tiger-lib 1.18.0

Library used by the tools ck3-tiger, vic3-tiger, and imperator-tiger. This library holds the bulk of the code for them. It can be built either for ck3-tiger with the feature ck3, or for vic3-tiger with the feature vic3, or for imperator-tiger with the feature imperator, but not both at the same time.
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
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
use std::sync::LazyLock;

use crate::everything::Everything;
use crate::helpers::TigerHashMap;
use crate::helpers::expand_scopes_hoi4;
use crate::item::Item;
use crate::scopes::*;
use crate::token::Token;
use crate::trigger::Trigger;
use crate::validate::ListType;

use Trigger::*;

pub fn scope_trigger(name: &Token, data: &Everything) -> Option<(Scopes, Trigger)> {
    if data.item_exists(Item::Building, name.as_str()) {
        return Some((expand_scopes_hoi4(Scopes::State | Scopes::Country), Trigger::CompareValue));
    }
    if data.item_exists(Item::IdeologyGroup, name.as_str()) {
        return Some((expand_scopes_hoi4(Scopes::Country), Trigger::CompareValue));
    }
    if data.item_exists(Item::Resource, name.as_str()) {
        return Some((expand_scopes_hoi4(Scopes::Country), Trigger::CompareValue));
    }
    let name_lc = name.as_str().to_ascii_lowercase();
    TRIGGER_MAP.get(&*name_lc).copied()
}

static TRIGGER_MAP: LazyLock<TigerHashMap<&'static str, (Scopes, Trigger)>> = LazyLock::new(|| {
    let mut hash = TigerHashMap::default();
    for (from, s, trigger) in TRIGGER.iter().copied() {
        if let Scope(scopes) = trigger {
            hash.insert(s, (expand_scopes_hoi4(from), Scope(expand_scopes_hoi4(scopes))));
        } else {
            hash.insert(s, (expand_scopes_hoi4(from), trigger));
        }
    }
    hash
});

