1 /* NetHack 3.6 context.h $NHDT-Date: 1447653421 2015/11/16 05:57:01 $ $NHDT-Branch: master $:$NHDT-Revision: 1.28 $ */
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. */
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 */
26 boolean down, chew, warned, quiet;
31 unsigned o_id; /* o_id of tin in save file */
32 int usedtime, reqtime;
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 */
45 boolean cancelled_don;
46 char disrobing[CONTEXTVERBSZ + 1];
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) */
75 struct monst *hitmon; /* the monster we tried to hit last */
76 unsigned m_id; /* monster id of hitmon, in save file */
80 unsigned parent_oid, /* set: splitobj(), */
81 child_oid; /* reset: clear_splitobjs() */
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 */
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] are passage indices */
100 unsigned ident; /* social security number for each monster */
101 unsigned no_of_wizards; /* 0, 1 or 2 (wizard and his shadow) */
102 unsigned run; /* 0: h (etc), 1: H (etc), 2: fh (etc) */
103 /* 3: FH, 4: ff+, 5: ff-, 6: FF+, 7: FF- */
105 unsigned startingpet_mid;
106 int current_fruit; /* fruit->fid corresponding to pl_fruit[] */
108 int rndencode; /* randomized escape sequence introducer */
109 long next_attrib_check; /* next attribute check */
110 long stethoscope_move;
111 short stethoscope_movement;
112 boolean travel; /* find way automatically to u.tx,u.ty */
113 boolean travel1; /* first travel step */
115 boolean nopick; /* do not pickup objects (as when running) */
117 boolean mon_moving; /* monsters' turn to move */
120 boolean bypasses; /* bypass flag is set on at least one fobj */
121 boolean botl; /* partially redo status line */
122 boolean botlx; /* print an entirely new bottom line */
123 boolean door_opened; /* set to true if door was opened during test_move */
124 struct dig_info digging;
125 struct victual_info victual;
127 struct book_info spbook;
128 struct takeoff_info takeoff;
129 struct warntype_info warntype;
130 struct polearm_info polearm;
131 struct obj_split objsplit; /* track most recently split object stack */
132 struct tribute_info tribute;
133 struct novel_tracking novel;
136 extern NEARDATA struct context_info context;
138 #endif /* CONTEXT_H */