-/* $NetBSD: rogue.h,v 1.4 1995/04/24 12:25:04 cgd Exp $ */
+/* $NetBSD: rogue.h,v 1.24 2013/08/11 03:44:27 dholland Exp $ */
/*
* Copyright (c) 1988, 1993
* 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
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
#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
#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
#define MAX_OPT_LEN 40
+#define MAX_ID_TITLE_LEN 64
struct id {
short value;
- char *title;
- char *real;
+ char title[MAX_ID_TITLE_LEN];
+ const char *real;
unsigned short id_status;
};
struct obj { /* comment is monster meaning */
unsigned long m_flags; /* monster flags */
- char *damage; /* damage it does */
+ const char *damage; /* damage it does */
short quantity; /* hit points to kill */
- short ichar; /* 'A' is for aquatar */
+ short ichar; /* 'A' is for aquator */
short kill_exp; /* exp for killing it */
short is_protected; /* level starts */
short is_cursed; /* level ends */
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 NULL
+#define INIT_RINGS NULL
+#define INIT_HP 12
+#define INIT_STR 16
+#define INIT_EXPLEVEL 1
+#define INIT_EXP 0
+#define INIT_PACK {0,NULL,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL}
+#define INIT_GOLD 0
+#define INIT_CHAR '@'
+#define INIT_MOVES 1250
struct fightr {
object *armor;
#define MAXROOMS 9
#define BIG_ROOM 10
-#define NO_ROOM -1
+#define NO_ROOM (-1)
-#define PASSAGE -3 /* cur_room value */
+#define PASSAGE (-3) /* cur_room value */
#define AMULET_LEVEL 26
extern struct id id_weapons[];
extern struct id id_armors[];
-extern object mon_tab[];
extern object level_monsters;
#define MONSTERS 26
#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 */
short second; /* 0 - 59 */
};
-#ifdef CURSES
-struct _win_st {
- short _cury, _curx;
- short _maxy, _maxx;
-};
-
-typedef struct _win_st WINDOW;
-
-extern int LINES, COLS;
-extern WINDOW *curscr;
-extern char *CL;
-
-char *md_gdtcf();
-
-#else
#include <curses.h>
-#endif
+
+/*
+ * external routine declarations.
+ */
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+object *alloc_object(void);
+object *get_letter_object(int);
+object *gr_monster(object *, int);
+object *gr_object(void);
+char *md_getenv(const char *);
+const char *
+ md_gln(void);
+void *md_malloc(size_t);
+const char *mon_name(const object *);
+const char *name_of(const object *);
+object *object_at(object *, short, short);
+object *pick_up(int, int, short *);
+void add_exp(int, boolean);
+void add_traps(void);
+void aggravate(void);
+void bounce(short, short, short, short, short);
+void byebye(int);
+void c_object_for_wizard(void);
+void call_it(void);
+boolean can_move(int, int, int, int);
+void check_gold_seeker(object *);
+boolean check_imitator(object *);
+void check_message(void);
+int check_up(void);
+void clean_up(const char *) __dead;
+void clear_level(void);
+void cnfs(void);
+int coin_toss(void);
+void cough_up(object *);
+void create_monster(void);
+void darken_room(short);
+void do_put_on(object *, boolean);
+void do_shell(void);
+void do_wear(object *);
+void do_wield(object *);
+void dr_course(object *, boolean, short, short);
+void draw_magic_map(void);
+void drop(void);
+int drop_check(void);
+void eat(void);
+void edit_opts(void);
+void error_save(int) __dead;
+void fight(boolean);
+boolean flame_broil(object *);
+void free_object(object *);
+void free_stuff(object *);
+int get_armor_class(const object *);
+int get_damage(const char *, boolean);
+void get_desc(const object *, char *, size_t);
+void get_dir_rc(short, short *, short *, short);
+char get_dungeon_char(short, short);
+void get_food(object *, boolean);
+int get_hit_chance(const object *);
+int get_input_line(const char *, const char *, char *, size_t, const char *, boolean, boolean);
+char get_mask_char(unsigned short);
+int get_number(const char *);
+int get_rand(int, int);
+short get_room_number(int, int);
+void get_wand_and_ring_materials(void);
+int get_weapon_damage(const object *);
+char gmc(object *);
+char gmc_row_col(int, int);
+char gr_obj_char(void);
+void gr_ring(object *, boolean);
+short gr_room(void);
+void gr_row_col(short *, short *, unsigned short);
+void hallucinate(void);
+boolean has_amulet(void);
+int hp_raise(void);
+void id_com(void);
+void id_trap(void);
+void id_type(void);
+boolean imitating(short, short);
+int init(int, char **);
+void insert_score(char [][82], char [][30], const char *, short, short, const object *, int);
+void inv_armor_weapon(boolean);
+void inv_rings(void);
+void inventory(const object *, unsigned short);
+boolean is_all_connected(void);
+boolean is_digit(int);
+boolean is_direction(short, short *);
+boolean is_passable(int, int);
+boolean is_vowel(short);
+void kick_into_pack(void);
+void killed_by(const object *, short) __dead;
+long lget_number(const char *);
+void light_passage(int, int);
+void light_up_room(int);
+boolean m_confuse(object *);
+void make_level(void);
+void make_scroll_titles(void);
+boolean md_df(const char *);
+void md_exit(int) __dead;
+void md_gct(struct rogue_time *);
+int md_get_file_id(const char *);
+void md_gfmt(const char *, struct rogue_time *);
+int md_gseed(void);
+void md_heed_signals(void);
+void md_ignore_signals(void);
+int md_link_count(const char *);
+void md_lock(boolean);
+void md_shell(const char *);
+void md_sleep(int);
+void md_slurp(void);
+/*void message(const char *, boolean);*/
+void messagef(boolean, const char *, ...) __printflike(2, 3);
+void mix_colors(void);
+int mon_can_go(const object *, short, short);
+int mon_damage(object *, short);
+void mon_hit(object *);
+boolean mon_sees(const object *, int, int);
+void move_mon_to(object *, short, short);
+void move_onto(void);
+void multiple_move_rogue(short);
+void mv_1_monster(object *, short, short);
+void mv_aquatars(void);
+void mv_mons(void);
+int name_cmp(char *, const char *);
+void nickize(char *, const char *, const char *);
+int one_move_rogue(short, short);
+void onintr(int);
+short pack_count(const object *);
+short pack_letter(const char *, unsigned short);
+void pad(const char *, short);
+void party_monsters(int, int);
+short party_objects(int);
+void place_at(object *, int, int);
+void play_level(void);
+void print_stats(int);
+void put_amulet(void);
+void put_mons(void);
+void put_objects(void);
+void put_on_ring(void);
+void put_player(short);
+void put_scores(const object *, short) __dead;
+void put_stairs(void);
+void quaff(void);
+void quit(boolean);
+int r_index(const char *, int, boolean);
+void rand_around(short, short *, short *);
+int rand_percent(int);
+void read_scroll(void);
+boolean reg_move(void);
+void relight(void);
+void remessage(short);
+void remove_ring(void);
+void rest(int);
+void restore(const char *);
+int rgetchar(void);
+void ring_stats(boolean);
+int rogue_can_see(int, int);
+void rogue_damage(short, object *, short);
+void rogue_hit(object *, boolean);
+void rust(object *);
+void s_con_mon(object *);
+void save_game(void);
+void save_into_file(const char *);
+void search(short, boolean);
+boolean seek_gold(object *);
+void show_average_hp(void);
+void show_monsters(void);
+void show_objects(void);
+void show_traps(void);
+void single_inv(short);
+void sound_bell(void);
+void special_hit(object *);
+void srrandom(int);
+void start_window(void);
+void stop_window(void);
+void take_a_nap(void);
+void take_from_pack(object *, object *);
+void take_off(void);
+void tele(void);
+void throw(void);
+void trap_player(short, short);
+void un_put_on(object *);
+void unblind(void);
+void unconfuse(void);
+void unhallucinate(void);
+void unwear(object *);
+void unwield(object *);
+void vanish(object *, short, object *);
+void wait_for_ack(void);
+void wake_room(short, boolean, short, short);
+void wake_up(object *);
+void wanderer(void);
+void wear(void);
+void wield(void);
+void win(void) __dead;
+void wizardize(void);
+long xxx(boolean);
+void xxxx(char *, short);
+void zapp(void);
+object *add_to_pack(object *, object *, int);
+struct id *get_id_table(const object *);
+
+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;
+#define HIT_MESSAGE_SIZE 80
+extern char hit_message[HIT_MESSAGE_SIZE];
+#define HUNGER_STR_LEN 8
+extern char hunger_str[HUNGER_STR_LEN];
+extern char login_name[MAX_OPT_LEN];
+extern const char *byebye_string;
+extern const char curse_message[];
+extern const char *error_file;
+extern char *fruit;
+extern const char *const m_names[];
+extern const char *more;
+extern const char *new_level_message;
+extern char *nick_name;
+extern const char *press_space;
+extern char *save_file;
+extern const char you_can_move_again[];
+extern const 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;
+extern gid_t gid;
+extern gid_t egid;