Document explicitly what m-prefix does to each command
[aNetHack.git] / include / context.h
blobfc0c28dca75654138d21ca173ff3c036902e34c8
1 /* NetHack 3.6 context.h $NHDT-Date: 1455907260 2016/02/19 18:41:00 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.30 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* NetHack may be freely redistributed. See license for details. */
5 /* If you change the context structure make sure you increment EDITLEVEL in */
6 /* patchlevel.h if needed. */
8 #ifndef CONTEXT_H
9 #define CONTEXT_H
11 #define CONTEXTVERBSZ 30
14 * The context structure houses things that the game tracks
15 * or adjusts during the game, to preserve game state or context.
17 * The entire structure is saved with the game.
21 struct dig_info { /* apply.c, hack.c */
22 int effort;
23 d_level level;
24 coord pos;
25 long lastdigtime;
26 boolean down, chew, warned, quiet;
29 struct tin_info {
30 struct obj *tin;
31 unsigned o_id; /* o_id of tin in save file */
32 int usedtime, reqtime;
35 struct book_info {
36 struct obj *book; /* last/current book being xscribed */
37 unsigned o_id; /* o_id of book in save file */
38 schar delay; /* moves left for this spell */
41 struct takeoff_info {
42 long mask;
43 long what;
44 int delay;
45 boolean cancelled_don;
46 char disrobing[CONTEXTVERBSZ + 1];
49 struct victual_info {
50 struct obj *piece; /* the thing being eaten, or last thing that
51 * was partially eaten, unless that thing was
52 * a tin, which uses the tin structure above,
53 * in which case this should be 0 */
54 unsigned o_id; /* o_id of food object in save file */
55 /* doeat() initializes these when piece is valid */
56 int usedtime, /* turns spent eating */
57 reqtime; /* turns required to eat */
58 int nmod; /* coded nutrition per turn */
59 Bitfield(canchoke, 1); /* was satiated at beginning */
61 /* start_eating() initializes these */
62 Bitfield(fullwarn, 1); /* have warned about being full */
63 Bitfield(eating, 1); /* victual currently being eaten */
64 Bitfield(doreset, 1); /* stop eating at end of turn */
67 struct warntype_info {
68 unsigned long obj; /* object warn_of_mon monster type M2 */
69 unsigned long polyd; /* warn_of_mon monster type M2 due to poly */
70 struct permonst *species; /* particular species due to poly */
71 short speciesidx; /* index of above in mons[] (for save/restore) */
74 struct polearm_info {
75 struct monst *hitmon; /* the monster we tried to hit last */
76 unsigned m_id; /* monster id of hitmon, in save file */
79 struct obj_split {
80 unsigned parent_oid, /* set: splitobj(), */
81 child_oid; /* reset: clear_splitobjs() */
84 struct tribute_info {
85 size_t tributesz; /* make it possible to skip this in future */
86 boolean enabled; /* Do we have tributes turned on? */
87 Bitfield(bookstock, 1); /* Have we stocked the book? */
88 Bitfield(Deathnotice,1); /* Did Death notice the book? */
89 /* Markers for other tributes can go here */
90 /* 30 free bits */
93 struct novel_tracking { /* for choosing random passage when reading novel */
94 unsigned id; /* novel oid from previous passage selection */
95 int count; /* number of passage indices available in pasg[] */
96 xchar pasg[30]; /* pasg[0..count-1] are passage indices */
97 /* tribute file is allowed to have more than 30 passages for a novel;
98 if it does, reading will first choose a random subset of 30 of them;
99 reading all 30 or switching to a different novel and then back again
100 will pick a new subset, independent of previous ones so might not
101 contain all--or even any--of the ones left out of the prior subset;
102 chatting with Death works the same as reading a novel except that
103 sometimes he delivers one of a few hardcoded messages rather than a
104 passage from the Death Quotes section of dat/tribute */
107 struct context_info {
108 unsigned ident; /* social security number for each monster */
109 unsigned no_of_wizards; /* 0, 1 or 2 (wizard and his shadow) */
110 unsigned run; /* 0: h (etc), 1: H (etc), 2: fh (etc) */
111 /* 3: FH, 4: ff+, 5: ff-, 6: FF+, 7: FF- */
112 /* 8: travel */
113 unsigned startingpet_mid;
114 int current_fruit; /* fruit->fid corresponding to pl_fruit[] */
115 int warnlevel;
116 int rndencode; /* randomized escape sequence introducer */
117 long next_attrib_check; /* next attribute check */
118 long stethoscope_move;
119 short stethoscope_movement;
120 boolean travel; /* find way automatically to u.tx,u.ty */
121 boolean travel1; /* first travel step */
122 boolean forcefight;
123 boolean nopick; /* do not pickup objects (as when running) */
124 boolean made_amulet;
125 boolean mon_moving; /* monsters' turn to move */
126 boolean move;
127 boolean mv;
128 boolean bypasses; /* bypass flag is set on at least one fobj */
129 boolean botl; /* partially redo status line */
130 boolean botlx; /* print an entirely new bottom line */
131 boolean door_opened; /* set to true if door was opened during test_move */
132 struct dig_info digging;
133 struct victual_info victual;
134 struct tin_info tin;
135 struct book_info spbook;
136 struct takeoff_info takeoff;
137 struct warntype_info warntype;
138 struct polearm_info polearm;
139 struct obj_split objsplit; /* track most recently split object stack */
140 struct tribute_info tribute;
141 struct novel_tracking novel;
144 extern NEARDATA struct context_info context;
146 #endif /* CONTEXT_H */