Skip to main content

tiger_lib/vic3/tables/
triggers.rs

1use std::sync::LazyLock;
2
3use crate::everything::Everything;
4use crate::helpers::TigerHashMap;
5use crate::item::Item;
6use crate::scopes::*;
7use crate::token::Token;
8use crate::trigger::Trigger;
9use crate::vic3::tables::misc::*;
10
11use Trigger::*;
12
13pub fn scope_trigger(name: &Token, _data: &Everything) -> Option<(Scopes, Trigger)> {
14    let name_lc = name.as_str().to_ascii_lowercase();
15    TRIGGER_MAP.get(&*name_lc).copied()
16}
17
18static TRIGGER_MAP: LazyLock<TigerHashMap<&'static str, (Scopes, Trigger)>> = LazyLock::new(|| {
19    let mut hash = TigerHashMap::default();
20    for (from, s, trigger) in TRIGGER.iter().copied() {
21        hash.insert(s, (from, trigger));
22    }
23    hash
24});
25
26/// LAST UPDATED VIC3 VERSION 1.12.2
27/// See `triggers.log` from the game data dumps
28/// A key ends with '(' if it is the version that takes a parenthesized argument in script.
29const TRIGGER: &[(Scopes, &str, Trigger)] = &[
30    (Scopes::None, "active_lens", UncheckedTodo), // no examples in vanilla
31    (Scopes::None, "active_lens_option", UncheckedTodo), // no examples in vanilla
32    // TODO: warn if this is in an any_ iterator and not at the end
33    (Scopes::all_but_none(), "add_to_temporary_list", Special),
34    (Scopes::Country, "additional_war_exhaustion", CompareValue),
35    (Scopes::Character, "age", CompareValue),
36    (Scopes::Country, "aggressive_diplomatic_plays_permitted", Boolean),
37    (Scopes::Ship, "ai_ship_value", CompareValue),
38    (Scopes::None, "all_false", Control),
39    (Scopes::None, "always", Boolean),
40    (Scopes::Amendment, "amendment_can_be_repealed", Boolean),
41    (Scopes::Law, "amendment_count", CompareValue),
42    (
43        Scopes::Character.union(Scopes::InterestGroup).union(Scopes::PoliticalMovement),
44        "amendment_stance",
45        Block(&[
46            ("amendment", Scope(Scopes::Amendment)),
47            ("value", CompareChoiceOrNumber(APPROVALS)),
48        ]),
49    ),
50    (Scopes::Country, "additional_war_exhaustion", CompareValue),
51    (Scopes::Country, "additional_war_exhaustion", CompareValue),
52    (Scopes::None, "and", Control),
53    (Scopes::None, "any_false", Control),
54    (Scopes::PoliticalLobby, "appeasement", CompareValue),
55    (Scopes::Country, "approaching_bureaucracy_shortage", Boolean),
56    (Scopes::State, "arable_land", CompareValue),
57    (Scopes::Country, "arable_land_country", CompareValue),
58    (Scopes::Ship, "armor", CompareValue),
59    (
60        Scopes::Country,
61        "army_mobilization_option_fraction",
62        Block(&[("target", Scope(Scopes::MobilizationOption)), ("value", CompareValue)]),
63    ),
64    (Scopes::Country, "army_power_projection", CompareValue),
65    (Scopes::Country, "army_reserves", Removed("1.6", "")),
66    (Scopes::None, "assert_if", Block(&[("limit", Control), ("?text", UncheckedValue)])),
67    (Scopes::None, "assert_read", UncheckedValue),
68    (Scopes::Country, "authority", CompareValue),
69    (Scopes::Country, "authority_usage", CompareValue),
70    (Scopes::State, "available_jobs", CompareValue),
71    (Scopes::Country, "average_country_infrastructure", CompareValue),
72    (Scopes::Country, "average_incorporated_country_infrastructure", CompareValue),
73    (
74        Scopes::Country,
75        "average_sol_for_culture",
76        Block(&[("target", Scope(Scopes::Culture)), ("value", CompareValue)]),
77    ),
78    (Scopes::Country, "average_sol_for_primary_cultures", CompareValue),
79    (
80        Scopes::Country,
81        "average_sol_for_religion",
82        Block(&[("target", Scope(Scopes::Religion)), ("value", CompareValue)]),
83    ),
84    (Scopes::Country, "average_sol_for_slaves", CompareValue),
85    (Scopes::Country, "battalion_manpower", Removed("1.6", "")),
86    (Scopes::Battle, "battle_side_pm_usage", Removed("1.6", "")),
87    (Scopes::Treaty.union(Scopes::TreatyOptions), "binds", Scope(Scopes::Country)),
88    (Scopes::State, "blockade_level", CompareValue),
89    (Scopes::Building, "building_has_goods_shortage", Boolean),
90    (Scopes::Country, "bureaucracy", CompareValue),
91    (Scopes::Country, "bureaucracy_usage", CompareValue),
92    (Scopes::None, "calc_true_if", Control),
93    (
94        Scopes::State,
95        "can_activate_production_method",
96        Block(&[
97            ("building_type", Item(Item::BuildingType)),
98            ("production_method", Item(Item::ProductionMethod)),
99        ]),
100    ),
101    (Scopes::Country, "can_add_wargoal_against", Removed("1.12", "no direct replacement")),
102    (
103        Scopes::Country,
104        "can_afford_diplomatic_action",
105        Block(&[("target", Scope(Scopes::Country)), ("type", Item(Item::DiplomaticAction))]),
106    ),
107    (Scopes::Character, "can_agitate", Scope(Scopes::Country)),
108    (Scopes::Law, "can_be_enacted", Boolean),
109    (
110        Scopes::Country,
111        "can_break_diplomatic_pact",
112        Block(&[
113            ("target", Scope(Scopes::Country)),
114            ("type", Item(Item::DiplomaticAction)),
115            ("?first_state", Scope(Scopes::State)),
116            ("?second_state", Scope(Scopes::State)),
117        ]),
118    ),
119    (Scopes::State, "can_construct_building", Item(Item::BuildingType)),
120    (
121        Scopes::Country,
122        "can_create_diplomatic_pact",
123        Block(&[
124            ("target", Scope(Scopes::Country)),
125            ("type", Item(Item::DiplomaticAction)),
126            ("?first_state", Scope(Scopes::State)),
127            ("?second_state", Scope(Scopes::State)),
128        ]),
129    ),
130    (Scopes::None, "can_create_treaty", Special),
131    (Scopes::Country, "can_decrease_autonomy", Boolean),
132    (
133        Scopes::Country,
134        "can_establish_any_export_route",
135        Removed("1.9", "replaced with world market system"),
136    ),
137    (
138        Scopes::Country,
139        "can_establish_any_import_route",
140        Removed("1.9", "replaced with world market system"),
141    ),
142    (Scopes::Country, "can_establish_company", Boolean),
143    (Scopes::Country, "can_form_nation", Item(Item::Country)),
144    (
145        Scopes::Country,
146        "can_have_as_subject",
147        Block(&[("who", Scope(Scopes::Country)), ("type", Item(Item::SubjectType))]),
148    ),
149    (Scopes::StrategicRegion, "can_have_declared_interest_here", Removed("1.13", "")),
150    (Scopes::Country, "can_have_political_movement", Removed("1.8", "")),
151    (Scopes::Country, "can_have_subjects", Boolean),
152    (Scopes::Country, "can_increase_autonomy", Boolean),
153    (Scopes::PowerBloc, "can_invite_any_country", Boolean),
154    (Scopes::Country, "can_leave_power_bloc", Boolean),
155    (Scopes::Country, "can_lobbies_target", Scope(Scopes::Country)),
156    (Scopes::Country, "can_own_autonomy_be_decreased", Boolean),
157    (Scopes::Company, "can_potentially_produce_prestige_goods", Item(Item::PrestigeGoods)),
158    (Scopes::Building, "can_queue_building_levels", CompareValue),
159    (Scopes::Country, "can_research", Item(Item::Technology)),
160    (
161        Scopes::Country,
162        "can_send_diplomatic_action",
163        Block(&[
164            ("target", Scope(Scopes::Country)),
165            ("type", Item(Item::DiplomaticAction)),
166            ("?first_state", Scope(Scopes::State)),
167            ("?second_state", Scope(Scopes::State)),
168        ]),
169    ),
170    (Scopes::None, "can_start_tutorial_lesson", Item(Item::TutorialLesson)),
171    (
172        Scopes::Country,
173        "can_take_on_scaled_debt",
174        Block(&[("who", Scope(Scopes::Country)), ("value", CompareValue)]),
175    ),
176    (Scopes::Country, "can_transfer_subject", Scope(Scopes::Country)),
177    (Scopes::Country, "can_trigger_event", Item(Item::Event)),
178    (Scopes::Building, "cash_reserves_available", CompareValue),
179    (Scopes::Building, "cash_reserves_ratio", CompareValue),
180    (
181        Scopes::Character,
182        "character_acceptance",
183        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
184    ),
185    (
186        Scopes::Character,
187        "character_is_discriminated",
188        Removed("1.8", "replaced with character_acceptance"),
189    ),
190    (Scopes::Character, "character_supports_political_movement", Boolean),
191    (
192        Scopes::Country
193            .union(Scopes::Province)
194            .union(Scopes::Market)
195            .union(Scopes::State)
196            .union(Scopes::StateRegion)
197            .union(Scopes::StrategicRegion)
198            .union(Scopes::Theater),
199        "check_area",
200        Block(&[
201            ("mode", Choice(&["adjacent"])),
202            (
203                "target",
204                Scope(
205                    Scopes::Country
206                        .union(Scopes::Province)
207                        .union(Scopes::Market)
208                        .union(Scopes::State)
209                        .union(Scopes::StateRegion)
210                        .union(Scopes::StrategicRegion)
211                        .union(Scopes::Theater),
212                ),
213            ),
214        ]),
215    ),
216    (Scopes::CivilWar, "civil_war_progress", CompareValue),
217    (Scopes::Character, "commander_is_available", Boolean),
218    (Scopes::Character, "commander_pm_usage", Removed("1.6", "")),
219    (Scopes::Character, "commander_rank", CompareValue),
220    (Scopes::Company, "company_employed_levels", CompareValue),
221    (Scopes::Company, "company_global_productivity_comparison", CompareValue),
222    (Scopes::Company, "company_has_building_type_monopoly", Scope(Scopes::BuildingType)),
223    (Scopes::Company, "company_has_monopoly", Boolean),
224    (Scopes::Company, "company_is_prosperous", Boolean),
225    (Scopes::Company, "company_owned_levels", CompareValue),
226    (Scopes::Company, "company_productivity", CompareValue),
227    (Scopes::Company, "company_prosperity", CompareValue),
228    (Scopes::Country, "construction_queue_duration", CompareValue),
229    (Scopes::Country, "construction_queue_government_duration", CompareValue),
230    (Scopes::Country, "construction_queue_num_queued_government_levels", CompareValue),
231    (Scopes::Country, "construction_queue_num_queued_levels", CompareValue),
232    (Scopes::Country, "construction_queue_num_queued_private_levels", CompareValue),
233    (Scopes::Country, "construction_queue_private_duration", CompareValue),
234    (Scopes::StateRegion, "contains_capital_of", ScopeOrItem(Scopes::Country, Item::Country)),
235    (Scopes::State, "controls_treaty_port_province", Boolean),
236    (Scopes::Character, "could_support_political_movement", Scope(Scopes::PoliticalMovement)),
237    (
238        Scopes::Country,
239        "country_army_unit_type_fraction",
240        Block(&[("target", Scope(Scopes::CombatUnitType)), ("value", CompareValue)]),
241    ),
242    (
243        Scopes::Country,
244        "country_average_cultural_acceptance",
245        Block(&[("target", Scope(Scopes::Culture)), ("value", CompareValue)]),
246    ),
247    (
248        Scopes::Country,
249        "country_average_culture_and_religion_pop_acceptance",
250        Block(&[
251            ("culture", Scope(Scopes::Culture)),
252            ("religion", Scope(Scopes::Religion)),
253            ("value", CompareValue),
254        ]),
255    ),
256    (
257        Scopes::Country,
258        "country_average_culture_pop_acceptance",
259        Block(&[("culture", Scope(Scopes::Culture)), ("value", CompareValue)]),
260    ),
261    (
262        Scopes::Country,
263        "country_average_religion_pop_acceptance",
264        Block(&[("religion", Scope(Scopes::Religion)), ("value", CompareValue)]),
265    ),
266    (
267        Scopes::Country,
268        "country_average_religious_acceptance",
269        Block(&[("target", Scope(Scopes::Religion)), ("value", CompareValue)]),
270    ),
271    (Scopes::Country, "country_can_have_mass_migration_to", Scope(Scopes::Country)), // undocumented
272    (Scopes::CountryDefinition, "country_definition_has_culture", Scope(Scopes::Culture)),
273    (Scopes::Country, "country_fervor_primary_culture", CompareValue),
274    (
275        Scopes::Country,
276        "country_has_building_group_levels",
277        Block(&[("type", Item(Item::BuildingGroup)), ("value", CompareValue)]),
278    ),
279    (Scopes::Country, "country_has_building_levels", CompareValue),
280    (
281        Scopes::Country,
282        "country_has_building_type_levels",
283        Block(&[("target", Scope(Scopes::BuildingType)), ("value", CompareValue)]),
284    ),
285    (Scopes::Country, "country_has_building_type_monopoly", Scope(Scopes::BuildingType)),
286    (Scopes::Country, "country_has_country_monopoly", Boolean),
287    (Scopes::MarketGoods, "country_has_local_shortage", Scope(Scopes::Country)),
288    (Scopes::Country, "country_has_primary_culture", Scope(Scopes::Culture)),
289    (Scopes::Country, "country_has_state_religion", Scope(Scopes::Religion)),
290    (Scopes::Country, "country_innovation", CompareValue),
291    (
292        Scopes::Country,
293        "country_navy_unit_type_fraction",
294        Removed("1.13", "replaced with `country_ship_type_fraction`"),
295    ),
296    (Scopes::Country, "country_or_subject_owns_entire_state_region", Item(Item::StateRegion)),
297    (Scopes::Building, "country_ownership_fraction", CompareValue),
298    (Scopes::Country, "country_pm_usage", Removed("1.6", "")),
299    (Scopes::Country, "country_rank", CompareValue),
300    (Scopes::Country, "country_ship_type_fraction", UncheckedTodo),
301    (
302        Scopes::Country,
303        "country_ship_type_fraction",
304        Block(&[("target", Scope(Scopes::ShipType)), ("value", CompareValue)]),
305    ),
306    (Scopes::Country, "country_tier", ItemOrCompareValue(Item::CountryTier)),
307    (Scopes::Country, "country_turmoil", CompareValue),
308    (Scopes::Ship, "crew", CompareValue),
309    (Scopes::Ship, "crew_percent", CompareValue),
310    (Scopes::Pop, "culture_accepted", Removed("1.8", "")),
311    (
312        Scopes::Country,
313        "cultural_acceptance_base",
314        Block(&[("target", Scope(Scopes::Culture)), ("value", CompareValue)]),
315    ),
316    (
317        Scopes::State,
318        "cultural_acceptance_delta",
319        Block(&[("target", Scope(Scopes::Culture)), ("value", CompareValue)]),
320    ),
321    (
322        Scopes::Culture,
323        "culture_can_have_mass_migration_to",
324        Removed("1.6", "replaced with culture_can_have_mass_migration_to_country"),
325    ),
326    (Scopes::Culture, "culture_can_have_mass_migration_to_country", Scope(Scopes::Country)),
327    (Scopes::Culture, "culture_current_fervor", CompareValue),
328    (Scopes::Culture, "culture_has_community_in_state", Scope(Scopes::State)),
329    (Scopes::Culture, "culture_has_national_awakening", Boolean),
330    (Scopes::Culture, "culture_is_discriminated_in", Removed("1.8", "")),
331    (Scopes::Culture, "culture_national_awakening_occurred", Boolean),
332    (
333        Scopes::Country,
334        "culture_percent_country",
335        Block(&[("target", Scope(Scopes::Culture)), ("value", CompareValue)]),
336    ),
337    (
338        Scopes::State,
339        "culture_percent_state",
340        Block(&[("target", Scope(Scopes::Culture)), ("value", CompareValue)]),
341    ),
342    (
343        Scopes::Culture,
344        "culture_secession_progress",
345        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
346    ),
347    (Scopes::Culture, "culture_target_fervor", CompareValue),
348    (Scopes::PowerBloc, "current_cohesion_number", CompareValue),
349    (Scopes::PowerBloc, "current_cohesion_percentage", CompareValue),
350    (Scopes::Country, "current_law_enactment_score", CompareValue),
351    (Scopes::BattleSide, "current_manpower", CompareValue),
352    (Scopes::None, "current_tooltip_depth", CompareValue),
353    (Scopes::None, "custom_description", Control),
354    (Scopes::None, "custom_tooltip", Special),
355    (Scopes::None, "day_value", CompareValue),
356    (Scopes::None, "daynight_value", CompareValue),
357    (Scopes::Ship, "days_obsolete", CompareValue),
358    (Scopes::None, "debug_log", UncheckedTodo),
359    (Scopes::None, "debug_log_details", Boolean),
360    (Scopes::Pop, "dependents", CompareValue),
361    (Scopes::State, "devastation", CompareValue),
362    (Scopes::DiplomaticPlay, "diplomatic_play_pm_usage", Removed("1.6", "")),
363    (Scopes::Country, "discriminates_religion", ScopeOrItem(Scopes::Religion, Item::Religion)),
364    (Scopes::Building, "earnings", CompareValue),
365    (
366        Scopes::Country,
367        "economic_dependence",
368        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
369    ),
370    (Scopes::Party, "election_momentum", CompareValue),
371    (Scopes::Country, "electoral_confidence", CompareValue),
372    (Scopes::Country, "empty_agitator_slots", CompareValue),
373    (Scopes::Country, "enacting_any_law", Boolean),
374    (Scopes::Country, "enactment_chance", CompareValue),
375    (
376        Scopes::Country,
377        "enactment_chance_for_law",
378        Block(&[("target", Scope(Scopes::LawType)), ("value", CompareValue)]),
379    ),
380    (
381        Scopes::Country,
382        "enactment_chance_for_law_without_enactment_modifier",
383        Block(&[("target", Scope(Scopes::LawType)), ("value", CompareValue)]),
384    ),
385    (Scopes::Country, "enactment_chance_without_enactment_modifier", CompareValue),
386    (Scopes::Country, "enactment_phase", CompareValue),
387    (Scopes::Country, "enactment_setback_count", CompareValue),
388    (
389        Scopes::Country,
390        "enemy_contested_wargoals",
391        Block(&[("target", Scope(Scopes::War)), ("value", CompareValue)]),
392    ),
393    (Scopes::Country, "enemy_occupation", CompareValue),
394    (Scopes::None, "error_check", Removed("1.7", "")),
395    (Scopes::DiplomaticPlay, "escalation", CompareValue),
396    (Scopes::None, "exists", Special),
397    (
398        Scopes::Country,
399        "expanding_institution",
400        ScopeOrItem(Scopes::InstitutionType, Item::Institution),
401    ),
402    (Scopes::Character, "experience_level", CompareValue),
403    (Scopes::StateGoods, "export_advantage", CompareValue),
404    (Scopes::StateGoods, "export_tariff_level", CompareValue),
405    (Scopes::Country, "fixed_expenses", CompareValueWarnEq),
406    (Scopes::Country, "fixed_income", CompareValueWarnEq),
407    (Scopes::Country, "flotilla_manpower", Removed("1.6", "")),
408    (Scopes::Pop, "food_security", CompareValue),
409    (
410        Scopes::MilitaryFormation,
411        "formation_army_unit_type_fraction",
412        Block(&[("target", Scope(Scopes::CombatUnitType)), ("value", CompareValue)]),
413    ),
414    (
415        Scopes::MilitaryFormation,
416        "formation_navy_unit_type_fraction",
417        Removed("1.13", "replaced with `formation_ship_type_fraction`"),
418    ),
419    (
420        Scopes::MilitaryFormation,
421        "formation_ship_type_fraction",
422        Block(&[("target", Scope(Scopes::ShipType)), ("value", CompareValue)]),
423    ),
424    (
425        Scopes::Building,
426        "fraction_of_levels_owned_by_country",
427        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
428    ),
429    (Scopes::State, "free_arable_land", CompareValue),
430    (Scopes::PowerBloc, "free_principle_slots", CompareValue),
431    (Scopes::Front, "front_side_pm_usage", Removed("1.6", "")),
432    (Scopes::None, "game_date", CompareDate),
433    (
434        Scopes::Country,
435        "gdp_ownership_ratio",
436        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
437    ),
438    (Scopes::Country, "gdp_per_capita_ranking", CompareValue),
439    (Scopes::Country, "gdp_ranking", CompareValue),
440    (
441        Scopes::Country,
442        "goods_production_rank",
443        Block(&[("target", Scope(Scopes::Goods)), ("value", CompareValue)]),
444    ),
445    (Scopes::Country, "global_country_ranking", CompareValue),
446    (Scopes::None, "global_population", CompareValue),
447    (
448        Scopes::None,
449        "global_variable_list_size",
450        Block(&[("name", Identifier("list name")), ("value", CompareValue)]),
451    ),
452    (Scopes::Country, "gold_reserves", CompareValue),
453    (Scopes::Country, "gold_reserves_limit", CompareValue),
454    (Scopes::Country, "government_legitimacy", CompareValue),
455    (Scopes::Country, "government_transfer_of_power", Item(Item::TransferOfPower)),
456    (Scopes::Country, "government_wage_level", CompareChoice(LEVELS)),
457    (Scopes::Country, "government_wage_level_value", CompareValue),
458    (
459        Scopes::HarvestCondition,
460        "harvest_condition_intensity",
461        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
462    ),
463    (Scopes::None, "has_account_item", UncheckedValue),
464    (Scopes::Market.union(Scopes::State), "has_active_building", Item(Item::BuildingType)),
465    (Scopes::Country, "has_active_peace_deal", Boolean),
466    (Scopes::Building, "has_active_production_method", Item(Item::ProductionMethod)),
467    (Scopes::Law, "has_amendment", Scope(Scopes::AmendmentType)),
468    (Scopes::Country, "has_any_law_commitment", Boolean),
469    (Scopes::Country, "has_any_naval_only_hostilities", Boolean),
470    (Scopes::Country, "has_any_strait_control", Scope(Scopes::Country)),
471    (Scopes::Country, "has_any_strait_province", Scope(Scopes::Country)),
472    (Scopes::Country, "has_any_subventions_on", Scope(Scopes::Goods)),
473    (Scopes::Country, "has_any_secessionists_broken_out", Boolean),
474    (Scopes::Country, "has_any_secessionists_growing", Boolean),
475    (Scopes::Country, "has_any_secessionists_possible", Removed("1.8", "")),
476    (Scopes::Country, "has_any_tariffs_on", Scope(Scopes::Goods)),
477    (Scopes::State, "has_assimilating_pops", Boolean),
478    (
479        Scopes::Country,
480        "has_attitude",
481        Block(&[("who", Scope(Scopes::Country)), ("attitude", Item(Item::Attitude))]),
482    ),
483    (Scopes::BattleSide, "has_battle_condition", Item(Item::BattleCondition)),
484    (
485        Scopes::Country.union(Scopes::Market).union(Scopes::State).union(Scopes::StateRegion),
486        "has_building",
487        Item(Item::BuildingType),
488    ),
489    (Scopes::PoliticalMovement, "has_character_ideology", Item(Item::Ideology)),
490    (Scopes::Country, "has_civil_war_from_movement_type", Scope(Scopes::PoliticalMovementType)),
491    (
492        Scopes::Country,
493        "has_claim",
494        Scope(Scopes::State.union(Scopes::StateRegion).union(Scopes::Country)),
495    ),
496    (Scopes::State, "has_claim_by", Scope(Scopes::Country)),
497    (
498        Scopes::Character,
499        "has_commander_order",
500        ScopeOrItem(Scopes::CommanderOrderType, Item::CommanderOrder),
501    ),
502    (Scopes::Country, "has_company", ScopeOrItem(Scopes::CompanyType, Item::CompanyType)),
503    (Scopes::Country, "has_completed_subgoal", Item(Item::ObjectiveSubgoal)),
504    (Scopes::Country, "has_consumption_tax", Scope(Scopes::Goods)),
505    (Scopes::State, "has_converting_pops", Boolean),
506    (Scopes::Country, "has_convoys_being_sunk", Boolean),
507    (Scopes::PoliticalMovement, "has_core_ideology", Boolean),
508    (Scopes::None, "has_cosmetic_dlc", UncheckedTodo),
509    (Scopes::None, "has_cosmetic_dlc_feature", UncheckedTodo),
510    (Scopes::State, "has_cultural_community", Scope(Scopes::Culture)),
511    (Scopes::Culture, "has_cultural_obsession", Item(Item::Goods)),
512    (Scopes::Character, "has_culture", Scope(Scopes::Character.union(Scopes::Culture))),
513    (Scopes::Culture, "has_culture_graphics", Item(Item::CultureGraphics)),
514    (Scopes::Country, "has_decreasing_interests", Removed("1.13", "")),
515    (Scopes::State, "has_decree", Item(Item::Decree)),
516    (Scopes::Building, "has_deployed_units", Boolean),
517    // TODO: limit the type to diplomatic actions that have pacts
518    (
519        Scopes::Country,
520        "has_diplomatic_pact",
521        Block(&[
522            ("who", Scope(Scopes::Country)),
523            ("type", Item(Item::DiplomaticAction)),
524            ("?is_initiator", Boolean),
525        ]),
526    ),
527    (Scopes::StrategicRegion, "has_diplomatic_play", Boolean),
528    (Scopes::Country, "has_diplomatic_relevance", Scope(Scopes::Country)),
529    (Scopes::Country, "has_diplomats_expelled", Scope(Scopes::Country)),
530    (
531        Scopes::Culture.union(Scopes::Religion),
532        "has_discrimination_trait",
533        Item(Item::DiscriminationTrait),
534    ),
535    (
536        Scopes::Culture.union(Scopes::Religion),
537        "has_discrimination_trait_group",
538        Item(Item::DiscriminationTraitGroup),
539    ),
540    (Scopes::None, "has_dlc_feature", Item(Item::DlcFeature)),
541    (
542        Scopes::Building,
543        "has_employee_slots_filled",
544        Block(&[("pop_type", Item(Item::PopType)), ("percent", CompareValue)]),
545    ),
546    (
547        Scopes::Country,
548        "has_export_priority_tariffs",
549        Removed("1.9", "replaced with world market system"),
550    ),
551    (Scopes::Building, "has_failed_hires", Boolean),
552    (Scopes::Country.union(Scopes::State), "has_famine", Boolean),
553    (Scopes::Country, "has_free_government_reform", Boolean),
554    (Scopes::None, "has_game_rule", Item(Item::GameRuleSetting)),
555    (Scopes::None, "has_game_started", Boolean),
556    (Scopes::None, "has_gameplay_dlc", UncheckedTodo),
557    (Scopes::Country, "has_global_highest_gdp", Boolean),
558    (Scopes::Country, "has_global_highest_innovation", Boolean),
559    (Scopes::None, "has_global_variable", Identifier("variable name")),
560    (Scopes::None, "has_global_variable_list", Identifier("list name")),
561    (Scopes::Country, "has_government_clout", CompareValue),
562    (Scopes::Country, "has_government_type", Item(Item::GovernmentType)),
563    (Scopes::StateRegion, "has_harvest_condition", Item(Item::HarvestConditionType)),
564    (Scopes::Country, "has_healthy_economy", Boolean),
565    (Scopes::MilitaryFormation, "has_high_attrition", Boolean),
566    (Scopes::Culture, "has_homeland", Scope(Scopes::State.union(Scopes::StateRegion))),
567    (Scopes::PowerBloc, "has_identity", Scope(Scopes::PowerBlocIdentity)),
568    (
569        Scopes::Character.union(Scopes::InterestGroup).union(Scopes::PoliticalMovement),
570        "has_ideology",
571        ScopeOrItem(Scopes::Ideology, Item::Ideology),
572    ),
573    (
574        Scopes::Country,
575        "has_import_priority_tariffs",
576        Removed("1.9", "replaced with world market system"),
577    ),
578    (Scopes::Country, "has_inactive_journal_entry", Item(Item::JournalEntry)),
579    (Scopes::Country, "has_institution", ScopeOrItem(Scopes::InstitutionType, Item::Institution)),
580    (Scopes::Country, "has_insurrectionary_interest_groups", Boolean),
581    (
582        Scopes::Country,
583        "has_interest_marker_in_region",
584        ScopeOrItem(Scopes::StrategicRegion, Item::StrategicRegion),
585    ),
586    (Scopes::Country, "has_journal_entry", Item(Item::JournalEntry)),
587    (Scopes::Province, "has_label", Item(Item::TerrainLabel)),
588    (Scopes::Country, "has_law", Scope(Scopes::LawType)),
589    (Scopes::Country, "has_law_commitment", Scope(Scopes::LawType)),
590    (
591        Scopes::Country,
592        "has_law_imposition_rights",
593        Block(&[("target_country", Scope(Scopes::Country)), ("law_type", Scope(Scopes::LawType))]),
594    ),
595    (Scopes::Country, "has_law_or_variant", Scope(Scopes::LawType)),
596    (Scopes::None, "has_local_variable", Special),
597    (Scopes::None, "has_local_variable_list", Special),
598    (Scopes::None, "has_map_interaction", Item(Item::MapInteractionType)),
599    (Scopes::None, "has_map_interaction_diplomatic_action", Item(Item::DiplomaticAction)),
600    (
601        Scopes::None,
602        "has_map_interaction_export_goods",
603        Removed("1.9", "replaced with world market system"),
604    ),
605    (
606        Scopes::None,
607        "has_map_interaction_import_goods",
608        Removed("1.9", "replaced with world market system"),
609    ),
610    (Scopes::Character, "has_military_formation", Boolean),
611    (Scopes::MilitaryFormation, "has_mobilization_option", Scope(Scopes::MobilizationOption)),
612    (Scopes::State, "has_mobilizing_unit", Boolean),
613    (
614        Scopes::Country
615            .union(Scopes::Building)
616            .union(Scopes::Character)
617            .union(Scopes::Institution)
618            .union(Scopes::InterestGroup)
619            .union(Scopes::JournalEntry)
620            .union(Scopes::PoliticalMovement)
621            .union(Scopes::PowerBloc)
622            .union(Scopes::State),
623        "has_modifier",
624        Item(Item::Modifier),
625    ),
626    (Scopes::MilitaryFormation, "has_naval_mission_with_invalid_area", Boolean),
627    (Scopes::InterestGroup, "has_negotiated", Boolean),
628    (
629        Scopes::Country,
630        "has_no_priority_tariffs",
631        Removed("1.9", "replaced with world market system"),
632    ),
633    (Scopes::Country, "has_objective", Item(Item::Objective)),
634    (Scopes::Pop, "has_ongoing_assimilation", Boolean),
635    (Scopes::Pop, "has_ongoing_conversion", Boolean),
636    (Scopes::Country, "has_overlapping_interests", Scope(Scopes::Country)),
637    (Scopes::AmendmentType, "has_parent_law", Boolean),
638    (Scopes::InterestGroup, "has_party", Boolean),
639    (Scopes::Party, "has_party_member", Scope(Scopes::InterestGroup)),
640    (Scopes::DiplomaticPlay, "has_play_goal", Item(Item::WarGoalType)),
641    (Scopes::Country, "has_political_movement", Removed("1.8", "")),
642    (Scopes::Pop, "has_pop_culture", Item(Item::Culture)),
643    (Scopes::Pop, "has_pop_religion", Item(Item::Religion)),
644    (
645        Scopes::Country.union(Scopes::Market).union(Scopes::State),
646        "has_port",
647        Removed("1.13", "replaced with `has_port_market` and `has_port_state`"),
648    ),
649    (Scopes::Country, "has_port_country", Boolean),
650    (Scopes::Market, "has_port_market", Boolean),
651    (Scopes::State, "has_port_state", Boolean),
652    (Scopes::Country, "has_possible_decisions", Boolean),
653    (
654        Scopes::State,
655        "has_potential_resource",
656        ScopeOrItem(Scopes::BuildingType, Item::BuildingType),
657    ),
658    (Scopes::MarketGoods.union(Scopes::StateGoods), "has_potential_supply", Boolean),
659    (Scopes::Country, "has_potential_to_form_country", UncheckedTodo), // No examples in vanilla
660    (Scopes::Country, "has_power_struggle", Boolean),
661    (Scopes::PowerBloc, "has_principle", Scope(Scopes::PowerBlocPrinciple)),
662    (Scopes::PowerBloc, "has_principle_group", Scope(Scopes::PowerBlocPrincipleGroup)),
663    (Scopes::None, "has_reached_end_date", Boolean),
664    (
665        Scopes::Country,
666        "has_region_stance",
667        Block(&[
668            ("region", Scope(Scopes::StrategicRegion)),
669            ("stance", Item(Item::AiStrategicRegionStanceType)),
670        ]),
671    ),
672    (Scopes::Character, "has_religion", ScopeOrItem(Scopes::Religion, Item::Religion)),
673    (Scopes::Religion, "has_religious_taboo", Item(Item::Goods)),
674    (Scopes::Country, "has_researchable_technology", Boolean),
675    (Scopes::Country, "has_revolution", Boolean),
676    (Scopes::Country, "has_revolution_over_law_type", Removed("1.8", "")),
677    (Scopes::Character, "has_role", Item(Item::CharacterRole)),
678    (Scopes::Character, "has_role_of_type", Item(Item::CharacterArchetype)),
679    (Scopes::Country, "has_ruling_interest_group", Item(Item::InterestGroup)),
680    (Scopes::Country, "has_ruling_interest_group_count", CompareValue),
681    (
682        Scopes::Country,
683        "has_secret_goal",
684        Block(&[("who", Scope(Scopes::Country)), ("secret_goal", Item(Item::SecretGoal))]),
685    ),
686    (Scopes::MilitaryFormation, "has_ship_outside_max_port_distance", Boolean),
687    (Scopes::Pop, "has_social_class", Item(Item::SocialClass)),
688    (Scopes::Country, "has_social_hierarchy", Item(Item::SocialHierarchy)),
689    (Scopes::Country, "has_state_in_state_region", Item(Item::StateRegion)),
690    (Scopes::Pop, "has_state_religion", Boolean),
691    (Scopes::State, "has_state_trait", Item(Item::StateTrait)),
692    (Scopes::Country, "has_strategic_adjacency", Scope(Scopes::State.union(Scopes::Country))),
693    (Scopes::Country, "has_strategic_land_adjacency", Scope(Scopes::State.union(Scopes::Country))),
694    (
695        Scopes::Country,
696        "has_strategic_region_interest_tier",
697        Block(&[("strategic_region", Scope(Scopes::StrategicRegion)), ("value", CompareValue)]),
698    ),
699    (Scopes::Country, "has_strategy", Item(Item::AiStrategy)),
700    (Scopes::Country, "has_subject_relation_with", Scope(Scopes::Country)),
701    (Scopes::Country, "has_sufficient_construction_capacity_for_investment", Boolean),
702    // no examples in vanilla
703    (
704        Scopes::Country,
705        "has_technology_progress",
706        Block(&[("technology", UncheckedTodo), ("progress", CompareValue)]),
707    ),
708    (
709        Scopes::Country,
710        "has_technology_researched",
711        ScopeOrItem(Scopes::Technology, Item::Technology),
712    ),
713    (Scopes::Character, "has_template", Item(Item::CharacterTemplate)),
714    (Scopes::Province, "has_terrain", Item(Item::Terrain)),
715    (Scopes::Character, "has_trait", Item(Item::CharacterTrait)),
716    (
717        Scopes::Country,
718        "has_treaty_port_in_country",
719        Removed("1.9", "replaced with `has_treaty_port_in_market`"),
720    ),
721    (Scopes::Country, "has_treaty_port_in_market", Scope(Scopes::Market)),
722    (Scopes::Country, "has_truce_with", Scope(Scopes::Country)),
723    (
724        Scopes::TreatyArticle.union(Scopes::TreatyArticleOptions),
725        "has_type",
726        Item(Item::TreatyArticle),
727    ),
728    (Scopes::None, "has_unification_candidate", UncheckedTodo), // No examples in vanilla
729    (Scopes::NewCombatUnit, "has_unit_type", Scope(Scopes::CombatUnitType)),
730    (Scopes::None, "has_variable", Identifier("variable name")),
731    (Scopes::None, "has_variable_list", Identifier("list name")),
732    (
733        Scopes::War,
734        "has_war_exhaustion",
735        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
736    ),
737    (Scopes::War, "has_war_goal", Item(Item::WarGoalType)),
738    (
739        Scopes::War,
740        "has_war_support",
741        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
742    ),
743    (Scopes::Country, "has_war_with", Scope(Scopes::Country)),
744    (Scopes::Country, "has_wasted_construction", Boolean),
745    (Scopes::None, "hidden_trigger", Control),
746    (
747        Scopes::Country,
748        "highest_overlapping_interest_tier",
749        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
750    ),
751    (Scopes::Country, "highest_secession_progress", CompareValue),
752    (Scopes::Ship, "hit_points", CompareValue),
753    (Scopes::Ship, "hit_points_percent", CompareValue),
754    (Scopes::InterestGroup, "ig_approval", CompareChoiceOrNumber(APPROVALS)),
755    (Scopes::InterestGroup, "ig_clout", CompareValue),
756    (Scopes::InterestGroup, "ig_government_power_share", CompareValue),
757    (
758        Scopes::State,
759        "ig_state_pol_strength_share",
760        Block(&[("target", Scope(Scopes::InterestGroup)), ("value", CompareValue)]),
761    ),
762    (Scopes::StateGoods, "import_advantage", CompareValue),
763    (Scopes::StateGoods, "import_tariff_level", CompareChoice(TARIFF_LEVELS)),
764    (Scopes::Country, "in_default", Boolean),
765    (Scopes::Country, "in_election_campaign", Boolean),
766    (Scopes::DiplomaticPact, "income_transfer", CompareValue),
767    (Scopes::State, "incorporation_progress", CompareValue),
768    (Scopes::Country, "influence", CompareValue),
769    (Scopes::Country, "influence_usage", CompareValue),
770    (Scopes::State.union(Scopes::StateRegion), "infrastructure", CompareValue),
771    (Scopes::State.union(Scopes::StateRegion), "infrastructure_delta", CompareValue),
772    (Scopes::State.union(Scopes::StateRegion), "infrastructure_usage", CompareValue),
773    (Scopes::DiplomaticPlay, "initiator_is", Scope(Scopes::Country)),
774    (
775        Scopes::Country,
776        "institution_investment_level",
777        Block(&[("institution", Item(Item::Institution)), ("value", CompareValue)]),
778    ),
779    (Scopes::InterestGroup, "interest_group_population", CompareValue),
780    (Scopes::InterestGroup, "interest_group_population_percentage", CompareValue),
781    (Scopes::InterestGroup, "interest_group_supports_political_movement", Boolean),
782    (Scopes::Invasion, "invasion_has_marines", Boolean),
783    (Scopes::Country, "investment_pool", CompareValue),
784    (Scopes::Country, "investment_pool_gross_income", CompareValue),
785    (Scopes::Country, "investment_pool_net_income", CompareValue),
786    (Scopes::None, "is_active", Removed("1.9", "")),
787    (
788        Scopes::Country,
789        "is_adjacent",
790        Removed("removed in 1.5", "replaced with is_adjacent_to_country and is_adjacent_to_state"),
791    ),
792    (Scopes::Country, "is_adjacent_to_country", Scope(Scopes::Country)),
793    (Scopes::Market, "is_adjacent_to_market", Scope(Scopes::Market)),
794    (Scopes::Country, "is_adjacent_to_state", Scope(Scopes::State)),
795    (Scopes::Character, "is_adult", Boolean),
796    (Scopes::Character, "is_advancing_on_front", Scope(Scopes::Front)),
797    (Scopes::Country, "is_ai", Boolean),
798    (Scopes::MilitaryFormation, "is_army", Boolean),
799    (Scopes::Country, "is_at_war", Boolean),
800    (Scopes::Character.union(Scopes::Ship), "is_attacker_in_battle", Boolean),
801    (Scopes::CharacterRole, "is_auto_assigned", Boolean),
802    (Scopes::Country, "is_banning_goods", ScopeOrItem(Scopes::Goods, Item::Goods)),
803    (Scopes::PoliticalMovement, "is_being_bolstered", Boolean),
804    (Scopes::State, "is_being_bombarded", Boolean),
805    (Scopes::PoliticalMovement, "is_being_suppressed", Boolean),
806    (Scopes::State, "is_blockaded_by", Scope(Scopes::Country)),
807    (Scopes::Building, "is_buildable", Boolean),
808    (Scopes::Building, "is_building_group", Item(Item::BuildingGroup)),
809    (Scopes::Building, "is_building_type", Item(Item::BuildingType)),
810    (
811        Scopes::None,
812        "is_building_type_expanded",
813        ScopeOrItem(Scopes::BuildingType, Item::BuildingType),
814    ),
815    (Scopes::Character, "is_busy", Boolean),
816    (Scopes::State, "is_capital", Boolean),
817    (Scopes::Character, "is_character_alive", Boolean),
818    (Scopes::CharacterRole, "is_character_role", Item(Item::CharacterRole)),
819    (Scopes::CharacterRole, "is_character_role_type", Item(Item::CharacterArchetype)),
820    (Scopes::CivilWar, "is_civil_war_type", Choice(&["revolution", "secession"])),
821    (Scopes::State, "is_coastal", Boolean),
822    (Scopes::Company, "is_company_type", ScopeOrItem(Scopes::CompanyType, Item::CompanyType)),
823    (Scopes::Country, "is_considered_adjacent_due_to_wargoals", Scope(Scopes::Country)),
824    (Scopes::Country, "is_construction_paused", Boolean),
825    (Scopes::MarketGoods, "is_consumed_by_government_buildings", Boolean),
826    (Scopes::MarketGoods, "is_consumed_by_military_buildings", Boolean),
827    (Scopes::Country, "is_country_alive", Boolean),
828    (Scopes::Country, "is_country_type", Item(Item::CountryType)),
829    (Scopes::Ship, "is_damaged", Boolean),
830    (Scopes::Character.union(Scopes::Ship), "is_defender_in_battle", Boolean),
831    (
832        Scopes::TreatyArticle.union(Scopes::TreatyArticleOptions),
833        "is_desired_by",
834        Scope(Scopes::Country),
835    ),
836    (Scopes::DiplomaticPact, "is_diplomatic_action_type", Item(Item::DiplomaticAction)),
837    (Scopes::DiplomaticCatalyst, "is_diplomatic_catalyst_type", Item(Item::DiplomaticCatalyst)),
838    (Scopes::DiplomaticPact, "is_diplomatic_pact_in_danger", Boolean),
839    (Scopes::Country, "is_diplomatic_play_ally_of", Scope(Scopes::Country)),
840    (Scopes::Country, "is_diplomatic_play_committed_participant", Boolean),
841    (Scopes::Country, "is_diplomatic_play_enemy_of", Scope(Scopes::Country)),
842    (Scopes::Country, "is_diplomatic_play_initiator", Boolean),
843    (Scopes::Country, "is_diplomatic_play_involved_with", Scope(Scopes::Country)),
844    (Scopes::Country, "is_diplomatic_play_participant_with", Scope(Scopes::Country)),
845    (Scopes::Country, "is_diplomatic_play_target", Boolean),
846    (Scopes::DiplomaticPlay, "is_diplomatic_play_type", Item(Item::DiplomaticPlay)),
847    (Scopes::Country, "is_diplomatic_play_undecided_participant", Boolean),
848    (Scopes::Country, "is_direct_subject_of", Scope(Scopes::Country)),
849    (Scopes::MilitaryFormation, "is_doing_piracy_in_region", Scope(Scopes::StrategicRegion)),
850    (Scopes::Pop, "is_employed", Boolean),
851    (Scopes::Country, "is_enacting_law", Scope(Scopes::LawType)),
852    (Scopes::Treaty, "is_enforced", Boolean),
853    (
854        Scopes::Treaty.union(Scopes::TreatyOptions),
855        "is_equal_exchange",
856        Removed("1.9.8", "replaced with `is_equal_exchange_for`"),
857    ),
858    (Scopes::Treaty.union(Scopes::TreatyOptions), "is_equal_exchange_for", Scope(Scopes::Country)),
859    (Scopes::Treaty.union(Scopes::TreatyOptions), "is_exchanging_obligations", Boolean),
860    (Scopes::Country, "is_expanding_institution", Boolean),
861    (Scopes::MarketGoods, "is_exported_to", Scope(Scopes::Market)),
862    (Scopes::Character, "is_female", Boolean),
863    (Scopes::Ship, "is_flagship", Boolean),
864    (Scopes::MilitaryFormation, "is_fleet", Boolean),
865    (Scopes::DiplomaticPact, "is_forced_pact", Boolean),
866    (Scopes::Country, "is_forced_to_join_plays", Scope(Scopes::Country)),
867    (Scopes::Treaty, "is_fulfilled_by", Scope(Scopes::Country)),
868    (Scopes::MilitaryFormation, "is_fully_mobilized", Boolean),
869    (Scopes::None, "is_game_paused", Boolean),
870    (Scopes::None, "is_gamestate_tutorial_active", Boolean),
871    (
872        Scopes::TreatyOptions.union(Scopes::TreatyArticleOptions),
873        "is_giftable_to",
874        Scope(Scopes::Country),
875    ),
876    (Scopes::JournalEntry, "is_goal_complete", Boolean),
877    (Scopes::Building, "is_government_funded", Boolean),
878    (Scopes::Character, "is_heir", Removed("1.13", "replaced with `is_heir_of_own_country`")),
879    (Scopes::Character, "is_heir_of_own_country", Boolean),
880    (Scopes::Character, "is_historical", Boolean),
881    (Scopes::Treaty, "is_historical_treaty", Boolean),
882    (Scopes::War, "is_holder_of_wargoal_in_war", Scope(Scopes::Country)),
883    (Scopes::Country, "is_home_country_for", Scope(Scopes::Country)),
884    (Scopes::StateRegion, "is_homeland", ScopeOrItem(Scopes::Culture, Item::Culture)),
885    (Scopes::State, "is_homeland_of_country_cultures", Scope(Scopes::Country)),
886    (Scopes::Character, "is_immortal", Boolean),
887    (Scopes::Country, "is_immune_to_revolutions", Boolean),
888    (Scopes::MarketGoods, "is_imported_from", Scope(Scopes::Market)),
889    (Scopes::Character.union(Scopes::Ship), "is_in_battle", Boolean),
890    (Scopes::Country, "is_in_customs_union", Boolean),
891    (Scopes::Country, "is_in_customs_union_with", Scope(Scopes::Country)),
892    (Scopes::Character, "is_in_exile_pool", Boolean),
893    (
894        Scopes::Country
895            .union(Scopes::State)
896            .union(Scopes::StateRegion)
897            .union(Scopes::StrategicRegion),
898        "is_in_geographic_region",
899        Item(Item::GeographicRegion),
900    ),
901    (Scopes::InterestGroup, "is_in_government", Boolean),
902    (Scopes::None, "is_in_list", Special),
903    (Scopes::Pop, "is_in_mild_starvation", Boolean),
904    (Scopes::Ship, "is_in_port", Boolean),
905    (Scopes::Country, "is_in_power_bloc", Boolean),
906    (Scopes::State, "is_in_revolt", Boolean),
907    (Scopes::State, "is_in_same_market_area", Scope(Scopes::State)),
908    (Scopes::Country, "is_in_same_power_bloc", Scope(Scopes::Country)),
909    (Scopes::Pop, "is_in_severe_starvation", Boolean),
910    (Scopes::Pop, "is_in_starvation", Boolean),
911    (Scopes::Character, "is_in_void", Boolean),
912    (Scopes::Country, "is_in_war_together", Scope(Scopes::Country)),
913    (Scopes::State, "is_incorporated", Boolean),
914    (Scopes::Country, "is_indirect_subject_of", Scope(Scopes::Country)),
915    (
916        Scopes::Country.union(Scopes::InterestGroup).union(Scopes::PoliticalMovement),
917        "is_insurrectionary",
918        Boolean,
919    ),
920    (Scopes::InterestMarker, "is_interest_active", Removed("1.13", "")),
921    (Scopes::Character, "is_interest_group_leader", Boolean),
922    (
923        Scopes::Character.union(Scopes::InterestGroup),
924        "is_interest_group_type",
925        Item(Item::InterestGroup),
926    ),
927    (Scopes::MilitaryFormation, "is_invalid_naval_mission_grace_period_active", Boolean),
928    (Scopes::Invasion, "is_invasion_stalled", Boolean),
929    (Scopes::Country, "is_involved_in_journal_entry", Item(Item::JournalEntry)),
930    (Scopes::State, "is_isolated_from_market", Boolean),
931    (Scopes::Country, "is_junior_in_customs_union", Boolean),
932    (Scopes::Theater, "is_land_theater", Boolean),
933    (Scopes::State, "is_largest_state_in_region", Boolean),
934    (Scopes::None, "is_lens_open", Block(&[("lens", UncheckedTodo), ("?tab_name", UncheckedTodo)])),
935    (Scopes::Country, "is_local_country", Scope(Scopes::StrategicRegion)),
936    (Scopes::Country, "is_local_player", Boolean),
937    (Scopes::Country, "is_losing_power_rank", Boolean),
938    (Scopes::CountryFormation, "is_major_formation", Boolean),
939    (Scopes::InterestGroup, "is_marginal", Boolean),
940    (Scopes::Country, "is_market_reachable_for_trade", Scope(Scopes::Market)),
941    (Scopes::Country, "is_mass_migration_origin", Boolean),
942    (Scopes::Country, "is_mass_migration_origin_of_culture", Scope(Scopes::Culture)),
943    (Scopes::State, "is_mass_migration_target", Boolean),
944    (Scopes::State, "is_mass_migration_target_for_culture", Scope(Scopes::Culture)),
945    (Scopes::InterestGroup, "is_member_of_any_lobby", Boolean),
946    (Scopes::InterestGroup, "is_member_of_lobby", Scope(Scopes::PoliticalLobbyType)),
947    (Scopes::InterestGroup, "is_member_of_party", Scope(Scopes::Party)),
948    (Scopes::MilitaryFormation, "is_mobilized", Boolean),
949    (Scopes::Character, "is_monarch", Boolean),
950    (Scopes::Invasion, "is_naval_invasion", Boolean),
951    (
952        Scopes::None,
953        "is_naval_invasion_stalled_due_to_orders",
954        Removed("1.9", "replaced with `is_invasion_stalled`"),
955    ),
956    (Scopes::Country.union(Scopes::InterestGroup), "is_negotiating", Boolean),
957    (Scopes::Character, "is_noble", Boolean),
958    (
959        Scopes::Country
960            .union(Scopes::State)
961            .union(Scopes::StateRegion)
962            .union(Scopes::StrategicRegion),
963        "is_not_in_geographic_region",
964        Item(Item::GeographicRegion),
965    ),
966    (Scopes::None, "is_objective_completed", Boolean),
967    (Scopes::Character.union(Scopes::MilitaryFormation), "is_on_front", Boolean),
968    (Scopes::Country, "is_owed_obligation_by", Scope(Scopes::Country)),
969    (
970        Scopes::None,
971        "is_panel_open",
972        Block(&[
973            ("?target", UncheckedTodo),
974            ("?panel_name", UncheckedTodo),
975            ("?tab_name", UncheckedTodo),
976        ]),
977    ),
978    (Scopes::Party, "is_party", Scope(Scopes::Party)),
979    (Scopes::Party, "is_party_type", Item(Item::Party)),
980    (Scopes::Country, "is_player", Boolean),
981    (Scopes::PoliticalLobby, "is_political_lobby_type", Item(Item::PoliticalLobby)),
982    (Scopes::PoliticalMovement, "is_political_movement_type", Item(Item::PoliticalMovement)),
983    (Scopes::Pop, "is_pop_type", Item(Item::PopType)),
984    (Scopes::None, "is_popup_open", UncheckedTodo),
985    (Scopes::State, "is_potential_treaty_port", Scope(Scopes::Country)),
986    (Scopes::Country, "is_power_bloc_leader", Boolean),
987    (Scopes::InterestGroup, "is_powerful", Boolean),
988    (Scopes::Culture, "is_primary_culture_of", Scope(Scopes::Country)),
989    (Scopes::Company, "is_producing_prestige_goods", Boolean),
990    (
991        Scopes::State,
992        "is_production_method_active",
993        Block(&[
994            ("building_type", Item(Item::BuildingType)),
995            ("production_method", Item(Item::ProductionMethod)),
996        ]),
997    ),
998    (Scopes::JournalEntry, "is_progressing", Boolean),
999    (Scopes::Province, "is_province_land", Boolean),
1000    (Scopes::Law, "is_reasonable_law_for_petition", Boolean),
1001    (Scopes::Treaty.union(Scopes::TreatyOptions), "is_renegotiation", Boolean),
1002    (Scopes::Character, "is_repairing", Removed("1.6", "")),
1003    (Scopes::Country, "is_researching_technology", Special), // also accepts "any"
1004    (Scopes::Country, "is_researching_technology_category", UncheckedTodo), // No examples in vanilla
1005    (
1006        Scopes::Country.union(Scopes::InterestGroup).union(Scopes::PoliticalMovement),
1007        "is_revolutionary",
1008        Boolean,
1009    ),
1010    (
1011        Scopes::PoliticalMovement,
1012        "is_revolutionary_movement",
1013        Removed("1.8", "replaced with is_revolutionary"),
1014    ),
1015    (Scopes::None, "is_rightclick_menu_open", UncheckedTodo),
1016    (Scopes::Character, "is_ruler", Removed("1.13", "replaced by three `is_ruler_of_` triggers")),
1017    (Scopes::Character, "is_ruler_of_any_country", Boolean),
1018    (Scopes::Character, "is_ruler_of_other_country", Boolean),
1019    (Scopes::Character, "is_ruler_of_own_country", Boolean),
1020    (Scopes::InterestGroup, "is_same_interest_group_type", Scope(Scopes::InterestGroup)),
1021    (Scopes::LawType, "is_same_law_group_as", Scope(Scopes::LawType)),
1022    (Scopes::Party, "is_same_party_type", Scope(Scopes::Party)),
1023    (Scopes::State, "is_sea_adjacent", Boolean),
1024    (
1025        Scopes::Country.union(Scopes::InterestGroup).union(Scopes::PoliticalMovement),
1026        "is_secessionist",
1027        Boolean,
1028    ),
1029    (Scopes::None, "is_set", Special),
1030    (Scopes::Ship, "is_ship_type", Scope(Scopes::ShipType)),
1031    (Scopes::State, "is_slave_state", Boolean),
1032    (Scopes::State, "is_split_state", Boolean),
1033    (Scopes::StateRegion, "is_state_region_land", Boolean),
1034    (Scopes::Religion, "is_state_religion", Scope(Scopes::Country)),
1035    (Scopes::State, "is_strategic_objective", Scope(Scopes::Country)),
1036    (Scopes::InterestGroup, "is_strongest_ig_in_government", Boolean),
1037    (Scopes::Country, "is_subject", Boolean),
1038    (Scopes::Country, "is_subject_of", Scope(Scopes::Country)),
1039    (Scopes::Country, "is_subject_type", Item(Item::SubjectType)),
1040    (Scopes::Building, "is_subsidized", Boolean),
1041    (Scopes::Building, "is_subsistence_building", Boolean),
1042    (
1043        Scopes::Country,
1044        "is_supporting_unification_candidate",
1045        Block(&[
1046            ("who", Scope(Scopes::Country)),
1047            ("country_formation", Item(Item::CountryFormation)),
1048        ]),
1049    ),
1050    (Scopes::War, "is_target_of_wargoal_in_war", Scope(Scopes::Country)),
1051    (Scopes::None, "is_target_in_global_variable_list", Special),
1052    (Scopes::None, "is_target_in_local_variable_list", Special),
1053    (Scopes::None, "is_target_in_variable_list", Special),
1054    (Scopes::State, "is_target_of_wargoal", Scope(Scopes::Country)),
1055    (Scopes::Country, "is_taxing_goods", ScopeOrItem(Scopes::Goods, Item::Goods)),
1056    (Scopes::None, "is_template_used", Item(Item::CharacterTemplate)),
1057    (Scopes::None, "is_theme_selected", Item(Item::Theme)),
1058    (Scopes::None, "is_trade_route_active", Removed("1.9", "replaced with world market system")),
1059    (
1060        Scopes::None,
1061        "is_trade_route_productive",
1062        Removed("1.9", "replaced with world market system"),
1063    ),
1064    (Scopes::Goods.union(Scopes::MarketGoods), "is_tradeable", Boolean),
1065    (Scopes::Character, "is_traveling", Removed("1.6", "")),
1066    (Scopes::TreatyArticle, "is_treaty_article_in_danger", Boolean),
1067    (Scopes::State, "is_treaty_port", Boolean),
1068    (Scopes::None, "is_tutorial_active", Boolean),
1069    (Scopes::None, "is_tutorial_lesson_active", Item(Item::TutorialLesson)),
1070    (Scopes::None, "is_tutorial_lesson_chain_completed", UncheckedTodo), // TODO
1071    (Scopes::None, "is_tutorial_lesson_completed", Item(Item::TutorialLesson)),
1072    (Scopes::None, "is_tutorial_lesson_step_completed", UncheckedTodo), // TODO
1073    (Scopes::State, "is_under_colonization", Boolean),
1074    (Scopes::Building, "is_under_construction", Boolean),
1075    (Scopes::Country, "is_unification_candidate", Item(Item::CountryFormation)),
1076    (Scopes::Country, "is_violating_sovereignty_of", Scope(Scopes::Country)),
1077    (Scopes::Front, "is_vulnerable_front", Scope(Scopes::Country)),
1078    (Scopes::DiplomaticPlay, "is_war", Boolean),
1079    (Scopes::War, "is_war_participant", Scope(Scopes::Country)),
1080    (Scopes::War, "is_warleader", Scope(Scopes::Country)),
1081    (Scopes::State, "is_world_market_hub", Boolean),
1082    (Scopes::Country, "isolated_states", CompareValue),
1083    (Scopes::JournalEntry, "journal_entry_age", CompareValue),
1084    (Scopes::Law, "law_approved_by", Scope(Scopes::InterestGroup)),
1085    (
1086        Scopes::Character.union(Scopes::InterestGroup).union(Scopes::PoliticalMovement),
1087        "law_enactment_stance",
1088        Block(&[("law", Scope(Scopes::LawType)), ("value", CompareChoice(STANCES))]),
1089    ),
1090    (Scopes::Law, "law_is_available", Boolean),
1091    (
1092        Scopes::LawType,
1093        "law_progressiveness_difference",
1094        Block(&[("target_law", Scope(Scopes::LawType)), ("value", CompareValue)]), // TODO verify
1095    ),
1096    (
1097        Scopes::Character.union(Scopes::InterestGroup).union(Scopes::PoliticalMovement),
1098        "law_stance",
1099        Block(&[("law", Scope(Scopes::LawType)), ("value", CompareChoice(STANCES))]),
1100    ),
1101    (Scopes::Country, "leading_producer_of", Scope(Scopes::Goods)),
1102    (Scopes::Country, "leads_customs_union", Boolean),
1103    (
1104        Scopes::Building,
1105        "levels_owned_by_country",
1106        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
1107    ),
1108    (
1109        Scopes::PowerBloc,
1110        "leverage_advantage",
1111        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
1112    ),
1113    (Scopes::Country, "liberty_desire", CompareValue),
1114    (Scopes::Country, "liberty_desire_weekly_progress", CompareValue),
1115    (Scopes::Country, "liberty_desire_weekly_progress_from_support_independence", CompareValue),
1116    (Scopes::Character, "lifetime_piracy_income", CompareValue),
1117    (
1118        Scopes::None,
1119        "list_size",
1120        Block(&[("name", Identifier("list name")), ("value", CompareValue)]),
1121    ),
1122    (Scopes::Country.union(Scopes::Pop).union(Scopes::State), "literacy_rate", CompareValue),
1123    (Scopes::PoliticalLobby, "lobby_clout", CompareValue),
1124    (
1125        Scopes::DiplomaticCatalyst.union(Scopes::PoliticalLobby),
1126        "lobby_formation_reason",
1127        Choice(LOBBY_FORMATION_REASON),
1128    ),
1129    (Scopes::None, "local_variable_list_size", Special),
1130    (
1131        Scopes::Country.union(Scopes::State),
1132        "loyalist_fraction",
1133        BlockOrCompareValue(&[
1134            ("value", CompareValue),
1135            ("?pop_type", Item(Item::PopType)),
1136            ("?strata", Item(Item::Strata)),
1137            ("?culture", ScopeOrItem(Scopes::Culture, Item::Culture)),
1138            ("?religion", ScopeOrItem(Scopes::Religion, Item::Religion)),
1139        ]),
1140    ),
1141    (Scopes::State, "loyalists", CompareValue),
1142    (Scopes::Character, "loyalty", CompareValue),
1143    (Scopes::State, "market_access", CompareValue),
1144    (
1145        Scopes::Market,
1146        "market_consumption_share",
1147        Block(&[
1148            ("?target", Scope(Scopes::Country)),
1149            ("?goods", Item(Item::Goods)),
1150            ("value", CompareValue),
1151        ]),
1152    ),
1153    (
1154        Scopes::Market,
1155        "market_exports",
1156        Block(&[
1157            ("?target", Scope(Scopes::Market)),
1158            ("?goods", Item(Item::Goods)),
1159            ("value", CompareValue),
1160        ]),
1161    ),
1162    (
1163        Scopes::Market,
1164        "market_exports_reliance",
1165        Block(&[
1166            ("?target", Scope(Scopes::Market)),
1167            ("?goods", Item(Item::Goods)),
1168            ("value", CompareValue),
1169        ]),
1170    ),
1171    (Scopes::MarketGoods, "market_goods_buy_orders", CompareValue),
1172    (Scopes::MarketGoods, "market_goods_cheaper", CompareValue),
1173    (Scopes::MarketGoods, "market_goods_consumption", CompareValue),
1174    (Scopes::MarketGoods, "market_goods_delta", CompareValue),
1175    (Scopes::MarketGoods, "market_goods_export_share", CompareValue),
1176    (Scopes::MarketGoods, "market_goods_exports", CompareValue),
1177    (Scopes::MarketGoods, "market_goods_has_goods_shortage", Boolean),
1178    (Scopes::MarketGoods, "market_goods_import_share", CompareValue),
1179    (Scopes::MarketGoods, "market_goods_imports", CompareValue),
1180    (Scopes::MarketGoods, "market_goods_pricier", CompareValue),
1181    (Scopes::MarketGoods, "market_goods_production", CompareValue),
1182    (Scopes::MarketGoods, "market_goods_sell_orders", CompareValue),
1183    (Scopes::MarketGoods, "market_goods_shortage_ratio", CompareValue),
1184    (Scopes::Market, "market_has_goods_shortage", Boolean),
1185    (
1186        Scopes::Market,
1187        "market_imports",
1188        Block(&[
1189            ("?target", Scope(Scopes::Market)),
1190            ("?goods", Item(Item::Goods)),
1191            ("value", CompareValue),
1192        ]),
1193    ),
1194    (
1195        Scopes::Market,
1196        "market_imports_reliance",
1197        Block(&[
1198            ("?target", Scope(Scopes::Market)),
1199            ("?goods", Item(Item::Goods)),
1200            ("value", CompareValue),
1201        ]),
1202    ),
1203    (Scopes::Market, "market_number_goods_shortages", CompareValue),
1204    (
1205        Scopes::Market,
1206        "market_number_goods_shortages_with",
1207        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), // TODO verify
1208    ),
1209    (
1210        Scopes::Market,
1211        "market_number_goods_shortages_without",
1212        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), // TODO verify
1213    ),
1214    (
1215        Scopes::MarketGoods,
1216        "market_prestige_goods_buy_orders",
1217        Block(&[("type", Item(Item::PrestigeGoods)), ("value", CompareValue)]),
1218    ),
1219    (
1220        Scopes::MarketGoods,
1221        "market_prestige_goods_consumption",
1222        Block(&[("type", Item(Item::PrestigeGoods)), ("value", CompareValue)]),
1223    ),
1224    (
1225        Scopes::MarketGoods,
1226        "market_prestige_goods_delta",
1227        Block(&[("type", Item(Item::PrestigeGoods)), ("value", CompareValue)]),
1228    ),
1229    (
1230        Scopes::MarketGoods,
1231        "market_prestige_goods_export_share",
1232        Block(&[("type", Item(Item::PrestigeGoods)), ("value", CompareValue)]),
1233    ),
1234    (
1235        Scopes::MarketGoods,
1236        "market_prestige_goods_exports",
1237        Block(&[("type", Item(Item::PrestigeGoods)), ("value", CompareValue)]),
1238    ),
1239    (
1240        Scopes::MarketGoods,
1241        "market_prestige_goods_import_share",
1242        Block(&[("type", Item(Item::PrestigeGoods)), ("value", CompareValue)]),
1243    ),
1244    (
1245        Scopes::MarketGoods,
1246        "market_prestige_goods_imports",
1247        Block(&[("type", Item(Item::PrestigeGoods)), ("value", CompareValue)]),
1248    ),
1249    (
1250        Scopes::MarketGoods,
1251        "market_prestige_goods_production",
1252        Block(&[("type", Item(Item::PrestigeGoods)), ("value", CompareValue)]),
1253    ),
1254    (
1255        Scopes::MarketGoods,
1256        "market_prestige_goods_sell_orders",
1257        Block(&[("type", Item(Item::PrestigeGoods)), ("value", CompareValue)]),
1258    ),
1259    (
1260        Scopes::Market,
1261        "market_production_share",
1262        Block(&[
1263            ("?target", Scope(Scopes::Country)),
1264            ("?goods", Item(Item::Goods)),
1265            ("value", CompareValue),
1266        ]),
1267    ),
1268    (
1269        Scopes::Market,
1270        "market_trade",
1271        Block(&[
1272            ("?target", Scope(Scopes::Market)),
1273            ("?goods", Item(Item::Goods)),
1274            ("value", CompareValue),
1275        ]),
1276    ),
1277    (
1278        Scopes::Market,
1279        "market_trade_reliance",
1280        Block(&[
1281            ("?target", Scope(Scopes::Market)),
1282            ("?goods", Item(Item::Goods)),
1283            ("value", CompareValue),
1284        ]),
1285    ),
1286    (Scopes::TreatyArticle.union(Scopes::TreatyArticleOptions), "max_contraventions", CompareValue),
1287    (Scopes::Country, "max_law_enactment_setbacks", CompareValue),
1288    (Scopes::MilitaryFormation, "max_organization", Removed("1.9", "")),
1289    (Scopes::Country, "max_num_companies", CompareValue),
1290    (Scopes::Country, "max_num_declared_interests", Removed("1.13", "")),
1291    (Scopes::Country, "military_ship_maintenance_fulfillment", CompareValue),
1292    (Scopes::Country, "military_wage_level", CompareChoice(LEVELS)),
1293    (Scopes::Country, "military_wage_level_value", CompareValue),
1294    (Scopes::Character, "mobilization_cost", Removed("1.5", "")),
1295    (Scopes::None, "month", CompareValue), // TODO: 0 to 11
1296    (Scopes::InterestGroup, "most_powerful_strata", Item(Item::Strata)),
1297    (Scopes::State, "most_prominent_revolting_interest_group", Item(Item::InterestGroup)),
1298    (Scopes::PoliticalMovement, "movement_can_cause_obstinance", Boolean),
1299    (Scopes::PoliticalMovement, "movement_is_causing_obstinance", Boolean),
1300    (Scopes::PoliticalMovement, "movement_pressure", UncheckedTodo), // no examples of non-complex form
1301    (Scopes::None, "nand", Control),
1302    (
1303        Scopes::Country,
1304        "nationalization_cost",
1305        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
1306    ),
1307    (Scopes::Country, "naval_power_projection", CompareValue),
1308    (Scopes::Country, "navy_reserves", Removed("1.6", "")),
1309    (Scopes::Country, "neighbors_any_power_bloc", Boolean),
1310    (Scopes::Country, "neighbors_member_of_same_power_bloc", Boolean),
1311    (Scopes::Country, "neighbors_power_bloc", Scope(Scopes::PowerBloc)),
1312    (Scopes::Country, "net_fixed_income", CompareValueWarnEq),
1313    (Scopes::Country, "net_total_income", CompareValueWarnEq),
1314    (Scopes::None, "night_value", CompareValue),
1315    (Scopes::None, "nor", Control),
1316    (Scopes::None, "not", Control),
1317    (Scopes::War, "num_casualties", CompareValue),
1318    (Scopes::Country, "num_companies", CompareValue),
1319    (
1320        Scopes::TreatyArticle,
1321        "num_contraventions",
1322        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
1323    ),
1324    (
1325        Scopes::War,
1326        "num_country_casualties",
1327        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
1328    ),
1329    (
1330        Scopes::War,
1331        "num_country_dead",
1332        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
1333    ),
1334    (
1335        Scopes::War,
1336        "num_country_wounded",
1337        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
1338    ),
1339    (Scopes::State, "num_cultural_communities", CompareValue),
1340    (Scopes::War, "num_dead", CompareValue),
1341    (Scopes::Country, "num_declared_interests", Removed("1.13", "")),
1342    // TODO: check that the DiplomaticAction has a pact.
1343    (
1344        Scopes::Country,
1345        "num_diplomatic_pacts",
1346        Block(&[("type", Item(Item::DiplomaticAction)), ("value", CompareValue)]),
1347    ),
1348    (
1349        Scopes::Front,
1350        "num_front_casualties",
1351        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
1352    ),
1353    (
1354        Scopes::Front,
1355        "num_front_dead",
1356        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
1357    ),
1358    (
1359        Scopes::Front,
1360        "num_front_wounded",
1361        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
1362    ),
1363    (
1364        Scopes::Country,
1365        "num_investments_of_type",
1366        Block(&[("type", Item(Item::BuildingType)), ("value", CompareValue)]),
1367    ),
1368    (Scopes::Theater, "num_mobilized_units_in_theater", CompareValue),
1369    (Scopes::Country.union(Scopes::InterestGroup), "num_political_lobbies", CompareValue),
1370    (Scopes::State, "num_potential_resources", UncheckedTodo), // no examples of non-complex form
1371    (Scopes::PowerBloc, "num_power_bloc_members", CompareValue),
1372    (Scopes::PowerBloc, "num_power_bloc_states", CompareValue),
1373    (Scopes::Theater, "num_provinces_in_theater", CompareValue),
1374    (Scopes::Country, "num_subjects", CompareValue),
1375    (Scopes::Country, "num_taxed_goods", CompareValue),
1376    (Scopes::War, "num_wounded", CompareValue),
1377    (Scopes::Country, "number_of_claims", CompareValue),
1378    (Scopes::Country, "number_of_possible_decisions", CompareValue),
1379    (Scopes::State, "obstinance", CompareValue),
1380    (Scopes::Building, "occupancy", CompareValue),
1381    (Scopes::None, "or", Control),
1382    (Scopes::MilitaryFormation, "organization", CompareValue),
1383    (Scopes::MilitaryFormation, "organization_target", CompareValue),
1384    (Scopes::Country, "overlord_can_decrease_subject_autonomy", Boolean),
1385    (Scopes::Country, "owes_obligation_to", Scope(Scopes::Country)),
1386    (
1387        Scopes::Country,
1388        "owns_entire_state_region",
1389        ScopeOrItem(Scopes::StateRegion, Item::StateRegion),
1390    ),
1391    (Scopes::Country, "owns_treaty_port_in", ScopeOrItem(Scopes::StateRegion, Item::StateRegion)),
1392    (
1393        Scopes::Country,
1394        "play_participant_has_war_goal_of_type_against",
1395        Block(&[("type", Item(Item::WarGoalType)), ("target", Scope(Scopes::Country))]),
1396    ),
1397    (
1398        Scopes::Country,
1399        "play_side_has_war_goal_of_type_against",
1400        Block(&[("type", Item(Item::WarGoalType)), ("target", Scope(Scopes::Country))]),
1401    ),
1402    (Scopes::PoliticalMovement, "political_movement_identity_support", CompareValue),
1403    (Scopes::PoliticalMovement, "political_movement_military_support", CompareValue),
1404    (Scopes::PoliticalMovement, "political_movement_popular_support", CompareValue),
1405    (Scopes::PoliticalMovement, "political_movement_radicalism", CompareValue),
1406    (Scopes::PoliticalMovement, "political_movement_support", CompareValue),
1407    (Scopes::PoliticalMovement, "political_movement_wealth_support", CompareValue),
1408    // TODO: exactly one of pop_type, religion, or culture must be specified
1409    (
1410        Scopes::Country.union(Scopes::State),
1411        "political_strength_share",
1412        Block(&[
1413            ("?pop_type", ScopeOrItem(Scopes::PopType, Item::PopType)),
1414            ("?religion", ScopeOrItem(Scopes::Religion, Item::Religion)),
1415            ("?culture", ScopeOrItem(Scopes::Culture, Item::Culture)),
1416            ("value", CompareValue),
1417        ]),
1418    ),
1419    (Scopes::Country, "politically_involved_ratio", CompareValue),
1420    (Scopes::StateRegion, "pollution_amount", CompareValue),
1421    (Scopes::State, "pollution_generation", CompareValue),
1422    (Scopes::Pop, "pop_acceptance", CompareValue),
1423    (Scopes::Pop, "pop_employment_building", Item(Item::BuildingType)),
1424    (Scopes::Pop, "pop_employment_building_group", Item(Item::BuildingGroup)),
1425    (Scopes::Pop, "pop_has_primary_culture", Boolean),
1426    (Scopes::Pop, "pop_is_discriminated", Removed("1.8", "replaced with pop_acceptance")),
1427    (Scopes::Pop, "pop_loyalist_fraction", CompareValue),
1428    (Scopes::Pop, "pop_neutral_fraction", CompareValue),
1429    (Scopes::Pop, "pop_radical_fraction", CompareValue),
1430    (
1431        Scopes::Country,
1432        "pop_type_percent_country",
1433        Block(&[("pop_type", Item(Item::PopType)), ("percent", CompareValue)]),
1434    ),
1435    (
1436        Scopes::State,
1437        "pop_type_percent_state",
1438        Block(&[("target", Scope(Scopes::PopType)), ("value", CompareValue)]),
1439    ),
1440    (
1441        Scopes::State,
1442        "population_by_culture",
1443        Block(&[("target", Scope(Scopes::Culture)), ("value", CompareValue)]),
1444    ),
1445    (
1446        Scopes::Country,
1447        "potential_diplomatic_play_power_ratio",
1448        Block(&[
1449            ("?type", Item(Item::DiplomaticPlay)),
1450            ("target", Scope(Scopes::Country)),
1451            ("?state", Scope(Scopes::State)),
1452            ("value", CompareValue),
1453        ]),
1454    ),
1455    (Scopes::Country, "potential_income", CompareValue),
1456    (Scopes::PowerBloc, "power_bloc_rank", CompareValue),
1457    (Scopes::Country, "power_bloc_share_gdp", CompareValue),
1458    (
1459        Scopes::Country,
1460        "power_bloc_share_gdp_with",
1461        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), // TODO verify
1462    ),
1463    (
1464        Scopes::Country,
1465        "power_bloc_share_gdp_without",
1466        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), // TODO verify
1467    ),
1468    (Scopes::Country, "power_bloc_share_power_projection", CompareValue),
1469    (
1470        Scopes::Country,
1471        "power_bloc_share_power_projection_with",
1472        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), // TODO verify
1473    ),
1474    (
1475        Scopes::Country,
1476        "power_bloc_share_power_projection_without",
1477        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), // TODO verify
1478    ),
1479    (Scopes::Country, "power_bloc_share_prestige", CompareValue),
1480    (
1481        Scopes::Country,
1482        "power_bloc_share_prestige_with",
1483        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), // TODO verify
1484    ),
1485    (
1486        Scopes::Country,
1487        "power_bloc_share_prestige_without",
1488        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), // TODO verify
1489    ),
1490    (Scopes::PowerBloc, "power_bloc_total_leading_goods_producers", CompareValue),
1491    (
1492        Scopes::PowerBloc,
1493        "power_bloc_total_leading_goods_producers_with",
1494        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), // TODO verify
1495    ),
1496    (
1497        Scopes::PowerBloc,
1498        "power_bloc_total_leading_goods_producers_without",
1499        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), // TODO verify
1500    ),
1501    (Scopes::PowerBloc, "power_bloc_worst_economic_dependence", CompareValue),
1502    (
1503        Scopes::PowerBloc,
1504        "power_bloc_worst_economic_dependence_with",
1505        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), // TODO verify
1506    ),
1507    (
1508        Scopes::PowerBloc,
1509        "power_bloc_worst_economic_dependence_without",
1510        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), // TODO verify
1511    ),
1512    (Scopes::PowerBloc, "power_bloc_worst_infamy", CompareValue),
1513    (
1514        Scopes::PowerBloc,
1515        "power_bloc_worst_infamy_with",
1516        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), // TODO verify
1517    ),
1518    (
1519        Scopes::PowerBloc,
1520        "power_bloc_worst_infamy_without",
1521        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), // TODO verify
1522    ),
1523    (Scopes::PowerBloc, "power_bloc_worst_leader_relations", CompareValue),
1524    (
1525        Scopes::PowerBloc,
1526        "power_bloc_worst_leader_relations_with",
1527        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), // TODO verify
1528    ),
1529    (
1530        Scopes::PowerBloc,
1531        "power_bloc_worst_leader_relations_without",
1532        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), // TODO verify
1533    ),
1534    (Scopes::PowerBloc, "power_bloc_worst_leader_religion_population_fraction", CompareValue),
1535    (
1536        Scopes::PowerBloc,
1537        "power_bloc_worst_leader_religion_population_fraction_with",
1538        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), // TODO verify
1539    ),
1540    (
1541        Scopes::PowerBloc,
1542        "power_bloc_worst_leader_religion_population_fraction_without",
1543        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), // TODO verify
1544    ),
1545    (Scopes::PowerBloc, "power_bloc_worst_liberty_desire", CompareValue),
1546    (
1547        Scopes::PowerBloc,
1548        "power_bloc_worst_liberty_desire_with",
1549        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), // TODO verify
1550    ),
1551    (
1552        Scopes::PowerBloc,
1553        "power_bloc_worst_liberty_desire_without",
1554        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), // TODO verify
1555    ),
1556    (
1557        Scopes::PowerBloc,
1558        "power_bloc_worst_progressiveness_difference_government_type",
1559        CompareValue,
1560    ),
1561    (
1562        Scopes::PowerBloc,
1563        "power_bloc_worst_progressiveness_difference_government_type_with",
1564        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), // TODO verify
1565    ),
1566    (
1567        Scopes::PowerBloc,
1568        "power_bloc_worst_progressiveness_difference_government_type_without",
1569        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), // TODO verify
1570    ),
1571    (Scopes::Ship, "power_projection_value", CompareValue),
1572    (
1573        Scopes::PowerBloc,
1574        "predicted_cohesion_percentage_with",
1575        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
1576    ),
1577    (
1578        Scopes::InterestGroup,
1579        "prefers_law",
1580        Block(&[("law", Scope(Scopes::LawType)), ("comparison_law", Scope(Scopes::LawType))]),
1581    ),
1582    (Scopes::Country, "prestige", CompareValue),
1583    (Scopes::Country, "primary_cultures_percent_country", CompareValue),
1584    (Scopes::State, "primary_cultures_percent_state", CompareValue),
1585    (Scopes::Character, "primary_role", Item(Item::CharacterRole)),
1586    (Scopes::Building, "private_ownership_fraction", CompareValue),
1587    (Scopes::Country, "produced_authority", CompareValue),
1588    (Scopes::Country, "produced_bureaucracy", CompareValue),
1589    (Scopes::Country, "produced_influence", CompareValue),
1590    (Scopes::LawType, "progressiveness", CompareValue),
1591    (Scopes::Character, "prominence", CompareValue),
1592    (Scopes::Pop, "quality_of_life", CompareValue),
1593    (
1594        Scopes::Country.union(Scopes::State),
1595        "radical_fraction",
1596        BlockOrCompareValue(&[
1597            ("value", CompareValue),
1598            ("?pop_type", Item(Item::PopType)),
1599            ("?strata", Item(Item::Strata)),
1600            ("?culture", ScopeOrItem(Scopes::Culture, Item::Culture)),
1601            ("?religion", ScopeOrItem(Scopes::Religion, Item::Religion)),
1602        ]),
1603    ),
1604    (Scopes::Country, "radical_population_fraction", CompareValue),
1605    (Scopes::None, "real_month", CompareValue),
1606    (
1607        Scopes::Country,
1608        "region_score",
1609        Block(&[("strategic_region", Scope(Scopes::StrategicRegion)), ("value", CompareValue)]),
1610    ),
1611    (Scopes::Country, "relative_authority", CompareValue),
1612    (Scopes::Country, "relative_bureaucracy", CompareValue),
1613    (Scopes::StateGoods, "relative_export_advantage", CompareValue),
1614    (Scopes::StateGoods, "relative_import_advantage", CompareValue),
1615    (Scopes::Country, "relative_influence", CompareValue),
1616    (Scopes::State, "relative_infrastructure", CompareValue),
1617    (Scopes::Pop, "religion_accepted", Removed("1.8", "")),
1618    (
1619        Scopes::Country,
1620        "religion_percent_country",
1621        Block(&[("target", Scope(Scopes::Religion)), ("value", CompareValue)]),
1622    ),
1623    (
1624        Scopes::State,
1625        "religion_percent_state",
1626        Block(&[("target", Scope(Scopes::Religion)), ("value", CompareValue)]),
1627    ),
1628    (
1629        Scopes::Character,
1630        "remaining_career_length",
1631        Block(&[("?role", Item(Item::CharacterRole)), ("years", CompareValue)]),
1632    ),
1633    (
1634        Scopes::StateRegion,
1635        "remaining_undepleted",
1636        Block(&[("type", Item(Item::BuildingType)), ("amount", CompareValue)]),
1637    ),
1638    (Scopes::CharacterRole, "role_priority", CompareValue),
1639    (Scopes::Country, "ruler_can_have_command", Boolean),
1640    (Scopes::all_but_none(), "save_temporary_scope_as", Special),
1641    (Scopes::None, "save_temporary_scope_value_as", Special),
1642    (Scopes::Country, "scaled_debt", CompareValue),
1643    (Scopes::Country, "scaled_gold_reserves", CompareValue),
1644    (
1645        Scopes::JournalEntry,
1646        "scripted_bar_progress",
1647        Block(&[("name", Item(Item::ScriptedProgressBar)), ("value", CompareValue)]),
1648    ),
1649    (Scopes::Building, "self_ownership_fraction", CompareValue),
1650    (
1651        Scopes::Culture,
1652        "shares_heritage_and_other_trait_with_any_primary_culture",
1653        Removed("1.10", ""),
1654    ),
1655    (
1656        Scopes::Culture,
1657        "shares_heritage_trait_group_with_any_primary_culture",
1658        Scope(Scopes::Country),
1659    ),
1660    (Scopes::Culture, "shares_heritage_trait_group_with_culture", Scope(Scopes::Culture)),
1661    (Scopes::Religion, "shares_heritage_trait_group_with_religion", Scope(Scopes::Religion)),
1662    (Scopes::Religion, "shares_heritage_trait_group_with_state_religion", Scope(Scopes::Country)),
1663    (Scopes::Culture, "shares_heritage_trait_with_any_primary_culture", Scope(Scopes::Country)),
1664    (Scopes::Culture, "shares_heritage_trait_with_culture", Scope(Scopes::Culture)),
1665    (Scopes::Religion, "shares_heritage_trait_with_culture", Scope(Scopes::Religion)),
1666    (Scopes::Religion, "shares_heritage_trait_with_religion", Scope(Scopes::Religion)),
1667    (Scopes::Religion, "shares_heritage_trait_with_state_religion", Scope(Scopes::Country)),
1668    (
1669        Scopes::Culture,
1670        "shares_language_trait_group_with_any_primary_culture",
1671        Scope(Scopes::Country),
1672    ),
1673    (Scopes::Culture, "shares_language_trait_group_with_culture", Scope(Scopes::Culture)),
1674    (Scopes::Culture, "shares_language_trait_with_any_primary_culture", Scope(Scopes::Country)),
1675    (Scopes::Culture, "shares_language_trait_with_culture", Scope(Scopes::Culture)),
1676    (Scopes::Culture, "shares_non_heritage_trait_with_any_primary_culture", Removed("1.10", "")),
1677    (Scopes::Culture, "shares_tradition_trait_with_any_primary_culture", Scope(Scopes::Country)),
1678    (Scopes::Culture, "shares_tradition_trait_with_culture", Scope(Scopes::Culture)),
1679    (Scopes::Culture, "shares_trait_with_any_primary_culture", Removed("1.10", "")),
1680    (Scopes::Religion, "shares_trait_with_state_religion", Removed("1.10", "")),
1681    (Scopes::Country, "ship_modification_market_demand_ratio", UncheckedTodo),
1682    (
1683        Scopes::Country,
1684        "should_set_wargoal",
1685        Block(&[("target", Scope(Scopes::DiplomaticPlay)), ("?value", Boolean)]),
1686    ),
1687    (Scopes::None, "should_show_nudity", Boolean),
1688    (Scopes::Country, "shrinking_institution", Item(Item::Institution)),
1689    (
1690        Scopes::Country,
1691        "size_weighted_lost_battles_fraction",
1692        Block(&[("target", Scope(Scopes::War)), ("value", CompareValue)]),
1693    ),
1694    (Scopes::Country, "sol_ranking", CompareValue),
1695    (Scopes::CharacterRole, "spawns_characters_to_pool", Boolean),
1696    (Scopes::Ship, "speed", CompareValue),
1697    (Scopes::Country, "stall_chance", CompareValue),
1698    (
1699        Scopes::Country,
1700        "stall_chance_for_law",
1701        Block(&[("target", Scope(Scopes::LawType)), ("value", CompareValue)]),
1702    ),
1703    (
1704        Scopes::Country,
1705        "stall_chance_for_law_without_enactment_modifier",
1706        Block(&[("target", Scope(Scopes::LawType)), ("value", CompareValue)]),
1707    ),
1708    (Scopes::Country, "stall_chance_without_enactment_modifier", CompareValue),
1709    (Scopes::Pop, "standard_of_living", CompareValue),
1710    (Scopes::BattleSide, "starting_manpower", CompareValue),
1711    (
1712        Scopes::State,
1713        "state_average_culture_and_religion_pop_acceptance",
1714        Block(&[
1715            ("culture", Scope(Scopes::Culture)),
1716            ("religion", Scope(Scopes::Religion)),
1717            ("value", CompareValue),
1718        ]),
1719    ),
1720    (
1721        Scopes::State,
1722        "state_average_culture_pop_acceptance",
1723        Block(&[("culture", Scope(Scopes::Culture)), ("value", CompareValue)]),
1724    ),
1725    (
1726        Scopes::State,
1727        "state_average_religion_pop_acceptance",
1728        Block(&[("religion", Scope(Scopes::Religion)), ("value", CompareValue)]),
1729    ),
1730    (
1731        Scopes::State,
1732        "state_cultural_acceptance",
1733        Block(&[("target", Scope(Scopes::Culture)), ("value", CompareValue)]),
1734    ),
1735    (
1736        Scopes::State,
1737        "state_exports",
1738        Block(&[
1739            ("?target", Scope(Scopes::State)),
1740            ("?goods", Item(Item::Goods)),
1741            ("value", CompareValue),
1742        ]),
1743    ),
1744    (Scopes::StateGoods, "state_goods_cheaper", CompareValue),
1745    (Scopes::StateGoods, "state_goods_consumption", CompareValue),
1746    (Scopes::StateGoods, "state_goods_delta", CompareValue),
1747    (Scopes::StateGoods, "state_goods_has_local_goods_shortage", Boolean),
1748    (Scopes::StateGoods, "state_goods_pricier", CompareValue),
1749    (Scopes::StateGoods, "state_goods_production", CompareValue),
1750    (
1751        Scopes::State,
1752        "state_has_building_group_levels",
1753        Block(&[("type", Item(Item::BuildingGroup)), ("value", CompareValue)]),
1754    ),
1755    (Scopes::State, "state_has_building_levels", CompareValue),
1756    (
1757        Scopes::State,
1758        "state_has_building_type_levels",
1759        Block(&[("target", Scope(Scopes::BuildingType)), ("value", CompareValue)]),
1760    ),
1761    (Scopes::State, "state_has_goods_shortage", Boolean),
1762    (Scopes::State, "state_has_national_awakening", Boolean),
1763    (
1764        Scopes::State,
1765        "state_imports",
1766        Block(&[
1767            ("?target", Scope(Scopes::State)),
1768            ("?goods", Item(Item::Goods)),
1769            ("value", CompareValue),
1770        ]),
1771    ),
1772    (Scopes::State, "state_is_eligible_as_mass_migration_target", Boolean),
1773    (Scopes::State, "state_population", CompareValue),
1774    (
1775        Scopes::State,
1776        "state_religious_acceptance",
1777        Block(&[("target", Scope(Scopes::Religion)), ("value", CompareValue)]),
1778    ),
1779    (
1780        Scopes::State,
1781        "state_trade",
1782        Block(&[
1783            ("?target", Scope(Scopes::State)),
1784            ("?goods", Item(Item::Goods)),
1785            ("value", CompareValue),
1786        ]),
1787    ),
1788    (Scopes::State, "state_unemployment_rate", CompareValue),
1789    (Scopes::Pop, "strata", CompareChoice(STRATA)),
1790    (Scopes::Country, "subject_can_increase_autonomy", Boolean),
1791    (Scopes::Country, "supply_network_strength", CompareValue),
1792    (Scopes::Country, "supply_ship_maintenance_fulfillment", CompareValue),
1793    (Scopes::None, "switch", Special),
1794    (Scopes::Country, "taking_loans", Boolean),
1795    (Scopes::PowerBloc, "target_cohesion_number", CompareValue),
1796    (Scopes::PowerBloc, "target_cohesion_percentage", CompareValue),
1797    (Scopes::DiplomaticPlay, "target_is", Scope(Scopes::Country)),
1798    (Scopes::State, "tax_capacity", CompareValue),
1799    (Scopes::State, "tax_capacity_usage", CompareValue),
1800    (Scopes::Country, "tax_level", CompareChoice(LEVELS)),
1801    (Scopes::Country, "tax_level_value", CompareValue),
1802    (Scopes::Country, "tax_waste", CompareValue),
1803    (Scopes::Country, "tenure_in_current_power_bloc_days", CompareValue),
1804    (Scopes::Country, "tenure_in_current_power_bloc_months", CompareValue),
1805    (Scopes::Country, "tenure_in_current_power_bloc_weeks", CompareValue),
1806    (Scopes::Country, "tenure_in_current_power_bloc_years", CompareValue),
1807    (Scopes::Country, "total_manpower", Removed("1.6", "")),
1808    (Scopes::Country, "total_expenses", CompareValue),
1809    (Scopes::Country, "total_income", CompareValue),
1810    (Scopes::Country, "total_population", CompareValue),
1811    (Scopes::Country, "total_population_including_subjects", CompareValue),
1812    (Scopes::Country, "total_population_including_subjects_share", CompareValue),
1813    (Scopes::Country, "total_population_share", CompareValue),
1814    (Scopes::Pop, "total_size", CompareValue),
1815    (Scopes::State, "total_urbanization", CompareValue),
1816    (Scopes::PowerBloc, "total_used_principle_levels", CompareValue),
1817    (
1818        Scopes::None,
1819        "trade_route_needs_convoys_to_grow",
1820        Removed("1.9", "replaced with world market system"),
1821    ),
1822    (Scopes::Character, "trait_value", CompareValue),
1823    (Scopes::Country, "transfer_money_gross_income", CompareValue),
1824    (Scopes::Country, "transfer_money_net_income", CompareValue),
1825    (Scopes::None, "trigger_else", Control),
1826    (Scopes::None, "trigger_else_if", Control),
1827    (Scopes::None, "trigger_if", Control),
1828    (Scopes::State, "turmoil", CompareValue),
1829    (Scopes::NewCombatUnit, "unit_formation_has_commander", Scope(Scopes::Character)),
1830    // docs for all three say "target" instead of "value"
1831    (Scopes::PowerBloc, "used_principle_slots", CompareValue),
1832    (
1833        Scopes::None,
1834        "variable_list_size",
1835        Block(&[("name", Identifier("list name")), ("value", CompareValue)]),
1836    ),
1837    (
1838        Scopes::War,
1839        "war_exhaustion_from_acceptance_of_dead",
1840        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
1841    ),
1842    (Scopes::War, "war_has_active_peace_deal", Boolean),
1843    (
1844        Scopes::Country,
1845        "war_participant_has_war_goal_of_type_against",
1846        Block(&[("type", Item(Item::WarGoalType)), ("target", Scope(Scopes::Country))]),
1847    ),
1848    (
1849        Scopes::Country,
1850        "war_side_has_war_goal_of_type_against",
1851        Block(&[("type", Item(Item::WarGoalType)), ("target", Scope(Scopes::Country))]),
1852    ),
1853    (Scopes::Treaty, "was_coerced_with_naval_threat", Boolean),
1854    (Scopes::Character, "was_exiled", Boolean),
1855    (Scopes::Country, "was_formed_from", Item(Item::Country)),
1856    (Scopes::Pop, "wealth", CompareValue),
1857    // TODO: exactly one of pop_type, religion, or culture must be specified
1858    (
1859        Scopes::Country.union(Scopes::State),
1860        "weath_share",
1861        Block(&[
1862            ("?pop_type", ScopeOrItem(Scopes::PopType, Item::PopType)),
1863            ("?religion", ScopeOrItem(Scopes::Religion, Item::Religion)),
1864            ("?culture", ScopeOrItem(Scopes::Culture, Item::Culture)),
1865            ("value", CompareValue),
1866        ]),
1867    ),
1868    (
1869        Scopes::Country,
1870        "weekly_net_fixed_income",
1871        Removed(
1872            "1.12",
1873            "Replaced with total_income, fixed_income, net_total_income, net_fixed_income",
1874        ),
1875    ),
1876    (Scopes::Building, "weekly_profit", CompareValue),
1877    (Scopes::None, "weighted_calc_true_if", Special),
1878    (Scopes::Pop, "workforce", CompareValue),
1879    (Scopes::State, "world_market_access", CompareValue),
1880    (Scopes::Goods, "world_market_delta", CompareValue),
1881    (Scopes::Goods, "world_market_exports", CompareValue),
1882    (Scopes::Goods, "world_market_imports", CompareValue),
1883    (
1884        Scopes::Country,
1885        "would_accept_diplomatic_action",
1886        Block(&[
1887            ("actor", Scope(Scopes::Country)),
1888            ("type", Item(Item::DiplomaticAction)),
1889            ("?first_state", Scope(Scopes::State)),
1890            ("?second_state", Scope(Scopes::State)),
1891            ("?modify_acceptance", SetValue),
1892        ]),
1893    ),
1894    (Scopes::InterestGroup, "would_sponsor_amendment", Scope(Scopes::AmendmentType)),
1895    (Scopes::None, "year", CompareValue),
1896    (Scopes::Character, "years_of_service", CompareValue),
1897    (
1898        Scopes::State,
1899        "years_to_incorporate",
1900        Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
1901    ),
1902];
1903
1904#[inline]
1905pub fn scope_trigger_complex(name: &str) -> Option<(Scopes, ArgumentValue, Scopes)> {
1906    TRIGGER_COMPLEX_MAP.get(name).copied()
1907}
1908
1909static TRIGGER_COMPLEX_MAP: LazyLock<TigerHashMap<&'static str, (Scopes, ArgumentValue, Scopes)>> =
1910    LazyLock::new(|| {
1911        let mut hash = TigerHashMap::default();
1912        for (from, s, trigger, outscopes) in TRIGGER_COMPLEX.iter().copied() {
1913            hash.insert(s, (from, trigger, outscopes));
1914        }
1915        hash
1916    });
1917
1918/// LAST UPDATED VIC3 VERSION 1.8.4
1919/// See `triggers.log` from the game data dumps
1920/// `(inscopes, trigger name, argtype, outscopes)`
1921/// Currently only works with single argument triggers
1922// TODO Update argtype when vic3 updated to 1.5+
1923const TRIGGER_COMPLEX: &[(Scopes, &str, ArgumentValue, Scopes)] = {
1924    use crate::item::Item;
1925    use ArgumentValue::*;
1926    &[
1927        (
1928            Scopes::Country,
1929            "additional_war_exhaustion",
1930            Scope(Scopes::DiplomaticPlay),
1931            Scopes::Value,
1932        ),
1933        (
1934            Scopes::Country,
1935            "army_mobilization_option_fraction",
1936            Item(Item::MobilizationOption),
1937            Scopes::Value,
1938        ),
1939        (Scopes::Country, "average_sol_for_culture", Scope(Scopes::Culture), Scopes::Value),
1940        (Scopes::Country, "average_sol_for_religion", Scope(Scopes::Religion), Scopes::Value),
1941        (Scopes::Character, "character_acceptance", Scope(Scopes::Country), Scopes::Value),
1942        (
1943            Scopes::Country,
1944            "country_army_unit_type_fraction",
1945            Scope(Scopes::CombatUnitType),
1946            Scopes::Value,
1947        ),
1948        (
1949            Scopes::Country,
1950            "country_average_cultural_acceptance",
1951            Scope(Scopes::Culture),
1952            Scopes::Value,
1953        ),
1954        (
1955            Scopes::Country,
1956            "country_average_culture_pop_acceptance",
1957            Scope(Scopes::Culture),
1958            Scopes::Value,
1959        ),
1960        (
1961            Scopes::Country,
1962            "country_average_religion_pop_acceptance",
1963            Scope(Scopes::Religion),
1964            Scopes::Value,
1965        ),
1966        (
1967            Scopes::Country,
1968            "country_average_religious_acceptance",
1969            Scope(Scopes::Religion),
1970            Scopes::Value,
1971        ),
1972        (
1973            Scopes::Country,
1974            "country_has_building_group_levels",
1975            Item(Item::BuildingGroup),
1976            Scopes::Value,
1977        ),
1978        (
1979            Scopes::Country,
1980            "country_has_building_type_levels",
1981            Item(Item::BuildingType),
1982            Scopes::Value,
1983        ),
1984        (Scopes::Country, "country_ship_type_fraction", Scope(Scopes::ShipType), Scopes::Value),
1985        (Scopes::Country, "cultural_acceptance_base", Scope(Scopes::Culture), Scopes::Value),
1986        (Scopes::State, "cultural_acceptance_delta", Scope(Scopes::Culture), Scopes::Value),
1987        (Scopes::Country, "culture_percent_country", Scope(Scopes::Culture), Scopes::Value),
1988        (Scopes::State, "culture_percent_state", Scope(Scopes::Culture), Scopes::Value),
1989        (Scopes::Culture, "culture_secession_progress", Scope(Scopes::Country), Scopes::Value),
1990        (
1991            Scopes::DiplomaticPact,
1992            "diplomatic_pact_other_country",
1993            Scope(Scopes::Country),
1994            Scopes::Country,
1995        ),
1996        (Scopes::Country, "economic_dependence", Scope(Scopes::Country), Scopes::Value),
1997        (Scopes::Country, "enactment_chance_for_law", Scope(Scopes::LawType), Scopes::Value),
1998        (
1999            Scopes::Country,
2000            "enactment_chance_for_law_without_enactment_modifier",
2001            Scope(Scopes::LawType),
2002            Scopes::Value,
2003        ),
2004        (Scopes::Country, "enemy_contested_wargoals", Scope(Scopes::War), Scopes::Value),
2005        (
2006            Scopes::MilitaryFormation,
2007            "formation_army_unit_type_fraction",
2008            Scope(Scopes::CombatUnitType),
2009            Scopes::Value,
2010        ),
2011        (
2012            Scopes::MilitaryFormation,
2013            "formation_navy_unit_type_fraction",
2014            Scope(Scopes::CombatUnitType),
2015            Scopes::Value,
2016        ),
2017        (
2018            Scopes::Building,
2019            "fraction_of_levels_owned_by_country",
2020            Scope(Scopes::Country),
2021            Scopes::Value,
2022        ),
2023        (Scopes::Country, "gdp_ownership_ratio", Scope(Scopes::Country), Scopes::Value),
2024        (Scopes::Country, "goods_production_rank", Scope(Scopes::Goods), Scopes::Value),
2025        (
2026            Scopes::HarvestCondition,
2027            "harvest_condition_intensity",
2028            Scope(Scopes::Country),
2029            Scopes::Value,
2030        ),
2031        (
2032            Scopes::Country,
2033            "has_strategic_region_interest_tier",
2034            Scope(Scopes::StrategicRegion),
2035            Scopes::Value,
2036        ),
2037        (Scopes::Country, "has_technology_progress", Item(Item::Technology), Scopes::Value),
2038        (Scopes::War, "has_war_exhaustion", Item(Item::Country), Scopes::Value),
2039        (Scopes::War, "has_war_support", Item(Item::Country), Scopes::Value),
2040        (
2041            Scopes::Country,
2042            "highest_overlapping_interest_tier",
2043            Scope(Scopes::Country),
2044            Scopes::Value,
2045        ),
2046        (Scopes::State, "ig_state_pol_strength_share", Scope(Scopes::InterestGroup), Scopes::Value),
2047        (Scopes::Country, "institution_investment_level", Item(Item::Institution), Scopes::Value),
2048        (Scopes::LawType, "law_progressiveness_difference", Scope(Scopes::LawType), Scopes::Value),
2049        (Scopes::PowerBloc, "leverage_advantage", Scope(Scopes::Country), Scopes::Value),
2050        (Scopes::None, "list_size", Identifier("list name"), Scopes::Value),
2051        (Scopes::Market, "market_consumption_share", Scope(Scopes::Country), Scopes::Value),
2052        (Scopes::Market, "market_exports", Scope(Scopes::Market), Scopes::Value),
2053        (Scopes::Market, "market_exports_reliance", Scope(Scopes::Market), Scopes::Value),
2054        (Scopes::Market, "market_imports", Scope(Scopes::Market), Scopes::Value),
2055        (Scopes::Market, "market_imports_reliance", Scope(Scopes::Market), Scopes::Value),
2056        (
2057            Scopes::Market,
2058            "market_number_goods_shortages_with",
2059            Scope(Scopes::Country),
2060            Scopes::Value,
2061        ),
2062        (
2063            Scopes::Market,
2064            "market_number_goods_shortages_without",
2065            Scope(Scopes::Country),
2066            Scopes::Value,
2067        ),
2068        (Scopes::Market, "market_production_share", Scope(Scopes::Country), Scopes::Value),
2069        (
2070            Scopes::PoliticalMovement,
2071            "movement_pressure",
2072            Scope(Scopes::InterestGroup),
2073            Scopes::Value,
2074        ),
2075        (Scopes::Country, "nationalization_cost", Scope(Scopes::Country), Scopes::Value),
2076        (Scopes::War, "num_country_casualties", Scope(Scopes::Country), Scopes::Value),
2077        (Scopes::War, "num_country_dead", Scope(Scopes::Country), Scopes::Value),
2078        (Scopes::War, "num_country_wounded", Scope(Scopes::Country), Scopes::Value),
2079        // TODO: check that the DiplomaticAction has a pact
2080        (Scopes::Country, "num_diplomatic_pacts", Item(Item::DiplomaticAction), Scopes::Value),
2081        // TODO: "will return an error if used on building types that are not level capped"
2082        (
2083            Scopes::State,
2084            "num_potential_resources",
2085            ScopeOrItem(Scopes::BuildingType, Item::BuildingType),
2086            Scopes::Value,
2087        ),
2088        (Scopes::Country, "pop_type_percent_country", Item(Item::PopType), Scopes::Value),
2089        (Scopes::State, "pop_type_percent_state", Scope(Scopes::PopType), Scopes::Value),
2090        (Scopes::State, "population_by_culture", Scope(Scopes::Culture), Scopes::Value),
2091        (
2092            Scopes::Country,
2093            "potential_diplomatic_play_power_ratio",
2094            Scope(Scopes::Country),
2095            Scopes::Value,
2096        ),
2097        (Scopes::Country, "religion_percent_country", Scope(Scopes::Religion), Scopes::Value),
2098        (Scopes::State, "religion_percent_state", Scope(Scopes::Religion), Scopes::Value),
2099        (Scopes::StateRegion, "remaining_undepleted", Item(Item::BuildingGroup), Scopes::Value),
2100        (Scopes::Country, "size_weighted_lost_battles_fraction", Scope(Scopes::War), Scopes::Value),
2101        (
2102            Scopes::State,
2103            "state_has_building_group_levels",
2104            Item(Item::BuildingGroup),
2105            Scopes::Value,
2106        ),
2107        (Scopes::State, "state_has_building_type_levels", Item(Item::BuildingType), Scopes::Value),
2108        (Scopes::Country, "power_bloc_share_gdp_with", Scope(Scopes::Country), Scopes::Value),
2109        (Scopes::Country, "power_bloc_share_gdp_without", Scope(Scopes::Country), Scopes::Value),
2110        (
2111            Scopes::Country,
2112            "power_bloc_share_power_projection_with",
2113            Scope(Scopes::Country),
2114            Scopes::Value,
2115        ),
2116        (
2117            Scopes::Country,
2118            "power_bloc_share_power_projection_without",
2119            Scope(Scopes::Country),
2120            Scopes::Value,
2121        ),
2122        (Scopes::Country, "power_bloc_share_prestige_with", Scope(Scopes::Country), Scopes::Value),
2123        (
2124            Scopes::Country,
2125            "power_bloc_share_prestige_without",
2126            Scope(Scopes::Country),
2127            Scopes::Value,
2128        ),
2129        (
2130            Scopes::PowerBloc,
2131            "power_bloc_total_leading_goods_producers_with",
2132            Scope(Scopes::Country),
2133            Scopes::Value,
2134        ),
2135        (
2136            Scopes::PowerBloc,
2137            "power_bloc_total_leading_goods_producers_without",
2138            Scope(Scopes::Country),
2139            Scopes::Value,
2140        ),
2141        (
2142            Scopes::PowerBloc,
2143            "power_bloc_worst_economic_dependence_with",
2144            Scope(Scopes::Country),
2145            Scopes::Value,
2146        ),
2147        (
2148            Scopes::PowerBloc,
2149            "power_bloc_worst_economic_dependence_without",
2150            Scope(Scopes::Country),
2151            Scopes::Value,
2152        ),
2153        (Scopes::PowerBloc, "power_bloc_worst_infamy_with", Scope(Scopes::Country), Scopes::Value),
2154        (
2155            Scopes::PowerBloc,
2156            "power_bloc_worst_infamy_without",
2157            Scope(Scopes::Country),
2158            Scopes::Value,
2159        ),
2160        (
2161            Scopes::PowerBloc,
2162            "power_bloc_worst_leader_relations_with",
2163            Scope(Scopes::Country),
2164            Scopes::Value,
2165        ),
2166        (
2167            Scopes::PowerBloc,
2168            "power_bloc_worst_leader_relations_without",
2169            Scope(Scopes::Country),
2170            Scopes::Value,
2171        ),
2172        (
2173            Scopes::PowerBloc,
2174            "power_bloc_worst_leader_religion_population_fraction_with",
2175            Scope(Scopes::Country),
2176            Scopes::Value,
2177        ),
2178        (
2179            Scopes::PowerBloc,
2180            "power_bloc_worst_leader_religion_population_fraction_without",
2181            Scope(Scopes::Country),
2182            Scopes::Value,
2183        ),
2184        (
2185            Scopes::PowerBloc,
2186            "power_bloc_worst_liberty_desire_with",
2187            Scope(Scopes::Country),
2188            Scopes::Value,
2189        ),
2190        (
2191            Scopes::PowerBloc,
2192            "power_bloc_worst_liberty_desire_without",
2193            Scope(Scopes::Country),
2194            Scopes::Value,
2195        ),
2196        (
2197            Scopes::PowerBloc,
2198            "power_bloc_worst_progressiveness_difference_government_type_with",
2199            Scope(Scopes::Country),
2200            Scopes::Value,
2201        ),
2202        (
2203            Scopes::PowerBloc,
2204            "power_bloc_worst_progressiveness_difference_government_type_without",
2205            Scope(Scopes::Country),
2206            Scopes::Value,
2207        ),
2208        (
2209            Scopes::PowerBloc,
2210            "predicted_cohesion_percentage_with",
2211            Scope(Scopes::Country),
2212            Scopes::Value,
2213        ),
2214        (Scopes::Country, "region_score", Scope(Scopes::StrategicRegion), Scopes::Value),
2215        (
2216            Scopes::JournalEntry,
2217            "scripted_bar_progress",
2218            Item(Item::ScriptedProgressBar),
2219            Scopes::Value,
2220        ),
2221        (Scopes::Country, "stall_chance_for_law", Scope(Scopes::LawType), Scopes::Value),
2222        (
2223            Scopes::Country,
2224            "stall_chance_for_law_without_enactment_modifier",
2225            Scope(Scopes::LawType),
2226            Scopes::Value,
2227        ),
2228        (
2229            Scopes::Country,
2230            "state_average_culture_pop_acceptance",
2231            Scope(Scopes::Culture),
2232            Scopes::Value,
2233        ),
2234        (
2235            Scopes::Country,
2236            "state_average_religion_pop_acceptance",
2237            Scope(Scopes::Religion),
2238            Scopes::Value,
2239        ),
2240        (Scopes::State, "state_cultural_acceptance", Scope(Scopes::Culture), Scopes::Value),
2241        (Scopes::State, "state_religious_acceptance", Scope(Scopes::Religion), Scopes::Value),
2242        (
2243            Scopes::War,
2244            "war_exhaustion_from_acceptance_of_dead",
2245            Scope(Scopes::Country),
2246            Scopes::Value,
2247        ),
2248        (Scopes::State, "years_to_incorporate", Scope(Scopes::Country), Scopes::Value),
2249    ]
2250};