Mercurial > hg > early-roguelike
comparison rogue5/rogue.h @ 33:f502bf60e6e4
Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
| author | elwin |
|---|---|
| date | Mon, 24 May 2010 20:10:59 +0000 |
| parents | |
| children | 655c317b6237 |
comparison
equal
deleted
inserted
replaced
| 32:2dcd75e6a736 | 33:f502bf60e6e4 |
|---|---|
| 1 /* | |
| 2 * Rogue definitions and variable declarations | |
| 3 * | |
| 4 * @(#)rogue.h 5.42 (Berkeley) 08/06/83 | |
| 5 * | |
| 6 * Rogue: Exploring the Dungeons of Doom | |
| 7 * Copyright (C) 1980-1983, 1985, 1999 Michael Toy, Ken Arnold and Glenn Wichman | |
| 8 * All rights reserved. | |
| 9 * | |
| 10 * See the file LICENSE.TXT for full copyright and licensing information. | |
| 11 */ | |
| 12 | |
| 13 #include "extern.h" | |
| 14 | |
| 15 #undef lines | |
| 16 | |
| 17 #define NOOP(x) (x += 0) | |
| 18 #define CCHAR(x) ( (x) & A_CHARTEXT ) | |
| 19 | |
| 20 #define MAXDAEMONS 20 | |
| 21 #define EMPTY 0 | |
| 22 | |
| 23 /* | |
| 24 * Maximum number of different things | |
| 25 */ | |
| 26 #define MAXROOMS 9 | |
| 27 #define MAXTHINGS 9 | |
| 28 #define MAXOBJ 9 | |
| 29 #define MAXPACK 23 | |
| 30 #define MAXTRAPS 10 | |
| 31 #define AMULETLEVEL 26 | |
| 32 #define NUMTHINGS 7 /* number of types of things */ | |
| 33 #define MAXPASS 13 /* upper limit on number of passages */ | |
| 34 #define NUMLINES 24 | |
| 35 #define NUMCOLS 80 | |
| 36 #define STATLINE (NUMLINES - 1) | |
| 37 #define BORE_LEVEL 50 | |
| 38 | |
| 39 /* | |
| 40 * return values for get functions | |
| 41 */ | |
| 42 #define NORM 0 /* normal exit */ | |
| 43 #define QUIT 1 /* quit option setting */ | |
| 44 #define MINUS 2 /* back up one option */ | |
| 45 | |
| 46 /* | |
| 47 * inventory types | |
| 48 */ | |
| 49 #define INV_OVER 0 | |
| 50 #define INV_SLOW 1 | |
| 51 #define INV_CLEAR 2 | |
| 52 | |
| 53 /* | |
| 54 * All the fun defines | |
| 55 */ | |
| 56 #define when break;case | |
| 57 #define otherwise break;default | |
| 58 #define until(expr) while(!(expr)) | |
| 59 #define next(ptr) (*ptr).l_next | |
| 60 #define prev(ptr) (*ptr).l_prev | |
| 61 #define winat(y,x) (moat(y,x) != NULL ? moat(y,x)->t_disguise : chat(y,x)) | |
| 62 #define ce(a,b) ((a).x == (b).x && (a).y == (b).y) | |
| 63 #define hero player.t_pos | |
| 64 #define pstats player.t_stats | |
| 65 #define pack player.t_pack | |
| 66 #define proom player.t_room | |
| 67 #define max_hp player.t_stats.s_maxhp | |
| 68 #define attach(a,b) _attach(&a,b) | |
| 69 #define detach(a,b) _detach(&a,b) | |
| 70 #define free_list(a) _free_list(&a) | |
| 71 #undef max | |
| 72 #define max(a,b) ((a) > (b) ? (a) : (b)) | |
| 73 #define on(thing,flag) ((((thing).t_flags & (flag)) != 0)) | |
| 74 #define GOLDCALC (rnd(50 + 10 * level) + 2) | |
| 75 #define ISRING(h,r) (cur_ring[h] != NULL && cur_ring[h]->o_which == r) | |
| 76 #define ISWEARING(r) (ISRING(LEFT, r) || ISRING(RIGHT, r)) | |
| 77 #define ISMULT(type) (type == POTION || type == SCROLL || type == FOOD) | |
| 78 #define INDEX(y,x) (&places[((x) << 5) + (y)]) | |
| 79 #define chat(y,x) (places[((x) << 5) + (y)].p_ch) | |
| 80 #define flat(y,x) (places[((x) << 5) + (y)].p_flags) | |
| 81 #define moat(y,x) (places[((x) << 5) + (y)].p_monst) | |
| 82 #define unc(cp) (cp).y, (cp).x | |
| 83 #ifdef MASTER | |
| 84 #define debug if (wizard) msg | |
| 85 #endif | |
| 86 | |
| 87 /* | |
| 88 * things that appear on the screens | |
| 89 */ | |
| 90 #define PASSAGE '#' | |
| 91 #define DOOR '+' | |
| 92 #define FLOOR '.' | |
| 93 #define PLAYER '@' | |
| 94 #define TRAP '^' | |
| 95 #define STAIRS '%' | |
| 96 #define GOLD '*' | |
| 97 #define POTION '!' | |
| 98 #define SCROLL '?' | |
| 99 #define MAGIC '$' | |
| 100 #define FOOD ':' | |
| 101 #define WEAPON ')' | |
| 102 #define ARMOR ']' | |
| 103 #define AMULET ',' | |
| 104 #define RING '=' | |
| 105 #define STICK '/' | |
| 106 #define CALLABLE -1 | |
| 107 #define R_OR_S -2 | |
| 108 | |
| 109 /* | |
| 110 * Various constants | |
| 111 */ | |
| 112 #define BEARTIME spread(3) | |
| 113 #define SLEEPTIME spread(5) | |
| 114 #define HOLDTIME spread(2) | |
| 115 #define WANDERTIME spread(70) | |
| 116 #define BEFORE spread(1) | |
| 117 #define AFTER spread(2) | |
| 118 #define HEALTIME 30 | |
| 119 #define HUHDURATION 20 | |
| 120 #define SEEDURATION 850 | |
| 121 #define HUNGERTIME 1300 | |
| 122 #define MORETIME 150 | |
| 123 #define STOMACHSIZE 2000 | |
| 124 #define STARVETIME 850 | |
| 125 #define ESCAPE 27 | |
| 126 #define LEFT 0 | |
| 127 #define RIGHT 1 | |
| 128 #define BOLT_LENGTH 6 | |
| 129 #define LAMPDIST 3 | |
| 130 #ifdef MASTER | |
| 131 #ifndef PASSWD | |
| 132 #define PASSWD "mTBellIQOsLNA" | |
| 133 #endif | |
| 134 #endif | |
| 135 | |
| 136 /* | |
| 137 * Save against things | |
| 138 */ | |
| 139 #define VS_POISON 00 | |
| 140 #define VS_PARALYZATION 00 | |
| 141 #define VS_DEATH 00 | |
| 142 #define VS_BREATH 02 | |
| 143 #define VS_MAGIC 03 | |
| 144 | |
| 145 /* | |
| 146 * Various flag bits | |
| 147 */ | |
| 148 /* flags for rooms */ | |
| 149 #define ISDARK 0000001 /* room is dark */ | |
| 150 #define ISGONE 0000002 /* room is gone (a corridor) */ | |
| 151 #define ISMAZE 0000004 /* room is gone (a corridor) */ | |
| 152 | |
| 153 /* flags for objects */ | |
| 154 #define ISCURSED 000001 /* object is cursed */ | |
| 155 #define ISKNOW 0000002 /* player knows details about the object */ | |
| 156 #define ISMISL 0000004 /* object is a missile type */ | |
| 157 #define ISMANY 0000010 /* object comes in groups */ | |
| 158 /* ISFOUND 0000020 ...is used for both objects and creatures */ | |
| 159 #define ISPROT 0000040 /* armor is permanently protected */ | |
| 160 | |
| 161 /* flags for creatures */ | |
| 162 #define CANHUH 0000001 /* creature can confuse */ | |
| 163 #define CANSEE 0000002 /* creature can see invisible creatures */ | |
| 164 #define ISBLIND 0000004 /* creature is blind */ | |
| 165 #define ISCANC 0000010 /* creature has special qualities cancelled */ | |
| 166 #define ISLEVIT 0000010 /* hero is levitating */ | |
| 167 #define ISFOUND 0000020 /* creature has been seen (used for objects) */ | |
| 168 #define ISGREED 0000040 /* creature runs to protect gold */ | |
| 169 #define ISHASTE 0000100 /* creature has been hastened */ | |
| 170 #define ISTARGET 000200 /* creature is the target of an 'f' command */ | |
| 171 #define ISHELD 0000400 /* creature has been held */ | |
| 172 #define ISHUH 0001000 /* creature is confused */ | |
| 173 #define ISINVIS 0002000 /* creature is invisible */ | |
| 174 #define ISMEAN 0004000 /* creature can wake when player enters room */ | |
