1 /* source/externs.h: declarations for global variables and initialized data 2 3 Copyright (c) 1989-94 James E. Wilson, Robert A. Koeneke 4 5 This software may be copied and distributed for educational, research, and 6 not for profit purposes provided that this copyright and statement are 7 included in all such copies. */ 8 9 /* VMS requires that this be in externs.h, not files.c; this prevents a 10 'psect' error for the variable errno */ 11 #include <errno.h> 12 13 /* Atari TC requires prototypes, but does not have __STDC__. 14 Hence, we check for ATARIST_TC here, and define LINT_ARGS if true. */ 15 #ifdef ATARIST_TC 16 #define LINT_ARGS 17 #endif 18 19 /* This causes more trouble than it is worth, and very few systems still 20 have this bug in their include files. */ 21 #if 0 22 /* many systems don't define these anywhere */ 23 #ifndef NeXT 24 #ifndef AMIGA 25 #if !defined(atarist) || !defined(__GNUC__) 26 #ifndef __TURBOC__ 27 #if defined(USG) || defined(DGUX) 28 extern int sprintf(); 29 #else 30 extern char *sprintf(); 31 #endif 32 #endif 33 #endif 34 #endif 35 #endif 36 #endif 37 38 /* to avoid 'psect' problem with VMS declaration of errno */ 39 #ifndef VMS 40 extern int errno; 41 #endif 42 43 extern char *copyright[5]; 44 45 /* horrible hack: needed because compact_monster() can be called from deep 46 within creatures() via place_monster() and summon_monster() */ 47 extern int hack_monptr; 48 49 extern vtype died_from; 50 extern vtype savefile; /* The save file. -CJS- */ 51 extern int32 birth_date; 52 53 /* These are options, set with set_options command -CJS- */ 54 extern int rogue_like_commands; 55 extern int find_cut; /* Cut corners on a run */ 56 extern int find_examine; /* Check corners on a run */ 57 extern int find_prself; /* Print yourself on a run (slower) */ 58 extern int find_bound; /* Stop run when the map shifts */ 59 extern int prompt_carry_flag; /* Prompt to pick something up */ 60 extern int show_weight_flag; /* Display weights in inventory */ 61 extern int highlight_seams; /* Highlight magma and quartz */ 62 extern int find_ignore_doors; /* Run through open doors */ 63 extern int sound_beep_flag; /* Beep for invalid character */ 64 extern int display_counts; /* Display rest/repeat counts */ 65 66 /* global flags */ 67 extern int new_level_flag; /* Next level when true */ 68 extern int teleport_flag; /* Handle teleport traps */ 69 extern int eof_flag; /* Used to handle eof/HANGUP */ 70 extern int player_light; /* Player carrying light */ 71 extern int find_flag; /* Used in MORIA */ 72 extern int free_turn_flag; /* Used in MORIA */ 73 extern int weapon_heavy; /* Flag if the weapon too heavy -CJS- */ 74 extern int pack_heavy; /* Flag if the pack too heavy -CJS- */ 75 extern char doing_inven; /* Track inventory commands */ 76 extern int screen_change; /* Screen changes (used in inven_commands) */ 77 78 extern int character_generated; /* don't save score until char gen finished*/ 79 extern int character_saved; /* prevents save on kill after save_char() */ 80 #if defined(STDIO_LOADED) 81 extern FILE *highscore_fp; /* High score file pointer */ 82 #endif 83 extern int command_count; /* Repetition of commands. -CJS- */ 84 extern int default_dir; /* Use last direction in repeated commands */ 85 extern int16 noscore; /* Don't score this game. -CJS- */ 86 extern int32u randes_seed; /* For encoding colors */ 87 extern int32u town_seed; /* Seed for town genera*/ 88 extern int16 dun_level; /* Cur dungeon level */ 89 extern int16 missile_ctr; /* Counter for missiles */ 90 extern int msg_flag; /* Set with first msg */ 91 extern vtype old_msg[MAX_SAVE_MSG]; /* Last messages -CJS- */ 92 extern int16 last_msg; /* Where in the array is the last */ 93 extern int death; /* True if died */ 94 extern int32 turn; /* Cur trun of game */ 95 extern int wizard; /* Wizard flag */ 96 extern int to_be_wizard; 97 extern int16 panic_save; /* this is true if playing from a panic save */ 98 99 extern int wait_for_more; 100 101 extern char days[7][29]; 102 extern int closing_flag; /* Used for closing */ 103 104 extern int16 cur_height, cur_width; /* Cur dungeon size */ 105 /* Following are calculated from max dungeon sizes */ 106 extern int16 max_panel_rows, max_panel_cols; 107 extern int panel_row, panel_col; 108 extern int panel_row_min, panel_row_max; 109 extern int panel_col_min, panel_col_max; 110 extern int panel_col_prt, panel_row_prt; 111 112 /* Following are all floor definitions */ 113 #ifdef MAC 114 extern cave_type (*cave)[MAX_WIDTH]; 115 #else 116 extern cave_type cave[MAX_HEIGHT][MAX_WIDTH]; 117 #endif 118 119 /* Following are player variables */ 120 extern player_type py; 121 #ifdef MACGAME 122 extern char *(*player_title)[MAX_PLAYER_LEVEL]; 123 extern race_type *race; 124 extern background_type *background; 125 #else 126 extern char *player_title[MAX_CLASS][MAX_PLAYER_LEVEL]; 127 extern race_type race[MAX_RACES]; 128 extern background_type background[MAX_BACKGROUND]; 129 #endif 130 extern int32u player_exp[MAX_PLAYER_LEVEL]; 131 extern int16u player_hp[MAX_PLAYER_LEVEL]; 132 extern int16 char_row; 133 extern int16 char_col; 134 135 extern int8u rgold_adj[MAX_RACES][MAX_RACES]; 136 137 extern class_type class[MAX_CLASS]; 138 extern int16 class_level_adj[MAX_CLASS][MAX_LEV_ADJ]; 139 140 /* Warriors don't have spells, so there is no entry for them. */ 141 #ifdef MACGAME 142 extern spell_type (*magic_spell)[31]; 143 #else 144 extern spell_type magic_spell[MAX_CLASS-1][31]; 145 #endif 146 extern char *spell_names[62]; 147 extern int32u spell_learned; /* Bit field for spells learnt -CJS- */ 148 extern int32u spell_worked; /* Bit field for spells tried -CJS- */ 149 extern int32u spell_forgotten; /* Bit field for spells forgotten -JEW- */ 150 extern int8u spell_order[32]; /* remember order that spells are learned in */ 151 extern int16u player_init[MAX_CLASS][5]; 152 extern int16 total_winner; 153 extern int32 max_score; 154 155 /* Following are store definitions */ 156 #ifdef MACGAME 157 extern owner_type *owners; 158 #else 159 extern owner_type owners[MAX_OWNERS]; 160 #endif 161 #ifdef MAC 162 extern store_type *store; 163 #else 164 extern store_type store[MAX_STORES]; 165 #endif 166 extern int16u store_choice[MAX_STORES][STORE_CHOICES]; 167 #ifndef MAC 168 extern int (*store_buy[MAX_STORES])(); 169 #endif 170 171 /* Following are treasure arrays and variables */ 172 #ifdef MACGAME 173 extern treasure_type *object_list; 174 #else 175 extern treasure_type object_list[MAX_OBJECTS]; 176 #endif 177 extern int8u object_ident[OBJECT_IDENT_SIZE]; 178 extern int16 t_level[MAX_OBJ_LEVEL+1]; 179 extern inven_type t_list[MAX_TALLOC]; 180 extern inven_type inventory[INVEN_ARRAY_SIZE]; 181 extern char *special_names[SN_ARRAY_SIZE]; 182 extern int16 sorted_objects[MAX_DUNGEON_OBJ]; 183 extern int16 inven_ctr; /* Total different obj's */ 184 extern int16 inven_weight; /* Cur carried weight */ 185 extern int16 equip_ctr; /* Cur equipment ctr */ 186 extern int16 tcptr; /* Cur treasure heap ptr */ 187 188 /* Following are creature arrays and variables */ 189 #ifdef MACGAME 190 extern creature_type *c_list; 191 #else 192 extern creature_type c_list[MAX_CREATURES]; 193 #endif 194 extern monster_type m_list[MAX_MALLOC]; 195 extern int16 m_level[MAX_MONS_LEVEL+1]; 196 extern m_attack_type monster_attacks[N_MONS_ATTS]; 197 #ifdef MAC 198 extern recall_type *c_recall; 199 #else 200 extern recall_type c_recall[MAX_CREATURES]; /* Monster memories. -CJS- */ 201 #endif 202 extern monster_type blank_monster; /* Blank monster values */ 203 extern int16 mfptr; /* Cur free monster ptr */ 204 extern int16 mon_tot_mult; /* # of repro's of creature */ 205 206 /* Following are arrays for descriptive pieces */ 207 #ifdef MACGAME 208 extern char **colors; 209 extern char **mushrooms; 210 extern char **woods; 211 extern char **metals; 212 extern char **rocks; 213 extern char **amulets; 214 extern char **syllables; 215 #else 216 extern char *colors[MAX_COLORS]; 217 extern char *mushrooms[MAX_MUSH]; 218 extern char *woods[MAX_WOODS]; 219 extern char *metals[MAX_METALS]; 220 extern char *rocks[MAX_ROCKS]; 221 extern char *amulets[MAX_AMULETS]; 222 extern char *syllables[MAX_SYLLABLES]; 223 #endif 224 225 extern int8u blows_table[7][6]; 226 227 extern int16u normal_table[NORMAL_TABLE_SIZE]; 228 229 /* Initialized data which had to be moved from some other file */ 230 /* Since these get modified, macrsrc.c must be able to access them */ 231 /* Otherwise, game cannot be made restartable */ 232 /* dungeon.c */ 233 extern char last_command; /* Memory of previous command. */ 234 /* moria1.c */ 235 /* Track if temporary light about player. */ 236 extern int light_flag; 237 238 #ifdef MSDOS 239 extern int8u floorsym, wallsym; 240 extern int ansi, saveprompt; 241 extern char moriatop[], moriasav[]; 242 #endif 243 244 /* function return values */ 245 /* only extern functions declared here, static functions declared inside 246 the file that defines them */ 247 #if defined(LINT_ARGS) 248 /* these prototypes can be used by MSC and TC for type checking of arguments 249 WARNING: note that this does not work for all ANSI C compilers, e.g. Gnu C, 250 will give error messages if you use these prototypes. 251 This is due to differing interpretations of the ANSI C standard, 252 specifically how to handle promotion of parameters. In my reading of 253 the standard, I believe that Gnu C's behaviour is correct. */ 254 255 #ifdef ATARI_ST 256 /* atarist.c */ 257 int check_input(int microsec); 258 void user_name(char * buf); 259 int access(char * name, int dum); 260 void chmod(char * name, int mode); /* dummy function */ 261 #endif 262 263 /* create.c */ 264 void create_character(void); 265 266 /* creature.c */ 267 void update_mon(int); 268 int multiply_monster(int, int, int, int); 269 void creatures(int); 270 271 /* death.c */ 272 void display_scores(int); 273 int duplicate_character(void); 274 int32 total_points(void); 275 void exit_game(void); 276 277 /* desc.c */ 278 int is_a_vowel(char); 279 void magic_init(void); 280 int16 object_offset(struct inven_type *); 281 void known1(struct inven_type *); 282 int known1_p(struct inven_type *); 283 void known2(struct inven_type *); 284 int known2_p(struct inven_type *); 285 void clear_known2(struct inven_type *); 286 void clear_empty(inven_type *); 287 void store_bought(inven_type *); 288 int store_bought_p(inven_type *); 289 void sample(struct inven_type *); 290 void identify(int *); 291 void unmagic_name(struct inven_type *); 292 void objdes(char *, struct inven_type *, int); 293 void invcopy(inven_type *, int); 294 void desc_charges(int); 295 void desc_remain(int); 296 297 /* dungeon.c */ 298 void dungeon(void); 299 300 /* eat.c */ 301 void eat(void); 302 303 /* files.c */ 304 void init_scorefile(void); 305 void read_times(void); 306 void helpfile(char *); 307 void print_objects(void); 308 #ifdef MAC 309 int file_character(void); 310 #else 311 int file_character(char *); 312 #endif 313 314 /* generate.c */ 315 void generate_cave(void); 316 317 #ifdef VMS 318 /* getch.c */ 319 int kbhit (void); 320 void user_name (char *); 321 void vms_crmode (void); 322 void vms_nocrmode (void); 323 int opengetch (void); 324 int closegetch (void); 325 char vms_getch (void); 326 #endif 327 328 /* help.c */ 329 void ident_char(void); 330 331 /* io.c */ 332 #ifdef SIGTSTP 333 int suspend(void); 334 #endif 335 void init_curses(void); 336 void moriaterm(void); 337 void put_buffer(char *, int, int); 338 void put_qio(void); 339 void restore_term(void); 340 void shell_out(void); 341 char inkey(void); 342 void flush(void); 343 void erase_line(int, int); 344 void clear_screen(void); 345 void clear_from(int); 346 void print(char, int, int); 347 void move_cursor_relative(int, int); 348 void count_msg_print(char *); 349 void prt(char *, int, int); 350 void move_cursor(int, int); 351 void msg_print(char *); 352 int get_check(char *); 353 int get_com(char *, char *); 354 int get_string(char *, int, int, int); 355 void pause_line(int); 356 void pause_exit(int, int); 357 void save_screen(void); 358 void restore_screen(void); 359 void bell(void); 360 void screen_map(void); 361 362 /* magic.c */ 363 void cast(void); 364 365 /* main.c */ 366 int main(int, char **); 367 368 /* misc1.c */ 369 void init_seeds(int32u); 370 void set_seed(int32u); 371 void reset_seed(void); 372 int check_time(void); 373 int randint(int); 374 int randnor(int, int); 375 int bit_pos(int32u *); 376 int in_bounds(int, int); 377 void panel_bounds(void); 378 int get_panel(int, int, int); 379 int panel_contains(int, int); 380 int distance(int, int, int, int); 381 int next_to_wall(int, int); 382 int next_to_corr(int, int); 383 int damroll(int, int); 384 int pdamroll(unsigned char *); 385 int los(int, int, int, int); 386 unsigned char loc_symbol(int, int); 387 int test_light(int, int); 388 void prt_map(void); 389 int compact_monsters(void); 390 void add_food(int); 391 int popm(void); 392 int max_hp(unsigned char *); 393 int place_monster(int, int, int, int); 394 void place_win_monster(void); 395 int get_mons_num(int); 396 void alloc_monster(int, int, int); 397 int summon_monster(int * ,int *, int); 398 int summon_undead(int *, int *); 399 int popt(void); 400 void pusht(int8u); 401 int magik(int); 402 int m_bonus(int, int, int); 403 404 /* misc2.c */ 405 void magic_treasure(int, int); 406 void set_options(void); 407 408 /* misc3.c */ 409 void place_trap(int, int, int); 410 void place_rubble(int, int); 411 void place_gold(int, int); 412 int get_obj_num(int, int); 413 void place_object(int, int, int); 414 void alloc_object(int (*)(), int, int); 415 void random_object(int, int, int); 416 void cnv_stat(int8u, char *); 417 void prt_stat(int); 418 void prt_field(char *, int, int); 419 int stat_adj(int); 420 int chr_adj(void); 421 int con_adj(void); 422 char *title_string(void); 423 void prt_title(void); 424 void prt_level(void); 425 void prt_cmana(void); 426 void prt_mhp(void); 427 void prt_chp(void); 428 void prt_pac(void); 429 void prt_gold(void); 430 void prt_depth(void); 431 void prt_hunger(void); 432 void prt_blind(void); 433 void prt_confused(void); 434 void prt_afraid(void); 435 void prt_poisoned(void); 436 void prt_state(void); 437 void prt_speed(void); 438 void prt_study(void); 439 void prt_winner(void); 440 int8u modify_stat(int, int16); 441 void set_use_stat(int); 442 int inc_stat(int); 443 int dec_stat(int); 444 int res_stat(int); 445 void bst_stat(int, int); 446 int tohit_adj(void); 447 int toac_adj(void); 448 int todis_adj(void); 449 int todam_adj(void); 450 void prt_stat_block(void); 451 void draw_cave(void); 452 void put_character(void); 453 void put_stats(void); 454 char *likert(int, int); 455 void put_misc1(void); 456 void put_misc2(void); 457 void put_misc3(void); 458 void display_char(void); 459 void get_name(void); 460 void change_name(void); 461 void inven_destroy(int); 462 void take_one_item(struct inven_type *, struct inven_type *); 463 void inven_drop(int, int); 464 int inven_damage(int (*)(), int); 465 int weight_limit(void); 466 int inven_check_num(struct inven_type *); 467 int inven_check_weight(struct inven_type *); 468 void check_strength(void); 469 int inven_carry(struct inven_type *); 470 int spell_chance(int); 471 void print_spells(int *, int, int, int); 472 int get_spell(int *, int, int *, int *, char *, int); 473 void calc_spells(int); 474 void gain_spells(void); 475 void calc_mana(int); 476 void prt_experience(void); 477 void calc_hitpoints(void); 478 void insert_str(char *, char *, char *); 479 void insert_lnum(char *, char *, int32, int); 480 int enter_wiz_mode(void); 481 int attack_blows(int, int *); 482 int tot_dam(struct inven_type *, int, int); 483 int critical_blow(int, int, int, int); 484 int mmove(int, int *, int *); 485 int player_saves(void); 486 int find_range(int, int, int *, int *); 487 void teleport(int); 488 489 /* misc4.c */ 490 void scribe_object(void); 491 void add_inscribe(struct inven_type *, int8u); 492 void inscribe(struct inven_type *, char *); 493 void check_view(void); 494 495 /* monsters.c */ 496 497 /* moria1.c */ 498 void change_speed(int); 499 void py_bonuses(struct inven_type *, int); 500 void calc_bonuses(void); 501 int show_inven(int, int, int, int, char *); 502 char *describe_use(int); 503 int show_equip(int, int); 504 void takeoff(int, int); 505 int verify(char *, int); 506 void inven_command(char); 507 int get_item(int *, char *, int, int, char *, char *); 508 int no_light(void); 509 int get_dir(char *, int *); 510 int get_alldir(char *, int *); 511 void move_rec(int, int, int, int); 512 void light_room(int, int); 513 void lite_spot(int, int); 514 void move_light(int, int, int, int); 515 void disturb(int, int); 516 void search_on(void); 517 void search_off(void); 518 void rest(void); 519 void rest_off(void); 520 int test_hit(int, int, int, int, int); 521 void take_hit(int, char *); 522 523 /* moria2.c */ 524 void change_trap(int, int); 525 void search(int, int, int); 526 void find_init(int); 527 void find_run(void); 528 void end_find(void); 529 void area_affect(int, int, int); 530 int minus_ac(int32u); 531 void corrode_gas(char *); 532 void poison_gas(int, char *); 533 void fire_dam(int, char *); 534 void cold_dam(int, char *); 535 void light_dam(int, char *); 536 void acid_dam(int, char *); 537 538 /* moria3.c */ 539 int cast_spell(char * ,int, int *, int *); 540 void delete_monster(int); 541 void fix1_delete_monster(int); 542 void fix2_delete_monster(int); 543 int delete_object(int, int); 544 int32u monster_death(int, int, int32u); 545 int mon_take_hit(int, int); 546 void py_attack(int, int); 547 void move_char(int, int); 548 void chest_trap(int, int); 549 void openobject(void); 550 void closeobject(void); 551 int twall(int, int, int, int); 552 553 /* moria4.c */ 554 void tunnel(int); 555 void disarm_trap(void); 556 void look(void); 557 void throw_object(void); 558 void bash(void); 559 560 #ifdef MSDOS 561 /* ms_misc.c */ 562 void user_name(char *); 563 char *getlogin(void); 564 #ifdef __TURBOC__ 565 void sleep(unsigned); 566 #else 567 unsigned int sleep(int); 568 #endif 569 void error(char *, ...); 570 void warn(char *, ...); 571 void msdos_init(void); 572 void msdos_raw(void); 573 void msdos_noraw(void); 574 int bios_getch(void); 575 int msdos_getch(void); 576 void bios_clear(void); 577 void msdos_intro(void); 578 void bios_clear(void); 579 #endif 580 581 /* potions.c */ 582 void quaff(void); 583 584 /* prayer.c */ 585 void pray(void); 586 587 /* recall.c */ 588 int bool_roff_recall(int); 589 int roff_recall(int); 590 591 /* rnd.c */ 592 int32u get_rnd_seed(void); 593 void set_rnd_seed(int32u); 594 int32 rnd(void); 595 596 /* save.c */ 597 #ifdef MAC 598 int save_char(int); 599 #else 600 int save_char(void); 601 #endif 602 int _save_char(char *); 603 int get_char(int *); 604 #if defined(STDIO_LOADED) 605 void set_fileptr(FILE *); 606 #endif 607 void wr_highscore(high_scores *); 608 void rd_highscore(high_scores *); 609 610 /* scrolls.c */ 611 void read_scroll(void); 612 613 /* sets.c */ 614 int set_room(int); 615 int set_corr(int); 616 int set_floor(int); 617 int set_corrodes(inven_type *); 618 int set_flammable(inven_type *); 619 int set_frost_destroy(inven_type *); 620 int set_acid_affect(inven_type *); 621 int set_lightning_destroy(inven_type *); 622 int set_null(inven_type *); 623 int set_acid_destroy(inven_type *); 624 int set_fire_destroy(inven_type *); 625 int set_large(inven_type *); 626 int general_store(int); 627 int armory(int); 628 int weaponsmith(int); 629 int temple(int); 630 int alchemist(int); 631 int magic_shop(int); 632 #ifdef MAC 633 int store_buy(int, int); 634 #endif 635 636 /* signals.c */ 637 void nosignals(void); 638 void signals(void); 639 void init_signals(void); 640 void ignore_signals(void); 641 void default_signals(void); 642 void restore_signals(void); 643 644 /* spells.c */ 645 void monster_name(char *, struct monster_type *, struct creature_type *); 646 void lower_monster_name(char *, struct monster_type *, 647 struct creature_type *); 648 int sleep_monsters1(int, int); 649 int detect_treasure(void); 650 int detect_object(void); 651 int detect_trap(void); 652 int detect_sdoor(void); 653 int detect_invisible(void); 654 int light_area(int, int); 655 int unlight_area(int, int); 656 void map_area(void); 657 int ident_spell(void); 658 int aggravate_monster(int); 659 int trap_creation(void); 660 int door_creation(void); 661 int td_destroy(void); 662 int detect_monsters(void); 663 void light_line(int, int, int); 664 void starlite(int, int); 665 int disarm_all(int, int, int); 666 void get_flags(int, int32u *, int *, int (**)()); 667 void fire_bolt(int, int, int, int, int, char *); 668 void fire_ball(int, int, int, int, int, char *); 669 void breath(int, int, int, int, char *, int); 670 int recharge(int); 671 int hp_monster(int, int, int, int); 672 int drain_life(int, int, int); 673 int speed_monster(int, int, int, int); 674 int confuse_monster(int, int, int); 675 int sleep_monster(int, int, int); 676 int wall_to_mud(int, int, int); 677 int td_destroy2(int, int, int); 678 int poly_monster(int, int, int); 679 int build_wall(int, int, int); 680 int clone_monster(int, int, int); 681 void teleport_away(int, int); 682 void teleport_to(int, int); 683 int teleport_monster(int, int, int); 684 int mass_genocide(void); 685 int genocide(void); 686 int speed_monsters(int); 687 int sleep_monsters2(void); 688 int mass_poly(void); 689 int detect_evil(void); 690 int hp_player(int); 691 int cure_confusion(void); 692 int cure_blindness(void); 693 int cure_poison(void); 694 int remove_fear(void); 695 void earthquake(void); 696 int protect_evil(void); 697 void create_food(void); 698 int dispel_creature(int, int); 699 int turn_undead(void); 700 void warding_glyph(void); 701 void lose_str(void); 702 void lose_int(void); 703 void lose_wis(void); 704 void lose_dex(void); 705 void lose_con(void); 706 void lose_chr(void); 707 void lose_exp(int32); 708 int slow_poison(void); 709 void bless(int); 710 void detect_inv2(int); 711 void destroy_area(int, int); 712 int enchant(int16 *, int16); 713 int remove_curse(void); 714 int restore_level(void); 715 716 /* staffs.c */ 717 void use(void); 718 719 /* store1.c */ 720 int32 item_value(struct inven_type *); 721 int32 sell_price(int, int32 *, int32 *, struct inven_type *); 722 int store_check_num(struct inven_type *, int); 723 void store_carry(int, int *, struct inven_type *); 724 void store_destroy(int, int, int); 725 void store_init(void); 726 void store_maint(void); 727 int noneedtobargain(int, int32); 728 void updatebargain(int, int32, int32); 729 730 /* store2.c */ 731 void enter_store(int); 732 733 /* treasur1.c */ 734 735 /* treasur2.c */ 736 737 #ifdef VMS 738 /* uexit.c */ 739 void uexit (int); 740 #endif 741 742 #ifdef unix 743 /* unix.c */ 744 int check_input(int); 745 #if 0 746 int system_cmd(char *); 747 #endif 748 void user_name(char *); 749 int tilde(char *, char *); 750 /* only declare this if stdio.h has been previously included, STDIO_LOADED 751 is defined after stdio.h is included */ 752 #if defined(STDIO_LOADED) 753 FILE *tfopen(char *, char *); 754 #endif 755 int topen(char *, int, int); 756 #endif 757 758 /* variable.c */ 759 760 /* wands.c */ 761 void aim(void); 762 763 /* wizard.c */ 764 void wizard_light(void); 765 void change_character(void); 766 void wizard_create(void); 767 768 #else 769 /* !defined (LINT_ARGS) */ 770 771 #ifdef ATARI_ST 772 /* atarist.c */ 773 int check_input (); 774 void user_name (); 775 int access (); 776 void chmod (); 777 #endif 778 779 /* create.c */ 780 void create_character(); 781 782 /* creature.c */ 783 void update_mon(); 784 int multiply_monster(); 785 void creatures(); 786 787 /* death.c */ 788 void display_scores(); 789 int duplicate_character(); 790 int32 total_points(); 791 void exit_game(); 792 793 /* desc.c */ 794 int is_a_vowel(); 795 void magic_init(); 796 int16 object_offset(); 797 void known1(); 798 int known1_p(); 799 void known2(); 800 int known2_p(); 801 void clear_known2(); 802 void clear_empty(); 803 void store_bought(); 804 int store_bought_p(); 805 void sample(); 806 void identify(); 807 void unmagic_name(); 808 void objdes(); 809 void invcopy(); 810 void desc_charges(); 811 void desc_remain(); 812 813 /* dungeon.c */ 814 void dungeon(); 815 816 /* eat.c */ 817 void eat(); 818 819 /* files.c */ 820 void init_scorefile(); 821 void read_times(); 822 void helpfile(); 823 void print_objects(); 824 int file_character(); 825 826 /* generate.c */ 827 void generate_cave(); 828 829 #ifdef VMS 830 /* getch.c */ 831 int kbhit (); 832 void user_name (); 833 void vms_crmode (); 834 void vms_nocrmode (); 835 int opengetch (); 836 int closegetch (); 837 char vms_getch (); 838 #endif 839 840 /* help.c */ 841 void ident_char(); 842 843 /* io.c */ 844 #ifdef SIGTSTP 845 int suspend(); 846 #endif 847 void init_curses(); 848 void moriaterm(); 849 void put_buffer(); 850 void put_qio(); 851 void restore_term(); 852 void shell_out(); 853 char inkey(); 854 void flush(); 855 void erase_line(); 856 void clear_screen(); 857 void clear_from(); 858 void print(); 859 void move_cursor_relative(); 860 void count_msg_print(); 861 void prt(); 862 void move_cursor(); 863 void msg_print(); 864 int get_check(); 865 int get_com(); 866 int get_string(); 867 void pause_line(); 868 void pause_exit(); 869 void save_screen(); 870 void restore_screen(); 871 void bell(); 872 void screen_map(); 873 874 /* magic.c */ 875 void cast(); 876 877 /* main.c */ 878 int main(); 879 880 /* misc1.c */ 881 void init_seeds(); 882 void set_seed(); 883 void reset_seed(); 884 int check_time(); 885 int randint(); 886 int randnor(); 887 int bit_pos(); 888 int in_bounds(); 889 void panel_bounds(); 890 int get_panel(); 891 int panel_contains(); 892 int distance(); 893 int next_to_walls(); 894 int next_to_corr(); 895 int damroll(); 896 int pdamroll(); 897 int los(); 898 unsigned char loc_symbol(); 899 int test_light(); 900 void prt_map(); 901 int compact_monsters(); 902 void add_food(); 903 int popm(); 904 int max_hp(); 905 int place_monster(); 906 void place_win_monster(); 907 int get_mons_num(); 908 void alloc_monster(); 909 int summon_monster(); 910 int summon_undead(); 911 int popt(); 912 void pusht(); 913 int magik(); 914 int m_bonus(); 915 916 /* misc2.c */ 917 void magic_treasure(); 918 void set_options(); 919 920 /* misc3.c */ 921 void place_trap(); 922 void place_rubble(); 923 void place_gold(); 924 int get_obj_num(); 925 void place_object(); 926 void alloc_object(); 927 void random_object(); 928 void cnv_stat(); 929 void prt_stat(); 930 void prt_field(); 931 int stat_adj(); 932 int chr_adj(); 933 int con_adj(); 934 char *title_string(); 935 void prt_title(); 936 void prt_level(); 937 void prt_cmana(); 938 void prt_mhp(); 939 void prt_chp(); 940 void prt_pac(); 941 void prt_gold(); 942 void prt_depth(); 943 void prt_hunger(); 944 void prt_blind(); 945 void prt_confused(); 946 void prt_afraid(); 947 void prt_poisoned(); 948 void prt_state(); 949 void prt_speed(); 950 void prt_study(); 951 void prt_winner(); 952 int8u modify_stat(); 953 void set_use_stat(); 954 int inc_stat(); 955 int dec_stat(); 956 int res_stat(); 957 void bst_stat(); 958 int tohit_adj(); 959 int toac_adj(); 960 int todis_adj(); 961 int todam_adj(); 962 void prt_stat_block(); 963 void draw_cave(); 964 void put_character(); 965 void put_stats(); 966 char *likert(); 967 void put_misc1(); 968 void put_misc2(); 969 void put_misc3(); 970 void display_char(); 971 void get_name(); 972 void change_name(); 973 void inven_destroy(); 974 void take_one_item(); 975 void inven_drop(); 976 int inven_damage(); 977 int weight_limit(); 978 int inven_check_num(); 979 int inven_check_weight(); 980 void check_strength(); 981 int inven_carry(); 982 int spell_chance(); 983 void print_spells(); 984 int get_spell(); 985 void calc_spells(); 986 void gain_spells(); 987 void calc_mana(); 988 void prt_experience(); 989 void calc_hitpoints(); 990 void insert_str(); 991 void insert_lnum(); 992 int enter_wiz_mode(); 993 int attack_blows(); 994 int tot_dam(); 995 int critical_blow(); 996 int mmove(); 997 int player_saves(); 998 int find_range(); 999 void teleport(); 1000 1001 /* misc4.c */ 1002 void scribe_object(); 1003 void add_inscribe(); 1004 void inscribe(); 1005 void check_view(); 1006 1007 /* monsters.c */ 1008 1009 /* moria1.c */ 1010 void change_speed(); 1011 void py_bonuses(); 1012 void calc_bonuses(); 1013 int show_inven(); 1014 char *describe_use(); 1015 int show_equip(); 1016 void takeoff(); 1017 int verify(); 1018 void inven_command(); 1019 int get_item(); 1020 int no_light(); 1021 int get_dir(); 1022 int get_alldir(); 1023 void move_rec(); 1024 void light_room(); 1025 void lite_spot(); 1026 void move_light(); 1027 void disturb(); 1028 void search_on(); 1029 void search_off(); 1030 void rest(); 1031 void rest_off(); 1032 int test_hit(); 1033 void take_hit(); 1034 1035 /* moria2.c */ 1036 void change_trap(); 1037 void search(); 1038 void find_init(); 1039 void find_run(); 1040 void end_find(); 1041 void area_affect(); 1042 int minus_ac(); 1043 void corrode_gas(); 1044 void poison_gas(); 1045 void fire_dam(); 1046 void cold_dam(); 1047 void light_dam(); 1048 void acid_dam(); 1049 1050 /* moria3.c */ 1051 int cast_spell(); 1052 void delete_monster(); 1053 void fix1_delete_monster(); 1054 void fix2_delete_monster(); 1055 int delete_object(); 1056 int32u monster_death(); 1057 int mon_take_hit(); 1058 void py_attack(); 1059 void move_char(); 1060 void chest_trap(); 1061 void openobject(); 1062 void closeobject(); 1063 int twall(); 1064 1065 /* moria4.c */ 1066 void tunnel(); 1067 void disarm_trap(); 1068 void look(); 1069 void throw_object(); 1070 void bash(); 1071 1072 #ifdef MSDOS 1073 /* ms_misc.c */ 1074 void user_name(); 1075 char *getlogin(); 1076 #ifdef __TURBOC__ 1077 void sleep(); 1078 #else 1079 unsigned int sleep(); 1080 #endif 1081 #if 0 1082 void error(); 1083 void warn(); 1084 #else 1085 /* Because an empty parameter list in a declaration can not match a parameter 1086 list with an elipsis in a definition. */ 1087 void error (char *fmt, ...); 1088 void warn (char *fmt, ...); 1089 #endif 1090 void msdos_init(); 1091 void msdos_raw(); 1092 void msdos_noraw(); 1093 int bios_getch(); 1094 int msdos_getch(); 1095 void bios_clear(); 1096 void msdos_intro(); 1097 void bios_clear(); 1098 #endif 1099 1100 /* potions.c */ 1101 void quaff(); 1102 1103 /* prayer.c */ 1104 void pray(); 1105 1106 /* recall.c */ 1107 int bool_roff_recall(); 1108 int roff_recall(); 1109 1110 /* rnd.c */ 1111 int32u get_rnd_seed(); 1112 void set_rnd_seed(); 1113 int32 rnd(); 1114 1115 /* save.c */ 1116 int save_char(); 1117 int _save_char(); 1118 int get_char(); 1119 #if defined(STDIO_LOADED) 1120 void set_fileptr(); 1121 #endif 1122 void wr_highscore(); 1123 void rd_highscore(); 1124 1125 /* scrolls.c */ 1126 void read_scroll(); 1127 1128 /* sets.c */ 1129 int set_room(); 1130 int set_corr(); 1131 int set_floor(); 1132 int set_corrodes(); 1133 int set_flammable(); 1134 int set_frost_destroy(); 1135 int set_acid_affect(); 1136 int set_lightning_destroy(); 1137 int set_null(); 1138 int set_acid_destroy(); 1139 int set_fire_destroy(); 1140 int set_large(); 1141 int general_store(); 1142 int armory(); 1143 int weaponsmith(); 1144 int temple(); 1145 int alchemist(); 1146 int magic_shop(); 1147 #ifdef MAC 1148 int store_buy(); 1149 #endif 1150 1151 /* signals.c */ 1152 void nosignals(); 1153 void signals(); 1154 void init_signals(); 1155 void ignore_signals(); 1156 void default_signals(); 1157 void restore_signals(); 1158 1159 /* spells.c */ 1160 void monster_name(); 1161 void lower_monster_name(); 1162 int sleep_monsters1(); 1163 int detect_treasure(); 1164 int detect_object(); 1165 int detect_trap(); 1166 int detect_sdoor(); 1167 int detect_invisible(); 1168 int light_area(); 1169 int unlight_area(); 1170 void map_area(); 1171 int ident_spell(); 1172 int aggravate_monster(); 1173 int trap_creation(); 1174 int door_creation(); 1175 int td_destroy(); 1176 int detect_monsters(); 1177 void light_line(); 1178 void starlite(); 1179 int disarm_all(); 1180 void get_flags(); 1181 void fire_bolt(); 1182 void fire_ball(); 1183 void breath(); 1184 int recharge(); 1185 int hp_monster(); 1186 int drain_life(); 1187 int speed_monster(); 1188 int confuse_monster(); 1189 int sleep_monster(); 1190 int wall_to_mud(); 1191 int td_destroy2(); 1192 int poly_monster(); 1193 int build_wall(); 1194 int clone_monster(); 1195 void teleport_away(); 1196 void teleport_to(); 1197 int teleport_monster(); 1198 int mass_genocide(); 1199 int genocide(); 1200 int speed_monsters(); 1201 int sleep_monsters2(); 1202 int mass_poly(); 1203 int detect_evil(); 1204 int hp_player(); 1205 int cure_confusion(); 1206 int cure_blindness(); 1207 int cure_poison(); 1208 int remove_fear(); 1209 void earthquake(); 1210 int protect_evil(); 1211 void create_food(); 1212 int dispel_creature(); 1213 int turn_undead(); 1214 void warding_glyph(); 1215 void lose_str(); 1216 void lose_int(); 1217 void lose_wis(); 1218 void lose_dex(); 1219 void lose_con(); 1220 void lose_chr(); 1221 void lose_exp(); 1222 int slow_poison(); 1223 void bless(); 1224 void detect_inv2(); 1225 void destroy_area(); 1226 int enchant(); 1227 int remove_curse(); 1228 int restore_level(); 1229 1230 /* staffs.c */ 1231 void use(); 1232 1233 /* store1.c */ 1234 int32 item_value(); 1235 int32 sell_price(); 1236 int store_check_num(); 1237 void store_carry(); 1238 void store_destroy(); 1239 void store_init(); 1240 void store_maint(); 1241 int noneedtobargain(); 1242 void updatebargain(); 1243 1244 /* store2.c */ 1245 void enter_store(); 1246 1247 /* treasur1.c */ 1248 1249 /* treasur2.c */ 1250 1251 #ifdef VMS 1252 /* uexit.c */ 1253 void uexit (); 1254 #endif 1255 1256 #ifdef unix 1257 /* unix.c */ 1258 int check_input(); 1259 #if 0 1260 int system_cmd(); 1261 #endif 1262 void user_name(); 1263 int tilde(); 1264 /* only declare this if stdio.h has been previously included, STDIO_LOADED 1265 is defined after stdio.h is included */ 1266 #if defined(STDIO_LOADED) 1267 FILE *tfopen(); 1268 #endif 1269 int topen(); 1270 #endif 1271 1272 /* variable.c */ 1273 1274 /* wands.c */ 1275 void aim(); 1276 1277 /* wizard.c */ 1278 void wizard_light(); 1279 void change_character(); 1280 void wizard_create(); 1281 1282 #endif 1283 1284 #ifdef unix 1285 /* call functions which expand tilde before calling open/fopen */ 1286 #define open topen 1287 #define fopen tfopen 1288 #endif 1289 1290 /* st-stuff.c for the atari ST */ 1291 #if defined(atarist) && defined(__GNUC__) 1292 extern char extended_file_name[80]; 1293 #endif 1294