annotate srogue/rogue.h @ 295:1e1c81fbb533

Rogue V5: fix elemental wands. Bolts often failed to hit, due to some struct members not being initialized. Reported by 'LazyCat' from RogueTemple.
author John "Elwin" Edwards
date Fri, 12 Jan 2018 18:02:39 -0500
parents 5b6855d5d089
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
36
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
1 /*
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
2 * Rogue definitions and variable declarations
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
3 *
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
4 * @(#)rogue.h 9.0 (rdk) 7/17/84
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
5 *
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
6 * Super-Rogue
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
7 * Copyright (C) 1984 Robert D. Kindelberger
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
8 * All rights reserved.
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
9 *
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
10 * Based on "Rogue: Exploring the Dungeons of Doom"
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
11 * Copyright (C) 1980, 1981 Michael Toy, Ken Arnold and Glenn Wichman
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
12 * All rights reserved.
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
13 *
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
14 * See the file LICENSE.TXT for full copyright and licensing information.
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
15 */
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
16
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
17 #ifdef BSD
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
18 #include "cx.h"
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
19 #endif
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
20
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
21
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
22 #include <ctype.h>
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
23 #include <curses.h>
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
24
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
25 #ifdef ATT
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
26 #define CBREAK FALSE
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
27 #define _IOSTRG 01
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
28 #endif
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
29
101
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents: 36
diff changeset
30 #ifdef HAVE_CONFIG_H
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents: 36
diff changeset
31 #include "config.h"
191
fb25a62680c7 srogue: clean up configuration in mdport.c.
John "Elwin" Edwards
parents: 190
diff changeset
32 #elif defined(_WIN32) && defined(__PDCURSES__)
fb25a62680c7 srogue: clean up configuration in mdport.c.
John "Elwin" Edwards
parents: 190
diff changeset
33 #define HAVE_ERASECHAR
fb25a62680c7 srogue: clean up configuration in mdport.c.
John "Elwin" Edwards
parents: 190
diff changeset
34 #define HAVE_KILLCHAR
101
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents: 36
diff changeset
35 #endif
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents: 36
diff changeset
36
118
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
37 /* mdport functions */
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
38 #ifdef HAVE_SYS_TYPES_H
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
39 #include <sys/types.h>
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
40 #endif
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
41
192
3de8058dd549 srogue: provide type definitions if needed.
John "Elwin" Edwards
parents: 191
diff changeset
42 #ifndef uid_t
3de8058dd549 srogue: provide type definitions if needed.
John "Elwin" Edwards
parents: 191
diff changeset
43 typedef unsigned int uid_t;
3de8058dd549 srogue: provide type definitions if needed.
John "Elwin" Edwards
parents: 191
diff changeset
44 #endif
3de8058dd549 srogue: provide type definitions if needed.
John "Elwin" Edwards
parents: 191
diff changeset
45 #ifndef gid_t
3de8058dd549 srogue: provide type definitions if needed.
John "Elwin" Edwards
parents: 191
diff changeset
46 typedef unsigned int gid_t;
3de8058dd549 srogue: provide type definitions if needed.
John "Elwin" Edwards
parents: 191
diff changeset
47 #endif
3de8058dd549 srogue: provide type definitions if needed.
John "Elwin" Edwards
parents: 191
diff changeset
48
118
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
49 int md_chmod(const char *filename, int mode);
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
50 char *md_crypt(const char *key, const char *salt);
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
51 int md_dsuspchar(void);
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
52 int md_erasechar(void);
190
f4f6734771e0 srogue: add and use md_fdopen().
John "Elwin" Edwards
parents: 175
diff changeset
53 FILE * md_fdopen(int fd, char *mode);
118
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
54 char *md_gethomedir(void);
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
55 char *md_getusername(void);
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
56 uid_t md_getuid(void);
120
d6b7c3fb37ea srogue: add and use more md_* portable functions.
John "Elwin" Edwards
parents: 118
diff changeset
57 gid_t md_getgid(void);
118
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
58 char *md_getpass(char *prompt);
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
59 char *md_getrealname(uid_t uid);
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
60 void md_init(void);
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
61 int md_killchar(void);
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
62 void md_normaluser(void);
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
63 void md_raw_standout(void);
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
64 void md_raw_standend(void);
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
65 int md_readchar(WINDOW *win);
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
66 int md_setdsuspchar(int c);
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
67 int md_shellescape(void);
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
68 void md_sleep(int s);
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
69 int md_suspchar(void);
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
70 int md_unlink(char *file);
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
71 int md_unlink_open_file(const char *file, FILE *inf);
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
72 void md_tstpsignal(void);
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
73 void md_tstphold(void);
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
74 void md_tstpresume(void);
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
75 void md_ignoreallsignals(void);
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
76 void md_onsignal_autosave(void);
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
77 void md_onsignal_exit(void);
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
78 void md_onsignal_default(void);
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
79 int md_issymlink(char *sp);
120
d6b7c3fb37ea srogue: add and use more md_* portable functions.
John "Elwin" Edwards
parents: 118
diff changeset
80 long md_memused(void);
121
e6c8652473fe srogue: more compatibility improvements.
John "Elwin" Edwards
parents: 120
diff changeset
81 int md_random(void);
e6c8652473fe srogue: more compatibility improvements.
John "Elwin" Edwards
parents: 120
diff changeset
82 void md_srandom(unsigned int seed);
252
3d4252fa2ed3 Use more portable random seed generation.
John "Elwin" Edwards
parents: 234
diff changeset
83 unsigned int md_random_seed(void);
118
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
84 char *xcrypt(const char *key, const char *setting);
8d1dfc5a912c srogue: add a complete mdport.c.
John "Elwin" Edwards
parents: 101
diff changeset
85
36
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
86 #define reg register /* register abbr. */
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
87
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
88 /*
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
89 * Maximum number of different things
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
90 */
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
91
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
92 #define NCOLORS 32
2128c7dc8a40 Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff