-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdefines.h
2460 lines (2140 loc) · 70.5 KB
/
defines.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
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
/* File: defines.h */
/*
* Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
*
* This software may be copied and distributed for educational, research,
* and not for profit purposes provided that this copyright and statement
* are included in all such copies. Other copyrights may also apply.
*/
/*
* Do not edit this file unless you know *exactly* what you are doing.
*
* Some of the values in this file were chosen to preserve game balance,
* while others are hard-coded based on the format of old save-files, the
* definition of arrays in various places, mathematical properties, fast
* computation, storage limits, or the format of external text files.
*
* Changing some of these values will induce crashes or memory errors or
* savefile mis-reads. Most of the comments in this file are meant as
* reminders, not complete descriptions, and even a complete knowledge
* of the source may not be sufficient to fully understand the effects
* of changing certain definitions.
*
* Lastly, note that the code does not always use the symbolic constants
* below, and sometimes uses various hard-coded values that may not even
* be defined in this file, but which may be related to definitions here.
* This is of course bad programming practice, but nobody is perfect...
*
* For example, there are MANY things that depend on the screen being
* 80x24, with the top line used for messages, the bottom line being
* used for status, and exactly 22 lines used to show the dungeon.
* Just because your screen can hold 46 lines does not mean that the
* game will work if you try to use 44 lines to show the dungeon.
*
* You have been warned.
*/
/*
* Current version string
*/
#define VERSION_STRING "2.8.3"
/*
* Current version numbers
*/
#define VERSION_MAJOR 2
#define VERSION_MINOR 8
#define VERSION_PATCH 3
/*
* This value is not currently used
*/
#define VERSION_EXTRA 0
/*
* Number of grids in each block (vertically)
* Probably hard-coded to 11, see "generate.c"
*/
#define BLOCK_HGT 11
/*
* Number of grids in each block (horizontally)
* Probably hard-coded to 11, see "generate.c"
*/
#define BLOCK_WID 11
/*
* Number of grids in each panel (vertically)
* Must be a multiple of BLOCK_HGT
*/
#define PANEL_HGT 11
/*
* Number of grids in each panel (horizontally)
* Must be a multiple of BLOCK_WID
*/
#define PANEL_WID 33
/*
* Number of grids in each screen (vertically)
* Must be a multiple of PANEL_HGT (at least 2x)
*/
#define SCREEN_HGT 22
/*
* Number of grids in each screen (horizontally)
* Must be a multiple of PANEL_WID (at least 2x)
*/
#define SCREEN_WID 66
/*
* Number of grids in each dungeon (horizontally)
* Must be a multiple of SCREEN_HGT
* Must be less or equal to 256
*/
#define DUNGEON_HGT 132
/*
* Number of grids in each dungeon (vertically)
* Must be a multiple of SCREEN_WID
* Must be less or equal to 256
*/
#define DUNGEON_WID 198
/*
* Maximum array bounds for entity list arrays
*/
#define MAX_O_IDX 256 /* Max size for "o_list[]" */
#define MAX_M_IDX 512 /* Max size for "m_list[]" */
/*
* Maximum dungeon level. The player can never reach this level
* in the dungeon, and this value is used for various calculations
* involving object and monster creation. It must be at least 100.
* Setting it below 128 may prevent the creation of some objects.
*/
#define MAX_DEPTH 128
/*
* Maximum value storable in a "byte" (hard-coded)
*/
#define MAX_UCHAR 255
/*
* Maximum value storable in a "s16b" (hard-coded)
*/
#define MAX_SHORT 32767
/*
* There is a 1/20 (5%) chance of inflating the requested object_level
* during the creation of an object (see "get_obj_num()" in "object.c").
* Lower values yield better objects more often.
*/
#define GREAT_OBJ 20
/*
* There is a 1/50 (2%) chance of inflating the requested monster_level
* during the creation of a monsters (see "get_mon_num()" in "monster.c").
* Lower values yield harder monsters more often.
*/
#define NASTY_MON 50 /* 1/chance of inflated monster level */
/*
* Refueling constants
*/
#define FUEL_TORCH 5000 /* Maximum amount of fuel in a torch */
#define FUEL_LAMP 15000 /* Maximum amount of fuel in a lantern */
/*
* More maximum values
*/
#define MAX_SIGHT 20 /* Maximum view distance */
#define MAX_RANGE 18 /* Maximum range (spells, etc) */
/*
* There is a 1/160 chance per round of creating a new monster
*/
#define MAX_M_ALLOC_CHANCE 160
/*
* Normal levels get at least 14 monsters
*/
#define MIN_M_ALLOC_LEVEL 14
/*
* The town starts out with 4 residents during the day
*/
#define MIN_M_ALLOC_TD 4
/*
* The town starts out with 8 residents during the night
*/
#define MIN_M_ALLOC_TN 8
/*
* A monster can only "multiply" (reproduce) if there are fewer than 100
* monsters on the level capable of such spontaneous reproduction. This
* is a hack which prevents the "m_list[]" array from exploding due to
* reproducing monsters. Messy, but necessary.
*/
#define MAX_REPRO 100
/*
* Player constants
*/
#define PY_MAX_EXP 99999999L /* Maximum exp */
#define PY_MAX_GOLD 999999999L /* Maximum gold */
#define PY_MAX_LEVEL 50 /* Maximum level */
/*
* Player "food" crucial values
*/
#define PY_FOOD_MAX 15000 /* Food value (Bloated) */
#define PY_FOOD_FULL 10000 /* Food value (Normal) */
#define PY_FOOD_ALERT 2000 /* Food value (Hungry) */
#define PY_FOOD_WEAK 1000 /* Food value (Weak) */
#define PY_FOOD_FAINT 500 /* Food value (Fainting) */
#define PY_FOOD_STARVE 100 /* Food value (Starving) */
/*
* Player regeneration constants
*/
#define PY_REGEN_NORMAL 197 /* Regen factor*2^16 when full */
#define PY_REGEN_WEAK 98 /* Regen factor*2^16 when weak */
#define PY_REGEN_FAINT 33 /* Regen factor*2^16 when fainting */
#define PY_REGEN_HPBASE 1442 /* Min amount hp regen*2^16 */
#define PY_REGEN_MNBASE 524 /* Min amount mana regen*2^16 */
/*
* Maximum number of "normal" pack slots, and the index of the "overflow"
* slot, which can hold an item, but only temporarily, since it causes the
* pack to "overflow", dropping the "last" item onto the ground. Since this
* value is used as an actual slot, it must be less than "INVEN_WIELD" (below).
* Note that "INVEN_PACK" is probably hard-coded by its use in savefiles, and
* by the fact that the screen can only show 23 items plus a one-line prompt.
*/
#define INVEN_PACK 23
/*
* Indexes used for various "equipment" slots (hard-coded by savefiles, etc).
*/
#define INVEN_WIELD 24
#define INVEN_BOW 25
#define INVEN_LEFT 26
#define INVEN_RIGHT 27
#define INVEN_NECK 28
#define INVEN_LITE 29
#define INVEN_BODY 30
#define INVEN_OUTER 31
#define INVEN_ARM 32
#define INVEN_HEAD 33
#define INVEN_HANDS 34
#define INVEN_FEET 35
/*
* Total number of inventory slots (hard-coded).
*/
#define INVEN_TOTAL 36
/*
* A "stack" of items is limited to less than 100 items (hard-coded).
*/
#define MAX_STACK_SIZE 100
/*
* Indexes of the various "stats" (hard-coded by savefiles, etc).
*/
#define A_STR 0
#define A_INT 1
#define A_WIS 2
#define A_DEX 3
#define A_CON 4
#define A_CHR 5
/*
* Player sex constants (hard-coded by save-files, arrays, etc)
*/
#define SEX_FEMALE 0
#define SEX_MALE 1
/*
* Player race constants (hard-coded by save-files, arrays, etc)
*/
#define RACE_HUMAN 0
#define RACE_HALF_ELF 1
#define RACE_ELF 2
#define RACE_HOBBIT 3
#define RACE_GNOME 4
#define RACE_DWARF 5
#define RACE_HALF_ORC 6
#define RACE_HALF_TROLL 7
#define RACE_DUNADAN 8
#define RACE_HIGH_ELF 9
/*
* Player class constants (hard-coded by save-files, arrays, etc)
*/
#define CLASS_WARRIOR 0
#define CLASS_MAGE 1
#define CLASS_PRIEST 2
#define CLASS_ROGUE 3
#define CLASS_RANGER 4
#define CLASS_PALADIN 5
/*** Screen Locations ***/
/*
* Some screen locations for various display routines
* Currently, row 8 and 15 are the only "blank" rows.
* That leaves a "border" around the "stat" values.
*/
#define ROW_RACE 1
#define COL_RACE 0 /* <race name> */
#define ROW_CLASS 2
#define COL_CLASS 0 /* <class name> */
#define ROW_TITLE 3
#define COL_TITLE 0 /* <title> or <mode> */
#define ROW_LEVEL 4
#define COL_LEVEL 0 /* "LEVEL xxxxxx" */
#define ROW_EXP 5
#define COL_EXP 0 /* "EXP xxxxxxxx" */
#define ROW_GOLD 6
#define COL_GOLD 0 /* "AU xxxxxxxxx" */
#define ROW_STAT 8
#define COL_STAT 0 /* "xxx xxxxxx" */
#define ROW_AC 15
#define COL_AC 0 /* "Cur AC xxxxx" */
#define ROW_MAXHP 16
#define COL_MAXHP 0 /* "Max HP xxxxx" */
#define ROW_CURHP 17
#define COL_CURHP 0 /* "Cur HP xxxxx" */
#define ROW_MAXSP 18
#define COL_MAXSP 0 /* "Max SP xxxxx" */
#define ROW_CURSP 19
#define COL_CURSP 0 /* "Cur SP xxxxx" */
#define ROW_INFO 20
#define COL_INFO 0 /* "xxxxxxxxxxxx" */
#define ROW_CUT 21
#define COL_CUT 0 /* <cut> */
#define ROW_STUN 22
#define COL_STUN 0 /* <stun> */
#define ROW_HUNGRY 23
#define COL_HUNGRY 0 /* "Weak" / "Hungry" / "Full" / "Gorged" */
#define ROW_BLIND 23
#define COL_BLIND 7 /* "Blind" */
#define ROW_CONFUSED 23
#define COL_CONFUSED 13 /* "Confused" */
#define ROW_AFRAID 23
#define COL_AFRAID 22 /* "Afraid" */
#define ROW_POISONED 23
#define COL_POISONED 29 /* "Poisoned" */
#define ROW_STATE 23
#define COL_STATE 38 /* <state> */
#define ROW_SPEED 23
#define COL_SPEED 49 /* "Slow (-NN)" or "Fast (+NN)" */
#define ROW_STUDY 23
#define COL_STUDY 64 /* "Study" */
#define ROW_DEPTH 23
#define COL_DEPTH 70 /* "Lev NNN" / "NNNN ft" */
#define ROW_MAP 1
#define COL_MAP 13
/*** General index values ***/
/*
* Legal restrictions for "summon_specific()"
*/
#define SUMMON_ANT 11
#define SUMMON_SPIDER 12
#define SUMMON_HOUND 13
#define SUMMON_HYDRA 14
#define SUMMON_ANGEL 15
#define SUMMON_DEMON 16
#define SUMMON_UNDEAD 17
#define SUMMON_DRAGON 18
#define SUMMON_HI_UNDEAD 21
#define SUMMON_HI_DRAGON 22
#define SUMMON_WRAITH 31
#define SUMMON_UNIQUE 32
/*
* Spell types used by project(), and related functions.
*/
#define GF_XXX1 1
#define GF_ARROW 2
#define GF_MISSILE 3
#define GF_MANA 4
#define GF_HOLY_ORB 5
#define GF_LITE_WEAK 6
#define GF_DARK_WEAK 7
#define GF_WATER 8
#define GF_PLASMA 9
#define GF_METEOR 10
#define GF_ICE 11
#define GF_GRAVITY 12
#define GF_INERTIA 13
#define GF_FORCE 14
#define GF_TIME 15
#define GF_ACID 16
#define GF_ELEC 17
#define GF_FIRE 18
#define GF_COLD 19
#define GF_POIS 20
#define GF_XXX2 21
#define GF_LITE 22
#define GF_DARK 23
#define GF_XXX3 24
#define GF_CONFUSION 25
#define GF_SOUND 26
#define GF_SHARD 27
#define GF_NEXUS 28
#define GF_NETHER 29
#define GF_CHAOS 30
#define GF_DISENCHANT 31
#define GF_XXX4 32
#define GF_KILL_WALL 33
#define GF_KILL_DOOR 34
#define GF_KILL_TRAP 35
#define GF_MAKE_WALL 36
#define GF_MAKE_DOOR 37
#define GF_MAKE_TRAP 38
#define GF_XXX5 39
#define GF_XXX6 40
#define GF_AWAY_UNDEAD 41
#define GF_AWAY_EVIL 42
#define GF_AWAY_ALL 43
#define GF_TURN_UNDEAD 44
#define GF_TURN_EVIL 45
#define GF_TURN_ALL 46
#define GF_DISP_UNDEAD 47
#define GF_DISP_EVIL 48
#define GF_DISP_ALL 49
#define GF_XXX7 50
#define GF_OLD_CLONE 51
#define GF_OLD_POLY 52
#define GF_OLD_HEAL 53
#define GF_OLD_SPEED 54
#define GF_OLD_SLOW 55
#define GF_OLD_CONF 56
#define GF_OLD_SLEEP 57
#define GF_OLD_DRAIN 58
#define GF_XXX8 59
/*
* Some constants for the "learn" code
*
* Most of these come from the "SM_xxx" flags
*/
#define DRS_FREE 14
#define DRS_MANA 15
#define DRS_RES_ACID 16
#define DRS_RES_ELEC 17
#define DRS_RES_FIRE 18
#define DRS_RES_COLD 19
#define DRS_RES_POIS 20
#define DRS_RES_FEAR 21
#define DRS_RES_LITE 22
#define DRS_RES_DARK 23
#define DRS_RES_BLIND 24
#define DRS_RES_CONFU 25
#define DRS_RES_SOUND 26
#define DRS_RES_SHARD 27
#define DRS_RES_NEXUS 28
#define DRS_RES_NETHR 29
#define DRS_RES_CHAOS 30
#define DRS_RES_DISEN 31
/*
* Number of keymap modes
*/
#define KEYMAP_MODES 2
/*
* Mode for original keyset commands
*/
#define KEYMAP_MODE_ORIG 0
/*
* Mode for roguelike keyset commands
*/
#define KEYMAP_MODE_ROGUE 1
/*** Feature Indexes (see "lib/edit/f_info.txt") ***/
/* Nothing */
#define FEAT_NONE 0x00
/* Various */
#define FEAT_FLOOR 0x01
#define FEAT_INVIS 0x02
#define FEAT_GLYPH 0x03
#define FEAT_OPEN 0x04
#define FEAT_BROKEN 0x05
#define FEAT_LESS 0x06
#define FEAT_MORE 0x07
/* Shops */
#define FEAT_SHOP_HEAD 0x08
#define FEAT_SHOP_TAIL 0x0F
/* Traps */
#define FEAT_TRAP_HEAD 0x10
#define FEAT_TRAP_TAIL 0x1F
/* Doors */
#define FEAT_DOOR_HEAD 0x20
#define FEAT_DOOR_TAIL 0x2F
/* Extra */
#define FEAT_SECRET 0x30
#define FEAT_RUBBLE 0x31
/* Seams */
#define FEAT_MAGMA 0x32
#define FEAT_QUARTZ 0x33
#define FEAT_MAGMA_H 0x34
#define FEAT_QUARTZ_H 0x35
#define FEAT_MAGMA_K 0x36
#define FEAT_QUARTZ_K 0x37
/* Walls */
#define FEAT_WALL_EXTRA 0x38
#define FEAT_WALL_INNER 0x39
#define FEAT_WALL_OUTER 0x3A
#define FEAT_WALL_SOLID 0x3B
#define FEAT_PERM_EXTRA 0x3C
#define FEAT_PERM_INNER 0x3D
#define FEAT_PERM_OUTER 0x3E
#define FEAT_PERM_SOLID 0x3F
/*
* Hack -- first "normal" artifact in the artifact list. All of
* the artifacts with indexes from 1 to 15 are "special" (lights,
* rings, amulets), and the ones from 16 to 127 are "normal".
*/
#define ART_MIN_NORMAL 16
/*** Ego-Item indexes (see "lib/edit/e_info.txt") ***/
/* Nothing */
/* xxx */
/* xxx */
/* xxx */
/* Body Armor */
#define EGO_RESIST_ACID 4
#define EGO_RESIST_ELEC 5
#define EGO_RESIST_FIRE 6
#define EGO_RESIST_COLD 7
#define EGO_RESISTANCE 8
#define EGO_ELVENKIND 9
/* xxx */
#define EGO_PERMANENCE 11
/* xxx */
/* xxx */
/* xxx */
/* xxx */
/* Shields */
#define EGO_ENDURE_ACID 16
#define EGO_ENDURE_ELEC 17
#define EGO_ENDURE_FIRE 18
#define EGO_ENDURE_COLD 19
#define EGO_ENDURANCE 20
/* xxx */
/* xxx */
/* xxx */
/* Crowns and Helms */
#define EGO_INTELLIGENCE 24
#define EGO_WISDOM 25
#define EGO_BEAUTY 26
#define EGO_MAGI 27
#define EGO_MIGHT 28
#define EGO_LORDLINESS 29
#define EGO_SEEING 30
#define EGO_INFRAVISION 31
#define EGO_LITE 32
#define EGO_TELEPATHY 33
#define EGO_REGENERATION 34
#define EGO_TELEPORTATION 35
#define EGO_STUPIDITY 36
#define EGO_NAIVETY 37
#define EGO_UGLINESS 38
#define EGO_SICKLINESS 39
/* Cloaks */
#define EGO_PROTECTION 40
#define EGO_STEALTH 41
#define EGO_AMAN 42
/* xxx */
#define EGO_ENVELOPING 44
#define EGO_VULNERABILITY 45
#define EGO_IRRITATION 46
/* xxx */
/* Gloves */
#define EGO_FREE_ACTION 48
#define EGO_SLAYING 49
#define EGO_AGILITY 50
#define EGO_POWER 51
/* xxx */
/* xxx */
#define EGO_WEAKNESS 54
#define EGO_CLUMSINESS 55
/* Boots */
#define EGO_SLOW_DESCENT 56
#define EGO_QUIET 57
#define EGO_MOTION 58
#define EGO_SPEED 59
/* xxx */
#define EGO_NOISE 61
#define EGO_SLOWNESS 62
#define EGO_ANNOYANCE 63
/* Weapons */
#define EGO_HA 64
#define EGO_DF 65
#define EGO_BLESS_BLADE 66
/* xxx */
#define EGO_WEST 68
#define EGO_ATTACKS 69
/* xxx */
/* xxx */
#define EGO_BRAND_ACID 72
#define EGO_BRAND_ELEC 73
#define EGO_BRAND_FIRE 74
#define EGO_BRAND_COLD 75
/* xxx */
/* xxx */
/* xxx */
/* xxx */
#define EGO_SLAY_ANIMAL 80
#define EGO_SLAY_EVIL 81
#define EGO_SLAY_UNDEAD 82
#define EGO_SLAY_DEMON 83
#define EGO_SLAY_ORC 84
#define EGO_SLAY_TROLL 85
#define EGO_SLAY_GIANT 86
#define EGO_SLAY_DRAGON 87
#define EGO_KILL_ANIMAL 88
#define EGO_KILL_EVIL 89
#define EGO_KILL_UNDEAD 90
#define EGO_KILL_DEMON 83
#define EGO_KILL_ORC 84
#define EGO_KILL_TROLL 85
#define EGO_KILL_GIANT 86
#define EGO_KILL_DRAGON 95
/* xxx */
/* xxx */
/* xxx */
/* xxx */
#define EGO_DIGGING 100
/* xxx */
#define EGO_MORGUL 102
/* xxx */
/* Bows */
#define EGO_ACCURACY 104
#define EGO_VELOCITY 105
/* xxx */
/* xxx */
#define EGO_EXTRA_MIGHT 108
#define EGO_EXTRA_SHOTS 109
/* xxx */
/* xxx */
/* Ammo */
#define EGO_HURT_ANIMAL 112
#define EGO_HURT_EVIL 113
#define EGO_HURT_UNDEAD 114
#define EGO_HURT_DEMON 115
#define EGO_HURT_ORC 116
#define EGO_HURT_TROLL 117
#define EGO_HURT_GIANT 118
#define EGO_HURT_DRAGON 119
/* xxx */
/* xxx */
#define EGO_FLAME 122
#define EGO_FROST 123
#define EGO_WOUNDING 124
#define EGO_BACKBITING 125
#define EGO_SHATTERED 126
#define EGO_BLASTED 127
/*** Object "tval" and "sval" codes ***/
/*
* The values for the "tval" field of various objects.
*
* This value is the primary means by which items are sorted in the
* player inventory, followed by "sval" and "cost".
*
* Note that a "BOW" with tval = 19 and sval S = 10*N+P takes a missile
* weapon with tval = 16+N, and does (xP) damage when so combined. This
* fact is not actually used in the source, but it kind of interesting.
*
* Note that as of 2.7.8, the "item flags" apply to all items, though
* only armor and weapons and a few other items use any of these flags.
*/
#define TV_SKELETON 1 /* Skeletons ('s') */
#define TV_BOTTLE 2 /* Empty bottles ('!') */
#define TV_JUNK 3 /* Sticks, Pottery, etc ('~') */
#define TV_SPIKE 5 /* Spikes ('~') */
#define TV_CHEST 7 /* Chests ('~') */
#define TV_SHOT 16 /* Ammo for slings */
#define TV_ARROW 17 /* Ammo for bows */
#define TV_BOLT 18 /* Ammo for x-bows */
#define TV_BOW 19 /* Slings/Bows/Xbows */
#define TV_DIGGING 20 /* Shovels/Picks */
#define TV_HAFTED 21 /* Priest Weapons */
#define TV_POLEARM 22 /* Axes and Pikes */
#define TV_SWORD 23 /* Edged Weapons */
#define TV_BOOTS 30 /* Boots */
#define TV_GLOVES 31 /* Gloves */
#define TV_HELM 32 /* Helms */
#define TV_CROWN 33 /* Crowns */
#define TV_SHIELD 34 /* Shields */
#define TV_CLOAK 35 /* Cloaks */
#define TV_SOFT_ARMOR 36 /* Soft Armor */
#define TV_HARD_ARMOR 37 /* Hard Armor */
#define TV_DRAG_ARMOR 38 /* Dragon Scale Mail */
#define TV_LITE 39 /* Lites (including Specials) */
#define TV_AMULET 40 /* Amulets (including Specials) */
#define TV_RING 45 /* Rings (including Specials) */
#define TV_STAFF 55
#define TV_WAND 65
#define TV_ROD 66
#define TV_SCROLL 70
#define TV_POTION 75
#define TV_FLASK 77
#define TV_FOOD 80
#define TV_MAGIC_BOOK 90
#define TV_PRAYER_BOOK 91
#define TV_GOLD 100 /* Gold can only be picked up by players */
/* The "sval" codes for TV_SHOT/TV_ARROW/TV_BOLT */
#define SV_AMMO_LIGHT 0 /* pebbles */
#define SV_AMMO_NORMAL 1 /* shots, arrows, bolts */
#define SV_AMMO_HEAVY 2 /* seeker arrows and bolts */
/* The "sval" codes for TV_BOW (note information in "sval") */
#define SV_SLING 2 /* (x2) */
#define SV_SHORT_BOW 12 /* (x2) */
#define SV_LONG_BOW 13 /* (x3) */
#define SV_LIGHT_XBOW 23 /* (x3) */
#define SV_HEAVY_XBOW 24 /* (x4) */
/* The "sval" codes for TV_DIGGING */
#define SV_SHOVEL 1
#define SV_GNOMISH_SHOVEL 2
#define SV_DWARVEN_SHOVEL 3
#define SV_PICK 4
#define SV_ORCISH_PICK 5
#define SV_DWARVEN_PICK 6
/* The "sval" values for TV_HAFTED */
#define SV_WHIP 2 /* 1d6 */
#define SV_QUARTERSTAFF 3 /* 1d9 */
#define SV_MACE 5 /* 2d4 */
#define SV_BALL_AND_CHAIN 6 /* 2d4 */
#define SV_WAR_HAMMER 8 /* 3d3 */
#define SV_LUCERN_HAMMER 10 /* 2d5 */
#define SV_MORNING_STAR 12 /* 2d6 */
#define SV_FLAIL 13 /* 2d6 */
#define SV_LEAD_FILLED_MACE 15 /* 3d4 */
#define SV_TWO_HANDED_FLAIL 18 /* 3d6 */
#define SV_MACE_OF_DISRUPTION 20 /* 5d8 */
#define SV_GROND 50 /* 3d4 */
/* The "sval" values for TV_POLEARM */
#define SV_SPEAR 2 /* 1d6 */
#define SV_AWL_PIKE 4 /* 1d8 */
#define SV_TRIDENT 5 /* 1d9 */
#define SV_PIKE 8 /* 2d5 */
#define SV_BEAKED_AXE 10 /* 2d6 */
#define SV_BROAD_AXE 11 /* 2d6 */
#define SV_GLAIVE 13 /* 2d6 */
#define SV_HALBERD 15 /* 3d4 */
#define SV_SCYTHE 17 /* 5d3 */
#define SV_LANCE 20 /* 2d8 */
#define SV_BATTLE_AXE 22 /* 2d8 */
#define SV_GREAT_AXE 25 /* 4d4 */
#define SV_LOCHABER_AXE 28 /* 3d8 */
#define SV_SCYTHE_OF_SLICING 30 /* 8d4 */
/* The "sval" codes for TV_SWORD */
#define SV_BROKEN_DAGGER 1 /* 1d1 */
#define SV_BROKEN_SWORD 2 /* 1d2 */
#define SV_DAGGER 4 /* 1d4 */
#define SV_MAIN_GAUCHE 5 /* 1d5 */
#define SV_RAPIER 7 /* 1d6 */
#define SV_SMALL_SWORD 8 /* 1d6 */
#define SV_SHORT_SWORD 10 /* 1d7 */
#define SV_SABRE 11 /* 1d7 */
#define SV_CUTLASS 12 /* 1d7 */
#define SV_TULWAR 15 /* 2d4 */
#define SV_BROAD_SWORD 16 /* 2d5 */
#define SV_LONG_SWORD 17 /* 2d5 */
#define SV_SCIMITAR 18 /* 2d5 */
#define SV_KATANA 20 /* 3d4 */
#define SV_BASTARD_SWORD 21 /* 3d4 */
#define SV_TWO_HANDED_SWORD 25 /* 3d6 */
#define SV_EXECUTIONERS_SWORD 28 /* 4d5 */
#define SV_BLADE_OF_CHAOS 30 /* 6d5 */
/* The "sval" codes for TV_SHIELD */
#define SV_SMALL_LEATHER_SHIELD 2
#define SV_SMALL_METAL_SHIELD 3
#define SV_LARGE_LEATHER_SHIELD 4
#define SV_LARGE_METAL_SHIELD 5
#define SV_SHIELD_OF_DEFLECTION 10
/* The "sval" codes for TV_HELM */
#define SV_HARD_LEATHER_CAP 2
#define SV_METAL_CAP 3
#define SV_IRON_HELM 5
#define SV_STEEL_HELM 6
#define SV_IRON_CROWN 10
#define SV_GOLDEN_CROWN 11
#define SV_JEWELED_CROWN 12
#define SV_MORGOTH 50
/* The "sval" codes for TV_BOOTS */
#define SV_PAIR_OF_SOFT_LEATHER_BOOTS 2
#define SV_PAIR_OF_HARD_LEATHER_BOOTS 3
#define SV_PAIR_OF_METAL_SHOD_BOOTS 6
/* The "sval" codes for TV_CLOAK */
#define SV_CLOAK 1
#define SV_SHADOW_CLOAK 6
/* The "sval" codes for TV_GLOVES */
#define SV_SET_OF_LEATHER_GLOVES 1
#define SV_SET_OF_GAUNTLETS 2
#define SV_SET_OF_CESTI 5
/* The "sval" codes for TV_SOFT_ARMOR */
#define SV_FILTHY_RAG 1
#define SV_ROBE 2
#define SV_SOFT_LEATHER_ARMOR 4
#define SV_SOFT_STUDDED_LEATHER 5
#define SV_HARD_LEATHER_ARMOR 6
#define SV_HARD_STUDDED_LEATHER 7
#define SV_LEATHER_SCALE_MAIL 11
/* The "sval" codes for TV_HARD_ARMOR */
#define SV_RUSTY_CHAIN_MAIL 1 /* 14- */
#define SV_METAL_SCALE_MAIL 3 /* 13 */
#define SV_CHAIN_MAIL 4 /* 14 */
#define SV_AUGMENTED_CHAIN_MAIL 6 /* 16 */
#define SV_DOUBLE_CHAIN_MAIL 7 /* 16 */
#define SV_BAR_CHAIN_MAIL 8 /* 18 */
#define SV_METAL_BRIGANDINE_ARMOUR 9 /* 19 */
#define SV_PARTIAL_PLATE_ARMOUR 12 /* 22 */
#define SV_METAL_LAMELLAR_ARMOUR 13 /* 23 */
#define SV_FULL_PLATE_ARMOUR 15 /* 25 */
#define SV_RIBBED_PLATE_ARMOUR 18 /* 28 */
#define SV_MITHRIL_CHAIN_MAIL 20 /* 28+ */
#define SV_MITHRIL_PLATE_MAIL 25 /* 35+ */
#define SV_ADAMANTITE_PLATE_MAIL 30 /* 40+ */
/* The "sval" codes for TV_DRAG_ARMOR */
#define SV_DRAGON_BLACK 1
#define SV_DRAGON_BLUE 2
#define SV_DRAGON_WHITE 3
#define SV_DRAGON_RED 4
#define SV_DRAGON_GREEN 5
#define SV_DRAGON_MULTIHUED 6
#define SV_DRAGON_SHINING 10
#define SV_DRAGON_LAW 12
#define SV_DRAGON_BRONZE 14
#define SV_DRAGON_GOLD 16
#define SV_DRAGON_CHAOS 18
#define SV_DRAGON_BALANCE 20
#define SV_DRAGON_POWER 30
/* The sval codes for TV_LITE */
#define SV_LITE_TORCH 0
#define SV_LITE_LANTERN 1
#define SV_LITE_GALADRIEL 4
#define SV_LITE_ELENDIL 5
#define SV_LITE_THRAIN 6
/* The "sval" codes for TV_AMULET */
#define SV_AMULET_DOOM 0
#define SV_AMULET_TELEPORT 1
#define SV_AMULET_ADORNMENT 2
#define SV_AMULET_SLOW_DIGEST 3
#define SV_AMULET_RESIST_ACID 4
#define SV_AMULET_SEARCHING 5
#define SV_AMULET_WISDOM 6
#define SV_AMULET_CHARISMA 7
#define SV_AMULET_THE_MAGI 8
/* xxx */
#define SV_AMULET_CARLAMMAS 10
#define SV_AMULET_INGWE 11
#define SV_AMULET_DWARVES 12
/* The sval codes for TV_RING */
#define SV_RING_WOE 0
#define SV_RING_AGGRAVATION 1
#define SV_RING_WEAKNESS 2
#define SV_RING_STUPIDITY 3
#define SV_RING_TELEPORTATION 4
/* xxx */
#define SV_RING_SLOW_DIGESTION 6
#define SV_RING_FEATHER_FALL 7
#define SV_RING_RESIST_FIRE 8
#define SV_RING_RESIST_COLD 9
#define SV_RING_SUSTAIN_STR 10
#define SV_RING_SUSTAIN_INT 11
#define SV_RING_SUSTAIN_WIS 12
#define SV_RING_SUSTAIN_DEX 13
#define SV_RING_SUSTAIN_CON 14
#define SV_RING_SUSTAIN_CHR 15
#define SV_RING_PROTECTION 16
#define SV_RING_ACID 17
#define SV_RING_FLAMES 18
#define SV_RING_ICE 19
#define SV_RING_RESIST_POIS 20
#define SV_RING_FREE_ACTION 21
#define SV_RING_SEE_INVIS 22
#define SV_RING_SEARCHING 23
#define SV_RING_STR 24
#define SV_RING_INT 25
#define SV_RING_DEX 26
#define SV_RING_CON 27
#define SV_RING_ACCURACY 28
#define SV_RING_DAMAGE 29
#define SV_RING_SLAYING 30
#define SV_RING_SPEED 31
#define SV_RING_BARAHIR 32
#define SV_RING_TULKAS 33
#define SV_RING_NARYA 34
#define SV_RING_NENYA 35
#define SV_RING_VILYA 36
#define SV_RING_POWER 37
/* The "sval" codes for TV_STAFF */
#define SV_STAFF_DARKNESS 0
#define SV_STAFF_SLOWNESS 1
#define SV_STAFF_HASTE_MONSTERS 2
#define SV_STAFF_SUMMONING 3
#define SV_STAFF_TELEPORTATION 4
#define SV_STAFF_IDENTIFY 5
#define SV_STAFF_REMOVE_CURSE 6
#define SV_STAFF_STARLITE 7
#define SV_STAFF_LITE 8
#define SV_STAFF_MAPPING 9
#define SV_STAFF_DETECT_GOLD 10