-+-+-+-+-+-+-+-+ START OF PART 2 -+-+-+-+-+-+-+-+ X merely test whether STDC is defined, they do not test the value. */ X/* Check how standard we are: Some code tests value of __STDC__. */ X#ifndef __STDC__ X#define __STDC__`090 X#endif X#endif $ CALL UNPACK CONFIG.H;1 662172537 $ create 'f' X/* source/constant.h: global constants used by Moria X X Copyright (c) 1989-92 James E. Wilson, Robert A. Koeneke X X This software may be copied and distributed for educational, research, an Vd X not for profit purposes provided that this copyright and statement are X included in all such copies. */ X X/*Note to the Wizard:`09`09`09`09`09- RAK -`09 */ X/*`09 Tweaking these constants can *GREATLY* change the game. */ X/*`09 Two years of constant tuning have generated these`09 */ X/*`09 values. Minor adjustments are encouraged, but you must */ X/*`09 be very careful not to unbalance the game. Moria was`09 */ X/*`09 meant to be challenging, not a give away. Many`09 */ X/*`09 adjustments can cause the game to act strangely, or even*/ X/*`09 cause errors.`09`09`09`09`09`09 */ X X/*Addendum:`09`09`09`09`09`09`09- JEW - X I have greatly expanded the number of defined constants. However, if X you change anything below, without understanding EXACTLY how the game X uses the number, the program may stop working correctly. Modify the X constants at your own risk. */ X X#define CONSTANT_H_INCLUDED X#ifndef CONFIG_H_INCLUDED XConstant.h should always be included after config.h, because it uses Xsome of the system defines set up there. X#endif X X/* Current version number of Moria`09`09`09`09*/ X#define CUR_VERSION_MAJ 5 /* version 5.5 */ X#define CUR_VERSION_MIN 5 X#define PATCH_LEVEL 0 X X#ifndef TRUE X#define TRUE 1 X#endif X#ifndef FALSE X#define FALSE 0 X#endif X X#define MAX_UCHAR`09255 X#define MAX_SHORT`0932767`09`09/* maximum short/long signed ints */ X#define MAX_LONG`090x7FFFFFFFL X X/* Changing values below this line may be hazardous to your health! */ X X/* message line location */ X#define MSG_LINE 0 X X/* number of messages to save in a buffer */ X#define MAX_SAVE_MSG 22 /* How many messages to save -CJS- */ X X/* Dungeon size parameters`09`09`09`09`09*/ X#define MAX_HEIGHT 66`09 /* Multiple of 11; >= 22 */ X#define MAX_WIDTH 198`09 /* Multiple of 33; >= 66 */ X#define SCREEN_HEIGHT 22 X#define SCREEN_WIDTH 66 X#define QUART_HEIGHT (SCREEN_HEIGHT / 4) X#define QUART_WIDTH (SCREEN_WIDTH / 4) X X/* Dungeon generation values`09`09`09`09`09*/ X/* Note: The entire design of dungeon can be changed by only`09 */ X/*`09 slight adjustments here.`09`09`09`09 */ X#define DUN_TUN_RND`09 9 /* 1/Chance of Random direction`09 */ X#define DUN_TUN_CHG`09 70 /* Chance of changing direction (99 max) */ X#define DUN_TUN_CON`09 15 /* Chance of extra tunneling`09 */ X#define DUN_ROO_MEA`09 32 /* Mean of # of rooms, standard dev2 */ X#define DUN_TUN_PEN`09 25 /* % chance of room doors`09`09 */ X#define DUN_TUN_JCT`09 15 /* % chance of doors at tunnel junctions */ X#define DUN_STR_DEN`09 5 /* Density of streamers`09`09 */ X#define DUN_STR_RNG`09 2 /* Width of streamers`09`09 */ X#define DUN_STR_MAG`09 3 /* Number of magma streamers`09 */ X#define DUN_STR_MC`09 90 /* 1/x chance of treasure per magma */ X#define DUN_STR_QUA`09 2 /* Number of quartz streamers`09 */ X#define DUN_STR_QC`09 40 /* 1/x chance of treasure per quartz */ X#define DUN_UNUSUAL`09 300 /* Level/x chance of unusual room`09 */ X X/* Store constants`09`09`09`09`09`09*/ X#define MAX_OWNERS`09 18 /* Number of owners to choose from */ X#define MAX_STORES`09 6 /* Number of different stores`09 */ X#define STORE_INVEN_MAX`09 24 /* Max number of discrete objs in inven */ X#define STORE_CHOICES`09 26 /* NUMBER of items to choose stock from */ X#define STORE_MAX_INVEN`09 18 /* Max diff objs in stock for auto buy */ X#define STORE_MIN_INVEN`09 10 /* Min diff objs in stock for auto sell */ X#define STORE_TURN_AROUND 9 /* Amount of buying and selling normally */ X#define COST_ADJ`09 100 /* Adjust prices for buying and selling */ X X/* Treasure constants`09`09`09`09`09`09*/ X#define INVEN_ARRAY_SIZE 34 /* Size of inventory array(Do not change)*/ X#define MAX_OBJ_LEVEL 50 /* Maximum level of magic in dungeon */ X#define OBJ_GREAT 12 /* 1/n Chance of item being a Great Item */ X/* Note that the following constants are all related, if you change one, X you must also change all succeeding ones. Also, player_init`5B`5D and X store_choice`5B`5D may also have to be changed. */ X#define MAX_OBJECTS 420 /* Number of objects for universe`09 */ X#define MAX_DUNGEON_OBJ 344 /* Number of dungeon objects */ X#define OBJ_OPEN_DOOR`09367 X#define OBJ_CLOSED_DOOR 368 X#define OBJ_SECRET_DOOR 369 X#define OBJ_UP_STAIR`09370 X#define OBJ_DOWN_STAIR`09371 X#define OBJ_STORE_DOOR 372 X#define OBJ_TRAP_LIST`09378 X#define OBJ_RUBBLE`09396 X#define OBJ_MUSH`09397 X#define OBJ_SCARE_MON`09398 X#define OBJ_GOLD_LIST`09399 X#define OBJ_NOTHING`09417 X#define OBJ_RUINED_CHEST 418 X#define OBJ_WIZARD 419 X#define OBJECT_IDENT_SIZE 448 /* 7*64, see object_offset() in desc.c, X`09`09`09`09 could be MAX_OBJECTS o_o() rewritten */ X#define MAX_GOLD 18 /* Number of different types of gold */ X/* with MAX_TALLOC 150, it is possible to get compacting objects during X level generation, although it is extremely rare */ X#define MAX_TALLOC 175 /* Max objects per level`09`09 */ X#define MIN_TRIX`091 /* Minimum t_list index used`09`09*/ X#define TREAS_ROOM_ALLOC 7 /* Amount of objects for rooms`09 */ X#define TREAS_ANY_ALLOC`09 2 /* Amount of objects for corridors */ X#define TREAS_GOLD_ALLOC 2 /* Amount of gold (and gems)`09 */ X X/* Magic Treasure Generation constants`09`09`09`09*/ X/* Note: Number of special objects, and degree of enchantments`09 */ X/*`09 can be adjusted here.`09`09`09`09`09 */ X#define OBJ_STD_ADJ`09 125 /* Adjust STD per level * 100`09 */ X#define OBJ_STD_MIN`09 7 /* Minimum STD`09`09`09 */ X#define OBJ_TOWN_LEVEL`09 7 /* Town object generation level`09 */ X#define OBJ_BASE_MAGIC`09 15 /* Base amount of magic`09`09 */ X#define OBJ_BASE_MAX`09 70 /* Max amount of magic`09`09 */ X#define OBJ_DIV_SPECIAL`09 6 /* magic_chance/#`09 special magic`09 * V/ X#define OBJ_DIV_CURSED`09 13 /* 10*magic_chance/# cursed items`09 */ X X/* Constants describing limits of certain objects`09`09*/ X#define OBJ_LAMP_MAX`0915000 /* Maximum amount that lamp can be filled*/ X#define OBJ_BOLT_RANGE`09 18 /* Maximum range of bolts and balls */ X#define OBJ_RUNE_PROT`09 3000 /* Rune of protection resistance`09 */ X X/* Creature constants`09`09`09`09`09`09*/ X#define MAX_CREATURES`09 279 /* Number of creatures defined for univ */ X#define N_MONS_ATTS`09 215 /* Number of monster attack types.`09*/ X/* with MAX_MALLOC 101, it is possible to get compacting monsters messages X while breeding/cloning monsters */ X#define MAX_MALLOC`09 125 /* Max that can be allocated`09 */ X#define MAX_MALLOC_CHANCE 160 /* 1/x chance of new monster each round */ X#define MAX_MONS_LEVEL`09 40 /* Maximum level of creatures`09 */ X#define MAX_SIGHT`09 20 /* Maximum dis a creature can be seen */ X#define MAX_SPELL_DIS`09 20 /* Maximum dis creat. spell can be cast */ X#define MAX_MON_MULT`09 75 /* Maximum reproductions on a level */ X#define MON_MULT_ADJ`09 7 /* High value slows multiplication */ X#define MON_NASTY`09 50 /* 1/x chance of high level creat`09`09*/ X#define MIN_MALLOC_LEVEL 14 /* Minimum number of monsters/level */ X#define MIN_MALLOC_TD`09 4 /* Number of people on town level (day) */ X#define MIN_MALLOC_TN`09 8 /* Number of people on town level (night)*/ X#define WIN_MON_TOT`09 2 /* Total number of "win" creatures */ X#define WIN_MON_APPEAR`09 50 /* Level where winning creatures begin */ X#define MON_SUMMON_ADJ`09 2 /* Adjust level of summoned creatures */ X#define MON_DRAIN_LIFE`09 2 /* Percent of player exp drained per hit */ X#define MAX_MON_NATTACK`09 4 /* Max num attacks (used in mons memory) -CJ VS-*/ X#define MIN_MONIX`09 2 /* Minimum index in m_list (1 = py, 0 = no mon)*/ X X/* Trap constants`09`09`09`09`09`09*/ X#define MAX_TRAP`09 18 /* Number of defined traps`09`09 */ X X#define SCARE_MONSTER`0999 X X/* Descriptive constants`09`09`09`09`09*/ X#define MAX_COLORS 49 /* Used with potions */ X#define MAX_MUSH 22 /* Used with mushrooms */ X#define MAX_WOODS 25 /* Used with staffs */ X#define MAX_METALS 25 /* Used with wands */ X#define MAX_ROCKS 32 /* Used with rings */ X#define MAX_AMULETS 11 /* Used with amulets */ X#define MAX_TITLES 45 /* Used with scrolls */ X#define MAX_SYLLABLES 153 /* Used with scrolls */ X X/* Player constants`09`09`09`09`09`09*/ X#define MAX_PLAYER_LEVEL 40 /* Maximum possible character level */ X#define MAX_EXP`09 9999999L /* Maximum amount of experience -CJS- */ X#define MAX_RACES`09 8 /* Number of defined races`09 */ X#define MAX_CLASS`09 6 /* Number of defined classes`09 */ X#define USE_DEVICE`09 3 /* x> Harder devices x< Easier devices */ X#define MAX_BACKGROUND`09 128 /* Number of types of histories for univ */ X#define PLAYER_FOOD_FULL 10000/* Getting full`09`09`09 */ X#define PLAYER_FOOD_MAX`09 15000/* Maximum food value, beyond is wasted */ X#define PLAYER_FOOD_FAINT 300/* Character begins fainting`09 */ X#define PLAYER_FOOD_WEAK 1000/* Warn player that he is getting very low*/ X#define PLAYER_FOOD_ALERT 2000/* Warn player that he is getting low */ X#define PLAYER_REGEN_FAINT 33 /* Regen factor*2`5E16 when fainting`09 * V/ X#define PLAYER_REGEN_WEAK 98 /* Regen factor*2`5E16 when weak`09 */ X#define PLAYER_REGEN_NORMAL 197 /* Regen factor*2`5E16 when full`09 */ X#define PLAYER_REGEN_HPBASE 1442 /* Min amount hp regen*2`5E16`09`09 */ X#define PLAYER_REGEN_MNBASE 524 /* Min amount mana regen*2`5E16`09 */ X#define PLAYER_WEIGHT_CAP 130 /* "#"*(1/10 pounds) per strength point */ X#define PLAYER_EXIT_PAUSE 2 /* Pause time before player can re-roll */ X X/* class level adjustment constants */ X#define CLA_BTH`09`090 X#define CLA_BTHB`091 X#define CLA_DEVICE`092 X#define CLA_DISARM`093 X#define CLA_SAVE`094 X/* this depends on the fact that CLA_SAVE values are all the same, if not, X then should add a separate column for this */ X#define CLA_MISC_HIT`094 X#define MAX_LEV_ADJ`095 X X/* Base to hit constants`09`09`09`09`09*/ X#define BTH_PLUS_ADJ`09 3 /* Adjust BTH per plus-to-hit`09*/ X X/* magic numbers for players inventory array */ X#define INVEN_WIELD 22`09/* must be first item in equipment list */ X#define INVEN_HEAD 23 X#define INVEN_NECK 24 X#define INVEN_BODY 25 X#define INVEN_ARM 26 X#define INVEN_HANDS 27 X#define INVEN_RIGHT 28 X#define INVEN_LEFT 29 X#define INVEN_FEET 30 X#define INVEN_OUTER 31 X#define INVEN_LIGHT 32 X#define INVEN_AUX 33 X X/* Attribute indexes -CJS- */ X X#define A_STR 0 X#define A_INT 1 X#define A_WIS 2 X#define A_DEX 3 X#define A_CON 4 X#define A_CHR 5 X X/* some systems have a non-ANSI definition of this, so undef it first */ X#undef CTRL X#define CTRL(x)`09`09(x & 0x1F) X#define DELETE`09`090x7f X#ifdef VMS X#define ESCAPE '\032'`09/* Use CTRL-Z instead of ESCAPE. */ X#else X#define ESCAPE`09 '\033'`09/* ESCAPE character -CJS- */ X#endif X X/* This used to be NULL, but that was technically incorrect. CNIL is used X instead of null to help avoid lint errors. */ X#ifndef CNIL X#define CNIL (char *)0 X#endif X X/* Fval definitions: these describe the various types of dungeon floors and X walls, if numbers above 15 are ever used, then the test against X MIN_CAVE_WALL will have to be changed, also the save routines will have X to be changed. */ X#define NULL_WALL`090 X#define DARK_FLOOR`091 X#define LIGHT_FLOOR`092 X#define MAX_CAVE_ROOM`092 X#define CORR_FLOOR`093 X#define BLOCKED_FLOOR`094 /* a corridor space with cl/st/se door or rubble * V/ X#define MAX_CAVE_FLOOR`094 X X#define MAX_OPEN_SPACE 3 X#define MIN_CLOSED_SPACE 4 X X#define TMP1_WALL`098 X#define TMP2_WALL`099 X X#define MIN_CAVE_WALL`0912 X#define GRANITE_WALL`0912 X#define MAGMA_WALL`0913 X#define QUARTZ_WALL`0914 X#define BOUNDARY_WALL`0915 X X/* Column for stats */ X#define STAT_COLUMN`090 X X/* Class spell types */ X#define NONE`090 X#define MAGE`091 X#define PRIEST`092 X X/* offsets to spell names in spell_names`5B`5D array */ X#define SPELL_OFFSET`090 X#define PRAYER_OFFSET`0931 X X/* definitions for the psuedo-normal distribution generation */ X#define NORMAL_TABLE_SIZE`09256 X#define NORMAL_TABLE_SD`09`0964 /* the standard deviation for the table */ X X/* definitions for the player's status field */ X#define PY_HUNGRY`090x00000001L X#define PY_WEAK`09`090x00000002L X#define PY_BLIND`090x00000004L X#define PY_CONFUSED`090x00000008L X#define PY_FEAR`09`090x00000010L X#define PY_POISONED`090x00000020L X#define PY_FAST`09`090x00000040L X#define PY_SLOW`09`090x00000080L X#define PY_SEARCH`090x00000100L X#define PY_REST`09`090x00000200L X#define PY_STUDY`090x00000400L X X#define PY_INVULN`090x00001000L X#define PY_HERO`09`090x00002000L X#define PY_SHERO`090x00004000L X#define PY_BLESSED`090x00008000L X#define PY_DET_INV`090x00010000L X#define PY_TIM_INFRA`090x00020000L X#define PY_SPEED`090x00040000L X#define PY_STR_WGT`090x00080000L X#define PY_PARALYSED`090x00100000L X#define PY_REPEAT`090x00200000L X#define PY_ARMOR`090x00400000L X X#define PY_STATS`090x3F000000L X#define PY_STR`09`090x01000000L /* these 6 stat flags must be adjacent */ X#define PY_INT`09`090x02000000L X#define PY_WIS`09`090x04000000L X#define PY_DEX`09`090x08000000L X#define PY_CON`09`090x10000000L X#define PY_CHR`09`090x20000000L X X#define PY_HP`09`090x40000000L X#define PY_MANA`09`090x80000000L X X/* definitions for objects that can be worn */ X#define TR_STATS`090x0000003FL`09/* the stats must be the low 6 bits */ X#define TR_STR`09`090x00000001L X#define TR_INT`09`090x00000002L X#define TR_WIS`09`090x00000004L X#define TR_DEX`09`090x00000008L X#define TR_CON`09`090x00000010L X#define TR_CHR`09`090x00000020L X#define TR_SEARCH`090x00000040L +-+-+-+-+-+-+-+- END OF PART 2 +-+-+-+-+-+-+-+-