| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
#ifndef global |
| 11 |
#define global extern |
| 12 |
#define global_defined_exec |
| 13 |
#endif |
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
typedef struct { |
| 19 |
integer op; |
| 20 |
int arg1; |
| 21 |
int arg2; |
| 22 |
int optype; |
| 23 |
int argcnt; |
| 24 |
const opdef *opdata; |
| 25 |
const char *errmsg; |
| 26 |
rbool disambig; |
| 27 |
rbool negate; |
| 28 |
rbool failmsg; |
| 29 |
rbool endor; |
| 30 |
} op_rec; |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
global uchar do_disambig; |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
global rbool beforecmd; |
| 43 |
global rbool supress_debug; |
| 44 |
|
| 45 |
|
| 46 |
global rbool was_metaverb; |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
global integer oldloc; |
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
global integer subcall_arg; |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
global integer *creat_fix; |
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
void raw_lineout(const char *s, rbool do_repl, |
| 66 |
int context, const char *pword); |
| 67 |
void msgout(int msgnum,rbool add_nl); |
| 68 |
void sysmsg(int msgid,char *s); |
| 69 |
void alt_sysmsg(int msgid,char *s, |
| 70 |
parse_rec *new_dobjrec,parse_rec *new_iobjrec); |
| 71 |
void sysmsgd(int msgid,char *s,parse_rec *new_dobj_rec); |
| 72 |
|
| 73 |
rbool ask_question(int qnum); |
| 74 |
void increment_turn(void); |
| 75 |
|
| 76 |
|
| 77 |
rbool match_answer(char *ans, int anum); |
| 78 |
|
| 79 |
void look_room(void); |
| 80 |
void runptr(int i, descr_ptr dp[], char *msg, int msgid, |
| 81 |
parse_rec *nounrec,parse_rec *objrec); |
| 82 |
|
| 83 |
int normalize_time(int tnum); |
| 84 |
void add_time(int dt); |
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
parse_rec *make_parserec(int obj,parse_rec *rec); |
| 91 |
parse_rec *copy_parserec(parse_rec *rec); |
| 92 |
void free_all_parserec(void); |
| 93 |
|
| 94 |
rbool in_scope(int item); |
| 95 |
rbool islit(void); |
| 96 |
rbool it_possess(int item); |
| 97 |
rbool it_proper(int item); |
| 98 |
rbool it_isweapon(int item); |
| 99 |
rbool it_door(int obj,word noun); |
| 100 |
rbool is_within(integer obj1, integer obj2, rbool stop_if_closed); |
| 101 |
|
| 102 |
integer it_room(int item); |
| 103 |
|
| 104 |
int lightcheck(int parent,int roomlight,rbool active); |
| 105 |
|
| 106 |
|
| 107 |
#define it_move(a,b) it_reposition(a,b,0) |
| 108 |
#define it_destroy(item) it_move(item,0) |
| 109 |
#define get_obj(dobj) it_move(dobj,1) |
| 110 |
#define drop_obj(dobj) it_move(dobj,loc+first_room) |
| 111 |
|
| 112 |
void it_reposition(int item,int newloc,rbool save_pos); |
| 113 |
void goto_room(int newroom); |
| 114 |
|
| 115 |
void it_describe(int dobj); |
| 116 |
int print_contents(int obj,int ind_lev); |
| 117 |
|
| 118 |
void recompute_score(void); |
| 119 |
|
| 120 |
int check_fit(int obj1, int obj2); |
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
#define FIT_OK 0 |
| 125 |
#define FIT_WEIGHT 1 |
| 126 |
#define FIT_NETWEIGHT 2 |
| 127 |
#define FIT_SIZE 3 |
| 128 |
#define FIT_NETSIZE 4 |
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
long getprop(int obj, int prop); |
| 133 |
void setprop(int obj, int prop, long val); |
| 134 |
rbool getattr(int obj, int prop); |
| 135 |
void setattr(int obj, int prop, rbool val); |
| 136 |
|
| 137 |
rbool matchclass(int obj, int oclass); |
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
void v_inventory(void); |
| 145 |
void v_look(void); |
| 146 |
void v_listexit(void); |
| 147 |
|
| 148 |
|
| 149 |
void exec_verb(void); |
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
int scan_metacommand(integer m_actor,int vcode, |
| 158 |
integer m_dobj, word m_prep, integer m_iobj, |
| 159 |
int *redir_flag); |
| 160 |
|
| 161 |
|
| 162 |
rbool argvalid(int argtype,int arg); |
| 163 |
|
| 164 |
|
| 165 |
|
| 166 |
|
| 167 |
int exec_instr(op_rec *oprec); |
| 168 |
long pop_expr_stack(void); |
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
|
| 173 |
void get_debugcmd(void); |
| 174 |
|
| 175 |
|
| 176 |
|
| 177 |
|
| 178 |
|
| 179 |
|
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
#define contloop(i,obj) for(i=it_contents(obj);i!=0;i=it_next(i)) |
| 194 |
#define safecontloop(i,j,obj) for(i=it_contents(obj),j=it_next(i); \ |
| 195 |
i!=0;i=j,j=it_next(i)) |
| 196 |
|
| 197 |
#define cnt_val(c) ((c)==-1 ? 0 : (c)) |
| 198 |
|
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
#define it_on(item) nounattr(item,on) |
| 207 |
#define it_group(item) creatattr(item,groupmemb) |
| 208 |
#define it_adj(item) objattr(item,adj) |
| 209 |
#define it_pushable(item) nounattr(item,pushable) |
| 210 |
#define it_pullable(item) nounattr(item,pullable) |
| 211 |
#define it_turnable(item) nounattr(item,turnable) |
| 212 |
#define it_playable(item) nounattr(item,playable) |
| 213 |
#define it_plur(item) nounattr(item,plural) |
| 214 |
#define it_gender(item) creatattr(item,gender) |
| 215 |
|
| 216 |
#define it_pict(item) objattr(item,pict) |
| 217 |
#define it_class(item) anyattr(item,oclass) |
| 218 |
#define it_next(item) objattr(item,next) |
| 219 |
#define it_isglobal(item) objattr(item,isglobal) |
| 220 |
#define it_flagnum(item) objattr(item,flagnum) |
| 221 |
#define it_seen(item) anyattr(item,seen) |
| 222 |
|
| 223 |
|
| 224 |
#define it_name(item) objattr2(item,name,(item<0) ? -item : 0) |
| 225 |
#define it_open(item) nounattr2(item,open, tcreat(item) || \ |
| 226 |
(tdoor(item) && !room[loc].locked_door)) |
| 227 |
|
| 228 |
|
| 229 |
|
| 230 |
#define it_canmove(item) (!tnoun(item) || noun[(item)-first_noun].movable) |
| 231 |
|
| 232 |
|
| 233 |
#ifdef IT_MACRO |
| 234 |
#define it_contents(item) objattr2(item,contents,\ |
| 235 |
roomattr2(item,contents,\ |
| 236 |
(item==1) ? player_contents : \ |
| 237 |
(item==1000) ? player_worn : 0)) |
| 238 |
#define it_lockable(item) nounattr2(item,lockable, (tdoor(item) ? 1 : 0) ) |
| 239 |
#define it_locked(item,name) nounattr2(item,locked,\ |
| 240 |
(tdoor(item) && room[loc].locked_door ? \ |
| 241 |
1 : 0)) |
| 242 |
#else |
| 243 |
int it_contents(integer obj); |
| 244 |
rbool it_lockable(integer obj,word noun); |
| 245 |
rbool it_locked(integer obj, word noun); |
| 246 |
#endif |
| 247 |
|
| 248 |
|
| 249 |
#ifdef global_defined_exec |
| 250 |
#undef global |
| 251 |
#undef global_defined_exec |
| 252 |
#endif |
| 253 |
|
| 254 |
|