2019-08-10 17:30:21 +00:00
|
|
|
// Hyperbolic Rogue -- items, monsters, walls, lands, descriptions, etc.
|
|
|
|
// Copyright (C) 2011-2018 Zeno Rogue, see 'hyper.cpp' for details
|
|
|
|
|
|
|
|
/** \file classes.h
|
|
|
|
* \brief header file for content
|
|
|
|
*/
|
|
|
|
|
2018-06-10 23:58:31 +00:00
|
|
|
namespace hr {
|
|
|
|
|
2018-09-04 17:53:42 +00:00
|
|
|
typedef unsigned color_t;
|
|
|
|
|
2018-11-30 14:26:50 +00:00
|
|
|
typedef unsigned long long flagtype;
|
|
|
|
#define Flag(i) (flagtype(1ull<<i))
|
|
|
|
|
|
|
|
static inline void set_flag(flagtype& f, flagtype which, bool b) {
|
|
|
|
if(b) f |= which;
|
|
|
|
else f &= ~which;
|
|
|
|
}
|
|
|
|
|
2019-03-24 00:26:43 +00:00
|
|
|
// we use CF not MF to avoid confusion with MF_ movement flags
|
|
|
|
static const flagtype CF_NOGHOST = Flag(0);
|
|
|
|
static const flagtype CF_RAIDER = Flag(1);
|
|
|
|
static const flagtype CF_PRINCESS = Flag(2);
|
|
|
|
static const flagtype CF_MIMIC = Flag(3);
|
|
|
|
static const flagtype CF_GOK = Flag(4);
|
|
|
|
static const flagtype CF_NONLIVING = Flag(5);
|
|
|
|
static const flagtype CF_METAL = Flag(6);
|
|
|
|
static const flagtype CF_STUNNABLE = Flag(7);
|
|
|
|
static const flagtype CF_HP = Flag(8);
|
|
|
|
static const flagtype CF_MOUNTABLE = Flag(9);
|
|
|
|
static const flagtype CF_FRIENDLY = Flag(10);
|
|
|
|
static const flagtype CF_PLAYER = Flag(11);
|
|
|
|
static const flagtype CF_BUG = Flag(12);
|
|
|
|
static const flagtype CF_IVY = Flag(13);
|
|
|
|
static const flagtype CF_PART = Flag(14);
|
|
|
|
static const flagtype CF_MUTANTIVY = Flag(15);
|
|
|
|
static const flagtype CF_ANYIVY = Flag(16);
|
|
|
|
static const flagtype CF_BULLET = Flag(17);
|
|
|
|
static const flagtype CF_DEMON = Flag(18);
|
|
|
|
static const flagtype CF_WORM = Flag(19);
|
|
|
|
static const flagtype CF_WITCH = Flag(20);
|
|
|
|
static const flagtype CF_BIRD = Flag(21);
|
|
|
|
static const flagtype CF_SLOWMOVER = Flag(22);
|
|
|
|
static const flagtype CF_MAGNETIC = Flag(23);
|
|
|
|
static const flagtype CF_SWITCH = Flag(24);
|
|
|
|
static const flagtype CF_GHOST = Flag(25);
|
|
|
|
static const flagtype CF_SHARK = Flag(26);
|
|
|
|
static const flagtype CF_SLIME = Flag(27);
|
|
|
|
static const flagtype CF_DRAGON = Flag(28);
|
|
|
|
static const flagtype CF_KRAKEN = Flag(29);
|
|
|
|
static const flagtype CF_NOBLOW = Flag(30);
|
|
|
|
static const flagtype CF_MULTITILE = Flag(31);
|
|
|
|
static const flagtype CF_LEADER = Flag(32);
|
|
|
|
static const flagtype CF_FLYING = Flag(33);
|
|
|
|
static const flagtype CF_ATTACK_THRU_VINE = Flag(34);
|
|
|
|
static const flagtype CF_ATTACK_NONADJACENT = Flag(35);
|
|
|
|
static const flagtype CF_NOHIGHLIGHT = Flag(36);
|
|
|
|
static const flagtype CF_INACTIVE = Flag(37);
|
|
|
|
static const flagtype CF_UNARMED = Flag(38);
|
|
|
|
static const flagtype CF_IGNORE_PLATE = Flag(39);
|
|
|
|
static const flagtype CF_BULL = Flag(40);
|
|
|
|
static const flagtype CF_TROLL = Flag(41);
|
|
|
|
static const flagtype CF_IGNORE_SMELL = Flag(42);
|
|
|
|
static const flagtype CF_RATLING = Flag(43);
|
|
|
|
static const flagtype CF_POWER = Flag(44);
|
|
|
|
static const flagtype CF_GHOSTMOVER = Flag(45);
|
|
|
|
static const flagtype CF_TECHNICAL = Flag(46);
|
|
|
|
static const flagtype CF_MOVED = Flag(47);
|
2019-03-30 16:42:39 +00:00
|
|
|
static const flagtype CF_FACING = Flag(48);
|
2019-04-20 22:57:24 +00:00
|
|
|
static const flagtype CF_FACE_UP = Flag(49);
|
|
|
|
static const flagtype CF_FACE_SIDE = Flag(50);
|
2019-03-23 15:26:53 +00:00
|
|
|
|
|
|
|
enum eMonster {
|
|
|
|
#define MONSTER(a,b,c,d,e,f,g,h) d,
|
|
|
|
#include "content.cpp"
|
|
|
|
motypes
|
|
|
|
};
|
2017-10-29 11:19:33 +00:00
|
|
|
|
|
|
|
struct monstertype {
|
|
|
|
char glyph;
|
2018-09-04 17:53:42 +00:00
|
|
|
color_t color;
|
2017-10-29 11:19:33 +00:00
|
|
|
const char *name;
|
2019-03-23 15:26:53 +00:00
|
|
|
flagtype flags;
|
|
|
|
enum eMonster mgroup;
|
2017-10-29 11:19:33 +00:00
|
|
|
const char *help;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct genderswitch_t {
|
|
|
|
int gender;
|
|
|
|
eMonster m;
|
|
|
|
const char *name;
|
|
|
|
const char *desc;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define NUM_GS 6
|
|
|
|
|
2019-03-23 15:26:53 +00:00
|
|
|
enum eOrbshape { osNone, osLove, osRanged, osOffensive, osFriend, osUtility, osDirectional, osWarping };
|
|
|
|
|
|
|
|
static const flagtype ZERO = 0;
|
|
|
|
|
|
|
|
static const flagtype IF_SHARD = Flag(0);
|
|
|
|
static const flagtype IF_FIREPROOF = Flag(1);
|
|
|
|
static const flagtype IF_PROTECTION = Flag(2);
|
|
|
|
static const flagtype IF_EMPATHY = Flag(3);
|
|
|
|
static const flagtype IF_RANGED = Flag(4);
|
|
|
|
static const flagtype IF_SHMUPLIFE = Flag(5);
|
2019-03-23 15:42:11 +00:00
|
|
|
static const flagtype IF_REVIVAL = Flag(6);
|
2017-10-29 11:19:33 +00:00
|
|
|
|
2019-08-10 08:57:14 +00:00
|
|
|
// 0 = basic treasure, 1 = other item, 2 = power orb, 3 = not an item
|
|
|
|
#define IC_TREASURE 0
|
|
|
|
#define IC_OTHER 1
|
|
|
|
#define IC_ORB 2
|
|
|
|
#define IC_NAI 3
|
|
|
|
|
2017-10-29 11:19:33 +00:00
|
|
|
struct itemtype {
|
|
|
|
char glyph;
|
2018-09-04 17:53:42 +00:00
|
|
|
color_t color;
|
2017-10-29 11:19:33 +00:00
|
|
|
const char *name;
|
2019-03-23 15:26:53 +00:00
|
|
|
int itemclass;
|
|
|
|
flagtype flags;
|
|
|
|
eOrbshape orbshape;
|
2017-10-29 11:19:33 +00:00
|
|
|
const char *help;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum eItem {
|
2019-03-23 15:26:53 +00:00
|
|
|
#define ITEM(a,b,c,d,e,f,g,h,i) d,
|
|
|
|
#include "content.cpp"
|
|
|
|
ittypes
|
2017-10-29 11:19:33 +00:00
|
|
|
};
|
|
|
|
|
2019-03-23 15:26:53 +00:00
|
|
|
enum eSlimegroup { sgNone, sgCave, sgWater, sgFloorA, sgFloorB, sgVine, sgTree };
|
|
|
|
|
|
|
|
static const flagtype WF_WATER = Flag(0);
|
|
|
|
static const flagtype WF_BOAT = Flag(1);
|
|
|
|
static const flagtype WF_CHASM = Flag(2);
|
|
|
|
static const flagtype WF_NOFLIGHT = Flag(3);
|
|
|
|
static const flagtype WF_FIRE = Flag(4);
|
|
|
|
static const flagtype WF_THUMPER = Flag(5);
|
|
|
|
static const flagtype WF_ACTIVABLE = Flag(6);
|
|
|
|
static const flagtype WF_ALCHEMY = Flag(7);
|
|
|
|
static const flagtype WF_RED = Flag(8);
|
|
|
|
static const flagtype WF_WALL = Flag(9);
|
|
|
|
static const flagtype WF_PUSHABLE = Flag(10);
|
|
|
|
static const flagtype WF_CONE = Flag(11);
|
|
|
|
static const flagtype WF_STDTREE = Flag(12);
|
|
|
|
static const flagtype WF_GRAVE = Flag(13);
|
|
|
|
static const flagtype WF_REPTILE = Flag(14);
|
|
|
|
static const flagtype WF_HEATCOLOR = Flag(15);
|
|
|
|
static const flagtype WF_HIGHWALL = Flag(16);
|
|
|
|
static const flagtype WF_THORNY = Flag(17);
|
|
|
|
static const flagtype WF_TIMEOUT = Flag(18);
|
|
|
|
static const flagtype WF_CISLAND = Flag(19);
|
|
|
|
static const flagtype WF_SULPHURIC = Flag(20);
|
|
|
|
static const flagtype WF_HALFVINE = Flag(21);
|
2017-10-29 11:19:33 +00:00
|
|
|
|
|
|
|
struct walltype {
|
|
|
|
char glyph;
|
2018-09-04 17:53:42 +00:00
|
|
|
color_t color;
|
2017-10-29 11:19:33 +00:00
|
|
|
const char *name;
|
2019-03-23 15:26:53 +00:00
|
|
|
flagtype flags;
|
|
|
|
int snakelevel;
|
|
|
|
eSlimegroup sg;
|
2017-10-29 11:19:33 +00:00
|
|
|
const char *help;
|
|
|
|
};
|
|
|
|
|
2019-03-23 15:26:53 +00:00
|
|
|
enum eWall {
|
|
|
|
#define WALL(a,b,c,d,e,f,g,h,i) d,
|
|
|
|
#include "content.cpp"
|
|
|
|
walltypes
|
2017-10-29 11:19:33 +00:00
|
|
|
};
|
|
|
|
|
2019-03-23 15:26:53 +00:00
|
|
|
static const flagtype LF_GENERATE_ALL = Flag(0);
|
|
|
|
static const flagtype LF_ICY = Flag(1);
|
|
|
|
static const flagtype LF_GRAVITY = Flag(2);
|
|
|
|
static const flagtype LF_EQUI = Flag(3);
|
|
|
|
static const flagtype LF_WARPED = Flag(4);
|
|
|
|
static const flagtype LF_CYCLIC = Flag(5);
|
|
|
|
static const flagtype LF_TECHNICAL = Flag(6);
|
|
|
|
static const flagtype LF_MIRROR = Flag(7);
|
|
|
|
static const flagtype LF_SEA = Flag(8);
|
|
|
|
static const flagtype LF_COASTAL = Flag(9);
|
|
|
|
static const flagtype LF_PURESEA = Flag(10);
|
|
|
|
static const flagtype LF_ELEMENTAL = Flag(11);
|
|
|
|
static const flagtype LF_HAUNTED = Flag(12);
|
|
|
|
static const flagtype LF_TROLL = Flag(13);
|
|
|
|
static const flagtype LF_INMIRROR = Flag(14);
|
|
|
|
static const flagtype LF_INMIRRORORWALL = Flag(15);
|
2017-10-29 11:19:33 +00:00
|
|
|
|
|
|
|
struct landtype {
|
2018-09-04 17:53:42 +00:00
|
|
|
color_t color;
|
2017-10-29 11:19:33 +00:00
|
|
|
const char *name;
|
2019-03-23 15:26:53 +00:00
|
|
|
flagtype flags;
|
|
|
|
eItem treasure;
|
2017-10-29 11:19:33 +00:00
|
|
|
const char *help;
|
|
|
|
};
|
|
|
|
|
2019-03-23 15:26:53 +00:00
|
|
|
enum eLand {
|
|
|
|
#define LAND(a,b,c,d,e,f,g) c,
|
|
|
|
#include "content.cpp"
|
|
|
|
landtypes
|
2017-10-29 11:19:33 +00:00
|
|
|
};
|
|
|
|
|
2018-06-21 23:48:46 +00:00
|
|
|
enum eGeometry {
|
|
|
|
gNormal, gEuclid, gSphere, gElliptic, gZebraQuotient, gFieldQuotient, gTorus, gOctagon, g45, g46, g47, gSmallSphere, gTinySphere, gEuclidSquare, gSmallElliptic,
|
2018-11-23 22:46:26 +00:00
|
|
|
gKleinQuartic, gBolza, gBolza2, gMinimal, gBinaryTiling, gArchimedean,
|
2019-03-01 17:53:20 +00:00
|
|
|
gMacbeath, gBring, gSchmutzM2, gSchmutzM3, gCrystal, gOctahedron,
|
|
|
|
gBinary3, gCubeTiling, gCell120, gECell120, gRhombic3, gBitrunc3,
|
2019-03-02 23:43:31 +00:00
|
|
|
gSpace534, gSpace435,
|
|
|
|
gCell5,
|
|
|
|
gCell8, gECell8,
|
|
|
|
gCell16, gECell16,
|
|
|
|
gCell24, gECell24,
|
|
|
|
gCell600, gECell600,
|
2019-03-13 12:12:49 +00:00
|
|
|
gHoroTris, gHoroRec, gHoroHex,
|
2019-03-15 12:46:23 +00:00
|
|
|
gField435, gField534,
|
2019-07-23 13:06:03 +00:00
|
|
|
gBinary4, gSol,
|
2019-08-06 10:00:46 +00:00
|
|
|
gKiteDart2, gKiteDart3, gNil, PROD2(gProduct,)
|
2018-06-21 23:48:46 +00:00
|
|
|
gGUARD};
|
2017-10-29 11:19:33 +00:00
|
|
|
|
2019-08-06 10:00:46 +00:00
|
|
|
enum eGeometryClass { gcHyperbolic, gcEuclid, gcSphere, gcSol, gcNil, PROD(gcProduct) };
|
2017-12-27 10:57:30 +00:00
|
|
|
|
2018-08-28 15:17:34 +00:00
|
|
|
enum class eVariation { bitruncated, pure, goldberg, irregular, dual };
|
|
|
|
|
2017-10-29 11:19:33 +00:00
|
|
|
struct geometryinfo {
|
2019-02-06 15:34:22 +00:00
|
|
|
const char* tiling_name;
|
|
|
|
const char* quotient_name;
|
|
|
|
const char* menu_displayed_name;
|
2017-10-29 11:19:33 +00:00
|
|
|
const char* shortname;
|
|
|
|
int sides;
|
|
|
|
int vertex;
|
2018-11-30 14:26:50 +00:00
|
|
|
flagtype flags;
|
2017-12-27 10:57:30 +00:00
|
|
|
eGeometryClass cclass;
|
2018-01-06 20:45:13 +00:00
|
|
|
int xcode;
|
2018-06-10 23:58:31 +00:00
|
|
|
std::array<int,2> distlimit; // bitrunc, non-bitrunc
|
2018-08-29 19:19:52 +00:00
|
|
|
eVariation default_variation;
|
2017-10-29 11:19:33 +00:00
|
|
|
};
|
|
|
|
|
2018-11-30 14:26:50 +00:00
|
|
|
static const flagtype qBOUNDED = 1;
|
|
|
|
static const flagtype qANYQ = 2;
|
|
|
|
static const flagtype qNONORIENTABLE = 4;
|
|
|
|
static const flagtype qSMALL = 8;
|
|
|
|
|
|
|
|
static const flagtype qFIELD = 16;
|
|
|
|
static const flagtype qDOCKS = 32;
|
|
|
|
static const flagtype qZEBRA = 64;
|
2017-10-29 11:19:33 +00:00
|
|
|
|
2019-02-25 17:13:09 +00:00
|
|
|
static const flagtype qELLIPTIC = 128;
|
|
|
|
|
2019-03-12 01:40:15 +00:00
|
|
|
static const flagtype qBINARY = 256;
|
2019-07-25 10:24:02 +00:00
|
|
|
static const flagtype qPENROSE = 512;
|
2019-03-12 01:40:15 +00:00
|
|
|
|
2019-08-10 17:34:12 +00:00
|
|
|
static const flagtype qEXPERIMENTAL = 32768;
|
|
|
|
|
2017-10-29 11:19:33 +00:00
|
|
|
// note: dnext assumes that x&7 equals 7
|
2018-08-20 14:28:25 +00:00
|
|
|
static const int SEE_ALL = 50;
|
2017-10-29 11:19:33 +00:00
|
|
|
static const int FORBIDDEN = -1;
|
|
|
|
|
|
|
|
extern eGeometry geometry;
|
2018-08-28 15:17:34 +00:00
|
|
|
extern eVariation variation;
|
2017-10-29 11:46:57 +00:00
|
|
|
|
2018-11-30 13:37:59 +00:00
|
|
|
extern std::vector<geometryinfo> ginf;
|
2017-10-29 13:19:51 +00:00
|
|
|
|
|
|
|
extern monstertype minf[motypes];
|
|
|
|
extern itemtype iinf[ittypes];
|
2017-12-01 23:31:36 +00:00
|
|
|
|
|
|
|
extern const landtype linf[landtypes];
|
2018-11-08 20:56:06 +00:00
|
|
|
extern color_t floorcolors[landtypes];
|
2019-08-09 19:00:52 +00:00
|
|
|
extern walltype winf[walltypes];
|
2017-12-19 13:35:34 +00:00
|
|
|
|
|
|
|
enum cpatterntype {
|
2018-08-02 20:25:08 +00:00
|
|
|
cpFootball, cpThree, cpChess, cpSingle, cpSingleSym, cpOddEven, cpLarge, cpZebra, cpUnknown
|
2017-12-19 13:35:34 +00:00
|
|
|
};
|
|
|
|
|
2018-02-08 21:27:12 +00:00
|
|
|
struct landtacinfo { eLand l; int tries, multiplier; };
|
2018-06-10 23:58:31 +00:00
|
|
|
|
2018-11-09 13:13:01 +00:00
|
|
|
enum eModel {
|
|
|
|
mdDisk, mdHalfplane, mdBand, mdPolygonal, mdFormula,
|
2019-07-12 21:10:01 +00:00
|
|
|
// 5..8.
|
2018-11-09 13:13:01 +00:00
|
|
|
mdEquidistant, mdEquiarea, mdBall, mdHyperboloid,
|
2019-07-12 21:10:01 +00:00
|
|
|
// 9..13
|
2018-11-09 13:13:01 +00:00
|
|
|
mdHemisphere, mdBandEquidistant, mdBandEquiarea, mdSinusoidal, mdTwoPoint,
|
2019-07-12 21:10:01 +00:00
|
|
|
// 14..16
|
2018-11-09 13:13:01 +00:00
|
|
|
mdFisheye, mdJoukowsky, mdJoukowskyInverted,
|
2019-07-12 21:10:01 +00:00
|
|
|
// 17..19
|
2019-03-20 01:10:53 +00:00
|
|
|
mdRotatedHyperboles, mdSpiral, mdPerspective,
|
2019-07-28 09:07:21 +00:00
|
|
|
// 20..24
|
2019-08-06 14:48:01 +00:00
|
|
|
mdEquivolume, mdCentralInversion, mdSimulatedPerspective, mdTwoHybrid, mdGeodesic,
|
2019-08-14 06:23:09 +00:00
|
|
|
// 25
|
2019-08-14 15:13:20 +00:00
|
|
|
mdMollweide, mdCentralCyl, mdCollignon,
|
2019-08-14 06:23:09 +00:00
|
|
|
// 26..
|
2019-05-12 12:35:14 +00:00
|
|
|
mdGUARD, mdUnchanged, mdHyperboloidFlat, mdPolynomial, mdRug, mdFlatten
|
2018-11-09 13:13:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef unsigned long long flagtype;
|
|
|
|
|
|
|
|
namespace mf {
|
|
|
|
static const flagtype azimuthal = 1;
|
2019-08-14 13:25:00 +00:00
|
|
|
static const flagtype cylindrical = 2;
|
2018-11-09 13:13:01 +00:00
|
|
|
static const flagtype equiarea = 4;
|
|
|
|
static const flagtype equidistant = 8;
|
|
|
|
static const flagtype conformal = 16;
|
|
|
|
static const flagtype euc_boring = 32;
|
|
|
|
static const flagtype space = 64;
|
|
|
|
static const flagtype hyper_only = 128;
|
|
|
|
static const flagtype hyper_or_torus = 256;
|
2019-08-14 13:25:00 +00:00
|
|
|
static const flagtype pseudocylindrical = 512; /* includes cylindrical */
|
2019-03-30 16:45:56 +00:00
|
|
|
static const flagtype equivolume = 1024;
|
2019-07-12 21:10:01 +00:00
|
|
|
static const flagtype twopoint = 2048;
|
2019-08-14 13:25:00 +00:00
|
|
|
static const flagtype uses_bandshift = 4096;
|
|
|
|
|
|
|
|
static const flagtype band = (cylindrical | pseudocylindrical | uses_bandshift);
|
|
|
|
static const flagtype pseudoband = (pseudocylindrical | uses_bandshift);
|
2018-11-09 13:13:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct modelinfo {
|
|
|
|
const char *name_hyperbolic;
|
|
|
|
const char *name_euclidean;
|
|
|
|
const char *name_spherical;
|
|
|
|
|
|
|
|
flagtype flags;
|
|
|
|
|
|
|
|
int is_azimuthal;
|
|
|
|
int is_band;
|
|
|
|
int is_equiarea;
|
|
|
|
int is_equidistant;
|
|
|
|
int is_conformal;
|
|
|
|
const char* name;
|
|
|
|
};
|
|
|
|
|
2019-08-09 22:58:50 +00:00
|
|
|
extern const modelinfo mdinf[int(mdPolynomial)+1];
|
2018-11-09 13:13:01 +00:00
|
|
|
|
2018-06-10 23:58:31 +00:00
|
|
|
}
|