Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
NetHack-collaboration/include/context.h at NetHack-3.7 · NetHack/NetHack-collaboration · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
See all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
NetHack
NetHack-collaboration
Repository navigation
Code
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
NetHack-3.7
Breadcrumbs
NetHack-collaboration
/
include
/
context.h
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
188 lines (166 loc) · 7.47 KB
NetHack-3.7
Breadcrumbs
NetHack-collaboration
/
include
/
context.h
Copy path
Top
File metadata and controls
Code
Blame
188 lines (166 loc) · 7.47 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
/* NetHack 3.7 context.h $NHDT-Date: 1753856387 2025/07/29 22:19:47 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.58 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2006. */
/* NetHack may be freely redistributed. See license for details. */
/* If you change the context structure make sure you increment EDITLEVEL in */
/* patchlevel.h if needed. */
#ifndef
CONTEXT_H
#define
CONTEXT_H
#define
CONTEXTVERBSZ
30
enum
nh_tips
{
TIP_ENHANCE
=
0
,
/* #enhance */
TIP_SWIM
,
/* walking into water */
TIP_UNTRAP_MON
,
/* walking into trapped peaceful */
TIP_GETPOS
,
/* getpos/farlook */
NUM_TIPS
};
/*
* The context structure houses things that the game tracks
* or adjusts during the game, to preserve game state or context.
*
* The entire structure is saved with the game.
*
*/
struct
dig_info
{
/* apply.c, hack.c */
int
effort
;
d_level
level
;
coord
pos
;
long
lastdigtime
;
boolean
down
,
chew
,
warned
,
quiet
;
};
struct
tin_info
{
struct
obj
*
tin
;
unsigned
o_id
;
/* o_id of tin in save file */
int
usedtime
,
reqtime
;
};
struct
book_info
{
struct
obj
*
book
;
/* last/current book being xscribed */
unsigned
o_id
;
/* o_id of book in save file */
schar
delay
;
/* moves left for this spell */
};
struct
takeoff_info
{
long
mask
;
long
what
;
int
delay
;
boolean
cancelled_don
;
char
disrobing
[
CONTEXTVERBSZ
+
1
];
};
struct
victual_info
{
struct
obj
*
piece
;
/* the thing being eaten, or last thing that
* was partially eaten, unless that thing was
* a tin, which uses the tin structure above,
* in which case this should be 0 */
unsigned
o_id
;
/* o_id of food object in save file */
/* doeat() initializes these when piece is valid */
int
usedtime
,
/* turns spent eating */
reqtime
;
/* turns required to eat */
int
nmod
;
/* coded nutrition per turn */
Bitfield
(
canchoke
,
1
);
/* was satiated at beginning */
/* start_eating() initializes these */
Bitfield
(
fullwarn
,
1
);
/* have warned about being full */
Bitfield
(
eating
,
1
);
/* victual currently being eaten */
Bitfield
(
doreset
,
1
);
/* stop eating at end of turn */
};
struct
engrave_info
{
char
text
[
BUFSZ
];
/* actual text being engraved - doengrave() handles all
the possible mutations of this */
char
*
nextc
;
/* next character(s) in text[] to engrave */
struct
obj
*
stylus
;
/* object doing the writing */
xint8
type
;
/* type of engraving (DUST, MARK, etc) */
coord
pos
;
/* location the engraving is being placed on */
int
actionct
;
/* nth turn spent engraving */
};
struct
warntype_info
{
unsigned long
obj
;
/* object warn_of_mon monster type M2 */
unsigned long
polyd
;
/* warn_of_mon monster type M2 due to poly */
struct
permonst
*
species
;
/* particular species due to poly */
short
speciesidx
;
/* index of above in mons[] (for save/restore) */
};
struct
polearm_info
{
struct
monst
*
hitmon
;
/* the monster we tried to hit last */
unsigned
m_id
;
/* monster id of hitmon, in save file */
};
struct
obj_split
{
unsigned
parent_oid
,
/* set: splitobj(), */
child_oid
;
/* reset: clear_splitobjs() */
};
struct
tribute_info
{
size_t
tributesz
;
/* make it possible to skip this in future */
boolean
enabled
;
/* Do we have tributes turned on? */
Bitfield
(
bookstock
,
1
);
/* Have we stocked the book? */
Bitfield
(
Deathnotice
,
1
);
/* Did Death notice the book? */
/* Markers for other tributes can go here */
/* 30 free bits */
};
struct
novel_tracking
{
/* for choosing random passage when reading novel */
unsigned
id
;
/* novel oid from previous passage selection */
int
count
;
/* number of passage indices available in pasg[] */
xint8
pasg
[
30
];
/* pasg[0..count-1] are passage indices */
/* tribute file is allowed to have more than 30 passages for a novel;
if it does, reading will first choose a random subset of 30 of them;
reading all 30 or switching to a different novel and then back again
will pick a new subset, independent of previous ones so might not
contain all--or even any--of the ones left out of the prior subset;
chatting with Death works the same as reading a novel except that
sometimes he delivers one of a few hardcoded messages rather than a
passage from the Death Quotes section of dat/tribute */
};
struct
achievement_tracking
{
unsigned
mines_prize_oid
,
/* luckstone->o_id */
soko_prize_oid
,
/* {bag or amulet}->o_id */
castle_prize_old
;
/* wand->o_id; not yet implemented */
/* record_achievement() wants the item type for livelog() event */
short
mines_prize_otyp
,
/* luckstone */
soko_prize_otyp
,
/* bag of holding or amulet of reflection */
castle_prize_otyp
;
/* strange object (someday wand of wishing) */
boolean
minetn_reached
;
/* avoid redundant checking for town entry */
};
struct
lifelists
{
long
total_seen_upclose
;
/* count of critters seen up close */
long
total_photographed
;
/* count of critters photographed (tourists) */
};
struct
context_info
{
unsigned
ident
;
/* social security number for each monster */
unsigned
no_of_wizards
;
/* 0, 1 or 2 (wizard and his shadow) */
unsigned
run
;
/* 0: h (etc), 1: H (etc), 2: fh (etc),
* 3: FH, 4: ff+, 5: ff-, 6: FF+, 7: FF-,
* 8: travel */
unsigned
startingpet_mid
;
/* monster id number for initial pet */
int
current_fruit
;
/* fruit->fid corresponding to svp.pl_fruit[] */
int
mysteryforce
;
/* adjusts how often "mysterious force" kicks in */
int
rndencode
;
/* randomized escape sequence introducer */
int
startingpet_typ
;
/* monster type for initial pet */
int
warnlevel
;
/* threshold (digit) to warn about unseen mons */
long
next_attrib_check
;
/* next attribute check */
long
seer_turn
;
/* when random clairvoyance will next kick in */
long
snickersnee_turn
;
/* Snickersnee last used to distance attack */
long
stethoscope_seq
;
/* when a stethoscope was last used; first use
* during a move takes no time, second uses move */
boolean
travel
;
/* find way automatically to u.tx,u.ty */
boolean
travel1
;
/* first travel step */
boolean
forcefight
;
boolean
nopick
;
/* do not pickup objects (as when running) */
boolean
made_amulet
;
boolean
mon_moving
;
/* monsters' turn to move */
boolean
move
;
boolean
mv
;
boolean
bypasses
;
/* bypass flag is set on at least one fobj */
boolean
door_opened
;
/* set to true if door was opened during test_move */
boolean
resume_wish
;
/* game was exited while in wish prompt */
boolean
tips
[
NUM_TIPS
];
struct
dig_info
digging
;
struct
victual_info
victual
;
struct
engrave_info
engraving
;
struct
tin_info
tin
;
struct
book_info
spbook
;
struct
takeoff_info
takeoff
;
struct
warntype_info
warntype
;
struct
polearm_info
polearm
;
struct
obj_split
objsplit
;
/* track most recently split object stack */
struct
tribute_info
tribute
;
struct
novel_tracking
novel
;
struct
achievement_tracking
achieveo
;
struct
lifelists
lifelist
;
char
jingle
[
5
+
1
];
};
#endif
/* CONTEXT_H */
You can’t perform that action at this time.