forked from DFHack/df-structures
-
Notifications
You must be signed in to change notification settings - Fork 0
/
df.units.xml
1585 lines (1315 loc) · 68.2 KB
/
df.units.xml
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
<data-definition>
<bitfield-type type-name='unit_flags1' base-type='uint32_t'>
<flag-bit name='move_state'
comment='Can the dwarf move or are they waiting for their movement timer'/>
<flag-bit name='dead'
comment='Dead (might also be set for incoming/leaving critters that are alive)'/>
<flag-bit name='has_mood' comment='Currently in mood'/>
<flag-bit name='had_mood' comment='Had a mood already'/>
<flag-bit name='marauder' comment='wide class of invader/inside creature attackers'/>
<flag-bit name='drowning' comment='Is currently drowning'/>
<flag-bit name='merchant' comment='An active merchant'/>
<flag-bit name='forest'
comment='used for units no longer linked to merchant/diplomacy, they just try to leave mostly'/>
<flag-bit name='left' comment='left the map'/>
<flag-bit name='rider' comment='Is riding an another creature'/>
<flag-bit name='incoming'/>
<flag-bit name='diplomat'/>
<flag-bit name='zombie'/>
<flag-bit name='skeleton'/>
<flag-bit name='can_swap' comment='Can swap tiles during movement (prevents multiple swaps)'/>
<flag-bit name='on_ground' comment='The creature is laying on the floor, can be conscious'/>
<flag-bit name='projectile' comment='Launched into the air? Funny.'/>
<flag-bit name='active_invader' comment='Active invader (for organized ones)'/>
<flag-bit name='hidden_in_ambush'/>
<flag-bit name='invader_origin' comment='Invader origin (could be inactive and fleeing)'/>
<flag-bit name='coward' comment='Will flee if invasion turns around'/>
<flag-bit name='hidden_ambusher' comment='Active marauder/invader moving inward?'/>
<flag-bit name='invades' comment='Marauder resident/invader moving in all the way'/>
<flag-bit name='check_flows' comment='Check against flows next time you get a chance'/>
<flag-bit name='ridden'/>
<flag-bit name='caged'/>
<flag-bit name='tame'/>
<flag-bit name='chained'/>
<flag-bit name='royal_guard'/>
<flag-bit name='fortress_guard'/>
<flag-bit name='suppress_wield'/>
<flag-bit name='important_historical_figure' comment='Is an important historical figure'/>
</bitfield-type>
<bitfield-type type-name='unit_flags2' base-type='uint32_t'>
<flag-bit name='swimming'/>
<flag-bit name='sparring'/>
<flag-bit name='no_notify' comment='Do not notify about level gains (for embark etc)'/>
<flag-bit name='unused'/>
<flag-bit name='calculated_nerves'/>
<flag-bit name='calculated_bodyparts'/>
<flag-bit name='important_historical_figure'
comment='Is important historical figure (slight variation)'/>
<flag-bit name='killed'
comment='Has been killed by kill function (slightly different from dead, not necessarily violent death)'/>
<flag-bit name='cleanup_1' comment='Must be forgotten by forget function (just cleanup)'/>
<flag-bit name='cleanup_2' comment='Must be deleted (cleanup)'/>
<flag-bit name='cleanup_3' comment='Recently forgotten (cleanup)'/>
<flag-bit name='for_trade' comment='Offered for trade'/>
<flag-bit name='trade_resolved'/>
<flag-bit name='has_breaks'/>
<flag-bit name='gutted'/>
<flag-bit name='circulatory_spray'/>
<flag-bit name='locked_in_for_trading'
comment="Locked in for trading (it's a projectile on the other set of flags, might be what the flying was)"/>
<flag-bit name='slaughter' comment='marked for slaughter'/>
<flag-bit name='underworld' comment='Underworld creature'/>
<flag-bit name='resident' comment='Current resident'/>
<flag-bit name='cleanup_4'
comment='Marked for special cleanup as unused load from unit block on disk'/>
<flag-bit name='calculated_insulation' comment='Insulation from clothing calculated'/>
<flag-bit name='visitor_uninvited' comment='Uninvited guest'/>
<flag-bit name='visitor'/>
<flag-bit name='calculated_inventory' comment='Inventory order calculated'/>
<flag-bit name='vision_good' comment='Vision -- have good part'/>
<flag-bit name='vision_damaged' comment='Vision -- have damaged part'/>
<flag-bit name='vision_missing' comment='Vision -- have missing part'/>
<flag-bit name='breathing_good' comment='Breathing -- have good part'/>
<flag-bit name='breathing_problem' comment='Breathing -- having a problem'/>
<flag-bit name='roaming_wilderness_population_source'/>
<flag-bit name='roaming_wilderness_population_source_not_a_map_feature'/>
</bitfield-type>
<bitfield-type type-name='unit_flags3' base-type='uint32_t'>
<flag-bit name='body_part_relsize_computed'/>
<flag-bit name='size_modifier_computed'/>
<flag-bit name='stuck_weapon_computed' comment='cleared if removing StuckIn item to recompute wound flags.'/>
<flag-bit name='compute_health' comment='causes the health structure to be created or updated'/>
<flag-bit name='announce_titan' comment='Announces creature like an FB or titan.'/>
<flag-bit name='unk5'/>
<flag-bit name='on_crutch'/>
<flag-bit name='weight_computed'/>
<flag-bit name='body_temp_in_range' comment='Is set to 1 every tick for non-dead creatures.'/>
<flag-bit name='wait_until_reveal' comment='Blocks all kind of things until tile is revealed.'/>
<flag-bit name='scuttle'>
<comment>
Scuttle creature: causes creature to be killed, leaving a behind
corpse and generating negative thoughts like a real kill.
</comment>
</flag-bit>
<flag-bit name='unk11'/>
<flag-bit name='ghostly'/>
<flag-bit name='unk13'/>
<flag-bit name='unk14'/>
<flag-bit name='unk15' comment='dropped when znew >= zold'/>
<flag-bit name='unk16' comment='something to do with werewolves?'/>
<flag-bit name='no_meandering' comment='for active_invaders'/>
<flag-bit name='floundering'/>
<flag-bit name='exit_vehicle1' comment='trapavoid'/>
<flag-bit name='exit_vehicle2' comment='trapavoid'/>
<flag-bit name='dangerous_terrain'/>
<flag-bit name='unk22'/>
<flag-bit name='unk23'/>
</bitfield-type>
<enum-type type-name='personality_facet_type'>
<enum-item name='ANXIETY'/>
<enum-item name='ANGER'/>
<enum-item name='DEPRESSION'/>
<enum-item name='SELF_CONSCIOUSNESS'/>
<enum-item name='IMMODERATION'/>
<enum-item name='VULNERABILITY'/>
<enum-item name='FRIENDLINESS'/>
<enum-item name='GREGARIOUSNESS'/>
<enum-item name='ASSERTIVENESS'/>
<enum-item name='ACTIVITY_LEVEL'/>
<enum-item name='EXCITEMENT_SEEKING'/>
<enum-item name='CHEERFULNESS'/>
<enum-item name='IMAGINATION'/>
<enum-item name='ARTISTIC_INTEREST'/>
<enum-item name='EMOTIONALITY'/>
<enum-item name='ADVENTUROUSNESS'/>
<enum-item name='INTELLECTUAL_CURIOSITY'/>
<enum-item name='LIBERALISM'/>
<enum-item name='TRUST'/>
<enum-item name='STRAIGHTFORWARDNESS'/>
<enum-item name='ALTRUISM'/>
<enum-item name='COOPERATION'/>
<enum-item name='MODESTY'/>
<enum-item name='SYMPATHY'/>
<enum-item name='SELF_EFFICACY'/>
<enum-item name='ORDERLINESS'/>
<enum-item name='DUTIFULNESS'/>
<enum-item name='ACHIEVEMENT_STRIVING'/>
<enum-item name='SELF_DISCIPLINE'/>
<enum-item name='CAUTIOUSNESS'/>
</enum-type>
<enum-type type-name='physical_attribute_type'>
<enum-item name='STRENGTH'/>
<enum-item name='AGILITY'/>
<enum-item name='TOUGHNESS'/>
<enum-item name='ENDURANCE'/>
<enum-item name='RECUPERATION'/>
<enum-item name='DISEASE_RESISTANCE'/>
</enum-type>
<enum-type type-name='mental_attribute_type'>
<enum-item name='ANALYTICAL_ABILITY'/>
<enum-item name='FOCUS'/>
<enum-item name='WILLPOWER'/>
<enum-item name='CREATIVITY'/>
<enum-item name='INTUITION'/>
<enum-item name='PATIENCE'/>
<enum-item name='MEMORY'/>
<enum-item name='LINGUISTIC_ABILITY'/>
<enum-item name='SPATIAL_SENSE'/>
<enum-item name='MUSICALITY'/>
<enum-item name='KINESTHETIC_SENSE'/>
<enum-item name='EMPATHY'/>
<enum-item name='SOCIAL_AWARENESS'/>
</enum-type>
<enum-type type-name='mood_type' base-type='int16_t'>
<enum-item name='None' value='-1'/>
<enum-item name='Fey'/>
<enum-item name='Secretive'/>
<enum-item name='Possessed'/>
<enum-item name='Macabre'/>
<enum-item name='Fell'/>
<enum-item name='Melancholy'/>
<enum-item name='Raving'/>
<enum-item name='Berserk'/>
<enum-item name='Baby'/>
<enum-item name='Traumatized'/>
</enum-type>
<enum-type type-name='ghost_type' base-type='int16_t'>
<enum-item name='MurderousGhost'/>
<enum-item name='SadisticGhost'/>
<enum-item name='SecretivePoltergeist'/>
<enum-item name='EnergeticPoltergeist'/>
<enum-item name='AngryGhost'/>
<enum-item name='ViolentGhost'/>
<enum-item name='MoaningSpirit'/>
<enum-item name='HowlingSpirit'/>
<enum-item name='TroublesomePoltergeist'/>
<enum-item name='RestlessHaunt'/>
<enum-item name='ForlornHaunt'/>
</enum-type>
<enum-type type-name='animal_training_level' base-type='int32_t'>
<enum-item name='SemiWild'/>
<enum-item name='Trained'/>
<enum-item name='WellTrained'/>
<enum-item name='SkilfullyTrained'/>
<enum-item name='ExpertlyTrained'/>
<enum-item name='ExceptionallyTrained'/>
<enum-item name='MasterfullyTrained'/>
<enum-item name='Domesticated'/>
<enum-item name='Unk8'/>
<enum-item name='WildUntamed'
comment='Seems to be used as default when not flags1.tame'/>
</enum-type>
<enum-type type-name='unit_report_type' base-type='int16_t'>
<enum-item name='Combat'/>
<enum-item name='Sparring'/>
<enum-item name='Hunting'/>
</enum-type>
<enum-type type-name='skill_rating' base-type='int32_t'>
<enum-attr name='xp_threshold' type-name='uint32_t'/>
<enum-attr name='caption'/>
<enum-item name='Dabbling'>
<item-attr name='xp_threshold' value='500'/>
<item-attr name='caption' value='Dabbling'/>
</enum-item>
<enum-item name='Novice'>
<item-attr name='xp_threshold' value='600'/>
<item-attr name='caption' value='Novice'/>
</enum-item>
<enum-item name='Adequate'>
<item-attr name='xp_threshold' value='700'/>
<item-attr name='caption' value='Adequate'/>
</enum-item>
<enum-item name='Competent'>
<item-attr name='xp_threshold' value='800'/>
<item-attr name='caption' value='Competent'/>
</enum-item>
<enum-item name='Skilled'>
<item-attr name='xp_threshold' value='900'/>
<item-attr name='caption' value='Skilled'/>
</enum-item>
<enum-item name='Proficient'>
<item-attr name='xp_threshold' value='1000'/>
<item-attr name='caption' value='Proficient'/>
</enum-item>
<enum-item name='Talented'>
<item-attr name='xp_threshold' value='1100'/>
<item-attr name='caption' value='Talented'/>
</enum-item>
<enum-item name='Adept'>
<item-attr name='xp_threshold' value='1200'/>
<item-attr name='caption' value='Adept'/>
</enum-item>
<enum-item name='Expert'>
<item-attr name='xp_threshold' value='1300'/>
<item-attr name='caption' value='Expert'/>
</enum-item>
<enum-item name='Professional'>
<item-attr name='xp_threshold' value='1400'/>
<item-attr name='caption' value='Professional'/>
</enum-item>
<enum-item name='Accomplished'>
<item-attr name='xp_threshold' value='1500'/>
<item-attr name='caption' value='Accomplished'/>
</enum-item>
<enum-item name='Great'>
<item-attr name='xp_threshold' value='1600'/>
<item-attr name='caption' value='Great'/>
</enum-item>
<enum-item name='Master'>
<item-attr name='xp_threshold' value='1700'/>
<item-attr name='caption' value='Master'/>
</enum-item>
<enum-item name='HighMaster'>
<item-attr name='xp_threshold' value='1800'/>
<item-attr name='caption' value='High Master'/>
</enum-item>
<enum-item name='GrandMaster'>
<item-attr name='xp_threshold' value='1900'/>
<item-attr name='caption' value='Grand Master'/>
</enum-item>
<enum-item name='Legendary'>
<item-attr name='xp_threshold' value='2000'/>
<item-attr name='caption' value='Legendary'/>
</enum-item>
<enum-item name='Legendary1'>
<item-attr name='xp_threshold' value='2100'/>
<item-attr name='caption' value='Legendary+1'/>
</enum-item>
<enum-item name='Legendary2'>
<item-attr name='xp_threshold' value='2200'/>
<item-attr name='caption' value='Legendary+2'/>
</enum-item>
<enum-item name='Legendary3'>
<item-attr name='xp_threshold' value='2300'/>
<item-attr name='caption' value='Legendary+3'/>
</enum-item>
<enum-item name='Legendary4'>
<item-attr name='xp_threshold' value='2400'/>
<item-attr name='caption' value='Legendary+4'/>
</enum-item>
<enum-item name='Legendary5'>
<item-attr name='caption' value='Legendary+5'/>
</enum-item>
</enum-type>
<enum-type type-name='unit_relationship_type' base-type='int16_t' comment='Used in unit.relations'>
<enum-item name='Pet'/>
<enum-item name='Spouse'/>
<enum-item name='Mother'/>
<enum-item name='Father'/>
<enum-item name='LastAttacker'/>
<enum-item name='GroupLeader'/>
<enum-item name='Dragee'/>
<enum-item name='Dragger'/>
<enum-item name='RiderMount'/>
<enum-item name='Lover'/>
<enum-item name='unk10'/>
<enum-item name='unk11'/>
<enum-item name='Child'/>
<enum-item name='Friend'/>
<enum-item name='Grudge'/>
<enum-item name='Worship'/>
<enum-item name='AcquaintanceLong'/>
<enum-item name='AcquaintancePassing'/>
<enum-item name='Bonded'/>
</enum-type>
<struct-type type-name='unit' key-field='id' instance-vector='$global.world.units.all'>
<compound type-name='language_name' name='name'/>
<code-helper name='describe'>
(describe-obj $.name)
(awhen (find-creature $.race)
(fmt "~:(~A ~A~)" $it.caste[$.caste].caste_id $it.creature_id))
</code-helper>
<stl-string name='custom_profession'/>
<enum base-type='int16_t' name='profession' type-name='profession' init-value='STANDARD'/>
<enum base-type='int16_t' name='profession2' type-name='profession' init-value='STANDARD'/>
<int32_t name='race' ref-target='creature_raw'/>
<compound name='pos' type-name='coord'/>
<compound name='idle_area' type-name='coord'>
<comment>
E.g. for a dead miner, holds the place where he
was likely hanging around when he got the command
to mine in an aquifer.
</comment>
</compound>
<int32_t name='idle_area_threshold' init-value='3'/>
<enum base-type='int16_t' name='idle_area_type' type-name='unit_station_type'/>
<int32_t name='follow_distance'/>
<compound name='path'>
<compound name='dest' type-name='coord'/>
<enum base-type='int16_t' name='goal' type-name='unit_path_goal'/>
<compound name='path' type-name='coord_path'/>
</compound>
<compound name='flags1' type-name='unit_flags1'/>
<compound name='flags2' type-name='unit_flags2'/>
<compound name='flags3' type-name='unit_flags3'/>
<compound name='meeting'>
<enum name='state' base-type='int8_t'>
<enum-item name="SelectNoble" value="0"/>
<enum-item name="FollowNoble" value="1"/>
<enum-item name="DoMeeting" value="2"/>
<enum-item name="LeaveMap" value="3"/>
</enum>
<int32_t name='target_entity' ref-target='historical_entity'/>
<enum name='target_role' type-name='entity_position_responsibility' base-type='int16_t'/>
<padding size='2'/>
</compound>
<int16_t name='caste' ref-target='caste_raw' aux-value='$$.race'/>
<int8_t name='sex' init-value='-1' comment='-1 n/a, 0 female, 1 male'/>
<int32_t name='id'/>
<int16_t name='unk_100'/>
<enum name='training_level' base-type='int32_t'
type-name='animal_training_level' init-value='WildUntamed'/>
<int32_t name='schedule_id' ref-target='schedule_info'/>
<int32_t name='civ_id' ref-target='historical_entity'/>
<int32_t name='population_id' ref-target='entity_population'/>
<int32_t name='unk_c0' comment='v0.34.01' init-value='-1'/>
<int32_t name='invasion_id' ref-target='invasion_info'/>
<int32_t name='unk_c8' init-value='-1' comment='v0.40.01'/>
<compound name='patrol_route' type-name='coord_path'
comment='used by necromancers for corpse locations, siegers etc'/>
<int32_t name='patrol_index' comment='from 23a'/>
<stl-vector name='specific_refs' pointer-type='specific_ref'/>
<stl-vector name='general_refs' pointer-type='general_ref'/>
<compound name='military'>
<int32_t name='squad_id' ref-target='squad'/>
<int32_t name='squad_position' init-value='-1'/>
<int32_t name='patrol_cooldown'/>
<int32_t name='patrol_timer'/>
<int16_t name='cur_uniform'/>
<stl-vector name='unk_items' type-name='int32_t'
ref-target='item' comment='v0.34.06'/>
<static-array name='uniforms' count='4'>
<stl-vector type-name='int32_t' ref-target='item'/>
</static-array>
<bitfield name='pickup_flags'>
<flag-bit name='update'/>
</bitfield>
<stl-vector name='uniform_pickup' type-name='int32_t' ref-target='item'/>
<stl-vector name='uniform_drop' type-name='int32_t' ref-target='item'/>
<stl-vector name='individual_drills' type-name='int32_t' ref-target='activity_entry'/>
</compound>
<stl-vector comment='v0.40.01'/>
<stl-vector comment='v0.40.01'/>
<stl-vector comment='v0.40.01'/>
<stl-vector comment='v0.40.01'/>
<compound name='animal'>
<compound name='population' type-name='world_population_ref'/>
<int32_t name='leave_countdown'
comment='once 0, it heads for the edge and leaves'/>
<int32_t name='vanish_countdown' comment='once 0, it vanishes in a puff of smoke'/>
</compound>
<int32_t comment='v0.40.01'/>
<compound type-name='coord' comment='v0.40.01'/>
<int32_t comment='v0.40.01'/>
<enum base-type='int16_t' name='mood' type-name='mood_type' init-value='None'/>
<int16_t name='unk_18e'/>
<compound name='relations'>
<uint32_t name='pregnancy_timer'/>
<pointer name='pregnancy_genes' type-name='unit_genes' comment='genes from mate'/>
<int16_t name='pregnancy_caste' init-value='-1' comment='caste of mate'
ref-target='caste_raw' aux-value='$$._global.race'/>
<int32_t comment='v0.40.01'/>
<enum base-type='int16_t' name='mood_copy' type-name='mood_type' init-value='None'
comment='copied from mood type upon entering strange mood'/>
<pointer name='ghost_info' type-name='unit_ghost_info'/>
<int32_t init-value='-1' comment='v0.34.01'/>
<int32_t name='birth_year' init-value='-1'/>
<int32_t name='birth_time' init-value='-1'/>
<int32_t name='curse_year' init-value='-1' comment='v0.34.01'/>
<int32_t name='curse_time' init-value='-1' comment='v0.34.01'/>
<int32_t name='birth_year_bias' init-value='0' comment='v0.34.01'/>
<int32_t name='birth_time_bias' init-value='0' comment='v0.34.01'/>
<int32_t name='old_year' init-value='-1' comment='could there be a death of old age time??'/>
<int32_t name='old_time' init-value='-1'/>
<pointer type-name='unit' name='following'/>
<uint16_t name='unk_238' comment='invalid unless following'/>
This should be a static-array, size 10, with index-enum unit_relationship_type; will likely need to fix plugins and scripts
<int32_t name='pet_owner_id' ref-target='unit'/>
<int32_t name='spouse_id' ref-target='unit'
comment='not used in relationship screen..'/>
<int32_t name='mother_id' ref-target='unit'/>
<int32_t name='father_id' ref-target='unit'/>
<int32_t name='last_attacker_id' ref-target='unit'/>
<int32_t name='group_leader_id' ref-target='unit'
comment='used by goblins, adv mode companions etc'/>
<int32_t name='draggee_id' ref-target='unit'
comment='unit being dragged by this one'/>
<int32_t name='dragger_id' ref-target='unit'
comment='unit that drags this one'/>
<int32_t name='rider_mount_id' ref-target='unit'/>
<int32_t name='lover_id' ref-target='unit'/>
<int16_t name='mount_type' comment='0 = riding, 1 = being carried, 2/3 = wagon horses, 4 = wagon merchant'/>
</compound>
<compound name='last_hit' type-name='history_hit_item'/>
<int32_t name='riding_item_id' ref-target='item' comment='v0.34.08'/>
<stl-vector name='inventory' pointer-type='unit_inventory_item'/>
<stl-vector name='owned_items' type-name='int32_t' ref-target='item'/>
<stl-vector name='traded_items' comment='items brought to trade depot' type-name='int32_t' ref-target='item'/>
<stl-vector name='owned_buildings' pointer-type='building'/>
<stl-vector name='corpse_parts' comment='entries remain even when items are destroyed' type-name='int32_t' ref-target='item'/>
<compound name='job'>
<int32_t name='account'/>
<int32_t name='satisfaction' comment='amount earned recently for jobs'/>
<pointer type-name='unit' name='hunt_target'/>
<pointer type-name='building' name='destroy_target'/>
<int32_t comment='v0.40.01'/>
<int32_t comment='v0.40.01'/>
<int32_t comment='v0.40.01'/>
<int32_t comment='v0.40.01'/>
<int8_t comment='v0.40.01'/>
<int32_t comment='v0.40.01'/>
<!--
<compound name='last_attack_dir' type-name='coord2d'/>
<uint16_t name='unk_2ec'/> reset to 0 together with x,y on job_counter reroll, so maybe z
-->
<compound type-name='coord2d'/>
<int16_t comment='v0.40.01'/>
<pointer comment='df_job' name='current_job' type-name='job'/>
<enum base-type='int16_t' type-name='job_skill' name='mood_skill'/>
<uint32_t name='unk_2fc'/> in advmode, lets non-player unit have job_counter update if nonzero
<int32_t name='mood_timeout' comment='counts down from 50000, insanity upon reaching zero'/>
<!--
<uint16_t name='siege_morale' init-value='100' comment='guess'/>
<uint16_t name='morale_recovery_timer' comment='0-1000'/>
<uint32_t name='unk_304'/>
-->
</compound>
<compound name='body'>
<compound name='components' type-name='body_component_info'/>
<stl-vector name='wounds' pointer-type='unit_wound'/>
<int32_t name='wound_next_id' init-value='1'/>
<static-array name='unk_39c' count='10'>
<int32_t init-value='-1'/>
</static-array>
<pointer name='body_plan' type-name='caste_body_info'/>
<int16_t name='weapon_bp' refers-to='$$._parent.body_plan.body_parts[$]' init-value='-1'/>
<static-array type-name='unit_attribute' name='physical_attrs'
count='6' index-enum='physical_attribute_type'/>
<compound name='size_info' type-name='body_size_info'/>
<uint32_t name='blood_max'/>
<uint32_t name='blood_count'/>
<int32_t name='infection_level'
comment='GETS_INFECTIONS_FROM_ROT sets; DISEASE_RESISTANCE reduces; >=300 causes bleeding'/>
<stl-vector name='spatters' pointer-type='unit_spatter'/>
</compound>
<compound name='appearance'>
<stl-vector name='body_modifiers' type-name='int32_t'
index-refers-to='$$._global.caste.ref-target.body_appearance_modifiers[$]'/>
<stl-vector name='bp_modifiers' type-name='int32_t'
index-refers-to='$$._global.caste.ref-target.bp_appearance.modifier_idx[$].refers-to'/>
<int32_t name='size_modifier' comment='product of all H/B/LENGTH body modifiers, in %'/>
-- Something for bp_appearance.layers_*
<stl-vector type-name='int16_t' name='tissue_style'
index-refers-to='$$._global.caste.ref-target.bp_appearance.style_layer_idx[$].refers-to'/>
<stl-vector type-name='int32_t' name='tissue_style_civ_id'
ref-target='historical_entity'
index-refers-to='$$._parent.tissue_style.index-refers-to[$]'/>
<stl-vector type-name='int32_t' name='tissue_style_id'
ref-target='entity_tissue_style'
aux-value='$$._parent.tissue_style_civ_id[$._key]'
index-refers-to='$$._parent.tissue_style.index-refers-to[$]'/>
<stl-vector type-name='int32_t' name='tissue_style_type'
refers-to='(find-by-id $$._global.caste.ref-target.tissue_styles $id $)'
index-refers-to='$$._parent.tissue_style.index-refers-to[$]'/>
<stl-vector type-name='int32_t' name='tissue_length'
index-refers-to='$$._parent.tissue_style.index-refers-to[$]'
comment='description uses bp_modifiers[style_list_idx[index]]'/>
<compound name='genes' type-name='unit_genes'/>
<stl-vector name='colors' type-name='int32_t'/>
</compound>
<stl-vector comment='v0.40.01'/>
<int32_t comment='v0.40.01'/>
<compound name='counters'>
<int32_t name='think_counter'/> // 53c decrements every job_counter reroll, set when changing jobs
<int32_t name='job_counter'/> // 540 current_job unit/walk done when reach -1, decremented every tick
<int32_t name='swap_counter' comment='dec per job_counter reroll, can_swap if 0'/>
<enum name='death_cause' base-type='int16_t' type-name='death_type'/>
<int32_t name='death_id' ref-target='death_info' comment='v0.34.01'/>
<int16_t name='winded'/>
<int16_t name='stunned'/> // 54c decrements every tick, unstun at 0
<int16_t name='unconscious'/>
<int16_t name='suffocation' comment='counts up while winded, results in death'/>
<int16_t name='webbed'/>
-- When gutted:
<compound name='guts_trail1' type-name='coord'/>
<compound name='guts_trail2' type-name='coord'/>
<int16_t name='soldier_mood_countdown' init-value='300' comment='plus a random amount' />
<enum name='soldier_mood' base-type='int16_t' init-value='None'>
<enum-item name='None' value='-1'/>
<enum-item name='MartialTrance'/>
<enum-item name='Enranged'/>
<enum-item name='Tantrum'/>
</enum>
<uint32_t name='pain'/>
<uint32_t name='nausea'/>
<uint32_t name='dizziness'/>
<int32_t comment='v0.40.01'/>
</compound>
<compound name='curse'>
<compound name='add_tags1' type-name='cie_add_tag_mask1'/>
<compound name='rem_tags1' type-name='cie_add_tag_mask1'/>
<compound name='add_tags2' type-name='cie_add_tag_mask2'/>
<compound name='rem_tags2' type-name='cie_add_tag_mask2'/>
<bool name='name_visible' comment='v0.34.01'/>
<stl-string name='name' comment='v0.34.01'/>
<stl-string name='name_plural' comment='v0.34.01'/>
<stl-string name='name_adjective' comment='v0.34.01'/>
<uint32_t name='sym_and_color1' comment='v0.34.01' init-value='0x400'/>
<uint32_t name='sym_and_color2' comment='v0.34.01' init-value='0x400'/>
<uint32_t name='flash_period' comment='v0.34.01'/>
<uint32_t name='flash_time2' comment='v0.34.01'/>
<stl-vector name='body_appearance' type-name='int32_t'
index-refers-to='$$._global.caste.ref-target.body_appearance_modifiers[$]'/>
<stl-vector name='bp_appearance' type-name='int32_t' comment='v0.34.01; guess!'
index-refers-to='$$._global.caste.ref-target.bp_appearance.modifier_idx[$].refers-to'/>
<uint32_t name='speed_add' comment='v0.34.01'/>
<uint32_t name='speed_mul_percent' comment='v0.34.01' init-value='100'/>
<pointer name='attr_change' type-name='curse_attr_change' comment='v0.34.01'/>
<uint32_t name='luck_mul_percent' comment='v0.34.01' init-value='100'/>
<stl-vector name='interaction_id' type-name='int32_t' comment='v0.34.01'
ref-target='creature_interaction_effect'/>
<stl-vector name='interaction_time' type-name='int32_t' comment='v0.34.01'/>
<stl-vector name='interaction_delay' type-name='int32_t' comment='v0.34.01'/>
<int32_t name='time_on_site' comment='v0.34.01'/>
<stl-vector name='own_interaction' type-name='int32_t' comment='v0.34.01'
refers-to='$$._global.body.body_plan.interactions[$]'/>
<stl-vector name='own_interaction_delay' type-name='int32_t' comment='v0.34.01'/>
</compound>
<compound name='counters2'>
<uint32_t name='paralysis'/>
<uint32_t name='numbness'/>
<uint32_t name='fever'/>
<uint32_t name='exhaustion'/>
<uint32_t name='hunger_timer'/>
<uint32_t name='thirst_timer'/>
<uint32_t name='sleepiness_timer'/>
<uint32_t name='stomach_content'/>
<uint32_t name='stomach_food'/>
<uint32_t name='vomit_timeout' comment='blocks nausea causing vomit'/>
<uint32_t name='stored_fat' comment='hunger leads to death only when 0'/>
</compound>
<compound name='status'>
<stl-vector name='misc_traits' pointer-type='unit_misc_trait'/>
<pointer name='eat_history'>
<compound name='food'>
<stl-vector name='item_type'>
<enum base-type='int16_t' type-name='item_type'/>
</stl-vector>
<stl-vector name='item_subtype' type-name='int16_t'/>
<compound name='material' type-name='material_vec_ref'/>
<stl-vector name='year' type-name='int32_t'/>
<stl-vector name='year_time' type-name='int32_t'/>
</compound>
<compound name='drink'>
<stl-vector name='item_type'>
<enum base-type='int16_t' type-name='item_type'/>
</stl-vector>
<stl-vector name='item_subtype' type-name='int16_t'/>
<compound name='material' type-name='material_vec_ref'/>
<stl-vector name='year' type-name='int32_t'/>
<stl-vector name='year_time' type-name='int32_t'/>
</compound>
</pointer>
<int32_t name='demand_timeout' init-value='1000'/>
<int32_t name='mandate_timeout' init-value='1000'/>
<stl-vector name='attacker_ids' type-name='int32_t' ref-target='unit'/>
<stl-vector name='attacker_cntdn' type-name='int16_t'/>
<uint8_t name='face_direction' comment='for wagons'/>
<compound type-name='language_name' name='artifact_name'/>
<stl-vector name='souls' pointer-type='unit_soul'/>
<pointer name='current_soul' type-name='unit_soul'/>
<stl-vector name='demands' pointer-type='unit_demand'/>
<static-array type-name='bool' name='labors' index-enum='unit_labor' count='94'/>
<stl-vector name='wrestle_items' pointer-type='unit_item_wrestle'/>
<stl-vector name='observed_traps' type-name='int32_t' ref-target='building'/>
<stl-vector name='recent_events' pointer-type='unit_thought'/>
<stl-vector name='dreams' pointer-type='unit_thought' comment='moved into recent_events upon waking up'/>
<int32_t name='happiness' init-value='100'/>
<int16_t name='insanity_chance' comment='increases gradually when miserable'/>
<stl-vector name='complaints' pointer-type='unit_complaint'/>
<stl-vector name='requests' pointer-type='unit_request'/>
<stl-vector name='coin_debts' pointer-type='unit_coin_debt'/>
<int16_t name='adv_sleep_timer'/>
-- average of the following vector
<compound name='recent_job_area' type-name='coord'/>
-- up to 50 locations where jobs were performed recently by the unit
<compound name='recent_jobs' type-name='coord_path'/>
</compound>
<int32_t name='hist_figure_id' ref-target='historical_figure'/>
<int32_t name='hist_figure_id2' ref-target='historical_figure'
comment='used for ghost in AttackedByDead thought'/>
<compound name='status2'>
<int16_t name='limbs_stand_max'/>
<int16_t name='limbs_stand_count'/>
<int16_t name='limbs_grasp_max'/>
<int16_t name='limbs_grasp_count'/>
<int16_t name='limbs_fly_max'/>
<int16_t name='limbs_fly_count'/>
<stl-vector name='body_part_temperature' pointer-type='temperaturest'/>
<uint32_t name='add_path_flags' comment='pathing flags to OR, set to 0 after move'/>
<compound type-name='tile_designation' name='liquid_type'/>
<uint8_t name='liquid_depth'/>
<int32_t name='unk_7c0' init-value='-1'/>
</compound>
<compound name='unknown7'>
<stl-vector name='unk_7c4'/>
<stl-vector comment='v0.34.01'/>
</compound>
<compound name='syndromes'>
-- Sorted by type:
<stl-vector name='active' pointer-type='unit_syndrome'/>
-- Seems to be incremented every new infection:
<stl-vector name='reinfection_type' type-name='int32_t' ref-target='syndrome'/>
<stl-vector name='reinfection_count' type-name='int16_t'/>
</compound>
<compound name='reports'>
<static-array name='log' count='3' index-enum='unit_report_type'>
<stl-vector type-name='int32_t' ref-target='report'/>
</static-array>
-- Garbage when the matching vector is empty:
<static-array type-name='int32_t' name='last_year' count='3' index-enum='unit_report_type'/>
<static-array type-name='int32_t' name='last_year_tick' count='3' index-enum='unit_report_type'/>
</compound>
<pointer name='health' type-name='unit_health_info'/>
<stl-vector name='used_items' pointer-type='unit_item_use' comment='Contains worn clothes, armor, weapons, arrows fired by archers'/>
<!--
<stl-vector name='adventurer_knows' comment='if not, no names' type-name='int32_t' ref-target='unit'/>
-->
<compound name='enemy'>
<stl-vector name='sound_cooldown' type-name='int32_t' comment='v0.34.01'
index-refers-to='$$._global.caste.ref-target.sound[$]'/>
<pointer name='undead' comment='v0.34.01'>
<compound>
<int32_t/>
<int32_t/>
<int32_t/>
<int32_t/>
<int32_t/>
<int16_t/>
<stl-string/>
</compound>
</pointer>
<int32_t name='were_race' ref-target='creature_raw'/>
<int32_t name='were_caste' ref-target='caste_raw' aux-value='$$.were_race'/>
<int32_t name='normal_race' ref-target='creature_raw'/>
<int32_t name='normal_caste' ref-target='caste_raw' aux-value='$$.normal_race'/>
<int32_t name='interaction' refers-to='$$._global.body.body_plan.interactions[$]' comment='v0.34.01'/>
<stl-vector name='unk_850'/>
<stl-vector name='witness_reports'>
<pointer>
<int32_t name='death_id' ref-target='death_info'/>
<int32_t name='crime_id' ref-target='criminal_case'/>
<int32_t name='unk1' comment='0 accuses, 1 corpse'/>
<int32_t name='year'/>
<int32_t name='year_tick'/>
<int32_t name='unk2' comment='bit 0 accuses'/>
</pointer>
</stl-vector>
<stl-vector comment='v0.40.01'/>
<static-array type-name='int32_t' count='5' comment='v0.40.01'/>
<static-array type-name='int32_t' count='10' comment='v0.40.01'/>
<static-array type-name='int32_t' count='10' comment='v0.40.01'/>
<static-array type-name='int32_t' count='10' comment='v0.40.01'/>
<static-array type-name='int32_t' count='10' comment='v0.40.01'/>
<static-array type-name='int32_t' count='10' comment='v0.40.01'/>
<static-array type-name='int32_t' count='20' comment='v0.40.01'/>
<int32_t comment='v0.40.01'/>
<pointer comment='v0.40.01'/>
<pointer comment='v0.40.01'/>
<int32_t comment='v0.40.01'/>
<int32_t comment='v0.40.01'/>
<int32_t comment='v0.40.01'/>
<int32_t comment='v0.40.01'/>
<pointer comment='v0.40.01'/>
<stl-vector comment='v0.40.01'/>
<stl-vector comment='v0.40.01'/>
<stl-vector comment='v0.40.01'/>
<pointer/>
<int32_t name='enemy_status_slot' init-value='-1'/>
<int32_t name='unk_874_cntr'/> // age ? incremented every tick
<stl-vector name='body_part_878' type-name='uint8_t'/>
<stl-vector name='body_part_888' type-name='uint8_t'/> 0 blocks pains, nausea
<stl-vector name='body_part_relsize' type-name='int32_t' comment='with modifiers'/>
<stl-vector name='body_part_8a8' type-name='uint8_t'/>
<stl-vector name='body_part_base_ins' type-name='uint16_t'/>
<stl-vector name='body_part_clothing_ins' type-name='uint16_t'/>
<stl-vector name='body_part_8d8' type-name='uint16_t'/>
<stl-vector name='unk_8e8'/> // items ids?
<stl-vector type-name='uint16_t' name='unk_8f8'/> // same size as 8e8, soldier related?
</compound>
<compound name='recuperation'>
<stl-vector name='healing_rate' type-name='int32_t'/>
<int32_t name='effective_rate' init-value='-1'/>
<int32_t name='tendons_heal'/>
<int32_t name='ligaments_heal'/>
</compound>
<int32_t name='weight'/>
<int32_t name='weight_fraction' comment='1e-6'/>
<stl-vector name='burrows' type-name='int32_t' ref-target='burrow'/>
<int32_t name='combat_side_id'/>
<int32_t comment='v0.40.01'/>
</struct-type>
<enum-type type-name='ghost_goal' base-type='int16_t'>
<enum-item name='None' value='-1'/>
<enum-item name='ScareToDeath'/>
<enum-item name='Stun'/>
<enum-item name='Batter'/>
<enum-item name='Possess'/>
<enum-item name='MisplaceItem'/>
<enum-item name='Haunt'/>
<enum-item name='Torment'/>
<enum-item name='ToppleBuilding'/>
</enum-type>
<struct-type type-name='unit_ghost_info'>
<enum base-type='int16_t' name='type' type-name='ghost_type'/>
<enum base-type='int16_t' name='type2' type-name='ghost_type'
comment='seems to have same value as type'/>
<enum base-type='int16_t' name="goal" type-name='ghost_goal'/>
<compound name='target' is-union='true'>
<int32_t name="unit" ref-target='unit'/>
<int32_t name="item" ref-target='item'/>
<int32_t name="building" ref-target='building'/>
</compound>
<compound name='misplace_pos' type-name='coord'/>
<int32_t name="action_timer" init-value='403200' comment='time since last action'/>
<int32_t name="unk_18"/>
<bitfield name='flags'>
<flag-bit name='announced'/>
<flag-bit name='was_at_rest'/>
</bitfield>
<int32_t name="death_x" comment='in tiles, global to world'/>
<int32_t name="death_y"/>
<int32_t name="death_z"/>
</struct-type>
<struct-type type-name='unit_genes'>
<!-- length matches body_appearance_modifiers + tissue_appearance_modifiers -->
<df-array name='appearance' type-name='uint8_t'/>
<!-- two items per color modifier -->
<df-array name="colors" type-name='int16_t'/>
</struct-type>
<struct-type type-name='unit_inventory_item'>
<pointer name='item' type-name='item'/>
<code-helper name='describe'>$.mode (describe-obj $.item)</code-helper>
<enum base-type='int16_t' name='mode'>
<enum-item name='Hauled'/>
<enum-item name='Weapon' comment='also shield, crutch'/>
<enum-item name='Worn' comment='quiver'/>
<enum-item name='Piercing'/>
<enum-item name='Flask' comment='attached to clothing'/>
<enum-item name='WrappedAround' comment='e.g. bandage'/>
<enum-item name='StuckIn'/>
<enum-item name='InMouth' comment='string descr like Worn'/>
<enum-item name='Pet' comment='Left shoulder, right shoulder, or head, selected randomly using pet_seed'/>
<enum-item name='SewnInto'/>
</enum>
<int16_t name='body_part_id'
refers-to='$$._global._parent._global.body.body_plan.body_parts[$]'/>
<int32_t name='pet_seed' comment='RNG seed for Pet mode'/>
<int32_t name='wound_id' init-value='-1' comment='-1 unless suture'/>
</struct-type>
<struct-type type-name='unit_spatter'>
<int16_t name="mat_type" ref-target='material' aux-value='$$.mat_index'/>
<int32_t name="mat_index" init-value='-1'/>
<enum type-name='matter_state' base-type='int16_t' name='mat_state'/>
<compound name='temperature' type-name='temperaturest'/>
<int32_t name="size"/>
<int16_t name='body_part_id'
refers-to='$$._global._parent._global.body.body_plan.body_parts[$]'/>
<int16_t name="unk_16"/>
</struct-type>
<struct-type type-name='unit_attribute'>
<int32_t name='value' comment='effective = value - soft_demotion' init-value='1000'/>
<int32_t name='max_value' init-value='2000'/>