forked from DFHack/df-structures
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdf.feature.xml
309 lines (264 loc) · 13.7 KB
/
df.feature.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
<data-definition>
<enum-type type-name='river_flag_type'> bay12: RiverFlagType
<enum-item name='UNUSED_1'/>
</enum-type>
<struct-type type-name='world_river' original-name='riverst'>
<compound name='name' type-name='language_name'/>
<code-helper name='describe'>(describe-obj $.name)</code-helper>
<compound name='path' type-name='coord2d_path'/>
<stl-vector name="flow" type-name='int32_t'/>
<stl-vector name="exit_tile" type-name='int16_t'/> -- 0 - 15
<stl-vector name="elevation" type-name='int16_t'/>
<compound name='end_pos' type-name='coord2d'/>
<df-flagarray name='flags' index-enum='river_flag_type'/>
<comment>
Additional river information:
The flow element affects the width of the river and seems to follow the
formula width = (flow / 40000 * 46) + 1, with a minimum width of 4 and
a maximum width of 47. DF uses specific names for rivers with certain flows:
- Stream: less than 5000
- Minor River 5000 - 9999
- River 10000 - 19999
- Major River: greather than 20000
Brooks tend to have a flow of 0, but DF has divided the controlling information
between this structure, the region map entry (below), and the feature map.
Thus, the region map flag 'is_brook' controls whether a water course actually
is a (potentially broad) brook or an open water course. Likewise, the 'has_river'
flag is needed for DF to properly understand a water course should be present.
The exit tile holds the information on which mid level tile the river should
exit the region. Presumably the path controls which edge to apply this to.
Note that the river up/down/left/right flags of the region map entry should
align with the sides rivers enter/exit.
The feature map has to have a river entry for the corresponding world tile
for a river to be implemented properly. All this is done by DF, but needs
to be known if hacking.
The world region details (below) data on rivers are generated as the regions
are generated.
The elevation element affects the level of the river. If the river elevation
is lower than the surrounding area DF tends to generate a valley around the
river to allow it to reach the correct elevation.
</comment>
</struct-type>
<enum-type type-name='feature_type' base-type='int16_t'> bay12: FeatureType
<enum-item name='NONE' value='-1'/>
<enum-item name='outdoor_river'/>
<enum-item name='cave'/>
<enum-item name='pit'/>
<enum-item name='magma_pool'/>
<enum-item name='volcano'/>
<enum-item name='deep_special_tube'/>
<enum-item name='deep_surface_portal'/>
<enum-item name='subterranean_from_layer'/>
<enum-item name='magma_core_from_layer'/>
<enum-item name='underworld_from_layer'/>
</enum-type>
<enum-type type-name='feature_alteration_type' base-type='int16_t'> bay12: FeatureAlterationType
<enum-item name='NONE' value='-1'/>
<enum-item name='new_pop_max'/>
<enum-item name='new_lava_fill_z'/>
</enum-type>
<class-type type-name='feature_alteration' original-name='feature_alterationst'>
<virtual-methods>
<vmethod ret-type='feature_alteration_type' name='getType'/>
<vmethod name='write_file'> <pointer name='file' type-name='file_compressorst'/> </vmethod>
<vmethod name='read_file'>
<pointer name='file' type-name='file_compressorst'/>
<enum name='loadversion' type-name='save_version'/>
</vmethod>
<vmethod is-destructor='true'/>
</virtual-methods>
</class-type>
<class-type type-name='feature_alteration_new_pop_maxst' inherits-from='feature_alteration'>
<int32_t name='index'/>
<int32_t name='new_num'/>
</class-type>
<class-type type-name='feature_alteration_new_lava_fill_zst' inherits-from='feature_alteration'>
<int32_t name='magma_fill_z'/>
</class-type>
<class-type type-name='feature' original-name='featurest'>
<stl-vector name='population' pointer-type='world_population'/>
<int32_t name='irritation_level' comment='divide by 10k for attack chance, max 100k'/>
<int16_t name='irritation_attacks' comment='maxes at 10?'/>
<compound name='embark_pos' type-name='coord2d_path'/>
<stl-vector name='min_map_z' type-name='int16_t'/>
<stl-vector name='max_map_z' type-name='int16_t'/>
<virtual-methods>
<vmethod ret-type='feature_type' name='getType'/>
<vmethod name='write_file'> <pointer name='file' type-name='file_compressorst'/> </vmethod>
<vmethod name='read_file'>
<pointer name='file' type-name='file_compressorst'/>
<enum name='loadversion' type-name='save_version'/>
</vmethod>
<vmethod name='shiftCoords'><int16_t name='x'/><int16_t name='y'/><int16_t name='z'/></vmethod>
<vmethod name='discovery_realize' comment='originally used in 40d to populate demon pits'/>
<vmethod is-destructor='true'/>
</virtual-methods>
</class-type>
<class-type type-name='feature_outdoor_riverst' inherits-from='feature'/>
<class-type type-name='feature_cavest' inherits-from='feature'/>
<class-type type-name='feature_pitst' inherits-from='feature'/>
<class-type type-name='feature_magma_poolst' inherits-from='feature'>
<int32_t name='magma_fill_z'/>
</class-type>
<class-type type-name='feature_volcanost' inherits-from='feature'>
<int32_t name='magma_fill_z'/>
</class-type>
<class-type type-name='feature_deep_special_tubest' inherits-from='feature'/>
<class-type type-name='feature_deep_surface_portalst' inherits-from='feature'/>
<class-type type-name='feature_subterranean_from_layerst' inherits-from='feature'/>
<class-type type-name='feature_magma_core_from_layerst' inherits-from='feature'/>
<class-type type-name='feature_underworld_from_layerst' inherits-from='feature'/>
<enum-type type-name='feature_init_flags'> bay12: FeatureInitFlagType
<enum-item name='NONE' value='-1'/>
<enum-item name='AddSavage'/>
<enum-item name='AddEvil'/>
<enum-item name='AddGood'/>
<enum-item name='Discovered'/>
<enum-item name='Announced'/>
<enum-item name='AnnouncedFully' comment='for tube inside vs. outside'/>
</enum-type>
<class-type type-name='feature_init' original-name='feature_initst'>
<df-flagarray name='flags' index-enum='feature_init_flags'/>
<stl-vector name='alterations' pointer-type='feature_alteration'/>
<int16_t name='start_x'/>
<int16_t name='start_y'/>
<int16_t name='end_x'/>
<int16_t name='end_y'/>
<enum name='start_depth' type-name='layer_type' base-type='int16_t'/>
<enum name='end_depth' type-name='layer_type' base-type='int16_t'/>
<virtual-methods>
<vmethod ret-type='feature_type' name='getType'/>
<vmethod name='write_file'>
<pointer name='file' type-name='file_compressorst'/>
<bool name='include_feature'/>
</vmethod>
<vmethod name='read_file'>
<pointer name='file' type-name='file_compressorst'/>
<enum name='loadversion' type-name='save_version'/>
<bool name='include_feature'/>
</vmethod>
<vmethod name='createFeature' comment='for load'>
<ret-type><pointer type-name='feature'/></ret-type>
</vmethod>
<vmethod name='recreateFeature' comment='destroyFeature(), then createFeature()'>
<ret-type><pointer type-name='feature'/></ret-type>
</vmethod>
<vmethod name='destroyFeature'/>
<vmethod name='getFeature'>
<ret-type><pointer type-name='feature'/></ret-type>
</vmethod>
<vmethod is-destructor='true'/>
<vmethod name='getMaterial'>
<pointer name='mat_type' type-name='int16_t'/>
<pointer name='mat_index' type-name='int32_t'/>
</vmethod>
<vmethod ret-type='bool' name='generates_river_vermin'/>
<vmethod ret-type='bool' name='outdoor_wildlife_feature'/>
<vmethod ret-type='bool' name='indoor_wildlife_feature'/>
<vmethod ret-type='bool' name='fishing_feature'/>
<vmethod name='getColor'>
<pointer name='foreground' type-name='int16_t'/>
<pointer name='background' type-name='int16_t'/>
<pointer name='bright' type-name='int8_t'/>
</vmethod>
<vmethod name='getName'>
<pointer name='name' type-name='stl-string'/>
</vmethod>
<vmethod name='isWater' ret-type='bool'/>
<vmethod name='isSubterranean' ret-type='bool'/>
<vmethod name='isMagma' ret-type='bool'/>
<vmethod name='isChasm' ret-type='bool'/>
<vmethod name='isUnderworld' ret-type='bool'/>
<vmethod ret-type='bool' name='isOutdoorRiver'/>
<vmethod ret-type='int32_t' name='getLayer'/>
</virtual-methods>
</class-type>
<class-type type-name='feature_init_outdoor_riverst' inherits-from='feature_init'>
<pointer name='feature' type-name='feature_outdoor_riverst'/>
</class-type>
<class-type type-name='feature_init_cavest' inherits-from='feature_init'>
<pointer name='feature' type-name='feature_cavest'/>
</class-type>
<class-type type-name='feature_init_pitst' inherits-from='feature_init'>
<pointer name='feature' type-name='feature_pitst'/>
</class-type>
<class-type type-name='feature_init_magma_poolst' inherits-from='feature_init'>
<pointer name='feature' type-name='feature_magma_poolst'/>
</class-type>
<class-type type-name='feature_init_volcanost' inherits-from='feature_init'>
<pointer name='feature' type-name='feature_volcanost'/>
</class-type>
<class-type type-name='feature_init_deep_special_tubest' inherits-from='feature_init'>
<int16_t name='mat_type' ref-target='material' aux-value='$$.mat_index'/>
<int32_t name='mat_index'/>
<pointer name='feature' type-name='feature_deep_special_tubest'/>
</class-type>
<class-type type-name='feature_init_deep_surface_portalst' inherits-from='feature_init'>
<int16_t name='mat_type' ref-target='material' aux-value='$$.mat_index'/>
<int32_t name='mat_index'/>
<pointer name='feature' type-name='feature_deep_surface_portalst'/>
</class-type>
<class-type type-name='feature_init_subterranean_from_layerst' inherits-from='feature_init'>
<int32_t name='layer' ref-target='world_underground_region'/>
<pointer name='feature' type-name='feature_subterranean_from_layerst'/>
</class-type>
<class-type type-name='feature_init_magma_core_from_layerst' inherits-from='feature_init'>
<int32_t name='layer' ref-target='world_underground_region'/>
<pointer name='feature' type-name='feature_magma_core_from_layerst'/>
</class-type>
<class-type type-name='feature_init_underworld_from_layerst' inherits-from='feature_init'>
<int32_t name='layer' ref-target='world_underground_region'/>
<int16_t name='mat_type' ref-target='material' aux-value='$$.mat_index'/>
<int32_t name='mat_index'/>
<pointer name='feature' type-name='feature_underworld_from_layerst'/>
</class-type>
<struct-type type-name='feature_mapst'>
<static-array name='feature_init' count='16'>
<static-array count='16'>
<stl-vector pointer-type='feature_init'/>
</static-array>
</static-array>
<static-array name='index_ul' count='16'>
<static-array count='16'>
<static-array count='5'><static-array count='2' type-name='int32_t'/></static-array>
</static-array>
</static-array>
<static-array name='index_u' count='16'>
<static-array count='16'>
<static-array count='5'><static-array count='2' type-name='int32_t'/></static-array>
</static-array>
</static-array>
<static-array name='index_l' count='16'>
<static-array count='16'>
<static-array count='5'><static-array count='2' type-name='int32_t'/></static-array>
</static-array>
</static-array>
</struct-type>
<struct-type type-name='feature_river_informationst'>
<static-array name='map' count='16'>
<static-array count='16'>
<static-array count='2' type-name='int16_t'/>
</static-array>
</static-array>
</struct-type>
<struct-type type-name='feature_layer_informationst'>
<static-array name='map' count='16'>
<static-array count='16'>
<static-array count='5'><static-array count='2' type-name='int32_t'/></static-array>
</static-array>
</static-array>
</struct-type>
<struct-type type-name='feature_map_shellst'>
<int16_t name='x'/>
<int16_t name='y'/>
<pointer name='features' type-name='feature_mapst'/>
<pointer name='river_info' type-name='feature_river_informationst'/>
<pointer name='layer_info' type-name='feature_layer_informationst'/>
</struct-type>
</data-definition>
<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->