diff options
author | Paul Janzen <pjanzen@cvs.openbsd.org> | 1998-08-22 08:56:02 +0000 |
---|---|---|
committer | Paul Janzen <pjanzen@cvs.openbsd.org> | 1998-08-22 08:56:02 +0000 |
commit | 6910826c1b27cf6a9d4cb8400743d571d3c9a27b (patch) | |
tree | 9562c830236235b683790903daad5db093658719 /games/rogue/rogue.h | |
parent | 92cf145f2c1e59139400da3a8db7b06cc24b7b54 (diff) |
More largely NetBSD-inspired code cleanup
Diffstat (limited to 'games/rogue/rogue.h')
-rw-r--r-- | games/rogue/rogue.h | 472 |
1 files changed, 418 insertions, 54 deletions
diff --git a/games/rogue/rogue.h b/games/rogue/rogue.h index e3632952dc2..983b2991c1b 100644 --- a/games/rogue/rogue.h +++ b/games/rogue/rogue.h @@ -1,3 +1,4 @@ +/* $OpenBSD: rogue.h,v 1.3 1998/08/22 08:55:43 pjanzen Exp $ */ /* $NetBSD: rogue.h,v 1.4 1995/04/24 12:25:04 cgd Exp $ */ /* @@ -5,7 +6,7 @@ * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by - * Timoth C. Stoehr. + * Timothy C. Stoehr. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -46,7 +47,7 @@ * 1.) This notice shall not be removed. * 2.) Credit shall not be taken for the creation of this source. * 3.) This code is not to be traded, sold, or used for personal - * gain or profit. + * gain or profit. */ #define boolean char @@ -155,13 +156,13 @@ #define RATION 0 #define FRUIT 1 -#define NOT_USED ((unsigned short) 0) +#define NOT_USED ((unsigned short) 0) #define BEING_WIELDED ((unsigned short) 01) -#define BEING_WORN ((unsigned short) 02) +#define BEING_WORN ((unsigned short) 02) #define ON_LEFT_HAND ((unsigned short) 04) #define ON_RIGHT_HAND ((unsigned short) 010) #define ON_EITHER_HAND ((unsigned short) 014) -#define BEING_USED ((unsigned short) 017) +#define BEING_USED ((unsigned short) 017) #define NO_TRAP -1 #define TRAP_DOOR 0 @@ -175,9 +176,9 @@ #define STEALTH_FACTOR 3 #define R_TELE_PERCENT 8 -#define UNIDENTIFIED ((unsigned short) 00) /* MUST BE ZERO! */ -#define IDENTIFIED ((unsigned short) 01) -#define CALLED ((unsigned short) 02) +#define UNIDENTIFIED ((unsigned short) 00) /* MUST BE ZERO! */ +#define IDENTIFIED ((unsigned short) 01) +#define CALLED ((unsigned short) 02) #define DROWS 24 #define DCOLS 80 @@ -245,15 +246,16 @@ struct obj { /* comment is monster meaning */ typedef struct obj object; -#define INIT_AW (object*)0,(object*)0 -#define INIT_RINGS (object*)0,(object*)0 -#define INIT_HP 12,12 -#define INIT_STR 16,16 -#define INIT_EXP 1,0 -#define INIT_PACK {0} -#define INIT_GOLD 0 -#define INIT_CHAR '@' -#define INIT_MOVES 1250 +#define INIT_AW (object*)0 +#define INIT_RINGS (object*)0 +#define INIT_HP 12 +#define INIT_STR 16 +#define INIT_EXPLEVEL 1 +#define INIT_EXP 0 +#define INIT_PACK {0} +#define INIT_GOLD 0 +#define INIT_CHAR '@' +#define INIT_MOVES 1250 struct fightr { object *armor; @@ -426,42 +428,6 @@ extern object level_monsters; #define MIN_ROW 1 -/* external routine declarations. - */ -#include <string.h> - -char *mon_name(); -char *get_ench_color(); -char *name_of(); -char *md_gln(); -char *md_getenv(); -char *md_malloc(); -boolean is_direction(); -boolean mon_sees(); -boolean mask_pack(); -boolean mask_room(); -boolean is_digit(); -boolean check_hunger(); -boolean reg_move(); -boolean md_df(); -boolean has_been_touched(); -object *add_to_pack(); -object *alloc_object(); -object *get_letter_object(); -object *gr_monster(); -object *get_thrown_at_monster(); -object *get_zapped_monster(); -object *check_duplicate(); -object *gr_object(); -object *object_at(); -object *pick_up(); -struct id *get_id_table(); -unsigned short gr_what_is(); -long rrandom(); -long lget_number(); -long xxx(); -void byebye(), onintr(), error_save(); - struct rogue_time { short year; /* >= 1987 */ short month; /* 1 - 12 */ @@ -479,12 +445,410 @@ struct _win_st { typedef struct _win_st WINDOW; +#ifndef FALSE +#define FALSE 0 +#endif + extern int LINES, COLS; extern WINDOW *curscr; extern char *CL; -char *md_gdtcf(); +void initscr __P((void)); +void endwin __P((void)); +void move __P((short, short)); +void mvaddstr __P((short, short, char *)); +void addstr __P((char *)); +void addch __P((int)); +void mvaddch __P((short, short, int)); +void refresh __P((void)); +void wrefresh __P((WINDOW *scr)); +int mvinch __P((short, short)); +void clear __P((void)); +void clrtoeol __P((void)); +void standout __P((void)); +void standend __P((void)); +void crmode __P((void)); +void noecho __P((void)); +void nonl __P((void)); +void clear_buffers __P((void)); +void put_char_at __P((short, short, int)); +void put_cursor __P((short, short)); +void put_st_char __P((int)); +void get_term_info __P((void)); +boolean tc_tname __P((FILE *, char *, char *)); +void tc_gtdata __P((FILE *, char *)); +void tc_gets __P((char *, char **)); +void tc_gnum __P((char *, int *)); +void tstp __P((void)); +void tc_cmget __P((void)); #else #include <curses.h> #endif + +/* + * external routine declarations. + */ +#include <sys/types.h> +#include <stdio.h> +#include <string.h> +#include <unistd.h> + +object *alloc_object __P((void)); +object *check_duplicate __P((object *, object *)); +char *get_ench_color __P((void)); +object *get_letter_object __P((int)); +object *get_thrown_at_monster __P((object *, short, short *, short *)); +object *get_zapped_monster __P((short, short *, short *)); +object *gr_monster __P((object *, int)); +object *gr_object __P((void)); +char *md_getenv __P((char *)); +char *md_gln __P((void)); +char *md_malloc __P((int)); +char *mon_name __P((object *)); +char *name_of __P((object *)); +object *object_at __P((object *, short, short)); +object *pick_up __P((short, short, short *)); +void add_exp __P((int, boolean)); +void add_mazes __P((void)); +void add_traps __P((void)); +void aggravate __P((void)); +void aim_monster __P((object *)); +void bounce __P((short, short, short, short, short)); +void byebye __P((int)); +void c_object_for_wizard __P((void)); +void call_it __P((void)); +boolean can_move __P((short, short, short, short)); +boolean can_turn __P((short, short)); +void center __P((short, char *)); +void check_gold_seeker __P((object *)); +boolean check_hunger __P((boolean)); +boolean check_imitator __P((object *)); +void check_message __P((void)); +int check_up __P((void)); +void clean_up __P((char *)); +void clear_level __P((void)); +void cnfs __P((void)); +int coin_toss __P((void)); +int connect_rooms __P((short, short)); +void cough_up __P((object *)); +void create_monster __P((void)); +int damage_for_strength __P((void)); +void darken_room __P((short)); +void disappear __P((object *)); +void do_args __P((int, char **)); +void do_opts __P((void)); +void do_put_on __P((object *, boolean)); +void do_shell __P((void)); +void do_wear __P((object *)); +void do_wield __P((object *)); +void dr_course __P((object *, boolean, short, short)); +void drain_life __P((void)); +void draw_magic_map __P((void)); +void draw_simple_passage __P((short, short, short, short, short)); +void drop __P((void)); +int drop_check __P((void)); +void drop_level __P((void)); +void eat __P((void)); +void edit_opts __P((void)); +void env_get_value __P((char **, char *, boolean)); +void error_save __P((int)); +void fight __P((int)); +void fill_it __P((int, boolean)); +void fill_out_level __P((void)); +boolean flame_broil __P((object *)); +int flit __P((object *)); +void flop_weapon __P((object *, short, short)); +void free_object __P((object *)); +void free_stuff __P((object *)); +void freeze __P((object *)); +int get_armor_class __P((object *)); +int get_com_id __P((int *, short)); +int get_damage __P((char *, boolean)); +void get_desc __P((object *, char *)); +int get_dir __P((short, short, short, short)); +void get_dir_rc __P((short, short *, short *, short)); +char get_dungeon_char __P((short, short)); +int get_exp_level __P((long)); +void get_food __P((object *, boolean)); +int get_hit_chance __P((object *)); +int get_input_line __P((char *, char *, char *, char *, boolean, boolean)); +char get_mask_char __P((unsigned short)); +int get_number __P((char *)); +boolean get_oth_room __P((short, short *, short *)); +int get_rand __P((int, int)); +short get_room_number __P((short, short)); +int get_value __P((object *)); +int get_w_damage __P((object *)); +void get_wand_and_ring_materials __P((void)); +int get_weapon_damage __P((object *)); +char gmc __P((object *)); +char gmc_row_col __P((short, short)); +void go_blind __P((void)); +boolean gold_at __P((short, short)); +void gr_armor __P((object *)); +char gr_dir __P((void)); +char gr_obj_char __P((void)); +void gr_potion __P((object *)); +void gr_ring __P((object *, boolean)); +short gr_room __P((void)); +void gr_row_col __P((short *, short *, unsigned short)); +void gr_scroll __P((object *)); +void gr_wand __P((object *)); +void gr_weapon __P((object *, int)); +void hallucinate __P((void)); +boolean has_amulet __P((void)); +boolean has_been_touched __P((struct rogue_time *, struct rogue_time *)); +void heal __P((void)); +void hide_boxed_passage __P((short, short, short, short, short)); +void hold_monster __P((void)); +int hp_raise __P((void)); +void id_all __P((void)); +void id_com __P((void)); +void id_trap __P((void)); +void id_type __P((void)); +void idntfy __P((void)); +boolean imitating __P((short, short)); +int init __P((int, char **)); +void init_str __P((char **, char *)); +void insert_score __P((char [][], char [][], char *, short, short, object *, int)); +void inv_armor_weapon __P((boolean)); +void inv_rings __P((void)); +void inventory __P((object *, unsigned short)); +boolean is_all_connected __P((void)); +boolean is_digit __P((int)); +boolean is_direction __P((short, short *)); +boolean is_pack_letter __P((short *, unsigned short *)); +boolean is_passable __P((short, short)); +boolean is_vowel __P((short)); +void kick_into_pack __P((void)); +void killed_by __P((object *, short)); +long lget_number __P((char *)); +void light_passage __P((short, short)); +void light_up_room __P((int)); +boolean m_confuse __P((object *)); +void make_level __P((void)); +void make_maze __P((short, short, short, short, short, short)); +void make_party __P((void)); +void make_room __P((short, short, short, short)); +void make_scroll_titles __P((void)); +boolean mask_pack __P((object *, unsigned short)); +boolean mask_room __P((short, short *, short *, unsigned short)); +void md_cbreak_no_echo_nonl __P((boolean)); +boolean md_df __P((char *)); +void md_exit __P((int)); +void md_gct __P((struct rogue_time *)); +char *md_gdtcf __P((void)); +int md_get_file_id __P((char *)); +void md_gfmt __P((char *, struct rogue_time *)); +int md_gseed __P((void)); +void md_heed_signals __P((void)); +void md_ignore_signals __P((void)); +int md_link_count __P((char *)); +void md_lock __P((boolean)); +void md_shell __P((char *)); +void md_sleep __P((int)); +void md_slurp __P((void)); +void md_tstp __P((void)); +void message __P((char *, boolean)); +void mix_colors __P((void)); +void mix_colors __P((void)); +void mix_random_rooms __P((void)); +int mon_can_go __P((object *, short, short)); +int mon_damage __P((object *, short)); +void mon_hit __P((object *)); +boolean mon_sees __P((object *, short, short)); +int move_confused __P((object *)); +void move_mon_to __P((object *, short, short)); +void move_onto __P((void)); +int mtry __P((object *, short, short)); +void multiple_move_rogue __P((short)); +void mv_1_monster __P((object *, short, short)); +void mv_aquatars __P((void)); +void mv_mons __P((void)); +int name_cmp __P((char *, char *)); +short next_avail_ichar __P((void)); +boolean next_to_something __P((short, short)); +void nickize __P((char *, char *, char *)); +int no_room_for_monster __P((int)); +int one_move_rogue __P((short, short)); +void onintr __P((int)); +void opt_erase __P((int)); +void opt_go __P((int)); +void opt_show __P((int)); +short pack_count __P((object *)); +short pack_letter __P((char *, unsigned short)); +void pad __P((char *, short)); +void party_monsters __P((int, int)); +short party_objects __P((int)); +void place_at __P((object *, short, short)); +void plant_gold __P((short, short, boolean)); +void play_level __P((void)); +void player_init __P((void)); +void player_init __P((void)); +void potion_heal __P((int)); +int pr_com_id __P((int)); +int pr_motion_char __P((int)); +void print_stats __P((int)); +void put_amulet __P((void)); +void put_door __P((room *, short, short *, short *)); +void put_gold __P((void)); +void put_m_at __P((short, short, object *)); +void put_mons __P((void)); +void put_objects __P((void)); +void put_on_ring __P((void)); +void put_player __P((short)); +void put_scores __P((object *, short)); +void put_stairs __P((void)); +void quaff __P((void)); +void quit __P((boolean)); +int r_index __P((char *, int, boolean)); +void r_read __P((FILE *, char *, int)); +void r_write __P((FILE *, char *, int)); +void rand_around __P((short, short *, short *)); +int rand_percent __P((int)); +void rand_place __P((object *)); +void read_pack __P((object *, FILE *, boolean)); +void read_scroll __P((void)); +void read_string __P((char *, FILE *)); +void recursive_deadend __P((short, short *, short, short)); +boolean reg_move __P((void)); +void relight __P((void)); +void remessage __P((short)); +void remove_ring __P((void)); +void rest __P((int)); +void restore __P((char *)); +int rgetchar __P((void)); +void ring_stats __P((boolean)); +int rogue_can_see __P((short, short)); +void rogue_damage __P((short, object *, short)); +void rogue_hit __P((object *, boolean)); +int rogue_is_around __P((short, short)); +long rrandom __P((void)); +void rust __P((object *)); +void rw_dungeon __P((FILE *, boolean)); +void rw_id __P((struct id *, FILE *, int, boolean)); +void rw_rooms __P((FILE *, boolean)); +void s_con_mon __P((object *)); +int same_col __P((int, int)); +int same_row __P((int, int)); +void save_game __P((void)); +void save_into_file __P((char *)); +void save_screen __P((void)); +void search __P((short, boolean)); +boolean seek_gold __P((object *)); +void sell_pack __P((void)); +void sf_error __P((void)); +void show_average_hp __P((void)); +void show_monsters __P((void)); +void show_objects __P((void)); +void show_traps __P((void)); +void single_inv __P((short)); +void sound_bell __P((void)); +void special_hit __P((object *)); +void srrandom __P((int)); +void start_window __P((void)); +void start_window __P((void)); +void steal_gold __P((object *)); +void steal_item __P((object *)); +void sting __P((object *)); +void stop_window __P((void)); +void stop_window __P((void)); +void take_a_nap __P((void)); +void take_from_pack __P((object *, object *)); +void take_off __P((void)); +void tele __P((void)); +void tele_away __P((object *)); +void throw __P((void)); +boolean throw_at_monster __P((object *, object *)); +int to_hit __P((object *)); +short trap_at __P((short, short)); +void trap_player __P((short, short)); +boolean try_to_cough __P((short, short, object *)); +void turn_passage __P((short, boolean)); +void un_put_on __P((object *)); +void unblind __P((void)); +void unconfuse __P((void)); +void uncurse_all __P((void)); +void unhallucinate __P((void)); +void unwear __P((object *)); +void unwield __P((object *)); +void vanish __P((object *, short, object *)); +void visit_rooms __P((int)); +void wait_for_ack __P((void)); +void wake_room __P((short, boolean, short, short)); +void wake_up __P((object *)); +void wanderer __P((void)); +void wdrain_life __P((object *)); +void wear __P((void)); +void wield __P((void)); +void win __P((void)); +void wizardize __P((void)); +void write_pack __P((object *, FILE *)); +void write_string __P((char *, FILE *)); +long xxx __P((boolean)); +void xxxx __P((char *, short)); +void zap_monster __P((object *, unsigned short)); +void zapp __P((void)); +object *add_to_pack __P((object *, object *, int)); +struct id *get_id_table __P((object *)); +unsigned short gr_what_is __P((void)); + +extern boolean ask_quit; +extern boolean being_held; +extern boolean cant_int; +extern boolean con_mon; +extern boolean detect_monster; +extern boolean did_int; +extern boolean interrupted; +extern boolean is_wood[]; +extern boolean jump; +extern boolean maintain_armor; +extern boolean mon_disappeared; +extern boolean msg_cleared; +extern boolean no_skull; +extern boolean passgo; +extern boolean r_see_invisible; +extern boolean r_teleport; +extern boolean save_is_interactive; +extern boolean score_only; +extern boolean see_invisible; +extern boolean sustain_strength; +extern boolean trap_door; +extern boolean wizard; +extern char hit_message[]; +extern char hunger_str[]; +extern char login_name[]; +extern char *byebye_string; +extern char *curse_message; +extern char *error_file; +extern char *fruit; +extern char *m_names[]; +extern char *more; +extern char *new_level_message; +extern char *nick_name; +extern char *press_space; +extern char *save_file; +extern char *you_can_move_again; +extern long level_points[]; +extern short add_strength; +extern short auto_search; +extern short bear_trap; +extern short blind; +extern short confused; +extern short cur_level; +extern short cur_room; +extern short e_rings; +extern short extra_hp; +extern short foods; +extern short halluc; +extern short haste_self; +extern short less_hp; +extern short levitate; +extern short m_moves; +extern short max_level; +extern short party_room; +extern short r_rings; +extern short regeneration; +extern short ring_exp; +extern short stealthy; |