df_ls_structure 0.3.0-rc.1

A language server for Dwarf Fortress RAW files
Documentation
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
use crate::{
    AppModTypeEnum, AppearanceModifierEnum, BpAppModifersEnum, BpCriteriaTokenArg, BpEnum,
    CdiTokenArg, CeBodyMatInteractionTokenArg, CeBodyTransformationTokenArg,
    CeChangePersonalityTokenArg, CeMentAttChangeTokenArg, CePhysAttChangeTokenArg, CeTagsTokenArg,
    CeXNoSevTokenArg, CeXNoTargetTokenArg, CeXTokenArg, ClassEnum, CounterTriggerEnum,
    CounterTypesEnum, EmotionEnum, EmotionTypeEnum, FrequencyEnum, InteractionEnum,
    InteractionToken, MatMultEnum, MatTokenEnum, MaterialTokenArg, MoonPhaseEnum, NameEnum,
    NoneEnum, PercEnum, PercOnEnum, PeriodicTriggerEnum, RequiredEnum, ReservedBloodEnum,
    SpeedEnum, TileEnum,
};
use df_ls_core::{Choose, DFChar, Reference, ReferenceTo};
use df_ls_syntax_analysis::TokenDeserialize;
use serde::{Deserialize, Serialize};

type CeTokenArgs = Choose<
    (PeriodicTriggerEnum, MoonPhaseEnum, u32, u32),
    (
        CounterTriggerEnum,
        CounterTypesEnum,
        Choose<u32, NoneEnum>,
        Choose<u32, NoneEnum>,
        RequiredEnum,
    ),
>;

