-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhack.h
820 lines (669 loc) · 18.5 KB
/
hack.h
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* hack.h - version 1.0.3 */
#include "config.h"
#include <stdarg.h>
#ifdef BSD
#include <strings.h> /* declarations for strcat etc. */
#else
#include <string.h> /* idem on System V */
#define index strchr
#define rindex strrchr
#endif /* BSD */
#define Null(type) ((struct type *) 0)
#include "def.objclass.h"
typedef struct {
xchar x,y;
} coord;
#include "def.monst.h" /* uses coord */
#include "def.gold.h"
#include "def.trap.h"
#include "def.obj.h"
#include "def.flag.h"
#include "def.mkroom.h"
#define plur(x) (((x) == 1) ? "" : "s")
#define BUFSZ 256 /* for getlin buffers */
#define PL_NSIZ 32 /* name of player, ghost, shopkeeper */
#include "def.rm.h"
#include "def.permonst.h"
#ifndef NOWORM
#include "def.wseg.h"
#endif /* NOWORM */
#define newstring(x) (char *) alloc((unsigned)(x))
#include "hack.onames.h"
#define ON 1
#define OFF 0
struct prop {
#define TIMEOUT 007777 /* mask */
#define LEFT_RING W_RINGL /* 010000L */
#define RIGHT_RING W_RINGR /* 020000L */
#define INTRINSIC 040000L
#define LEFT_SIDE LEFT_RING
#define RIGHT_SIDE RIGHT_RING
#define BOTH_SIDES (LEFT_SIDE | RIGHT_SIDE)
long p_flgs;
void (*p_tofn)(void); /* called after timeout */
};
struct you {
xchar ux, uy;
schar dx, dy, dz; /* direction of move (or zap or ... ) */
#ifdef QUEST
schar di; /* direction of FF */
xchar ux0, uy0; /* initial position FF */
#endif /* QUEST */
xchar udisx, udisy; /* last display pos */
char usym; /* usually '@' */
schar uluck;
#define LUCKMAX 10 /* on moonlit nights 11 */
#define LUCKMIN (-10)
int last_str_turn:3; /* 0: none, 1: half turn, 2: full turn */
/* +: turn right, -: turn left */
unsigned udispl:1; /* @ on display */
unsigned ulevel:4; /* 1 - 14 */
#ifdef QUEST
unsigned uhorizon:7;
#endif /* QUEST */
unsigned utrap:3; /* trap timeout */
unsigned utraptype:1; /* defined if utrap nonzero */
#define TT_BEARTRAP 0
#define TT_PIT 1
unsigned uinshop:6; /* used only in shk.c - (roomno+1) of shop */
/* perhaps these #define's should also be generated by makedefs */
#define TELEPAT LAST_RING /* not a ring */
#define Telepat u.uprops[TELEPAT].p_flgs
#define FAST (LAST_RING+1) /* not a ring */
#define Fast u.uprops[FAST].p_flgs
#define CONFUSION (LAST_RING+2) /* not a ring */
#define Confusion u.uprops[CONFUSION].p_flgs
#define INVIS (LAST_RING+3) /* not a ring */
#define Invis u.uprops[INVIS].p_flgs
#define Invisible (Invis && !See_invisible)
#define GLIB (LAST_RING+4) /* not a ring */
#define Glib u.uprops[GLIB].p_flgs
#define PUNISHED (LAST_RING+5) /* not a ring */
#define Punished u.uprops[PUNISHED].p_flgs
#define SICK (LAST_RING+6) /* not a ring */
#define Sick u.uprops[SICK].p_flgs
#define BLIND (LAST_RING+7) /* not a ring */
#define Blind u.uprops[BLIND].p_flgs
#define WOUNDED_LEGS (LAST_RING+8) /* not a ring */
#define Wounded_legs u.uprops[WOUNDED_LEGS].p_flgs
#define STONED (LAST_RING+9) /* not a ring */
#define Stoned u.uprops[STONED].p_flgs
#define PROP(x) (x-RIN_ADORNMENT) /* convert ring to index in uprops */
unsigned umconf:1;
char *usick_cause;
struct prop uprops[LAST_RING+10];
unsigned uswallow:1; /* set if swallowed by a monster */
unsigned uswldtim:4; /* time you have been swallowed */
unsigned uhs:3; /* hunger state - see hack.eat.c */
schar ustr,ustrmax;
schar udaminc;
schar uac;
int uhp,uhpmax;
long int ugold,ugold0,uexp,urexp;
int uhunger; /* refd only in eat.c and shk.c */
int uinvault;
struct monst *ustuck;
int nr_killed[CMNUM+2]; /* used for experience bookkeeping */
};
#define DIST(x1,y1,x2,y2) (((x1)-(x2))*((x1)-(x2)) + ((y1)-(y2))*((y1)-(y2)))
#define PL_CSIZ 20 /* sizeof pl_character */
#define MAX_CARR_CAP 120 /* so that boulders can be heavier */
#define MAXLEVEL 40
#define FAR (COLNO+2) /* position outside screen */
/* alloc.c */
extern long *alloc(unsigned lth);
extern long *enlarge(char *ptr, unsigned lth);
/* hack.Decl.c */
extern char nul[];
extern char plname[PL_NSIZ];
extern char lock[];
extern boolean in_mklev;
extern boolean restoring;
extern struct rm levl[COLNO][ROWNO];
#ifndef QUEST
extern struct mkroom rooms[MAXNROFROOMS+1];
extern coord doors[DOORMAX];
#endif
extern struct monst *fmon;
extern struct trap *ftrap;
extern struct gold *fgold;
extern struct obj *fobj;
extern struct obj *fcobj, *invent, *uwep, *uarm;
extern struct obj *uarm2, *uarmh, *uarms, *uarmg, *uright;
extern struct obj *uleft;
extern struct obj *uchain; /* defined iff PUNISHED */
extern struct obj *uball; /* defined if PUNISHED */
extern struct you u;
extern struct monst youmonst;
extern char *save_cm;
extern char *killer;
extern char *nomovemsg;
extern long moves;
extern long wailmsg;
extern int multi;
extern char genocided[60];
extern char fut_geno[60];
extern xchar curx, cury; /* cursor location on screen */
extern xchar seehx, seelx, seehy, seely; /* where to see */
extern coord bhitpos; /* place where thrown weapon falls to the ground */
extern char quitchars[];
/* hack.c */
void unsee(void);
void seeoff(int mode);
void domove(void);
int dopickup(void);
void pickup(int all);
void lookaround(void);
int monster_nearby(void);
int cansee(xchar x, xchar y);
int sgn(int a);
void setsee(void);
void nomul(int nval);
int abon(void);
int dbon(void);
void losestr(int num);
void losehp(int n, char *knam);
void losehp_m(int n, struct monst *mtmp);
void losexp(void);
int inv_weight(void);
long newuexp(void);
/* hack.apply.c */
int doapply(void);
int holetime(void);
void dighole(void);
/* hack.bones.c */
void savebones(void);
int getbones(void);
/* hack.cmd.c */
extern char sdir[];
extern schar xdir[];
extern schar ydir[];
void rhack(char *cmd);
int doextcmd(void);
int movecmd(char sym);
int getdir(boolean s);
void confdir(void);
#ifdef QUEST
void finddir(void);
#endif
int isok(int x, int y);
/* hack.do.c */
int dodrop(void);
void dropx(struct obj *obj);
void dropy(struct obj *obj);
int doddrop(void);
int dodown(void);
int doup(void);
void goto_level(int newlevel, boolean at_stairs);
int donull(void);
int dopray(void);
int dothrow(void);
struct obj *splitobj(struct obj *obj, int num);
void more_experienced(int exp, int rexp);
void set_wounded_legs(long side, int timex);
void heal_legs(void);
/* hack.do_name.c */
coord getpos(int force, char *goal);
int do_mname(void);
int ddocall(void);
void docall(struct obj *obj);
char *monnam(struct monst *mtmp);
char *Monnam(struct monst *mtmp);
char *amonnam(struct monst *mtmp, char *adj);
char *Amonnam(struct monst *mtmp, char *adj);
char *Xmonnam(struct monst *mtmp);
/* hack.do_wear.c */
int doremarm(void);
int doremring(void);
int armoroff(struct obj *otmp);
int doweararm(void);
int dowearring(void);
void ringoff(struct obj *obj);
void find_ac(void);
void glibr(void);
struct obj *some_armor(void);
void corrode_armor(void);
/* hack.dog.c */
extern struct permonst li_dog;
extern struct permonst dog;
extern struct permonst la_dog;
extern struct monst *mydogs;
extern struct monst *fallen_down;
void makedog(void);
void losedogs(void);
void keepdogs(void);
void fall_down(struct monst *mtmp);
int dog_move(struct monst *mtmp, int after);
int inroom(xchar x, xchar y);
int tamedog(struct monst *mtmp, struct obj *obj);
/* hack.eat.c */
extern char *hu_stat[];
void init_uhunger(void);
void gethungry(void);
void morehungry(int num);
void lesshungry(int num);
int poisonous(struct obj *otmp);
int doeat(void);
/* hack.end.c */
extern xchar maxdlevel;
extern int done_stopprint;
void done1(int);
int done1_wrap(void);
void done_in_by(struct monst *mtmp);
void done(char *st1);
void clearlocks(void);
#ifdef NOSAVEONHANGUP
void hangup(int signum);
#endif
char *eos(char *s);
void charcat(char *s, char c);
void prscore(int argc, char **argv);
/* hack.engrave.c */
int sengr_at(char *s, xchar x, xchar y);
void u_wipe_engr(int cnt);
void wipe_engr_at(xchar x, xchar y, xchar cnt);
void read_engr_at(int x, int y);
void make_engr_at(int x, int y, char *s);
int doengrave(void);
void save_engravings(int fd);
void rest_engravings(int fd);
/* hack.fight.c */
extern char mlarge[];
int hitmm(struct monst *magr, struct monst *mdef);
void mondied(struct monst *mdef);
int fightm(struct monst *mtmp);
int thitu(int tlev, int dam, char *name);
boolean hmon(struct monst *mon, struct obj *obj, int thrown);
int attack(struct monst *mtmp);
/* hack.invent.c */
extern struct wseg *m_atseg;
struct obj *addinv(struct obj *obj);
void useup(struct obj *obj);
void freeinv(struct obj *obj);
void delobj(struct obj *obj);
void freeobj(struct obj *obj);
void freegold(struct gold *gold);
void deltrap(struct trap *trap);
struct monst *m_at(int x, int y);
struct obj *o_at(int x, int y);
struct obj *sobj_at(int n, int x, int y);
int carried(struct obj *obj);
int carrying(int type);
struct obj *o_on(unsigned int id, struct obj *objchn);
struct trap *t_at(int x, int y);
struct gold *g_at(int x, int y);
struct obj *getobj(char *let, char *word);
int ggetobj(char *word, int (*fn)(), int max);
int askchain(struct obj *objchn, char *olets, int allflag, int (*fn)(),
int (*ckfn)(), int max);
void prinv(struct obj *obj);
int ddoinv(void);
int dotypeinv(void);
int dolook(void);
void stackobj(struct obj *obj);
int doprgold(void);
int doprwep(void);
int doprarm(void);
int doprring(void);
int digit(char c);
/* hack.ioctl.c */
void getioctls(void);
void setioctls(void);
#ifdef SUSPEND
int dosuspend();
#endif /* SUSPEND */
/* hack.lev.c */
extern boolean level_exists[];
void savelev(int fd, xchar lev);
void bwrite(int fd, char *loc, unsigned num);
void saveobjchn(int fd, struct obj *otmp);
void savemonchn(int fd, struct monst *mtmp);
void getlev(int fd, int pid, xchar lev);
void mread(int fd, char *buf, unsigned len);
void mklev(void);
/* hack.makemon.c */
struct monst *makemon(struct permonst *ptr, int x, int y);
coord enexto(xchar xx, xchar yy);
int goodpos(int x,int y);
void rloc(struct monst *mtmp);
struct monst *mkmon_at(char let, int x, int y);
/* hack.main.c */
extern int (*afternmv)();
extern int (*occupation)();
extern char *occtxt;
extern int hackpid;
extern int locknum;
#ifdef DEF_PAGER
extern char *catmore;
#endif
extern char SAVEF[];
extern char *hname;
void glo(int foo);
void askname(void);
void impossible(char *s, ...);
void stop_occupation(void);
/* hack.mhitu.c */
int mhitu(struct monst *mtmp);
int hitu(struct monst *mtmp, int dam);
/* hack.mklev.c */
struct mkroom;
extern int doorindex;
extern int nroom;
extern xchar dlevel; /* dungeon level */
extern xchar xupstair, yupstair;
extern xchar xdnstair, ydnstair;
void makelevel(void);
void mktrap(int num, int mazeflag, struct mkroom *croom);
/* hack.mkmaze.c */
void makemaz(void);
coord mazexy(void);
/* hack.mkobj.c */
extern struct obj zeroobj;
struct obj *mkobj_at(int let, int x, int y);
void mksobj_at(int otyp, int x, int y);
struct obj *mkobj(int let);
struct obj *mksobj(int otyp);
int letter(int c);
int weight(struct obj *obj);
void mkgold(long num, int x, int y);
/* hack.mkshop.c */
void mkshop(void);
void mkzoo(int type);
void mkswamp(void);
/* hack.mon.c */
void movemon(void);
void justswld(struct monst *mtmp, char *name);
void youswld(struct monst *mtmp, int dam, int die, char *name);
int dochug(struct monst *mtmp);
int m_move(struct monst *mtmp, int after);
int mfndpos(struct monst *mon, coord poss[9], int info[9], int flag);
int dist(int x, int y);
void poisoned(char *string, char *pname);
void mondead(struct monst *mtmp);
void replmon(struct monst *mtmp, struct monst *mtmp2);
void relmon(struct monst *mon);
void monfree(struct monst *mtmp);
void unstuck(struct monst *mtmp);
void killed(struct monst *mtmp);
void kludge(char *str, char *arg);
void rescham(void);
int newcham(struct monst *mtmp, struct permonst *mdat);
void mnexto(struct monst *mtmp);
void setmangry(struct monst *mtmp);
int canseemon(struct monst *mtmp);
/* hack.monst.c */
extern struct permonst mons[];
extern struct permonst pm_ghost;
extern struct permonst pm_wizard;
#ifdef MAIL
extern struct permonst pm_mail_daemon;
#endif /* MAIL */
extern struct permonst pm_eel;
/* hack.objnam.c */
char *typename(int otyp);
char *xname(struct obj *obj);
char *doname(struct obj *obj);
void setan(char *str, char *buf);
char *aobjnam(struct obj *otmp, char *verb);
char *Doname(struct obj *obj);
struct obj *readobjnam(char *bp);
/* hack.o_init.c */
extern struct objclass objects[];
extern char obj_symbols[];
extern int bases[];
int letindex(char let);
void init_objects(void);
int probtype(char let);
void oinit(void);
void savenames(int fd);
void restnames(int fd);
int dodiscovered(void);
/* hack.options.c */
void initoptions(void);
int doset(void);
/* hack.pager.c */
int dowhatis(void);
void set_whole_screen(void);
#ifdef NEWS
int readnews(void);
#endif
void set_pager(int mode);
int page_line(char *s);
void cornline(int mode, char *text);
int dohelp(void);
int page_file(char *fnam, boolean silent);
#ifdef UNIX
#ifdef SHELL
int dosh(void);
#endif /* SHELL */
int child(int wt);
#endif /* UNIX */
/* hack.potion.c */
int dodrink(void);
void pluslvl(void);
void strange_feeling(struct obj *obj, char *txt);
void potionhit(struct monst *mon, struct obj *obj);
void potionbreathe(struct obj *obj);
int dodip(void);
/* hack.pri.c */
void swallowed(void);
void panic(char *str, ...);
void atl(int x, int y, int ch);
void on_scr(int x, int y);
void tmp_at(schar x, schar y);
void Tmp_at(schar x, schar y);
void setclipped(void);
void at(xchar x, xchar y, char ch);
void prme(void);
int doredraw(void);
void docrt(void);
void docorner(int xmin, int ymax);
void curs_on_u(void);
void pru(void);
void prl(int x, int y);
char news0(xchar x, xchar y);
void newsym(int x, int y);
void mnewsym(int x, int y);
void nosee(int x, int y);
#ifndef QUEST
void prl1(int x, int y);
void nose1(int x, int y);
#endif
int vism_at(int x, int y);
#ifdef NEWSCR
void pobj(struct obj *obj);
#endif
void unpobj(struct obj *obj);
void seeobjs(void);
void seemons(void);
void pmon(struct monst *mon);
void unpmon(struct monst *mon);
void nscr(void);
void bot(void);
#ifdef WAN_PROBING
void mstatusline(struct monst *mtmp);
#endif
void cls(void);
/* hack.read.c */
int doread(void);
int identify(struct obj *otmp);
void litroom(boolean on);
/* hack.rip.c */
void outrip(void);
/* hack.rumors.c */
void outrumor(void);
/* hack.save.c */
int dosave(void);
#ifndef NOSAVEONHANGUP
void hangup(int signum);
#endif
int dorecover(int fd);
struct obj *restobjchn(int fd);
struct monst *restmonchn(int fd);
/* hack.search.c */
int findit(void);
int dosearch(void);
int doidtrap(void);
void wakeup(struct monst *mtmp);
void seemimic(struct monst *mtmp);
/* hack.shk.c */
extern struct obj *billobjs;
extern char shtypes[];
char *shkname(struct monst *mtmp);
void shkdead(struct monst *mtmp);
void replshk(struct monst *mtmp, struct monst *mtmp2);
int inshop(void);
int dopay(void);
void paybill(void);
void addtobill(struct obj *obj);
void subfrombill(struct obj *obj);
void splitbill(struct obj *obj, struct obj *otmp);
int doinvbill(int mode);
void obfree(struct obj *obj, struct obj *merge);
int shkcatch(struct obj *obj);
int shk_move(struct monst *shkp);
int online(int x, int y);
int follower(struct monst *mtmp);
void shopdig(int fall);
/* hack.shknam.c */
void findname(char *nampt, char let);
/* hack.steal.c */
long somegold(void);
void stealgold(struct monst *mtmp);
int steal(struct monst *mtmp);
void mpickobj(struct monst *mtmp, struct obj *otmp);
int stealamulet(struct monst *mtmp);
void relobj(struct monst *mtmp, int show);
/* hack.termcap.c */
extern char *CD;
extern int CO;
extern int LI;
void startup(void);
void start_screen(void);
void end_screen(void);
void curs(int x, int y);
void cl_end(void);
void clear_screen(void);
void home(void);
void standoutbeg(void);
void standoutend(void);
void backsp(void);
void bell(void);
void delay_output(void);
void cl_eos(void);
/* hack.timeout.c */
void timeout(void);
/* hack.topl.c */
int doredotopl(void);
void remember_topl(void);
void addtopl(char *s);
void more(void);
void cmore(char *s);
void clrlin(void);
void pline(char *line, ...);
void vpline(char *line, va_list args);
void putsym(char c);
void putstr(char *s);
/* hack.track.c */
void initrack(void);
void settrack(void);
coord *gettrack(int x, int y);
/* hack.trap.c */
extern char vowels[];
extern char *traps[];
struct trap *maketrap(int x, int y, int typ);
void dotrap(struct trap *trap);
int mintrap(struct monst *mtmp);
void selftouch(char *arg);
void float_up(void);
void float_down(void);
void tele(void);
int dotele(void);
void placebc(int attach);
void unplacebc(void);
void level_tele(void);
void drown(void);
/* hack.tty.c */
extern char morc;
void gettty(void);
void settty(char *s);
void setftty(void);
void error(char *s, ...);
void getlin(char *bufp);
void getret(void);
void cgetret(char *s);
void xwaitforspace(char *s);
char *parse(void);
char readchar(void);
void end_of_input(void);
/* hack.unix.c */
void setrandom(void);
int getyear(void);
char *getdate(void);
int phase_of_the_moon(void);
int night(void);
int midnight(void);
void gethdate(char *name);
int uptodate(int fd);
void getlock(void);
#ifdef MAIL
void getmailstatus(void);
void ckmailstatus(void);
void readmail(void);
#endif
void regularize(char *s);
/* hack.u_init.c */
extern char pl_character[PL_CSIZ];
void u_init(void);
void plnamesuffix(void);
/* hack.vault.c */
void setgd(void);
void invault(void);
int gd_move(void);
void gddead(void);
void replgd(struct monst *mtmp, struct monst *mtmp2);
/* hack.version.c */
int doversion(void);
/* hack.wield.c */
void setuwep(struct obj *obj);
int dowield(void);
void corrode_weapon(void);
int chwepon(struct obj *otmp, int amount);
/* hack.wizard.c */
void amulet(void);
int wiz_hit(struct monst *mtmp);
void inrange(struct monst *mtmp);
/* hack.worm.c */
#ifndef NOWORM
extern struct wseg *wsegs[32];
extern struct wseg *wheads[32];
extern long wgrowtime[32];
int getwn(struct monst *mtmp);
void initworm(struct monst *mtmp);
void worm_move(struct monst *mtmp);
void worm_nomove(struct monst *mtmp);
void wormdead(struct monst *mtmp);
void wormhit(struct monst *mtmp);
void wormsee(unsigned tmp);
void pwseg(struct wseg *wtmp);
void cutworm(struct monst *mtmp, xchar x, xchar y, uchar weptyp);
#endif
/* hack.worn.c */
void setworn(struct obj *obj, long mask);
void setnotworn(struct obj *obj);
/* hack.zap.c */
int dozap(void);
char *exclam(int force);
void hit(char *str, struct monst *mtmp, char *force);
void miss(char *str, struct monst *mtmp);
struct monst *bhit(int ddx, int ddy, int range, char sym, int (*fhitm)(),
int (*fhito)(), struct obj *obj);
struct monst *boomhit(int dx, int dy);
void buzz(int type, xchar sx, xchar sy, int dx, int dy);
void fracture_rock(struct obj *obj);
/* rnd.c */
int rn1(int x, int y);
int rn2(int x);
int rnd(int x);
int d(int n, int x);