forked from DFHack/df_misc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
df_structs_dbg.h
1262 lines (1113 loc) · 35.1 KB
/
df_structs_dbg.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
#ifdef __METASM__
typedef __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
#endif
#ifdef __cplusplus
#define vector(i) std::vector<i>
#elif !defined(LINUX)
#define vector(i) struct { i* ptr; i* endptr; i* endalloc; int pad; }
typedef struct string {
union {
char buf[16];
char *ptr;
};
int len;
int capa;
int pad;
} string;
#else
#define vector(i) struct { i* ptr; i* endptr; i* endalloc; }
typedef struct string {
char* ptr;
} string;
#endif
typedef struct df_name {
string first_name;
string nick_name;
int32_t words[7];
int16_t parts_of_speech[7];
int32_t language;
int16_t unk;
int8_t has_name;
int8_t pad;
} df_name;
typedef union t_creaturflags1
{
uint32_t whole;
#ifndef NO_CREATURE_FLAGS
struct
{
unsigned int move_state : 1; //!( 0 : Can the dwarf move or are they waiting for their movement timer
unsigned int dead : 1; //!( 1 : Dead (might also be set for incoming/leaving critters that are alive)
unsigned int has_mood : 1; //!( 2 : Currently in mood
unsigned int had_mood : 1; //!( 3 : Had a mood already
unsigned int marauder : 1; //!( 4 : wide class of invader/inside creature attackers
unsigned int drowning : 1; //!( 5 : Is currently drowning
unsigned int merchant : 1; //!( 6 : An active merchant
unsigned int forest : 1; //!( 7 : used for units no longer linked to merchant/diplomacy, they just try to leave mostly
unsigned int left : 1; //!( 8 : left the map
unsigned int rider : 1; //!( 9 : Is riding an another creature
unsigned int incoming : 1; //!( 10
unsigned int diplomat : 1; //!( 11
unsigned int zombie : 1; //!( 12
unsigned int skeleton : 1; //!( 13
unsigned int can_swap : 1; //!( 14: Can swap tiles during movement (prevents multiple swaps)
unsigned int on_ground : 1; //!( 15: The creature is laying on the floor, can be conscious
unsigned int projectile : 1; //!( 16: Launched into the air? Funny.
unsigned int active_invader : 1; //!( 17: Active invader (for organized ones)
unsigned int hidden_in_ambush : 1; //!( 18
unsigned int invader_origin : 1; //!( 19: Invader origin (could be inactive and fleeing)
unsigned int coward : 1; //!( 20: Will flee if invasion turns around
unsigned int hidden_ambusher : 1; //!( 21: Active marauder/invader moving inward?
unsigned int invades : 1; //!( 22: Marauder resident/invader moving in all the way
unsigned int check_flows : 1; //!( 23: Check against flows next time you get a chance
unsigned int ridden : 1; //!( 24
unsigned int caged : 1; //!( 25
unsigned int tame : 1; //!( 26
unsigned int chained : 1; //!( 27
unsigned int royal_guard : 1; //!( 28
unsigned int fortress_guard : 1; //!( 29
unsigned int suppress_wield : 1; //!( 30: Suppress wield for beatings/etc
unsigned int important_historical_figure : 1; //!( 31: Is an important historical figure
} bits;
#endif
} t_creaturflags1;
typedef union t_creaturflags2
{
uint32_t whole;
#ifndef NO_CREATURE_FLAGS
struct
{
unsigned int swimming : 1;
unsigned int sparring : 1;
unsigned int no_notify : 1; //!( Do not notify about level gains (for embark etc)
unsigned int unused : 1;
unsigned int calculated_nerves : 1;
unsigned int calculated_bodyparts : 1;
unsigned int important_historical_figure : 1; //!( Is important historical figure (slight variation)
unsigned int killed : 1; //!( Has been killed by kill function (slightly different from dead, not necessarily violent death)
unsigned int cleanup_1 : 1; //!( Must be forgotten by forget function (just cleanup)
unsigned int cleanup_2 : 1; //!( Must be deleted (cleanup)
unsigned int cleanup_3 : 1; //!( Recently forgotten (cleanup)
unsigned int for_trade : 1; //!( Offered for trade
unsigned int trade_resolved : 1;
unsigned int has_breaks : 1;
unsigned int gutted : 1;
unsigned int circulatory_spray : 1;
unsigned int locked_in_for_trading : 1; //!( Locked in for trading (it's a projectile on the other set of flags, might be what the flying was)
unsigned int slaughter : 1; //!( marked for slaughter
unsigned int underworld : 1; //!( Underworld creature
unsigned int resident : 1; //!( Current resident
unsigned int cleanup_4 : 1; //!( Marked for special cleanup as unused load from unit block on disk
unsigned int calculated_insulation : 1; //!( Insulation from clothing calculated
unsigned int visitor_uninvited : 1; //!( Uninvited guest
unsigned int visitor : 1; //!( visitor
unsigned int calculated_inventory : 1; //!( Inventory order calculated
unsigned int vision_good : 1; //!( Vision -- have good part
unsigned int vision_damaged : 1; //!( Vision -- have damaged part
unsigned int vision_missing : 1; //!( Vision -- have missing part
unsigned int breathing_good : 1; //!( Breathing -- have good part
unsigned int breathing_problem : 1; //!( Breathing -- having a problem
unsigned int roaming_wilderness_population_source : 1;
unsigned int roaming_wilderness_population_source_not_a_map_feature : 1;
} bits;
#endif
} t_creaturflags2;
typedef union t_creaturflags3
{
uint32_t whole;
#ifndef NO_CREATURE_FLAGS
struct
{
unsigned int unk0 : 1; //!( Is 1 for new and dead creatures, periodicaly set to 0 for non-dead creatures.
unsigned int unk1 : 1; //!( Is 1 for new creatures, periodically set to 0 for non-dead creatures.
unsigned int unk2 : 1; //!( Is set to 1 every tick for non-dead creatures.
unsigned int unk3 : 1; //!( Is periodically set to 0 for non-dead creatures.
unsigned int announce_titan : 1; //!( Announces creature like an FB or titan.
unsigned int unk5 : 1;
unsigned int unk6 : 1;
unsigned int unk7 : 1;
unsigned int unk8 : 1; //!( Is set to 1 every tick for non-dead creatures.
unsigned int unk9 : 1; //!( Is set to 0 every tick for non-dead creatures.
unsigned int scuttle : 1; //!( Scuttle creature: causes creature to be killed, leaving a behind corpse and generating negative thoughts like a real kill.
unsigned int unk11 : 1;
unsigned int ghostly : 1; //!( Creature is a ghost.
unsigned int unk13_31 : 19;
} bits;
#endif
} t_creaturflags3;
#define NUM_CREATURE_LABORS 94
#define NUM_CREATURE_TRAITS 30
#define NUM_CREATURE_MENTAL_ATTRIBUTES 13
#define NUM_CREATURE_PHYSICAL_ATTRIBUTES 6
#define MAX_COLORS 15
typedef struct df_attrib
{
uint32_t unk_0;
uint32_t unk_4;
uint32_t unk_8;
uint32_t unk_c;
uint32_t unk_10;
uint32_t unk_14;
uint32_t unk_18;
} df_attrib;
typedef struct df_skill
{
uint16_t id; // 0
int32_t rating; // 4
uint32_t experience; // 8
uint32_t unk_c;
uint32_t rusty; // 10
uint32_t unk_14;
uint32_t unk_18;
uint32_t unk_1c;
} df_skill;
typedef struct df_soul
{
uint32_t creature_id;
df_name name; // 4
uint32_t race;
uint8_t sex;
uint8_t pad_75;
uint16_t unk_76;
int32_t unk_78;
int32_t unk_7c;
int32_t unk_80;
int32_t unk_84;
int32_t unk_88_new;
int32_t unk_8c_new;
int32_t unk_90_new;
int32_t unk_94_new;
df_attrib mental[NUM_CREATURE_MENTAL_ATTRIBUTES]; // 88..1f3
vector(df_skill*) skills; // 1f4;
vector(void*) likes;
uint16_t traits[NUM_CREATURE_TRAITS]; // 214
vector(int16_t*) unk_250; // 1 pointer to 2 shorts
vector(uint32_t) unk_260;
} df_soul;
typedef struct df_reference {
void *vtable;
uint32_t id;
} df_reference;
typedef struct df_jobref {
uint32_t unk_0;
struct df_job* task;
uint32_t unk_8;
} df_jobref;
typedef struct df_item { // item_woodst etc
void *vtable;
int16_t x;
int16_t y;
int16_t z;
int16_t pad_a;
uint32_t flags;
uint32_t age;
uint32_t id;
vector(df_jobref*) inuse;
vector(void*) refs; // general_ref_building_holderst, general_ref_unit_ownerst, general_ref_contained_in_itemst, ...
uint16_t unk_38; // material info ?
uint16_t pad_3a;
uint32_t unk_3c;
uint16_t pad_40;
uint16_t unk_42;
uint16_t unk_44;
uint16_t unk_46;
uint16_t unk_48; // 60000 * 4
uint16_t unk_4a;
uint16_t unk_4c;
uint16_t unk_4e;
uint32_t unk_50;
uint32_t unk_54;
uint32_t stack_size; // 58
uint32_t unk_5c;
uint32_t unk_60;
void *splatter; // 64: vector(df_contaminant*)
uint16_t temperature;
uint16_t temperature_fraction;
uint16_t unk_6c;
uint16_t pad_6e;
uint32_t unk_70;
uint32_t unk_74;
uint32_t unk_78;
uint32_t unk_7c;
} df_item;
struct item_drinkst {
df_item i;
uint16_t material;
uint16_t pad;
uint32_t material_idx;
};
struct item_seedsst {
df_item i;
uint32_t age; // 80: determite growth state
uint32_t unk_84;
};
struct item_plantst {
df_item i;
uint32_t age; // 80: determine withered state
};
// TODO find the base class
struct itemdef_glovesst {
void **vtable;
string name_raw; // ITEM_GLOVES_GLOVES
uint16_t subtype;
uint16_t pad;
string name_singular; // glove
string name_plural; // gloves
uint32_t unk_5c;
uint8_t unk_60;
uint8_t pad_61;
uint16_t unk_62;
void *flagarray_ptr_1; // [0]
uint32_t flagarray_len_1;
uint32_t unk_6c;
void *flagarray_ptr_2; // [33, 1]
uint32_t flagarray_len_2;
uint32_t unk_78;
uint16_t unk_7c;
uint16_t unk_7e;
uint16_t unk_80;
uint16_t pad_82;
};
struct item_glovesst {
df_item i;
uint32_t unk_80; // race idx ? 241
uint32_t unk_84;
int32_t unk_88;
int32_t unk_8c;
vector(void*) itemimprovements; // itemimprovement_threadst / itemimprovement_clothst
struct itemdef_glovest *itemdef; // a0
char *flagarray_ptr;
uint32_t flagarray_len;
};
typedef struct df_job_link
{
struct df_job *job;
struct df_job_link *prev;
struct df_job_link *next;
} df_job_link;
typedef struct df_job_actor
{
void *vtable;
uint32_t id; // creature id (general_ref_unit_workerst)
// building id (general_ref_building_holderst when construct building)
} df_job_actor;
typedef struct df_item_wrap
{
df_item *item; // item_boulderst, etc
uint32_t unk_4;
uint32_t unk_8;
uint32_t unk_c;
} df_item_wrap;
typedef struct df_job_unk94
{
int16_t unk_0;
int16_t unk_2;
int16_t unk_4;
int16_t pad_6;
uint32_t unk_8;
uint32_t unk_c;
uint32_t unk_10;
uint16_t unk_14;
int16_t pad_16;
uint32_t unk_18;
uint32_t unk_1c;
uint32_t unk_20;
uint32_t unk_24;
int32_t unk_28;
string unk_2c;
string unk_48;
int32_t unk_64;
int32_t unk_68;
vector(uint32_t) unk_6c;
int32_t unk_7c;
int16_t unk_80;
int16_t pad_82;
} df_job_unk94;
typedef struct df_job
{
uint32_t job_id;
df_job_link* job_links;
int16_t job_type; // 8: 73 = construct rock coffin, 81 = construct rock block
int16_t pad_a;
int32_t unk_c;
int16_t x;
int16_t y;
int16_t z;
int16_t pad_16;
int32_t counter; // 18: job done when reach -1, decremented on df_creature:job_counter
void* unk_1c;
struct {
uint32_t repeat:1;
uint32_t suspended:1;
uint32_t unk_4:1;
uint32_t active:1; // ?
uint32_t unk:28;
} flags; // 20
int16_t unk_24;
int16_t pad_26;
int32_t unk_28;
int16_t unk_2c;
int16_t unk_2e;
int16_t unk_30;
int16_t pad_32;
uint32_t unk_34;
int32_t unk_38;
uint32_t unk_3c;
string unk_40;
uint32_t unk_5c;
uint32_t unk_60;
vector(df_item_wrap*) materials;
vector(uint32_t) unk_74;
vector(df_job_actor*) actors;
vector(df_job_unk94*) unk_94;
} df_job;
typedef struct df_relationship
{
uint32_t creature_id;
uint32_t unk_4; // 30
uint32_t last_seen; // ? increments every job_counter loop
uint32_t type:2; // 0=longterm acquaintance, 1=friend, 2=grudge, 3=friend
} df_relationship;
typedef struct df_body_layer
{
string name; // 'CHITIN', 'FAT'
uint32_t unk_1c;
uint8_t *unk_20; // ptr to 1 byte, 0 or 1
uint32_t unk_24;
uint32_t unk_28;
uint32_t unk_2c;
uint32_t unk_30;
uint32_t unk_34;
int32_t unk_38;
int16_t unk_3c;
uint16_t pad_3e;
vector(uint32_t) unk_40;
uint32_t unk_50;
int32_t unk_54;
int32_t unk_58;
int32_t unk_5c;
int32_t unk_60;
int32_t unk_64;
int32_t unk_68;
} df_body_layer;
typedef struct df_body_part
{
string abbrev; // 'HD', 'RWING'
string rawname; // 'HEAD', 'WING'
int16_t unk_38;
uint16_t pad_3a;
void *unk_3c;
uint32_t unk_40;
vector(df_body_layer*) layers;
uint32_t unk_54; // 1000
uint32_t unk_58; // 1000
uint32_t unk_5c;
uint32_t unk_60;
uint32_t unk_64; // 500
uint32_t unk_68;
int16_t unk_6c;
vector(string*) name_singular;
vector(string*) name_plural;
} df_body_part;
typedef struct df_building
{
void *vtable;
uint32_t x1;
uint32_t y1;
uint32_t x2;
uint32_t x3;
uint32_t y2;
uint32_t y3;
uint32_t z;
uint32_t height;
int16_t material_type;
uint16_t pad_22;
int32_t material_index;
uint8_t *unk_2c; // room shape?
uint32_t x_min; // left
uint32_t y_min; // top
uint32_t x_width;
uint32_t y_height;
uint32_t age;
uint16_t unk_44;
uint16_t pad_46;
uint32_t id;
vector(df_job*) tasks; // 4c: construct rock bed etc
vector(uint32_t) unk_5c;
vector(uint32_t) unk_6c;
uint8_t is_room;
uint8_t pad_7d;
uint16_t pad_7e;
vector(struct df_building*) covered_buildings; // other buildings inside the room
vector(struct df_building*) associated_buildings; // eg chair -> table
struct df_creature *owner; // a0
vector(uint32_t) unk_a4;
string unk_b4; // NOT the building name (bedroom -> n)
vector(uint32_t) unk_d0;
} df_building;
struct building_doorst {
struct df_building b;
uint32_t unk_e0;
uint32_t unk_e4;
uint32_t unk_e8;
uint32_t unk_ec;
uint32_t unk_f0;
uint32_t unk_f4;
struct {
uint32_t forbid_passage:1;
uint32_t external:1;
uint32_t taken_by_invaders:1;
uint32_t used_by_intruder:1;
uint32_t closed:1; // currently open/closed
uint32_t operated_by_mechanism:1;
uint32_t pet_passable:1;
uint32_t unk:25;
} flags; // f8
};
struct building_farmplotst {
struct df_building b;
uint32_t unk_e0;
uint32_t unk_e4;
uint32_t unk_e8;
uint32_t unk_ec;
uint32_t unk_f0;
uint32_t unk_f4;
uint16_t plantation_program[4]; // per season ; 40 = plump helmet, -1 = nothing
uint32_t unk_100;
struct {
uint32_t season_fert:1;
uint32_t unk:31;
} flags; // 104
uint8_t unk_108;
uint8_t pad_109;
uint16_t pad_10a;
uint32_t unk_10c;
uint32_t unk_110;
uint16_t unk_114;
};
struct building_workshopst {
struct df_building b;
uint32_t unk_e0;
uint32_t unk_e4;
uint32_t unk_e8;
uint32_t unk_ec;
uint32_t unk_f0;
uint32_t unk_f4;
uint16_t workshop_type; // 2 => masonry
vector(uint32_t) workshop_profile_ids; // vector of df_creature id
uint32_t workshop_profile_minproficiency;
uint32_t workshop_profile_maxproficiency; // when set, between 0-15 ; when unset =3000
int32_t unk_114; // -1
int32_t unk_118; // 0
int32_t unk_11c; // -1
};
struct building_tradedepotst {
struct df_building b;
uint32_t unk_e0;
uint32_t unk_e4;
uint32_t unk_e8;
uint32_t unk_ec;
uint32_t unk_f0;
uint32_t unk_f4;
struct {
uint32_t trader_requested:1;
uint32_t anyone_may_trade:1;
uint32_t unk:30;
} flags; // f8
uint32_t pad_fc;
};
struct building_stockpilest {
struct df_building b;
uint32_t category_flags; // 0xe0
// all uint8_t here are flags, eg 0/1
uint8_t animal_empty_cages;
uint8_t animal_empty_traps;
uint16_t pad_e6;
vector(uint8_t) animals;
vector(uint8_t) food_meat; // 0xf8
vector(uint8_t) food_fish;
vector(uint8_t) food_unprepared_fish;
vector(uint8_t) food_egg;
vector(uint8_t) food_plants;
vector(uint8_t) food_drink_plant;
vector(uint8_t) food_drink_animal;
vector(uint8_t) food_cheese_plant;
vector(uint8_t) food_cheese_animal;
vector(uint8_t) food_seeds;
vector(uint8_t) food_leaves;
vector(uint8_t) food_powder_plant;
vector(uint8_t) food_powder_creature;
vector(uint8_t) food_glob;
vector(uint8_t) food_glob_paste;
vector(uint8_t) food_glob_pressed;
vector(uint8_t) food_liquid_plant;
vector(uint8_t) food_liquid_animal;
vector(uint8_t) food_liquid_misc;
uint8_t food_prepared_meals;
uint8_t pad_229;
uint16_t pad_22a;
vector(uint8_t) furniture_type; // 0x22c
vector(uint8_t) furniture_other_mats;
vector(uint8_t) furniture_mats;
uint8_t furniture_quality_core[7];
uint8_t furniture_quality_total[7];
uint8_t furniture_sand_bags;
uint8_t pad_26b;
uint32_t pad_26c;
vector(uint8_t) refuse_type; // 0x270
vector(uint8_t) refuse_corpse;
vector(uint8_t) refuse_body_parts;
vector(uint8_t) refuse_skulls;
vector(uint8_t) refuse_bones;
vector(uint8_t) refuse_shells;
vector(uint8_t) refuse_teeth;
vector(uint8_t) refuse_horns;
vector(uint8_t) refuse_hair;
uint8_t refuse_fresh_raw_hide;
uint8_t refuse_rotten_raw_hide;
uint16_t pad_302;
vector(uint8_t) stone; // 0x304
vector(uint8_t) unk_314;
vector(uint8_t) ammo_type; // 0x324
vector(uint8_t) ammo_other_mats;
vector(uint8_t) ammo_mats;
uint8_t ammo_quality_core[7];
uint8_t ammo_quality_total[7];
uint16_t pad_362;
vector(uint8_t) coins; // 0x364
vector(uint8_t) bars_other_mats; // 0x374
vector(uint8_t) blocks_other_mats;
vector(uint8_t) bars_mats;
vector(uint8_t) blocks_mats;
vector(uint8_t) gems_rough_other_mats;
vector(uint8_t) gems_cut_other_mats;
vector(uint8_t) gems_rough_mats;
vector(uint8_t) gems_cut_mats;
vector(uint8_t) finished_goods_type; // 0x3f4
vector(uint8_t) finished_goods_other_mats;
vector(uint8_t) finished_goods_mats;
uint8_t finished_goods_quality_core[7];
uint8_t finished_goods_quality_total[7];
uint16_t pad_432;
vector(uint8_t) leather; // 0x434
vector(uint8_t) cloth_thread_silk;
vector(uint8_t) cloth_thread_plant;
vector(uint8_t) cloth_thread_yarn;
vector(uint8_t) cloth_thread_metal;
vector(uint8_t) cloth_cloth_silk;
vector(uint8_t) cloth_cloth_plant;
vector(uint8_t) cloth_cloth_yarn;
vector(uint8_t) cloth_cloth_metal;
vector(uint8_t) wood; // 0x4c4
vector(uint8_t) weapon_weapon_type;
vector(uint8_t) weapon_trapcomp_type;
vector(uint8_t) weapon_other_mats;
vector(uint8_t) weapon_mats;
uint8_t weapons_quality_core[7];
uint8_t weapons_quality_total[7];
uint8_t weapons_usable;
uint8_t weapons_unusable;
vector(uint8_t) armor_body; // 0x524
vector(uint8_t) armor_head;
vector(uint8_t) armor_feet;
vector(uint8_t) armor_hands;
vector(uint8_t) armor_legs;
vector(uint8_t) armor_shield;
vector(uint8_t) armor_other_mats;
vector(uint8_t) armor_mats;
uint8_t armor_quality_core[7];
uint8_t armor_quality_total[7];
uint8_t armor_usable;
uint8_t armor_unusable;
uint8_t allow_organic; // 0x5b4
uint8_t allow_inorganic;
uint16_t pad_5b6;
uint16_t max_barrels; // 5b8
uint16_t max_bins;
vector(uint32_t) unk_5bc;
vector(uint32_t) unk_5cc;
vector(uint32_t) unk_5dc;
vector(uint16_t) unk_5ec;
df_building *give_to;
vector(df_building*) take_from;
uint32_t stockpile_number;
};
typedef struct df_unit_unk_evt {
uint16_t type; // 13 => sober_since: "he needs alcohol to get through the working day" (value=age), 15 => death_seen: "getting used to tragedy" (value=degree)
uint16_t unk_2;
uint32_t value; // may be decremented/incremented every tick (depends on the type)
// if decrements, evt is deleted at 0
} df_unit_unk_evt;
typedef struct df_unit_recentevent {
uint16_t type;
uint16_t pad_2;
uint32_t age; // tick count
int32_t type_param1; // type=128 (admired a) p1=what (0=seat, 1=bed..)
uint32_t type_param2; // type=128 p2=quality (0..50=fine, 150=very fine, 15000=completely sublime)
uint16_t unk_10; // set for 'admired a very fine well' / 'made a friend'
uint16_t unk_12; // set for 'admired fine well'
} df_unit_recentevent;
typedef struct df_unit_spatter {
uint16_t material_type;
uint16_t pad_2;
int32_t material_subtype;
int16_t material_state; // 0=frozen 1=liquid 2=gas 3=powder 4=paste 5=pressed
int16_t temperature;
int16_t unk_c;
int16_t pad_e;
int32_t quantity;
int16_t bodypart_idx;
int16_t unk_16; // body_plan_index ? cant find stuff if != 1 on a dwarf
} df_unit_spatter;
typedef struct df_creature_pregnancy {
uint8_t *unk_0;
uint16_t size_of_unk0; // dwarf: 32 uint8
uint16_t pad_6;
uint16_t *unk_8;
uint16_t size_of_unk8; // dwarf: 10 uint16
uint16_t pad_e;
} df_creature_pregnancy;
typedef struct df_creature
{
df_name name; // 0
string custom_profession; // 6c (MSVC)
uint16_t profession; // 88
uint16_t profession_bis; // 8a
uint32_t race; // 8c
int16_t x; // 90
int16_t y; // 92
int16_t z; // 94
int16_t unk_x96; // 96
int16_t unk_y98; // 98
int16_t unk_z9a; // 9a
uint32_t unk_9c;
int16_t unk_a0;
uint16_t pad_a2;
uint16_t unk_a4;
uint16_t unk_a6;
int16_t dest_x; // a8
int16_t dest_y; // aa
int16_t dest_z; // ac
int16_t unk_ae; // -1
vector(uint16_t) path_x;
vector(uint16_t) path_y;
vector(uint16_t) path_z;
t_creaturflags1 flags1; // e0
t_creaturflags2 flags2; // e4
t_creaturflags3 flags3; // e8
int8_t unk_ec;
uint8_t pad_ed;
uint16_t pad_ee;
int32_t unk_f0;
int16_t unk_f4;
int16_t pad_f6;
uint16_t caste; // f8
uint8_t sex; // fa
uint8_t pad_fb;
uint32_t id; // fc
uint16_t unk_100;
uint16_t pad_102;
int32_t unk_104;
uint32_t civ; // 108
int32_t unk_10c;
int32_t unk_110;
int32_t unk_114_new;
vector(uint32_t) unk_114;
vector(uint32_t) unk_124;
vector(uint32_t) unk_134;
uint32_t unk_144;
vector(void*) unk_148;
vector(df_reference*) nemesis; // dwarves have a vector of 1 entry of general_ref_is_nemesisst with their own creature_id XXX mmh, in fact no
int32_t squad_index; // 168: which squad is this dwarf in?
int32_t squad_position; // 16c: order inside the squad
uint32_t unk_170;
uint32_t draft_timer; // increments every tick while on duty/carrying order?
uint16_t unk_178;
uint16_t pad_17a;
vector(uint32_t) unk_17c; // item ids
vector(uint32_t) unk_18c;
vector(uint32_t) unk_19c;
vector(uint32_t) unk_1ac;
uint32_t pickup_equipment_bit; // 1bc
vector(uint32_t) unk_1c0; // 1c0/1d0: military/civ inventory?
vector(uint32_t) unk_1d0;
vector(uint32_t) unk_1e0;
int32_t unk_1f0;
int16_t unk_1f4;
uint16_t pad_1f6;
int32_t unk_1f8;
int32_t unk_1fc;
int32_t unk_200;
int16_t unk_204;
uint16_t pad_206;
uint32_t unk_208; // damage/fleeing? (hunted creature hit)
uint32_t unk_20c;
int16_t mood; // 210
uint16_t unk_212;
uint32_t pregnancy_timer; // 214
df_creature_pregnancy* pregnancy_ptr; // 218
int16_t unk_21c;
int16_t unk_21e;
void* unk_220; // set on ghost?
int32_t unk_228_new;
uint32_t birth_year; // 224
uint32_t birth_time; // 228
int32_t unk_234_new;
int32_t unk_238_new;
uint32_t unk_23c_new;
uint32_t unk_240_new;
uint32_t unk_22c;
uint32_t unk_230;
struct df_creature* following; // try to get on the same pos as this creature
uint16_t unk_238;
uint16_t pad_23a;
int32_t unk_23c;
int32_t married_id; // 240: not used in relationship screen..
int32_t mother_id; // 244: idem
int32_t father_id; // 248: idem
int32_t unk_24c;
int32_t unk_250;
int32_t unk_254;
int32_t unk_258;
int32_t unk_25c_mother; // mother id again?
int32_t lover_id;
int16_t unk_264;
int16_t pad_266;
int32_t unk_268;
int32_t unk_26c;
int16_t unk_270;
int16_t pad_272;
int32_t unk_274;
int32_t unk_278;
int32_t unk_27c;
int16_t unk_280;
uint16_t pad_282;
int32_t unk_284;
vector(df_item_wrap*) inventory; // 288 - vector of item pointers
vector(int32_t) owned_items; // 298 - vector of item IDs
vector(uint32_t) unk_2a8;
vector(df_building*) owned_buildings; // 2b8 - make room, assign -> added here
vector(uint32_t) unk_2c8;
uint32_t unk_2d8;
uint32_t unk_2dc;
struct df_creature *hunt_target; // 2e0
uint32_t unk_2e4;
int16_t unk_2e8; // fight related
int16_t unk_2ea; // fight related
uint16_t unk_2ec;
uint16_t unk_2ee;
uint16_t unk_2f0_cntr; // increments every tick
uint16_t pad_2f2;
df_job * current_job; // 2f4
uint16_t unk_2f8;
uint16_t pad_2fa;
uint32_t unk_2fc;
uint32_t unk_300;
uint32_t unk_304;
vector(uint32_t) unk_308; // 87*0 ?
vector(uint32_t) unk_318;
vector(uint32_t) unk_328;
vector(uint32_t) unk_338; // 238*0
vector(uint32_t) unk_348; // 238*0
vector(uint32_t) unk_358; // 238*0
vector(uint32_t) unk_368; // 238*0
vector(uint32_t) unk_378; // 238*0
vector(uint32_t) unk_388;
uint32_t unk_398;
int32_t unk_39c;
int32_t unk_3a0;
int32_t unk_3a4;
int32_t unk_3a8;
int32_t unk_3ac;
int32_t unk_3b0;
int32_t unk_3b4;
int32_t unk_3b8;
int32_t unk_3bc;
int32_t unk_3c0;
void *body_plan; // vector(df_body_part*)* body_plan; // points into a giant chunk, raws?
uint16_t unk_3c8;
uint16_t pad_3ca;
df_attrib physical[NUM_CREATURE_PHYSICAL_ATTRIBUTES]; // 3cc..473
uint32_t unk_474;
uint32_t unk_478;
uint32_t unk_47c;
uint32_t unk_480;
uint32_t unk_484;
uint32_t unk_488;
uint32_t blood_max;
uint32_t blood_count; // 490
uint32_t unk_494;
vector(df_unit_spatter*) spatters;
vector(uint16_t) unk_4a8;
vector(uint16_t) unk_4b8;
uint32_t unk_4c8;
vector(int16_t) unk_4cc;
vector(int32_t) unk_4dc;
vector(int32_t) unk_4ec;
vector(int32_t) unk_4fc;
vector(uint16_t) unk_50c;
void* unk_51c;
uint16_t unk_520;
uint16_t* unk_524;
uint16_t unk_528;
uint16_t pad_52a;
vector(uint32_t) appearance; // 52c
int32_t think_counter; // 53c decrements every job_counter reroll, set when changing jobs
int32_t job_counter; // 540 current_job unit/walk done when reach -1, decremented every tick
int32_t unk_544; // if set, decrements every job_counter reroll
int16_t unk_548;
int16_t pad_54a_new;
int32_t unk_564_new;
int16_t winded;
int16_t stunned; // 54c decrements every tick, unstun at 0
int16_t unconscious;
int16_t unk_550;
int16_t webbed;
int16_t unk_x554; // coords ? (-30.000x3)
int16_t unk_y556;
int16_t unk_z558;
int16_t unk_x55a; // coords again
int16_t unk_y55c;
int16_t unk_z55e;
int16_t unk_560;
int16_t unk_562;
uint32_t unk_564;
uint32_t unk_568;
uint32_t unk_56c;
uint32_t unk_570;
uint32_t unk_574;
uint32_t unk_578;
uint32_t unk_57c;
uint8_t unk_5a0_new;
uint8_t pad_5a1_new;