combat.cc
combat.hh
coord.hh
+core.hh
default.permobjs
default.permons
display.hh
notify-local-tty.cc
objects.cc
objects.hh
+permobj.hh
+permon.hh
player.hh
pmon2.cc
pmon_comp
GAME:=victrix-abyssi
MAJVERS:=0
MINVERS:=9
-PATCHVERS:=0
+PATCHVERS:=1
COMMON_CFLAGS:=-Wall -Wwrite-strings -Wunreachable-code -Wformat -Werror=format-security -fstack-protector --param=ssp-buffer-size=4 -DMAJVERS=$(MAJVERS) -DMINVERS=$(MINVERS) -DPATCHVERS=$(PATCHVERS)-std=gnu11 -D_FORTIFY_SOURCE=2
COMMON_CXXFLAGS:=-Wall -Wwrite-strings -Wno-unused-but-set-variable -Wredundant-decls -Wunreachable-code -Wformat -Werror=format-security -fstack-protector --param=ssp-buffer-size=4 -DMAJVERS=$(MAJVERS) -DMINVERS=$(MINVERS) -DPATCHVERS=$(PATCHVERS) -std=gnu++11 -D_FORTIFY_SOURCE=2
PRODUCTION_CFLAGS:=$(COMMON_CFLAGS)
# file a bug report over this, I will close it NOTABUG; if you submit a
# patch to add such a dependency, I will reject it out of hand.
-permobj.o: permobj.cc victrix-abyssi.hh objects.hh pobj_id.hh pmon_id.hh
+permobj.o: permobj.cc core.hh permobj.hh pobj_id.hh
-permons.o: permons.cc victrix-abyssi.hh monsters.hh pobj_id.hh pmon_id.hh
+permons.o: permons.cc core.hh permon.hh pmon_id.hh
pmon2.o: pmon2.cc victrix-abyssi.hh notify.hh monsters.hh pobj_id.hh pmon_id.hh player.hh
#include "victrix-abyssi.hh"
#include "combat.hh"
#include "monsters.hh"
+#include "objects.hh"
Action_cost player_attack(Offset delta)
{
#include "victrix-abyssi.hh"
#endif
+#ifndef MONSTERS_HH
#include "monsters.hh"
+#endif
#define agility_modifier() (u.withering ? (u.agility / 10) : (u.agility / 5))
/* XXX combat.c data and funcs */
--- /dev/null
+/*! \file core.hh
+ * \brief Essential predefinitions header for Victrix Abyssi
+ */
+
+/* Copyright 2014 Martin Read
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef CORE_HH
+#define CORE_HH
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
+#include <stdlib.h>
+#include <stdint.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <arpa/inet.h>
+
+#ifndef COORD_HH
+#include "coord.hh"
+#endif
+
+#ifndef RNG_HH
+#include "rng.hh"
+#endif
+
+enum Comparison
+{
+ Lesser = -1,
+ Equal = 0,
+ Greater = 1
+};
+
+enum Pass_fail
+{
+ You_fail = -1,
+ You_pass = 0
+};
+
+enum Action_cost
+{
+ Cost_none = 0,
+ Cost_std = 1
+};
+
+enum Noisiness
+{
+ Noise_silent,
+ Noise_low,
+ Noise_std
+};
+
+#define is_vowel(ch) (((ch) == 'a') || ((ch) == 'e') || ((ch) == 'i') || ((ch) == 'o') || ((ch) == 'u'))
+
+/* XXX ENUMERATED TYPES XXX */
+
+/*! \brief Defines the displayable colour of things in the game.
+ *
+ * Game colours after Gcol_l_cyan may alias to a colour in the range l_grey
+ * through l_cyan depending on your display.
+ */
+enum Gamecolour
+{
+ /* l_cyan is the last "core" colour. Colours after it may alias to one
+ * of the core colours depending on the nature of your display. */
+ Gcol_l_grey, Gcol_d_grey, Gcol_red, Gcol_blue,
+ Gcol_green, Gcol_purple, Gcol_brown, Gcol_cyan,
+ Gcol_white, Gcol_l_red, Gcol_l_blue, Gcol_l_green,
+ Gcol_l_purple, Gcol_yellow, Gcol_l_cyan,
+ /* Fancy colours now! */
+ Gcol_iron, Gcol_gold, Gcol_silver,
+ /* UI customizable colours */
+ Gcol_prio_low, Gcol_prio_normal, Gcol_prio_alert, Gcol_prio_warn, Gcol_prio_bug
+};
+#define LAST_CORE_COLOUR Gcol_l_cyan
+#define LAST_FIXED_COLOUR Gcol_silver
+#define LAST_COLOUR Gcol_prio_bug
+
+/* XXX enum damtyp - types of damage. */
+enum Damtyp {
+ DT_PHYS = 0, DT_COLD, DT_FIRE, DT_NECRO,
+ DT_ELEC, DT_HELLFIRE, DT_POISON,
+ DT_KNOCKBACK, DT_DROWNING
+};
+#define DT_COUNT (1 + DT_DROWNING)
+
+/* XXX enum Game_cmd - player actions. */
+enum Game_cmd {
+ WALK, STAND_STILL, GO_DOWN_STAIRS, ATTACK,
+ GET_ITEM, DROP_ITEM,
+ WIELD_WEAPON, WEAR_ARMOUR, TAKE_OFF_ARMOUR, PUT_ON_RING, REMOVE_RING,
+ QUAFF_POTION, READ_SCROLL, THROW_FLASK, EAT_FOOD,
+ EMANATE_ARMOUR, ZAP_WEAPON, MAGIC_RING,
+ USE_ACTIVE_SKILL, ALLOCATE_SKILL_POINT,
+ SAVE_GAME, QUIT,
+ WIZARD_LEVELUP, WIZARD_DESCEND
+};
+
+/* XXX enum Death */
+/* Sadly, there are not 52 kinds of way to die. */
+enum Death {
+ DEATH_KILLED, DEATH_KILLED_MON, DEATH_BODY, DEATH_AGILITY,
+ DEATH_LASH, DEATH_RIBBONS
+};
+
+enum Fell_powers {
+ FePo_iron, // boosted by ironguard armour, hellglaive
+ FePo_decay, // boosted by foetid vestments,
+ FePo_bone, // boosted by lich's robe, vampire ring
+ FePo_flesh // boosted by t's lash or the ribbons,
+};
+
+#define TOTAL_FELL_POWERS (1 + FePo_flesh)
+
+#define RESIST_MASK_TEMPORARY 0x0000FFFFu
+#define RESIST_MASK_PERM_EQUIP 0xFFFF0000u
+#define RESIST_RING 0x00010000u
+#define RESIST_ARMOUR 0x00020000u
+
+/*! \brief Represent an in-game action in more detail than Game_cmd
+ */
+struct Action
+{
+ Game_cmd cmd;
+ uint32_t details[8];
+};
+
+
+class Permobj;
+class Permon;
+class Obj;
+class Mon;
+
+#define NO_POBJ (-1)
+#define NO_PMON (-1)
+#define NO_OBJ (-1)
+#define NO_MON (-1)
+#define NO_REGION 0xffffffffu
+
+#endif
+
+/* victrix-abyssi.hh */
+// vim:cindent:ts=8:sw=4:expandtab
-victrix-abyssi (0.9.0-1) UNRELEASED; urgency=low
+victrix-abyssi (0.9.1-1) UNRELEASED; urgency=low
* Initial release. (Closes: #XXXXXX)
- -- Martin Read <martin@blackswordsonics.com> Sat, 08 Feb 2014 15:43:32 +0000
+ -- Martin Read <martin@blackswordsonics.com> Sat, 10 Feb 2014 23:25:00 +0000
#define DISPLAY_NC_CC
#include "victrix-abyssi.hh"
#include "monsters.hh"
+#include "objects.hh"
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
void hide_inv(void);
void show_inv(void);
void update_inv(enum poclass_num filter);
+int inv_select(enum poclass_num filter, char const *action, int accept_blank);
WINDOW *status_window;
WINDOW *world_window;
WINDOW *message_window;
extern int display_shutdown(void);
extern void newsym(Coord c);
extern void touch_back_buffer(void);
-extern int inv_select(enum poclass_num filter, char const *action, int accept_blank);
extern void get_player_action(Action *act);
extern Pass_fail select_dir(Offset *pstep);
extern int getYN(char const *msg);
*/
#include "victrix-abyssi.hh"
+#include "objects.hh"
+#include "monsters.hh"
+#include "player.hh"
+#include "map.hh"
#include "util.h"
#include <stdio.h>
#include <stdlib.h>
#include "victrix-abyssi.hh"
#include "combat.hh"
+#include "objects.hh"
+#include "monsters.hh"
+#include "map.hh"
+#include "player.hh"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
*/
#include "victrix-abyssi.hh"
-#include "fov.hh"
+#include "objects.hh"
+#include "monsters.hh"
#include <string.h>
Level lvl;
#define MONSTERS_CC
#include "victrix-abyssi.hh"
#include "monsters.hh"
+#include "objects.hh"
Mon monsters[100];
static int reject_mon(int pm);
#ifndef MONSTERS_HH
#define MONSTERS_HH
-#ifndef VICTRIX_ABYSSI_HH
-#include "victrix-abyssi.hh"
+#ifndef CORE_HH
+#include "core.hh"
#endif
-/* XXX struct permon */
-#include "pmon_id.hh"
-
-#define PMF_RESIST_FIRE 0x00000001
-#define PMF_RESIST_COLD 0x00000002
-#define PMF_RESIST_ELEC 0x00000004
-#define PMF_RESIST_POIS 0x00000008
-#define PMF_RESIST_NECR 0x00000010
-#define PMF_RESIST_SLAM 0x00000020
-#define PMF_RESIST_DRWN 0x00000040
-#define PMF_UNDEAD 0x00010000
-#define PMF_DEMONIC 0x00020000
-#define PMF_MAGICIAN 0x00040000
-#define PMF_ARCHER 0x00080000
-#define PMF_SMART 0x00100000
-#define PMF_STUPID 0x00200000
-#define PMF_ETHEREAL 0x00400000
-#define PMF_FLYING 0x00800000
-
-#define PERMON_FLAG_FIELDS 1
-struct Permon {
- char const *name;
- char const *plural;
- char const *description;
- char sym;
- char const *unicode;
- int colour;
- int rarity; /* Chance in 100 of being thrown back and regen'd. */
- int power; /* Used to determine OOD rating. */
- /* All OOD-improved stats cap out at base + (power * base) */
- int hp; /* Improved by OOD rating at 1:1. */
- int mtohit; /* Improved by OOD rating at 1:3. */
- int rtohit; /* Improved by OOD rating at 1:3. */
- int mdam; /* Improved by OOD rating at 1:5. */
- int rdam; /* Improved by OOD rating at 1:5. */
- Damtyp rdtyp; /* type of damage used by ranged attack. */
- char const *shootverb; /* shooting verb e.g. "fires an arrow", "breathes". */
- int defence; /* Improved by OOD rating at 1:3. */
- int exp; /* Unaffected by OOD rating. */
- int speed; /* 0 = slow; 1 = normal; 2 = quick */
- uint32_t flags[PERMON_FLAG_FIELDS]; /* resistances, AI settings, etc. */
-};
-extern struct Permon permons[NUM_OF_PERMONS];
-
-#define NO_ATK (-1)
-#define NO_PMON (-1)
-
-enum AI_mode {
- AI_charger, AI_archer, AI_dodger, AI_drunk, AI_seeker, AI_chaser
-};
+#ifndef PERMON_HH
+#include "permon.hh"
+#endif
/* XXX struct mon */
#define MONSTERS_IN_PLAY 100
/* XXX mon2.c data and funcs */
extern void select_space(int *py, int *px, int dy, int dx, int selection_mode);
-/* XXX pmon2.c data and funcs */
-extern bool pmon_is_archer(int pm);
-extern bool pmon_is_magician(int pm);
-extern bool pmon_is_smart(int pm);
-extern bool pmon_is_stupid(int pm);
-extern bool pmon_is_undead(int pm);
-extern bool pmon_resists_cold(int pm);
-extern bool pmon_resists_fire(int pm);
-extern bool pmon_resists_poison(int pm);
-extern bool pmon_resists_necro(int pm);
-extern bool pmon_resists_elec(int pm);
-extern bool pmon_resists_drowning(int pm);
-extern bool pmon_can_fly(int pm);
-extern bool pmon_is_ethereal(int pm);
-extern bool pmon_resists_knockback(int pm);
-
#endif
-/* monsters.h */
+/* monsters.hh */
// vim:cindent:expandtab
#define NOTIFY_LOCAL_TTY_CC
#include "victrix-abyssi.hh"
#include "monsters.hh"
+#include "objects.hh"
+#include "player.hh"
+#include "map.hh"
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#define OBJECTS_CC
#include "victrix-abyssi.hh"
+#include "objects.hh"
#include "monsters.hh"
Obj objects[100];
#ifndef OBJECTS_HH
#define OBJECTS_HH
-/*! \brief Quality level of object.
- */
-enum Item_quality
-{
- Quality_bad, //!< Useless or hypothetically actively harmful
- Quality_normal, //!< Useful
- Quality_good,
- Quality_excellent,
- Quality_legendary
-};
-
-/* XXX enum poclass_num */
-/* Categories of permanent object. */
-enum poclass_num {
- POCLASS_NONE = 0, POCLASS_WEAPON, POCLASS_POTION,
- POCLASS_SCROLL, POCLASS_FLASK, POCLASS_ARMOUR, POCLASS_RING,
- POCLASS_FOOD, POCLASS_CARRION
-};
-
-#include "pobj_id.hh"
-
-#define POBJ_FLAG_WORDS 1
-
-// POF field 0
-#define POF_NOTIFY_EQUIP 0x00000001u // item has special messages when changing equip status
-#define POF_ACTIVATABLE 0x00000002u // item can be activated when equipped
-#define POF_STACKABLE 0x00000004u // item can stack
-#define POF_DAMAGEABLE 0x00000008u // track durability
-#define POF_BREAK_REACT 0x00000010u // item reacts to breakage attempts
-#define POF_DRESS 0x00010000u
-
-/*! \brief The 'permanent object' database */
-struct Permobj {
- char const *name; //!< English-language name of item
- char const *plural; //!< English-language plural of item
- char const *description; //!< English-language description of item
- enum poclass_num poclass; //!< Category of item
- int rarity; //!< Chance in 100 of being thrown away and regen'd.
- char sym; //!< must be in range 32...126
- char const *unicode; //!< must be a C-style string in UTF-8 encoding
- Gamecolour colour; //!< colour used for terminal display
- int power; //!< first POCLASS-specific data field
- int power2; //!< second POCLASS-specific data field
- int depth; //!< shallowest depth at which item can be randomly gen'd
- uint32_t flags[POBJ_FLAG_WORDS];
-};
-#define NO_POBJ (-1)
+#ifndef CORE_HH
+#include "core.hh"
+#endif
-extern Permobj permobjs[NUM_OF_PERMOBJS];
+#ifndef PERMOBJ_HH
+#include "permobj.hh"
+#endif
/* XXX Obj */
#define OBJ_MAX_DUR 100
extern int create_obj(int po_idx, int quantity, bool with_you, Coord c);
extern bool consume_obj(int obj);
extern int create_obj_class(enum poclass_num pocl, int quantity, bool with_you, Coord c);
+extern void damage_obj(int obj);
+extern int evasion_penalty(int obj);
extern Action_cost drop_obj(int inv_idx);
extern Action_cost put_on_ring(int obj);
extern Action_cost zap_weapon(void);
extern Action_cost player_unwield(Noisiness noisy = Noise_std);
extern Action_cost player_wield(int slot, Noisiness noisy = Noise_std);
+extern void attempt_pickup(void);
extern Pass_fail ring_removal_unsafe(Noisiness noisy = Noise_std);
extern Pass_fail armour_removal_unsafe(Noisiness noisy = Noise_std);
#endif
-/* objects.h */
+/* objects.hh */
// vim:cindent
--- /dev/null
+/*! \file permobj.hh
+ * \brief permobj-related header for Victrix Abyssi
+ */
+
+/* Copyright 2014 Martin Read
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PERMOBJ_HH
+#define PERMOBJ_HH
+
+#ifndef CORE_HH
+#include "core.hh"
+#endif
+
+#include "pobj_id.hh"
+
+/*! \brief Quality level of object.
+ */
+enum Item_quality
+{
+ Quality_bad, //!< Useless or hypothetically actively harmful
+ Quality_normal, //!< Useful
+ Quality_good,
+ Quality_excellent,
+ Quality_legendary
+};
+
+/* XXX enum poclass_num */
+/* Categories of permanent object. */
+enum poclass_num {
+ POCLASS_NONE = 0, POCLASS_WEAPON, POCLASS_POTION,
+ POCLASS_SCROLL, POCLASS_FLASK, POCLASS_ARMOUR, POCLASS_RING,
+ POCLASS_FOOD, POCLASS_CARRION
+};
+
+#include "pobj_id.hh"
+
+#define POBJ_FLAG_WORDS 1
+
+// POF field 0
+#define POF_NOTIFY_EQUIP 0x00000001u // item has special messages when changing equip status
+#define POF_ACTIVATABLE 0x00000002u // item can be activated when equipped
+#define POF_STACKABLE 0x00000004u // item can stack
+#define POF_DAMAGEABLE 0x00000008u // track durability
+#define POF_BREAK_REACT 0x00000010u // item reacts to breakage attempts
+#define POF_DRESS 0x00010000u
+
+/*! \brief The 'permanent object' database */
+struct Permobj {
+ char const *name; //!< English-language name of item
+ char const *plural; //!< English-language plural of item
+ char const *description; //!< English-language description of item
+ enum poclass_num poclass; //!< Category of item
+ int rarity; //!< Chance in 100 of being thrown away and regen'd.
+ char sym; //!< must be in range 32...126
+ char const *unicode; //!< must be a C-style string in UTF-8 encoding
+ Gamecolour colour; //!< colour used for terminal display
+ int power; //!< first POCLASS-specific data field
+ int power2; //!< second POCLASS-specific data field
+ int depth; //!< shallowest depth at which item can be randomly gen'd
+ uint32_t flags[POBJ_FLAG_WORDS];
+};
+#define NO_POBJ (-1)
+
+extern Permobj permobjs[NUM_OF_PERMOBJS];
+extern bool po_is_stackable(int po);
+
+#endif
+
+/* permobj.hh */
+// vim:cindent
+
--- /dev/null
+/*! \file permon.hh
+ * \brief permon-related header
+ */
+
+/* Copyright 2014 Martin Read
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PERMON_HH
+#define PERMON_HH
+
+#ifndef CORE_HH
+#include "core.hh"
+#endif
+
+/* XXX struct permon */
+#include "pmon_id.hh"
+
+#define PMF_RESIST_FIRE 0x00000001
+#define PMF_RESIST_COLD 0x00000002
+#define PMF_RESIST_ELEC 0x00000004
+#define PMF_RESIST_POIS 0x00000008
+#define PMF_RESIST_NECR 0x00000010
+#define PMF_RESIST_SLAM 0x00000020
+#define PMF_RESIST_DRWN 0x00000040
+#define PMF_UNDEAD 0x00010000
+#define PMF_DEMONIC 0x00020000
+#define PMF_MAGICIAN 0x00040000
+#define PMF_ARCHER 0x00080000
+#define PMF_SMART 0x00100000
+#define PMF_STUPID 0x00200000
+#define PMF_ETHEREAL 0x00400000
+#define PMF_FLYING 0x00800000
+
+#define PERMON_FLAG_FIELDS 1
+struct Permon {
+ char const *name;
+ char const *plural;
+ char const *description;
+ char sym;
+ char const *unicode;
+ int colour;
+ int rarity; /* Chance in 100 of being thrown back and regen'd. */
+ int power; /* Used to determine OOD rating. */
+ /* All OOD-improved stats cap out at base + (power * base) */
+ int hp; /* Improved by OOD rating at 1:1. */
+ int mtohit; /* Improved by OOD rating at 1:3. */
+ int rtohit; /* Improved by OOD rating at 1:3. */
+ int mdam; /* Improved by OOD rating at 1:5. */
+ int rdam; /* Improved by OOD rating at 1:5. */
+ Damtyp rdtyp; /* type of damage used by ranged attack. */
+ char const *shootverb; /* shooting verb e.g. "fires an arrow", "breathes". */
+ int defence; /* Improved by OOD rating at 1:3. */
+ int exp; /* Unaffected by OOD rating. */
+ int speed; /* 0 = slow; 1 = normal; 2 = quick */
+ uint32_t flags[PERMON_FLAG_FIELDS]; /* resistances, AI settings, etc. */
+};
+extern struct Permon permons[NUM_OF_PERMONS];
+
+#define NO_ATK (-1)
+#define NO_PMON (-1)
+
+enum AI_mode {
+ AI_charger, AI_archer, AI_dodger, AI_drunk, AI_seeker, AI_chaser
+};
+
+/* XXX pmon2.c data and funcs */
+extern bool pmon_is_archer(int pm);
+extern bool pmon_is_magician(int pm);
+extern bool pmon_is_smart(int pm);
+extern bool pmon_is_stupid(int pm);
+extern bool pmon_is_undead(int pm);
+extern bool pmon_resists_cold(int pm);
+extern bool pmon_resists_fire(int pm);
+extern bool pmon_resists_poison(int pm);
+extern bool pmon_resists_necro(int pm);
+extern bool pmon_resists_elec(int pm);
+extern bool pmon_resists_drowning(int pm);
+extern bool pmon_can_fly(int pm);
+extern bool pmon_is_ethereal(int pm);
+extern bool pmon_resists_knockback(int pm);
+
+#endif
+
+/* permon.hh */
+// vim:cindent:expandtab
{ return martial() || rotten() || thanatoic() || sybaritic(); }
};
+#define MIN_FOOD (-1950)
+#define SLOT_CANCEL (-1)
+#define SLOT_NOTHING (-2)
+
/* XXX u.c data and funcs */
extern void u_init(char const *name);
extern void write_char_dump(void);
open(HEADERFILE, ">", "pmon_id.hh") or die "pmon_comp: could not open pmon_id.hh for write: $!";
open(SOURCEFILE, ">", "permons.cc") or die "pmon_comp: could not open permons.cc for write: $!";
print HEADERFILE "// pmon_id.hh\n// This file is autogenerated from $input_fname\n// and is subject to the same copyright licensing terms as that file.\n// Do not edit this file directly; edit $input_fname\n// then use pmon_comp to regenerate this file and permons.cc\n#pragma once\nenum Pmon_id {\n";
-print SOURCEFILE "// permons.cc\n// This file is autogenerated from $input_fname\n// and is subject to the same copyright licensing terms as that file.\n// Do not edit this file directly; edit $input_fname then use pmon_comp to\n// regenreate this file and pmon_id.hh\n#include \"victrix-abyssi.hh\"\nPermon permons[NUM_OF_PERMONS] = {\n";
+print SOURCEFILE "// permons.cc\n// This file is autogenerated from $input_fname\n// and is subject to the same copyright licensing terms as that file.\n// Do not edit this file directly; edit $input_fname then use pmon_comp to\n// regenreate this file and pmon_id.hh\n#include \"core.hh\"\n#include \"permon.hh\"\nPermon permons[NUM_OF_PERMONS] = {\n";
my $phref;
my $i;
my $total_mons = 0;
open(HEADERFILE, ">", "pobj_id.hh") or die "pobj_comp: could not open pobj_id.hh for write: $!";
open(SOURCEFILE, ">", "permobj.cc") or die "pobj_comp: could not open permobj.cc for write: $!";
print HEADERFILE "// pobj_id.hh\n// This file is autogenerated from $input_fname\n// and is subject to the same copyright licensing terms as that file.\n// Do not edit this file directly; edit $input_fname\n// then use pobj_comp to regenerate this file and permobj.cc\n#pragma once\nenum Pobj_id {\n";
-print SOURCEFILE "// permobj.cc\n// This file is autogenerated from $input_fname\n// and is subject to the same copyright licensing terms as that file.\n// Do not edit this file directly; edit $input_fname then use pobj_comp to\n// regenreate this file and pobj_id.hh\n#include \"victrix-abyssi.hh\"\nPermobj permobjs[NUM_OF_PERMOBJS] = {\n";
+print SOURCEFILE "// permobj.cc\n// This file is autogenerated from $input_fname\n// and is subject to the same copyright licensing terms as that file.\n// Do not edit this file directly; edit $input_fname then use pobj_comp to\n// regenreate this file and pobj_id.hh\n#include \"core.hh\"\n#include \"permobj.hh\"\nPermobj permobjs[NUM_OF_PERMOBJS] = {\n";
my $phref;
my $i;
my $total_objs = 0;
#include "victrix-abyssi.hh"
#include "combat.hh"
+#include "objects.hh"
#include <limits.h>
#include <string.h>
#include <stdio.h>
#include <stdio.h>
#include <arpa/inet.h>
-#ifndef COORD_HH
-#include "coord.hh"
-#endif
-
-#ifndef RNG_HH
-#include "rng.hh"
-#endif
-
-#define ALPHA_LEVEL 1
-
-enum Comparison
-{
- Lesser = -1,
- Equal = 0,
- Greater = 1
-};
-
-enum Pass_fail
-{
- You_fail = -1,
- You_pass = 0
-};
-
-enum Action_cost
-{
- Cost_none = 0,
- Cost_std = 1
-};
-
-enum Noisiness
-{
- Noise_silent,
- Noise_low,
- Noise_std
-};
-
+#include "core.hh"
/* change WIZARD_MODE to 1 if you want the wizard mode commands. */
#define WIZARD_MODE 0
-#define is_vowel(ch) (((ch) == 'a') || ((ch) == 'e') || ((ch) == 'i') || ((ch) == 'o') || ((ch) == 'u'))
-
-/* XXX ENUMERATED TYPES XXX */
-
-/*! \brief Defines the displayable colour of things in the game.
- *
- * Game colours after Gcol_l_cyan may alias to a colour in the range l_grey
- * through l_cyan depending on your display.
- */
-enum Gamecolour
-{
- /* l_cyan is the last "core" colour. Colours after it may alias to one
- * of the core colours depending on the nature of your display. */
- Gcol_l_grey, Gcol_d_grey, Gcol_red, Gcol_blue,
- Gcol_green, Gcol_purple, Gcol_brown, Gcol_cyan,
- Gcol_white, Gcol_l_red, Gcol_l_blue, Gcol_l_green,
- Gcol_l_purple, Gcol_yellow, Gcol_l_cyan,
- /* Fancy colours now! */
- Gcol_iron, Gcol_gold, Gcol_silver,
- /* UI customizable colours */
- Gcol_prio_low, Gcol_prio_normal, Gcol_prio_alert, Gcol_prio_warn, Gcol_prio_bug
-};
-#define LAST_CORE_COLOUR Gcol_l_cyan
-#define LAST_FIXED_COLOUR Gcol_silver
-#define LAST_COLOUR Gcol_prio_bug
-
-/* XXX enum damtyp - types of damage. */
-enum Damtyp {
- DT_PHYS = 0, DT_COLD, DT_FIRE, DT_NECRO,
- DT_ELEC, DT_HELLFIRE, DT_POISON,
- DT_KNOCKBACK, DT_DROWNING
-};
-#define DT_COUNT (1 + DT_DROWNING)
-
-/* XXX enum Game_cmd - player actions. */
-enum Game_cmd {
- WALK, STAND_STILL, GO_DOWN_STAIRS, ATTACK,
- GET_ITEM, DROP_ITEM,
- WIELD_WEAPON, WEAR_ARMOUR, TAKE_OFF_ARMOUR, PUT_ON_RING, REMOVE_RING,
- QUAFF_POTION, READ_SCROLL, THROW_FLASK, EAT_FOOD,
- EMANATE_ARMOUR, ZAP_WEAPON, MAGIC_RING,
- USE_ACTIVE_SKILL, ALLOCATE_SKILL_POINT,
- SAVE_GAME, QUIT,
- WIZARD_LEVELUP, WIZARD_DESCEND
-};
-
-/* XXX enum Death */
-/* Sadly, there are not 52 kinds of way to die. */
-enum Death {
- DEATH_KILLED, DEATH_KILLED_MON, DEATH_BODY, DEATH_AGILITY,
- DEATH_LASH, DEATH_RIBBONS
-};
-
-enum Fell_powers {
- FePo_iron, // boosted by ironguard armour, hellglaive
- FePo_decay, // boosted by foetid vestments,
- FePo_bone, // boosted by lich's robe, vampire ring
- FePo_flesh // boosted by t's lash or the ribbons,
-};
-
-#define TOTAL_FELL_POWERS (1 + FePo_flesh)
-
-#define RESIST_MASK_TEMPORARY 0x0000FFFFu
-#define RESIST_MASK_PERM_EQUIP 0xFFFF0000u
-#define RESIST_RING 0x00010000u
-#define RESIST_ARMOUR 0x00020000u
-/* XXX STRUCTURES XXX */
-
#ifndef PLAYER_HH
#include "player.hh"
#endif
-/*! \brief Represent an in-game action in more detail than Game_cmd
- */
-struct Action
-{
- Game_cmd cmd;
- uint32_t details[8];
-};
-
-#define MIN_FOOD (-1950)
-#define SLOT_CANCEL (-1)
-#define SLOT_NOTHING (-2)
-
#ifndef MONSTERS_HH
#include "monsters.hh"
#endif
-#ifndef OBJECTS_HH
-#include "objects.hh"
-#endif
-
#ifndef DISPLAY_HH
#include "display.hh"
#endif
/* XXX misc.c data and funcs */
extern char const *damtype_names[DT_COUNT];
-extern void attempt_pickup(void);
-extern bool po_is_stackable(int po);
-extern void damage_obj(int obj);
-extern int evasion_penalty(int obj);
-
/* XXX log.cc */
extern void log_death(Death d, char const *what);
extern void load_config(void);