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
use df_ls_core::{AllowEmpty, Any, Reference, ReferenceTo, Referenceable};
use df_ls_syntax_analysis::TokenDeserialize;
use serde::{Deserialize, Serialize};
// TODO: for all of these, support `!ARG` tokens, up to `!ARG65537` at least
#[derive(
Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq, Referenceable,
)]
pub struct CreatureVariationToken {
/// Argument 1 of `[CREATURE_VARIATION:...]`
#[token_de(token = "CREATURE_VARIATION", on_duplicate_to_parent, primary_token)]
#[referenceable(self_reference)]
pub reference: Option<ReferenceTo<Self>>,
// TODO: properly implement the below tokens; CV_NEW_TAG, CV_REMOVE_TAG, CV_NEW_CTAG, CV_REMOVE_CTAG:
// --------------------------------------------------------------------------------------------
/// **Warning: Incomplete token. This token is not yet properly implemented, and so you will
/// not get any hover text information from the arguments, autocomplete will not work, and
/// you will not be alerted to any errors.**
///
/// ---
/// Adds the given token to the creature.
///
/// `APPLY_CREATURE_VARIATION` is the only token that cannot be added.
///
/// You can replace any portion of the arguments of this token with `!ARGn`, with `n` being
/// a number (eg, `!ARG1`, `!ARG2` etc etc). When this creature variation is applied (using
/// `APPLY_CREATURE_VARIATION`), if any arguments other than the specified `CREATURE_VARIATION`
/// ID are given, these extra arguments will replace all instances of `!ARGn`, where
/// `n` is the index of the argument given to `APPLY_CREATURE_VARIATION`; the first argument
/// will replace any `!ARG1`, the second any `!ARG2` and so on.
///
/// For instance, if you use `[CV_NEW_TAG:PETVALUE:!ARG1]`, then the creature variation can be
/// used like so: `[APPLY_CREATURE_VARIATION:VARIATION_ID:200]`, and `[PETVALUE:200]` will be
/// added to the creature.
///
/// You can replace any amount of the token with `!ARG` placeholders; for instance, you could
/// do `[CV_NEW_TAG:NAME:!ARG1 bear:!ARG1 bears:!ARG1 bear]`, and replace `!ARG1` with `grizzly`,
/// and then the token `[NAME:grizzly bear:grizzly bear:grizzly bears]` would be added to the
/// creature, or you could use `[CV_NEW_TAG:NAME:!ARG1]`, and by using
/// `[APPLY_CREATURE_VARIATION:EXAMPLE_VARIATION:dwarf|dwarves|dwarven]`, you would end up with
/// `[NAME:dwarf:dwarves:dwarven]`. You can even use an `!ARG` for the tag itself, like this
/// `[CV_NEW_TAG:!ARG1]`.
#[token_de(token = "CV_NEW_TAG", alias = "CV_ADD_TAG")]
pub cv_new_tag: Vec<(Reference, Option<(Vec<Any>,)>)>,
/// **Warning: Incomplete token. This token is not yet properly implemented, and so you will
/// not get any hover text information from the arguments, autocomplete will not work, and
/// you will not be alerted to any errors.**
///
/// ---
/// Removes from the creature all tokens which start with the given chain of token arguments.
///
/// For example, `[CV_REMOVE_TAG:BODY:HUMANOID_SIMPLE]` would remove
/// `[BODY:HUMANOID_SIMPLE:3_EYES]`, but `[CV_REMOVE_TAG:BODY:3_EYES]`, or `[CV_REMOVE_TAG:3_EYES]`
/// would not. Neither would `[CV_REMOVE_TAG:BODY:HUMANOID_SIMPLE]` be able to remove
/// `[BODY:HUMANOID_SIMPLE_NECK]`, as it looks for whole arguments.
///
/// `[CV_REMOVE_TAG:BODY]` would remove both examples above, as they both start with `BODY`.
///
/// You can replace any portion of the arguments of this token with `!ARGn`, with `n` being
/// a number (eg, `!ARG1`, `!ARG2` etc etc). When this creature variation is applied (using
/// `APPLY_CREATURE_VARIATION`), if any arguments other than the specified `CREATURE_VARIATION`
/// ID are given, these extra arguments will replace all instances of `!ARGn`, where
/// `n` is the index of the argument given to `APPLY_CREATURE_VARIATION`; the first argument
/// will replace any `!ARG1`, the second any `!ARG2` and so on.
///
/// For instance, if you use `[CV_REMOVE_TAG:PETVALUE:!ARG1]`, then the creature variation can be
/// used like so: `[APPLY_CREATURE_VARIATION:VARIATION_ID:200]`, and `[PETVALUE:200]` will be
/// removed from the creature.
///
/// You can replace any amount of the token with `!ARG` placeholders; for instance, you could
/// do `[CV_REMOVE_TAG:BODY:!ARG1:!ARG2]`, and use
/// `[APPLY_CREATURE_VARIATION:EXAMPLE_REMOVAL:HUMANOID_SIMPLE:BRAIN]` to only remove `BODY`
/// tokens that start with `HUMANOID_SIMPLE:BRAIN`.
#[token_de(token = "CV_REMOVE_TAG")]
pub cv_remove_tag: Vec<(Reference, Option<(Vec<Any>,)>)>,
/// List of `[CV_CONVERT_TAG]` tokens.
#[token_de(token = "CV_CONVERT_TAG")]
pub cv_convert_tag: Vec<CvConvertTag>,
/// **Warning: Incomplete token. This token is not yet properly implemented, and so you will
/// not get any hover text information from the arguments, autocomplete will not work, and
/// you will not be alerted to any errors.**
///
/// ---
/// Adds the given token to the creature, but only when the specified numbered
/// argument of `APPLY_CREATURE_VARIATION has a specfic value.
///
/// For example, `[CV_REMOVE_CTAG:2:HUMANOID:CAN_SPEAK]` will only add `[CAN_SPEAK]`
/// if the second argument used in `APPLY_CREATURE_VARIATION` (also known as `!ARG2`)
/// is `HUMANOID`.
///
/// `APPLY_CREATURE_VARIATION` is the only token that cannot be added.
///
/// You can replace any portion of the arguments of this token with `!ARGn`, with `n` being
/// a number (eg, `!ARG1`, `!ARG2` etc etc). When this creature variation is applied (using
/// `APPLY_CREATURE_VARIATION`), if any arguments other than the specified `CREATURE_VARIATION`
/// ID are given, these extra arguments will replace all instances of `!ARGn`, where
/// `n` is the index of the argument given to `APPLY_CREATURE_VARIATION`; the first argument
/// will replace any `!ARG1`, the second any `!ARG2` and so on.
///
/// For instance, if you use `[CV_NEW_TAG:PETVALUE:!ARG1]`, then the creature variation can be
/// used like so: `[APPLY_CREATURE_VARIATION:VARIATION_ID:200]`, and `[PETVALUE:200]` will be
/// added to the creature.
///
/// You can replace any amount of the token with `!ARG` placeholders; for instance, you could
/// do `[CV_NEW_TAG:NAME:!ARG1 bear:!ARG1 bears:!ARG1 bear]`, and replace `!ARG1` with `grizzly`,
/// and then the token `[NAME:grizzly bear:grizzly bears:grizzly bear]` would be added to the
/// creature. Or you could use `[CV_NEW_TAG:NAME:!ARG1]`, and by using
/// `[APPLY_CREATURE_VARIATION:EXAMPLE_VARIATION:dwarf|dwarves|dwarven]`, you would end up with
/// `[NAME:dwarf:dwarves:dwarven]`. You can even use an `!ARG` for the tag itself, like this
/// `[CV_NEW_TAG:!ARG1]`.
#[token_de(token = "CV_NEW_CTAG", alias = "CV_ADD_CTAG")]
pub cv_new_ctag: Vec<(u16, Reference, Option<(Vec<Any>,)>)>,
/// **Warning: Incomplete token. This token is not yet properly implemented, and so you will
/// not get any hover text information from the arguments, autocomplete will not work, and
/// you will not be alerted to any errors.**
///
/// ---
/// Removes from the creature all tokens which start with the given chain of token arguments.
///
/// For example, `[CV_REMOVE_TAG:BODY:HUMANOID_SIMPLE]` would remove
/// `[BODY:HUMANOID_SIMPLE:3_EYES]`, but `[CV_REMOVE_TAG:BODY:3_EYES]`, or `[CV_REMOVE_TAG:3_EYES]`
/// would not. Neither would `[CV_REMOVE_TAG:BODY:HUMANOID_SIMPLE]` be able to remove
/// `[BODY:HUMANOID_SIMPLE_NECK]`, as it looks for whole arguments.
///
/// `[CV_REMOVE_TAG:BODY]` would remove both examples above, as they both start with `BODY`.
///
/// Unlike `CV_REMOVE_TAG` however, the token will only be removed when the specified numbered
/// argument of `APPLY_CREATURE_VARIATION has a specfic value.
///
/// For example, `[CV_REMOVE_CTAG:2:HUMANOID:PET_EXOTIC]` will only remove `[PET_EXOTIC]`
/// if the second argument used in `APPLY_CREATURE_VARIATION` (also known as `!ARG2`)
/// is `HUMANOID`.
///
/// You can replace any portion of the arguments of this token with `!ARGn`, with `n` being
/// a number (eg, `!ARG1`, `!ARG2` etc etc). When this creature variation is applied (using
/// `APPLY_CREATURE_VARIATION`), if any arguments other than the specified `CREATURE_VARIATION`
/// ID are given, these extra arguments will replace all instances of `!ARGn`, where
/// `n` is the index of the argument given to `APPLY_CREATURE_VARIATION`; the first argument
/// will replace any `!ARG1`, the second any `!ARG2` and so on.
///
/// For instance, if you use `[CV_REMOVE_TAG:PETVALUE:!ARG1]`, then the creature variation can be
/// used like so: `[APPLY_CREATURE_VARIATION:VARIATION_ID:200]`, and `[PETVALUE:200]` will be
/// removed from the creature.
///
/// You can replace any amount of the token with `!ARG` placeholders; for instance, you could
/// do `[CV_REMOVE_TAG:BODY:!ARG1:!ARG2]`, and use
/// `[APPLY_CREATURE_VARIATION:EXAMPLE_REMOVAL:HUMANOID_SIMPLE:BRAIN]` to only remove `BODY`
/// tokens that start with `HUMANOID_SIMPLE:BRAIN`.
#[token_de(token = "CV_REMOVE_CTAG")]
pub cv_remove_ctag: Vec<(u16, Reference, Option<(Vec<Any>,)>)>,
/// List of `[CV_CONVERT_CTAG]` tokens.
#[token_de(token = "CV_CONVERT_CTAG")]
pub cv_convert_ctag: Vec<CvConvertCTag>,
}
/// Starts a "conversion block" to modify the arguments of existing tokens on a creature.
/// A conversion block contains one `CVCT_MASTER`, one `CVCT_TARGET`, and one `CVCT_REPLACEMENT`
/// (note, `CVCT_REPLACEMENT` is optional, and leaving it out may be used to erase parts of
/// arguments instead of replacing them).
///
/// Note that if a creature variation contains multiple `CV_CONVERT_TAG` (or `CV_CONVERT_CTAG`)
/// blocks altering the same token, the replacements will be applied in reverse order
/// (see [Application](https://dwarffortresswiki.org/index.php/Creature_variation_token#Application)
/// for more detail).
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CvConvertTag {
/// `CV_CONVERT_TAG`; has no arguments.
#[token_de(token = "CV_CONVERT_TAG", on_duplicate_to_parent, primary_token)]
pub cv_convert_tag: Option<()>,
// TODO: properly implement the 3 below tokens:
// --------------------------------------------------------------------------------------------
/// **Warning: Incomplete token. This token is not yet properly implemented, and so you will
/// not get any hover text information from the arguments, autocomplete will not work, and
/// you will not be alerted to any errors.**
///
/// ---
/// Specifies which tokens of the creature may be modified, by looking at full arguments
/// at the start of said token.
///
/// For example, `[CVCT_MASTER:BODY:HUMANOID_SIMPLE]` would target
/// `[BODY:HUMANOID_SIMPLE:3_EYES]`, but `[CVCT_MASTER:BODY:3_EYES]`, or `[CVCT_MASTER:3_EYES]`
/// would not. Neither would `[CVCT_MASTER:BODY:HUMANOID_SIMPLE]` be able to target
/// `[BODY:HUMANOID_SIMPLE_NECK]`, as it looks for whole arguments.
///
/// `[CVCT_MASTER:BODY]` would target both examples above, as they both start with `BODY`.
///
/// If no `CVCT_MASTER` is given in the conversion block, or it is given no arguments,
/// or the only argument it is given is blank (i.e. `[CVCT_MASTER:]`), *all* tokens of
/// the creature are selected.
///
/// Note that if a creature variation contains multiple `CV_CONVERT_TAG` (or `CV_CONVERT_CTAG`)
/// blocks altering the same token, the replacements will be applied in reverse order
/// (see [Application](https://dwarffortresswiki.org/index.php/Creature_variation_token#Application)
/// for more detail).
///
/// You can replace any portion of the arguments of this token with `!ARGn`, with `n` being
/// a number (eg, `!ARG1`, `!ARG2` etc etc). When this creature variation is applied (using
/// `APPLY_CREATURE_VARIATION`), if any arguments other than the specified `CREATURE_VARIATION`
/// ID are given, these extra arguments will replace all instances of `!ARGn`, where
/// `n` is the index of the argument given to `APPLY_CREATURE_VARIATION`; the first argument
/// will replace any `!ARG1`, the second any `!ARG2` and so on.
///
/// For instance, if you use `[CVCT_MASTER:BODY:!ARG1]`, then the creature variation can be
/// used like so: `[APPLY_CREATURE_VARIATION:VARIATION_ID:HUMANOID_SIMPLE]`, and this would
/// cause the token to function as `[CVCT_MASTER:BODY:HUMANOID_SIMPLE]`.
#[token_de(token = "CVCT_MASTER")]
pub cvct_master: Option<
AllowEmpty<(
Reference, // TODO: ref can be name of any token that nests under CREATURE
Option<(Vec<Any>,)>,
)>,
>,
/// **Warning: Incomplete token. This token is not yet properly implemented, and so you will
/// not get any hover text information from the arguments, autocomplete will not work, and
/// you will not be alerted to any errors.**
///
/// ---
/// Locates the specified parameters or portions of parameters, within all tokens specified
/// by `CVCT_MASTER`.
///
/// For example, this conversion block:
///
/// ```df_raw
/// [CV_CONVERT_TAG]
/// [CVCT_MASTER:STATE_NAME]
/// [CVCT_TARGET:adder]
/// ```
/// Will select every instance of `adder` in all arguments of all `STATE_NAME` tokens
/// in that creature, and *only* the portion saying `adder`:
///
/// ```df_raw
/// [STATE_NAME:ALL_SOLID:frozen adder venom]
/// [STATE_NAME:LIQUID:adder venom]
/// ```
/// You may target references and integers as well as strings, though be warned that integers
/// cannot be targeted exactly; for instance, `[CVCT_TARGET:1]` will select the `1` in `10`
/// or `101` as well.
///
/// You can target the token itself, for instance, you could replace the `[PET]` token
/// with `[PET_EXOTIC]`:
///
/// ```df_raw
/// [CV_CONVERT_TAG]
/// [CVCT_MASTER:PET]
/// [CVCT_TARGET:PET]
/// [CVCT_REPLACEMENT:PET_EXOTIC]
/// ```
/// Be warned however that it has not been tested whether subsequent arguments are deleted by this,
/// and they most likely are not, so this is likely only safe to use for tokens with no arguments
/// (like my example above).
///
/// If no `CVCT_TARGET` is given in the conversion block, or it is given no arguments,
/// or the only argument it is given is blank (i.e. `[CVCT_TARGET:]`), the game will freeze
/// when loading the creature.
///
/// You can replace any portion of the arguments of this token with `!ARGn`, with `n` being
/// a number (eg, `!ARG1`, `!ARG2` etc etc). When this creature variation is applied (using
/// `APPLY_CREATURE_VARIATION`), if any arguments other than the specified `CREATURE_VARIATION`
/// ID are given, these extra arguments will replace all instances of `!ARGn`, where
/// `n` is the index of the argument given to `APPLY_CREATURE_VARIATION`; the first argument
/// will replace any `!ARG1`, the second any `!ARG2` and so on.
///
/// For instance, if you use `[CVCT_TARGET:!ARG1 monster]`, then the creature variation can be
/// used like so: `[APPLY_CREATURE_VARIATION:VARIATION_ID:gila]`, and this would
/// cause the token to function as `[CVCT_TARGET:gila monster]`.
#[token_de(token = "CVCT_TARGET")]
pub cvct_target: Option<(Vec<Any>,)>,
/// **Warning: Incomplete token. This token is not yet properly implemented, and so you will
/// not get any hover text information from the arguments, autocomplete will not work, and
/// you will not be alerted to any errors.**
///
/// ---
/// Replaces the string specified by `CVCT_TARGET` within the tokens specified by `CVCT_MASTER`.
/// This means the targeted part of a token can be changed anywhere in the token, e.g:
///
/// ```df_raw
/// [CV_CONVERT_TAG]
/// [CVCT_MASTER:BODY]
/// [CVCT_TARGET:2EYES]
/// [CVCT_REPLACEMENT:2EYESTALKS]
/// ```
/// Would affect both of these:
///
/// ```df_raw
/// [BODY:QUADRUPED_NECK:NOSE:2LUNGS:BRAIN:2EYES]
/// [BODY:INSECT:2EYES:HEART:GUTS:BRAIN:MOUTH:2WINGS]
/// ```
/// Converting them into:
///
/// ```df_raw
/// [BODY:QUADRUPED_NECK:NOSE:2LUNGS:BRAIN:2EYESTALKS]
/// [BODY:INSECT:2EYESTALKS:HEART:GUTS:BRAIN:MOUTH:2WINGS]
/// ```
/// Colons can be included as part of both the target and the replacement string, for example:
///
/// ```df_raw
/// [CV_CONVERT_TAG]
/// [CVCT_MASTER:BODY]
/// [CVCT_TARGET:BASIC_1PARTBODY:BASIC_HEAD]
/// [CVCT_REPLACEMENT:HUMANOID:3FINGERS]
/// ```
/// Will convert `[BODY:BASIC_1PARTBODY:BASIC_HEAD:HEART:GUTS:BRAIN:MOUTH:2EYESTALKS]`, into
/// `[BODY:HUMANOID:3FINGERS:HEART:GUTS:BRAIN:MOUTH:2EYESTALKS]`. All occurrences of the target
/// string are replaced, for example:
/// ```df_raw
/// [CV_CONVERT_TAG]
/// [CVCT_MASTER:DESCRIPTION]
/// [CVCT_TARGET:TRAIT]
/// [CVCT_REPLACEMENT:modderiffic]
/// ```
/// Will convert `[DESCRIPTION:This is an example creature. It is TRAIT, very very TRAIT.]`,
/// into `[DESCRIPTION:This is an example creature. It is modderiffic, very very modderiffic.]`.
///
/// If no `CVCT_REPLACEMENT` is given, the target string is simply removed.
///
/// You can replace any portion of the arguments of this token with `!ARGn`, with `n` being
/// a number (eg, `!ARG1`, `!ARG2` etc etc). When this creature variation is applied (using
/// `APPLY_CREATURE_VARIATION`), if any arguments other than the specified `CREATURE_VARIATION`
/// ID are given, these extra arguments will replace all instances of `!ARGn`, where
/// `n` is the index of the argument given to `APPLY_CREATURE_VARIATION`; the first argument
/// will replace any `!ARG1`, the second any `!ARG2` and so on.
///
/// For instance, if you used:
///
/// ```df_raw
/// [CV_CONVERT_TAG]
/// [CVCT_MASTER:DESCRIPTION]
/// [CVCT_TARGET:TRAIT]
/// [CVCT_REPLACEMENT:!ARG1]
/// ```
/// Then the creature variation can be used like so:
/// `[APPLY_CREATURE_VARIATION:VARIATION_ID:mod-tastic]`, and this would allow you to change
/// the above example into `[DESCRIPTION:This is an example creature. It is mod-tastic, very very mod-tastic.]`.
#[token_de(token = "CVCT_REPLACEMENT")]
pub cvct_replacement: Option<(Vec<Any>,)>,
}
/// Starts a "conversion block" to modify the arguments of existing tokens on a creature, but
/// unlike `CV_CONVERT_TAG`, the block will only apply a change when the specified numbered argument
/// of `APPLY_CREATURE_VARIATION has a specfic value.
///
/// For example, `[CV_CONVERT_CTAG:2:HUMANOID]` will only add apply the effects of the following
/// conversion block if the second argument used in `APPLY_CREATURE_VARIATION` (also known as
/// `!ARG2`) is `HUMANOID`.
///
/// A conversion block contains one `CVCT_MASTER`, one `CVCT_TARGET`, and one `CVCT_REPLACEMENT`
/// (note, `CVCT_REPLACEMENT` is optional, and leaving it out may be used to erase parts of
/// arguments instead of replacing them).
///
/// Note that if a creature variation contains multiple `CV_CONVERT_TAG` (or `CV_CONVERT_CTAG`)
/// blocks altering the same token, the replacements will be applied in reverse order
/// (see [Application](https://dwarffortresswiki.org/index.php/Creature_variation_token#Application)
/// for more detail).
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CvConvertCTag {
/// Arguments of `[CV_CONVERT_CTAG:...]`
#[token_de(token = "CV_CONVERT_CTAG", on_duplicate_to_parent, primary_token)]
pub cv_convert_ctag: Option<(u16, Any)>,
// TODO: properly implement the 3 below tokens:
// --------------------------------------------------------------------------------------------
/// **Warning: Incomplete token. This token is not yet properly implemented, and so you will
/// not get any hover text information from the arguments, autocomplete will not work, and
/// you will not be alerted to any errors.**
///
/// ---
/// Specifies which tokens of the creature may be modified, by looking at full arguments
/// at the start of said token.
///
/// For example, `[CVCT_MASTER:BODY:HUMANOID_SIMPLE]` would target
/// `[BODY:HUMANOID_SIMPLE:3_EYES]`, but `[CVCT_MASTER:BODY:3_EYES]`, or `[CVCT_MASTER:3_EYES]`
/// would not. Neither would `[CVCT_MASTER:BODY:HUMANOID_SIMPLE]` be able to target
/// `[BODY:HUMANOID_SIMPLE_NECK]`, as it looks for whole arguments.
///
/// `[CVCT_MASTER:BODY]` would target both examples above, as they both start with `BODY`.
///
/// If no `CVCT_MASTER` is given in the conversion block, or it is given no arguments,
/// or the only argument it is given is blank (i.e. `[CVCT_MASTER:]`), *all* tokens of
/// the creature are selected.
///
/// Note that if a creature variation contains multiple `CV_CONVERT_TAG` (or `CV_CONVERT_CTAG`)
/// blocks altering the same token, the replacements will be applied in reverse order
/// (see [Application](https://dwarffortresswiki.org/index.php/Creature_variation_token#Application)
/// for more detail).
///
/// You can replace any portion of the arguments of this token with `!ARGn`, with `n` being
/// a number (eg, `!ARG1`, `!ARG2` etc etc). When this creature variation is applied (using
/// `APPLY_CREATURE_VARIATION`), if any arguments other than the specified `CREATURE_VARIATION`
/// ID are given, these extra arguments will replace all instances of `!ARGn`, where
/// `n` is the index of the argument given to `APPLY_CREATURE_VARIATION`; the first argument
/// will replace any `!ARG1`, the second any `!ARG2` and so on.
///
/// For instance, if you use `[CVCT_MASTER:BODY:!ARG1]`, then the creature variation can be
/// used like so: `[APPLY_CREATURE_VARIATION:VARIATION_ID:HUMANOID_SIMPLE]`, and this would
/// cause the token to function as `[CVCT_MASTER:BODY:HUMANOID_SIMPLE]`.
#[token_de(token = "CVCT_MASTER")]
pub cvct_master: Option<
AllowEmpty<(
Reference, // TODO: ref can be name of any token that nests under CREATURE
Option<(Vec<Any>,)>,
)>,
>,
/// **Warning: Incomplete token. This token is not yet properly implemented, and so you will
/// not get any hover text information from the arguments, autocomplete will not work, and
/// you will not be alerted to any errors.**
///
/// ---
/// Locates the specified parameters or portions of parameters, within all tokens specified
/// by `CVCT_MASTER`.
///
/// For example, this conversion block:
///
/// ```df_raw
/// [CV_CONVERT_TAG]
/// [CVCT_MASTER:STATE_NAME]
/// [CVCT_TARGET:adder]
/// ```
/// Will select every instance of `adder` in all arguments of all `STATE_NAME` tokens
/// in that creature, and *only* the portion saying `adder`:
///
/// ```df_raw
/// [STATE_NAME:ALL_SOLID:frozen adder venom]
/// [STATE_NAME:LIQUID:adder venom]
/// ```
/// You may target references and integers as well as strings, though be warned that integers
/// cannot be targeted exactly; for instance, `[CVCT_TARGET:1]` will select the `1` in `10`
/// or `101` as well.
///
/// You can target the token itself, for instance, you could replace the `[PET]` token
/// with `[PET_EXOTIC]`:
///
/// ```df_raw
/// [CV_CONVERT_TAG]
/// [CVCT_MASTER:PET]
/// [CVCT_TARGET:PET]
/// [CVCT_REPLACEMENT:PET_EXOTIC]
/// ```
/// Be warned however that it has not been tested whether subsequent arguments are deleted by this,
/// and they most likely are not, so this is likely only safe to use for tokens with no arguments
/// (like my example above).
///
/// If no `CVCT_TARGET` is given in the conversion block, or it is given no arguments,
/// or the only argument it is given is blank (i.e. `[CVCT_TARGET:]`), the game will freeze
/// when loading the creature.
///
/// You can replace any portion of the arguments of this token with `!ARGn`, with `n` being
/// a number (eg, `!ARG1`, `!ARG2` etc etc). When this creature variation is applied (using
/// `APPLY_CREATURE_VARIATION`), if any arguments other than the specified `CREATURE_VARIATION`
/// ID are given, these extra arguments will replace all instances of `!ARGn`, where
/// `n` is the index of the argument given to `APPLY_CREATURE_VARIATION`; the first argument
/// will replace any `!ARG1`, the second any `!ARG2` and so on.
///
/// For instance, if you use `[CVCT_TARGET:!ARG1 monster]`, then the creature variation can be
/// used like so: `[APPLY_CREATURE_VARIATION:VARIATION_ID:gila]`, and this would
/// cause the token to function as `[CVCT_TARGET:gila monster]`.
#[token_de(token = "CVCT_TARGET")]
pub cvct_target: Option<(Vec<Any>,)>,
/// **Warning: Incomplete token. This token is not yet properly implemented, and so you will
/// not get any hover text information from the arguments, autocomplete will not work, and
/// you will not be alerted to any errors.**
///
/// ---
/// Replaces the string specified by `CVCT_TARGET` within the tokens specified by `CVCT_MASTER`.
/// This means the targeted part of a token can be changed anywhere in the token, e.g:
///
/// ```df_raw
/// [CV_CONVERT_TAG]
/// [CVCT_MASTER:BODY]
/// [CVCT_TARGET:2EYES]
/// [CVCT_REPLACEMENT:2EYESTALKS]
/// ```
/// Would affect both of these:
///
/// ```df_raw
/// [BODY:QUADRUPED_NECK:NOSE:2LUNGS:BRAIN:2EYES]
/// [BODY:INSECT:2EYES:HEART:GUTS:BRAIN:MOUTH:2WINGS]
/// ```
/// Converting them into:
///
/// ```df_raw
/// [BODY:QUADRUPED_NECK:NOSE:2LUNGS:BRAIN:2EYESTALKS]
/// [BODY:INSECT:2EYESTALKS:HEART:GUTS:BRAIN:MOUTH:2WINGS]
/// ```
/// Colons can be included as part of both the target and the replacement string, for example:
///
/// ```df_raw
/// [CV_CONVERT_TAG]
/// [CVCT_MASTER:BODY]
/// [CVCT_TARGET:BASIC_1PARTBODY:BASIC_HEAD]
/// [CVCT_REPLACEMENT:HUMANOID:3FINGERS]
/// ```
/// Will convert `[BODY:BASIC_1PARTBODY:BASIC_HEAD:HEART:GUTS:BRAIN:MOUTH:2EYESTALKS]`, into
/// `[BODY:HUMANOID:3FINGERS:HEART:GUTS:BRAIN:MOUTH:2EYESTALKS]`. All occurrences of the target
/// string are replaced, for example:
/// ```df_raw
/// [CV_CONVERT_TAG]
/// [CVCT_MASTER:DESCRIPTION]
/// [CVCT_TARGET:TRAIT]
/// [CVCT_REPLACEMENT:modderiffic]
/// ```
/// Will convert `[DESCRIPTION:This is an example creature. It is TRAIT, very very TRAIT.]`,
/// into `[DESCRIPTION:This is an example creature. It is modderiffic, very very modderiffic.]`.
///
/// If no `CVCT_REPLACEMENT` is given, the target string is simply removed.
///
/// You can replace any portion of the arguments of this token with `!ARGn`, with `n` being
/// a number (eg, `!ARG1`, `!ARG2` etc etc). When this creature variation is applied (using
/// `APPLY_CREATURE_VARIATION`), if any arguments other than the specified `CREATURE_VARIATION`
/// ID are given, these extra arguments will replace all instances of `!ARGn`, where
/// `n` is the index of the argument given to `APPLY_CREATURE_VARIATION`; the first argument
/// will replace any `!ARG1`, the second any `!ARG2` and so on.
///
/// For instance, if you used:
///
/// ```df_raw
/// [CV_CONVERT_TAG]
/// [CVCT_MASTER:DESCRIPTION]
/// [CVCT_TARGET:TRAIT]
/// [CVCT_REPLACEMENT:!ARG1]
/// ```
/// Then the creature variation can be used like so:
/// `[APPLY_CREATURE_VARIATION:VARIATION_ID:mod-tastic]`, and this would allow you to change
/// the above example into `[DESCRIPTION:This is an example creature. It is mod-tastic, very very mod-tastic.]`.
#[token_de(token = "CVCT_REPLACEMENT")]
pub cvct_replacement: Option<(Vec<Any>,)>,
}