/// LAST UPDATED HOI4 VERSION 1.16.4
/// See `documentation/triggers_documentation.md` from the game files.
/// TODO HOI4
const TRIGGER: &[(Scopes, &str, Trigger)] = &[
    (Scopes::None, "add_to_temp_array", UncheckedTodo),
    (Scopes::None, "add_to_temp_variable", UncheckedTodo),
    (Scopes::Character, "advisor_can_be_fired", Boolean),
    (Scopes::Country, "agency_upgrade_number", CompareValue),
    (Scopes::Country, "ai_has_role_division", UncheckedTodo),
    (Scopes::Country, "ai_has_role_template", UncheckedTodo),
    (Scopes::Country, "ai_irrationality", CompareValue),
    (Scopes::Country, "ai_liberate_desire", Scope(Scopes::Country)),
    (Scopes::Country, "ai_wants_divisions", CompareValue),
    (Scopes::Country, "all_guaranteed_country", Iterator(ListType::All, Scopes::Country)),
    (Scopes::None, "all_of", UncheckedTodo),
    (Scopes::None, "all_of_scopes", Iterator(ListType::All, Scopes::all_but_none())),
    (
        Scopes::Country.union(Scopes::Operation),
        "all_operative_leader",
        Iterator(ListType::All, Scopes::Character),
    ),
    (Scopes::Country, "all_purchase_contracts", Iterator(ListType::All, Scopes::PurchaseContract)),
    (Scopes::Country, "all_scientists", Iterator(ListType::All, Scopes::Character)),
    (Scopes::Country, "all_subject_countries", Iterator(ListType::All, Scopes::Country)),
    (Scopes::Country, "alliance_naval_strength_ratio", CompareValue),
    (Scopes::Country, "alliance_strength_ratio", CompareValue),
    (Scopes::None, "always", Boolean),
    (Scopes::Country, "amount_manpower_in_deployment_queue", CompareValue),
    (Scopes::Country, "amount_research_slots", CompareValue),
    (Scopes::Country, "amount_taken_ideas", UncheckedTodo),
    (Scopes::None, "and", Control),
    (Scopes::Country, "any_claim", UncheckedTodo),
    (Scopes::Country, "any_country_division", Iterator(ListType::Any, Scopes::Division)),
    (Scopes::State, "any_country_with_core", Iterator(ListType::Any, Scopes::Country)),
    (Scopes::Country, "any_guaranteed_country", Iterator(ListType::Any, Scopes::Country)),
    (Scopes::Country, "any_home_area_neighbor_country", Iterator(ListType::Any, Scopes::Country)),
    (Scopes::None, "any_of", UncheckedTodo),
    (Scopes::None, "any_of_scopes", Iterator(ListType::Any, Scopes::all_but_none())),
    (
        Scopes::Country.union(Scopes::Operation),
        "any_operative_leader",
        Iterator(ListType::Any, Scopes::Character),
    ),
    (Scopes::State, "any_province_building_level", UncheckedTodo),
    (Scopes::Country, "any_purchase_contract", Iterator(ListType::Any, Scopes::PurchaseContract)),
    (Scopes::Country, "any_scientist", Iterator(ListType::Any, Scopes::Character)),
    (Scopes::State, "any_state_division", Iterator(ListType::Any, Scopes::Division)),
    (Scopes::None, "any_state_in", Iterator(ListType::Any, Scopes::State)),
    (Scopes::Country, "any_subject_country", Iterator(ListType::Any, Scopes::Country)),
    (Scopes::Country, "any_war_score", CompareValue),
    (Scopes::State, "area", UncheckedTodo),
    (Scopes::Combatant, "armor", UncheckedTodo),
    (
        Scopes::Country,
        "army_manpower_in_state",
        Block(&[("state", Item(Item::State)), ("amount", CompareValue)]),
    ),
    (Scopes::Character.union(Scopes::Combatant), "attack_skill_level", CompareValue),
    (Scopes::Character.union(Scopes::Combatant), "average_stats", CompareValue),
    (Scopes::State.union(Scopes::Country), "building_count_trigger", UncheckedTodo),
    (Scopes::PurchaseContract, "buyer", Scope(Scopes::Country)),
    (Scopes::Country.union(Scopes::Character), "can_be_country_leader", UncheckedTodo),
    (Scopes::None, "can_build_railway", UncheckedTodo),
    (Scopes::State, "can_construct_building", UncheckedTodo),
    (Scopes::Country, "can_declare_war_on", Scope(Scopes::Country)),
    (Scopes::Country, "can_research", Item(Item::Technology)),
    (Scopes::Character.union(Scopes::Combatant), "can_select_trait", UncheckedTodo),
    (Scopes::None, "career_profile_check_medal", UncheckedTodo),
    (Scopes::None, "career_profile_check_playthrough_ratio", UncheckedTodo),
    (Scopes::None, "career_profile_check_playthrough_value", UncheckedTodo),
    (Scopes::None, "career_profile_check_points", UncheckedTodo),
    (Scopes::None, "career_profile_check_ratio", UncheckedTodo),
    (Scopes::None, "career_profile_check_ribbon", UncheckedTodo),
    (Scopes::None, "career_profile_check_value", UncheckedTodo),
    (Scopes::None, "career_profile_has_player_flag", UncheckedTodo),
    (Scopes::None, "career_profile_set_temp_playthrough_variable", UncheckedTodo),
    (Scopes::None, "career_profile_set_temp_variable", UncheckedTodo),
    (Scopes::Country, "casualties", CompareValue),
    (
        Scopes::Country,
        "casualties_inflicted_by",
        Block(&[("opponent", Scope(Scopes::Country)), ("thousands", CompareValue)]),
    ),
    (Scopes::Country, "casualties_k", CompareValue),
    (Scopes::None, "check_variable", UncheckedTodo),
    (Scopes::Country, "civilwar_target", Scope(Scopes::Country)),
    (Scopes::None, "clamp_temp_variable", UncheckedTodo),
    (Scopes::None, "clear_temp_array", UncheckedTodo),
    (Scopes::Country, "command_power", CompareValue),
    (Scopes::Country, "command_power_daily", CompareValue),
    (Scopes::Country, "compare_autonomy_progress_ratio", CompareValue),
    (Scopes::Country, "compare_autonomy_state", UncheckedTodo),
    (Scopes::Country, "compare_intel_with", UncheckedTodo),
    (Scopes::State, "compliance", CompareValue),
    (Scopes::State, "compliance_speed", CompareValue),
    (Scopes::Country, "conscription_ratio", CompareValue),
    (Scopes::PurchaseContract, "contract_contains_equipment", UncheckedTodo),
    (Scopes::Country, "controls_province", Item(Item::Province)),
    (Scopes::Country, "controls_state", Scope(Scopes::State)),
    (Scopes::Country, "convoy_threat", CompareValue),
    (Scopes::Country, "core_compliance", UncheckedTodo),
    (Scopes::Country, "core_resistance", UncheckedTodo),
    (Scopes::None, "count_triggers", UncheckedTodo),
    (Scopes::None, "country_exists", Scope(Scopes::Country)),
    (Scopes::Country, "current_conscription_amount", CompareValue),
    (Scopes::None, "custom_override_tooltip", UncheckedTodo),
    (Scopes::None, "custom_trigger_tooltip", UncheckedTodo),
    (Scopes::None, "date", CompareDate),
    (Scopes::Country, "days_since_capitulated", CompareValue),
    (Scopes::State, "days_since_last_strategic_bombing", CompareValue),
    (Scopes::PurchaseContract, "deal_completion", CompareValue),
    (
        Scopes::Country,
        "decryption_progress",
        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
    ),
    (Scopes::Character.union(Scopes::Combatant), "defense_skill_level", CompareValue),
    (Scopes::None, "difficulty", CompareValue),
    (Scopes::Combatant, "dig_in", CompareValue),
    (
        Scopes::State,
        "distance_to",
        Block(&[("target", Scope(Scopes::State)), ("value", CompareValue)]),
    ),
    (Scopes::None, "divide_temp_variable", UncheckedTodo),
    (Scopes::Division, "division_has_battalion_in_template", UncheckedTodo),
    (Scopes::Division, "division_has_majority_template", UncheckedTodo),
    (Scopes::Country, "divisions_in_border_state", UncheckedTodo),
    (Scopes::Country, "divisions_in_state", UncheckedTodo),
    (Scopes::None, "else", Control),
    (Scopes::None, "else_if", Control),
    (Scopes::Country, "enemies_naval_strength_ratio", UncheckedTodo),
    (Scopes::Country, "enemies_strength_ratio", CompareValue),
    (Scopes::Country, "estimated_intel_max_armor", UncheckedTodo),
    (Scopes::Country, "estimated_intel_max_piercing", UncheckedTodo),
    (Scopes::Country, "exists", Boolean),
    (Scopes::Combatant, "fastest_unit", CompareValue),
    (Scopes::Country, "fighting_army_strength_ratio", UncheckedTodo),
    (Scopes::None, "find_highest_in_array", UncheckedTodo),
    (Scopes::None, "find_lowest_in_array", UncheckedTodo),
    (
        Scopes::Country,
        "focus_progress",
        Block(&[("focus", Item(Item::NationalFocus)), ("progress", CompareValue)]),
    ),
    (Scopes::Country, "foreign_manpower", UncheckedTodo),
    (Scopes::State, "free_building_slots", UncheckedTodo),
    (Scopes::Combatant, "frontage_full", Boolean),
    (Scopes::Country, "fuel_ratio", CompareValue),
    (Scopes::None, "game_rules_allow_achievements", Boolean),
    (Scopes::Country, "garrison_manpower_need", CompareValue),
    (Scopes::Country, "get_highest_scored_country_temp", UncheckedTodo),
    (Scopes::Country, "get_sorted_scored_countries_temp", UncheckedTodo),
    (Scopes::Country, "get_supply_vehicles_temp", UncheckedTodo),
    (Scopes::Country, "gives_military_access_to", Scope(Scopes::Country)),
    (Scopes::Combatant, "hardness", CompareValue),
    (Scopes::Character, "has_ability", Item(Item::Ability)),
    (Scopes::Country, "has_active_mission", UncheckedTodo),
    (Scopes::State, "has_active_resistance", UncheckedTodo),
    (Scopes::Country, "has_added_tension_amount", CompareValue),
    (Scopes::Character, "has_advisor_role", UncheckedTodo),
    (Scopes::Country, "has_air_experience", CompareValue),
    (Scopes::Character, "has_air_ledger", UncheckedTodo),
    (Scopes::Country, "has_allowed_idea_with_traits", UncheckedTodo),
    (Scopes::Country, "has_annex_war_goal", UncheckedTodo),
    (Scopes::None, "has_any_custom_difficulty_setting", UncheckedTodo),
    (Scopes::Country, "has_any_license", UncheckedTodo),
    (Scopes::Country, "has_any_power_balance", UncheckedTodo),
    (Scopes::Country, "has_army_experience", CompareValue),
    (Scopes::Character, "has_army_ledger", UncheckedTodo),
    (Scopes::Country, "has_army_manpower", UncheckedTodo),
    (Scopes::Country, "has_army_size", UncheckedTodo),
    (Scopes::Combatant, "has_artillery_ratio", CompareValue),
    (Scopes::Country, "has_attache", UncheckedTodo),
    (Scopes::Country, "has_attache_from", UncheckedTodo),
    (Scopes::Country, "has_autonomy_state", UncheckedTodo),
    (Scopes::Country, "has_available_idea_with_traits", UncheckedTodo),
    (Scopes::Country, "has_bombing_war_support", CompareValue),
    (Scopes::State.union(Scopes::Country), "has_border_war", UncheckedTodo),
    (Scopes::None, "has_border_war_between", UncheckedTodo),
    (Scopes::State.union(Scopes::Country), "has_border_war_with", UncheckedTodo),
    (Scopes::Country, "has_breakthrough_points", UncheckedTodo),
    (Scopes::Country, "has_built", UncheckedTodo),
    (Scopes::Country, "has_capitulated", UncheckedTodo),
    (Scopes::Country, "has_captured_operative", UncheckedTodo),
    (Scopes::Combatant, "has_carrier_airwings_in_own_combat", UncheckedTodo),
    (Scopes::Combatant, "has_carrier_airwings_on_mission", UncheckedTodo),
    (Scopes::Country, "has_casualties_war_support", CompareValue),
    (Scopes::Combatant, "has_cavalry_ratio", UncheckedTodo),
    (Scopes::Country, "has_character", UncheckedTodo),
    (
        Scopes::Character,
        "has_character_flag",
        FlagOrBlock(&[
            ("flag", Flag),
            ("?value", CompareValue),
            ("?days", CompareValue),
            ("?date", CompareDate),
        ]),
    ),
    (Scopes::Country, "has_civil_war", Boolean),
    (
        Scopes::Country,
        "has_collaboration",
        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
    ),
    (Scopes::Combatant, "has_combat_modifier", UncheckedTodo),
    (Scopes::None, "has_completed_custom_achievement", Item(Item::Achievement)),
    (Scopes::Country, "has_completed_focus", UncheckedTodo),
    (Scopes::State.union(Scopes::Country), "has_contested_owner", UncheckedTodo),
    (Scopes::Country, "has_convoys_war_support", CompareValue),
    (Scopes::Country, "has_core_occupation_modifier", UncheckedTodo),
    (Scopes::Country, "has_cosmetic_tag", UncheckedTodo),
    (Scopes::Country, "has_country_custom_difficulty_setting", UncheckedTodo),
    (
        Scopes::Country,
        "has_country_flag",
        FlagOrBlock(&[
            ("flag", Flag),
            ("?value", CompareValue),
            ("?days", CompareValue),
            ("?date", CompareDate),
        ]),
    ),
    (Scopes::Country, "has_country_leader", UncheckedTodo),
    (Scopes::Country, "has_country_leader_ideology", UncheckedTodo),
    (Scopes::Country, "has_country_leader_with_trait", UncheckedTodo),
    (Scopes::None, "has_custom_difficulty_setting", UncheckedTodo),
    (Scopes::Country, "has_damaged_buildings", UncheckedTodo),
    (Scopes::Country, "has_decision", UncheckedTodo),
    (Scopes::Country, "has_defensive_war", Boolean),
    (Scopes::Country, "has_defensive_war_with", UncheckedTodo),
    (Scopes::Country, "has_deployed_air_force_size", UncheckedTodo),
    (Scopes::Country, "has_design_based_on", UncheckedTodo),
    (Scopes::None, "has_dlc", UncheckedTodo),
    (Scopes::Country, "has_done_agency_upgrade", UncheckedTodo),
    (
        Scopes::State.union(Scopes::Country).union(Scopes::Character),
        "has_dynamic_modifier",
        UncheckedTodo,
    ),
    (Scopes::Country, "has_elections", UncheckedTodo),
    (Scopes::Country, "has_equipment", UncheckedTodo),
    (Scopes::None, "has_event_target", UncheckedTodo),
    (Scopes::Country, "has_facility_specialization", UncheckedTodo),
    (Scopes::Country, "has_finished_collecting_for_operation", UncheckedTodo),
    (Scopes::Combatant, "has_flanked_opponent", UncheckedTodo),
    (Scopes::Country, "has_focus_tree", UncheckedTodo),
    (Scopes::Country, "has_fuel", CompareValue),
    (Scopes::Country, "has_full_control_of_state", UncheckedTodo),
    (Scopes::None, "has_game_rule", UncheckedTodo),
    (
        Scopes::None,
        "has_global_flag",
        FlagOrBlock(&[
            ("flag", Flag),
            ("?value", CompareValue),
            ("?days", CompareValue),
            ("?date", CompareDate),
        ]),
    ),
    (Scopes::Country, "has_government", UncheckedTodo),
    (Scopes::Country, "has_guaranteed", UncheckedTodo),
    (Scopes::Character, "has_id", UncheckedTodo),
    (Scopes::Country, "has_idea", UncheckedTodo),
    (Scopes::Country, "has_idea_with_trait", UncheckedTodo),
    (Scopes::Character, "has_ideology", UncheckedTodo),
    (Scopes::Character, "has_ideology_group", UncheckedTodo),
    (Scopes::Country, "has_intelligence_agency", UncheckedTodo),
    (Scopes::Country, "has_legitimacy", CompareValueWarnEq),
    (Scopes::Country, "has_license", UncheckedTodo),
    (Scopes::Country, "has_manpower", CompareValueWarnEq),
    (Scopes::Country, "has_manpower_for_recruit_change_to", UncheckedTodo),
    (Scopes::Country, "has_market_access_with", UncheckedTodo),
    (Scopes::Combatant, "has_max_planning", UncheckedTodo),
    (Scopes::Country, "has_military_access_to", UncheckedTodo),
    (Scopes::Country, "has_military_industrial_organization", UncheckedTodo),
    (Scopes::Country, "has_mined", UncheckedTodo),
    (Scopes::Country, "has_mines", UncheckedTodo),
    (Scopes::IndustrialOrg, "has_mio_equipment_type", UncheckedTodo),
    (
        Scopes::IndustrialOrg,
        "has_mio_flag",
        FlagOrBlock(&[
            ("flag", Flag),
            ("?value", CompareValue),
            ("?days", CompareValue),
            ("?date", CompareDate),
        ]),
    ),
    (Scopes::IndustrialOrg, "has_mio_number_of_completed_traits", UncheckedTodo),
    (Scopes::IndustrialOrg, "has_mio_policy", UncheckedTodo),
    (Scopes::IndustrialOrg, "has_mio_policy_active", UncheckedTodo),
    (Scopes::IndustrialOrg, "has_mio_research_category", UncheckedTodo),
    (Scopes::IndustrialOrg, "has_mio_size", CompareValue),
    (Scopes::IndustrialOrg, "has_mio_trait", UncheckedTodo),
    (Scopes::Character, "has_nationality", UncheckedTodo),
    (Scopes::Country, "has_naval_invasion_against_state", UncheckedTodo),
    (Scopes::Country, "has_navy_experience", CompareValue),
    (Scopes::Character, "has_navy_ledger", UncheckedTodo),
    (Scopes::Country, "has_navy_size", UncheckedTodo),
    (Scopes::Country, "has_non_aggression_pact_with", UncheckedTodo),
    (Scopes::State, "has_occupation_modifier", UncheckedTodo),
    (Scopes::Country, "has_offensive_war", UncheckedTodo),
    (Scopes::Country, "has_offensive_war_with", UncheckedTodo),
    (Scopes::Division, "has_officer_name", UncheckedTodo),
    (Scopes::Country, "has_operation_token", UncheckedTodo),
    (Scopes::Country, "has_opinion", UncheckedTodo),
    (Scopes::Country, "has_opinion_modifier", UncheckedTodo),
    (Scopes::Country, "has_political_power", CompareValue),
    (Scopes::Country, "has_power_balance", UncheckedTodo),
    (Scopes::None, "has_power_balance_modifier", UncheckedTodo),
    (
        Scopes::SpecialProject,
        "has_project_flag",
        FlagOrBlock(&[
            ("flag", Flag),
            ("?value", CompareValue),
            ("?days", CompareValue),
            ("?date", CompareDate),
        ]),
    ),
    (Scopes::None, "has_railway_connection", UncheckedTodo),
    (Scopes::None, "has_railway_level", UncheckedTodo),
    (Scopes::Country, "has_relation_modifier", UncheckedTodo),
    (Scopes::Combatant, "has_reserves", UncheckedTodo),
    (Scopes::State, "has_resistance", UncheckedTodo),
    (Scopes::State, "has_resources_amount", UncheckedTodo),
    (Scopes::Country, "has_resources_in_country", UncheckedTodo),
    (Scopes::State.union(Scopes::Country), "has_resources_rights", UncheckedTodo),
    (Scopes::None, "has_rule", UncheckedTodo),
    (Scopes::Character, "has_scientist_level", UncheckedTodo),
    (Scopes::Country, "has_scientist_specialization", UncheckedTodo),
    (Scopes::Country, "has_shine_effect_on_focus", UncheckedTodo),
    (Scopes::Country, "has_stability", CompareValue),
    (Scopes::None, "has_start_date", CompareDate),
    (Scopes::State, "has_state_category", UncheckedTodo),
    (
        Scopes::State,
        "has_state_flag",
        FlagOrBlock(&[
            ("flag", Flag),
            ("?value", CompareValue),
            ("?days", CompareValue),
            ("?date", CompareDate),
        ]),
    ),
    (Scopes::Country, "has_subject", UncheckedTodo),
    (Scopes::Country, "has_tech", UncheckedTodo),
    (Scopes::Country, "has_tech_bonus", UncheckedTodo),
    (Scopes::Country, "has_template", UncheckedTodo),
    (Scopes::Country, "has_template_ai_majority_unit", UncheckedTodo),
    (Scopes::Country, "has_template_containing_unit", UncheckedTodo),
    (Scopes::Country, "has_template_majority_unit", UncheckedTodo),
    (Scopes::Country, "has_terrain", UncheckedTodo),
    (Scopes::Character.union(Scopes::Combatant), "has_trait", UncheckedTodo),
    (Scopes::Country, "has_truce_with", UncheckedTodo),
    (Scopes::Country, "has_unit_leader", UncheckedTodo),
    (
        Scopes::Character,
        "has_unit_leader_flag",
        FlagOrBlock(&[
            ("flag", Flag),
            ("?value", CompareValue),
            ("?days", CompareValue),
            ("?date", CompareDate),
        ]),
    ),
    (Scopes::Combatant, "has_unit_type", UncheckedTodo),
    (Scopes::None, "has_variable", UncheckedTodo),
    (Scopes::Country, "has_volunteers_amount_from", UncheckedTodo),
    (Scopes::Country, "has_war", UncheckedTodo),
    (Scopes::Country, "has_war_support", CompareValue),
    (Scopes::Country, "has_war_together_with", UncheckedTodo),
    (Scopes::Country, "has_war_with", UncheckedTodo),
    (Scopes::Country, "has_war_with_major", UncheckedTodo),
    (Scopes::Country, "has_war_with_wargoal_against", UncheckedTodo),
    (Scopes::Country, "has_wargoal_against", UncheckedTodo),
    (
        Scopes::State
            .union(Scopes::Country)
            .union(Scopes::Character)
            .union(Scopes::Combatant)
            .union(Scopes::Ace)
            .union(Scopes::StrategicRegion)
            .union(Scopes::Operation)
            .union(Scopes::IndustrialOrg)
            .union(Scopes::PurchaseContract)
            .union(Scopes::RaidInstance)
            .union(Scopes::SpecialProject),
        "hidden_trigger",
        UncheckedTodo,
    ),
    (Scopes::Country, "ic_ratio", UncheckedTodo),
    (Scopes::Country, "ideology_support_trigger", UncheckedTodo),
    (Scopes::None, "if", Control),
    (Scopes::State, "impassable", UncheckedTodo),
    (Scopes::Country, "intel_level_over", UncheckedTodo),
    (Scopes::Country, "is_active_decryption_bonuses_enabled", UncheckedTodo),
    (Scopes::Character, "is_active_scientist", UncheckedTodo),
    (Scopes::Character, "is_advisor", UncheckedTodo),
    (Scopes::Country, "is_ai", UncheckedTodo),
    (Scopes::Character, "is_air_chief", UncheckedTodo),
    (Scopes::Country, "is_ally_with", UncheckedTodo),
    (Scopes::Combatant, "is_amphibious_invasion", UncheckedTodo),
    (Scopes::Character, "is_army_chief", UncheckedTodo),
    (Scopes::Character, "is_army_leader", UncheckedTodo),
    (Scopes::Character, "is_assigned", UncheckedTodo),
    (Scopes::Combatant, "is_attacker", UncheckedTodo),
    (Scopes::State, "is_border_conflict", UncheckedTodo),
    (Scopes::Character.union(Scopes::Combatant), "is_border_war", UncheckedTodo),
    (Scopes::State, "is_capital", UncheckedTodo),
    (Scopes::Character, "is_character", UncheckedTodo),
    (Scopes::Character, "is_character_slot", UncheckedTodo),
    (Scopes::State, "is_claimed_by", UncheckedTodo),
    (Scopes::State, "is_coastal", UncheckedTodo),
    (Scopes::State, "is_controlled_by", UncheckedTodo),
    (Scopes::State, "is_core_of", UncheckedTodo),
    (Scopes::Character, "is_corps_commander", UncheckedTodo),
    (Scopes::Character, "is_country_leader", UncheckedTodo),
    (Scopes::Country, "is_cryptology_department_active", UncheckedTodo),
    (Scopes::None, "is_debug", UncheckedTodo),
    (Scopes::Country, "is_decrypting", UncheckedTodo),
    (Scopes::Combatant, "is_defender", UncheckedTodo),
    (Scopes::State, "is_demilitarized_zone", UncheckedTodo),
    (Scopes::Country, "is_dynamic_country", UncheckedTodo),
    (Scopes::Country, "is_embargoed_by", UncheckedTodo),
    (Scopes::Country, "is_embargoing", UncheckedTodo),
    (Scopes::Country, "is_exile_host", UncheckedTodo),
    (Scopes::Country, "is_exiled_in", UncheckedTodo),
    (Scopes::Character, "is_exiled_leader", UncheckedTodo),
    (Scopes::Character, "is_exiled_leader_from", UncheckedTodo),
    (Scopes::Country, "is_faction_leader", UncheckedTodo),
    (Scopes::Country.union(Scopes::Character).union(Scopes::Ace), "is_female", UncheckedTodo),
    (Scopes::Character, "is_field_marshal", UncheckedTodo),
    (Scopes::Combatant, "is_fighting_air_units", UncheckedTodo),
    (Scopes::Combatant, "is_fighting_in_terrain", UncheckedTodo),
    (Scopes::Combatant, "is_fighting_in_weather", UncheckedTodo),
    (Scopes::State, "is_fully_controlled_by", UncheckedTodo),
    (Scopes::Country, "is_fully_decrypted", UncheckedTodo),
    (Scopes::Country, "is_government_in_exile", UncheckedTodo),
    (Scopes::Country, "is_guaranteed_by", UncheckedTodo),
    (Scopes::Character, "is_high_command", UncheckedTodo),
    (Scopes::Character, "is_hired_as_advisor", UncheckedTodo),
    (Scopes::None, "is_historical_focus_on", UncheckedTodo),
    (Scopes::Country, "is_hosting_exile", UncheckedTodo),
    (Scopes::None, "is_in_array", UncheckedTodo),
    (Scopes::Country, "is_in_faction", UncheckedTodo),
    (Scopes::Country, "is_in_faction_with", UncheckedTodo),
    (Scopes::State, "is_in_home_area", UncheckedTodo),
    (Scopes::Country, "is_in_peace_conference", UncheckedTodo),
    (Scopes::Country, "is_in_tech_sharing_group", UncheckedTodo),
    (Scopes::None, "is_ironman", UncheckedTodo),
    (Scopes::State, "is_island_state", UncheckedTodo),
    (Scopes::Country, "is_justifying_wargoal_against", UncheckedTodo),
    (Scopes::Character, "is_leading_army", UncheckedTodo),
    (Scopes::Character, "is_leading_army_group", UncheckedTodo),
    (Scopes::Character.union(Scopes::Combatant), "is_leading_volunteer_group", UncheckedTodo),
    (
        Scopes::Character.union(Scopes::Combatant),
        "is_leading_volunteer_group_with_original_country",
        UncheckedTodo,
    ),
    (Scopes::Country, "is_lend_leasing", UncheckedTodo),
    (Scopes::Country, "is_licensing_any_to", UncheckedTodo),
    (Scopes::Country, "is_licensing_to", UncheckedTodo),
    (Scopes::Country, "is_major", UncheckedTodo),
    (Scopes::IndustrialOrg, "is_military_industrial_organization", UncheckedTodo),
    (Scopes::IndustrialOrg, "is_mio_assigned_to_task", UncheckedTodo),
    (Scopes::IndustrialOrg, "is_mio_available", UncheckedTodo),
    (Scopes::IndustrialOrg, "is_mio_trait_available", UncheckedTodo),
    (Scopes::IndustrialOrg, "is_mio_trait_completed", UncheckedTodo),
    (Scopes::IndustrialOrg, "is_mio_visible", UncheckedTodo),
    (Scopes::Character, "is_navy_chief", UncheckedTodo),
    (Scopes::Character, "is_navy_leader", UncheckedTodo),
    (Scopes::Country, "is_neighbor_of", UncheckedTodo),
    (Scopes::State, "is_on_continent", UncheckedTodo),
    (Scopes::State, "is_one_state_island", UncheckedTodo),
    (Scopes::Operation, "is_operation_type", UncheckedTodo),
    (Scopes::Character, "is_operative", UncheckedTodo),
    (Scopes::Character, "is_operative_captured", UncheckedTodo),
    (Scopes::State, "is_owned_and_controlled_by", UncheckedTodo),
    (Scopes::State, "is_owned_by", UncheckedTodo),
    (Scopes::Country, "is_owner_neighbor_of", UncheckedTodo),
    (Scopes::Character, "is_political_advisor", UncheckedTodo),
    (Scopes::None, "is_power_balance_in_range", UncheckedTodo),
    (Scopes::None, "is_power_balance_side_active", UncheckedTodo),
    (Scopes::Country, "is_preparing_operation", UncheckedTodo),
    (Scopes::Country, "is_puppet", UncheckedTodo),
    (Scopes::Country, "is_puppet_of", UncheckedTodo),
    (Scopes::Country, "is_researching_technology", UncheckedTodo),
    (Scopes::Country, "is_running_operation", UncheckedTodo),
    (Scopes::Character, "is_scientist_injured", UncheckedTodo),
    (Scopes::Country, "is_special_project_being_researched", UncheckedTodo),
    (Scopes::Country, "is_special_project_completed", UncheckedTodo),
    (Scopes::Country, "is_spymaster", UncheckedTodo),
    (Scopes::Country, "is_staging_coup", UncheckedTodo),
    (Scopes::Country, "is_subject", UncheckedTodo),
    (Scopes::Country, "is_subject_of", UncheckedTodo),
    (Scopes::Country, "is_target_of_coup", UncheckedTodo),
    (Scopes::Character, "is_theorist", UncheckedTodo),
    (Scopes::None, "is_tutorial", UncheckedTodo),
    (Scopes::Character, "is_unit_leader", UncheckedTodo),
    (Scopes::Division, "is_unit_template_reserves", UncheckedTodo),
    (Scopes::Combatant, "is_winning", UncheckedTodo),
    (Scopes::Country, "land_doctrine_level", UncheckedTodo),
    (Scopes::Combatant, "less_combat_width_than_opponent", UncheckedTodo),
    (Scopes::None, "log", UncheckedTodo),
    (Scopes::Character.union(Scopes::Combatant), "logistics_skill_level", UncheckedTodo),
    (Scopes::Country, "longest_war_length", CompareValue),
    (Scopes::Country, "manpower_per_military_factory", CompareValue),
    (
        Scopes::State
            .union(Scopes::Country)
            .union(Scopes::Character)
            .union(Scopes::Combatant)
            .union(Scopes::Ace)
            .union(Scopes::StrategicRegion)
            .union(Scopes::Operation)
            .union(Scopes::IndustrialOrg)
            .union(Scopes::PurchaseContract)
            .union(Scopes::RaidInstance)
            .union(Scopes::SpecialProject),
        "meta_trigger",
        UncheckedTodo,
    ),
    (Scopes::Combatant, "min_planning", UncheckedTodo),
    (Scopes::Country, "mine_threat", UncheckedTodo),
    (Scopes::None, "modulo_temp_variable", UncheckedTodo),
    (Scopes::None, "multiply_temp_variable", UncheckedTodo),
    (Scopes::Country, "naval_strength_comparison", UncheckedTodo),
    (Scopes::Country, "naval_strength_ratio", UncheckedTodo),
    (Scopes::Country, "network_national_coverage", UncheckedTodo),
    (Scopes::Country, "network_strength", UncheckedTodo),
    (Scopes::Combatant, "night", UncheckedTodo),
    (Scopes::State, "non_damaged_building_level", UncheckedTodo),
    (Scopes::None, "not", Control),
    (Scopes::Character, "not_already_hired_except_as", Item(Item::AdvisorSlot)),
    (Scopes::Country, "num_battalions_in_states", CompareValue),
    (Scopes::Country, "num_divisions", CompareValue),
    (Scopes::Country, "num_divisions_in_states", CompareValue),
    (Scopes::Country, "num_faction_members", CompareValue),
    (Scopes::Country, "num_fake_intel_divisions", CompareValue),
    (Scopes::Country, "num_finished_operations", CompareValue),
    (Scopes::Country, "num_free_operative_slots", CompareValue),
    (Scopes::Country, "num_nukes_being_dropped", CompareValue),
    (Scopes::Country, "num_nukes_left_to_drop", CompareValue),
    (Scopes::Country, "num_occupied_states", CompareValue),
    (Scopes::Country, "num_of_available_civilian_factories", CompareValue),
    (Scopes::Country, "num_of_available_military_factories", CompareValue),
    (Scopes::Country, "num_of_available_naval_factories", CompareValue),
    (Scopes::None, "num_of_career_profile_points", CompareValue),
    (Scopes::Country, "num_of_civilian_factories", CompareValue),
    (Scopes::Country, "num_of_civilian_factories_available_for_projects", CompareValue),
    (Scopes::Country, "num_of_controlled_factories", CompareValue),
    (Scopes::Country, "num_of_controlled_states", CompareValue),
    (Scopes::Country, "num_of_factories", CompareValue),
    (Scopes::Country, "num_of_military_factories", CompareValue),
    (Scopes::Country, "num_of_naval_factories", CompareValue),
    (Scopes::Country, "num_of_nukes", CompareValue),
    (Scopes::Country, "num_of_operatives", CompareValue),
    (Scopes::Country, "num_of_owned_factories", CompareValue),
    (Scopes::Country, "num_of_supply_nodes", CompareValue),
    (Scopes::Country, "num_operative_slots", CompareValue),
    (Scopes::State, "num_owned_neighbour_states", CompareValue),
    (Scopes::Country, "num_planes_stationed_in_regions", UncheckedTodo),
    (Scopes::Country, "num_researched_technologies", CompareValue),
    (Scopes::Country, "num_subjects", CompareValue),
    (Scopes::Country, "num_tech_sharing_groups", CompareValue),
    (Scopes::Character, "num_units", CompareValue),
    (Scopes::State.union(Scopes::Country), "occupation_law", UncheckedTodo),
    (Scopes::State, "occupied_country_tag", UncheckedTodo),
    (Scopes::Character, "operative_leader_mission", UncheckedTodo),
    (Scopes::Character, "operative_leader_operation", UncheckedTodo),
    (Scopes::None, "or", Control),
    (Scopes::Country, "original_research_slots", CompareValue),
    (Scopes::Country, "original_tag", Scope(Scopes::Country)),
    (Scopes::Country, "owns_any_state_of", UncheckedTodo),
    (Scopes::Country, "owns_state", UncheckedTodo),
    (Scopes::Country, "pc_current_score", UncheckedTodo),
    (Scopes::State, "pc_does_state_stack_demilitarized", UncheckedTodo),
    (Scopes::State, "pc_does_state_stack_dismantled", UncheckedTodo),
    (Scopes::Country, "pc_is_forced_government", UncheckedTodo),
    (Scopes::Country, "pc_is_forced_government_by", UncheckedTodo),
    (Scopes::Country, "pc_is_forced_government_to", UncheckedTodo),
    (Scopes::Country, "pc_is_liberated", UncheckedTodo),
    (Scopes::Country, "pc_is_loser", UncheckedTodo),
    (Scopes::Country, "pc_is_on_same_side_as", UncheckedTodo),
    (Scopes::Country, "pc_is_on_winning_side", UncheckedTodo),
    (Scopes::Country, "pc_is_puppeted", UncheckedTodo),
    (Scopes::Country, "pc_is_puppeted_by", UncheckedTodo),
    (Scopes::State, "pc_is_state_claimed", UncheckedTodo),
    (Scopes::State, "pc_is_state_claimed_and_taken_by", UncheckedTodo),
    (Scopes::State, "pc_is_state_claimed_by", UncheckedTodo),
    (Scopes::State, "pc_is_state_outside_influence_for_winner", UncheckedTodo),
    (Scopes::Country, "pc_is_winner", UncheckedTodo),
    (Scopes::Country, "pc_total_score", UncheckedTodo),
    (Scopes::None, "pc_turn", UncheckedTodo),
    (Scopes::Combatant, "phase", UncheckedTodo),
    (Scopes::Character.union(Scopes::Combatant), "planning_skill_level", UncheckedTodo),
    (Scopes::Country, "political_power_daily", CompareValue),
    (Scopes::Country, "political_power_growth", CompareValue),
    (Scopes::None, "power_balance_daily_change", UncheckedTodo),
    (Scopes::None, "power_balance_value", UncheckedTodo),
    (Scopes::None, "power_balance_weekly_change", UncheckedTodo),
    (Scopes::None, "print_variables", UncheckedTodo),
    (Scopes::Combatant, "province_vp", CompareValue),
    (Scopes::Country, "received_expeditionary_forces", UncheckedTodo),
    (Scopes::Combatant, "recon_advantage", UncheckedTodo),
    (Scopes::State, "region", UncheckedTodo),
    (Scopes::None, "remove_from_temp_array", UncheckedTodo),
    (Scopes::Combatant, "reserves", UncheckedTodo),
    (Scopes::State, "resistance", CompareValue),
    (Scopes::State, "resistance_speed", UncheckedTodo),
    (Scopes::State, "resistance_target", UncheckedTodo),
    (Scopes::None, "resize_temp_array", UncheckedTodo),
    (Scopes::State.union(Scopes::Country), "resource_count_trigger", UncheckedTodo),
    (Scopes::None, "round_temp_variable", UncheckedTodo),
    (Scopes::None, "scope_exists", UncheckedTodo),
    (Scopes::PurchaseContract, "seller", UncheckedTodo),
    (Scopes::None, "set_temp_variable", UncheckedTodo),
    (Scopes::None, "set_temp_variable_to_random", UncheckedTodo),
    (Scopes::Country, "ships_in_area", UncheckedTodo),
    (Scopes::Country, "ships_in_state_ports", UncheckedTodo),
    (Scopes::Character.union(Scopes::Combatant), "skill", CompareValue),
    (Scopes::Combatant, "skill_advantage", CompareValue),
    (Scopes::State, "state", UncheckedTodo),
    (Scopes::State, "state_and_terrain_strategic_value", UncheckedTodo),
    (Scopes::State, "state_population", CompareValue),
    (Scopes::State, "state_population_k", CompareValue),
    (Scopes::State, "state_strategic_value", UncheckedTodo),
    (Scopes::Country, "stockpile_ratio", UncheckedTodo),
    (Scopes::Country, "strength_ratio", UncheckedTodo),
    (Scopes::None, "subtract_from_temp_variable", UncheckedTodo),
    (Scopes::Country, "surrender_progress", CompareValue),
    (Scopes::Country.union(Scopes::Combatant), "tag", UncheckedTodo),
    (Scopes::Country, "target_conscription_amount", UncheckedTodo),
    (Scopes::Combatant, "temperature", CompareValue),
    (Scopes::None, "threat", CompareValue),
    (Scopes::Division, "unit_organization", CompareValue),
    (Scopes::Division, "unit_strength", UncheckedTodo),
    (Scopes::Country, "war_length_with", UncheckedTodo),
];