This repository has been archived by the owner on Apr 26, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rogue.h
3216 lines (2873 loc) · 117 KB
/
Rogue.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
//
// RogueMain.h
// Brogue
//
// Created by Brian Walker on 12/26/08.
// Copyright 2012. All rights reserved.
//
// This file is part of Brogue.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "PlatformDefines.h"
// unicode: comment this line to revert to ASCII
#define USE_UNICODE
// version string -- no more than 16 bytes:
#define BROGUE_VERSION_STRING "1.7.4.0"
// debug macros -- define DEBUGGING as 1 to enable wizard mode.
#define DEBUGGING 0
#define REMOVE_CURSE_CURES 0
#define DEBUG if (DEBUGGING)
#define MONSTERS_ENABLED (!DEBUGGING || 1) // Quest room monsters can be generated regardless.
#define ITEMS_ENABLED (!DEBUGGING || 1)
#define D_BULLET_TIME (DEBUGGING && 0)
#define D_WORMHOLING (DEBUGGING && 1)
#define D_IMMORTAL (DEBUGGING && 1)
#define D_SAFETY_VISION (DEBUGGING && 0)
#define D_SCENT_VISION (DEBUGGING && 0)
#define D_DISABLE_BACKGROUND_COLORS (DEBUGGING && 0)
#define D_INSPECT_LEVELGEN (DEBUGGING && 0)
#define D_INSPECT_MACHINES (DEBUGGING && 0)
#define D_MESSAGE_ITEM_GENERATION (DEBUGGING && 0)
#define D_MESSAGE_MACHINE_GENERATION (DEBUGGING && 0)
// set to false to allow multiple loads from the same saved file:
#define DELETE_SAVE_FILE_AFTER_LOADING true
// set to false to disable references to keystrokes (e.g. for a tablet port)
#define KEYBOARD_LABELS true
//#define BROGUE_ASSERTS // introduces several assert()s -- useful to find certain array overruns and other bugs
//#define AUDIT_RNG // VERY slow, but sometimes necessary to debug out-of-sync recording errors
//#define GENERATE_FONT_FILES // Displays font in grid upon startup, which can be screen-captured into font files for PC.
#ifdef BROGUE_ASSERTS
#include <assert.h>
#define brogueAssert(x) assert(x)
#else
#define brogueAssert(x)
#endif
#define boolean char
#define false 0
#define true 1
#define Fl(N) (1 << (N))
#define PI 3.14159265
#define FLOAT_FUDGE 0.00001
// recording and save filenames
#define LAST_GAME_PATH "LastGame.broguesave"
#define LAST_GAME_NAME "LastGame"
#define LAST_RECORDING_NAME "LastRecording"
#define RECORDING_SUFFIX ".broguerec"
#define GAME_SUFFIX ".broguesave"
#define ANNOTATION_SUFFIX ".txt"
#define RNG_LOG "RNGLog.txt"
#define BROGUE_FILENAME_MAX (min(1024*4, FILENAME_MAX))
// Allows unicode characters:
#define uchar unsigned short
#define MESSAGE_LINES 3
#define MESSAGE_ARCHIVE_LINES ROWS
// Size of the entire terminal window. These need to be hard-coded here and in Viewport.h
#define COLS 100
#define ROWS (31 + MESSAGE_LINES)
// Size of the portion of the terminal window devoted to displaying the dungeon:
#define DCOLS (COLS - STAT_BAR_WIDTH - 1) // n columns on the left for the sidebar;
// one column to separate the sidebar from the map.
#define DROWS (ROWS - MESSAGE_LINES - 2) // n lines at the top for messages;
// one line at the bottom for flavor text;
// another line at the bottom for the menu bar.
#define STAT_BAR_WIDTH 20 // number of characters in the stats bar to the left of the map
#define LOS_SLOPE_GRANULARITY 32768 // how finely we divide up the squares when calculating slope;
// higher numbers mean fewer artifacts but more memory and processing
#define INTERFACE_OPACITY 95
#define LIGHT_SMOOTHING_THRESHOLD 150 // light components higher than this magnitude will be toned down a little
#define MAX_BOLT_LENGTH DCOLS*10
#define VISIBILITY_THRESHOLD 50 // how bright cumulative light has to be before the cell is marked visible
#define AMULET_LEVEL 26 // how deep before the amulet appears
#define DEEPEST_LEVEL 40 // how deep the universe goes
#define MACHINES_FACTOR 1.0 // use this to adjust machine frequency
#define MACHINES_BUFFER_LENGTH 200
#define DEFENSE_FACTOR 0.987 // Each point of armor multiplies enemy attackers' accuracy by this value.
// (displayed armor value is 10% of the real value)
#define WEAPON_ENCHANT_DAMAGE_FACTOR 1.065 // Each marginal point of weapon enchantment
// multiplies damage by this factor.
#define WEAPON_ENCHANT_ACCURACY_FACTOR 1.065 // Each marginal point of weapon enchantment
// multiplies accuracy by this factor.
#define WEAPON_KILLS_TO_AUTO_ID 20
#define ARMOR_DELAY_TO_AUTO_ID 1000
#define RING_DELAY_TO_AUTO_ID 1500
#define FALL_DAMAGE_MIN 8
#define FALL_DAMAGE_MAX 10
#define INPUT_RECORD_BUFFER 1000 // how many bytes of input data to keep in memory before saving it to disk
#define DEFAULT_PLAYBACK_DELAY 50
#define HIGH_SCORES_COUNT 30
// color escapes
#define COLOR_ESCAPE 25
#define COLOR_VALUE_INTERCEPT 25
// display characters:
#ifdef USE_UNICODE
#define FLOOR_CHAR 0x00b7
#define LIQUID_CHAR '~'
#define CHASM_CHAR 0x2237
#define TRAP_CHAR 0x25c7
#define FIRE_CHAR 0x22CF
#define GRASS_CHAR '"'
#define BRIDGE_CHAR '='
#define DESCEND_CHAR '>'
#define ASCEND_CHAR '<'
#define WALL_CHAR '#'
#define DOOR_CHAR '+'
#define OPEN_DOOR_CHAR '\''
#define ASH_CHAR '\''
#define BONES_CHAR ','
#define MUD_CHAR ','
#define WEB_CHAR ':'
//#define FOLIAGE_CHAR 0x03A8 // lower-case psi
#define FOLIAGE_CHAR 0x2648 // Aries symbol
#define VINE_CHAR ':'
#define ALTAR_CHAR '|'
#define LEVER_CHAR '/'
#define LEVER_PULLED_CHAR '\\'
#define STATUE_CHAR 0x00df
#define VENT_CHAR '='
#define DEWAR_CHAR '&'
#define TRAMPLED_FOLIAGE_CHAR '"' // 0x2034 // 0x2037
#define PLAYER_CHAR '@'
#define AMULET_CHAR 0x2640
#define FOOD_CHAR ';'
#define SCROLL_CHAR 0x266A//'?' // 0x039E
//#define RING_CHAR 0x26AA //0xffee
#define RING_CHAR 0xffee
#define CHARM_CHAR 0x03DE
#define POTION_CHAR '!'
#define ARMOR_CHAR '['
#define WEAPON_CHAR 0x2191
#define STAFF_CHAR '\\'
#define WAND_CHAR '~'
#define GOLD_CHAR '*'
#define GEM_CHAR 0x25cf
#define TOTEM_CHAR 0x26b2
#define TURRET_CHAR 0x25cf
#define UNICORN_CHAR 0x00da
#define KEY_CHAR '-'
#define ELECTRIC_CRYSTAL_CHAR 164
#define UP_ARROW_CHAR 0x2191
#define DOWN_ARROW_CHAR 0x2193
#define LEFT_ARROW_CHAR 0x2190
#define RIGHT_ARROW_CHAR 0x2192
#define UP_TRIANGLE_CHAR 0x2206
#define DOWN_TRIANGLE_CHAR 0x2207
#define OMEGA_CHAR 0x03A9
#define THETA_CHAR 0x03B8
#define LAMDA_CHAR 0x03BB
#define KOPPA_CHAR 0x03DF//0x03DE
#define LOZENGE_CHAR 0x29EB
#define CROSS_PRODUCT_CHAR 0x2A2F
#define CHAIN_TOP_LEFT '\\'
#define CHAIN_BOTTOM_RIGHT '\\'
#define CHAIN_TOP_RIGHT '/'
#define CHAIN_BOTTOM_LEFT '/'
#define CHAIN_TOP '|'
#define CHAIN_BOTTOM '|'
#define CHAIN_LEFT '-'
#define CHAIN_RIGHT '-'
#define BAD_MAGIC_CHAR 0x29F2
#define GOOD_MAGIC_CHAR 0x29F3
#else
#define FLOOR_CHAR '.'
#define LIQUID_CHAR '~'
#define CHASM_CHAR ':'
#define TRAP_CHAR '%'
#define FIRE_CHAR '^'
#define GRASS_CHAR '"'
#define BRIDGE_CHAR '='
#define DESCEND_CHAR '>'
#define ASCEND_CHAR '<'
#define WALL_CHAR '#'
#define DOOR_CHAR '+'
#define OPEN_DOOR_CHAR '\''
#define ASH_CHAR '\''
#define BONES_CHAR ','
#define MUD_CHAR ','
#define WEB_CHAR ':'
#define FOLIAGE_CHAR '&'
#define VINE_CHAR ':'
#define ALTAR_CHAR '|'
#define LEVER_CHAR '/'
#define LEVER_PULLED_CHAR '\\'
#define STATUE_CHAR '&'
#define VENT_CHAR '='
#define DEWAR_CHAR '&'
#define TRAMPLED_FOLIAGE_CHAR '"'
#define PLAYER_CHAR '@'
#define AMULET_CHAR ','
#define FOOD_CHAR ';'
#define SCROLL_CHAR '?'
#define RING_CHAR '='
#define CHARM_CHAR '+'
#define POTION_CHAR '!'
#define ARMOR_CHAR '['
#define WEAPON_CHAR '('
#define STAFF_CHAR '\\'
#define WAND_CHAR '~'
#define GOLD_CHAR '*'
#define GEM_CHAR '+'
#define TOTEM_CHAR '0'
#define TURRET_CHAR '*'
#define UNICORN_CHAR 'U'
#define KEY_CHAR '-'
#define ELECTRIC_CRYSTAL_CHAR '$'
#define UP_ARROW_CHAR '^'
#define DOWN_ARROW_CHAR 'v'
#define LEFT_ARROW_CHAR '<'
#define RIGHT_ARROW_CHAR '>'
#define UP_TRIANGLE_CHAR '^'
#define DOWN_TRIANGLE_CHAR 'v'
#define OMEGA_CHAR '^'
#define THETA_CHAR '0'
#define LAMDA_CHAR '\\'
#define KOPPA_CHAR 'k'
#define LOZENGE_CHAR '+'
#define CROSS_PRODUCT_CHAR 'x'
#define CHAIN_TOP_LEFT '\\'
#define CHAIN_BOTTOM_RIGHT '\\'
#define CHAIN_TOP_RIGHT '/'
#define CHAIN_BOTTOM_LEFT '/'
#define CHAIN_TOP '|'
#define CHAIN_BOTTOM '|'
#define CHAIN_LEFT '-'
#define CHAIN_RIGHT '-'
#define BAD_MAGIC_CHAR '+'
#define GOOD_MAGIC_CHAR '$'
#endif
enum eventTypes {
KEYSTROKE,
MOUSE_UP,
MOUSE_DOWN,
RIGHT_MOUSE_DOWN,
RIGHT_MOUSE_UP,
MOUSE_ENTERED_CELL,
RNG_CHECK,
SAVED_GAME_LOADED,
END_OF_RECORDING,
EVENT_ERROR,
NUMBER_OF_EVENT_TYPES, // unused
};
typedef struct rogueEvent {
enum eventTypes eventType;
signed long param1;
signed long param2;
boolean controlKey;
boolean shiftKey;
} rogueEvent;
typedef struct rogueHighScoresEntry {
signed long score;
char date[100];
char description[DCOLS];
} rogueHighScoresEntry;
typedef struct fileEntry {
char *path;
char date[100];
} fileEntry;
enum RNGs {
RNG_SUBSTANTIVE,
RNG_COSMETIC,
NUMBER_OF_RNGS,
};
enum displayDetailValues {
DV_UNLIT = 0,
DV_LIT,
DV_DARK,
};
enum directions {
NO_DIRECTION = -1,
// Cardinal directions; must be 0-3:
UP = 0,
DOWN = 1,
LEFT = 2,
RIGHT = 3,
// Secondary directions; must be 4-7:
UPLEFT = 4,
DOWNLEFT = 5,
UPRIGHT = 6,
DOWNRIGHT = 7,
DIRECTION_COUNT = 8,
};
enum textEntryTypes {
TEXT_INPUT_NORMAL = 0,
TEXT_INPUT_FILENAME,
TEXT_INPUT_NUMBERS,
TEXT_INPUT_TYPES,
};
#define NUMBER_DYNAMIC_COLORS 6
enum tileType {
NOTHING = 0,
GRANITE,
FLOOR,
FLOOR_FLOODABLE,
CARPET,
MARBLE_FLOOR,
WALL,
DOOR,
OPEN_DOOR,
SECRET_DOOR,
LOCKED_DOOR,
OPEN_IRON_DOOR_INERT,
DOWN_STAIRS,
UP_STAIRS,
DUNGEON_EXIT,
DUNGEON_PORTAL,
TORCH_WALL, // wall lit with a torch
CRYSTAL_WALL,
PORTCULLIS_CLOSED,
PORTCULLIS_DORMANT,
WOODEN_BARRICADE,
PILOT_LIGHT_DORMANT,
PILOT_LIGHT,
HAUNTED_TORCH_DORMANT,
HAUNTED_TORCH_TRANSITIONING,
HAUNTED_TORCH,
WALL_LEVER_HIDDEN,
WALL_LEVER,
WALL_LEVER_PULLED,
WALL_LEVER_HIDDEN_DORMANT,
STATUE_INERT,
STATUE_DORMANT,
STATUE_CRACKING,
STATUE_INSTACRACK,
PORTAL,
TURRET_DORMANT,
WALL_MONSTER_DORMANT,
DARK_FLOOR_DORMANT,
DARK_FLOOR_DARKENING,
DARK_FLOOR,
MACHINE_TRIGGER_FLOOR,
ALTAR_INERT,
ALTAR_KEYHOLE,
ALTAR_CAGE_OPEN,
ALTAR_CAGE_CLOSED,
ALTAR_SWITCH,
ALTAR_SWITCH_RETRACTING,
ALTAR_CAGE_RETRACTABLE,
PEDESTAL,
MONSTER_CAGE_OPEN,
MONSTER_CAGE_CLOSED,
COFFIN_CLOSED,
COFFIN_OPEN,
GAS_TRAP_POISON_HIDDEN,
GAS_TRAP_POISON,
TRAP_DOOR_HIDDEN,
TRAP_DOOR,
GAS_TRAP_PARALYSIS_HIDDEN,
GAS_TRAP_PARALYSIS,
MACHINE_PARALYSIS_VENT_HIDDEN,
MACHINE_PARALYSIS_VENT,
GAS_TRAP_CONFUSION_HIDDEN,
GAS_TRAP_CONFUSION,
FLAMETHROWER_HIDDEN,
FLAMETHROWER,
FLOOD_TRAP_HIDDEN,
FLOOD_TRAP,
NET_TRAP_HIDDEN,
NET_TRAP,
ALARM_TRAP_HIDDEN,
ALARM_TRAP,
MACHINE_POISON_GAS_VENT_HIDDEN,
MACHINE_POISON_GAS_VENT_DORMANT,
MACHINE_POISON_GAS_VENT,
MACHINE_METHANE_VENT_HIDDEN,
MACHINE_METHANE_VENT_DORMANT,
MACHINE_METHANE_VENT,
STEAM_VENT,
MACHINE_PRESSURE_PLATE,
MACHINE_PRESSURE_PLATE_USED,
MACHINE_GLYPH,
MACHINE_GLYPH_INACTIVE,
DEWAR_CAUSTIC_GAS,
DEWAR_CONFUSION_GAS,
DEWAR_PARALYSIS_GAS,
DEWAR_METHANE_GAS,
DEEP_WATER,
SHALLOW_WATER,
MUD,
CHASM,
CHASM_EDGE,
MACHINE_COLLAPSE_EDGE_DORMANT,
MACHINE_COLLAPSE_EDGE_SPREADING,
LAVA,
LAVA_RETRACTABLE,
LAVA_RETRACTING,
SUNLIGHT_POOL,
DARKNESS_PATCH,
ACTIVE_BRIMSTONE,
INERT_BRIMSTONE,
OBSIDIAN,
BRIDGE,
BRIDGE_FALLING,
BRIDGE_EDGE,
STONE_BRIDGE,
MACHINE_FLOOD_WATER_DORMANT,
MACHINE_FLOOD_WATER_SPREADING,
MACHINE_MUD_DORMANT,
HOLE,
HOLE_GLOW,
HOLE_EDGE,
FLOOD_WATER_DEEP,
FLOOD_WATER_SHALLOW,
GRASS,
DEAD_GRASS,
GRAY_FUNGUS,
LUMINESCENT_FUNGUS,
LICHEN,
HAY,
RED_BLOOD,
GREEN_BLOOD,
PURPLE_BLOOD,
ACID_SPLATTER,
VOMIT,
URINE,
UNICORN_POOP,
WORM_BLOOD,
ASH,
BURNED_CARPET,
PUDDLE,
BONES,
RUBBLE,
JUNK,
BROKEN_GLASS,
ECTOPLASM,
EMBERS,
SPIDERWEB,
NETTING,
FOLIAGE,
DEAD_FOLIAGE,
TRAMPLED_FOLIAGE,
FUNGUS_FOREST,
TRAMPLED_FUNGUS_FOREST,
FORCEFIELD,
FORCEFIELD_MELT,
SACRED_GLYPH,
MANACLE_TL,
MANACLE_BR,
MANACLE_TR,
MANACLE_BL,
MANACLE_T,
MANACLE_B,
MANACLE_L,
MANACLE_R,
PORTAL_LIGHT,
GUARDIAN_GLOW,
PLAIN_FIRE,
BRIMSTONE_FIRE,
FLAMEDANCER_FIRE,
GAS_FIRE,
GAS_EXPLOSION,
DART_EXPLOSION,
ITEM_FIRE,
CREATURE_FIRE,
POISON_GAS,
CONFUSION_GAS,
ROT_GAS,
STENCH_SMOKE_GAS,
PARALYSIS_GAS,
METHANE_GAS,
STEAM,
DARKNESS_CLOUD,
HEALING_CLOUD,
BLOODFLOWER_STALK,
BLOODFLOWER_POD,
HAVEN_BEDROLL,
DEEP_WATER_ALGAE_WELL,
DEEP_WATER_ALGAE_1,
DEEP_WATER_ALGAE_2,
ANCIENT_SPIRIT_VINES,
ANCIENT_SPIRIT_GRASS,
AMULET_SWITCH,
COMMUTATION_ALTAR,
COMMUTATION_ALTAR_INERT,
PIPE_GLOWING,
PIPE_INERT,
RESURRECTION_ALTAR,
RESURRECTION_ALTAR_INERT,
MACHINE_TRIGGER_FLOOR_REPEATING,
STATUE_INERT_DOORWAY,
STATUE_DORMANT_DOORWAY,
CHASM_WITH_HIDDEN_BRIDGE,
CHASM_WITH_HIDDEN_BRIDGE_ACTIVE,
MACHINE_CHASM_EDGE,
RAT_TRAP_WALL_DORMANT,
RAT_TRAP_WALL_CRACKING,
ELECTRIC_CRYSTAL_OFF,
ELECTRIC_CRYSTAL_ON,
TURRET_LEVER,
WORM_TUNNEL_MARKER_DORMANT,
WORM_TUNNEL_MARKER_ACTIVE,
WORM_TUNNEL_OUTER_WALL,
BRAZIER,
MUD_FLOOR,
MUD_WALL,
MUD_DOORWAY,
//unfortunate creatures turned to stone
MEDUSA_STATUE,
MEDUSA_STATUE_CRACKING,
NUMBER_TILETYPES,
};
enum lightType {
NO_LIGHT,
MINERS_LIGHT,
BURNING_CREATURE_LIGHT,
WISP_LIGHT,
SALAMANDER_LIGHT,
IMP_LIGHT,
PIXIE_LIGHT,
LICH_LIGHT,
FLAMEDANCER_LIGHT,
SENTINEL_LIGHT,
UNICORN_LIGHT,
IFRIT_LIGHT,
PHOENIX_LIGHT,
PHOENIX_EGG_LIGHT,
YENDOR_LIGHT,
SPECTRAL_BLADE_LIGHT,
SPECTRAL_IMAGE_LIGHT,
SPARK_TURRET_LIGHT,
EXPLOSIVE_BLOAT_LIGHT,
BOLT_LIGHT_SOURCE,
TELEPATHY_LIGHT,
SCROLL_PROTECTION_LIGHT,
SCROLL_ENCHANTMENT_LIGHT,
POTION_STRENGTH_LIGHT,
EMPOWERMENT_LIGHT,
GENERIC_FLASH_LIGHT,
FALLEN_TORCH_FLASH_LIGHT,
SUMMONING_FLASH_LIGHT,
EXPLOSION_FLARE_LIGHT,
QUIETUS_FLARE_LIGHT,
SLAYING_FLARE_LIGHT,
CHARGE_FLASH_LIGHT,
TORCH_LIGHT,
LAVA_LIGHT,
SUN_LIGHT,
DARKNESS_PATCH_LIGHT,
FUNGUS_LIGHT,
FUNGUS_FOREST_LIGHT,
LUMINESCENT_ALGAE_BLUE_LIGHT,
LUMINESCENT_ALGAE_GREEN_LIGHT,
ECTOPLASM_LIGHT,
UNICORN_POOP_LIGHT,
EMBER_LIGHT,
FIRE_LIGHT,
BRIMSTONE_FIRE_LIGHT,
EXPLOSION_LIGHT,
INCENDIARY_DART_LIGHT,
PORTAL_ACTIVATE_LIGHT,
CONFUSION_GAS_LIGHT,
DARKNESS_CLOUD_LIGHT,
FORCEFIELD_LIGHT,
CRYSTAL_WALL_LIGHT,
CANDLE_LIGHT,
HAUNTED_TORCH_LIGHT,
GLYPH_LIGHT_DIM,
GLYPH_LIGHT_BRIGHT,
SACRED_GLYPH_LIGHT,
DESCENT_LIGHT,
NUMBER_LIGHT_KINDS
};
// Item categories
enum itemCategory {
FOOD = Fl(0),
WEAPON = Fl(1),
ARMOR = Fl(2),
POTION = Fl(3),
SCROLL = Fl(4),
STAFF = Fl(5),
WAND = Fl(6),
RING = Fl(7),
CHARM = Fl(8),
GOLD = Fl(9),
AMULET = Fl(10),
GEM = Fl(11),
KEY = Fl(12),
CAN_BE_DETECTED = (WEAPON | ARMOR | POTION | SCROLL | RING | CHARM | WAND | STAFF | AMULET),
PRENAMED_CATEGORY = (FOOD | GOLD | AMULET | GEM | KEY),
NEVER_IDENTIFIABLE = (FOOD | CHARM | GOLD | AMULET | GEM | KEY),
COUNTS_TOWARD_SCORE = (GOLD | AMULET | GEM),
CAN_BE_SWAPPED = (WEAPON | ARMOR | STAFF | CHARM | RING),
ALL_ITEMS = (FOOD|POTION|WEAPON|ARMOR|STAFF|WAND|SCROLL|RING|CHARM|GOLD|AMULET|GEM|KEY),
};
enum keyKind {
KEY_DOOR,
KEY_CAGE,
KEY_PORTAL,
NUMBER_KEY_TYPES
};
enum foodKind {
RATION,
FRUIT,
NUMBER_FOOD_KINDS
};
enum potionKind {
POTION_LIFE,
POTION_STRENGTH,
POTION_TELEPATHY,
POTION_LEVITATION,
POTION_DETECT_MAGIC,
POTION_HASTE_SELF,
POTION_FIRE_IMMUNITY,
POTION_INVISIBILITY,
POTION_POISON,
POTION_PARALYSIS,
POTION_HALLUCINATION,
POTION_CONFUSION,
POTION_INCINERATION,
POTION_DARKNESS,
POTION_DESCENT,
POTION_LICHEN,
NUMBER_POTION_KINDS
};
enum weaponKind {
DAGGER,
SWORD,
BROADSWORD,
WHIP,
RAPIER,
FLAIL,
MACE,
HAMMER,
SPEAR,
PIKE,
AXE,
WAR_AXE,
DART,
INCENDIARY_DART,
JAVELIN,
NUMBER_WEAPON_KINDS
};
enum weaponEnchants {
W_SPEED,
W_QUIETUS,
W_PARALYSIS,
W_MULTIPLICITY,
W_SLOWING,
W_CONFUSION,
W_FORCE,
W_SLAYING,
W_ENERVATION,
W_MERCY,
NUMBER_GOOD_WEAPON_ENCHANT_KINDS = W_MERCY,
W_PLENTY,
NUMBER_WEAPON_RUNIC_KINDS
};
enum armorKind {
LEATHER_ARMOR,
SCALE_MAIL,
CHAIN_MAIL,
BANDED_MAIL,
SPLINT_MAIL,
PLATE_MAIL,
NUMBER_ARMOR_KINDS
};
enum armorEnchants {
A_MULTIPLICITY,
A_MUTUALITY,
A_ABSORPTION,
A_REPRISAL,
A_IMMUNITY,
A_REFLECTION,
A_RESPIRATION,
A_DAMPENING,
A_VANISHING,
A_BURDEN,
NUMBER_GOOD_ARMOR_ENCHANT_KINDS = A_BURDEN,
A_VULNERABILITY,
A_IMMOLATION,
NUMBER_ARMOR_ENCHANT_KINDS,
};
enum wandKind {
WAND_TELEPORT,
WAND_SLOW,
WAND_POLYMORPH,
WAND_NEGATION,
WAND_DOMINATION,
WAND_TURRET,
WAND_BECKONING,
WAND_PLENTY,
WAND_INVISIBILITY,
WAND_EMPOWERMENT,
NUMBER_WAND_KINDS
};
enum staffKind {
STAFF_LIGHTNING,
STAFF_FIRE,
STAFF_POISON,
STAFF_TUNNELING,
STAFF_BLINKING,
STAFF_ENTRANCEMENT,
STAFF_OBSTRUCTION,
STAFF_DISCORD,
STAFF_CONJURATION,
STAFF_HEALING,
STAFF_HASTE,
STAFF_PROTECTION,
NUMBER_STAFF_KINDS
};
// these must be wand bolts, in order, and then staff bolts, in order:
enum boltType {
BOLT_NONE = 0,
BOLT_TELEPORT,
BOLT_SLOW,
BOLT_POLYMORPH,
BOLT_NEGATION,
BOLT_DOMINATION,
BOLT_BECKONING,
BOLT_PLENTY,
BOLT_INVISIBILITY,
BOLT_EMPOWERMENT,
BOLT_BUILD_TURRET,
BOLT_LIGHTNING,
BOLT_FIRE,
BOLT_POISON,
BOLT_TUNNELING,
BOLT_BLINKING,
BOLT_ENTRANCEMENT,
BOLT_OBSTRUCTION,
BOLT_DISCORD,
BOLT_CONJURATION,
BOLT_HEALING,
BOLT_HASTE,
BOLT_SLOW_2,
BOLT_SHIELDING,
BOLT_SPIDERWEB,
BOLT_SPARK,
BOLT_DRAGONFIRE,
BOLT_DISTANCE_ATTACK,
BOLT_POISON_DART,
BOLT_ACID_TURRET_ATTACK,
BOLT_ANCIENT_SPIRIT_VINES,
BOLT_WHIP,
BOLT_THROWN_SPEAR,
NUMBER_BOLT_KINDS
};
enum ringKind {
RING_CLAIRVOYANCE,
RING_STEALTH,
RING_REGENERATION,
RING_TRANSFERENCE,
RING_LIGHT,
RING_AWARENESS,
RING_WISDOM,
RING_REAPING,
RING_SPELL_CHAINING,
NUMBER_RING_KINDS
};
enum charmKind {
CHARM_HEALTH,
CHARM_PROTECTION,
CHARM_HASTE,
CHARM_FIRE_IMMUNITY,
CHARM_INVISIBILITY,
CHARM_TELEPATHY,
CHARM_LEVITATION,
CHARM_SHATTERING,
CHARM_GUARDIAN,
CHARM_TELEPORTATION,
CHARM_RECHARGING,
CHARM_NEGATION,
NUMBER_CHARM_KINDS
};
enum scrollKind {
SCROLL_ENCHANTING,
SCROLL_IDENTIFY,
SCROLL_TELEPORT,
SCROLL_REMOVE_CURSE,
SCROLL_RECHARGING,
SCROLL_PROTECT_ARMOR,
SCROLL_PROTECT_WEAPON,
SCROLL_SANCTUARY,
SCROLL_MAGIC_MAPPING,
SCROLL_NEGATION,
SCROLL_SHATTERING,
SCROLL_DISCORD,
SCROLL_AGGRAVATE_MONSTER,
SCROLL_SUMMON_MONSTER,
NUMBER_SCROLL_KINDS
};
#define MAX_PACK_ITEMS 26
enum monsterTypes {
MK_YOU,
MK_RAT,
MK_KOBOLD,
MK_JACKAL,
MK_EEL,
MK_MONKEY,
MK_BLOAT,
MK_PIT_BLOAT,
MK_GOBLIN,
MK_GOBLIN_CONJURER,
MK_GOBLIN_MYSTIC,
MK_GOBLIN_TOTEM,
MK_PINK_JELLY,
MK_TOAD,
MK_VAMPIRE_BAT,
MK_ARROW_TURRET,
MK_ACID_MOUND,
MK_CENTIPEDE,
MK_OGRE,
MK_BOG_MONSTER,
MK_OGRE_TOTEM,
MK_SPIDER,
MK_SPARK_TURRET,
MK_WILL_O_THE_WISP,
MK_WRAITH,
MK_ZOMBIE,
MK_TROLL,
MK_OGRE_SHAMAN,
MK_NAGA,
MK_SALAMANDER,
MK_EXPLOSIVE_BLOAT,
MK_DAR_BLADEMASTER,
MK_DAR_PRIESTESS,
MK_DAR_BATTLEMAGE,
MK_ACID_JELLY,
MK_CENTAUR,
MK_UNDERWORM,
MK_SENTINEL,
MK_ACID_TURRET,
MK_DART_TURRET,
MK_KRAKEN,
MK_LICH,
MK_PHYLACTERY,
MK_PIXIE,
MK_PHANTOM,
MK_FLAME_TURRET,
MK_IMP,
MK_FURY,
MK_REVENANT,
MK_TENTACLE_HORROR,
MK_GOLEM,
MK_DRAGON,
MK_GOBLIN_CHIEFTAN,
MK_BLACK_JELLY,
MK_VAMPIRE,
MK_FLAMEDANCER,
MK_SPECTRAL_BLADE,
MK_SPECTRAL_IMAGE,
MK_GUARDIAN,
MK_WINGED_GUARDIAN,
MK_CHARM_GUARDIAN,
MK_WARDEN_OF_YENDOR,
MK_ELDRITCH_TOTEM,
MK_MIRRORED_TOTEM,
MK_UNICORN,
MK_IFRIT,
MK_PHOENIX,
MK_PHOENIX_EGG,
MK_ANCIENT_SPIRIT,
MK_VALKYRIE,
MK_DAR_ASSASSIN,
MK_MEDUSA,
MK_GOBLIN_SKIRMISHER,
NUMBER_MONSTER_KINDS
};