GAME:=victrix-abyssi
MAJVERS:=1
MINVERS:=0
-PRODUCTION_CFLAGS:=-std=gnu99 -c -Wall -Wstrict-prototypes -Wwrite-strings -Wmissing-prototypes -Wno-unused-but-set-variable -Wredundant-decls -Wunreachable-code -DMAJVERS=$(MAJVERS) -DMINVERS=$(MINVERS)
-DEVELOPMENT_CFLAGS:=-std=gnu99 -c -g -Wall -Wstrict-prototypes -Wwrite-strings -Wmissing-prototypes -Wno-unused-but-set-variable -Wredundant-decls -Wunreachable-code -Werror -DMAJVERS=$(MAJVERS) -DMINVERS=$(MINVERS)
-CFLAGS=$(PRODUCTION_CFLAGS)
+PRODUCTION_CXXFLAGS:=-c -Wall -Wwrite-strings -Wno-unused-but-set-variable -Wredundant-decls -Wunreachable-code -DMAJVERS=$(MAJVERS) -DMINVERS=$(MINVERS)
+DEVELOPMENT_CXXFLAGS:=-c -g -Wall -Wwrite-strings -Wno-unused-but-set-variable -Wredundant-decls -Wunreachable-code -Werror -DMAJVERS=$(MAJVERS) -DMINVERS=$(MINVERS)
LINKFLAGS=-lm -lpanelw -lncursesw -g
ARCHIVEDIR:=victrix-abyssi_$(MAJVERS).$(MINVERS)
+.cc.o:
+ $(CXX) $(DEVELOPMENT_CXXFLAGS) $(CXXFLAGS) $< -o $@
+
all: $(GAME)
$(GAME): $(OBJS)
- $(CC) $(OBJS) $(LINKFLAGS) -o $(GAME)
+ $(CXX) $(OBJS) $(LINKFLAGS) -o $(GAME)
archive: clean
mkdir $(ARCHIVEDIR)
clean:
-rm -f *.o $(GAME) victrix-abyssi.log victrix-abyssi.sav.gz *.tgz
-display-nc.o: display-nc.c victrix-abyssi.h
+display-nc.o: display-nc.cc victrix-abyssi.hh
-main.o: main.c combat.h victrix-abyssi.h monsters.h
+main.o: main.cc combat.hh victrix-abyssi.hh monsters.hh
-combat.o: combat.c combat.h victrix-abyssi.h
+combat.o: combat.cc combat.hh victrix-abyssi.hh
-u.o: u.c combat.h victrix-abyssi.h
+u.o: u.cc combat.hh victrix-abyssi.hh
-permobj.o: permobj.c victrix-abyssi.h
+permobj.o: permobj.cc victrix-abyssi.hh
-map.o: map.c victrix-abyssi.h
+map.o: map.cc victrix-abyssi.hh
-permons.o: permons.c victrix-abyssi.h
+permons.o: permons.cc victrix-abyssi.hh
-pmon2.o: pmon2.c victrix-abyssi.h monsters.h
+pmon2.o: pmon2.cc victrix-abyssi.hh monsters.hh
-objects.o: objects.c victrix-abyssi.h
+objects.o: objects.cc victrix-abyssi.hh
-monsters.o: monsters.c victrix-abyssi.h monsters.h
+monsters.o: monsters.cc victrix-abyssi.hh monsters.hh
-mon2.o: mon2.c victrix-abyssi.h sorcery.h monsters.h
+mon2.o: mon2.cc victrix-abyssi.hh sorcery.hh monsters.hh
-vector.o: vector.c victrix-abyssi.h
+vector.o: vector.cc victrix-abyssi.hh
-sorcery.o: sorcery.c victrix-abyssi.h sorcery.h
+sorcery.o: sorcery.cc victrix-abyssi.hh sorcery.hh
-# vim:ts=8:sw=8:noexpandtab
+# vim:ts=8:sts=8:sw=8:noexpandtab
-/*! \file combat.c
+/*! \file combat.cc
* \brief combat mechanics
*/
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "victrix-abyssi.h"
-#include "combat.h"
-#include "monsters.h"
+#include "victrix-abyssi.hh"
+#include "combat.hh"
+#include "monsters.hh"
int player_attack(int dy, int dx)
{
-/* combat.h
- *
- * Copyright 2005-2012 Martin Read
+/* \file combat.hh
+ * \brief Combat functions header
+ */
+
+/* Copyright 2005-2012 Martin Read
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef COMBAT_H
-#define COMBAT_H
+#ifndef COMBAT_HH
+#define COMBAT_HH
-#ifndef VICTRIX_ABYSSI_H
-#include "victrix-abyssi.h"
+#ifndef VICTRIX_ABYSSI_HH
+#include "victrix-abyssi.hh"
#endif
-#include "monsters.h"
+#include "monsters.hh"
#define agility_modifier() (u.withering ? (u.agility / 10) : (u.agility / 5))
/* XXX combat.c data and funcs */
-/*! \file display-nc.c
+/*! \file display-nc.cc
* \brief ncurses display support
*/
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#define DISPLAY_NC_C
-#include "victrix-abyssi.h"
-#include "monsters.h"
+#define DISPLAY_NC_CC
+#include "victrix-abyssi.hh"
+#include "monsters.hh"
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
enum game_cmd get_command(void)
{
int ch;
- int done = 0;
- while (!done)
+ while (1)
{
ch = wgetch(message_window);
if (!panel_hidden(inventory_panel))
return WIZARD_LEVELUP;
}
}
- return 0;
+ return QUIT;
}
int display_shutdown(void)
-/*! \file display.h
+/*! \file display.hh
* \brief Display-related definitions for Victrix Abyssi
*/
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef DISPLAY_H
-#define DISPLAY_H
+#ifndef DISPLAY_HH
+#define DISPLAY_HH
#define DBCLR_L_GREY 0
#define DBCLR_D_GREY 1
-/*! \file fov.c
+/*! \file fov.cc
* \brief field-of-view computation (recursive shadowcasting)
*
* A recursive shadowcasting implementation using diamond (rather than whole-
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "victrix-abyssi.h"
-#include "fov.h"
+#include "victrix-abyssi.hh"
+#include "fov.hh"
#include <string.h>
#include <math.h>
-/*! \file fov.h
+/*! \file fov.hh
* \brief field-of-view header
*/
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef FOV_H
-#define FOV_H
+#ifndef FOV_HH
+#define FOV_HH
#define MAX_FOV_RADIUS 10
-/* \file main.c
+/* \file main.cc
* \brief main core of Victrix Abyssi
*/
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "victrix-abyssi.h"
-#include "combat.h"
+#include "victrix-abyssi.hh"
+#include "combat.hh"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-/*! \file map.c
+/*! \file map.cc
* \brief Map generation and population
*/
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "victrix-abyssi.h"
-#include "fov.h"
+#include "victrix-abyssi.hh"
+#include "fov.hh"
#include <string.h>
int mapobject[DUN_HEIGHT][DUN_WIDTH];
{
if (terrain[y][x] == overwrite[j])
{
- terrain[y][x] = newterr;
+ terrain[y][x] = (terrain_num) newterr;
return 1;
}
}
-/*! \file map.h
+/*! \file map.hh
* \brief Map-related header
*/
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef MAP_H
-#define MAP_H
+#ifndef MAP_HH
+#define MAP_HH
-#ifndef VICTRIX_ABYSSI_H
-#include "victrix-abyssi.h"
+#ifndef VICTRIX_ABYSSI_HH
+#include "victrix-abyssi.hh"
#endif
/* XXX enum terrain_num */
-/* \file misc.c
+/* \file misc.cc
* \brief Stuff.
*/
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "victrix-abyssi.h"
+#include "victrix-abyssi.hh"
const char *damtype_names[DT_COUNT] = {
- [DT_PHYS] = "physical damage",
- [DT_FIRE] = "fire",
- [DT_COLD] = "cold",
- [DT_ELEC] = "electricity",
- [DT_NECRO] = "necromantic force",
- [DT_POISON] = "poison",
+ "physical damage",
+ "fire",
+ "cold",
+ "electricity",
+ "necromantic force",
+ "poison",
};
/* main.c */
-/* \file mon2.c
+/* \file mon2.cc
* \brief More monster functions
*/
*/
/* TODO: Convert missile AI to a new-style AI function. */
-#define MON2_C
-#include "victrix-abyssi.h"
-#include "sorcery.h"
-#include "monsters.h"
-#include "combat.h"
+#define MON2_CC
+#include "victrix-abyssi.hh"
+#include "sorcery.hh"
+#include "monsters.hh"
+#include "combat.hh"
/* AI map cell descriptor. */
struct ai_cell {
-/*! \file monsters.c
+/*! \file monsters.cc
* \brief Monster-related functions
*/
-/* Copyright 2005-2012 Martin Read
+/* Copyright 2005-2013 Martin Read
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#define MONSTERS_C
-#include "victrix-abyssi.h"
-#include "monsters.h"
+#define MONSTERS_CC
+#include "victrix-abyssi.hh"
+#include "monsters.hh"
struct mon monsters[100];
static int reject_mon(int pm);
-/*! \file monsters.h
+/*! \file monsters.hh
* \brief Monster-related header
*/
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef MONSTERS_H
-#define MONSTERS_H
+#ifndef MONSTERS_HH
+#define MONSTERS_HH
-#ifndef VICTRIX_ABYSSI_H
-#include "victrix-abyssi.h"
+#ifndef VICTRIX_ABYSSI_HH
+#include "victrix-abyssi.hh"
#endif
/* XXX struct permon */
-/* objects.c
- *
- * Copyright 2005-2012 Martin Read
+/* \file objects.cc
+ * \brief Object handling for Victrix Abyssi
+ */
+
+/* Copyright 2005-2013 Martin Read
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#define OBJECTS_C
-#include "victrix-abyssi.h"
-#include "monsters.h"
+#define OBJECTS_CC
+#include "victrix-abyssi.hh"
+#include "monsters.hh"
struct obj objects[100];
int get_random_pobj(void);
-/*! \file objects.h
+/*! \file objects.hh
* \brief object-related header for Victrix Abyssi
*/
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef OBJECTS_H
-#define OBJECTS_H
+#ifndef OBJECTS_HH
+#define OBJECTS_HH
/* XXX enum poclass_num */
/* Categories of permanent object. */
-/* permobj.c
- *
- * Copyright 2005-2012 Martin Read
+/* \file permobj.cc
+ * \brief object database for Victrix Abyssi
+ */
+/* Copyright 2005-2012 Martin Read
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#define PERMOBJ_C
-#include "victrix-abyssi.h"
+#define PERMOBJ_CC
+#include "victrix-abyssi.hh"
struct permobj permobjs[NUM_OF_PERMOBJS] = {
- [PO_DAGGER] =
{
"dagger", "daggers", "A long knife, designed for stabbing.", POCLASS_WEAPON, 25, ')', 4, 1, 1
},
- [PO_LONG_SWORD] =
{
"long sword", "long swords", "A steel sword of simple but sturdy construction; the\nblade is three feet long.", POCLASS_WEAPON, 30, ')', 10, 1, 4
},
- [PO_MACE] =
{
"mace", "maces", "A flanged lump of iron on an iron haft.", POCLASS_WEAPON, 30, ')', 7, 1, 2
},
- [PO_RUNESWORD] =
{
"runesword", "runeswords", "An eerily glowing sword engraved with many strange\nrunes.", POCLASS_WEAPON, 80, ')', 20, 1, 12
},
- [PO_BOW] =
{
"bow", "bows", "A recurve composite bow.", POCLASS_WEAPON, 45, '(', 8, 1, 1
},
- [PO_CROSSBOW] =
{
"crossbow", "crossbows", "A crossbow.", POCLASS_WEAPON, 70, '(', 16, 1, 6
},
- [PO_THUNDERBOW] =
{
"thunderbow", "thunderbows", "A recurve composite bow decorated with eldritch signs.\nArrows fired with this bow strike with staggering force.", POCLASS_WEAPON, 70, '(', 16, 1, 30
},
- [PO_TORMENTORS_LASH] =
{
"tormentor's lash", "tormentor's lash", "A bone-handled whip that crackles with malefic energies.", POCLASS_WEAPON, 80, ')', 20, 1, 30
},
- [PO_STAFF_OF_FIRE] =
{
"staff of fire", "staff of fire", "A jet-black staff with a glowing ruby in its headpiece.", POCLASS_WEAPON, 80, ')', 10, 1, 20
},
- [PO_POT_HEAL] =
{
"healing potion", "healing potions", "This magic elixir restores some lost hit points.", POCLASS_POTION, 10, '!', 0, 1, 1
},
- [PO_POT_BODY] =
{
"body potion", "body potions", "This magic elixir will improve your physique.", POCLASS_POTION, 70, '!', 0, 1, 5
},
- [PO_POT_AGILITY] =
{
"agility potion", "agility potions", "This magic elixir will sharpen your reflexes.", POCLASS_POTION, 70, '!', 0, 1, 5
},
- [PO_POT_RESTORATION] =
{
"restoration potion", "restoration potions", "This magic elixir cures temporary damage to one's\nabilities.", POCLASS_POTION, 70, '!', 0, 1, 1
},
- [PO_FLASK_POISON] =
{
"poison flask", "poison flask", "This fragile bottle is full of contact poison.", POCLASS_FLASK, 10, '~', 0, 1, 1
},
- [PO_FLASK_FIRE] =
{
"fire flask", "fire flasks", "The volatile, phosphorus-laced liquid in this sealed\nflask will ignite spontaneously when exposed to the air.", POCLASS_FLASK, 40, '~', 0, 1, 20
},
- [PO_FLASK_WEAKNESS] =
{
"weakness flask", "weakness flasks", "Dousing the living in this vile liquid causes immediate\nand severe physical degeneration.", POCLASS_FLASK, 40, '~', 0, 1, 20
},
- [PO_SCR_TELEPORT] =
{
"teleport scroll", "teleport scrolls", "Reading this scroll will teleport you to a random\nlocation.", POCLASS_SCROLL, 40, '?', 0, 1, 1
},
- [PO_SCR_FIRE] =
{
"fire scroll", "fire scrolls", "Reading this scroll will engulf all nearby creatures\n(including you) in flames.", POCLASS_SCROLL, 30, '?', 0, 1, 1
},
- [PO_SCR_PROTECTION] =
{
"protection scroll", "protection scrolls", "Reading this scroll will dispel any curses afflicting\nyou and protect you from curses for a time.", POCLASS_SCROLL, 80, '?', 0, 1, 8
},
- [PO_LEATHER_ARMOUR] =
{
"leather armour", "suits of leather armour", "A heavy leather jerkin and breeches, providing some\nprotection.", POCLASS_ARMOUR, 25, '[', 3, 1, 1
},
- [PO_CHAINMAIL] =
{
"chainmail", "suits of chainmail", "A suit of interlocking metal rings, providing better\nprotection than leather.", POCLASS_ARMOUR, 30, '[', 6, 1, 3
},
- [PO_PLATE_ARMOUR] =
{
"plate armour", "suits of plate armour", "A suit of steel plates, providing better protection than\nchainmail.", POCLASS_ARMOUR, 40, '[', 10, 1, 6
},
- [PO_MAGE_ARMOUR] =
{
"mage armour", "suits of mage armour", "A suit of glowing steel plates bearing enchantments of\ndefence.", POCLASS_ARMOUR, 70, '[', 15, 1, 12
},
- [PO_ROBE] =
{
"mundane robe", "mundane robes", "A simple woolen robe. It's better protection than your\nskin, but not by much.", POCLASS_ARMOUR, 50, '[', 2, 1, 1
},
- [PO_ROBE_SWIFTNESS] =
{
"robe of swiftness", "robes of swiftness", "A simple woolen robe that bears a potent enchantment,\nprotecting the wearer and making him unnaturally swift.", POCLASS_ARMOUR, 70, '[', 8, 1, 8
},
- [PO_ROBE_SHADOWS] =
{
"robe of shadows", "robes of shadows", "A simple woolen robe that bears an awesome enchantment,\nprotecting the wearer better than steel plate.", POCLASS_ARMOUR, 90, '[', 14, 1, 18
},
- [PO_DRAGON_ARMOUR] =
{
"dragonhide armour", "suits of dragonhide armour", "The skin of a dragon, formed into a jerkin and breeches;\nit turns blows like steel plate and turns away\nflames.", POCLASS_ARMOUR, 90, '[', 12, 1, 21
},
- [PO_METEOR_ARMOUR] =
{
"meteoric plate armour", "suits of meteoric plate armour", "This plate armour has been forged out of metal taken from\na fallen star.", POCLASS_ARMOUR, 90, '[', 18, 1, 27
},
- [PO_SACRED_MAIL] =
{
"sacred chainmail", "suits of sacred chainmail", "This suit of interlocking rings has been consecrated to\nthe gods of the Light.", POCLASS_ARMOUR, 90, '[', 15, 1, 24
},
- [PO_RAGGED_SHIFT] =
{
"ragged shift", "ragged shifts", "This sorry-looking collection of rags is all that remains\nof a battle ballgown.", POCLASS_ARMOUR, 100, '[', 1, 0, 1
},
- [PO_BATTLE_BALLGOWN] =
{
"battle ballgown", "battle ballgowns", "Partially armoured dresses such as this are a\ntraditional part of a princess's wardrobe.", POCLASS_ARMOUR, 95, '[', 3, 1, 1
},
- [PO_IMPERATRIX_GOWN] =
{
"imperatrix gown", "imperatrix gowns", "This armoured, enchanted, and elaborately decorated dress\nwould be worthy of an empress regnant.", POCLASS_ARMOUR, 95, '[', 15, 1, 24
},
- [PO_RIBBONS] =
{
/* inspired by DoomRL's Necroarmor and my own creepiness. */
"set of ribbons", "sets of ribbons", "These ribbons, arranged as if to form an alleged\ngarment, make your fingers tingle with magic.", POCLASS_ARMOUR, 90, '[', 15, 1, 30
},
- [PO_RING_REGEN] =
{
"regeneration ring", "regeneration rings", "This magical ring increases the wearer's healing rate,\nbut also increases the rate at which they must consume\nfood.", POCLASS_RING, 70, '=', 0, 1, 1
},
- [PO_RING_FIRE] =
{
"fire ring", "fire rings", "This magical ring protects the wearer from mundane and\nmagical fire, and imbues their blows in combat with the\npower of fire.", POCLASS_RING, 50, '=', 0, 1, 1
},
- [PO_RING_VAMPIRE] =
{
"vampire ring", "vampire rings", "This magical ring protects the wearer from necromantic\nenergies, and imbues their blows in combat with such\nenergies as well.", POCLASS_RING, 90, '=', 0, 1, 12
},
- [PO_RING_FROST] =
{
"frost ring", "frost rings", "This magical ring protects the wearer from mundane and\nmagical cold, and imbues their blows in combat with the\npower of cold. Rumour suggests it might also allow walking\non water.\n", POCLASS_RING, 40, '=', 0, 1, 1
},
- [PO_RING_TELEPORT] =
{
"teleport ring", "teleport rings", "This magical ring allows the wearer to teleport for a\nmodest cost in nutrition.", POCLASS_RING, 70, '=', 0, 1, 1
},
- [PO_IRON_RATION] =
{
"iron ration", "iron rations", "A parcel of hardtack and beef jerky. Dull but nutritious.", POCLASS_FOOD, 75, '%', 0, 1, 1
},
- [PO_DRIED_FRUIT] =
{
"parcel of dried fruit", "parcels of dried fruit", "A parcel of mixed dried fruit. It sure beats hardtack\nand beef jerky.", POCLASS_FOOD, 75, '%', 0, 1, 1
},
- [PO_ELVEN_BREAD] =
{
"round of elven waybread", "rounds of elven waybread", "A tasty, filling, nutritious piece of elven waybread.", POCLASS_FOOD, 85, '%', 0, 1, 1
},
- [PO_DEVIL_SPLEEN] =
{
"devil spleen", "devil spleens", "A weirdly pulsing organ ripped from the torso of a devil.", POCLASS_FOOD, 100, '%', 0, 1, 1
}
-/*! \file permons.c
+/*! \file permons.cc
* \brief monster database for Victrix Abyssi
*/
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#define PERMONS_C
-#include "victrix-abyssi.h"
+#define PERMONS_CC
+#include "victrix-abyssi.hh"
/*! \brief Array housing the monster database.
*/
struct permon permons[NUM_OF_PERMONS] = {
- [PM_NEWT] =
{
"newt", "newts", 'n', DBCLR_RED, 20, 1, 3, 0, -1, 2, -1, DT_PHYS, "", 1, 1, 0, PMF_STUPID
},
- [PM_RAT] =
{
"rat", "rats", 'r', DBCLR_BROWN, 15, 1, 4, 0, -1, 2, -1, DT_PHYS, "", 4, 2, 2, PMF_STUPID
},
- [PM_WOLF] =
{
"wolf", "wolves", 'c', DBCLR_BROWN, 30, 6, 20, 8, -1, 10, -1, DT_PHYS, "", 6, 15, 2, 0
},
- [PM_SNAKE] =
{
/* Saps one Body on a really good hit */
"snake", "snakes", 's', DBCLR_RED, 20, 6, 15, 10, -1, 3, -1, DT_PHYS, "", 9, 40, 2, PMF_STUPID
},
- [PM_THUG] =
{
/* may drop a mace or leather armour */
"thug", "thugs", 't', DBCLR_BROWN, 30, 1, 8, 5, -1, 5, -1, DT_PHYS, "", 4, 5, 1, 0
},
- [PM_GOON] =
{
"goon", "goons", 't', DBCLR_YELLOW, 20, 3, 15, 6, -1, 7, -1, DT_PHYS, "", 8, 10, 1, 0
},
- [PM_HUNTER] =
{
/* Has a ranged attack - arrows */
"hunter", "hunters", 'h', DBCLR_GREEN, 30, 9, 40, 6, 20, 6, 10, DT_PHYS, "shoots an arrow", 10, 50, 1, PMF_ARCHER
},
- [PM_DUELLIST] =
{
"duellist", "duellists", 'f', DBCLR_RED, 40, 12, 60, 30, -1, 15, -1, DT_PHYS, "", 15, 130, 1, PMF_SMART
},
- [PM_WARLORD] =
{
"warlord", "warlords", 'f', DBCLR_L_RED, 30, 15, 80, 25, -1, 20, -1, DT_PHYS, "", 20, 400, 2, PMF_SMART
},
- [PM_GOBLIN] =
{
/* may drop a dagger */
"goblin", "goblins", 'g', DBCLR_BROWN, 20, 1, 6, 1, -1, 3, -1, DT_PHYS, "", 3, 3, 1, 0
},
- [PM_BAD_ELF] =
{
"bad elf", "bad elves", 'e', DBCLR_L_GREY, 40, 3, 15, 10, -1, 6, -1, DT_PHYS, "", 8, 15, 2, PMF_SMART
},
- [PM_TROLL] =
{
"troll", "trolls", 'T', DBCLR_GREEN, 20, 12, 80, 15, -1, 15, -1, DT_PHYS, "", 13, 150, 1, PMF_STUPID
},
- [PM_GIANT] =
{
"giant", "giants", 'H', DBCLR_BROWN, 20, 21, 80, 15, -1, 25, -1, DT_PHYS, "", 20, 500, 1, PMF_STUPID
},
- [PM_GIANT_JARL] =
{
"giant jarl", "giant jarls", 'H', DBCLR_L_GREY, 80, 25, 160, 20, -1, 30, -1, DT_PHYS, "", 22, 1000, 1, 0
},
- [PM_WIZARD] =
{
/* Uses sorcery against you; see sorcery.c for details. */
"wizard", "wizards", 'w', DBCLR_BLUE, 80, 12, 40, 10, 20, 10, 10, DT_ELEC, "casts", 15, 200, 1, PMF_SMART | PMF_MAGICIAN
},
- [PM_ARCHMAGE] =
{
/* Uses sorcery against you; see sorcery.c for details. */
"archmage", "archmagi", 'w', DBCLR_L_BLUE, 80, 24, 80, 15, 30, 15, 15, DT_ELEC, "casts", 15, 1500, 1, PMF_SMART | PMF_MAGICIAN | PMF_RESIST_ELEC
},
- [PM_ZOMBIE] =
{
"zombie", "zombies", 'z', DBCLR_L_GREY, 25, 3, 30, 2, -1, 20, -1, DT_PHYS, "", 1, 7, 0, PMF_STUPID | PMF_UNDEAD | PMF_RESIST_COLD | PMF_RESIST_POIS | PMF_RESIST_NECR
},
- [PM_WRAITH] =
{
"wraith", "wraiths", 'W', DBCLR_WHITE, 25, 12, 40, 25, -1, 5, -1, DT_PHYS, "", 5, 100, 0, PMF_SMART | PMF_UNDEAD | PMF_RESIST_COLD | PMF_RESIST_POIS | PMF_RESIST_NECR
},
- [PM_LICH] =
{
/* Uses sorcery against you; see sorcery.c for details. */
"lich", "liches", 'L', DBCLR_L_GREY, 70, 15, 70, 15, 25, 15, 15, DT_NECRO, "casts", 15, 250, 1, PMF_SMART | PMF_UNDEAD | PMF_RESIST_COLD | PMF_MAGICIAN | PMF_RESIST_POIS | PMF_RESIST_NECR
},
- [PM_MASTER_LICH] =
{
/* Master liches use sorcery against you, more powerfully
* than lesser practitioners. */
"master lich", "master liches", 'L', DBCLR_PURPLE, 60, 30, 150, 30, 30, 20, 30, DT_NECRO, "", 30, 3000, 1, PMF_SMART | PMF_UNDEAD | PMF_RESIST_COLD | PMF_MAGICIAN | PMF_RESIST_POIS | PMF_RESIST_NECR
},
- [PM_VAMPIRE] =
{
/* Vampires heal by hitting you. */
"vampire", "vampires", 'V', DBCLR_RED, 55, 18, 70, 25, -1, 15, -1, DT_PHYS, "", 22, 750, 1, PMF_SMART | PMF_UNDEAD | PMF_RESIST_COLD | PMF_RESIST_POIS | PMF_RESIST_NECR
},
- [PM_DEMON] =
{
/* Demons summon more demons if you don't kill them
* quickly. */
"demon", "demons", '&', DBCLR_RED, 60, 18, 40, 25, -1, 20, -1, DT_PHYS, "", 15, 500, 1, PMF_SMART | PMF_DEMONIC | PMF_RESIST_FIRE
},
- [PM_DEFILER] =
{
/* Defilers use sorcery (mostly curses) against you. */
"defiler", "defilers", '&', DBCLR_L_GREEN, 65, 27, 120, 30, 30, 20, 30, DT_FIRE, "", 25, 2000, 1, PMF_SMART | PMF_DEMONIC | PMF_RESIST_FIRE | PMF_MAGICIAN | PMF_RESIST_POIS
},
- [PM_CENTAUR] =
{
"centaur", "centaurs", 'C', DBCLR_BROWN, 30, 9, 40, 15, -1, 10, -1, DT_PHYS, "", 10, 50, 2, 0
},
- [PM_ICE_MONSTER] =
{
/* Fires ice blasts. */
"ice monster", "ice monsters", 'I', DBCLR_WHITE, 50, 6, 40, 10, 20, 15, 15, DT_COLD, "launches a blast of", 10, 35, 0, PMF_RESIST_COLD | PMF_ARCHER
},
- [PM_DRAGON] =
{
/* Breathes fire. */
"dragon", "dragons", 'D', DBCLR_RED, 50, 15, 80, 20, 20, 20, 20, DT_FIRE, "breathes", 18, 300, 1, PMF_RESIST_FIRE | PMF_ARCHER
},
- [PM_MOONDRAKE] =
{
/* Breathes eldritchness represented as cold. I should work on that. */
"moondrake", "moondrakes", 'D', DBCLR_L_CYAN, 50, 15, 80, 20, 20, 20, 20, DT_COLD, "breathes", 24, 500, 1, PMF_RESIST_FIRE | PMF_RESIST_COLD | PMF_RESIST_NECR | PMF_ARCHER
-/*! \file pmon2.c
+/*! \file pmon2.cc
* \brief permons flag-check functions
*/
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#define PMON2_C
-#include "victrix-abyssi.h"
-#include "monsters.h"
+#define PMON2_CC
+#include "victrix-abyssi.hh"
+#include "monsters.hh"
bool pmon_resists_fire(int pm)
{
-/* rng.c
- *
- * Copyright 2005-2012 Martin Read
+/* \file rng.cc
+ * \brief xorshift PRNG
+ */
+
+/* Copyright 2005-2012 Martin Read
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
*/
-#include "victrix-abyssi.h"
+#include "victrix-abyssi.hh"
#include <time.h>
#include <unistd.h>
#include <stdint.h>
-/*! \file sorcery.c
+/*! \file sorcery.cc
* \brief evil magic used by monsters
*/
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "victrix-abyssi.h"
-#include "sorcery.h"
-#include "monsters.h"
-#include "combat.h"
+#include "victrix-abyssi.hh"
+#include "sorcery.hh"
+#include "monsters.hh"
+#include "combat.hh"
/* SORCERY
*
-/*! \file sorcery.h
- * \brief Monster sorcery rules
+/*! \file sorcery.hh
+ * \brief Monster sorcery header
*/
/* Copyright 2005-2013 Martin Read
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SORCERY_H
-#define SORCERY_H
+#ifndef SORCERY_HH
+#define SORCERY_HH
/* XXX DATA TYPES XXX */
-/*! \file u.c
+/*! \file u.cc
* \brief player-character
*/
/*
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "victrix-abyssi.h"
-#include "combat.h"
+#include "victrix-abyssi.hh"
+#include "combat.hh"
#include <limits.h>
#include <string.h>
#include <stdio.h>
-/*! \file vector.c
+/*! \file vector.cc
* \brief direction-handling code
*/
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "victrix-abyssi.h"
+#include "victrix-abyssi.hh"
void compute_directions(int y1, int x1, int y2, int x2, int *pdy, int *pdx, int *psy, int *psx, int *pmelee, int *pcardinal)
{
-/*! \file victrix-abyssi.h
+/*! \file victrix-abyssi.hh
* \brief Main header for Victrix Abyssi
*/
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef VICTRIX_ABYSSI_H
-#define VICTRIX_ABYSSI_H
+#ifndef VICTRIX_ABYSSI_HH
+#define VICTRIX_ABYSSI_HH
+#ifndef _GNU_SOURCE
#define _GNU_SOURCE
+#endif
#include <stdlib.h>
#include <stdint.h>
int ring; /* For now, you can only wear one magic ring. */
};
-#ifndef MONSTERS_H
-#include "monsters.h"
+#ifndef MONSTERS_HH
+#include "monsters.hh"
#endif
-#ifndef OBJECTS_H
-#include "objects.h"
+#ifndef OBJECTS_HH
+#include "objects.hh"
#endif
-#ifndef DISPLAY_H
-#include "display.h"
+#ifndef DISPLAY_HH
+#include "display.hh"
#endif
-#ifndef MAP_H
-#include "map.h"
+#ifndef MAP_HH
+#include "map.hh"
#endif
-#ifndef FOV_H
-#include "fov.h"
+#ifndef FOV_HH
+#include "fov.hh"
#endif
/* XXX main.c data and funcs */
extern struct player u;
#endif
-/* victrix-abyssi.h */
+/* victrix-abyssi.hh */
// vim:cindent:ts=8:sw=4:expandtab