// region: Symptomatic Effects ====================================================================
/// Causes the targeted bodypart to undergo bruising.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeBruising {
    /// Arguments for `[CE_BRUISING:...]`
    #[token_de(token = "CE_BRUISING", on_duplicate_to_parent, primary_token)]
    pub ce_bruising: Option<CeXTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Covers the targeted bodypart with blisters.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeBlisters {
    /// Arguments for `[CE_BLISTERS:...]`
    #[token_de(token = "CE_BLISTERS", on_duplicate_to_parent, primary_token)]
    pub ce_blisters: Option<CeXTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Causes pus to ooze from the afflicted bodypart.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeOozing {
    /// Arguments for `[CE_OOZING:...]`
    #[token_de(token = "CE_OOZING", on_duplicate_to_parent, primary_token)]
    pub ce_oozing: Option<CeXTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Causes the targeted bodypart to start bleeding, with heavy enough bleeding resulting in the
/// death of the sufferer. Some conditions seem to cause bleeding to be fatal no matter how weak.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeBleeding {
    /// Arguments for `[CE_BLEEDING:...]`
    #[token_de(token = "CE_BLEEDING", on_duplicate_to_parent, primary_token)]
    pub ce_bleeding: Option<CeXTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Causes the targeted bodypart to swell up. Extreme swelling may lead to necrosis.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeSwelling {
    /// Arguments for `[CE_SWELLING:...]`
    #[token_de(token = "CE_SWELLING", on_duplicate_to_parent, primary_token)]
    pub ce_swelling: Option<CeXTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Causes the targeted bodypart to rot, with associated tissue damage, miasma emission and
/// bleeding. The victim slowly bleeds to death if the wound is not treated. Badly necrotic limbs
/// will require amputation.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeNecrosis {
    /// Arguments for `[CE_NECROSIS:...]`
    #[token_de(token = "CE_NECROSIS", on_duplicate_to_parent, primary_token)]
    pub ce_necrosis: Option<CeXTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Causes numbness in the affected body part, blocking pain. Extreme numbness may lead to sensory
/// nerve damage.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeNumbness {
    /// Arguments for `[CE_NUMBNESS:...]`
    #[token_de(token = "CE_NUMBNESS", on_duplicate_to_parent, primary_token)]
    pub ce_numbness: Option<CeXTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Afflicts the targeted bodypart with intense pain.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CePain {
    /// Arguments for `[CE_PAIN:...]`
    #[token_de(token = "CE_PAIN", on_duplicate_to_parent, primary_token)]
    pub ce_pain: Option<CeXTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Causes paralysis. Paralysis is complete paralysis and will cause suffocation in smaller
/// creatures. Paralysis on a limb may lead to motor nerve damage.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeParalysis {
    /// Arguments for `[CE_PARALYSIS:...]`
    #[token_de(token = "CE_PARALYSIS", on_duplicate_to_parent, primary_token)]
    pub ce_paralysis: Option<CeXTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// An organ afflicted with this `CE` is rendered inoperable - for example, if both lungs are
/// impaired the creature can't breathe and will suffocate. This token only affects organs, not
/// limbs. Note that this effect is currently bugged, and will not "turn off" until the creature
/// receives a wound to cause its body parts to update.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeImpairFunction {
    /// Arguments for `[CE_IMPAIR_FUNCTION:...]`
    #[token_de(token = "CE_IMPAIR_FUNCTION", on_duplicate_to_parent, primary_token)]
    pub ce_impair_function: Option<CeXTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Inflicts the Dizziness condition, occasional fainting and a general slowdown in movement and
/// work speed.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeDizziness {
    /// Arguments for `[CE_DIZZINESS:...]`
    #[token_de(token = "CE_DIZZINESS", on_duplicate_to_parent, primary_token)]
    pub ce_dizziness: Option<CeXNoTargetTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Causes the Drowsiness condition.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeDrowsiness {
    /// Arguments for `[CE_DROWSINESS:...]`
    #[token_de(token = "CE_DROWSINESS", on_duplicate_to_parent, primary_token)]
    pub ce_drowsiness: Option<CeXNoTargetTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Renders unconscious.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeUnconsciousness {
    /// Arguments for `[CE_UNCONSCIOUSNESS:...]`
    #[token_de(token = "CE_UNCONSCIOUSNESS", on_duplicate_to_parent, primary_token)]
    pub ce_unconsciousness: Option<CeXNoTargetTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Causes the Fever condition.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeFever {
    /// Arguments for `[CE_FEVER:...]`
    #[token_de(token = "CE_FEVER", on_duplicate_to_parent, primary_token)]
    pub ce_fever: Option<CeXNoTargetTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Causes the Nausea condition, and heavy vomiting. Can eventually lead to dehydration and death.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeNausea {
    /// Arguments for `[CE_NAUSEA:...]`
    #[token_de(token = "CE_NAUSEA", on_duplicate_to_parent, primary_token)]
    pub ce_nausea: Option<CeXNoTargetTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// This effect results in the sufferer periodically coughing blood, which stains the tile they're
/// on and requires cleanup. It doesn't appear to be lethal, but may cause minor bleeding damage.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeCoughBlood {
    /// Arguments for `[CE_COUGH_BLOOD:...]`
    #[token_de(token = "CE_COUGH_BLOOD", on_duplicate_to_parent, primary_token)]
    pub ce_cough_blood: Option<CeXNoTargetTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// This effect results in the sufferer periodically vomiting blood, which stains the tile they're
/// on and requires cleanup. It doesn't appear to be lethal, but may cause minor bleeding damage.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeVomitBlood {
    /// Arguments for `[CE_VOMIT_BLOOD:...]`
    #[token_de(token = "CE_VOMIT_BLOOD", on_duplicate_to_parent, primary_token)]
    pub ce_vomit_blood: Option<CeXNoTargetTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
// endregion ======================================================================================
// region: Healing Effects ========================================================================
/// Decreases the severity of pain produced by wounds or syndrome effects on the targeted bodypart.
/// The `SEV` value probably controls by how much the pain is decreased.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeReducePain {
    /// Arguments for `[CE_REDUCE_PAIN:...]`
    #[token_de(token = "CE_REDUCE_PAIN", on_duplicate_to_parent, primary_token)]
    pub ce_reduce_pain: Option<CeXTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Decreases the severity of swelling on the targeted bodypart.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeReduceSwelling {
    /// Arguments for `[CE_REDUCE_SWELLING:...]`
    #[token_de(token = "CE_REDUCE_SWELLING", on_duplicate_to_parent, primary_token)]
    pub ce_reduce_swelling: Option<CeXTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Decreases the severity of any paralysis effects on the targeted bodypart.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeReduceParalysis {
    /// Arguments for `[CE_REDUCE_PARALYSIS:...]`
    #[token_de(token = "CE_REDUCE_PARALYSIS", on_duplicate_to_parent, primary_token)]
    pub ce_reduce_paralysis: Option<CeXTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Decreases the severity of any dizziness the creature has.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeReduceDizziness {
    /// Arguments for `[CE_REDUCE_DIZZINESS:...]`
    #[token_de(token = "CE_REDUCE_DIZZINESS", on_duplicate_to_parent, primary_token)]
    pub ce_reduce_dizziness: Option<CeXNoTargetTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Decreases the severity of any nausea the creature has.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeReduceNausea {
    /// Arguments for `[CE_REDUCE_NAUSEA:...]`
    #[token_de(token = "CE_REDUCE_NAUSEA", on_duplicate_to_parent, primary_token)]
    pub ce_reduce_nausea: Option<CeXNoTargetTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Decreases the severity of any fever the creature has.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeReduceFever {
    /// Arguments for `[CE_REDUCE_FEVER:...]`
    #[token_de(token = "CE_REDUCE_FEVER", on_duplicate_to_parent, primary_token)]
    pub ce_reduce_fever: Option<CeXNoTargetTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Decreases the severity of the bleeding of any wounds or syndrome effects on the targeted
/// bodypart. The `SEV` value probably controls by how much the bleeding is decreased.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeStopBleeding {
    /// Arguments for `[CE_STOP_BLEEDING:...]`
    #[token_de(token = "CE_STOP_BLEEDING", on_duplicate_to_parent, primary_token)]
    pub ce_stop_bleeding: Option<CeXTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Closes any wounds on the targeted bodypart with speed depending on the `SEV` value.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeCloseOpenWounds {
    /// Arguments for `[CE_CLOSE_OPEN_WOUNDS:...]`
    #[token_de(token = "CE_CLOSE_OPEN_WOUNDS", on_duplicate_to_parent, primary_token)]
    pub ce_close_open_wounds: Option<CeXTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Probably decreases the severity of the infection from infected wounds over time.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeCureInfection {
    /// Arguments for `[CE_CURE_INFECTION:...]`
    #[token_de(token = "CE_CURE_INFECTION", on_duplicate_to_parent, primary_token)]
    pub ce_cure_infection: Option<CeXTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Heals the tissues of the targeted bodypart with speed depending on the `SEV` value.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeHealTissues {
    /// Arguments for `[CE_HEAL_TISSUES:...]`
    #[token_de(token = "CE_HEAL_TISSUES", on_duplicate_to_parent, primary_token)]
    pub ce_heal_tissues: Option<CeXTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Heals the nerves of the targeted bodypart with speed depending on the `SEV` value.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeHealNerves {
    /// Arguments for `[CE_HEAL_NERVES:...]`
    #[token_de(token = "CE_HEAL_NERVES", on_duplicate_to_parent, primary_token)]
    pub ce_heal_nerves: Option<CeXTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Causes missing bodyparts to regrow. `SEV` controls how quickly bodyparts are regrown.
///
/// In adventure, parts will be regrown until you travel or wait/sleep.
/// [Bug:0011396.](https://www.bay12games.com/dwarves/mantisbt/view.php?id=0011396)
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeRegrowParts {
    /// Arguments for `[CE_REGROW_PARTS:...]`
    #[token_de(token = "CE_REGROW_PARTS", on_duplicate_to_parent, primary_token)]
    pub ce_regrow_parts: Option<CeXTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
// endregion ======================================================================================
// region: Special Effects ========================================================================
/// Adds the specified tag(s) to the affected creature. Multiple tags can be specified sequentially
/// within a single effect token.
///
/// Adding tags will cause the creature to pass/fail any relevant `IT_REQUIRES`/`IT_FORBIDDEN` checks
/// (with the apparent exceptions of `FIT_FOR_ANIMATION` and `FIT_FOR_RESURRECTION`). Note that
/// `CE_REMOVE_TAG` overrides this effect.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeAddTag {
    /// Arguments for `[CE_ADD_TAG:...]`
    #[token_de(token = "CE_ADD_TAG", on_duplicate_to_parent, primary_token)]
    pub ce_add_tag: Option<CeTagsTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Removes the specified tag(s) from the affected creature. Multiple tags can be specified
/// sequentially within a single effect token.
///
/// If a particular tag is targeted by both `CE_REMOVE_TAG` and `CE_ADD_TAG`, and both effects are
/// active simultaneously, `CE_REMOVE_TAG` takes precedence (i.e. the overall effect is that of tag
/// removal for as long as `CE_REMOVE_TAG` remains active). The order in which the effects activate
/// doesn't affect this, not even if `CE_ADD_TAG` is added later/earlier via a different syndrome.
///
/// Removing tags will cause the creature to fail/pass any relevant `IT_REQUIRES`/`IT_FORBIDDEN` checks
/// (with the apparent exceptions of `FIT_FOR_ANIMATION` and `FIT_FOR_RESURRECTION`).
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeRemoveTag {
    /// Arguments for `[CE_REMOVE_TAG:...]`
    #[token_de(token = "CE_REMOVE_TAG", on_duplicate_to_parent, primary_token)]
    pub ce_remove_tag: Option<CeTagsTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Attaches the specified name to the creature's normal name.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeDisplayName {
    /// Arguments for `[CE_DISPLAY_NAME:...]`
    #[token_de(token = "CE_DISPLAY_NAME", on_duplicate_to_parent, primary_token)]
    pub ce_display_name: Option<(NameEnum, String, String, String, CeXNoSevTokenArg)>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Causes the creature to display the specified tile instead of its normal one.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeDisplayTile {
    /// Arguments for `[CE_DISPLAY_TILE:...]`
    #[token_de(token = "CE_DISPLAY_TILE", on_duplicate_to_parent, primary_token)]
    pub ce_display_tile: Option<(TileEnum, DFChar, u8, u8, u8, CeXNoSevTokenArg)>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Causes the creature to flash between its normal tile and the one specified here.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeFlashTile {
    /// Arguments for `[CE_FLASH_TILE:...]`
    #[token_de(token = "CE_FLASH_TILE", on_duplicate_to_parent, primary_token)]
    pub ce_flash_tile: Option<(
        TileEnum,
        DFChar,
        u8,
        u8,
        u8,
        FrequencyEnum,
        u32,
        u32,
        CeXNoSevTokenArg,
    )>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Alters the creature's specified physical attribute.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CePhysAttChange {
    /// Arguments for `[CE_PHYS_ATT_CHANGE:...]`
    #[token_de(token = "CE_PHYS_ATT_CHANGE", on_duplicate_to_parent, primary_token)]
    pub ce_phys_att_change: Option<CePhysAttChangeTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Alters the creature's specified mental attribute.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeMentAttChange {
    /// Arguments for `[CE_MENT_ATT_CHANGE:...]`
    #[token_de(token = "CE_MENT_ATT_CHANGE", on_duplicate_to_parent, primary_token)]
    pub ce_ment_att_change: Option<CeMentAttChangeTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Changes the creature's speed. The minimum and maximum speeds able to be created by
/// `CE_SPEED_CHANGE` are 99 and 10,000 respectively.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeSpeedChange {
    /// Arguments for `[CE_SPEED_CHANGE:...]`
    #[token_de(token = "CE_SPEED_CHANGE", on_duplicate_to_parent, primary_token)]
    pub ce_speed_change: Option<(SpeedEnum, i32, CeXNoSevTokenArg)>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Alters the creature's specified skill level. The argument `PERC` specifies a percentage of the
/// creature's current skill, and `PERC_ON` the probability of the effect being applied on a
/// particular roll.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeSkillRollAdjust {
    /// Arguments for `[CE_SKILL_ROLL_ADJUST:...]`
    #[token_de(token = "CE_SKILL_ROLL_ADJUST", on_duplicate_to_parent, primary_token)]
    pub ce_skill_roll_adjust: Option<(PercEnum, u8, PercOnEnum, u8, CeXNoSevTokenArg)>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Alters the size of the creature.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeBodyAppearanceModifier {
    /// Arguments for `[CE_BODY_APPEARANCE_MODIFIER:...]`
    #[token_de(token = "CE_BODY_APPEARANCE_MODIFIER")]
    pub ce_body_appearance_modifier: Option<(
        AppearanceModifierEnum,
        AppModTypeEnum,
        u32,
        CeXNoSevTokenArg,
    )>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Alters the characteristics (height, width etc.) of a body part.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeBpAppearanceModifier {
    /// Arguments for `[CE_BP_APPEARANCE_MODIFIER:...]`
    #[token_de(
        token = "CE_BP_APPEARANCE_MODIFIER",
        on_duplicate_to_parent,
        primary_token
    )]
    pub ce_bp_appearance_modifier: Option<(
        BpEnum,
        BpCriteriaTokenArg,
        AppearanceModifierEnum,
        BpAppModifersEnum,
        u32,
        CeXNoTargetTokenArg,
    )>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Makes the affected unit transform into a different creature. The target creature may either
/// be specified directly by following this with a `CE:CREATURE` token, or else set to be randomly
/// selected from a "pool" defined by additional `[CE:...]` tokens (of which multiple may be
/// specified).
///
/// Note that transformation into or out of the target form causes the creature to
/// drop all items in its inventory and instantly heals all of its wounds. If an undead limb
/// happens to be transformed, its entire body will regenerate upon transforming back.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeBodyTransformation {
    /// Arguments for `[CE_BODY_TRANSFORMATION:...]`
    #[token_de(
        token = "CE_BODY_TRANSFORMATION",
        on_duplicate_to_parent,
        primary_token
    )]
    pub ce_body_transformation: Option<CeXNoSevTokenArg>,
    /// Either specifies the details of what the creature transforms into, or prevents the syndrome
    /// effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<Choose<CeTokenArgs, CeBodyTransformationTokenArg>>,
}
/// When the affected creature is struck with a weapon made of the specified material, the force
/// exerted will be multiplied by A/B, thus making the creature more or less susceptible to this
/// material. For example, if A is 2 and B is 1, the force exerted by the defined material will
/// be doubled. If A is 1 and B is 2, it will be halved instead. `NONE:NONE` can be used in place
/// of a specific material token so as to make the effect applicable to all materials. Note that
/// this syndrome effect is equivalent to the `MATERIAL_FORCE_MULTIPLIER` creature token.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeMaterialForceMultiplier {
    /// Arguments for `[CE_MATERIAL_FORCE_MULTIPLIER:...]`
    #[token_de(
        token = "CE_MATERIAL_FORCE_MULTIPLIER",
        on_duplicate_to_parent,
        primary_token
    )]
    pub ce_material_force_multiplier: Option<(
        MatMultEnum,
        Choose<(NoneEnum, NoneEnum), MaterialTokenArg>,
        u32,
        u32,
        CeXNoSevTokenArg,
    )>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Makes the creature able to perform an interaction. Follow this effect token with
/// `[CDI:INTERACTION:<interaction name>]` to specify the desired interaction, and add other `CDI`
/// tokens as required.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeCanDoInteraction {
    /// Arguments for `[CE_CAN_DO_INTERACTION:...]`
    #[token_de(token = "CE_CAN_DO_INTERACTION", on_duplicate_to_parent, primary_token)]
    pub ce_can_do_interaction: Option<CeXNoSevTokenArg>,
    ///
    #[token_de(token = "CDI")]
    pub cdi: Vec<CdiTokenArg>,
}
/// Makes the creature able to perform an interaction when using an attack with a designated body
/// part/parts.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeSpecialAttackInteraction {
    /// Arguments for `[CE_SPECIAL_ATTACK_INTERACTION:...]`
    #[token_de(
        token = "CE_SPECIAL_ATTACK_INTERACTION",
        on_duplicate_to_parent,
        primary_token
    )]
    pub ce_special_attack_interaction: Option<(
        InteractionEnum,
        ReferenceTo<InteractionToken>,
        CeXNoSevTokenArg,
    )>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// This is used to tie an interaction to one of the creature’s body materials. Generated vampire
/// syndromes use this effect to make vampire blood pass on the vampirism curse when consumed.
///
/// The target body material is specified by inserting its `ID` as defined in the creature raws. For
/// example, when a syndrome with "`CE_BODY_MAT_INTERACTION:MAT_TOKEN:SWEAT`" is gained by a unit, the
/// effect will apply to any material defined as "SWEAT" in the creature raws of that unit, if such
/// a material is present.
///
/// This currently only works on materials obtained from historical figures. That is to say, the
/// material must bear the source unit's name, such as "Urist McVampire's dwarf blood" as opposed to
/// mere "dwarf blood".
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeBodyMatInteraction {
    /// Arguments for `[CE_BODY_MAT_INTERACTION:...]`
    #[token_de(
        token = "CE_BODY_MAT_INTERACTION",
        on_duplicate_to_parent,
        primary_token
    )]
    pub ce_body_mat_interaction: Option<(
        MatTokenEnum,
        Choose<ReservedBloodEnum, Reference>,
        CeXNoSevTokenArg,
    )>,
    /// Used to either specify how the body material triggers the interaction, or what interaction
    /// is actually used.
    #[token_de(token = "CE")]
    pub ce: Vec<CeBodyMatInteractionTokenArg>,
}
/// Provides the ability to sense creatures belonging to the specified creature class even when such
/// creatures lie far beyond line of sight, including through walls and floors. It also appears to
/// reduce or negate the combat penalty of blind units when fighting creatures they can sense. In
/// adventure mode, the specified tile will be used to represent sensed creatures when they cannot
/// be seen directly.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeSenseCreatureClass {
    /// Arguments for `[CE_SENSE_CREATURE_CLASS:...]`
    #[token_de(
        token = "CE_SENSE_CREATURE_CLASS",
        on_duplicate_to_parent,
        primary_token
    )]
    pub ce_sense_creature_class: Option<(
        ClassEnum,
        Reference,
        DFChar,
        u8,
        u8,
        u8,
        CeXNoTargetTokenArg,
    )>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Makes the creature feel a specific emotion. The effect's `SEV` value determines how intense
/// the emotion is. The creature also receives a thought in the following format: "`[creature]`
/// feels `[emotion]` due to `[syndrome name]`".
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeFeelEmotion {
    /// Arguments for `[CE_FEEL_EMOTION:...]`
    #[token_de(token = "CE_FEEL_EMOTION", on_duplicate_to_parent, primary_token)]
    pub ce_feel_emotion: Option<(EmotionEnum, EmotionTypeEnum, CeXNoTargetTokenArg)>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Changes a personality trait by the given amount. Multiple `FACET:<trait>:<amount>` sets may be
/// used, and `<amount>` can be negative. For example, generated necromancer syndromes come with
/// the following effect:
///
/// `[CE_CHANGE_PERSONALITY:FACET:ANXIETY_PROPENSITY:50:FACET:TRUST:-50:START:0:ABRUPT]`
///
/// According to Toady, `CE_CHANGE_PERSONALITY` effects can cause creatures to re-evaluate their
/// goals in worldgen; the boost to anxiety and distrust given to necromancers makes it more
/// likely for them to develop the goal of ruling the world.
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeChangePersonality {
    /// Arguments for `[CE_CHANGE_PERSONALITY:...]`
    #[token_de(token = "CE_CHANGE_PERSONALITY", on_duplicate_to_parent, primary_token)]
    pub ce_change_personality: Option<CeChangePersonalityTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
/// Causes erratic behavior, meaning "People that like to brawl have a chance of starting a brawl-
/// level fight with any nearby adult." -Toady
#[derive(Serialize, Deserialize, Clone, Debug, Default, TokenDeserialize, PartialEq, Eq)]
pub struct CeErraticBehavior {
    /// Arguments for `[CE_ERRATIC_BEHAVIOR:...]`
    #[token_de(token = "CE_ERRATIC_BEHAVIOR", on_duplicate_to_parent, primary_token)]
    pub ce_erratic_behavior: Option<CeXNoTargetTokenArg>,
    /// Used to prevent the syndrome effect being active unless certain conditions apply.
    #[token_de(token = "CE")]
    pub ce: Vec<CeTokenArgs>,
}
// endregion ======================================================================================