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