forked from diasurgical/devilution
-
Notifications
You must be signed in to change notification settings - Fork 2
/
structs.h
2008 lines (1817 loc) · 37 KB
/
structs.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
#include <string>
#define GLOBAL_WIDTH 1280
#define GLOBAL_HEIGHT 960
#define MAX_STASH_TABS 25
#define MEGAPACKETSIZE 32000
#define GRISWOLD_GOLD_LIMIT 1400000
#define ADRIA_GOLD_LIMIT 1400000
#define WIRT_GOLD_LIMIT 900000
#include <sstream>
#include <chrono>
#include <fstream>
#include <future>
#include <vector>
#include "..\ctpl_stl.h"
#include <thread>
#include <functional>
struct globalData {
bool initThread;
bool autoConfigDone;
int num_threads;
int maxThreads;
int bestNumThreads;
int autoConfigIter;
int bestAvg;
int lowest;
int highest;
long long int sum;
int iter;
ctpl::thread_pool pp;
};
struct threadedStuff {
bool ltf;
globalData* dd;
std::chrono::high_resolution_clock::time_point timeStart;
std::string label;
threadedStuff(std::string l, int mx, bool logToFile, globalData &d) {
dd = &d;
timeStart = std::chrono::high_resolution_clock::now();
label = l;
ltf = logToFile;
if (d.initThread == false) {
d.lowest = 9999999;
d.highest = 0;
d.iter = 0;
d.sum = 0;
d.bestAvg = 9999999;
d.maxThreads = mx;
d.num_threads = 1;
d.bestNumThreads = 1;
d.autoConfigIter = 0;
d.autoConfigDone = false;
d.initThread = true;
d.pp.init();
d.pp.resize(d.maxThreads);
}
}
~threadedStuff() {
auto duration = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::high_resolution_clock::now() - timeStart).count();
if (duration < dd->lowest) { dd->lowest = duration; }
if (duration > dd->highest) { dd->highest = duration; }
dd->iter++;
dd->sum += duration;
int avg = dd->sum / (dd->iter + 0.01);
if (ltf == true) {
std::ofstream outfile;
outfile.open("test.txt", std::ios_base::app);
outfile << label << " - Elapsed time: " << duration << " LOW: " << dd->lowest << " HIGH: " << dd->highest << " AVG: " << avg << " DONE WITH THREADS: " << dd->num_threads << " BEST AVG: " << dd->bestAvg << " bestnumt: " << dd->bestNumThreads << "\n";
outfile.close();
}
autoConfig();
}
/*
void threadedStuff::call_from_thread(int idm) {
int mul = dd->height / dd->num_threads;
for (int i = 0; i < mul; ++i) {
int tid = idm * mul + i;
memcpy((BYTE *)dd->param1 + (tid * dd->param2), &dd->param3[tid * dd->width], dd->width * sizeof(UINT32));
}
}
*/
/*
void threadedStuff::executeThreaded(std::function< void(int,globalData*)>& lambda) {
std::vector<std::future<void> > results(dd->num_threads);
for (int j = 0; j < dd->num_threads; ++j) {
results[j] = dd->pp.push([&](int) {
//myFunc(j, dd);
lambda(j,dd);
});
}
for (int j = 0; j < dd->num_threads; ++j) { results[j].get(); }
}
*/
/*
std::vector<std::future<void>> results(dd->num_threads);
for (int j = 0; j < dd->num_threads; ++j) {
results[j] = dd->pp.push([j](int) {
int mul = dd->height / dd->num_threads;
for (int i = 0; i < mul; ++i) {
int tid = j * mul + i;
memcpy((BYTE *)dd->param1 + (tid * dd->param2), &dd->param3[tid * dd->width], dd->width * sizeof(UINT32));
}
});
}
for (int j = 0; j < dd->num_threads; ++j) { results[j].get(); }
*/
/*
std::vector<std::future<void>> results(dd->num_threads);
for (int j = 0; j < dd->num_threads; ++j) {
results[j] = dd->pp.push([j, dd](int) {
int mul = dd->height / dd->num_threads;
for (int i = 0; i < mul; ++i) {
int tid = j * mul + i;
memcpy((BYTE *)dd->param1 + (tid * dd->param2), &dd->param3[tid * dd->width], dd->width * sizeof(UINT32));
}; }
}
for (int j = 0; j < dd->num_threads; ++j) { results[j].get(); }
*/
/*
std::vector<std::future<void>> results(dd->num_threads);
for (int j = 0; j < dd->num_threads; ++j) { results[j] = dd->pp.push([&](int) {
call_from_thread(j); }); }
for (int j = 0; j < dd->num_threads; ++j) { results[j].get(); }
*/
void threadedStuff::autoConfig() {
if (dd->autoConfigDone) { return; }
dd->autoConfigIter++;
if (dd->autoConfigIter >= 2) {
int avg = dd->sum / dd->iter;
dd->autoConfigIter = 0;
if (avg < dd->bestAvg) {
dd->bestNumThreads = dd->num_threads;
dd->bestAvg = avg;
}
dd->sum = 0;
dd->iter = 0;
dd->lowest = 999999;
dd->highest = 0;
if (dd->num_threads < dd->maxThreads) { dd->num_threads++; }
else {
dd->autoConfigDone = true;
//MessageBox(NULL, "Autoconfig DONE", NULL, NULL);
dd->num_threads = dd->bestNumThreads;
}
}
}
};
class drawingQueue
{
public:
int ItemID;
int Row;
int Col;
int x;
int y;
int new_x = -1;
int new_y = -1;
int width;
int height;
int color;
std::string text;
int r;
int g;
int b;
bool mix;
drawingQueue(int x2, int y2, int width2, int height2, int Row2, int Col2, int ItemID2, int q2, std::string text2, int mix2, int r2, int g2, int b2) { x = x2; y = y2; Row = Row2; Col = Col2; ItemID = ItemID2; width = width2; height = height2; color = q2; text = text2; r = r2; g = g2; b = b2; mix = mix2; }
};
class FloatingText {
public:
std::string text;
int color;
int iterations;
int angle;//0-360
int posX, posY;
bool showOnCenter;
int callerID;
int value;
std::string description;
void doStuff(std::string s, int c, int px, int py, bool center, int cc, std::string desc, int v) {
text = s;
color = c;
iterations = 0;
angle = -60 + (rand() % 121) + 180 * (rand() % 2); //angle = 60 + rand() % 61;
showOnCenter = center;
posX = px;
posY = py;
callerID = cc;
description = desc;
value = v;
}
FloatingText(std::string s, int c, int px, int py, bool center, int cc, std::string desc, int v) {
doStuff(s, c, px, py, center, cc, desc, v);
}
FloatingText(std::string s, int c, std::string desc) {
doStuff(s, c, 0, 0, true, -1, desc, -1);
}
void IncreaseIterations() { iterations++; }
};
//////////////////////////////////////////////////
// items
//////////////////////////////////////////////////
struct PLStruct
{
const char *PLName;
char PLPower;
int PLParam1;
int PLParam2;
int PLMinLvl;
int PLIType;
int PLGOE;
int PLDouble;
int PLOk;
int PLMinVal;
int PLMaxVal;
int PLMultVal;
};
struct UItemStruct
{
char *UIName;
char UIItemId;
char UIMinLvl;
char UINumPL;
int UIValue;
char UIPower1;
int UIParam1;
int UIParam2;
char UIPower2;
int UIParam3;
int UIParam4;
char UIPower3;
int UIParam5;
int UIParam6;
char UIPower4;
int UIParam7;
int UIParam8;
char UIPower5;
int UIParam9;
int UIParam10;
char UIPower6;
int UIParam11;
int UIParam12;
};
struct ItemDataStruct
{
int iRnd;
char iClass;
char iLoc;
int iCurs;
char itype;
char iItemId;
char *iName;
char *iSName;
int iMinMLvl;
int iDurability;
int iMinDam;
int iMaxDam;
int iMinAC;
int iMaxAC;
char iMinStr;
char iMinMag;
char iMinDex;
// item_special_effect
int iFlags;
// item_misc_id
int iMiscId;
// spell_id
int iSpell;
int iUsable;
int iValue;
int iMaxValue;
};
struct ItemGetRecordStruct
{
int nSeed;
unsigned short wCI;
int nIndex;
int dwTimestamp;
};
struct ItemStruct
{
int _iSeed;
unsigned short _iCreateInfo;
int _itype;
int _ix;
int _iy;
int _iAnimFlag;
unsigned char *_iAnimData; // PSX name -> ItemFrame
int _iAnimLen;
int _iAnimFrame;
int _iAnimWidth;
int _iAnimWidth2; // width 2?
int isRare; // set when item is flagged for deletion, deprecated in 1.02
char _iSelFlag;
int _iPostDraw;
BOOL _iIdentified;
char _iMagical;
char _iName[64];
char _iIName[64];
char _iLoc;
// item_class enum
char _iClass;
int _iCurs;
int _ivalue;
int _iIvalue;
int _iMinDam;
int _iMaxDam;
int _iAC;
// item_special_effect
int _iFlags;
// item_misc_id
int _iMiscId;
// spell_id
int _iSpell;
int _iCharges;
int _iMaxCharges;
int _iDurability;
int _iMaxDur;
int _iPLDam;
int _iPLToHit;
int _iPLAC;
int _iPLStr;
int _iPLMag;
int _iPLDex;
int _iPLVit;
int _iPLFR;
int _iPLLR;
int _iPLMR;
int _iPLMana;
int _iPLHP;
int _iPLDamMod;
int _iPLGetHit;
int _iPLLight;
char _iSplLvlAdd;
char _iRequest;
int _iUid;
int _iFMinDam;
int _iFMaxDam;
int _iLMinDam;
int _iLMaxDam;
int _iPLEnAc;
char _iPrePower;
char _iSufPower;
int _iVAdd1;
int _iVMult1;
int _iVAdd2;
int _iVMult2;
char _iMinStr;
unsigned char _iMinMag;
char _iMinDex;
BOOL _iStatFlag;
int IDidx;
int rareAffix;
};
//////////////////////////////////////////////////
// player
//////////////////////////////////////////////////
#define LATEST_PLAYERSTRUCT PlayerStruct6
struct PlayerStruct
{
int _pmode;
char walkpath[25];
unsigned char plractive;
int destAction;
int destParam1;
int destParam2;
int destParam3;
int destParam4;
int plrlevel;
int WorldX;
int WorldY;
int _px;
int _py;
int _ptargx;
int _ptargy;
int _pownerx;
int _pownery;
int _poldx;
int _poldy;
int _pxoff;
int _pyoff;
int _pxvel;
int _pyvel;
int _pdir;
int _nextdir;
int _pgfxnum;
unsigned char *_pAnimData;
int _pAnimDelay;
int _pAnimCnt;
int _pAnimLen;
int _pAnimFrame;
int _pAnimWidth;
int _pAnimWidth2;
int _peflag;
int _plid;
int _pvid;
int _pSpell;
char _pSplType;
char _pSplFrom;
int _pTSpell;
int _pTSplType;
int _pRSpell;
// enum spell_type
char _pRSplType;
int _pSBkSpell;
char _pSBkSplType;
char _pSplLvl[64];
union {
unsigned __int64 _pMemSpells64;
int _pMemSpells[2];
};
union {
unsigned __int64 _pAblSpells64;
int _pAblSpells[2];
};
union {
unsigned __int64 _pScrlSpells64;
int _pScrlSpells[2];
};
int _pSpellFlags;
int _pSplHotKey[4];
char _pSplTHotKey[4];
int _pwtype;
unsigned char _pBlockFlag;
unsigned char _pInvincible;
char _pLightRad;
unsigned char _pLvlChanging;
char _pName[32];
// plr_class enum value.
// TODO: this could very well be `enum plr_class _pClass`
// since there are 3 bytes of alingment after this field.
// it could just be that the compiler optimized away all accesses to
// the higher bytes by using byte instructions, since all possible values
// of plr_class fit into one byte.
char _pClass;
int _pStrength;
int _pBaseStr;
int _pMagic;
int _pBaseMag;
int _pDexterity;
int _pBaseDex;
int _pVitality;
int _pBaseVit;
int _pStatPts;
int _pDamageMod;
int _pBaseToBlk;
int _pHPBase;
int _pMaxHPBase;
int _pHitPoints;
int _pMaxHP;
int _pHPPer;
int _pManaBase;
int _pMaxManaBase;
int _pMana;
int _pMaxMana;
int _pManaPer;
char _pLevel;
char _pMaxLvl;
int _pExperience;
int _pMaxExp;
int _pNextExper;
char _pArmorClass;
char _pMagResist;
char _pFireResist;
char _pLghtResist;
int _pGold;
int _pInfraFlag;
int _pVar1;
int _pVar2;
int _pVar3;
int _pVar4;
int _pVar5;
int _pVar6;
int _pVar7;
int _pVar8;
unsigned char _pLvlVisited[NUMLEVELS];
unsigned char _pSLvlVisited[NUMLEVELS]; // only 10 used
int _pGFXLoad;
unsigned char *_pNAnim[8];
int _pNFrames;
int _pNWidth;
unsigned char *_pWAnim[8];
int _pWFrames;
int _pWWidth;
unsigned char *_pAAnim[8];
int _pAFrames;
int _pAWidth;
int _pAFNum;
unsigned char *_pLAnim[8];
unsigned char *_pFAnim[8];
unsigned char *_pTAnim[8];
int _pSFrames;
int _pSWidth;
int _pSFNum;
unsigned char *_pHAnim[8];
int _pHFrames;
int _pHWidth;
unsigned char *_pDAnim[8];
int _pDFrames;
int _pDWidth;
unsigned char *_pBAnim[8];
int _pBFrames;
int _pBWidth;
ItemStruct InvBody[NUM_INVLOC];
ItemStruct InvList[NUM_INV_GRID_ELEM];
int _pNumInv;
char InvGrid[NUM_INV_GRID_ELEM];
ItemStruct SpdList[8];
ItemStruct HoldItem;
int _pIMinDam;
int _pIMaxDam;
int _pIAC;
int _pIBonusDam;
int _pIBonusToHit;
int _pIBonusAC;
int _pIBonusDamMod;
union {
unsigned __int64 _pISpells64;
int _pISpells[2];
};
int _pIFlags;
int _pIGetHit;
char _pISplLvlAdd;
char _pISplCost;
int _pISplDur;
int _pIEnAc;
int _pIFMinDam;
int _pIFMaxDam;
int _pILMinDam;
int _pILMaxDam;
int _pOilType;
unsigned char pTownWarps;
unsigned char pDungMsgs;
unsigned char pLvlLoad;
unsigned char pBattleNet;
unsigned char pManaShield;
char bReserved[3];
short wReserved[8];
int pDiabloKillLevel;
int dwReserved[7];
unsigned char *_pNData;
unsigned char *_pWData;
unsigned char *_pAData;
unsigned char *_pLData;
unsigned char *_pFData;
unsigned char *_pTData;
unsigned char *_pHData;
unsigned char *_pDData;
unsigned char *_pBData;
unsigned int version;
};
struct PlayerStruct2 :PlayerStruct
{
ItemStruct InvListExpanded[4][40];
char InvGridExpanded[4][40];
int NumInvExpanded[4];
int currentInventoryIndex;
};
struct PlayerStruct3 :PlayerStruct2
{
ItemStruct alternateWeapons[2];
int currentWeaponSet;
char walkpath2[100];
};
struct PlayerStruct4 :PlayerStruct3
{
ItemStruct StashInvList[MAX_STASH_TABS][40];
char StashInvGrid[MAX_STASH_TABS][40];
int StashNumInv[MAX_STASH_TABS];
char StashNames[MAX_STASH_TABS][16];
int lastTab;
};
struct PlayerStruct5 :PlayerStruct4
{
int NewSpellHotkeys[12];
int NewSpellTHotkeys[12];
};
struct PlayerStruct6 :PlayerStruct5
{
float cooldowns[100];
};
//////////////////////////////////////////////////
// textdat
//////////////////////////////////////////////////
struct TextDataStruct
{
char *txtstr;
int scrlltxt;
int txtspd;
int sfxnr;
};
//////////////////////////////////////////////////
// missiles
//////////////////////////////////////////////////
// TPDEF PTR FCN VOID MIADDPRC
// TPDEF PTR FCN VOID MIPROC
struct MissileData
{
unsigned char mName;
void(__fastcall *mAddProc)(int, int, int, int, int, int, int, int, int);
void(__fastcall *mProc)(int);
int mDraw;
unsigned char mType;
unsigned char mResist;
unsigned char mFileNum;
int mlSFX;
int miSFX;
};
struct MisFileData
{
unsigned char mAnimName;
unsigned char mAnimFAmt;
char *mName;
int mFlags;
unsigned char *mAnimData[16];
unsigned char mAnimDelay[16];
unsigned char mAnimLen[16];
int mAnimWidth[16];
int mAnimWidth2[16];
};
struct ChainStruct
{
int idx;
int _mitype;
int _mirange;
};
struct MissileStruct
{
int _mitype;
int _mix;
int _miy;
int _mixoff;
int _miyoff;
int _mixvel;
int _miyvel;
int _misx;
int _misy;
int _mitxoff;
int _mityoff;
int _mimfnum;
int _mispllvl;
int _miDelFlag;
int _miAnimType;
int _miAnimFlags;
unsigned char *_miAnimData;
int _miAnimDelay;
int _miAnimLen;
int _miAnimWidth;
int _miAnimWidth2;
int _miAnimCnt;
int _miAnimAdd;
int _miAnimFrame;
int _miDrawFlag;
int _miLightFlag;
int _miPreFlag;
int _miUniqTrans;
int _mirange;
int _misource;
int _micaster;
int _midam;
int _miHitFlag;
int _midist;
int _mlid;
int _mirnd;
int _miVar1;
int _miVar2;
int _miVar3;
int _miVar4;
int _miVar5;
int _miVar6;
int _miVar7;
int _miVar8;
};
//////////////////////////////////////////////////
// effects/sound
//////////////////////////////////////////////////
struct TSnd
{
WAVEFORMATEX fmt;
int len;
int offset;
char *sound_path;
IDirectSoundBuffer *DSB;
int start_tc;
};
struct TSFX
{
unsigned char bFlags;
char *pszName;
TSnd *pSnd;
};
//////////////////////////////////////////////////
// monster
//////////////////////////////////////////////////
struct AnimStruct // note: wrong names
{
unsigned char *CMem;
unsigned char *Frames[8]; // probably Data[8]
int Rate;
int Delay;
};
struct MonsterData
{
int flags; // width?
int mType;
char *GraphicType;
BOOL has_special;
char *sndfile;
int snd_special;
int has_trans;
char *TransFile;
int Frames[6];
int Rate[6];
char *mName;
char mMinDLvl;
char mMaxDLvl;
char mLevel;
int mMinHP;
int mMaxHP;
char mAi;
int mFlags;
unsigned char mInt;
unsigned char mHit;
unsigned char mAFNum;
unsigned char mMinDamage;
unsigned char mMaxDamage;
unsigned char mHit2;
unsigned char mAFNum2;
unsigned char mMinDamage2;
unsigned char mMaxDamage2;
char mArmorClass;
char mMonstClass;
unsigned short mMagicRes;
unsigned short mMagicRes2;
unsigned short mTreasure;
char mSelFlag;
unsigned short mExp;
};
struct CMonster
{
unsigned char mtype;
// TODO: Add enum for place flags
unsigned char mPlaceFlags;
AnimStruct Anims[6];
TSnd *Snds[8];
int flags_1; // width
int flags_2; // width 2
unsigned char mMinHP;
unsigned char mMaxHP;
int has_special;
unsigned char mAFNum;
char mdeadval;
MonsterData *MData;
// A TRN file contains a sequence of colour transitions, represented
// as indexes into a palette. (a 256 byte array of palette indices)
unsigned char *trans_file;
};
struct MonsterStruct // note: missing field _mAFNum
{
int _mMTidx;
int _mmode; /* MON_MODE */
unsigned char _mgoal;
int _mgoalvar1;
int _mgoalvar2;
int _mgoalvar3;
int isActivated;
unsigned char _pathcount;
int _mx;
int _my;
int _mfutx;
int _mfuty;
int _moldx;
int _moldy;
int _mxoff;
int _myoff;
int _mxvel;
int _myvel;
int _mdir;
int _menemy;
unsigned char _menemyx;
unsigned char _menemyy;
short falign_52;
unsigned char *_mAnimData;
int _mAnimDelay;
int _mAnimCnt;
int _mAnimLen;
int _mAnimFrame;
int _meflag;
int _mDelFlag;
int _mVar1;
int _mVar2;
int _mVar3;
int _mVar4;
int _mVar5;
int _mVar6;
int _mVar7;
int _mVar8;
int _mmaxhp;
int _mhitpoints;
unsigned char _mAi;
unsigned char _mint;
short falign_9A;
int _mFlags;
char _msquelch; /* unsigned char */
int falign_A4;
int _lastx;
int _lasty;
int _mRndSeed;
int _mAISeed;
int falign_B8;
unsigned char _uniqtype;
unsigned char _uniqtrans;
char _udeadval;
char mWhoHit;
char mLevel;
unsigned short mExp;
unsigned char mHit;
unsigned char mMinDamage;
unsigned char mMaxDamage;
unsigned char mHit2;
unsigned char mMinDamage2;
unsigned char mMaxDamage2;
char mArmorClass;
char falign_CB;
unsigned short mMagicRes;
int mtalkmsg;
unsigned char leader;
unsigned char leaderflag;
unsigned char unpackfilesize;
unsigned char mlid;
char *mName;
CMonster *MType;
MonsterData *MData;
};
struct UniqMonstStruct
{
char mtype;
char *mName;
char *mMode;
unsigned char mlevel;
unsigned short mmaxhp;
unsigned char mAi;
unsigned char mint;
unsigned char mMinDamage;
unsigned char mMaxDamage;
unsigned short mMagicRes;
unsigned short mUnqAttr;
unsigned char mUnqVar1;
unsigned char mUnqVar2;
int mtalkmsg;
};
//////////////////////////////////////////////////
// objects
//////////////////////////////////////////////////
struct ObjDataStruct
{
char oload;
char ofindex;
char ominlvl;
char omaxlvl;
char olvltype;
char otheme;
char oquest;
int oAnimFlag;
int oAnimDelay;
int oAnimLen;
int oAnimWidth;
int oSolidFlag;
int oMissFlag;
int oLightFlag;
char oBreak;
char oSelFlag;
int oTrapFlag;
};
struct ObjectStruct
{
int _otype;
int _ox;
int _oy;
int _oLight;
int _oAnimFlag;
unsigned char *_oAnimData;
int _oAnimDelay;
int _oAnimCnt;
int _oAnimLen;
int _oAnimFrame;
int _oAnimWidth;
int _oAnimWidth2;
int _oDelFlag;
char _oBreak; // check
int _oSolidFlag;
int _oMissFlag;
char _oSelFlag; // check
int _oPreFlag;
int _oTrapFlag;
int _oDoorFlag;
int _olid;
int _oRndSeed;
int _oVar1;
int _oVar2;
int _oVar3;
int _oVar4;
int _oVar5;
int _oVar6;
int _oVar7;
int _oVar8;
};
//////////////////////////////////////////////////
// portal
//////////////////////////////////////////////////
struct PortalStruct
{
int open;
int x;
int y;
int level;
int ltype;
int setlvl;
};
//////////////////////////////////////////////////
// msg
//////////////////////////////////////////////////
#pragma pack(push, 1)
struct TCmd
{
unsigned char bCmd;
};
struct TCmdLoc
{
unsigned char bCmd;
unsigned char x;