Mercurial > hg > early-roguelike
comparison rogue5/extern.c @ 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 * global variable initializaton | |
| 3 * | |
| 4 * @(#)extern.c 4.82 (Berkeley) 02/05/99 | |
| 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 /* All global variables are defined here, or in vers.c or init.c */ | |
| 14 | |
| 15 #include <curses.h> | |
| 16 #include "rogue.h" | |
| 17 | |
| 18 int after; /* True if we want after daemons */ | |
| 19 int again; /* Repeating the last command */ | |
| 20 int noscore; /* Was a wizard sometime */ | |
| 21 int seenstairs; /* Have seen the stairs (for lsd) */ | |
| 22 int amulet = FALSE; /* He found the amulet */ | |
| 23 int door_stop = FALSE; /* Stop running when we pass a door */ | |
| 24 int fight_flush = FALSE; /* True if toilet input */ | |
| 25 int firstmove = FALSE; /* First move after setting door_stop */ | |
| 26 int got_ltc = FALSE; /* We have gotten the local tty chars */ | |
| 27 int has_hit = FALSE; /* Has a "hit" message pending in msg */ | |
| 28 int in_shell = FALSE; /* True if executing a shell */ | |
| 29 int inv_describe = TRUE; /* Say which way items are being used */ | |
| 30 int jump = FALSE; /* Show running as series of jumps */ | |
| 31 int kamikaze = FALSE; /* to_death really to DEATH */ | |
| 32 int lower_msg = FALSE; /* Messages should start w/lower case */ | |
| 33 int move_on = FALSE; /* Next move shouldn't pick up items */ | |
| 34 int msg_esc = FALSE; /* Check for ESC from msg's --More-- */ | |
| 35 int passgo = FALSE; /* Follow passages */ | |
| 36 int playing = TRUE; /* True until he quits */ | |
| 37 int q_comm = FALSE; /* Are we executing a 'Q' command? */ | |
| 38 int running = FALSE; /* True if player is running */ | |
| 39 int save_msg = TRUE; /* Remember last msg */ | |
| 40 int see_floor = TRUE; /* Show the lamp illuminated floor */ | |
| 41 int stat_msg = FALSE; /* Should status() print as a msg() */ | |
| 42 int terse = FALSE; /* True if we should be short */ | |
| 43 int to_death = FALSE; /* Fighting is to the death! */ | |
| 44 int tombstone = TRUE; /* Print out tombstone at end */ | |
| 45 #ifdef MASTER | |
| 46 int wizard = FALSE; /* True if allows wizard commands */ | |
| 47 #endif | |
| 48 int pack_used[26] = { /* Is the character used in the pack? */ | |
| 49 FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, | |
| 50 FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, | |
| 51 FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE | |
| 52 }; | |
| 53 | |
| 54 int dir_ch; /* Direction from last get_dir() call */ | |
| 55 char file_name[MAXSTR]; /* Save file name */ | |
| 56 char huh[MAXSTR]; /* The last message printed */ | |
| 57 const char *p_colors[MAXPOTIONS]; /* Colors of the potions */ | |
| 58 char prbuf[2*MAXSTR]; /* buffer for sprintfs */ | |
| 59 const char *r_stones[MAXRINGS]; /* Stone settings of the rings */ | |
| 60 int runch; /* Direction player is running */ | |
| 61 char *s_names[MAXSCROLLS]; /* Names of the scrolls */ | |
| 62 int take; /* Thing she is taking */ | |
| 63 char whoami[MAXSTR]; /* Name of player */ | |
| 64 const char *ws_made[MAXSTICKS]; /* What sticks are made of */ | |
| 65 char *ws_type[MAXSTICKS]; /* Is it a wand or a staff */ | |
| 66 int orig_dsusp; /* Original dsusp char */ | |
| 67 char fruit[MAXSTR] = /* Favorite fruit */ | |
| 68 { 's', 'l', 'i', 'm', 'e', '-', 'm', 'o', 'l', 'd', '\0' }; | |
| 69 char home[MAXSTR] = { '\0' }; /* User's home directory */ | |
| 70 const char *inv_t_name[] = { | |
| 71 "Overwrite", | |
| 72 "Slow", | |
| 73 "Clear" | |
| 74 }; | |
| 75 int l_last_comm = '\0'; /* Last last_comm */ | |
| 76 int l_last_dir = '\0'; /* Last last_dir */ | |
| 77 int last_comm = '\0'; /* Last command typed */ | |
| 78 int last_dir = '\0'; /* Last direction given */ | |
| 79 const char *tr_name[] = { /* Names of the traps */ | |
| 80 "a trapdoor", | |
| 81 "an arrow trap", | |
| 82 "a sleeping gas trap", | |
| 83 "a beartrap", | |
| 84 "a teleport trap", | |
| 85 "a poison dart trap", | |
| 86 "a rust trap", | |
| 87 "a mysterious trap" | |
| 88 }; | |
| 89 | |
| 90 | |
| 91 int n_objs; /* # items listed in inventory() call */ | |
| 92 int ntraps; /* Number of traps on this level */ | |
| 93 int hungry_state = 0; /* How hungry is he */ | |
| 94 int inpack = 0; /* Number of things in pack */ | |
| 95 int inv_type = 0; /* Type of inventory to use */ | |
| 96 int level = 1; /* What level she is on */ | |
| 97 int max_hit; /* Max damage done to her in to_death */ | |
| 98 int max_level; /* Deepest player has gone */ | |
| 99 int mpos = 0; /* Where cursor is on top line */ | |
| 100 int no_food = 0; /* Number of levels without food */ | |
| 101 const int a_class[MAXARMORS] = { /* Armor class for each armor type */ | |
| 102 8, /* LEATHER */ | |
| 103 7, /* RING_MAIL */ | |
| 104 7, /* STUDDED_LEATHER */ | |
| 105 6, /* SCALE_MAIL */ | |
| 106 5, /* CHAIN_MAIL */ | |
| 107 4, /* SPLINT_MAIL */ | |
| 108 4, /* BANDED_MAIL */ | |
| 109 3, /* PLATE_MAIL */ | |
| 110 }; | |
| 111 | |
| 112 int count = 0; /* Number of times to repeat command */ | |
| 113 FILE *scoreboard = NULL; /* File descriptor for score file */ | |
| 114 int food_left; /* Amount of food in hero's stomach */ | |
| 115 int lastscore = -1; /* Score before this turn */ | |
| 116 int no_command = 0; /* Number of turns asleep */ | |
| 117 int no_move = 0; /* Number of turns held in place */ | |
| 118 int purse = 0; /* How much gold he has */ | |
| 119 int quiet = 0; /* Number of quiet turns */ | |
| 120 int vf_hit = 0; /* Number of time flytrap has hit */ | |
| 121 | |
| 122 unsigned int dnum; /* Dungeon number */ | |
| 123 unsigned int seed; /* Random number seed */ | |
| 124 const int e_levels[] = { | |
| 125 10L, | |
| 126 20L, | |
| 127 40L, | |
| 128 80L, | |
| 129 160L, | |
| 130 320L, | |
| 131 640L, | |
| 132 1300L, | |
| 133 2600L, | |
| 134 5200L, | |
| 135 13000L, | |
| 136 26000L, | |
| 137 50000L, | |
| 138 100000L, | |
| 139 200000L, | |
| 140 400000L, | |
| 141 800000L, | |
| 142 2000000L, | |
| 143 4000000L, | |
| 144 8000000L, | |
| 145 0L | |
| 146 }; | |
| 147 | |
| 148 coord delta; /* Change indicated to get_dir() */ | |
| 149 coord oldpos; /* Position before last look() call */ | |
| 150 coord stairs; /* Location of staircase */ | |
| 151 | |
| 152 PLACE places[MAXLINES*MAXCOLS]; /* level map */ | |
| 153 | |
| 154 THING *cur_armor; /* What he is wearing */ | |
| 155 THING *cur_ring[2]; /* Which rings are being worn */ | |
| 156 THING *cur_weapon; /* Which weapon he is weilding */ | |
| 157 THING *l_last_pick = NULL; /* Last last_pick */ | |
| 158 THING *last_pick = NULL; /* Last object picked in get_item() */ | |
| 159 THING *lvl_obj = NULL; /* List of objects on this level */ | |
| 160 THING *mlist = NULL; /* List of monsters on the level */ | |
| 161 THING player; /* His stats */ | |
| 162 /* restart of game */ | |
| 163 | |
| 164 WINDOW *hw = NULL; /* used as a scratch window */ | |
| 165 | |
