forked from muspellsson/omega-ng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
defs.h
1941 lines (1687 loc) · 48.2 KB
/
defs.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
/* omega copyright (c) 1987,1988,1989 by Laurence Raphael Brothers */
/* This file is the header file for all omega modules */
/* defs.h */
/* omega will NOT function unless the implementor sets the appropriate
definitions in the following section. */
/*--------------------------USER DEFINITIONS--------------------------*/
/* Some minor quote changes... This #define should be removed after some
* public review, and the acceptable changes made permanent. */
#define NEW_QUOTES
/* A few parody quotes... These have to be checked to make sure that they
* make sense even if you don't know what they're parodying. */
#define TRADEMARK_VIOLATION
/* Include the Monk guild. */
#define INCLUDE_MONKS
/* Update the display every turn to center on the player. Rather heavy
* on the bandwidth. */
/* #define CENTER_ON_PLAYER */
#define NEW_BANK
/* Implementor should uncomment the following if his system uses
string.h instead of strings.h (try man string) */
#define STRING
/* Implementor should define int32 as the type of integer which uses
* 32 bits. */
typedef int int32;
/* Implementor should uncomment the following if getopt is not
available */
/* #define NOGETOPT */
/* Implementor should uncomment the following if omega appears to
redraw the screen excessively. */
#define EXCESSIVE_REDRAW
/* The following definition is recommended. Remove it only if you have
huge amounts of disk space and are annoyed at waiting a few more seconds
on save and restore. */
/*#define COMPRESS_SAVE_FILES*/
/* If your system has gzip, I recommend using it instead of compress */
/* (try just typing 'gzip' at the shell prompt) */
#define USE_GZIP
/* If your system doesn't have the usleep call, uncomment this line */
/* (try man usleep) */
/* #define NO_USLEEP */
/* Define the maximum length of a filename on your system. If you don't */
/* define, will try to make an educated guess. If you have one, */
/* /usr/include/limits.h is a good place to look for this value. */
/* DOS needn't worry; I'm forcing its FNAME_MAX_LENGTH to 8 elsewhere
* in this file (we'll wait for LFN support). */
#define FNAME_MAX_LEN 48
/* OMEGALIB is where all the data files reside.
Note the final / is necessary.
msdos note: \ is the C string escape character, so you need \\ in the
path given in OMEGALIB
This might usually be "/usr/games/lib/omegalib/", for unix,
or something like "c:\\games\\omega\\omegalib\\" for msdos */
#define OMEGALIB "./lib/"
/* OMEGASTATE is where all the volatile data files reside.
Notes as above apply. */
#define OMEGASTATE "./lib/"
/* TILEFILE is the name of the file you want to use for graphics tiles. You */
/* aren't really free to use any file you want here. It should be the Omega */
/* distribution graphics files provided for your computer. Of course a file */
/* of the same format and size as the "correct" file will also work if you */
/* want to change things around. This file should be located in OMEGALIB */
#define TILEFILE "omegatiles.xpm"
/* Comment the following line out if you want users to be able to override */
/* the OMEGALIB define, above, by setting the environment variable OMEGALIB */
/* (I recommend leaving this line uncommented, unless you're compiling */
/* for someone else and don't know where they'll be putting the omegalib */
/* directory, as is the case with compiling executables for home computers. */
/* It would be downright insecure to comment this line out in a multi-user */
/* environment, especially if you're going to run omega setuid.) */
#define FIXED_OMEGALIB
/* set WIZARD to maintainers's username */
#define WIZARD "ivan"
/* If CATCH_SIGNALS is set to 1, will not dump core, nicer for players. */
/* dbx still intercepts the signals first, so it's ok for debugging */
#define CATCH_SIGNALS 1
/*---------------------------SYSTEM DEFINITIONS---------------------------*/
/* Don't change anything from here on (unless you know what you're doing) */
#define VERSION 9003
#define VERSIONSTRING "omega version 0.91"
#ifdef __WIN32
#define MSDOS
#endif
#ifndef AMIGA
#ifndef MSDOS
#ifndef BSD
#ifndef SYSV
ERROR! - One of these should be set - edit the makefile appropriately
#endif
#endif
#endif
#endif
/*
* WDT: according to my man page, getopt should be defined in unistd.h,
* but my compiler seems to disagree unless this is set. I hope that
* this doesn't break too many things. */
/*#define __USE_POSIX2*/
#define _DEFAULT_SOURCE
#define _XOPEN_SOURCE 500
#if defined(MSDOS_SUPPORTED_ANTIQUE)
#define SAVE_LEVELS
#endif
#ifdef COMPRESS_SAVE_FILES
# ifdef USE_GZIP
# define COMPRESSOR "gzip"
# define UNCOMPRESSOR "gunzip"
# define COMPRESS_EXT "gz"
# define EXT_LENGTH 2
# else
# define COMPRESSOR "compress"
# define UNCOMPRESSOR "uncompress"
# define COMPRESS_EXT "Z"
# define EXT_LENGTH 1
# endif
#else
# define EXT_LENGTH 0
#endif
#if !defined(FNAME_MAX_LEN) || defined(MSDOS)
# ifdef MSDOS
# undef FNAME_MAX_LEN
# define FNAME_MAX_LEN 7
# else
# define FNAME_MAX_LEN 14
# endif
#endif
#define VACANT 0
#define ABORT -1
#define CASHVALUE -2
/* moderately arbitrary but probably cannot be easily changed */
/*#define MAXWIDTH 64*/
#define MAXWIDTH 128
#define MAXLENGTH 64
#define SMALLSCREEN_LENGTH 16
#define SMALLSCREEN_WIDTH 64
#define STANDARD_LENGTH 64
#define STANDARD_WIDTH 64
#define ARENA_WIDTH SMALLSCREEN_WIDTH
#define ARENA_LENGTH SMALLSCREEN_LENGTH
#define ABYSS_WIDTH STANDARD_WIDTH
#define ABYSS_LENGTH SMALLSCREEN_LENGTH
#define ASTRAL_WIDTH STANDARD_WIDTH
#define ASTRAL_LENGTH STANDARD_LENGTH
#define CASTLE_WIDTH STANDARD_WIDTH
#define CASTLE_LENGTH STANDARD_LENGTH
#define CAVES_WIDTH STANDARD_WIDTH
#define CAVES_LENGTH STANDARD_LENGTH
#define CIRCLE_WIDTH SMALLSCREEN_WIDTH
#define CIRCLE_LENGTH SMALLSCREEN_LENGTH
#define COUNTRY_WIDTH STANDARD_WIDTH
#define COUNTRY_LENGTH STANDARD_LENGTH
#define COURT_WIDTH SMALLSCREEN_WIDTH
#define COURT_LENGTH 24
#define DLAIR_WIDTH SMALLSCREEN_WIDTH
#define DLAIR_LENGTH SMALLSCREEN_LENGTH
#define HOUSE_WIDTH SMALLSCREEN_WIDTH
#define HOUSE_LENGTH SMALLSCREEN_LENGTH
#define HOVEL_WIDTH SMALLSCREEN_WIDTH
#define HOVEL_LENGTH SMALLSCREEN_LENGTH
#define MANSION_WIDTH SMALLSCREEN_WIDTH
#define MANSION_LENGTH SMALLSCREEN_LENGTH
#define MISLE_WIDTH SMALLSCREEN_WIDTH
#define MISLE_LENGTH SMALLSCREEN_LENGTH
#define PALACE_WIDTH STANDARD_WIDTH
#define PALACE_LENGTH STANDARD_LENGTH
#define RAMPART_WIDTH 128
#define RAMPART_LENGTH STANDARD_LENGTH
#define SEWERS_WIDTH STANDARD_WIDTH
#define SEWERS_LENGTH STANDARD_LENGTH
#define SPEAK_WIDTH SMALLSCREEN_WIDTH
#define SPEAK_LENGTH SMALLSCREEN_LENGTH
#define TACTICAL_WIDTH SMALLSCREEN_WIDTH
#define TACTICAL_LENGTH SMALLSCREEN_LENGTH
#define TEMPLE_WIDTH SMALLSCREEN_WIDTH
#define TEMPLE_LENGTH SMALLSCREEN_LENGTH
#define VILLAGE_WIDTH SMALLSCREEN_WIDTH
#define VILLAGE_LENGTH SMALLSCREEN_LENGTH
#define VOLCANO_WIDTH STANDARD_WIDTH
#define VOLCANO_LENGTH STANDARD_LENGTH
/* number of slots in inventory. Cannot be changed without work */
#define MAXITEMS 16
/* number of slots in pack. Should be <= 26. */
#define MAXPACK 26
/* number of items in pawn shop. Should be <= 26 */
#define PAWNITEMS 20 /* DG -- the more the merrier. WDT -- I agree. */
/* number of lines back strings are recalled */
#define STRING_BUFFER_SIZE 25
/* number of rerolls allowed +1 */ /* added by dagibbs (DG) */
#define REROLLS -1
/* Verbosity levels */
#define TERSE 0
#define MEDIUM 1
#define VERBOSE 2
/* Arbitrary. Max of the levels in the dungeons */
#define MAXLEVELS 21
/* levels in each dungeon */
#define ASTRALLEVELS 5
#define SEWERLEVELS 18
#define CASTLELEVELS 16
#define CAVELEVELS 10
#define VOLCANOLEVELS 20
#define PALACELEVELS 14
/* Overall Game Progress Vector Bits */
/* Long had BETTER have at least 32 bits.... */
#define SPOKE_TO_DRUID 0x1
#define COMPLETED_CAVES 0x2
#define COMPLETED_SEWERS 0x4
#define COMPLETED_CASTLE 0x8
#define COMPLETED_ASTRAL 0x10
#define COMPLETED_VOLCANO 0x20
#define KILLED_DRAGONLORD 0x40
#define KILLED_EATER 0x80
#define KILLED_LAWBRINGER 0x100
#define COMPLETED_CHALLENGE 0x200
#define SOLD_CONDO 0x400
#define FAST_MOVE 0x800
#define SKIP_PLAYER 0x1000
#define SKIP_MONSTERS 0x2000
#define MOUNTED 0x4000
#define SUPPRESS_PRINTING 0x8000
#define LOST 0x10000
#define ARENA_MODE 0x20000
#define CHEATED 0x40000
#define BANK_BROKEN 0x80000
#define CLUB_MEMBER 0x100000
#define PREPARED_VOID 0x200000
#define DESTROYED_ORDER 0x400000
#define GAVE_STARGEM 0x800000
#define ATTACKED_ORACLE 0x1000000
#define UNDEAD_GUARDS 0x2000000
/* 26 so far... */
/* non-existant environments for the random number seeding routine */
/* added 12/30/98 (DG) */
#define E_RESTORE -2
#define E_RANDOM -1
/* general environment types */
#define E_NEVER_NEVER_LAND 0
#define E_COUNTRYSIDE 1
#define E_CITY 2
#define E_VILLAGE 3
#define E_TACTICAL_MAP 4
#define E_SEWERS 5
#define E_CASTLE 6
#define E_CAVES 7
#define E_VOLCANO 8
#define E_ASTRAL 9
#define E_ARENA 10
#define E_HOVEL 11
#define E_MANSION 12
#define E_HOUSE 13
#define E_DLAIR 14
#define E_ABYSS 15
#define E_STARPEAK 16
#define E_MAGIC_ISLE 17
#define E_TEMPLE 18
#define E_CIRCLE 19
#define E_COURT 20
#define E_PALACE 21
#define E_MAX E_PALACE
/* player game status */
#define DEAD 1
#define QUIT 2
#define WIN 3
#define BIGWIN 4
/* kind of arbitrary */
#define MAXROOMS 48
#define MAXCONNECTIONS 4
#define STRING_LEN 100
/* some random characters */
#define ESCAPE 27
#define RETURN '\n' /* Aren't these backwards? WSS */
#define LINEFEED '\r' /* Aren't these backwards? WSS */
#define BACKSPACE '\b'
#define DELETE 127
/* tac mode action definitions */
/* have to remember to find where these are used, mostly unused, now! */
#define DISENGAGE 10
#define BLOCK 20
#define CUT 30
#define THRUST 40
#define MAGIC 50
#define LUNGE 60
#define RIPOSTE 70
#define WIELD 80
#define PICK_UP 90
/* as in attack low, block high, etc. */
/* These values may be added to the ones above to get things like
block high, cut low, etc. CLEVER is only used by some monsters
to cheat with.... */
#define LOW 1
#define CENTER 2
#define HIGH 3
#define CLEVER 4
/* weapon types */
#define CUTTING 1
#define THRUSTING 2
#define STRIKING 3
#define MISSILE 4
/* random aux constants */
/* aux field for private residences in city */
#define BURGLED 2
#define LOCKED 3
#define UNLOCKED 0
/* cannot use M command on site with this aux value */
#define NOCITYMOVE 666
/* bow and crossbow object aux fields */
#define LOADED 1
#define UNLOADED 0
/* alignment used randomly throughout*/
#define LAWFUL 1
#define CHAOTIC 2
#define NEUTRAL 3
/* spells */
#define NUMSPELLS 42
#define S_MON_DET 0
#define S_OBJ_DET 1
#define S_MISSILE 2
#define S_FIREBOLT 3
#define S_TELEPORT 4
#define S_LBALL 5
#define S_SLEEP 6
#define S_DISRUPT 7
#define S_DISINTEGRATE 8
#define S_POLYMORPH 9
#define S_HEAL 10
#define S_DISPEL 11
#define S_IDENTIFY 12
#define S_BREATHE 13
#define S_INVISIBLE 14
#define S_WARP 15
#define S_ENCHANT 16
#define S_BLESS 17
#define S_RESTORE 18
#define S_CURE 19
#define S_TRUESIGHT 20
#define S_HELLFIRE 21
#define S_KNOWLEDGE 22
#define S_HERO 23
#define S_RETURN 24
#define S_DESECRATE 25
#define S_HASTE 26
#define S_SUMMON 27
#define S_SANCTUARY 28
#define S_ACCURACY 29
#define S_RITUAL 30
#define S_FEAR 31
#define S_APPORT 32
#define S_SHADOWFORM 33
#define S_ALERT 34
#define S_REGENERATE 35
#define S_SANCTIFY 36
#define S_CLAIRVOYANCE 37
#define S_DRAIN 38
#define S_LEVITATE 39
#define S_WISH 40
#define S_NUTRITION 41
/* ranks in guilds, etc */
#define NUMRANKS 10
#define LEGION 0
#define ARENA 1
#define COLLEGE 2
#define THIEVES 3
#define ORDER 4
#define CIRCLE 5
#define NOBILITY 6
#define PRIESTHOOD 7
#ifdef INCLUDE_MONKS
#define MONKS 8
#endif
#define ADEPT 9
#define LEGIONAIRE 1
#define CENTURION 2
#define FORCE_LEADER 3
#define COLONEL 4
#define COMMANDANT 5
#define TRAINEE 1
#define BESTIARIUS 2
#define RETIARIUS 3
#define GLADIATOR 4
#define CHAMPION 5
#define NOVICE 1
#define STUDENT 2
#define PRECEPTOR 3
#define MAGE 4
#define ARCHMAGE 5
#define TMEMBER 1
#define ATHIEF 2
#define THIEF 3
#define TMASTER 4
#define SHADOWLORD 5
#define GALLANT 1
#define GUARDIAN 2
#define CHEVALIER 3
#define PALADIN 4
#define JUSTICIAR 5
#define INITIATE 1
#define ENCHANTER 2
#define SORCEROR 3
#define HIGHSORCEROR 4
#define PRIME 5
#define COMMONER 1
#define ESQUIRE 2
#define KNIGHT 3
#define LORD 4
#define DUKE 5
#define LAY 1
#define ACOLYTE 2
#define PRIEST 3
#define SPRIEST 4
#define HIGHPRIEST 5
#ifdef INCLUDE_MONKS
#define MONK_TRAINEE 1
#define MONK_MONK 2
#define MONK_MASTER 3
#define MONK_MASTER_SIGHS 4
#define MONK_MASTER_PAINS 5
#define MONK_MASTER_TEARS 6
#define MONK_GRANDMASTER 7
#endif
/* different priesthoods */
#define ODIN 1
#define SET 2
#define ATHENA 3
#define HECATE 4
#define DRUID 5
#define DESTINY 6
/* MONSTER STATUS/ABILITY BITS */
/* currently a long */
#define AWAKE 1
#define MOBILE 2
#define HOSTILE 4
/* missing bit 3, 8 */
#define WANDERING 16
#define HUNGRY 32
#define GREEDY 64
#define NEEDY 128
#define ONLYSWIM 256
#define FLYING 512
#define INTANGIBLE 1024
#define M_INVISIBLE 2048
#define SWIMMING 4096
#define POISONOUS 8192
#define EDIBLE 16384
#define ALLOC 32768 /* allocated monstring & corpsestr */
/* PLAYER STATUS INDICES */
#define NUMSTATI 25
#define ACCURACY 0
#define BLINDED 1
#define SLOWED 2
#define DISPLACED 3
#define SLEPT 4
#define DISEASED 5
#define POISONED 6
#define HASTED 7
#define BREATHING 8
#define INVISIBLE 9
#define REGENERATING 10
#define VULNERABLE 11
#define BERSERK 12
#define IMMOBILE 13
#define ALERT 14
#define AFRAID 15
#define HERO 16
#define LEVITATING 17
#define ACCURATE 18
#define TRUESIGHT 19
#define SHADOWFORM 20
#define ILLUMINATION 21
#define DEFLECTION 22
#define PROTECTION 23
/* PROTECTION is deviant -- indicates protective value, not duration */
#define RETURNING 24
/* RETURNING is somewhat deviant--how many turns 'til RETURN spell goes off */
/* player immunity indices */
/* also monster immunity bits (2^n) */
/* also damage types */
#define NUMIMMUNITIES 14
#define UNSTOPPABLE 0
#define NORMAL_DAMAGE 1
#define FLAME 2
#define COLD 3
#define ELECTRICITY 4
#define POISON 5
#define ACID 6
#define FEAR 7
#define SLEEP 8
#define NEGENERGY 9
#define OTHER_MAGIC 10
#define THEFT 11
#define GAZE 12
#define INFECTION 13
#define EVERYTHING -1
/* location lstatus bits */
#define SEEN 1
#define LIT 2
#define SECRET 4
#define STOPS 8
#define CHANGED 16
/* room string id */
/* for use in roomname() */
/* number of rooms above ROOMBASE */
#define NUMROOMNAMES 30
#define RS_WALLSPACE 1
#define RS_CORRIDOR 2
#define RS_CAVERN 3
#define RS_GOBLINKING 4
#define RS_DRAGONLORD 5
#define RS_PONDS 6
#define RS_OCEAN 7
#define RS_WYRM 8
#define RS_ADEPT 9
#define RS_DESTINY 10
#define RS_ODIN 11
#define RS_SET 12
#define RS_ATHENA 13
#define RS_HECATE 14
#define RS_DRUID 15
#define RS_COUNTRYSIDE 16
#define RS_ARENA 17
#define RS_SEWER_DUCT 18
#define RS_DRAINED_SEWER 19
#define RS_DROWNED_SEWER 20
#define RS_KITCHEN 21
#define RS_BEDROOM 22
#define RS_BATHROOM 23
#define RS_DININGROOM 24
#define RS_SECRETPASSAGE 25
#define RS_CLOSET 26
#define RS_LOWERASTRAL 27
#define RS_EARTHPLANE 28
#define RS_WATERPLANE 29
#define RS_AIRPLANE 30
#define RS_FIREPLANE 31
#define RS_HIGHASTRAL 32
#define RS_VOLCANO 33
#define RS_STARPEAK 34
#define RS_MAGIC_ISLE 35
#define RS_CIRCLE 36
#define RS_ZORCH 37
#define RS_COURT 38
/* normal room name indices start after the RS_ constants */
#define ROOMBASE 39
#define RS_GARDEROBE ROOMBASE+0
#define RS_CELL ROOMBASE+1
#define RS_TILED ROOMBASE+2
#define RS_CRYSTAL_CAVE ROOMBASE+3
#define RS_BEDROOM2 ROOMBASE+4
#define RS_STOREROOM ROOMBASE+5
#define RS_CHARRED ROOMBASE+6
#define RS_MARBLE_HALL ROOMBASE+7
#define RS_EERIE_CAVE ROOMBASE+8
#define RS_TREASURE ROOMBASE+9
#define RS_SMOKEY ROOMBASE+10
#define RS_APARTMENT ROOMBASE+11
#define RS_ANTECHAMBER ROOMBASE+12
#define RS_HAREM ROOMBASE+13
#define RS_MULTIPURPOSE ROOMBASE+14
#define RS_STALACTITES ROOMBASE+15
#define RS_GREENHOUSE ROOMBASE+16
#define RS_WATERCLOSET ROOMBASE+17
#define RS_STUDY ROOMBASE+18
#define RS_LIVING_ROOM ROOMBASE+19
#define RS_DEN ROOMBASE+20
#define RS_ABATOIR ROOMBASE+21
#define RS_BOUDOIR ROOMBASE+22
#define RS_STAR_CHAMBER ROOMBASE+23
#define RS_MANMADE_CAVE ROOMBASE+24
#define RS_SEWER_CONTROL ROOMBASE+25
#define RS_SHRINE ROOMBASE+26
#define RS_MAGIC_LAB ROOMBASE+27
#define RS_PENTAGRAM ROOMBASE+28
#define RS_OMEGA_DAIS ROOMBASE+29
#if defined(MSDOS_SUPPORTED_ANTIQUE) || defined(AMIGA)
#define CLR(fg) COL_##fg
#define CLRS(fg,bg) COL_##fg|COL_BG_##bg
#endif
#if defined(MSDOS_SUPPORTED_ANTIQUE)
#define COL_BLACK 0x0000
#define COL_BLUE 0x0100
#define COL_GREEN 0x0200
#define COL_CYAN 0x0300
#define COL_RED 0x0400
#define COL_PURPLE 0x0500
#define COL_BROWN 0x0600
#define COL_WHITE 0x0700
#define COL_GREY 0x0800
#define COL_LIGHT_BLUE 0x0900
#define COL_LIGHT_GREEN 0x0a00
#define COL_LIGHT_CYAN 0x0b00
#define COL_LIGHT_RED 0x0c00
#define COL_LIGHT_PURPLE 0x0d00
#define COL_YELLOW 0x0e00
#define COL_BRIGHT_WHITE 0x0f00
#define COL_BG_BLACK 0x0000
#define COL_BG_BLUE 0x1000
#define COL_BG_GREEN 0x2000
#define COL_BG_CYAN 0x3000
#define COL_BG_RED 0x4000
#define COL_BG_PURPLE 0x5000
#define COL_BG_BROWN 0x6000
#define COL_BG_WHITE 0x7000
#define COL_FG_BLINK 0x8000
#elif defined(AMIGA)
#include <curses210.h>
/* unfortunately, this curses package only implements 8 colours... */
#define COL_WHITE 0x0100
#define COL_BLACK COL_WHITE
/* this assumes that all things with black fg have white bg */
#define COL_BROWN 0x0200
#define COL_YELLOW 0x0300
#define COL_GREY 0x0400
#define COL_GREEN 0x0500
#define COL_BLUE 0x0600
#define COL_RED 0x0700
#define COL_CYAN 0x0500 /* = green */
#define COL_PURPLE 0x0700 /* = red */
#define COL_LIGHT_BLUE 0x0600 /* = blue */
#define COL_LIGHT_GREEN 0x0500 /* = green */
#define COL_LIGHT_CYAN 0x0500 /* = green */
#define COL_LIGHT_RED 0x0700 /* = red */
#define COL_LIGHT_PURPLE 0x0100 /* = white */
#define COL_BRIGHT_WHITE 0x0100 /* = white */
#define COL_BG_BLACK 0x0000
#define COL_BG_WHITE (A_REVERSE<<8)
#define COL_BG_GREEN (A_REVERSE<<8)
#define COL_BG_CYAN (A_REVERSE<<8)
#define COL_BG_RED (A_REVERSE<<8)
#define COL_BG_PURPLE (A_REVERSE<<8)
#define COL_BG_BROWN (A_REVERSE<<8)
#define COL_BG_BLUE (A_REVERSE<<8)
#define COL_FG_BLINK 0x0000 /* not implemented :( */
/* WDT: thank goodness for that lack of implementation. */
#else /* !MSDOS_ANTIQUE && !AMIGA */
# ifdef USE_OPCURSES
# include "../opcurses/curses.h"
# else
# include <curses.h>
# endif
# define COL_FG_BLINK A_BLINK
# ifdef COLOR_PAIR
# ifdef OMEGA_CLRGEN
# define CLR(fg) OMEGA_CLRGEN1 fg
# define CLRS(fg, bg) OMEGA_CLRGEN2 fg bg
# else
# include "clrgen.h"
# define CLR(fg) CLR_##fg##_BLACK
# define CLRS(fg, bg) CLR_##fg##_##bg
# endif
# else /* COLOR_PAIR */
# define CLR(fg) 0
# define CLRS(fg,bg) 0
# endif /* COLOR_PAIR */
#endif /* !MSDOS_ANTIQUE && !AMIGA */
/* objects, locations, and terrain; characters to draw */
#define NULL_ITEM '\0'
#define SPACE (' ' | CLR(WHITE))
#define WALL ('#' | CLR(GREY))
#define PORTCULLIS ('7' | CLR(WHITE))
#define OPEN_DOOR ('|' | CLR(BROWN))
#define CLOSED_DOOR ('-' | CLR(BROWN))
#define WHIRLWIND ('6' | CLR(LIGHT_BLUE))
#define ABYSS ('0' | CLRS(BLACK,BROWN))
#define VOID_CHAR (' ' | CLR(WHITE))
#define LAVA ('`' | CLR(RED))
#define HEDGE ('\"' | CLR(GREEN))
#define WATER ('~' | CLR(BLUE))
#define FIRE (';' | CLR(LIGHT_RED))
#define TRAP ('^' | CLR(RED))
#define LIFT ('_' | CLR(BRIGHT_WHITE))
#define STAIRS_UP ('<' | CLR(WHITE))
#define STAIRS_DOWN ('>' | CLR(WHITE))
#define FLOOR ('.' | CLR(BROWN))
#define PLAYER ('@' | CLR(WHITE))
#define CORPSE ('+' | CLR(RED))
#define STATUE ('1' | CLR(GREY))
#define RUBBLE ('4' | CLR(GREY))
#define ALTAR ('8' | CLR(LIGHT_BLUE))
#define CASH ('$' | CLR(YELLOW)) /* various kinds of money */
#define PILE ('*' | CLR(BRIGHT_WHITE)) /* several objects in one place */
#define FOOD ('%' | CLR(BROWN))
#define WEAPON (')' | CLR(GREY))
#define MISSILEWEAPON ('(' | CLR(BROWN))
#define SCROLL ('?' | CLR(YELLOW))
#define POTION ('!' | CLR(LIGHT_GREEN))
#define ARMOR (']' | CLR(GREY))
#define SHIELD ('[' | CLR(BROWN))
#define CLOAK ('}' | CLR(CYAN))
#define BOOTS ('{' | CLR(BROWN))
#define STICK ('/' | CLR(BROWN))
#define RING ('=' | CLR(YELLOW))
#define THING ('\\' | CLR(WHITE))
#define ARTIFACT ('&' | CLR(YELLOW))
/* TERRAIN TYPES */
#define PLAINS ('-' | CLR(LIGHT_GREEN))
#define TUNDRA ('_' | CLR(GREY))
#define ROAD ('.' | CLR(BROWN))
#define MOUNTAINS ('^' | CLR(GREY))
#define PASS ('v' | CLR(BROWN))
#define RIVER ('~' | CLR(BLUE))
#define CITY ('O' | CLR(WHITE))
#define VILLAGE ('o' | CLR(WHITE))
#define FOREST ('(' | CLR(LIGHT_GREEN))
#define JUNGLE (')' | CLR(GREEN))
#define SWAMP ('=' | CLR(GREEN))
#define VOLCANO ('!' | CLR(RED))
#define CASTLE ('%' | CLR(GREY))
#define TEMPLE ('X' | CLR(BROWN))
#define CAVES ('*' | CLRS(BLACK,BROWN))
#define DESERT ('\"' | CLR(YELLOW))
#define CHAOS_SEA ('+' | CLR(LIGHT_PURPLE))
#define STARPEAK ('|' | CLR(LIGHT_BLUE))
#define DRAGONLAIR ('$' | CLR(BROWN))
#define MAGIC_ISLE ('&' | CLR(PURPLE))
#define PALACE ('K' | CLR(PURPLE))
#define CHAIR ('5' | CLR(BROWN))
#define SAFE ('3' | CLR(GREY))
#define FURNITURE ('2' | CLR(BROWN))
#define BED ('9' | CLR(CYAN))
/* wow, all characters used! */
/* total number of editable stats */
#define NUMSTATS 11
/* total number of player options */
#define NUMOPTIONS 11
/* number of options with TRUE/FALSE values */
#define NUMTFOPTIONS 9
/* The slot number of the two options not in Player.options */
#define VERBOSITY_LEVEL 10
#define SEARCH_DURATION 11
/* Player.options bits */
#define BELLICOSE 1
#define JUMPMOVE 2
#define RUNSTOP 4
#define PICKUP 8
#define CONFIRM 16
#define TOPINV 32
#define PACKADD 64
#define COMPRESS_OPTION 128
#define SHOW_COLOUR 256
/* This has to be changed whenever an item is added */
#define NUMSCROLLS 24
#define NUMPOTIONS 18
#define NUMFOODS 16
#define NUMTHINGS 31 /* DAG for mirror of self-knowledge */ /* WSS cards */
#define NUMCARDS 4
#define NUMWEAPONS 41
#define NUMARMOR 17
#define NUMSHIELDS 8
#define NUMCLOAKS 7
#define NUMBOOTS 7
#define NUMRINGS 9 /* DAG loss of ring of self-knowledge */
#define NUMSTICKS 17
#define NUMARTIFACTS 26
/* running sum of itemtypes, for indexing into Objects array */
#define THINGID 0
#define CARDID (THINGID+NUMTHINGS-NUMCARDS)
#define FOODID NUMTHINGS /* 26 */
#define SCROLLID (FOODID + NUMFOODS) /* 42 */
#define POTIONID (SCROLLID + NUMSCROLLS) /* 66 */
#define WEAPONID (POTIONID + NUMPOTIONS) /* 84 */
#define ARMORID (WEAPONID + NUMWEAPONS) /* 125 */
#define SHIELDID (ARMORID + NUMARMOR) /* 142 */
#define CLOAKID (SHIELDID + NUMSHIELDS) /* 150 */
#define BOOTID (CLOAKID + NUMCLOAKS) /* 157 */
#define RINGID (BOOTID + NUMBOOTS) /* 164 */
#define STICKID (RINGID + NUMRINGS) /* 174 */
#define ARTIFACTID (STICKID + NUMSTICKS) /* 191 */
#define CASHID (ARTIFACTID+NUMARTIFACTS) /* 216 */
/* Corpse's aux field is monster id */
#define CORPSEID (CASHID+1)
#define TOTALITEMS (CORPSEID+1)
/* descriptive constants for various object ids */
#define OB_GARAGE_OPENER (THINGID+0)
#define OB_LOCK_PICK (THINGID+2)
#define OB_SALT_WATER (THINGID+6)
#define OB_KEY (THINGID+7)
#define OB_TORCH (THINGID+8)
#define OB_JUSTICIAR_BADGE (THINGID+16)
#define OB_TRAP_DART (THINGID+17)
#define OB_TRAP_ACID (THINGID+18)
#define OB_TRAP_SNARE (THINGID+19)
#define OB_TRAP_FIRE (THINGID+20)
#define OB_TRAP_TELEPORT (THINGID+21)
#define OB_TRAP_SLEEP (THINGID+22)
#define OB_TRAP_DISINTEGRATE (THINGID+23)
#define OB_TRAP_ABYSS (THINGID+24)
#define OB_TRAP_MANADRAIN (THINGID+25)
#define OB_DEBIT_CARD (CARDID+0)
#define OB_CREDIT_CARD (CARDID+1)
#define OB_PREPAID_CARD (CARDID+2)
#define OB_SMART_CARD (CARDID+3)
#define OB_RATION (FOODID+0)
#define OB_LEMBAS (FOODID+1)
#define OB_GRAIN (FOODID+15)
#define OB_BLANK_SCROLL (SCROLLID+0)
#define OB_SPELLS_SCROLL (SCROLLID+1)
#define OB_SCROLL_LAW (SCROLLID+17)
#define OB_POTION_CHAOS (POTIONID+14)
#define OB_SHORT_SWORD (WEAPONID+1)
#define OB_GREAT_SWORD (WEAPONID+5)
#define OB_GREAT_AXE (WEAPONID+12)
#define OB_CLUB (WEAPONID+17)
#define OB_QUARTERSTAFF (WEAPONID+18)
#define OB_SPEAR (WEAPONID+19)
#define OB_HALBERD (WEAPONID+20)
#define OB_MACE_DISRUPT (WEAPONID+25)
#define OB_LONGBOW (WEAPONID+26)
#define OB_CROSSBOW (WEAPONID+27)
#define OB_ARROW (WEAPONID+28)
#define OB_BOLT (WEAPONID+29)
#define OB_DESECRATOR (WEAPONID+32)
#define OB_DEFENDER (WEAPONID+34)
#define OB_VICTRIX (WEAPONID+35)
#define OB_HEWER (WEAPONID+36)
#define OB_GIANT_CLUB (WEAPONID+38)
#define OB_SCYTHE_DEATH (WEAPONID+39)
#define OB_LEATHER (ARMORID+1)
#define OB_MITHRIL_PLATE (ARMORID+11)
#define OB_DRAGONSCALE (ARMORID+12)
#define OB_LRG_RND_SHIELD (SHIELDID+2)
#define OB_DEFLECT (SHIELDID+7)
#define OB_CLOAK_PROTECT (CLOAKID+4)
#define OB_ORB_MASTERY (ARTIFACTID+0)
#define OB_ORB_FIRE (ARTIFACTID+1)
#define OB_ORB_WATER (ARTIFACTID+2)
#define OB_ORB_EARTH (ARTIFACTID+3)
#define OB_ORB_AIR (ARTIFACTID+4)
#define OB_DEAD_ORB (ARTIFACTID+5)
#define OB_ANTIOCH (ARTIFACTID+7)
#define OB_YENDOR (ARTIFACTID+8)
#define OB_KOLWYNIA (ARTIFACTID+9)
#define OB_POTION_DEATH (ARTIFACTID+10)
#define OB_POTION_LIFE (ARTIFACTID+13)
#define OB_SYMBOL_ODIN (ARTIFACTID+14)
#define OB_SYMBOL_SET (ARTIFACTID+15)
#define OB_SYMBOL_ATHENA (ARTIFACTID+16)
#define OB_SYMBOL_HECATE (ARTIFACTID+17)
#define OB_SYMBOL_DRUID (ARTIFACTID+18)
#define OB_SYMBOL_DESTINY (ARTIFACTID+19)
#define OB_KARNAK (ARTIFACTID+20)
#define OB_STARGEM (ARTIFACTID+21)
#define OB_SCEPTRE (ARTIFACTID+22)
#define OB_HOLDING (ARTIFACTID+24)
/* describing unique items and monsters */
#define COMMON 0
#define UNIQUE_UNMADE 1
#define UNIQUE_MADE 2
#define UNIQUE_TAKEN 3
/* general item function id's */
#define I_NO_OP 0
#define I_NOTHING 1
/* note some of these functions are for other types of items too */
/* scroll functions */
#define I_BLESS 101