-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrogue.c
1432 lines (1407 loc) · 39.6 KB
/
rogue.c
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
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* global variable declaration
*
* Advanced Rogue
* Copyright (C) 1984, 1985 Michael Morgan, Ken Dalka and AT&T
* All rights reserved.
*
* Based on "Rogue: Exploring the Dungeons of Doom"
* Copyright (C) 1980, 1981 Michael Toy, Ken Arnold and Glenn Wichman
* All rights reserved.
*
* See the file LICENSE.TXT for full copyright and licensing information.
*/
#include <ctype.h>
#include "curses.h"
#include "rogue.h"
/*
* Now all the global variables
*/
struct trap traps[MAXTRAPS];
struct room rooms[MAXROOMS]; /* One for each room -- A level */
struct room *oldrp; /* Roomin(&player.t_oldpos) */
struct thing player; /* The rogue */
struct object *cur_armor; /* What a well dresssed rogue wears */
struct object *cur_ring[NUM_FINGERS]; /* Which rings are being worn */
struct object *cur_misc[NUM_MM]; /* which MM's are in use */
int cur_relic[MAXRELIC]; /* Currently used relics */
struct linked_list *lvl_obj = NULL;
struct linked_list *mlist = NULL;
struct linked_list *tlist = NULL; /* list of monsters fallen down traps */
struct linked_list *monst_dead = NULL; /* monster killed by monster */
struct object *cur_weapon = NULL;
int char_type = -1; /* what type of character is player */
int foodlev = 1; /* how fast he eats food */
int ntraps; /* Number of traps on this level */
int trader = 0; /* no. of purchases */
int curprice = -1; /* current price of item */
int no_move; /* Number of turns held in place */
int seed; /* Random number seed */
int dnum; /* Dungeon number */
int max_level; /* Deepest player has gone ever */
int cur_max; /* Deepest player has gone currently */
int lost_dext; /* amount of lost dexterity */
int mpos = 0;
int no_command = 0;
int level = 1;
int purse = 0;
int inpack = 0;
int total = 0;
int no_food = 0; /* how long has he gone with no food */
int foods_this_level = 0; /* foods made per level */
int count = 0;
int food_left = HUNGERTIME;
int group = 1;
int hungry_state = F_OKAY;
int infest_dam=0;
int lost_str=0;
int lastscore = -1;
int hold_count = 0;
int trap_tries = 0;
int pray_time = 0;
int spell_power = 0;
int turns = 0; /* Number of turns player has taken */
int quest_item = 0; /* Item player is looking for */
char nfloors = -1; /* Number of floors in this dungeon */
char curpurch[15]; /* name of item ready to buy */
char PLAYER = VPLAYER; /* what the player looks like */
char take; /* Thing the rogue is taking */
char prbuf[LINELEN*2]; /* Buffer for sprintfs */
char outbuf[BUFSIZ]; /* Output buffer for stdout */
char runch; /* Direction player is running */
char *s_names[MAXSCROLLS]; /* Names of the scrolls */
char *p_colors[MAXPOTIONS]; /* Colors of the potions */
char *r_stones[MAXRINGS]; /* Stone settings of the rings */
char *ws_made[MAXSTICKS]; /* What sticks are made of */
char whoami[LINELEN]; /* Name of player */
char fruit[LINELEN]; /* Favorite fruit */
char huh[LINELEN]; /* The last message printed */
char *s_guess[MAXSCROLLS]; /* Players guess at what scroll is */
char *p_guess[MAXPOTIONS]; /* Players guess at what potion is */
char *r_guess[MAXRINGS]; /* Players guess at what ring is */
char *ws_guess[MAXSTICKS]; /* Players guess at what wand is */
char *m_guess[MAXMM]; /* Players guess at what MM is */
char *ws_type[MAXSTICKS]; /* Is it a wand or a staff */
char file_name[LINELEN]; /* Save file name */
char score_file[LINELEN]; /* Score file name */
char home[LINELEN]; /* User's home directory */
WINDOW *cw; /* Window that the player sees */
WINDOW *hw; /* Used for the help command */
WINDOW *mw; /* Used to store mosnters */
WINDOW *msgw; /* Used to display messages */
bool pool_teleport = FALSE; /* just teleported from a pool */
bool inwhgt = FALSE; /* true if from wghtchk() */
bool after; /* True if we want after daemons */
bool waswizard; /* Was a wizard sometime */
bool s_know[MAXSCROLLS]; /* Does he know what a scroll does */
bool p_know[MAXPOTIONS]; /* Does he know what a potion does */
bool r_know[MAXRINGS]; /* Does he know what a ring does */
bool ws_know[MAXSTICKS]; /* Does he know what a stick does */
bool m_know[MAXMM]; /* Does he know what a MM does */
bool playing = TRUE;
bool running = FALSE;
bool wizard = FALSE;
bool notify = TRUE;
bool fight_flush = FALSE;
bool terse = FALSE;
bool auto_pickup = TRUE;
bool door_stop = FALSE;
bool jump = FALSE;
bool slow_invent = FALSE;
bool firstmove = FALSE;
bool askme = FALSE;
bool in_shell = FALSE;
bool daytime = TRUE;
coord delta; /* Change indicated to get_dir() */
LEVTYPE levtype; /* type of level i'm on */
char *nothing = "Nothing seems to happen.";
char *spacemsg = "--Press space to continue--";
char *morestr = "-- More --";
char *retstr = "[Press return to continue]";
/*
* NOTE: the ordering of the points in this array is critical. They MUST
* be listed in the following sequence:
*
* 7 4 6
* 1 0 2
* 5 3 8
*/
coord grid[9] = {{0,0},
{ 0,-1}, { 0, 1}, {-1, 0}, { 1, 0},
{-1,-1}, { 1, 1}, { 1,-1}, {-1, 1}
};
struct death_type deaths[DEATHNUM] = {
{ D_ARROW, "an arrow"},
{ D_DART, "a dart"},
{ D_BOLT, "a bolt"},
{ D_POISON, "poison"},
{ D_POTION, "a cursed potion"},
{ D_PETRIFY, "petrification"},
{ D_SUFFOCATION, "suffocation"},
{ D_INFESTATION, "a parasite"},
{ D_DROWN, "drowning"},
{ D_ROT, "body rot"},
{ D_CONSTITUTION, "poor health"},
{ D_STRENGTH, "being too weak"},
{ D_SIGNAL, "a bug"},
{ D_CHOKE, "dust of choking"},
{ D_STRANGLE, "strangulation"},
{ D_FALL, "a fall"},
{ D_RELIC, "an artifact's wrath"},
};
/*
* weapons and their attributes
*/
struct init_weps weaps[MAXWEAPONS] = {
{ "mace", "2d4", "1d3", NONE, ISMETAL, 100, 8 },
{ "long sword", "1d12", "1d2", NONE, ISMETAL, 60, 18 },
{ "short bow", "1d1", "1d1", NONE, 0, 40, 15 },
{ "arrow", "1d1", "1d6", BOW, ISMANY|ISMISL, 5, 1 },
{ "dagger", "1d6", "1d4", NONE, ISMETAL|ISMISL|ISMANY, 10, 2 },
{ "rock", "1d2", "1d4", SLING, ISMANY|ISMISL, 5, 1 },
{ "two-handed sword","3d6", "1d2", NONE, ISMETAL, 250, 40 },
{ "sling", "0d0", "0d0", NONE, 0, 5, 1 },
{ "dart", "1d1", "1d3", NONE, ISMANY|ISMISL, 5, 1 },
{ "crossbow", "1d1", "1d1", NONE, 0, 100, 15 },
{ "crossbow bolt", "1d2", "1d12", CROSSBOW, ISMANY|ISMISL, 7, 1 },
{ "spear", "1d6", "1d8", NONE, ISMETAL|ISMISL, 50, 8 },
{ "trident", "3d4", "1d4", NONE, ISMETAL, 50, 20 },
{ "spetum", "2d6", "1d3", NONE, ISMETAL, 50, 20 },
{ "bardiche", "3d4", "1d2", NONE, ISMETAL, 125, 20 },
{ "pike", "1d12", "1d8", NONE, ISMETAL, 80, 18 },
{ "bastard sword", "2d8", "1d2", NONE, ISMETAL, 100, 30 },
{ "halberd", "2d6", "1d3", NONE, ISMETAL, 175, 10 },
{ "battle axe", "1d8", "1d3", NONE, ISMETAL, 80, 10 },
};
struct init_armor armors[MAXARMORS] = {
{ "leather armor", 11, 8, 70, 100 },
{ "ring mail", 22, 7, 50, 250 },
{ "studded leather armor", 33, 7, 50, 200 },
{ "scale mail", 45, 6, 70, 250 },
{ "padded armor", 57, 6, 150, 150 },
{ "chain mail", 69, 5, 100, 300 },
{ "splint mail", 80, 4, 150, 350 },
{ "banded mail", 90, 4, 150, 350 },
{ "plate mail", 96, 3, 400, 400 },
{ "plate armor", 100, 2, 650, 450 },
};
struct magic_item things[NUMTHINGS] = {
{ "potion", 260, 10 }, /* potion */
{ "scroll", 260, 30 }, /* scroll */
{ "food", 180, 20 }, /* food */
{ "weapon", 80, 0 }, /* weapon */
{ "armor", 80, 0 }, /* armor */
{ "ring", 50, 5 }, /* ring */
{ "stick", 60, 0 }, /* stick */
{ "miscellaneous magic", 30, 50 }, /* miscellaneous magic */
{ "artifact", 0, 10 }, /* artifact */
};
struct magic_item s_magic[MAXSCROLLS] = {
{ "monster confusion", 60, 125, 0, 0 },
{ "magic mapping", 50, 150, 0, 0 },
{ "light", 80, 100, 21, 15 },
{ "hold monster", 30, 200, 33, 20 },
{ "sleep", 30, 150, 20, 0 },
{ "enchantment", 180, 200, 9, 9 },
{ "identify", 200, 100, 0, 25 },
{ "scare monster", 40, 250, 27, 21 },
{ "gold detection", 30, 110, 0, 0 },
{ "teleportation", 60, 165, 10, 20 },
{ "create monster", 30, 75, 0, 0 },
{ "remove curse", 70, 120, 9, 15 },
{ "petrification", 10, 185, 0, 0 },
{ "genocide", 10, 300, 0, 0 },
{ "cure disease", 80, 160, 0, 0 },
{ "acquirement", 10, 400, 0, 0 },
{ "protection", 30, 190, 20, 0 },
};
struct magic_item p_magic[MAXPOTIONS] = {
{ "clear thought", 60, 180, 27, 10 },
{ "gain ability", 160, 210, 15, 15 },
{ "see invisible", 60, 150, 25, 15 },
{ "healing", 170, 130, 27, 27 },
{ "monster detection", 60, 120, 0, 0 },
{ "magic detection", 60, 105, 0, 0 },
{ "raise level", 20, 350, 11, 10 },
{ "haste self", 100, 180, 30, 5 },
{ "restore abilities", 160, 140, 0, 0 },
{ "phasing", 50, 210, 21, 20 },
{ "invisibility", 50, 230, 0, 15 },
{ "flying", 50, 130, 0, 20 },
};
struct magic_item r_magic[MAXRINGS] = {
{ "protection", 50, 200, 33, 25 },
{ "add strength", 60, 200, 33, 25 },
{ "sustain ability", 50, 500, 0, 0 },
{ "searching", 60, 400, 0, 0 },
{ "extra sight", 40, 350, 0, 0 },
{ "alertness", 40, 380, 0, 0 },
{ "aggravate monster", 30, 100, 100, 0 },
{ "dexterity", 60, 220, 33, 25 },
{ "increase damage", 60, 220, 33, 25 },
{ "regeneration", 40, 600, 0, 0 },
{ "slow digestion", 40, 240, 15, 15 },
{ "teleportation", 20, 100, 100, 0 },
{ "stealth", 40, 300, 0, 0 },
{ "add intelligence", 60, 240, 33, 25 },
{ "increase wisdom", 60, 220, 33, 25 },
{ "sustain health", 80, 500, 0, 0 },
{ "burden", 20, 100, 100, 0 },
{ "illumination", 30, 520, 0, 0 },
{ "delusion", 20, 100, 75, 0 },
{ "fear", 20, 100, 100, 0},
{ "heroism", 30, 390, 0, 0 },
{ "fire resistance", 40, 400, 0, 0 },
{ "warmth", 40, 400, 0, 0 },
{ "vampiric regeneration", 10,1000, 0, 0},
};
struct magic_item ws_magic[MAXSTICKS] = {
{ "light", 90, 120, 20, 20 },
{ "striking", 60, 115, 0, 0 },
{ "lightning", 35, 200, 0, 0 },
{ "fire", 35, 200, 0, 0 },
{ "cold", 35, 200, 0, 0 },
{ "polymorph", 80, 150, 0, 0 },
{ "magic missile", 80, 170, 0, 0 },
{ "slow monster", 80, 220, 25, 20 },
{ "drain life", 90, 210, 20, 0 },
{ "charging", 80, 400, 0, 0 },
{ "teleport monster", 90, 140, 25, 20 },
{ "cancellation", 40, 130, 0, 0 },
{ "confuse monster", 35, 100, 15, 0},
{ "disintegration", 10, 300, 33, 0},
{ "petrification", 10, 300, 0, 0},
{ "paralyze monster", 30, 180, 15, 0},
{ "degenerate monster", 30, 250, 30, 0},
{ "curing", 10, 250, 25, 0},
{ "wonder", 50, 110, 0, 0},
{ "fear", 30, 180, 0, 0},
};
/*
* WARNING: unique miscellaneous magic items must be put at the end
* of this list. They MUST be the last items. The function
* create_obj() in wizard.c depends on it.
*/
struct magic_item m_magic[MAXMM] = {
{ "alchemy jug", 40, 240, 0, 0},
{ "beaker of potions", 60, 300, 0, 0},
{ "book of spells", 60, 300, 0, 0},
{ "boots of elvenkind", 50, 500, 0, 0},
{ "bracers of defense", 140, 100, 15, 0},
{ "chime of opening", 50, 250, 0, 0},
{ "chime of hunger", 50, 100,100, 0},
{ "cloak of displacement", 60, 500, 0, 0},
{ "cloak of protection", 70, 200, 15, 0},
{ "drums of panic", 40, 350, 0, 0},
{ "dust of disappearance", 40, 300, 0, 0},
{ "dust of choking", 30, 100,100, 0},
{ "gauntlets of dexterity", 30, 600, 25, 0},
{ "gauntlets of ogre power", 30, 600, 25, 0},
{ "jewel of attacks", 40, 150,100, 0},
{ "keoghtoms ointment", 50, 200, 0, 0},
{ "robe of powerlessness", 30, 100,100, 0},
{ "gauntlets of fumbling", 30, 100,100, 0},
{ "necklace of adaptation", 20, 500, 0, 0},
{ "necklace of strangulation",30, 110,100, 0},
{ "boots of dancing", 30, 120,100, 0},
{ "book of skills", 20, 650, 0, 0},
};
struct magic_item rel_magic[MAXRELIC] = {
{ "Daggers of Musty Doit", 0, 50000, 0, 0},
{ "Cloak of Emori", 0, 50000, 0, 0},
{ "Ankh of Heil", 0, 50000, 0, 0},
{ "Staff of Ming", 0, 50000, 0, 0},
{ "Wand of Orcus", 0, 50000, 0, 0},
{ "Rod of Asmodeus", 0, 50000, 0, 0},
{ "Amulet of Yendor", 0, 50000, 0, 0},
{ "Mandolin of Brian", 0, 50000, 0, 0},
{ "Horn of Geryon", 0, 50000, 0, 0},
{ "Morning Star of Hruggek", 0, 50000, 0, 0},
{ "Flail of Yeenoghu", 0, 50000, 0, 0},
};
/*
* these are the spells that a magic user can cast
*/
struct spells magic_spells[MAXSPELLS] = {
{ P_TFIND, 3, TYP_POTION, 0 },
{ S_IDENT, 5, TYP_SCROLL, 0 },
{ S_LIGHT, 7, TYP_SCROLL, ISBLESSED },
{ S_REMOVE, 7, TYP_SCROLL, 0 },
{ S_CONFUSE, 10, TYP_SCROLL, 0 },
{ S_MAP, 10, TYP_SCROLL, 0 },
{ WS_MISSILE, 15, TYP_STICK, 0 },
{ P_CLEAR, 20, TYP_POTION, 0 },
{ S_TELEP, 20, TYP_SCROLL, 0 },
{ S_SLEEP, 20, TYP_SCROLL, 0 },
{ P_SEEINVIS, 20, TYP_POTION, 0 },
{ WS_COLD, 25, TYP_STICK, 0 },
{ WS_ELECT, 25, TYP_STICK, 0 },
{ WS_FIRE, 25, TYP_STICK, 0 },
{ P_HASTE, 30, TYP_POTION, 0 },
{ WS_CANCEL, 30, TYP_STICK, 0 },
{ P_PHASE, 40, TYP_POTION, 0 },
{ S_HOLD, 50, TYP_SCROLL, 0 },
{ S_PROTECT, 60, TYP_SCROLL, 0 },
{ S_ALLENCH, 70, TYP_SCROLL, 0 },
};
/*
* these are the spells that a cleric can cast
*/
struct spells cleric_spells[MAXPRAYERS] = {
{ P_MFIND, 3, TYP_POTION, 0 },
{ P_TFIND, 7, TYP_POTION, 0 },
{ S_IDENT, 15, TYP_SCROLL, 0 },
{ S_LIGHT, 15, TYP_SCROLL, ISBLESSED },
{ S_REMOVE, 20, TYP_SCROLL, 0 },
{ P_HEALING, 25, TYP_POTION, 0 },
{ S_CURING, 30, TYP_SCROLL, 0 },
{ S_MAP, 30, TYP_SCROLL, 0 },
{ P_CLEAR, 30, TYP_POTION, 0 },
{ P_SEEINVIS, 35, TYP_POTION, 0 },
{ P_RESTORE, 40, TYP_POTION, 0 },
{ P_PHASE, 40, TYP_POTION, 0 },
{ S_TELEP, 45, TYP_SCROLL, 0 },
{ WS_CURING, 50, TYP_STICK, ISBLESSED },
{ WS_DRAIN, 50, TYP_STICK, 0 },
};
char *cnames[4][11] = {
{ "Veteran", "Warrior",
"Swordsman", "Hero",
"Swashbuckler", "Myrmidon",
"Champion", "Superhero",
"Lord", "Lord",
"Lord"
},
{ "Prestidigitator", "Evoker",
"Conjurer", "Theurgist",
"Thaumaturgist", "Magician",
"Enchanter", "Warlock",
"Sorcerer", "Necromancer",
"Wizard"
},
{ "Acolyte", "Adept",
"Priest", "Curate",
"Prefect", "Canon",
"Lama", "Patriarch",
"High Priest", "High Priest",
"High Priest"
},
{ "Rogue", "Footpad",
"Cutpurse", "Robber",
"Burglar", "Filcher",
"Sharper", "Magsman",
"Thief", "Master Thief",
"Master Thief"
}
} ;
struct h_list helpstr[] = {
'?', " prints help",
'/', " identify object",
'h', " left",
'j', " down",
'k', " up",
'l', " right",
'y', " up & left",
'u', " up & right",
'b', " down & left",
'n', " down & right",
'H', " run left",
'J', " run down",
'K', " run up",
'L', " run right",
'Y', " run up & left",
'U', " run up & right",
'B', " run down & left",
'N', " run down & right",
't', "<dir> throw something",
'f', "<dir> forward until find something",
'z', "<dir> zap a wand or staff",
'>', " go down a staircase",
'<', " go up a staircase",
's', " search for trap/secret door",
'.', " rest for a while",
'i', " inventory",
'I', " inventory single item",
'q', " quaff potion",
'r', " read paper",
'e', " eat food",
'w', " wield a weapon",
'W', " wear something",
'T', " take off something",
'd', " drop object",
'P', " pick up object(s)",
'c', " call object (generic)",
'm', " mark object (specific)",
'o', " examine/set options",
'C', " cast a spell",
'p', " pray",
'a', " affect the undead",
'^', " set a trap",
'G', " sense gold",
'D', " dip something (into a pool)",
CTRL('T'), "<dir> take (steal) from (direction)",
CTRL('U'), " use miscellaneous magic item",
CTRL('L'), " redraw screen",
CTRL('R'), " repeat last message",
ESCAPE, " cancel command",
'v', " print program version number",
'!', " shell escape",
'S', " save game",
'Q', " quit",
0, 0
} ;
struct h_list wiz_help[] = {
CTRL('A'), " system activity",
CTRL('C'), " move to another dungeon level",
CTRL('D'), " down 1 dungeon level",
CTRL('E'), " food remaining",
CTRL('F'), " display entire level",
CTRL('H'), " jump 9 experience levels",
CTRL('I'), " inventory of level",
CTRL('J'), " teleport",
CTRL('N'), " recharge staff",
CTRL('P'), " toggle wizard status",
CTRL('U'), " up 1 dungeon level",
CTRL('X'), " detect monsters",
CTRL('Z'), " identify",
'M', " make object",
0, 0
};
#define HPT(x) x
struct monster monsters[NUMMONST+1] = {
/* {"Name",
CARRY, NORMAL, WANDER, APPEAR, INTEL,
{ATTRIBUTES},
"SUMMONED_CREATURE", NUMBER_SUMMONED,
ADDED_EXPERIENCE/HIT_POINT,
{str exp, level, "armor", hit_points,
"damage"}}, */
{"unknown",
0, FALSE, FALSE, '\0', "",
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
0,
0, 0,
{10, 0, 0, 0, HPT(""),
""}},
{"bat",
0, TRUE, FALSE, 'b', "2-4",
{ISMEAN, ISHUH, CANDISEASE, ISFLY, ISHASTE},
0, 0,
0,
{10, 5, 2, 1, HPT("1d4"),
"1d2"}},
{"giant rat",
0, TRUE, TRUE, 'R', "2-4",
{ISMEAN, CANDISEASE},
0, 0,
1,
{10, 7, 1, 7, HPT("1d4"),
"1d3"}},
{"kobold",
10, TRUE, TRUE, 'K', "8",
{ISMEAN, CANSHOOT, CARRYWEAPON},
0, 0,
1,
{9, 5, 1, 7, HPT("1d4"),
"1d4"}},
{"gnome",
10, TRUE, TRUE, 'G', "11-12",
{CANSHOOT, CARRYPOTION, CARRYWEAPON},
0, 0,
1,
{10, 8, 1, 5, HPT("1d6"),
"1d6"}},
{"halfling",
10, TRUE, TRUE, 'H', "11-12",
{CANSHOOT, CARRYPOTION, CARRYWEAPON},
0, 0,
1,
{8, 9, 1, 4, HPT("1d6"),
"1d6"}},
{"dwarf",
15, TRUE, TRUE, 'D', "11-12",
{CANSHOOT, CARRYPOTION, CARRYWEAPON},
0, 0,
1,
{14, 10, 1, 4, HPT("1d8"),
"1d8"}},
{"orc",
15, TRUE, TRUE, 'O', "8",
{ISMEAN, CANSHOOT, CARRYGOLD, CARRYWEAPON},
0, 0,
1,
{12, 10, 1, 6, HPT("1d8"),
"1d8"}},
{"manes",
0, TRUE, TRUE, 'M', "2-4",
{ISMEAN, MAGICHIT, ISUNDEAD, TURNABLE},
0, 0,
1,
{10, 18, 1, 7, HPT("1d8"),
"1d2/1d2/1d4"}},
{"elf",
50, TRUE, TRUE, 'E', "13-20",
{CANSHOOT, CARRYPOTION, CARRYSCROLL, CARRYWEAPON},
0, 0,
2,
{12, 20, 1, 5, HPT("1d8+1"),
"1d10"}},
{"hobgoblin",
10, TRUE, TRUE, 'h', "8-10",
{ISMEAN, CANSHOOT, CARRYWEAPON},
0, 0,
2,
{14, 20, 1, 5, HPT("1d8+1"),
"1d8"}},
{"fire beetle",
0, TRUE, TRUE, 'B', "0",
{ISMEAN, HASFIRE},
0, 0,
2,
{10, 20, 1, 4, HPT("1d8+2"),
"2d4"}},
{"giant ant",
0, TRUE, TRUE, 'A', "1",
{ISMEAN, CANPOISON},
0, 0,
3,
{10, 40, 2, 3, HPT("2d8"),
"1d6/1d6"}},
{"zombie",
0, TRUE, TRUE, 'Z', "0",
{ISMEAN, ISUNDEAD, TURNABLE},
0, 0,
2,
{10, 20, 2, 8, HPT("2d8"),
"1d8"}},
{"ear seeker",
0, TRUE, TRUE, 'e', "0",
{ISMEAN, CANINFEST},
0, 0,
0,
{10, 0, 1, 9, HPT("1d1"),
"0d0"}},
{"shrieker",
0, TRUE, FALSE, 'S', "0",
{CANSHRIEK, NOMOVE, NOSTAB},
0, 0,
1,
{10, 5, 3, 7, HPT("3d8"),
"0d0"}},
{"stirge",
0, TRUE, TRUE, 's', "1",
{ISMEAN, CANDRAW, ISFLY},
0, 0,
2,
{10, 36, 4, 8, HPT("1d8+1"),
"1d3"}},
{"gas spore",
0, TRUE, FALSE, 'a', "0",
{ISMEAN, CANEXPLODE, CANINFEST, ISFLY},
0, 0,
5,
{10, 90, 1, 9, HPT("1d1"),
"1d1"}},
{"troglodyte",
5, TRUE, TRUE, 'T', "5-7",
{ISMEAN, CANSMELL, CANSHOOT, CARRYGOLD, CARRYWEAPON},
0, 0,
2,
{10, 36, 2, 5, HPT("2d8"),
"1d3/1d3/2d5"}},
{"lemure",
0, TRUE, FALSE, 'L', "2-4",
{ISMEAN, ISREGEN, MAGICHIT, ISUNDEAD, TURNABLE},
0, 0,
3,
{10, 65, 3, 7, HPT("3d8"),
"1d3"}},
{"bugbear",
5, TRUE, TRUE, 'b', "5-8",
{ISMEAN, CANSHOOT, CANSURPRISE, CARRYGOLD, CARRYPOTION,
CARRYWEAPON},
0, 0,
4,
{16, 135, 3, 5, HPT("3d8+1"),
"2d4"}},
{"wererat",
20, TRUE, TRUE, 'r', "11-12",
{ISMEAN, MAGICHIT, CARRYFOOD},
0, 0,
4,
{10, 150, 3, 6, HPT("3d8+1"),
"1d8"}},
{"ghoul",
0, TRUE, TRUE, 'g', "5-7",
{ISMEAN, CANPARALYZE, ISUNDEAD, TURNABLE},
0, 0,
2,
{10, 65, 2, 6, HPT("2d8"),
"1d3/1d3/1d6"}},
{"leprechaun",
100, TRUE, FALSE, 'l', "15-16",
{CARRYGOLD, STEALGOLD},
0, 0,
1,
{10, 80, 6, 3, HPT("1d4+1"),
"0d0"}},
{"ogre",
50, TRUE, TRUE, 'o', "5-7",
{ISMEAN, CARRYGOLD, CARRYWEAPON},
0, 0,
5,
{18, 90, 4, 5, HPT("4d8+1"),
"1d10"}},
{"centaur",
15, TRUE, TRUE, 'C', "5-10",
{CANSHOOT, CARRYPOTION, CARRYGOLD},
0, 0,
4,
{10, 85, 4, 4, HPT("4d8"),
"1d6/1d6"}},
{"nymph",
100, TRUE, FALSE, 'N', "15-16",
{STEALMAGIC, CARRYSCROLL, CARRYPOTION},
0, 0,
3,
{10, 350, 4, 9, HPT("3d8"),
"0d0"}},
{"violet fungi",
0, TRUE, FALSE, 'F', "0",
{ISMEAN, CANHOLD, NOMOVE, CANROT, NOSTAB},
0, 0,
4,
{10, 135, 3, 7, HPT("3d8"),
"5d1"}},
{"giant tick",
0, TRUE, TRUE, 't', "0",
{ISMEAN, CANDRAW, CANDISEASE},
0, 0,
2,
{10, 105, 3, 3, HPT("3d8"),
"1d4"}},
{"gelatinous cube",
90, TRUE, TRUE, 'c', "0",
{ISMEAN, ISSCAVENGE, CANPARALYZE, NOSTAB, CARRYFOOD},
0, 0,
4,
{10, 150, 4, 8, HPT("4d8"),
"2d4"}},
{"blink dog",
0, TRUE, TRUE, 'B', "8-10",
{ISMEAN, CANBLINK},
0, 0,
5,
{10, 170, 4, 5, HPT("4d8"),
"1d6"}},
{"very young dragon",
10, TRUE, FALSE, 'd', "15-16",
{ISMEAN, CANBRANDOM, ISGREED, CARRYGOLD, CARRYSTICK},
0, 0,
9,
{10, 100, 9, -1, HPT("9d1"),
"1d4/1d4/2d4"}},
{"rust monster",
0, TRUE, TRUE, 'R', "1",
{ISMEAN, CANRUST},
0, 0,
4,
{10, 185, 5, 2, HPT("3d8"),
"0d0/0d0"}},
{"ghast",
0, TRUE, TRUE, 'G', "11-12",
{CANPARALYZE, CANSTINK, ISMEAN, ISUNDEAD, TURNABLE},
0, 0,
4,
{10, 190, 4, 4, HPT("4d8"),
"1d4/1d4/1d8"}},
{"blindheim",
0, TRUE, FALSE, 'b', "1",
{CANBLIND, ISMEAN},
0, 0,
4,
{8, 200, 2, 1, HPT("4d8+2"),
"1d8"}},
{"shadow",
0, TRUE, TRUE, 'S', "5-7",
{ISSHADOW, ISMEAN, CANCHILL, ISUNDEAD, TURNABLE},
0, 0,
4,
{10, 255, 3, 7, HPT("3d8+3"),
"1d4+1"}},
{"gargoyle",
5, TRUE, TRUE, 'g', "5-7",
{ISMEAN, MAGICHIT, CARRYSTICK},
0, 0,
5,
{10, 165, 4, 5, HPT("4d8+4"),
"1d3/1d3/1d6/1d4"}},
{"su-monster", 10, TRUE, TRUE, 's', "8-10",
{ISMEAN, CARRYSCROLL, CARRYGOLD, CARRYFOOD},
0, 0,
6,
{10, 225, 5, 6, HPT("5d8+5"),
"4d4/2d4"}},
{"gray ooze",
50, TRUE, FALSE, 'o', "1",
{ISMEAN, NOMOVE, CANRUST, ISSCAVENGE, NOCOLD, NOFIRE, NOSTAB,
CARRYSTICK, CARRYFOOD},
0, 0,
5,
{10, 200, 3, 8, HPT("3d8+3"),
"2d8"}},
{"owlbear",
5, TRUE, TRUE, 'O', "5-7",
{ISMEAN, CANHUG, CARRYRING, CARRYFOOD},
0, 0,
8,
{10, 225, 5, 5, HPT("5d8+2"),
"1d6/1d6/2d6"}},
{"quasit",
30, TRUE, TRUE, 'Q', "5-7",
{ISMEAN, ISREGEN, MAGICHIT, CANSURPRISE, CANITCH,
CARRYSCROLL, CARRYGOLD, CARRYPOTION, NOCOLD, NOFIRE, NOBOLT},
0, 0,
3,
{10, 325, 7, 2, HPT("3d8"),
"1d2/1d2/1d4"}},
{"doppleganger",
0, TRUE, TRUE, 'D', "11-12",
{ISMEAN, CANSURPRISE},
0, 0,
4,
{10, 330, 10, 5, HPT("4d8"),
"1d12"}},
{"yeti",
30, TRUE, TRUE, 'Y', "8-10",
{ISMEAN, CANPARALYZE, CANHUG, NOCOLD, CANSURPRISE,
CARRYGOLD, CARRYPOTION},
0, 0,
8,
{13, 500, 6, 6, HPT("4d8+4"),
"1d6/1d6"}},
{"leucrotta",
0, TRUE, FALSE, 'L', "8-10",
{ISMEAN},
0, 0,
8,
{10, 475, 6, 4, HPT("6d8+1"),
"3d6/1d6/1d6"}},
{"imp",
25, TRUE, TRUE, 'I', "8-10",
{ISMEAN, ISREGEN, MAGICHIT, CANPOISON, CANSURPRISE,
CANTELEPORT, CARRYRING, CARRYSTICK, NOCOLD, NOBOLT, NOFIRE},
0, 0,
3,
{10, 275, 2, 2, HPT("2d8+2"),
"1d4"}},
{"cockatrice",
0, TRUE, TRUE, 'C', "1",
{ISMEAN, TOUCHSTONE},
0, 0,
5,
{10, 315, 5, 6, HPT("5d8"),
"1d3"}},
{"wight",
0, TRUE, TRUE, 'W', "8-10",
{ISMEAN, CANDRAIN, MAGICHIT, ISUNDEAD, TURNABLE},
0, 0,
5,
{10, 540, 4, 5, HPT("4d8+3"),
"1d4"}},
{"troll",
50, TRUE, FALSE, 'T', "5-7",
{ISMEAN, ISREGEN, CARRYFOOD, CARRYGOLD, CARRYSTICK},
0, 0,
8,
{18, 600, 6, 4, HPT("6d8+6"),
"1d4+4/1d4+4/2d6"}},
{"jackalwere",
50, TRUE, TRUE, 'J', "11-12",
{ISMEAN, CANSHOOT, CANSNORE, MAGICHIT, CARRYFOOD, CARRYGOLD,
CARRYSCROLL},
0, 0,
4,
{10, 800, 4, 4, HPT("4d8"),
"2d4"}},
{"wraith",
0, TRUE, TRUE, 'w', "11-12",
{ISMEAN, CANDRAIN, MAGICHIT, ISUNDEAD, TURNABLE},
0, 0,
6,
{10, 575, 5, 4, HPT("5d8+3"),
"1d6"}},
{"erinyes",
25, TRUE, TRUE, 'E', "8-10",
{ISMEAN, CANFRIGHTEN, CANSUMMON, TURNABLE, CANPAIN, CANSEE,
NOFIRE, CANTELEPORT, CARRYRING, CARRYSTICK},
"ghoul", 3,
8,
{10, 875, 7, 2, HPT("6d8+6"),
"2d4"}},
{"lava child",
0, TRUE, TRUE, 'l', "8-10",
{ISMEAN, NOMETAL},
0, 0,
8,
{10, 950, 5, 4, HPT("5d8+1"),
"1d6/1d6/2d12"}},
{"basilisk",
0, TRUE, FALSE, 'B', "1",
{ISMEAN, LOOKSTONE},
0, 0,
8,
{10, 1000, 6, 4, HPT("6d8+1"),
"1d10"}},
{"mummy",
20, TRUE, FALSE, 'm', "5-7",
{ISMEAN,CANINFEST, MAGICHIT, CANFRIGHTEN, HALFDAMAGE, ISUNDEAD,
TURNABLE, CARRYRING, CARRYSTICK},
0, 0,
8,
{10, 1150, 6, 3, HPT("6d8+3"),
"1d12"}},
{"otyugh",
0, TRUE, TRUE, 'o', "5-10",
{ISMEAN, CANDISEASE},
0, 0,
8,
{10, 700, 7, 3, HPT("7d8"),
"1d8/1d8/1d4+1"}},
{"adult dragon",
30, TRUE, FALSE, 'd', "15-16",
{ISMEAN, CANBRANDOM, ISGREED, CANFRIGHTEN, CARRYGOLD,
CARRYPOTION, CARRYSTICK},
0, 0,
9,
{10, 1000, 9, -1, HPT("45d1"),
"1d6/1d6/2d6"}},
{"invisible stalker",
0, TRUE, TRUE, 'i', "13-14",
{ISMEAN, ISINVIS},
0, 0,
10,
{10, 1090, 8, 3, HPT("8d8"),
"4d4"}},
{"xorn",
0, TRUE, TRUE, 'X', "8-10",
{ISMEAN, CANINWALL, NOCOLD, NOFIRE, CANSURPRISE, NOBOLT},
0, 0,
10,
{10, 1275, 7, -2, HPT("7d8+7"),
"1d3/1d3/1d3/4d6"}},
{"will-o-wisp", 100, TRUE, FALSE, 'W', "15-16",
{ISMEAN, CANSURPRISE, ISFLY, CARRYGOLD, CARRYMISC, NOBOLT},
0, 0,
12,
{10, 2000, 9, -8, HPT("9d8"),
"2d8"}},
{"chimera",
0, TRUE, FALSE, 'c', "2-4",
{ISMEAN, CANBFIRE, NOFIRE},
0, 0,
12,
{10, 1000, 9, 6, HPT("9d8"),
"1d3/1d3/1d4/1d4/2d4/3d4"}},
{"mimic",
20, TRUE, FALSE, 'M', "2-10",
{ISDISGUISE, CANHOLD, CARRYFOOD, CARRYRING, CARRYGOLD},
0, 0,
12,
{10, 1300, 9, 7, HPT("9d8"),
"3d4"}},
{"horned devil",
5, TRUE, TRUE, 'H', "13-14",
{ISMEAN, CANFRIGHTEN, CANINFEST, CANPOISON, MAGICHIT, CANSUMMON,
NOFIRE, CANTELEPORT, CARRYGOLD, CARRYRING, CARRYSTICK},
"wight", 2,
6,
{10, 1320, 7, -3, HPT("5d8+5"),
"1d4/1d4/1d4+1/1d3"}},
{"specter",
0, TRUE, TRUE, 'S', "13-14",
{ISMEAN, DOUBLEDRAIN, ISUNDEAD, TURNABLE},
0, 0,
10,
{10, 1650, 7, 2, HPT("7d8+3"),
"1d8"}},
{"lamia",
0, TRUE, TRUE, 'L', "13-14",
{ISMEAN, TAKEWISDOM},
0, 0,
9,
{10, 1500, 9, 3, HPT("9d8"),
"1d4/1d4"}},
{"neo-otyugh",
0, TRUE, TRUE, 'N', "10-12",
{ISMEAN, CANDISEASE},
0, 0,
10,
{12, 1500, 10, 0, HPT("12d8"),
"2d6/2d6/1d3"}},
{"barbed devil",
0, TRUE, TRUE, 'B', "11-12",
{TOUCHFEAR, CANSUMMON, ISMEAN, CANHOLD, TURNABLE, NOFIRE,
CANTELEPORT},
"ghast", 4,
10,
{10, 1425, 8, 0, HPT("8d8"),
"2d4/2d4/3d4"}},
{"vrock",
10, TRUE, TRUE, 'V', "5-7",
{ISMEAN, CANSUMMON, CANSEE, TURNABLE, CANTELEPORT, CARRYGOLD,
CARRYRING, CARRYSTICK},
"erinyes", 2,
10,
{10, 1500, 8, 0, HPT("8d8"),
"1d4/1d4/1d8/1d8/1d6"}},
{"shambling mound",
25, TRUE, TRUE, 's', "5-7",
{ISMEAN, CANSUFFOCATE, NOCOLD, NOFIRE, CANHOLD, CARRYGOLD,
CARRYFOOD, CARRYRING},
0, 0,
10,
{10, 1800, 9, 0, HPT("9d8"),
"2d8/2d8"}},
{"umber hulk",
40, TRUE, TRUE, 'U', "8-10",
{ISMEAN, CANHUH, CANINWALL, CANTUNNEL, CARRYSCROLL,
CARRYPOTION, CARRYFOOD},
0, 0,
12,
{10, 1700, 8, 2, HPT("8d8+8"),
"3d4/3d4/2d5"}},
{"ettin",
0, TRUE, TRUE, 'e', "0",