This repository has been archived by the owner on Nov 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
diggers.cpp
11063 lines (10620 loc) · 526 KB
/
diggers.cpp
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
/* ================================================================================= */
/* ooooooooo.--ooooooo--.oooooo.-----.oooooo.--oooooooooooo-ooooooooo.----.oooooo..o */
/* 888'---`Y8b--`888'--d8P'--`Y8b---d8P' `Y8b-`888'-----`8-`888---`Y88.-d8P'----`Y8 */
/* 888------888--888--888----------888----------888----------888---.d88'-Y88bo.----- */
/* 888------888--888--888----------888----------888oooo8-----888ooo88P'---`"Y8888o.- */
/* 888------888--888--888-----oOOo-888-----oOOo-888----"-----888`88b.---------`"Y88b */
/* 888-----d88'--888--`88.----.88'-`88.----.88'-888-------o--888--`88b.--oo-----.d8P */
/* 888bood8P'--oo888oo-`Y8bood8P'---`Y8bood8P'-o888ooooood8-o888o--o888o-8""88888P'- */
/* ================================================================================= */
/* Copyr. (c) Mhatxotic Design, 2011 Copyr. (c) Millenium Interactive Ltd., 1994 */
/* ================================================================================= */
/* COMPILER DIRECTIVES */
/* --------------------------------------------------------------------------------- */
#if _MSC_VER < 1500 // Make sure we are using correct compiler
# error Please use Microsoft compiler 15.00.30729.01 for 80x86
#elif _WIN64 // Make sure we are not using 64-bit compiler
# error X86-64 build not supported yet as there is no 64-bit uFMOD library
#elif !__cplusplus // Make sure we are compiling in c++ mode and not c
# error Must use C++ mode to compile this application
#elif UNICODE // Make sure we are not using UNICODE mode
# error Must use ANSI mode to compile this application
#endif // Checks completed
/* --------------------------------------------------------------------------------- */
/* COMPILER WARNINGS */
/* --------------------------------------------------------------------------------- */
#pragma warning(disable:4201) // Nonstandard extension used (from mmsystem.h)
#pragma warning(disable:4995) // Deprecated functions (from dshow.h)
/* --------------------------------------------------------------------------------- */
/* SYSTEM DEFINES */
/* --------------------------------------------------------------------------------- */
#define WIN32_LEAN_AND_MEAN // Compile speed optimisation
#define WINVER 0x0400 // I want this program to work on Windows 95
/* --------------------------------------------------------------------------------- */
#define DIRECTINPUT_VERSION 0x0300 // Required direct input version (rec:0x300)
#define DIRECTDRAW_VERSION 0x0300 // Required direct draw version (rec:0x300)
#define DIRECTSOUND_VERSION 0x0300 // Required direct sound version (rec:0x300)
/* --------------------------------------------------------------------------------- */
/* SYSTEM INCLUDES */
/* --------------------------------------------------------------------------------- */
#include <windows.h> // Windows SDK for system
#include <mmsystem.h> // Windows Multimedia for timings
#include <ddraw.h> // Direct Draw for graphics
#include <dinput.h> // Direct Input for control
#include <dsound.h> // Direct Sound for sound effects
#include <dshow.h> // Direct Show for streaming audio
#include <winsock.h> // Windows networking SDK
#include <dbghelp.h> // Debugging SDK
#include <commctrl.H> // Windows common control headers
/* --------------------------------------------------------------------------------- */
/* GAME INCLUDES */
/* --------------------------------------------------------------------------------- */
#include "lib/ufmod.h" // uFMOD library
#include "lib/scalex.h" // ScaleX library
/* --------------------------------------------------------------------------------- */
/* SYSTEM LIBRARIES */
/* --------------------------------------------------------------------------------- */
#pragma comment(lib, "DIGGERS") // Want my own libs (CRC32, MiniLzo, UFMod)
#pragma comment(lib, "KERNEL32") // Want kernel32.dll exports (Windows System)
#pragma comment(lib, "GDI32") // Want gdi32.dll exports (Windows Graphics)
#pragma comment(lib, "USER32") // Want user32.dll exports (Windows User Interface)
#pragma comment(lib, "OLE32") // Want ole32.dll exports (Windows Ole)
#pragma comment(lib, "WSOCK32") // Want wsock32.dll exports (Windows Networking)
#pragma comment(lib, "COMCTL32") // Want comctl32.dll exports (Common controls)
#pragma comment(lib, "WINMM") // Want winmm.dll exports (Windows Multi-media)
#pragma comment(lib, "DDRAW") // Want ddraw.dll exports (Direct Draw)
#pragma comment(lib, "DSOUND") // Want dsound.dll exports (Direct Sound)
#pragma comment(lib, "DINPUT8") // Want dinput.dll exports (Direct Input)
#pragma comment(lib, "DXGUID") // Want input device guid's (Direct Input)
#pragma comment(lib, "STRMIIDS") // Want streaming exports (Direct Show)
#pragma comment(lib, "VERSION") // Want version exports (Windows System)
#pragma comment(lib, "DBGHELP") // Want debugging exports (Windows System)
/* --------------------------------------------------------------------------------- */
/* LINKER OPTIONS */
/* --------------------------------------------------------------------------------- */
#pragma comment(linker, "/SUBSYSTEM:WINDOWS") // Microsoft Windows application
/* --------------------------------------------------------------------------------- */
/* APP DEFINES */
/* --------------------------------------------------------------------------------- */
#define WSOCK_REQ_MAJOR 1 // Major version of winsock required
#define WSOCK_REQ_MINOR 1 // Minor version of winsock required
/* --------------------------------------------------------------------------------- */
#define ASPECT_WIDTH 320 // Aspect screen resolution width (DO NOT CHANGE!)
#define ASPECT_HEIGHT 240 // Aspect screen resolution height (DO NOT CHANGE!)
#define ASPECT_DEPTH 8 // Default screen resolution depth
/* --------------------------------------------------------------------------------- */
#define NUM_DIGGERS 5 // Maximum number of diggers per player
#define NUM_PLAYERS 2 // Maximum number of players in game
#define NUM_RACES 4 // Number of official digger races
/* --------------------------------------------------------------------------------- */
#define TIMER_FRAMELIMIT_FAST 8 // Hundreths of a ms to wait before next game tick
#define TIMER_FRAMELIMIT_SLOW 16 // Slow frame limiter
#define TIMER_ANIMTERRAIN 10 // Game ticks to wait before animating next terrain
#define TIMER_ANIMNORMAL 10 // Delay before anim next sprite for normal objects
#define TIMER_ANIMFAST 5 // Delay before anim next sprite for fast objects
#define TIMER_PICKUPDELAY 10 // Game ticks to wait before checking for pickups
#define TIMER_DEADWAIT 600 // Wait time before removing ACT_DEATH objects
#define TIMER_MUTATEWAIT 3600 // Wait time before full digger mutation occurs
#define TIMER_DANGERTIMEOUT 600 // Timeout before removing the danger flag
#define TIMER_TARGETTIME 1800 // Timeout before selecting another target (AI)
/* --------------------------------------------------------------------------------- */
#define AFL_WINDOW 0x01 // Window mode
#define AFL_NOSOUNDS 0x02 // Sound effects disabled
#define AFL_NOMUSIC 0x04 // Music track disabled
#define AFL_NOTIPS 0x08 // Tips disabled
#define AFL_EDITOR 0x10 // Level editor enabled
#define AFL_NOENMIXSND 0x20 // No enhanced sound mixing
#define AFL_NOSTREAMING 0x40 // No streaming even when MP3 exists
/* --------------------------------------------------------------------------------- */
#define EFL_BROWSER 0x01 // Sprite/Tile browser activated
/* --------------------------------------------------------------------------------- */
#define INITTYP_FONTS 0x01 // Initialise textures needed to print text
#define INITTYP_BASE 0x02 // Initialise textures required to display a level
#define INITTYP_INGAME 0x04 // Initialise textures related to in-game
#define INITTYP_LOADING 0x08 // Initialise loading screen bitmap
/* --------------------------------------------------------------------------------- */
#define LFL_UNPLAYED 0x1 // Level not attempted
#define LFL_UNFINISHED 0x2 // Level not completed
#define LFL_LOCKED 0x4 // Level not selectable
/* --------------------------------------------------------------------------------- */
#define LEVEL_NUM 34 // Number of levels in game
#define LEVEL_WIDTH 128 // Horizontal number of tiles in level
#define LEVEL_HEIGHT 128 // Vertical number of tiles in level
#define LEVEL_PWIDTH (LEVEL_WIDTH*TILE_SIZE) // Level width in pixels
#define LEVEL_PHEIGHT (LEVEL_HEIGHT*TILE_SIZE) // Level height in pixels
#define LEVEL_SIZE_WORD (LEVEL_WIDTH*LEVEL_HEIGHT) // Size of a level in words
#define LEVEL_SIZE (LEVEL_SIZE_WORD<<1) // Size of a level in bytes
/* --------------------------------------------------------------------------------- */
#define TILE_SIZE 16 // Width and height of a single tile
#define SCR_TILES_WIDTH (ASPECT_WIDTH/TILE_SIZE) // Total X onscreen tiles
#define SCR_TILES_HEIGHT (ASPECT_HEIGHT/TILE_SIZE) // Total Y onscreen tiles
#define SCR_TILES (SCR_TILES_WIDTH*SCR_TILES_HEIGHT) // Total tiles onscreen
/* --------------------------------------------------------------------------------- */
#define TILES_NUM 480 // Number of tiles in a single tileset bitmap
/* --------------------------------------------------------------------------------- */
#define GS_INVENTORY 0x1 // (InGameDisplay flags) Show digger inventory
#define GS_LOCATIONS 0x2 // Locations of all diggers
#define GS_GAMESTATUS 0x4 // Game status
#define GS_HELPANDINFO 0x8 // Help and information
/* --------------------------------------------------------------------------------- */
#define JD_WAIT 0 // Object will not move while jumping
#define JD_MOVE 1 // Object should move while jumping
#define JD_SIZE 24 // Size of the jump
/* --------------------------------------------------------------------------------- */
#define DFM_O 0x0001 // Match over tile or dig failed (DigData)
#define DFM_A 0x0002 // Match above tile or dig failed
#define DFM_B 0x0004 // Match below tile or dig failed
#define DFM_C 0x0008 // Match centre of over tile or dig failed
#define DFS_O 0x0010 // Set over tile if successful match
#define DFS_A 0x0020 // Set above tile if successful match
#define DFS_B 0x0040 // Set below tile if successful match
#define DFO_BUSY 0x0080 // Set object to busy if successful dig
#define DFO_NOTBUSY 0x0100 // Remove busy flag if dig successful
#define DFO_TREASURE 0x0200 // Spin the wheel of fortune if dig successful
/* --------------------------------------------------------------------------------- */
#define PFL_AI 0x1 // Computer controls this player
/* --------------------------------------------------------------------------------- */
#define OFL_REGISTERED 0x0000000000000001 // Object is registered in the global object list
#define OFL_BUSY 0x0000000000000002 // Object is busy and user cannot enter another command
#define OFL_FALL 0x0000000000000004 // Object should fall
#define OFL_JUMPRISE 0x0000000000000008 // Object is rising while jumping
#define OFL_JUMPFALL 0x0000000000000010 // Object is falling while jumping
#define OFL_PICKUP 0x0000000000000020 // Object can be picked up
#define OFL_TREASURE 0x0000000000000040 // Object is treasure
#define OFL_PURCHASABLE 0x0000000000000080 // Object is purchasable from shop
#define OFL_SELLABLE 0x0000000000000100 // Object is sellable to shop
#define OFL_DIGGER 0x0000000000000200 // Object is a digger
#define OFL_HURTDIGGER 0x0000000000000400 // Object hurts diggers
#define OFL_PHASEDIGGER 0x0000000000000800 // Object teleports diggers anywhere
#define OFL_IGNOREFIGHT 0x0000000000001000 // Object should ignore fighting until next action
#define OFL_DONTFLEE 0x0000000000002000 // Object should not run away when fighting
#define OFL_COMPUTER 0x0000000000004000 // Object is computer controlled
#define OFL_NOANIMLOOP 0x0000000000008000 // Object is not allowed to loop its animation
#define OFL_CONSUME 0x0000000000010000 // Object consumes another object
#define OFL_AQUALUNG 0x0000000000200000 // Object can breathe in water
#define OFL_STATIONARY 0x0000000000400000 // Object does not move and is stationary
#define OFL_DANGEROUS 0x0000000000800000 // Object is dangerous and diggers run away
#define OFL_SOUNDLOOP 0x0000000001000000 // Object sound is looped when sprite anim is reset
#define OFL_TRACK 0x0000000002000000 // Object can only move on tracks
#define OFL_FLOAT 0x0000000004000000 // Object floats in water
#define OFL_BLOCK 0x0000000008000000 // Object is a platform for diggers
#define OFL_DEVICE 0x0000000010000000 // Object is a device
#define OFL_PHASETARGET 0x0000000020000000 // Object is a valid random phase target
#define OFL_EXPLODE 0x0000000040000000 // Object explodes on death
#define OFL_CPUSELL 0x0000000080000000 // Object has items to sell (OFL_COMPUTER)
#define OFL_NOEDITVALID 0x0000000100000000 // Object cant be used in the edtior
#define OFL_FLOATING 0x0000000200000000 // Object is floating right now
#define OFL_DELICATE 0x0000000400000000 // Object is delicate (takes more damage)
#define OFL_VOLATILE 0x0000000800000000 // Object is volatile
/* --------------------------------------------------------------------------------- */
enum CFGCMD // Config function commands
{
CFG_SAVE, // Save settings
CFG_LOAD, // Load settings
CFG_DEFAULT // Set default settings
};
/* --------------------------------------------------------------------------------- */
enum BMPID // All the bitmaps used in the game
{
BMP_FONTLARGE, // Large font
BMP_FONTSMALL, // Small font
BMP_FONTTINY, // Tiny font
BMP_HPBAR, // Health bar bitmap
BMP_LOADING, // Loading screen
BMP_LOGO, // Diggers logo
BMP_PLXDESERT, // Desert parallax background
BMP_PLXGRASS, // Grass parallax background
BMP_PLXISLANDS, // Islands parallax background
BMP_PLXJUNGLE, // Jungle parallax background
BMP_PLXMOUNTAIN, // Mountain parallax background
BMP_PLXROCK, // Rock parallax background
BMP_PLXSNOW, // Snow parallax background
BMP_PTRANS, // Transparency bitmap
BMP_RACES, // Race images
BMP_TSDESERT, // Desert tile set
BMP_TSGRASS, // Grass tile set
BMP_TSISLANDS, // Islands tile set
BMP_TSJUNGLE, // Jungle tile set
BMP_TSMOUNTAIN, // Mountain tile set
BMP_TSROCK, // Rock tile set
BMP_TSSNOW, // Snow tile set
BMP_TSSPRITES, // Sprites tile set
BMP_TSINTERFACE, // Interface tile set
BMP_MAX // Maximum number if bitmaps to load
};
/* --------------------------------------------------------------------------------- */
enum SFXID // All the sound effects available to the game
{
SFX_NONE = -1, // No sound effect
SFX_CLICK, // Mouse click command successful
SFX_DIEFTAR, // F'Targ death sound
SFX_DIEGRAB, // Grablin death sound
SFX_DIEHABB, // Habbish death sound
SFX_DIEQUAR, // Quarrior death sound
SFX_DIG, // Digging sound
SFX_ERROR, // Mouse click command failed
SFX_EXPLODE, // TNT explosion sound
SFX_FIND, // Treasure found
SFX_GCLOSE, // Gate close
SFX_GOPEN, // Gate open
SFX_JUMP, // Jump sound
SFX_KICK, // Kick sound
SFX_PHASE, // Phase teleport sound
SFX_PUNCH, // Punch sound
SFX_SELECT, // Select digger sound
SFX_TRADE, // Trade complete sound
SFX_MAX // Maximum number of sound effects
};
/* --------------------------------------------------------------------------------- */
enum MUSICCMD // Music commands for function
{
MUSICCMD_PLAY, // Play specified music
MUSICCMD_STOP, // Stop playing music
MUSICCMD_PAUSE, // Pause playing music
MUSICCMD_RESUME, // Resume playing music
MUSICCMD_VOLUME, // Set music volume
MUSICCMD_MUTE // Toggle mute music
};
/* --------------------------------------------------------------------------------- */
enum MUSICID // All the music modules available to the game
{
MUSIC_NULL = -1, // No music
MUSIC_BANK, // Bank music
MUSIC_INGAME, // In-game music
MUSIC_LOSE, // Game over music
MUSIC_MENU, // In-menu music
MUSIC_SELECT, // App.Game.Level loading music
MUSIC_SHOP, // Shop music
MUSIC_TITLE, // Title music
MUSIC_WIN, // Map most mortem music
MUSIC_MAX // Maximum number of modules to load
};
/* --------------------------------------------------------------------------------- */
enum MUSICTYPEID // Music type ID
{
MUSICTYPE_NULL, // No music playing
MUSICTYPE_MP3, // Streaming MP3
MUSICTYPE_XM, // Extended module
MUSICTYPE_MAX // Maximum number of supported music types
};
/* --------------------------------------------------------------------------------- */
enum MENUID // Object popup menu identifiers
{
MNU_NONE = -1, // No menu selected
MNU_MAIN, // Main digger menu
MNU_MOVE, // Digger movement menu
MNU_DIG, // Digger digging menu
MNU_DROP, // Digger drop item menu
MNU_TRADE, // Digger trade menu
MNU_BUY, // Digger purchase menu
MNU_SELL, // Digger sell menu
MNU_TUNNEL, // Small and large tunneller menu
MNU_CORK, // Corkscrew menu
MNU_TNT, // Explosives menu
MNU_MAP, // Map menu
MNU_TRAIN, // Train for rails menu
MNU_TRDROP, // Train drop menu
MNU_FLOAT, // Floating device movement menu
MNU_GATE, // Flood gate menu
MNU_DEPLOY, // Object deployment menu
MNU_LIFT, // Lift control menu
MNU_MAX // Maximum number of menus
};
/* --------------------------------------------------------------------------------- */
enum MOUSEID // Mouse button id's
{
MID_LMB, // Left mouse button
MID_RMB, // Right mouse button
MID_MMB, // Middle mouse button
MID_BT4, // Thumb button one pressed
MID_BT5, // Thumb button two pressed
MID_MAX // Max number of buttons supported
};
/* --------------------------------------------------------------------------------- */
enum CURSORID // Cursor types
{
CID_NONE = -1, // No cursor
CID_ARROW, // Arrow cursor
CID_OK, // Cursor with OK text
CID_EXIT, // Cursor with EXIT text
CID_LEFT, // Cursor with LEFT scroll arrow
CID_TOP, // Cursor with TOP scroll arrow
CID_RIGHT, // Cursor with RIGHT scroll arrow
CID_BOTTOM, // Cursor with BOTTOM scroll arrow
CID_MAX // Max number of supported cursors
};
/* --------------------------------------------------------------------------------- */
enum SCENES // Types of scenery
{
SCENE_DESERT, // Desert scenery
SCENE_GRASS, // Grass scenery
SCENE_ISLANDS, // Islands scenery
SCENE_JUNGLE, // Jungle scenery
SCENE_MOUNTAIN, // Mountain scenery
SCENE_ROCK, // Rocky scenery
SCENE_SNOW, // Snow scenery
SCENE_MAX // Total number of sceneries
};
/* --------------------------------------------------------------------------------- */
enum OBJTYP // All the types of objects
{
TYP_NULL = -1, // Invalid object
TYP_FTARG, // [00] F'Targ race digger
TYP_HABBISH, // [01] Habbish race digger
TYP_GRABLIN, // [02] Grablin race digger
TYP_QUARRIOR, // [03] Quarrior race digger
TYP_JENNITE, // [04] The most valuable treasure
TYP_DIAMOND, // [05] The near-most valuable treasure
TYP_GOLD, // [06] The un-common treasure
TYP_EMERALD, // [07] The not so un-common treasure
TYP_RUBY, // [08] The most common treasure
TYP_RZRGHOST, // [09] A fast moving, random directional, spinning monster
TYP_SLOWSKEL, // [0A] A slow moving skeleton that homes in on any digger
TYP_FASTSKEL, // [0B] A fast moving skeleton that homes in on any digger
TYP_SLOWGHOST, // [0C] A slow moving ghost that homes in on any digger
TYP_SLOWPHASE, // [0D] A slow moving worm hole that transports diggers anywhere
TYP_FASTPHASE, // [0E] A fast moving worm hole that transports diggers anywhere
TYP_TOADSTOOL, // [0F] A plant that attacks diggers
TYP_BADROOTS, // [10] A root plant that attacks diggers
TYP_ALIEN, // [11] A mutated alien from a digger
TYP_ALIENEGG, // [12] If digger touches this then TYP_ALIEN is born
TYP_BIRD, // [13] Critter. Just flies left and right
TYP_FISH, // [14] Critter. Just swims left and right
TYP_DINOFAST, // [15] A fast moving dinosour
TYP_DINOSLOW, // [16] A slow moving dinosour
TYP_STEGO, // [17] Main part of a slow moving stegosaurus
TYP_STEGOB, // [18] Attachment part of TYP_STEGMAIN
TYP_TURTLE, // [19] Turtle. Just swims left and right (Unused in original)
TYP_BIGFOOT, // [1A] A fast moving, intelligent monster (Unused in original)
TYP_STUNNEL, // [1B] Small tunneler
TYP_LTUNNEL, // [1C] Large tunneler
TYP_LTUNNELB, // [1D] Attachment for large tunneler
TYP_CORK, // [1E] Corkscrew (Vertical tunneler)
TYP_TELEPOLE, // [1F] Telepole
TYP_TNT, // [20] Explosives
TYP_FIRSTAID, // [21] First aid kit
TYP_MAP, // [22] Map that shows everything in the level
TYP_TRACK, // [23] Track for train cart
TYP_TRAIN, // [24] Train for track
TYP_BRIDGE, // [25] Bridge piece
TYP_BOAT, // [26] Inflatable boat
TYP_GATE, // [27] Flood gate
TYP_GATEB, // [28] Deployed flood gate
TYP_LIFT, // [29] Elevator
TYP_LIFTB, // [2A] Deployed elevator
TYP_LIFTC, // [2B] Deployed elevator attachment
TYP_MAX, // Total number of object types
TYP_DIGRANDOM // For LoadLevelData(). Select a random race
};
/* --------------------------------------------------------------------------------- */
enum OBJAI // All the types of AI that can control an object
{
AI_NONE, // No AI
AI_DIGGER, // Object is a digger
AI_ROAMCREEP, // Object is a roaming humanoid
AI_ROAMSLOW, // Object is a roaming humanoid
AI_ROAMFAST, // Object is a roaming humanoid
AI_CRITTER, // Object does nothing but go left and right
AI_FINDSLOW, // Object slowly homes in on a digger
AI_FINDFAST, // Object quickly homes in on a digger
AI_RANDOM, // Object moves in 4 directions finding a digger
AI_BIGFOOT, // Object moves around like a digger and steals items
AI_MAX // Maximum number of AI types
};
/* --------------------------------------------------------------------------------- */
enum OBJACT // All the actions that an object can do
{
ACT_HIDE, // Object is invinsible
ACT_STOP, // Object is standing still
ACT_CREEP, // Object is creeping
ACT_WALK, // Object is walking
ACT_RUN, // Object is running
ACT_DIG, // Object is digging
ACT_PHASE, // Object is teleporting
ACT_DEATH, // Object is dead
ACT_FIGHT, // Object is fighting (only if both objects have OFL_DIGGER)
ACT_EATEN, // Object is eaten by an alien egg
ACT_MAX, // Total number of actions
ACT_KEEP // Preserve the current action (SETACTION() Command)
};
/* --------------------------------------------------------------------------------- */
enum OBJJOB // All the jobs that an object can do (Sub-action)
{
JOB_NONE, // No job
JOB_BOUNCE, // The object bounces in the opposite direction when it is blocked
JOB_DIG, // The object digs when it is blocked
JOB_DIGDOWN, // The object digs down when in centre of tile
JOB_EXPLODE, // The object explodes when
JOB_HOME, // The object is to move to its starting position (home point)
JOB_INDANGER, // The object is in danger
JOB_PHASE, // The object is to teleport
JOB_SEARCH, // The object walks around and never stops but picks up treasure
JOB_SPAWN, // The object is spawning not teleporting (uses ACT_PHASE)
JOB_MAX, // Maximum number of jobs
JOB_KEEP, // Preserve the current job (SETACTION() Command)
JOB_JUMP // Same as JOB_KEEP but the object should jump as well
};
/* --------------------------------------------------------------------------------- */
enum OBJDIR // All the directions an object can go in
{
DIR_UL, // Move left and dig up-left diagonally
DIR_U, // Up direction, but not used
DIR_UR, // Move right and dig up-right diagonally
DIR_L, // Move left and dig left
DIR_NONE, // No direction
DIR_R, // Move right and dig right
DIR_DL, // Move left and dig down-left diagnoally
DIR_D, // Dig down
DIR_DR, // Move right and dig down-right diagonally
DIR_MAX, // Maximum number of directions
DIR_LR, // Go left or right
DIR_OPPOSITE, // Move in the opposite direction (SETACTION() Command)
DIR_KEEP, // Preserve the current direction (SETACTION() Command)
DIR_HOME, // Direction to the player's home point (SETACTION() Command)
DIR_TCTR // Move into the centre of the tile (SETACTION() Command)
};
/* ================================================================================= */
/* CORE */
/* --------------------------------------------------------------------------------- */
extern "C" { INT _fltused; } // Stupid MS compiler :/
/* --------------------------------------------------------------------------------- */
typedef struct COORDS { INT X, Y; } COORDS, *PCOORDS; // Co-ordinates
/* --------------------------------------------------------------------------------- */
typedef VOID (*GAMEFUNC)(VOID); // Function pointer
/* ================================================================================= */
struct MODEDATA // Mode data type
{
UCHAR TexScale; // Texture scale
USHORT Width; // Resolution width
USHORT Height; // Resolution height
UCHAR Depth; // Bit depth
UCHAR Available; // Full screen mode available?
}
ModeData[]= // Modes that are used in game
{
// 8-bit modes (256 colour palette mode)
1, ASPECT_WIDTH, ASPECT_HEIGHT, 8, FALSE, // 320x240x8 (1:1 Aspect)
2, ASPECT_WIDTH * 2, ASPECT_HEIGHT * 2, 8, FALSE, // 640x480x8 (2:1 Aspect)
3, ASPECT_WIDTH * 3, ASPECT_HEIGHT * 3, 8, FALSE, // 960x720x8 (3:1 Aspect)
4, ASPECT_WIDTH * 4, ASPECT_HEIGHT * 4, 8, FALSE, // 1280x960x8 (4:1 Aspect)
// 16-bit modes (65,536 colour palette mode)
// 1, ASPECT_WIDTH, ASPECT_HEIGHT, 16, FALSE, // 320x240x16 (1:1 Aspect)
// 2, ASPECT_WIDTH * 2, ASPECT_HEIGHT * 2, 16, FALSE, // 640x480x16 (2:1 Aspect)
// 3, ASPECT_WIDTH * 3, ASPECT_HEIGHT * 3, 16, FALSE, // 960x720x16 (3:1 Aspect)
// 4, ASPECT_WIDTH * 4, ASPECT_HEIGHT * 4, 16, FALSE, // 1280x960x16 (4:1 Aspect)
// 32-bit modes (16,777,216 colour palette mode)
// 1, ASPECT_WIDTH, ASPECT_HEIGHT, 32, FALSE, // 320x240x32 (1:1 Aspect)
// 2, ASPECT_WIDTH * 2, ASPECT_HEIGHT * 2, 32, FALSE, // 640x480x32 (2:1 Aspect)
// 3, ASPECT_WIDTH * 3, ASPECT_HEIGHT * 3, 32, FALSE, // 960x720x32 (3:1 Aspect)
// 4, ASPECT_WIDTH * 4, ASPECT_HEIGHT * 4, 32, FALSE, // 1280x960x32 (4:1 Aspect)
// Last one always NULL
NULL
};
/* ================================================================================= */
CHAR MUSICNAMES[MUSIC_MAX][9] = // Music file names (see above for id's)
{
"MBANK", "MINGAME", "MLOSE", "MMENU", "MSELECT", "MSHOP", "MTITLE", "MWIN"
};
/* ================================================================================= */
struct CURSOR // Struct definition for mouse cursor type
{
USHORT StartId; // Starting tile animation of mouse cursor
USHORT EndId; // Ending tile animation of mouse cursor
CHAR OffsetX; // Offset X co-ordinate
CHAR OffsetY; // Offset Y co-ordinate
}
CursorData[CID_MAX]= // Available cursors
{
479, 479, 0, 0, // CID_ARROW
459, 462, -8, -8, // CID_OK
455, 458, -8, -8, // CID_EXIT
451, 451, 0, 0, // CID_LEFT
452, 452, 0, 0, // CID_TOP
453, 453, -15, 0, // CID_RIGHT
454, 454, 0, -15 // CID_BOTTOM
};
/* --------------------------------------------------------------------------------- */
struct MENU // Control menu layouts structure
{
MENUID Id; // Id of this menu
UCHAR Width; // Width of this menu
UCHAR Height; // Height of this menu
USHORT Flags; // Which buttons are disabled when object is busy
struct BUTDATA // Button data struct
{
SHORT Id; // Interface id of button
CHAR Tip[49]; // Button tip
}
Data[16]; // Id's of each button (-1 = no button)
}
MenuData[MNU_MAX]=
{
// ID W H FLAGS BID TIP
MNU_MAIN , 8, 1, 0x0f0, 15, "SELECT MOVEMENT MENU FOR %s",
11, "SELECT DIG MENU FOR %s",
5, "PICKUP OBJECT TOUCHED BY %s",
6, "SELECT INVENTORY MENU FOR %s",
12, "ORDER %s TO ENTER TRADE CENTRE",
10, "ORDER %s TO HALT ALL ACTIONS",
9, "ORDER %s TO SEARCH FOR GEMS",
22, "ORDER %s TO TELEPORT HOME",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
// ID W H FLAGS BID TIP
MNU_MOVE, 4, 2, 0x70f, 0, "ORDER %s TO WALK LEFT",
13, "ORDER %s TO JUMP",
1, "ORDER %s TO WALK RIGHT",
10, "ORDER %s TO HALT ALL ACTIONS",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
3, "ORDER %s TO RUN LEFT",
2, "ORDER %s TO STOP",
4, "ORDER %s TO RUN RIGHT",
21, "RETURN TO MAIN CONTROL MENU",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
// ID W H FLAGS BID TIP
MNU_DIG, 4, 2, 0xb0f, 23, "ORDER %s TO DIG UPPER-LEFT",
0, "ORDER %s TO DIG LEFT",
1, "ORDER %s TO DIG RIGHT",
25, "ORDER %s TO DIG UPPER-RIGHT",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
24, "ORDER %s TO DIG LOWER-LEFT",
14, "ORDER %s TO DIG DOWN",
21, "RETURN TO MAIN CONTROL MENU",
26, "ORDER %s TO DIG DOWN-RIGHT",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
// ID W H FLAGS BID TIP
MNU_DROP, 3, 2, 0x000, 27, "SELECT NEXT INVENTORY ITEM",
29, "DROP CURRENTLY DISPLAYED ITEM",
30, "DROP CURRENTLY DISPLAYED ITEM",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
28, "RETURN TO MAIN CONTROL MENU",
31, "DROP CURRENTLY DISPLAYED ITEM",
32, "DROP CURRENTLY DISPLAYED ITEM",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
// ID W H FLAGS BID TIP
MNU_TRADE, 5, 1, 0x00f, 34, "PURCHASE ITEMS FROM TRADE CENTRE",
35, "SELL INVENTORY TO TRADE CENTRE",
10, "ORDER %s TO REST",
16, "RECRUIT A NEW %s DIGGER",
21, "RETURN TO MAIN CONTROL MENU",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
// ID W H FLAGS BID TIP
MNU_BUY, 3, 2, 0x000, 27, "SELECT NEXT ITEM ON SALE",
29, "PURCHASE CURRENTLY DISPLAYED ITEM",
30, "PURCHASE CURRENTLY DISPLAYED ITEM",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
28, "RETURN TO TRADE CENTRE MENU",
31, "PURCHASE CURRENTLY DISPLAYED ITEM",
32, "PURCHASE CURRENTLY DISPLAYED ITEM",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
// ID W H FLAGS BID TIP
MNU_SELL, 3, 2, 0x000, 27, "SELECT NEXT INVENTORY ITEM",
29, "SELL CURRENTLY DISPLAYED ITEM",
30, "SELL CURRENTLY DISPLAYED ITEM",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
28, "RETURN TO TRADE CENTRE MENU",
31, "SELL CURRENTLY DISPLAYED ITEM",
32, "SELL CURRENTLY DISPLAYED ITEM",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
// ID W H FLAGS BID TIP
MNU_TUNNEL, 3, 1, 0x007, 0, "ORDER %s TO MOVE AND DIG LEFT",
2, "ORDER %s TO HALT ALL ACTIONS",
1, "ORDER %s TO MOVE AND DIG RIGHT",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
// ID W H FLAGS BID TIP
MNU_CORK, 2, 2, 0x303, 0, "ORDER %s TO MOVE LEFT",
1, "ORDER %s TO MOVE RIGHT",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
14, "ORDER %s TO DIG DOWN",
2, "ORDER %s TO HALT ALL ACTIONS",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
// ID W H FLAGS BID TIP
MNU_TNT, 1, 1, 0x001, 19, "DETONATE %s",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
// ID W H FLAGS BID TIP
MNU_MAP, 1, 1, 0x001, 33, "VIEW %s",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
// ID W H FLAGS BID TIP
MNU_TRAIN, 3, 2, 0x707, 0, "ORDER %s TO MOVE LEFT",
2, "ORDER %s TO HALT ALL ACTIONS",
1, "ORDER %s TO MOVE RIGHT",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
5, "GRAB ANY ITEM %s IS TOUCHING",
6, "DISPLAY %s IVENTORY",
9, "ORDER %s TO SEARCH FOR TREASURE",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
// ID W H FLAGS BID TIP
MNU_TRDROP, 3, 2, 0x000, 27, "DISPLAY NEXT ITEM IN INVENTORY",
29, "DROP CURRENTLY DISPLAYED ITEM",
30, "DROP CURRENTLY DISPLAYED ITEM",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
28, "RETURN TO %s CONTROL MENU",
31, "DROP CURRENTLY DISPLAYED ITEM",
32, "DROP CURRENTLY DISPLAYED ITEM",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
// ID W H FLAGS BID TIP
MNU_FLOAT, 3, 1, 0x007, 0, "ORDER %s TO MOVE LEFT",
2, "ORDER %s TO HALT",
1, "ORDER %s TO MOVE RIGHT",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
// ID W H FLAGS BID TIP
MNU_GATE, 2, 1, 0x003, 17, "RAISE THE %s",
18, "DROP THE %s",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
// ID W H FLAGS BID TIP
MNU_DEPLOY, 1, 1, 0x001, 20, "DEPLOY %s",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
// ID W H FLAGS BID TIP
MNU_LIFT, 3, 1, 0x007, 13, "SEND %s UP",
2, "STOP THE %s",
14, "SEND %s DOWN",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
-1, "UNDEFINED",
// ID W H FLAGS BID TIP
};
/* --------------------------------------------------------------------------------- */
struct LEVELINFO // Level information structure
{
CHAR Name[9]; // Name of level (Max of 8 chars)
USHORT Required; // Money required to win level
UCHAR Flags; // Level flags
}
LevelInfo[LEVEL_NUM]= // Level information data
{
// NAME WINREQ FLAGS
"AZERG", 600, LFL_UNPLAYED | LFL_UNFINISHED,
"DHOBBS", 600, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"ELEVATE", 600, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"DEENA", 600, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"JUSTYN", 600, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"FUJALE", 1000, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"HAEWARD", 600, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"SAIRRUHR", 1000, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"TRAAGHE", 600, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"KURVELYN", 1400, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"SQUEEK", 1400, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"MYKEBORL", 1400, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"ZORLYACK", 1400, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"FTARGUS", 1400, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"TRAISA", 1400, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"KLINDYKE", 1400, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"EEANZONE", 1400, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"CHYSSHIR", 1400, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"DJENNEE", 1400, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"DWINDERA", 1400, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"TWANG", 1400, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"HABBARD", 1800, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"BENJAR", 1400, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"SHRUBREE", 1800, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"BAROK", 1800, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"MUHLAHRD", 1800, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"CHONSKEE", 1800, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"PURTH", 1800, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"ANKH", 1800, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"ZELIOS", 2200, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"FRUER", 2200, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"KLARSH", 2200, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"SUHMNER", 2200, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED,
"SIMTOB", 2200, LFL_UNPLAYED | LFL_UNFINISHED | LFL_LOCKED
// NAME WINREQ FLAGS
};
/* --------------------------------------------------------------------------------- */
CHAR SceneNames[SCENE_MAX][10]= // Names of sceneries
{
"DESERT", // SCENE_DESERT
"GRASS", // SCENE_GRASS
"ISLANDS", // SCENE_ISLANDS
"JUNGLE", // SCENE_JUNGLE
"MOUNTAIN", // SCENE_MOUNTAIN
"ROCK", // SCENE_ROCK
"SNOW" // SCENE_SNOW
};
/* --------------------------------------------------------------------------------- */
OBJDIR DirTable[3][3]={DIR_UL,DIR_U,DIR_UR,DIR_L,DIR_NONE,DIR_R,DIR_DL,DIR_D,DIR_DR};
/* --------------------------------------------------------------------------------- */
struct DIRDATA // Direction structure (data for each direction)
{
USHORT AnimStart; // Start of animation
USHORT AnimEnd; // End of animation
};
struct ACTDATA // Action structure (data for each action)
{
struct DIRDATA DirData[DIR_MAX]; // Direction data for each action
CHAR OffsetX; // Offset X coordinates
CHAR OffsetY; // Offset Y coordinates
SFXID SoundId; // Sound to play when action is this
UINT64 Flags; // Flags for this action (OFL_*)
};
struct OBJDATA // Object structure (data for each object type)
{
struct ACTDATA ActData[ACT_MAX]; // Action data for each object type
CHAR Name[9]; // Name of object
SHORT DigDelay; // Object digging delay or drop chance if OFL_TREASURE
SHORT PhaseDelay; // Phase delay for object
SHORT Strength; // Strength (Chance to hit) of object
SHORT Stamina; // Stamina (Delay before next hp tick, -1 = no regen)
USHORT Value; // Value of item at shop
UCHAR Weight; // Weight of item (Max carry weight if its a digger)
UINT64 Flags; // Flags for this object (OFL_*)
MENUID Menu; // Control menu used when right clicked on object
OBJACT InitialAction; // Initial action when created
OBJJOB InitialJob; // Initial action job created
OBJDIR InitialDirection; // Initial direction when created
OBJAI AIType; // AI type
UCHAR AnimTimer; // Delay before incrementing animation frame
OBJTYP Attachment; // A virtual object can be attached to this one to
// make a bigger object. Just specify the TYP_ of object
// you want to attach.
}
ObjectData[TYP_MAX]=
{
// F'TARG DIR_UL DIR_U DIR_UR DIR_L NONE DIR_R DIR_DL DIR_D DIR_DR OFX OFY SOUND FLAGS
/* ACT_HIDE */ 476,476, 476,476, 476,476, 476,476, 476,476, 476,476, 476,476, 476,476, 476,476, 0, 0, SFX_NONE, OFL_BUSY,
/* ACT_STOP */ 138,140, 138,140, 138,140, 138,140, 138,140, 138,140, 138,140, 138,140, 138,140, 0, 0, SFX_NONE, OFL_FALL | OFL_DIGGER,
/* ACT_CREEP */ 12, 15, 12, 15, 8, 11, 12, 15, 12, 15, 8, 11, 12, 15, 12, 15, 8, 11, 0, 0, SFX_NONE, OFL_FALL | OFL_DIGGER,
/* ACT_WALK */ 12, 15, 12, 15, 8, 11, 12, 15, 12, 15, 8, 11, 12, 15, 12, 15, 8, 11, 0, 0, SFX_NONE, OFL_FALL | OFL_DIGGER,
/* ACT_RUN */ 20, 23, 20, 23, 16, 19, 20, 23, 20, 23, 16, 19, 20, 23, 20, 23, 16, 19, 0, 0, SFX_NONE, OFL_FALL | OFL_DIGGER,
/* ACT_DIG */ 63, 65, 63, 65, 60, 62, 63, 65, 63, 65, 60, 62, 63, 65, 86, 88, 60, 62, 0, 0, SFX_DIG, OFL_FALL | OFL_SOUNDLOOP,
/* ACT_PHASE */ 106,109, 106,109, 106,109, 106,109, 106,109, 106,109, 106,109, 106,109, 106,109, 0, 0, SFX_PHASE, OFL_BUSY,
/* ACT_DEATH */ 451,454, 451,454, 451,454, 451,454, 451,454, 451,454, 451,454, 451,454, 451,454, 0, 0, SFX_DIEFTAR, 0,
/* ACT_FIGHT */ 245,249, 240,244, 240,244, 245,249, 240,244, 240,244, 245,249, 240,244, 240,244, 0, 0, SFX_NONE, OFL_FALL | OFL_DIGGER,
/* ACT_EATEN */ 77, 79, 74, 76, 74, 76, 77, 79, 74, 76, 74, 76, 77, 79, 74, 76, 74, 76, 0, 0, SFX_NONE, OFL_FALL | OFL_NOANIMLOOP,
// NAME
"FTARG",
// DIGDELAY TELEDELAY STRENGTH STAMINA VALUE WEIGHT FLAGS
70, 150, 20, 60, 1000, 0, OFL_DIGGER | OFL_PHASETARGET | OFL_DELICATE,
// MENU ACTION JOB DIRECTION AITYPE ANIMTIMER ATTACHMENT
MNU_MAIN, ACT_PHASE, JOB_NONE, DIR_NONE, AI_DIGGER, TIMER_ANIMNORMAL, TYP_NULL,
// HABBISH DIR_UL DIR_U DIR_UR DIR_L NONE DIR_R DIR_DL DIR_D DIR_DR OFX OFY SOUND FLAGS
/* ACT_HIDE */ 476,476, 476,476, 476,476, 476,476, 476,476, 476,476, 476,476, 476,476, 476,476, 0, 0, SFX_NONE, OFL_BUSY,
/* ACT_STOP */ 135,137, 135,137, 135,137, 135,137, 135,137, 135,137, 135,137, 135,137, 135,137, 0, 0, SFX_NONE, OFL_FALL | OFL_DIGGER,
/* ACT_CREEP */ 120,123, 120,123, 116,119, 120,123, 120,123, 116,119, 120,123, 120,123, 116,119, 0, 0, SFX_NONE, OFL_FALL | OFL_DIGGER,
/* ACT_WALK */ 120,123, 120,123, 116,119, 120,123, 120,123, 116,119, 120,123, 120,123, 116,119, 0, 0, SFX_NONE, OFL_FALL | OFL_DIGGER,
/* ACT_RUN */ 128,131, 128,131, 124,127, 128,131, 128,131, 124,127, 128,131, 128,131, 124,127, 0, 0, SFX_NONE, OFL_FALL | OFL_DIGGER,
/* ACT_DIG */ 228,230, 228,230, 225,227, 228,230, 228,230, 225,227, 228,230, 237,239, 225,227, 0, 0, SFX_DIG, OFL_FALL | OFL_SOUNDLOOP,
/* ACT_PHASE */ 106,109, 106,109, 106,109, 106,109, 106,109, 106,109, 106,109, 106,109, 106,109, 0, 0, SFX_PHASE, OFL_BUSY,
/* ACT_DEATH */ 451,454, 451,454, 451,454, 451,454, 451,454, 451,454, 451,454, 451,454, 451,454, 0, 0, SFX_DIEHABB, 0,
/* ACT_FIGHT */ 255,259, 250,254, 250,254, 255,259, 250,254, 250,254, 255,259, 250,254, 250,254, 0, 0, SFX_NONE, OFL_FALL | OFL_DIGGER,
/* ACT_EATEN */ 151,153, 141,143, 141,143, 151,153, 141,143, 141,143, 151,153, 141,143, 141,143, 0, 0, SFX_NONE, OFL_FALL | OFL_NOANIMLOOP,
// NAME
"HABBISH",
// DIGDELAY TELEDELAY STRENGTH STAMINA VALUE WEIGHT FLAGS
80, 60, 30, 120, 1000, 0, OFL_DIGGER | OFL_PHASETARGET | OFL_DELICATE,
// MENU ACTION JOB DIRECTION AITYPE ANIMTIMER ATTACHMENT
MNU_MAIN, ACT_PHASE, JOB_NONE, DIR_NONE, AI_DIGGER, TIMER_ANIMNORMAL, TYP_NULL,
// GRABLIN DIR_UL DIR_U DIR_UR DIR_L NONE DIR_R DIR_DL DIR_D DIR_DR OFX OFY SOUND FLAGS
/* ACT_HIDE */ 476,476, 476,476, 476,476, 476,476, 476,476, 476,476, 476,476, 476,476, 476,476, 0, 0, SFX_NONE, OFL_BUSY,
/* ACT_STOP */ 222,224, 222,224, 222,224, 222,224, 222,224, 222,224, 222,224, 222,224, 222,224, 0, 0, SFX_NONE, OFL_FALL | OFL_DIGGER,
/* ACT_CREEP */ 204,207, 204,207, 200,203, 204,207, 204,207, 200,203, 204,207, 204,207, 200,203, 0, 0, SFX_NONE, OFL_FALL | OFL_DIGGER,
/* ACT_WALK */ 204,207, 204,207, 200,203, 204,207, 204,207, 200,203, 204,207, 204,207, 200,203, 0, 0, SFX_NONE, OFL_FALL | OFL_DIGGER,
/* ACT_RUN */ 212,215, 212,215, 208,211, 212,215, 212,215, 208,211, 212,215, 212,215, 208,211, 0, 0, SFX_NONE, OFL_FALL | OFL_DIGGER,
/* ACT_DIG */ 83, 85, 83, 85, 80, 82, 83, 85, 83, 85, 80, 82, 83, 85, 89, 91, 80, 82, 0, 0, SFX_DIG, OFL_FALL | OFL_SOUNDLOOP,
/* ACT_PHASE */ 106,109, 106,109, 106,109, 106,109, 106,109, 106,109, 106,109, 106,109, 106,109, 0, 0, SFX_PHASE, OFL_BUSY,
/* ACT_DEATH */ 451,454, 451,454, 451,454, 451,454, 451,454, 451,454, 451,454, 451,454, 451,454, 0, 0, SFX_DIEGRAB, 0,
/* ACT_FIGHT */ 275,279, 270,274, 270,274, 275,279, 270,274, 270,274, 275,279, 270,274, 270,274, 0, 0, SFX_NONE, OFL_FALL | OFL_DIGGER,
/* ACT_EATEN */ 219,221, 216,218, 216,218, 219,221, 216,218, 216,218, 219,221, 216,218, 216,218, 0, 0, SFX_NONE, OFL_FALL | OFL_NOANIMLOOP,
// NAME
"GRABLIN",
// DIGDELAY TELEDELAY STRENGTH STAMINA VALUE WEIGHT FLAGS
60, 120, 25, 120, 1000, 0, OFL_DIGGER | OFL_PHASETARGET | OFL_DELICATE,
// MENU ACTION JOB DIRECTION AITYPE ANIMTIMER ATTACHMENT