use std::sync::LazyLock;
use crate::everything::Everything;
use crate::helpers::TigerHashMap;
use crate::item::Item;
use crate::scopes::*;
use crate::token::Token;
use crate::trigger::Trigger;
use crate::vic3::tables::misc::*;
use Trigger::*;
pub fn scope_trigger(name: &Token, _data: &Everything) -> Option<(Scopes, Trigger)> {
let name_lc = name.as_str().to_ascii_lowercase();
TRIGGER_MAP.get(&*name_lc).copied()
}
static TRIGGER_MAP: LazyLock<TigerHashMap<&'static str, (Scopes, Trigger)>> = LazyLock::new(|| {
let mut hash = TigerHashMap::default();
for (from, s, trigger) in TRIGGER.iter().copied() {
hash.insert(s, (from, trigger));
}
hash
});
const TRIGGER: &[(Scopes, &str, Trigger)] = &[
(Scopes::None, "active_lens", UncheckedValue), (Scopes::None, "active_lens_option", UncheckedValue), (Scopes::all_but_none(), "add_to_temporary_list", Special),
(Scopes::Country, "additional_war_exhaustion", CompareValue),
(Scopes::Character, "age", CompareValue),
(Scopes::Country, "aggressive_diplomatic_plays_permitted", Boolean),
(Scopes::None, "all_false", Control),
(Scopes::None, "always", Boolean),
(Scopes::None, "and", Control),
(Scopes::None, "any_false", Control),
(Scopes::PoliticalLobby, "appeasement", CompareValue),
(Scopes::Country, "approaching_bureaucracy_shortage", Boolean),
(Scopes::State, "arable_land", CompareValue),
(Scopes::Country, "arable_land_country", CompareValue),
(
Scopes::Country,
"army_mobilization_option_fraction",
Block(&[("target", Scope(Scopes::MobilizationOption)), ("value", CompareValue)]),
),
(Scopes::Country, "army_power_projection", CompareValue),
(Scopes::Country, "army_reserves", Removed("1.6", "")),
(Scopes::None, "assert_if", Block(&[("limit", Control), ("?text", UncheckedValue)])),
(Scopes::None, "assert_read", UncheckedValue),
(Scopes::Country, "authority", CompareValue),
(Scopes::State, "available_jobs", CompareValue),
(Scopes::Country, "average_country_infrastructure", CompareValue),
(Scopes::Country, "average_incorporated_country_infrastructure", CompareValue),
(
Scopes::Country,
"average_sol_for_culture",
Block(&[("target", Scope(Scopes::Culture)), ("value", CompareValue)]),
),
(Scopes::Country, "average_sol_for_primary_cultures", CompareValue),
(
Scopes::Country,
"average_sol_for_religion",
Block(&[("target", Scope(Scopes::Religion)), ("value", CompareValue)]),
),
(Scopes::Country, "average_sol_for_slaves", CompareValue),
(Scopes::Country, "battalion_manpower", Removed("1.6", "")),
(Scopes::Battle, "battle_side_pm_usage", Removed("1.6", "")),
(Scopes::Building, "building_has_goods_shortage", Boolean),
(Scopes::Country, "bureaucracy", CompareValue),
(Scopes::None, "calc_true_if", Control),
(
Scopes::State,
"can_activate_production_method",
Block(&[
("building_type", Item(Item::BuildingType)),
("production_method", Item(Item::ProductionMethod)),
]),
),
(Scopes::Country, "can_add_wargoal_against", Scope(Scopes::Country)),
(
Scopes::Country,
"can_afford_diplomatic_action",
Block(&[("target", Scope(Scopes::Country)), ("type", Item(Item::DiplomaticAction))]),
),
(Scopes::Character, "can_agitate", Scope(Scopes::Country)),
(Scopes::Law, "can_be_enacted", Boolean),
(
Scopes::Country,
"can_break_diplomatic_pact",
Block(&[
("target", Scope(Scopes::Country)),
("type", Item(Item::DiplomaticAction)),
("?first_state", Scope(Scopes::State)),
("?second_state", Scope(Scopes::State)),
]),
),
(Scopes::State, "can_construct_building", Item(Item::BuildingType)),
(
Scopes::Country,
"can_create_diplomatic_pact",
Block(&[
("target", Scope(Scopes::Country)),
("type", Item(Item::DiplomaticAction)),
("?first_state", Scope(Scopes::State)),
("?second_state", Scope(Scopes::State)),
]),
),
(Scopes::Country, "can_decrease_autonomy", Boolean),
(Scopes::Country, "can_establish_any_export_route", ScopeOrItem(Scopes::Goods, Item::Goods)),
(Scopes::Country, "can_establish_any_import_route", ScopeOrItem(Scopes::Goods, Item::Goods)),
(Scopes::Country, "can_establish_company", Boolean),
(Scopes::Country, "can_form_nation", Item(Item::Country)),
(
Scopes::Country,
"can_have_as_subject",
Block(&[("who", Scope(Scopes::Country)), ("type", Item(Item::SubjectType))]),
),
(Scopes::StrategicRegion, "can_have_declared_interest_here", Scope(Scopes::Country)),
(Scopes::Country, "can_have_mass_migration_to", Scope(Scopes::Country)),
(Scopes::Country, "can_have_political_movement", Removed("1.8", "")),
(Scopes::Country, "can_have_subjects", Boolean),
(Scopes::Country, "can_increase_autonomy", Boolean),
(Scopes::PowerBloc, "can_invite_any_country", Boolean),
(Scopes::Country, "can_leave_power_bloc", Boolean),
(Scopes::Country, "can_lobbies_target", Scope(Scopes::Country)),
(Scopes::Country, "can_own_autonomy_be_decreased", Boolean),
(Scopes::Building, "can_queue_building_levels", CompareValue),
(Scopes::Country, "can_research", Item(Item::Technology)),
(
Scopes::Country,
"can_send_diplomatic_action",
Block(&[
("target", Scope(Scopes::Country)),
("type", Item(Item::DiplomaticAction)),
("?first_state", Scope(Scopes::State)),
("?second_state", Scope(Scopes::State)),
]),
),
(Scopes::None, "can_start_tutorial_lesson", Item(Item::TutorialLesson)),
(
Scopes::Country,
"can_take_on_scaled_debt",
Block(&[("who", Scope(Scopes::Country)), ("value", CompareValue)]),
),
(Scopes::Country, "can_trigger_event", Item(Item::Event)),
(Scopes::Building, "cash_reserves_available", CompareValue),
(Scopes::Building, "cash_reserves_ratio", CompareValue),
(
Scopes::Character,
"character_acceptance",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
),
(
Scopes::Character,
"character_is_discriminated",
Removed("1.8", "replaced with character_acceptance"),
),
(Scopes::Character, "character_supports_political_movement", Boolean),
(
Scopes::Country
.union(Scopes::Province)
.union(Scopes::State)
.union(Scopes::StateRegion)
.union(Scopes::StrategicRegion)
.union(Scopes::Theater),
"check_area",
Block(&[
("mode", Choice(&["adjacent"])),
(
"target",
Scope(
Scopes::Country
.union(Scopes::Province)
.union(Scopes::State)
.union(Scopes::StateRegion)
.union(Scopes::StrategicRegion)
.union(Scopes::Theater),
),
),
]),
),
(Scopes::CivilWar, "civil_war_progress", CompareValue),
(Scopes::Character, "commander_is_available", Boolean),
(Scopes::Character, "commander_pm_usage", Removed("1.6", "")),
(Scopes::Character, "commander_rank", CompareValue),
(Scopes::Country, "construction_queue_duration", CompareValue),
(Scopes::Country, "construction_queue_government_duration", CompareValue),
(Scopes::Country, "construction_queue_num_queued_government_levels", CompareValue),
(Scopes::Country, "construction_queue_num_queued_levels", CompareValue),
(Scopes::Country, "construction_queue_num_queued_private_levels", CompareValue),
(Scopes::Country, "construction_queue_private_duration", CompareValue),
(Scopes::StateRegion, "contains_capital_of", ScopeOrItem(Scopes::Country, Item::Country)),
(Scopes::Character, "could_support_political_movement", Scope(Scopes::PoliticalMovement)),
(
Scopes::Country,
"country_army_unit_type_fraction",
Block(&[("target", Scope(Scopes::CombatUnitType)), ("value", CompareValue)]),
),
(
Scopes::Country,
"country_average_cultural_acceptance",
Block(&[("target", Scope(Scopes::Culture)), ("value", CompareValue)]),
),
(
Scopes::Country,
"country_average_religious_acceptance",
Block(&[("target", Scope(Scopes::Religion)), ("value", CompareValue)]),
),
(Scopes::Country, "country_can_have_mass_migration_to", Scope(Scopes::Country)), (Scopes::CountryDefinition, "country_definition_has_culture", Scope(Scopes::Culture)),
(
Scopes::Country,
"country_has_building_group_levels",
Block(&[("type", Item(Item::BuildingGroup)), ("value", CompareValue)]),
),
(Scopes::Country, "country_has_building_levels", CompareValue),
(
Scopes::Country,
"country_has_building_type_levels",
Block(&[("target", Scope(Scopes::BuildingType)), ("value", CompareValue)]),
),
(Scopes::MarketGoods, "country_has_local_shortage", Scope(Scopes::Country)),
(Scopes::Country, "country_has_primary_culture", Scope(Scopes::Culture)),
(Scopes::Country, "country_has_state_religion", Scope(Scopes::Religion)),
(Scopes::Country, "country_innovation", CompareValue),
(
Scopes::Country,
"country_navy_unit_type_fraction",
Block(&[("target", Scope(Scopes::CombatUnitType)), ("value", CompareValue)]),
),
(Scopes::Country, "country_or_subject_owns_entire_state_region", Item(Item::StateRegion)),
(Scopes::Country, "country_ownership_fraction", CompareValue),
(Scopes::Country, "country_pm_usage", Removed("1.6", "")),
(Scopes::Country, "country_rank", CompareValue),
(Scopes::Country, "country_tier", ItemOrCompareValue(Item::CountryTier)),
(Scopes::Country, "country_turmoil", CompareValue),
(Scopes::Pop, "culture_accepted", Removed("1.8", "")),
(
Scopes::Country,
"cultural_acceptance_base",
Block(&[("target", Scope(Scopes::Culture)), ("value", CompareValue)]),
),
(
Scopes::Country,
"cultural_acceptance_delta",
Block(&[("target", Scope(Scopes::Culture)), ("value", CompareValue)]),
),
(
Scopes::Culture,
"culture_can_have_mass_migration_to",
Removed("1.6", "replaced with culture_can_have_mass_migration_to_country"),
),
(Scopes::Culture, "culture_can_have_mass_migration_to_country", Scope(Scopes::Country)),
(Scopes::Culture, "culture_has_community_in_state", Scope(Scopes::State)),
(Scopes::Culture, "culture_is_discriminated_in", Removed("1.8", "")),
(
Scopes::Country,
"culture_percent_country",
Block(&[("target", Scope(Scopes::Culture)), ("value", CompareValue)]),
),
(
Scopes::State,
"culture_percent_state",
Block(&[("target", Scope(Scopes::Culture)), ("value", CompareValue)]),
),
(
Scopes::Culture,
"culture_secession_progress",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
),
(Scopes::PowerBloc, "current_cohesion_number", CompareValue),
(Scopes::PowerBloc, "current_cohesion_percentage", CompareValue),
(Scopes::BattleSide, "current_manpower", CompareValue),
(Scopes::None, "current_tooltip_depth", CompareValue),
(Scopes::None, "custom_description", Control),
(Scopes::None, "custom_tooltip", Special),
(Scopes::None, "day_value", CompareValue),
(Scopes::None, "daynight_value", CompareValue),
(Scopes::None, "debug_log", UncheckedValue),
(Scopes::None, "debug_log_details", Boolean),
(Scopes::Pop, "dependents", CompareValue),
(Scopes::State, "devastation", CompareValue),
(Scopes::DiplomaticPlay, "diplomatic_play_pm_usage", Removed("1.6", "")),
(Scopes::Country, "discriminates_religion", ScopeOrItem(Scopes::Religion, Item::Religion)),
(Scopes::Building, "earnings", CompareValue),
(
Scopes::Country,
"economic_dependence",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
),
(Scopes::Party, "election_momentum", CompareValue),
(Scopes::Country, "empty_agitator_slots", CompareValue),
(Scopes::Country, "enacting_any_law", Boolean),
(Scopes::Country, "enactment_chance", CompareValue),
(
Scopes::Country,
"enactment_chance_for_law",
Block(&[("target", Scope(Scopes::LawType)), ("value", CompareValue)]),
),
(
Scopes::Country,
"enactment_chance_for_law_without_enactment_modifier",
Block(&[("target", Scope(Scopes::LawType)), ("value", CompareValue)]),
),
(Scopes::Country, "enactment_chance_without_enactment_modifier", CompareValue),
(Scopes::Country, "enactment_phase", CompareValue),
(Scopes::Country, "enactment_setback_count", CompareValue),
(
Scopes::Country,
"enemy_contested_wargoals",
Block(&[("target", Scope(Scopes::War)), ("value", CompareValue)]),
),
(Scopes::Country, "enemy_occupation", CompareValue),
(Scopes::None, "error_check", Special),
(Scopes::DiplomaticPlay, "escalation", CompareValue),
(Scopes::None, "exists", Special),
(
Scopes::Country,
"expanding_institution",
ScopeOrItem(Scopes::InstitutionType, Item::Institution),
),
(Scopes::Character, "experience_level", CompareValue),
(Scopes::Country, "flotilla_manpower", Removed("1.6", "")),
(Scopes::Pop, "food_security", CompareValue),
(
Scopes::MilitaryFormation,
"formation_army_unit_type_fraction",
Block(&[("target", Scope(Scopes::CombatUnitType)), ("value", CompareValue)]),
),
(
Scopes::MilitaryFormation,
"formation_navy_unit_type_fraction",
Block(&[("target", Scope(Scopes::CombatUnitType)), ("value", CompareValue)]),
),
(
Scopes::Building,
"fraction_of_levels_owned_by_country",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
),
(Scopes::State, "free_arable_land", CompareValue),
(Scopes::PowerBloc, "free_principle_slots", CompareValue),
(Scopes::Front, "front_side_pm_usage", Removed("1.6", "")),
(Scopes::None, "game_date", CompareDate),
(
Scopes::Country,
"gdp_ownership_ratio",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
),
(Scopes::Country, "gdp_per_capita_ranking", CompareValue),
(
Scopes::Country,
"goods_production_rank",
Block(&[("target", Scope(Scopes::Goods)), ("value", CompareValue)]),
),
(Scopes::Country, "global_country_ranking", CompareValue),
(Scopes::None, "global_population", CompareValue),
(
Scopes::None,
"global_variable_list_size",
Block(&[("name", UncheckedValue), ("value", CompareValue)]),
),
(Scopes::Country, "gold_reserves", CompareValue),
(Scopes::Country, "gold_reserves_limit", CompareValue),
(Scopes::Country, "government_legitimacy", CompareValue),
(Scopes::Country, "government_transfer_of_power", Item(Item::TransferOfPower)),
(Scopes::Country, "government_wage_level", CompareChoice(LEVELS)),
(Scopes::Country, "government_wage_level_value", CompareValue),
(
Scopes::HarvestCondition,
"harvest_condition_intensity",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
),
(Scopes::Market.union(Scopes::State), "has_active_building", Item(Item::BuildingType)),
(Scopes::Country, "has_active_peace_deal", Boolean),
(Scopes::Building, "has_active_production_method", Item(Item::ProductionMethod)),
(Scopes::Country, "has_any_secessionists_broken_out", Boolean),
(Scopes::Country, "has_any_secessionists_growing", Boolean),
(Scopes::Country, "has_any_secessionists_possible", Removed("1.8", "")),
(Scopes::State, "has_assimilating_pops", Boolean),
(
Scopes::Country,
"has_attitude",
Block(&[("who", Scope(Scopes::Country)), ("attitude", Item(Item::Attitude))]),
),
(Scopes::BattleSide, "has_battle_condition", Item(Item::BattleCondition)),
(
Scopes::Country.union(Scopes::Market).union(Scopes::State).union(Scopes::StateRegion),
"has_building",
Item(Item::BuildingType),
),
(Scopes::PoliticalMovement, "has_character_ideology", Item(Item::Ideology)),
(Scopes::Country, "has_civil_war_from_movement_type", Scope(Scopes::PoliticalMovementType)),
(
Scopes::Country,
"has_claim",
Scope(Scopes::State.union(Scopes::StateRegion).union(Scopes::Country)),
),
(Scopes::State, "has_claim_by", Scope(Scopes::Country)),
(
Scopes::Character,
"has_commander_order",
ScopeOrItem(Scopes::CommanderOrderType, Item::CommanderOrder),
),
(Scopes::Country, "has_company", Scope(Scopes::CompanyType)),
(Scopes::Country, "has_completed_subgoal", Item(Item::ObjectiveSubgoal)),
(Scopes::Country, "has_consumption_tax", Scope(Scopes::Goods)),
(Scopes::State, "has_converting_pops", Boolean),
(Scopes::Country, "has_convoys_being_sunk", Boolean),
(Scopes::PoliticalMovement, "has_core_ideology", Boolean),
(Scopes::None, "has_cosmetic_dlc", UncheckedValue),
(Scopes::State, "has_cultural_community", Scope(Scopes::Culture)),
(Scopes::Culture, "has_cultural_obsession", Item(Item::Goods)),
(Scopes::Character, "has_culture", Scope(Scopes::Character.union(Scopes::Culture))),
(Scopes::Culture, "has_culture_graphics", Item(Item::CultureGraphics)),
(Scopes::Country, "has_decreasing_interests", Boolean),
(Scopes::State, "has_decree", Item(Item::Decree)),
(Scopes::Building, "has_deployed_units", Boolean),
(
Scopes::Country,
"has_diplomatic_pact",
Block(&[
("who", Scope(Scopes::Country)),
("type", Item(Item::DiplomaticAction)),
("?is_initiator", Boolean),
]),
),
(Scopes::StrategicRegion, "has_diplomatic_play", Boolean),
(Scopes::Country, "has_diplomatic_relevance", Scope(Scopes::Country)),
(Scopes::Country, "has_diplomats_expelled", Scope(Scopes::Country)),
(
Scopes::Culture.union(Scopes::Religion),
"has_discrimination_trait",
Item(Item::DiscriminationTrait),
),
(Scopes::None, "has_dlc_feature", Item(Item::DlcFeature)),
(
Scopes::Building,
"has_employee_slots_filled",
Block(&[("pop_type", Item(Item::PopType)), ("percent", CompareValue)]),
),
(Scopes::Country, "has_export_priority_tariffs", ScopeOrItem(Scopes::Goods, Item::Goods)),
(Scopes::Building, "has_failed_hires", Boolean),
(Scopes::Country.union(Scopes::State), "has_famine", Boolean),
(Scopes::Country, "has_free_government_reform", Boolean),
(Scopes::None, "has_game_rule", Item(Item::GameRuleSetting)),
(Scopes::None, "has_game_started", Boolean),
(Scopes::None, "has_gameplay_dlc", UncheckedValue),
(Scopes::Country, "has_global_highest_gdp", Boolean),
(Scopes::Country, "has_global_highest_innovation", Boolean),
(Scopes::None, "has_global_variable", UncheckedValue),
(Scopes::None, "has_global_variable_list", UncheckedValue),
(Scopes::Country, "has_government_clout", CompareValue),
(Scopes::Country, "has_government_type", Item(Item::GovernmentType)),
(Scopes::StateRegion, "has_harvest_condition", Item(Item::HarvestConditionType)),
(Scopes::Country, "has_healthy_economy", Boolean),
(Scopes::MilitaryFormation, "has_high_attrition", Boolean),
(Scopes::Culture, "has_homeland", Scope(Scopes::State.union(Scopes::StateRegion))),
(Scopes::PowerBloc, "has_identity", Scope(Scopes::PowerBlocIdentity)),
(
Scopes::Character.union(Scopes::InterestGroup).union(Scopes::PoliticalMovement),
"has_ideology",
ScopeOrItem(Scopes::Ideology, Item::Ideology),
),
(Scopes::Country, "has_import_priority_tariffs", ScopeOrItem(Scopes::Goods, Item::Goods)),
(Scopes::Country, "has_inactive_journal_entry", Item(Item::JournalEntry)),
(Scopes::Country, "has_institution", ScopeOrItem(Scopes::InstitutionType, Item::Institution)),
(Scopes::Country, "has_insurrectionary_interest_groups", Boolean),
(
Scopes::Country,
"has_interest_marker_in_region",
ScopeOrItem(Scopes::StrategicRegion, Item::StrategicRegion),
),
(Scopes::Country, "has_journal_entry", Item(Item::JournalEntry)),
(Scopes::Province, "has_label", Item(Item::TerrainLabel)),
(Scopes::Country, "has_law", Scope(Scopes::LawType)),
(
Scopes::Country,
"has_law_imposition_rights",
Block(&[("target_country", Scope(Scopes::Country)), ("law_type", Scope(Scopes::LawType))]),
),
(Scopes::None, "has_local_variable", UncheckedValue),
(Scopes::None, "has_local_variable_list", UncheckedValue),
(Scopes::None, "has_map_interaction", UncheckedValue), (Scopes::None, "has_map_interaction_diplomatic_action", UncheckedValue), (Scopes::None, "has_map_interaction_export_goods", UncheckedValue), (Scopes::None, "has_map_interaction_import_goods", UncheckedValue), (Scopes::Character, "has_military_formation", Boolean),
(Scopes::MilitaryFormation, "has_mobilization_option", Scope(Scopes::MobilizationOption)),
(Scopes::State, "has_mobilizing_unit", Boolean),
(
Scopes::Country
.union(Scopes::Building)
.union(Scopes::Character)
.union(Scopes::Institution)
.union(Scopes::InterestGroup)
.union(Scopes::JournalEntry)
.union(Scopes::PoliticalMovement)
.union(Scopes::PowerBloc)
.union(Scopes::State),
"has_modifier",
Item(Item::Modifier),
),
(Scopes::Country, "has_no_priority_tariffs", ScopeOrItem(Scopes::Goods, Item::Goods)),
(Scopes::Country, "has_objective", Item(Item::Objective)),
(Scopes::Pop, "has_ongoing_assimilation", Boolean),
(Scopes::Pop, "has_ongoing_conversion", Boolean),
(Scopes::Country, "has_overlapping_interests", Scope(Scopes::Country)),
(Scopes::InterestGroup, "has_party", Boolean),
(Scopes::Party, "has_party_member", Scope(Scopes::InterestGroup)),
(Scopes::DiplomaticPlay, "has_play_goal", Item(Item::Wargoal)),
(Scopes::Country, "has_political_movement", Removed("1.8", "")),
(Scopes::Pop, "has_pop_culture", Item(Item::Culture)),
(Scopes::Pop, "has_pop_religion", Item(Item::Religion)),
(Scopes::Country.union(Scopes::Market).union(Scopes::State), "has_port", Boolean),
(Scopes::Country, "has_possible_decisions", Boolean),
(Scopes::State, "has_potential_resource", Item(Item::BuildingGroup)),
(Scopes::Country, "has_potential_to_form_country", UncheckedValue), (Scopes::Country, "has_power_struggle", Boolean),
(Scopes::PowerBloc, "has_principle", Scope(Scopes::PowerBlocPrinciple)),
(Scopes::PowerBloc, "has_principle_group", Scope(Scopes::PowerBlocPrincipleGroup)),
(Scopes::None, "has_reached_end_date", Boolean),
(Scopes::Character, "has_religion", Scope(Scopes::Religion)),
(Scopes::Religion, "has_religious_taboo", Item(Item::Goods)),
(Scopes::Country, "has_researchable_technology", Boolean),
(Scopes::Country, "has_revolution", Boolean),
(Scopes::Country, "has_revolution_over_law_type", Removed("1.8", "")),
(Scopes::Character, "has_role", Item(Item::CharacterRole)),
(Scopes::Country, "has_ruling_interest_group", Item(Item::InterestGroup)),
(Scopes::Country, "has_ruling_interest_group_count", CompareValue),
(
Scopes::Country,
"has_secret_goal",
Block(&[("who", Scope(Scopes::Country)), ("secret_goal", Item(Item::SecretGoal))]),
),
(Scopes::Pop, "has_social_class", Item(Item::SocialClass)),
(Scopes::Country, "has_social_hierarchy", Item(Item::SocialHierarchy)),
(Scopes::Country, "has_state_in_state_region", Item(Item::StateRegion)),
(Scopes::Pop, "has_state_religion", Boolean),
(Scopes::State, "has_state_trait", Item(Item::StateTrait)),
(Scopes::Country, "has_strategic_adjacency", Scope(Scopes::State.union(Scopes::Country))),
(Scopes::Country, "has_strategic_land_adjacency", Scope(Scopes::State.union(Scopes::Country))),
(Scopes::Country, "has_strategy", Item(Item::AiStrategy)),
(Scopes::Country, "has_subject_relation_with", Scope(Scopes::Country)),
(Scopes::Country, "has_sufficient_construction_capacity_for_investment", Boolean),
(
Scopes::Country,
"has_technology_progress",
Block(&[("technology", UncheckedValue), ("progress", CompareValue)]),
),
(
Scopes::Country,
"has_technology_researched",
ScopeOrItem(Scopes::Technology, Item::Technology),
),
(Scopes::Character, "has_template", Item(Item::CharacterTemplate)),
(Scopes::Province, "has_terrain", Item(Item::Terrain)),
(Scopes::Character, "has_trait", Item(Item::CharacterTrait)),
(Scopes::Country, "has_treaty_port_in_country", Scope(Scopes::Country)),
(Scopes::Country, "has_truce_with", Scope(Scopes::Country)),
(Scopes::None, "has_unification_candidate", UncheckedValue), (Scopes::NewCombatUnit, "has_unit_type", Scope(Scopes::CombatUnitType)),
(Scopes::None, "has_variable", UncheckedValue),
(Scopes::None, "has_variable_list", UncheckedValue),
(
Scopes::War,
"has_war_exhaustion",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
),
(Scopes::War, "has_war_goal", Item(Item::Wargoal)),
(
Scopes::War,
"has_war_support",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
),
(Scopes::Country, "has_war_with", Scope(Scopes::Country)),
(Scopes::Country, "has_wasted_construction", Boolean),
(Scopes::None, "hidden_trigger", Control),
(Scopes::Country, "highest_secession_progress", CompareValue),
(Scopes::InterestGroup, "ig_approval", CompareChoiceOrNumber(APPROVALS)),
(Scopes::InterestGroup, "ig_clout", CompareValue),
(Scopes::InterestGroup, "ig_government_power_share", CompareValue),
(
Scopes::State,
"ig_state_pol_strength_share",
Block(&[("target", Scope(Scopes::InterestGroup)), ("value", CompareValue)]),
),
(Scopes::Country, "in_default", Boolean),
(Scopes::Country, "in_election_campaign", Boolean),
(Scopes::DiplomaticPact, "income_transfer", CompareValue),
(Scopes::State, "incorporation_progress", CompareValue),
(Scopes::Country, "influence", CompareValue),
(Scopes::State.union(Scopes::StateRegion), "infrastructure", CompareValue),
(Scopes::State.union(Scopes::StateRegion), "infrastructure_usage", CompareValue),
(Scopes::DiplomaticPlay, "initiator_is", Scope(Scopes::Country)),
(
Scopes::Country,
"institution_investment_level",
Block(&[("institution", Item(Item::Institution)), ("value", CompareValue)]),
),
(Scopes::InterestGroup, "interest_group_population", CompareValue),
(Scopes::InterestGroup, "interest_group_population_percentage", CompareValue),
(Scopes::InterestGroup, "interest_group_supports_political_movement", Boolean),
(Scopes::Country, "investment_pool", CompareValue),
(Scopes::Country, "investment_pool_gross_income", CompareValue),
(Scopes::Country, "investment_pool_net_income", CompareValue),
(Scopes::NavalInvasion, "is_active", Boolean),
(
Scopes::Country,
"is_adjacent",
Removed("removed in 1.5", "replaced with is_adjacent_to_country and is_adjacent_to_state"),
),
(Scopes::Country, "is_adjacent_to_country", Scope(Scopes::Country)),
(Scopes::Country, "is_adjacent_to_state", Scope(Scopes::State)),
(Scopes::Character, "is_advancing_on_front", Scope(Scopes::Front)),
(Scopes::Country, "is_ai", Boolean),
(Scopes::MilitaryFormation, "is_army", Boolean),
(Scopes::Country, "is_at_war", Boolean),
(Scopes::Character, "is_attacker_in_battle", Boolean),
(Scopes::Country, "is_banning_goods", ScopeOrItem(Scopes::Goods, Item::Goods)),
(Scopes::InterestGroup, "is_being_bolstered", Boolean),
(Scopes::InterestGroup, "is_being_suppressed", Boolean),
(Scopes::Building, "is_buildable", Boolean),
(Scopes::Building, "is_building_group", Item(Item::BuildingGroup)),
(Scopes::Building, "is_building_type", Item(Item::BuildingType)),
(
Scopes::None,
"is_building_type_expanded",
ScopeOrItem(Scopes::BuildingType, Item::BuildingType),
),
(Scopes::Character, "is_busy", Boolean),
(Scopes::State, "is_capital", Boolean),
(Scopes::Character, "is_character_alive", Boolean),
(Scopes::CivilWar, "is_civil_war_type", Choice(&["revolution", "secession"])),
(Scopes::State, "is_coastal", Boolean),
(Scopes::Country, "is_considered_adjacent_due_to_wargoals", Scope(Scopes::Country)),
(Scopes::Country, "is_construction_paused", Boolean),
(Scopes::MarketGoods, "is_consumed_by_government_buildings", Boolean),
(Scopes::MarketGoods, "is_consumed_by_military_buildings", Boolean),
(Scopes::Country, "is_country_alive", Boolean),
(Scopes::Country, "is_country_type", Item(Item::CountryType)),
(Scopes::Character, "is_defender_in_battle", Boolean),
(Scopes::DiplomaticPact, "is_diplomatic_action_type", Item(Item::DiplomaticAction)),
(Scopes::DiplomaticCatalyst, "is_diplomatic_catalyst_type", Item(Item::DiplomaticCatalyst)),
(Scopes::DiplomaticPact, "is_diplomatic_pact_in_danger", Boolean),
(Scopes::Country, "is_diplomatic_play_ally_of", Scope(Scopes::Country)),
(Scopes::Country, "is_diplomatic_play_committed_participant", Boolean),
(Scopes::Country, "is_diplomatic_play_enemy_of", Scope(Scopes::Country)),
(Scopes::Country, "is_diplomatic_play_initiator", Boolean),
(Scopes::Country, "is_diplomatic_play_involved_with", Scope(Scopes::Country)),
(Scopes::Country, "is_diplomatic_play_participant_with", Scope(Scopes::Country)),
(Scopes::Country, "is_diplomatic_play_target", Boolean),
(Scopes::DiplomaticPlay, "is_diplomatic_play_type", Item(Item::DiplomaticPlay)),
(Scopes::Country, "is_diplomatic_play_undecided_participant", Boolean),
(Scopes::Country, "is_direct_subject_of", Scope(Scopes::Country)),
(Scopes::Pop, "is_employed", Boolean),
(Scopes::Country, "is_enacting_law", Scope(Scopes::LawType)),
(Scopes::Country, "is_expanding_institution", Boolean),
(Scopes::Character, "is_female", Boolean),
(Scopes::MilitaryFormation, "is_fleet", Boolean),
(Scopes::DiplomaticPact, "is_forced_pact", Boolean),
(Scopes::Country, "is_forced_to_join_plays", Scope(Scopes::Country)),
(Scopes::MilitaryFormation, "is_fully_mobilized", Boolean),
(Scopes::None, "is_game_paused", Boolean),
(Scopes::None, "is_gamestate_tutorial_active", Boolean),
(Scopes::JournalEntry, "is_goal_complete", Boolean),
(Scopes::Building, "is_government_funded", Boolean),
(Scopes::Character, "is_heir", Boolean),
(Scopes::Character, "is_historical", Boolean),
(Scopes::Country, "is_home_country_for", Scope(Scopes::Country)),
(Scopes::StateRegion, "is_homeland", ScopeOrItem(Scopes::Culture, Item::Culture)),
(Scopes::State, "is_homeland_of_country_cultures", Scope(Scopes::Country)),
(Scopes::Character, "is_immortal", Boolean),
(Scopes::Country, "is_immune_to_revolutions", Boolean),
(Scopes::Character, "is_in_battle", Boolean),
(Scopes::Country, "is_in_customs_union", Boolean),
(Scopes::Country, "is_in_customs_union_with", Scope(Scopes::Country)),
(Scopes::Character, "is_in_exile_pool", Boolean),
(Scopes::InterestGroup, "is_in_government", Boolean),
(Scopes::None, "is_in_list", Special),
(Scopes::Pop, "is_in_mild_starvation", Boolean),
(Scopes::Country, "is_in_power_bloc", Boolean),
(Scopes::State, "is_in_revolt", Boolean),
(Scopes::Country, "is_in_same_power_bloc", Scope(Scopes::Country)),
(Scopes::Pop, "is_in_severe_starvation", Boolean),
(Scopes::Pop, "is_in_starvation", Boolean),
(Scopes::Character, "is_in_void", Boolean),
(Scopes::Country, "is_in_war_together", Scope(Scopes::Country)),
(Scopes::State, "is_incorporated", Boolean),
(Scopes::Country, "is_indirect_subject_of", Scope(Scopes::Country)),
(
Scopes::Country.union(Scopes::InterestGroup).union(Scopes::PoliticalMovement),
"is_insurrectionary",
Boolean,
),
(Scopes::InterestMarker, "is_interest_active", Boolean),
(
Scopes::Character.union(Scopes::InterestGroup),
"is_interest_group_type",
Item(Item::InterestGroup),
),
(Scopes::State, "is_isolated_from_market", Boolean),
(Scopes::Country, "is_junior_in_customs_union", Boolean),
(Scopes::Theater, "is_land_theater", Boolean),
(Scopes::State, "is_largest_state_in_region", Boolean),
(
Scopes::None,
"is_lens_open",
Block(&[("lens", UncheckedValue), ("?tab_name", UncheckedValue)]),
),
(Scopes::Country, "is_local_player", Boolean),
(Scopes::Country, "is_losing_power_rank", Boolean),
(Scopes::InterestGroup, "is_marginal", Boolean),
(Scopes::Country, "is_market_reachable_for_trade", Scope(Scopes::Market)),
(Scopes::Country, "is_mass_migration_origin", Boolean),
(Scopes::Country, "is_mass_migration_origin_of_culture", Scope(Scopes::Culture)),
(Scopes::State, "is_mass_migration_target", Boolean),
(Scopes::State, "is_mass_migration_target_for_culture", Scope(Scopes::Culture)),
(Scopes::InterestGroup, "is_member_of_any_lobby", Boolean),
(Scopes::InterestGroup, "is_member_of_lobby", Scope(Scopes::PoliticalLobbyType)),
(Scopes::InterestGroup, "is_member_of_party", Scope(Scopes::Party)),
(Scopes::MilitaryFormation, "is_mobilized", Boolean),
(Scopes::Character, "is_monarch", Boolean),
(Scopes::NavalInvasion, "is_naval_invasion_stalled_due_to_orders", Boolean),
(Scopes::None, "is_objective_completed", Boolean),
(Scopes::Character.union(Scopes::MilitaryFormation), "is_on_front", Boolean),
(Scopes::Country, "is_owed_obligation_by", Scope(Scopes::Country)),
(
Scopes::None,
"is_panel_open",
Block(&[
("?target", UncheckedValue),
("?panel_name", UncheckedValue),
("?tab_name", UncheckedValue),
]),
),
(Scopes::Party, "is_party", Scope(Scopes::Party)),
(Scopes::Party, "is_party_type", Item(Item::Party)),
(Scopes::Country, "is_player", Boolean),
(Scopes::PoliticalLobby, "is_political_lobby_type", Item(Item::PoliticalLobby)),
(Scopes::PoliticalMovement, "is_political_movement_type", Item(Item::PoliticalMovement)),
(Scopes::Pop, "is_pop_type", Item(Item::PopType)),
(Scopes::None, "is_popup_open", UncheckedValue),
(Scopes::Country, "is_power_bloc_leader", Boolean),
(Scopes::InterestGroup, "is_powerful", Boolean),
(Scopes::Culture, "is_primary_culture_of", Scope(Scopes::Country)),
(
Scopes::State,
"is_production_method_active",
Block(&[
("building_type", Item(Item::BuildingType)),
("production_method", Item(Item::ProductionMethod)),
]),
),
(Scopes::JournalEntry, "is_progressing", Boolean),
(Scopes::Province, "is_province_land", Boolean),
(Scopes::Law, "is_reasonable_law_for_petition", Boolean),
(Scopes::Character, "is_repairing", Removed("1.6", "")),
(Scopes::Country, "is_researching_technology", Special), (Scopes::Country, "is_researching_technology_category", UncheckedValue), (
Scopes::Country.union(Scopes::InterestGroup).union(Scopes::PoliticalMovement),
"is_revolutionary",
Boolean,
),
(
Scopes::PoliticalMovement,
"is_revolutionary_movement",
Removed("1.8", "replaced with is_revolutionary"),
),
(Scopes::None, "is_rightclick_menu_open", UncheckedValue),
(Scopes::Character, "is_ruler", Boolean),
(Scopes::InterestGroup, "is_same_interest_group_type", Scope(Scopes::InterestGroup)),
(Scopes::LawType, "is_same_law_group_as", Scope(Scopes::LawType)),
(Scopes::Party, "is_same_party_type", Scope(Scopes::Party)),
(Scopes::State, "is_sea_adjacent", Boolean),
(
Scopes::Country.union(Scopes::InterestGroup).union(Scopes::PoliticalMovement),
"is_secessionist",
Boolean,
),
(Scopes::None, "is_set", Special),
(Scopes::State, "is_slave_state", Boolean),
(Scopes::State, "is_split_state", Boolean),
(Scopes::StateRegion, "is_state_region_land", Boolean),
(Scopes::Religion, "is_state_religion", Scope(Scopes::Country)),
(Scopes::State, "is_strategic_objective", Scope(Scopes::Country)),
(Scopes::InterestGroup, "is_strongest_ig_in_government", Boolean),
(Scopes::Country, "is_subject", Boolean),
(Scopes::Country, "is_subject_of", Scope(Scopes::Country)),
(Scopes::Country, "is_subject_type", Item(Item::SubjectType)),
(Scopes::Building, "is_subsidized", Boolean),
(Scopes::Building, "is_subsistence_building", Boolean),
(
Scopes::Country,
"is_supporting_unification_candidate",
Block(&[
("who", Scope(Scopes::Country)),
("country_formation", Item(Item::CountryFormation)),
]),
),
(
Scopes::None,
"is_target_in_global_variable_list",
Block(&[("name", UncheckedValue), ("*target", ScopeOkThis(Scopes::all_but_none()))]),
),
(
Scopes::None,
"is_target_in_local_variable_list",
Block(&[("name", UncheckedValue), ("*target", ScopeOkThis(Scopes::all_but_none()))]),
),
(
Scopes::None,
"is_target_in_variable_list",
Block(&[("name", UncheckedValue), ("*target", ScopeOkThis(Scopes::all_but_none()))]),
),
(Scopes::State, "is_target_of_wargoal", Scope(Scopes::Country)),
(Scopes::Country, "is_taxing_goods", ScopeOrItem(Scopes::Goods, Item::Goods)),
(Scopes::None, "is_template_used", Item(Item::CharacterTemplate)),
(Scopes::TradeRoute, "is_trade_route_active", Boolean),
(Scopes::TradeRoute, "is_trade_route_productive", Boolean),
(Scopes::Goods.union(Scopes::MarketGoods), "is_tradeable", Boolean),
(Scopes::Character, "is_traveling", Removed("1.6", "")),
(Scopes::State, "is_treaty_port", Boolean),
(Scopes::None, "is_tutorial_active", Boolean),
(Scopes::None, "is_tutorial_lesson_active", Item(Item::TutorialLesson)),
(Scopes::None, "is_tutorial_lesson_chain_completed", UncheckedValue), (Scopes::None, "is_tutorial_lesson_completed", Item(Item::TutorialLesson)),
(Scopes::None, "is_tutorial_lesson_step_completed", UncheckedValue), (Scopes::State, "is_under_colonization", Boolean),
(Scopes::Building, "is_under_construction", Boolean),
(Scopes::Country, "is_unification_candidate", Item(Item::CountryFormation)),
(Scopes::Country, "is_violating_sovereignty_of", Scope(Scopes::Country)),
(Scopes::Front, "is_vulnerable_front", Scope(Scopes::Country)),
(Scopes::DiplomaticPlay, "is_war", Boolean),
(Scopes::War, "is_war_participant", Scope(Scopes::Country)),
(Scopes::War, "is_warleader", Scope(Scopes::Country)),
(Scopes::Country, "isolated_states", CompareValue),
(Scopes::JournalEntry, "journal_entry_age", CompareValue),
(Scopes::Law, "law_approved_by", Scope(Scopes::InterestGroup)),
(
Scopes::Character.union(Scopes::InterestGroup).union(Scopes::PoliticalMovement),
"law_enactment_stance",
Block(&[("law", Scope(Scopes::LawType)), ("value", CompareChoice(STANCES))]),
),
(
Scopes::LawType,
"law_progressiveness_difference",
Block(&[("target_law", Scope(Scopes::LawType)), ("value", CompareValue)]), ),
(
Scopes::Character.union(Scopes::InterestGroup).union(Scopes::PoliticalMovement),
"law_stance",
Block(&[("law", Scope(Scopes::LawType)), ("value", CompareChoice(STANCES))]),
),
(Scopes::Country, "leading_producer_of", Scope(Scopes::Goods)),
(Scopes::Country, "leads_customs_union", Boolean),
(
Scopes::Building,
"levels_owned_by_country",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
),
(
Scopes::PowerBloc,
"leverage_advantage",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
),
(Scopes::Country, "liberty_desire", CompareValue),
(Scopes::Country, "liberty_desire_weekly_progress", CompareValue),
(Scopes::None, "list_size", Block(&[("name", UncheckedValue), ("value", CompareValue)])),
(Scopes::Country.union(Scopes::Pop).union(Scopes::State), "literacy_rate", CompareValue),
(Scopes::PoliticalLobby, "lobby_clout", CompareValue),
(
Scopes::DiplomaticCatalyst.union(Scopes::PoliticalLobby),
"lobby_formation_reason",
Choice(LOBBY_FORMATION_REASON),
),
(
Scopes::None,
"local_variable_list_size",
Block(&[("name", UncheckedValue), ("value", CompareValue)]),
),
(
Scopes::Country.union(Scopes::State),
"loyalist_fraction",
Block(&[
("value", CompareValue),
("?pop_type", Item(Item::PopType)),
("?strata", Item(Item::Strata)),
("?culture", ScopeOrItem(Scopes::Culture, Item::Culture)),
("?religion", ScopeOrItem(Scopes::Religion, Item::Religion)),
]),
),
(Scopes::State, "loyalty", CompareValue),
(Scopes::State, "market_access", CompareValue),
(Scopes::MarketGoods, "market_goods_buy_orders", CompareValue),
(Scopes::MarketGoods, "market_goods_cheaper", CompareValue),
(Scopes::MarketGoods, "market_goods_consumption", CompareValue),
(Scopes::MarketGoods, "market_goods_delta", CompareValue),
(Scopes::MarketGoods, "market_goods_exports", CompareValue),
(Scopes::MarketGoods, "market_goods_has_goods_shortage", Boolean),
(Scopes::MarketGoods, "market_goods_imports", CompareValue),
(Scopes::MarketGoods, "market_goods_pricier", CompareValue),
(Scopes::MarketGoods, "market_goods_production", CompareValue),
(Scopes::MarketGoods, "market_goods_sell_orders", CompareValue),
(Scopes::MarketGoods, "market_goods_shortage_ratio", CompareValue),
(Scopes::Market, "market_has_goods_shortage", Boolean),
(Scopes::Market, "market_number_goods_shortages", CompareValue),
(
Scopes::Market,
"market_number_goods_shortages_with",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), ),
(
Scopes::Market,
"market_number_goods_shortages_without",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), ),
(Scopes::Country, "max_law_enactment_setbacks", CompareValue),
(Scopes::MilitaryFormation, "max_organization", CompareValue),
(Scopes::Country, "max_num_companies", CompareValue),
(Scopes::Country, "max_num_declared_interests", CompareValue),
(Scopes::Country, "military_wage_level", CompareChoice(LEVELS)),
(Scopes::Country, "military_wage_level_value", CompareValue),
(Scopes::Character, "mobilization_cost", Removed("1.5", "")),
(Scopes::None, "month", CompareValue), (Scopes::InterestGroup, "most_powerful_strata", Item(Item::Strata)),
(Scopes::State, "most_prominent_revolting_interest_group", Item(Item::InterestGroup)),
(Scopes::None, "nand", Control),
(
Scopes::Country,
"nationalization_cost",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
),
(Scopes::Country, "naval_power_projection", CompareValue),
(Scopes::Country, "navy_reserves", Removed("1.6", "")),
(Scopes::Country, "neighbors_any_power_bloc", Boolean),
(Scopes::Country, "neighbors_member_of_same_power_bloc", Boolean),
(Scopes::Country, "neighbors_power_bloc", Scope(Scopes::PowerBloc)),
(Scopes::None, "night_value", CompareValue),
(Scopes::None, "nor", Control),
(Scopes::None, "not", Control),
(Scopes::War, "num_casualties", CompareValue),
(Scopes::Country, "num_companies", CompareValue),
(
Scopes::War,
"num_country_casualties",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
),
(
Scopes::War,
"num_country_dead",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
),
(
Scopes::War,
"num_country_wounded",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
),
(Scopes::State, "num_cultural_communities", CompareValue),
(Scopes::War, "num_dead", CompareValue),
(Scopes::Country, "num_declared_interests", CompareValue),
(Scopes::Front, "num_defending_battalions(", CompareValue),
(
Scopes::Country,
"num_diplomatic_pacts",
Block(&[("type", Item(Item::DiplomaticAction)), ("value", CompareValue)]),
),
(Scopes::Front, "num_enemy_units(", CompareValue),
(
Scopes::Country,
"num_investments_of_type",
Block(&[("type", Item(Item::BuildingType)), ("value", CompareValue)]),
),
(Scopes::Theater, "num_mobilized_units_in_theater", CompareValue),
(Scopes::Country, "num_mutual_trade_route_levels_with_country(", CompareValue),
(Scopes::Country.union(Scopes::InterestGroup), "num_political_lobbies", CompareValue),
(Scopes::PowerBloc, "num_power_bloc_members", CompareValue),
(Scopes::PowerBloc, "num_power_bloc_states", CompareValue),
(Scopes::Theater, "num_provinces_in_theater", CompareValue),
(Scopes::Country, "num_subjects", CompareValue),
(Scopes::Country, "num_taxed_goods", CompareValue),
(Scopes::War, "num_wounded", CompareValue),
(Scopes::Country, "number_of_claims", CompareValue),
(Scopes::Country, "number_of_possible_decisions", CompareValue),
(Scopes::Building, "occupancy", CompareValue),
(Scopes::None, "or", Control),
(Scopes::MilitaryFormation, "organization", CompareValue),
(Scopes::Country, "overlord_can_decrease_subject_autonomy", Boolean),
(Scopes::Country, "owes_obligation_to", Scope(Scopes::Country)),
(
Scopes::Country,
"owns_entire_state_region",
ScopeOrItem(Scopes::StateRegion, Item::StateRegion),
),
(Scopes::Country, "owns_treaty_port_in", ScopeOrItem(Scopes::StateRegion, Item::StateRegion)),
(
Scopes::Country,
"play_participant_has_war_goal_of_type_against",
Block(&[("type", Item(Item::Wargoal)), ("target", Scope(Scopes::Country))]),
),
(
Scopes::Country,
"play_side_has_war_goal_of_type_against",
Block(&[("type", Item(Item::Wargoal)), ("target", Scope(Scopes::Country))]),
),
(Scopes::PoliticalMovement, "political_movement_identity_support", CompareValue),
(Scopes::PoliticalMovement, "political_movement_military_support", CompareValue),
(Scopes::PoliticalMovement, "political_movement_popular_support", CompareValue),
(Scopes::PoliticalMovement, "political_movement_radicalism", CompareValue),
(Scopes::PoliticalMovement, "political_movement_support", CompareValue),
(Scopes::PoliticalMovement, "political_movement_wealth_support", CompareValue),
(Scopes::Country, "politically_involved_ratio", CompareValue),
(Scopes::StateRegion, "pollution_amount", CompareValue),
(Scopes::State, "pollution_generation", CompareValue),
(Scopes::Pop, "pop_acceptance", CompareValue),
(Scopes::Pop, "pop_employment_building", Item(Item::BuildingType)),
(Scopes::Pop, "pop_employment_building_group", Item(Item::BuildingGroup)),
(Scopes::Pop, "pop_has_primary_culture", Boolean),
(Scopes::Pop, "pop_is_discriminated", Removed("1.8", "replaced with pop_acceptance")),
(Scopes::Pop, "pop_loyalist_fraction", CompareValue),
(Scopes::Pop, "pop_neutral_fraction", CompareValue),
(Scopes::Pop, "pop_radical_fraction", CompareValue),
(
Scopes::Country,
"pop_type_percent_country",
Block(&[("pop_type", UncheckedValue), ("percent", CompareValue)]),
),
(
Scopes::State,
"pop_type_percent_state",
Block(&[("target", Scope(Scopes::PopType)), ("value", CompareValue)]),
),
(
Scopes::State,
"population_by_culture",
Block(&[("target", Scope(Scopes::Culture)), ("value", CompareValue)]),
),
(
Scopes::Country,
"potential_diplomatic_play_power_ratio",
Block(&[
("?type", Item(Item::DiplomaticPlay)),
("target", Scope(Scopes::Country)),
("?state", Scope(Scopes::State)),
("value", CompareValue),
]),
),
(Scopes::PowerBloc, "power_bloc_rank", CompareValue),
(Scopes::Country, "power_bloc_share_gdp", CompareValue),
(
Scopes::Country,
"power_bloc_share_gdp_with",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), ),
(
Scopes::Country,
"power_bloc_share_gdp_without",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), ),
(Scopes::Country, "power_bloc_share_power_projection", CompareValue),
(
Scopes::Country,
"power_bloc_share_power_projection_with",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), ),
(
Scopes::Country,
"power_bloc_share_power_projection_without",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), ),
(Scopes::Country, "power_bloc_share_prestige", CompareValue),
(
Scopes::Country,
"power_bloc_share_prestige_with",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), ),
(
Scopes::Country,
"power_bloc_share_prestige_without",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), ),
(Scopes::PowerBloc, "power_bloc_total_leading_goods_producers", CompareValue),
(
Scopes::PowerBloc,
"power_bloc_total_leading_goods_producers_with",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), ),
(
Scopes::PowerBloc,
"power_bloc_total_leading_goods_producers_without",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), ),
(Scopes::PowerBloc, "power_bloc_worst_economic_dependence", CompareValue),
(
Scopes::PowerBloc,
"power_bloc_worst_economic_dependence_with",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), ),
(
Scopes::PowerBloc,
"power_bloc_worst_economic_dependence_without",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), ),
(Scopes::PowerBloc, "power_bloc_worst_infamy", CompareValue),
(
Scopes::PowerBloc,
"power_bloc_worst_infamy_with",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), ),
(
Scopes::PowerBloc,
"power_bloc_worst_infamy_without",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), ),
(Scopes::PowerBloc, "power_bloc_worst_leader_relations", CompareValue),
(
Scopes::PowerBloc,
"power_bloc_worst_leader_relations_with",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), ),
(
Scopes::PowerBloc,
"power_bloc_worst_leader_relations_without",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), ),
(Scopes::PowerBloc, "power_bloc_worst_leader_religion_population_fraction", CompareValue),
(
Scopes::PowerBloc,
"power_bloc_worst_leader_religion_population_fraction_with",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), ),
(
Scopes::PowerBloc,
"power_bloc_worst_leader_religion_population_fraction_without",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), ),
(Scopes::PowerBloc, "power_bloc_worst_liberty_desire", CompareValue),
(
Scopes::PowerBloc,
"power_bloc_worst_liberty_desire_with",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), ),
(
Scopes::PowerBloc,
"power_bloc_worst_liberty_desire_without",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), ),
(
Scopes::PowerBloc,
"power_bloc_worst_progressiveness_difference_government_type",
CompareValue,
),
(
Scopes::PowerBloc,
"power_bloc_worst_progressiveness_difference_government_type_with",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), ),
(
Scopes::PowerBloc,
"power_bloc_worst_progressiveness_difference_government_type_without",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]), ),
(
Scopes::PowerBloc,
"predicted_cohesion_percentage_with",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
),
(
Scopes::InterestGroup,
"prefers_law",
Block(&[("law", Scope(Scopes::LawType)), ("comparison_law", Scope(Scopes::LawType))]),
),
(Scopes::Country, "prestige", CompareValue),
(Scopes::Country, "primary_cultures_percent_country", CompareValue),
(Scopes::State, "primary_cultures_percent_state", CompareValue),
(Scopes::Building, "private_ownership_fraction", CompareValue),
(Scopes::Country, "produced_authority", CompareValue),
(Scopes::Country, "produced_bureaucracy", CompareValue),
(Scopes::Country, "produced_influence", CompareValue),
(Scopes::LawType, "progressiveness", CompareValue),
(Scopes::Pop, "quality_of_life", CompareValue),
(
Scopes::Country.union(Scopes::State),
"radical_fraction",
Block(&[
("value", CompareValue),
("?pop_type", Item(Item::PopType)),
("?strata", Item(Item::Strata)),
("?culture", ScopeOrItem(Scopes::Culture, Item::Culture)),
("?religion", ScopeOrItem(Scopes::Religion, Item::Religion)),
]),
),
(Scopes::Country, "radical_population_fraction", CompareValue),
(Scopes::None, "real_month", CompareValue),
(Scopes::State, "relative_infrastructure", CompareValue),
(Scopes::Pop, "religion_accepted", Removed("1.8", "")),
(
Scopes::Country,
"religion_percent_country",
Block(&[("target", Scope(Scopes::Religion)), ("value", CompareValue)]),
),
(
Scopes::State,
"religion_percent_state",
Block(&[("target", Scope(Scopes::Religion)), ("value", CompareValue)]),
),
(
Scopes::StateRegion,
"remaining_undepleted",
Block(&[("type", Item(Item::BuildingGroup)), ("amount", CompareValue)]),
),
(Scopes::Country, "ruler_can_have_command", Boolean),
(Scopes::all_but_none(), "save_temporary_scope_as", Special),
(Scopes::None, "save_temporary_scope_value_as", Special),
(Scopes::Country, "scaled_debt", CompareValue),
(Scopes::Country, "scaled_gold_reserves", CompareValue),
(
Scopes::JournalEntry,
"scripted_bar_progress",
Block(&[("name", Item(Item::ScriptedProgressBar)), ("value", CompareValue)]),
),
(Scopes::Building, "self_ownership_fraction", CompareValue),
(
Scopes::Culture,
"shares_heritage_and_other_trait_with_any_primary_culture",
Scope(Scopes::Country),
),
(Scopes::Culture, "shares_heritage_trait_with_any_primary_culture", Scope(Scopes::Country)),
(Scopes::Religion, "shares_heritage_trait_with_state_religion", Scope(Scopes::Country)),
(Scopes::Culture, "shares_non_heritage_trait_with_any_primary_culture", Scope(Scopes::Country)),
(Scopes::Culture, "shares_trait_with_any_primary_culture", Scope(Scopes::Country)),
(Scopes::Religion, "shares_trait_with_state_religion", Scope(Scopes::Country)),
(Scopes::Country, "should_set_wargoal", Boolean),
(Scopes::None, "should_show_nudity", Boolean),
(Scopes::Country, "shrinking_institution", Item(Item::Institution)),
(
Scopes::Country,
"size_weighted_lost_battles_fraction",
Block(&[("target", Scope(Scopes::War)), ("value", CompareValue)]),
),
(Scopes::Country, "sol_ranking", CompareValue),
(Scopes::Pop, "standard_of_living", CompareValue),
(Scopes::BattleSide, "starting_manpower", CompareValue),
(
Scopes::State,
"state_cultural_acceptance",
Block(&[("target", Scope(Scopes::Culture)), ("value", CompareValue)]),
),
(
Scopes::State,
"state_religious_acceptance",
Block(&[("target", Scope(Scopes::Religion)), ("value", CompareValue)]),
),
(Scopes::StateGoods, "state_goods_cheaper", CompareValue),
(Scopes::StateGoods, "state_goods_consumption", CompareValue),
(Scopes::StateGoods, "state_goods_delta", CompareValue),
(Scopes::StateGoods, "state_goods_has_local_goods_shortage", Boolean),
(Scopes::StateGoods, "state_goods_pricier", CompareValue),
(Scopes::StateGoods, "state_goods_production", CompareValue),
(
Scopes::State,
"state_has_building_group_levels",
Block(&[("type", Item(Item::BuildingGroup)), ("value", CompareValue)]),
),
(Scopes::State, "state_has_building_levels", CompareValue),
(
Scopes::State,
"state_has_building_type_levels",
Block(&[("target", Item(Item::BuildingType)), ("value", CompareValue)]),
),
(Scopes::State, "state_has_goods_shortage", Boolean),
(Scopes::State, "state_is_eligible_as_mass_migration_target", Boolean),
(Scopes::State, "state_population", CompareValue),
(Scopes::State, "state_unemployment_rate", CompareValue),
(Scopes::Pop, "strata", CompareChoice(STRATA)),
(Scopes::Country, "subject_can_increase_autonomy", Boolean),
(Scopes::Country, "supply_network_strength", CompareValue),
(Scopes::None, "switch", Special),
(Scopes::Country, "taking_loans", Boolean),
(Scopes::PowerBloc, "target_cohesion_number", CompareValue),
(Scopes::PowerBloc, "target_cohesion_percentage", CompareValue),
(Scopes::DiplomaticPlay, "target_is", Scope(Scopes::Country)),
(Scopes::State, "tax_capacity", CompareValue),
(Scopes::State, "tax_capacity_usage", CompareValue),
(Scopes::Country, "tax_level", CompareChoice(LEVELS)),
(Scopes::Country, "tax_level_value", CompareValue),
(Scopes::Country, "tenure_in_current_power_bloc_days", CompareValue),
(Scopes::Country, "tenure_in_current_power_bloc_months", CompareValue),
(Scopes::Country, "tenure_in_current_power_bloc_weeks", CompareValue),
(Scopes::Country, "tenure_in_current_power_bloc_years", CompareValue),
(Scopes::Country, "total_manpower", Removed("1.6", "")),
(Scopes::Country, "total_population", CompareValue),
(Scopes::Country, "total_population_including_subjects", CompareValue),
(Scopes::Country, "total_population_including_subjects_share", CompareValue),
(Scopes::Country, "total_population_share", CompareValue),
(Scopes::Pop, "total_size", CompareValue),
(Scopes::State, "total_urbanization", CompareValue),
(Scopes::PowerBloc, "total_used_principle_levels", CompareValue),
(Scopes::TradeRoute, "trade_route_needs_convoys_to_grow", Boolean),
(Scopes::Character, "trait_value", CompareValue),
(Scopes::None, "trigger_else", Control),
(Scopes::None, "trigger_else_if", Control),
(Scopes::None, "trigger_if", Control),
(Scopes::State, "turmoil", CompareValue),
(Scopes::PowerBloc, "used_principle_slots", CompareValue),
(
Scopes::None,
"variable_list_size",
Block(&[("name", UncheckedValue), ("value", CompareValue)]),
),
(
Scopes::War,
"war_exhaustion_from_acceptance_of_dead",
Block(&[("target", Scope(Scopes::Country)), ("value", CompareValue)]),
),
(Scopes::War, "war_has_active_peace_deal", Boolean),
(
Scopes::Country,
"war_participant_has_war_goal_of_type_against",
Block(&[("type", Item(Item::Wargoal)), ("target", Scope(Scopes::Country))]),
),
(
Scopes::Country,
"war_side_has_war_goal_of_type_against",
Block(&[("type", Item(Item::Wargoal)), ("target", Scope(Scopes::Country))]),
),
(Scopes::Character, "was_exiled", Boolean),
(Scopes::Country, "was_formed_from", Item(Item::Country)),
(Scopes::Pop, "wealth", CompareValue),
(Scopes::Country, "weekly_net_fixed_income", CompareValue),
(Scopes::Building, "weekly_profit", CompareValue),
(Scopes::None, "weighted_calc_true_if", Special),
(Scopes::Pop, "workforce", CompareValue),
(
Scopes::Country,
"would_accept_diplomatic_action",
Block(&[
("actor", Scope(Scopes::Country)),
("type", Item(Item::DiplomaticAction)),
("?first_state", Scope(Scopes::State)),
("?second_state", Scope(Scopes::State)),
("?modify_acceptance", SetValue),
]),
),
(Scopes::None, "year", CompareValue),
(Scopes::Character, "years_of_service", CompareValue),
];
#[inline]
pub fn scope_trigger_complex(name: &str) -> Option<(Scopes, ArgumentValue, Scopes)> {
TRIGGER_COMPLEX_MAP.get(name).copied()
}
static TRIGGER_COMPLEX_MAP: LazyLock<TigerHashMap<&'static str, (Scopes, ArgumentValue, Scopes)>> =
LazyLock::new(|| {
let mut hash = TigerHashMap::default();
for (from, s, trigger, outscopes) in TRIGGER_COMPLEX.iter().copied() {
hash.insert(s, (from, trigger, outscopes));
}
hash
});
const TRIGGER_COMPLEX: &[(Scopes, &str, ArgumentValue, Scopes)] = {
use crate::item::Item;
use ArgumentValue::*;
&[
(
Scopes::Country,
"additional_war_exhaustion",
Scope(Scopes::DiplomaticPlay),
Scopes::Value,
),
(
Scopes::Country,
"army_mobilization_option_fraction",
Item(Item::MobilizationOption),
Scopes::Value,
),
(Scopes::Country, "average_sol_for_culture", Scope(Scopes::Culture), Scopes::Value),
(Scopes::Country, "average_sol_for_religion", Scope(Scopes::Religion), Scopes::Value),
(Scopes::Character, "character_acceptance", Scope(Scopes::Country), Scopes::Value),
(Scopes::Country, "country_army_unit_type_fraction", UncheckedValue, Scopes::Value), (
Scopes::Country,
"country_average_cultural_acceptance",
Scope(Scopes::Culture),
Scopes::Value,
),
(
Scopes::Country,
"country_average_religious_acceptance",
Scope(Scopes::Religion),
Scopes::Value,
),
(
Scopes::Country,
"country_has_building_group_levels",
Item(Item::BuildingGroup),
Scopes::Value,
),
(
Scopes::Country,
"country_has_building_type_levels",
Item(Item::BuildingType),
Scopes::Value,
),
(Scopes::Country, "country_navy_unity_type_fraction", UncheckedValue, Scopes::Value), (Scopes::Country, "cultural_acceptance_base", Scope(Scopes::Culture), Scopes::Value),
(Scopes::Country, "cultural_acceptance_delta", Scope(Scopes::Culture), Scopes::Value),
(Scopes::Country, "culture_percent_country", Item(Item::Culture), Scopes::Value),
(Scopes::State, "culture_percent_state", Item(Item::Culture), Scopes::Value),
(Scopes::Culture, "culture_secession_progress", Scope(Scopes::Country), Scopes::Value),
(
Scopes::DiplomaticPact,
"diplomatic_pact_other_country",
Scope(Scopes::Country),
Scopes::Country,
),
(Scopes::Country, "economic_dependence", Scope(Scopes::Country), Scopes::Value),
(Scopes::Country, "enactment_chance_for_law", Scope(Scopes::LawType), Scopes::Value),
(
Scopes::Country,
"enactment_chance_for_law_without_enactment_modifier",
Scope(Scopes::LawType),
Scopes::Value,
),
(Scopes::Country, "enemy_contested_wargoals", Scope(Scopes::War), Scopes::Value),
(
Scopes::Building,
"fraction_of_levels_owned_by_country",
Scope(Scopes::Country),
Scopes::Value,
),
(Scopes::Country, "gdp_ownership_ratio", Scope(Scopes::Country), Scopes::Value),
(Scopes::Country, "goods_production_rank", Scope(Scopes::Goods), Scopes::Value),
(
Scopes::HarvestCondition,
"harvest_condition_intensity",
Scope(Scopes::Country),
Scopes::Value,
),
(Scopes::Country, "has_technology_progress", Item(Item::Technology), Scopes::Value),
(Scopes::War, "has_war_exhaustion", Item(Item::Country), Scopes::Value),
(Scopes::War, "has_war_support", Item(Item::Country), Scopes::Value),
(Scopes::State, "ig_state_pol_strength_share", Scope(Scopes::InterestGroup), Scopes::Value),
(Scopes::Country, "institution_investment_level", Item(Item::Institution), Scopes::Value),
(Scopes::PowerBloc, "leverage_advantage", Scope(Scopes::Country), Scopes::Value),
(Scopes::None, "list_size", UncheckedValue, Scopes::Value),
(
Scopes::Market,
"market_number_goods_shortages_with",
Scope(Scopes::Country),
Scopes::Value,
),
(
Scopes::Market,
"market_number_goods_shortages_without",
Scope(Scopes::Country),
Scopes::Value,
),
(Scopes::Country, "nationalization_cost", Scope(Scopes::Country), Scopes::Value),
(Scopes::War, "num_country_casualties", Scope(Scopes::Country), Scopes::Value),
(Scopes::War, "num_country_dead", Scope(Scopes::Country), Scopes::Value),
(Scopes::War, "num_country_wounded", Scope(Scopes::Country), Scopes::Value),
(Scopes::Country, "num_diplomatic_pacts", Item(Item::DiplomaticAction), Scopes::Value),
(Scopes::Country, "pop_type_percent_country", Item(Item::PopType), Scopes::Value),
(Scopes::State, "pop_type_percent_state", Item(Item::PopType), Scopes::Value),
(Scopes::State, "population_by_culture", Scope(Scopes::Culture), Scopes::Value),
(
Scopes::Country,
"potential_diplomatic_play_power_ratio",
Scope(Scopes::Country),
Scopes::Value,
),
(Scopes::Country, "religion_percent_country", Item(Item::Religion), Scopes::Value),
(Scopes::State, "religion_percent_state", Item(Item::Religion), Scopes::Value),
(Scopes::StateRegion, "remaining_undepleted", Item(Item::BuildingGroup), Scopes::Value),
(Scopes::Country, "size_weighted_lost_battles_fraction", Scope(Scopes::War), Scopes::Value),
(
Scopes::State,
"state_has_building_group_levels",
Item(Item::BuildingGroup),
Scopes::Value,
),
(Scopes::State, "state_has_building_type_levels", Item(Item::BuildingType), Scopes::Value),
(Scopes::Country, "power_bloc_share_gdp_with", Scope(Scopes::Country), Scopes::Value),
(Scopes::Country, "power_bloc_share_gdp_without", Scope(Scopes::Country), Scopes::Value),
(
Scopes::Country,
"power_bloc_share_power_projection_with",
Scope(Scopes::Country),
Scopes::Value,
),
(
Scopes::Country,
"power_bloc_share_power_projection_without",
Scope(Scopes::Country),
Scopes::Value,
),
(Scopes::Country, "power_bloc_share_prestige_with", Scope(Scopes::Country), Scopes::Value),
(
Scopes::Country,
"power_bloc_share_prestige_without",
Scope(Scopes::Country),
Scopes::Value,
),
(
Scopes::PowerBloc,
"power_bloc_total_leading_goods_producers_with",
Scope(Scopes::Country),
Scopes::Value,
),
(
Scopes::PowerBloc,
"power_bloc_total_leading_goods_producers_without",
Scope(Scopes::Country),
Scopes::Value,
),
(
Scopes::PowerBloc,
"power_bloc_worst_economic_dependence_with",
Scope(Scopes::Country),
Scopes::Value,
),
(
Scopes::PowerBloc,
"power_bloc_worst_economic_dependence_without",
Scope(Scopes::Country),
Scopes::Value,
),
(Scopes::PowerBloc, "power_bloc_worst_infamy_with", Scope(Scopes::Country), Scopes::Value),
(
Scopes::PowerBloc,
"power_bloc_worst_infamy_without",
Scope(Scopes::Country),
Scopes::Value,
),
(
Scopes::PowerBloc,
"power_bloc_worst_leader_relations_with",
Scope(Scopes::Country),
Scopes::Value,
),
(
Scopes::PowerBloc,
"power_bloc_worst_leader_relations_without",
Scope(Scopes::Country),
Scopes::Value,
),
(
Scopes::PowerBloc,
"power_bloc_worst_leader_religion_population_fraction_with",
Scope(Scopes::Country),
Scopes::Value,
),
(
Scopes::PowerBloc,
"power_bloc_worst_leader_religion_population_fraction_without",
Scope(Scopes::Country),
Scopes::Value,
),
(
Scopes::PowerBloc,
"power_bloc_worst_liberty_desire_with",
Scope(Scopes::Country),
Scopes::Value,
),
(
Scopes::PowerBloc,
"power_bloc_worst_liberty_desire_without",
Scope(Scopes::Country),
Scopes::Value,
),
(
Scopes::PowerBloc,
"power_bloc_worst_progressiveness_difference_government_type_with",
Scope(Scopes::Country),
Scopes::Value,
),
(
Scopes::PowerBloc,
"power_bloc_worst_progressiveness_difference_government_type_without",
Scope(Scopes::Country),
Scopes::Value,
),
(
Scopes::PowerBloc,
"predicted_cohesion_percentage_with",
Scope(Scopes::Country),
Scopes::Value,
),
(
Scopes::JournalEntry,
"scripted_bar_progress",
Item(Item::ScriptedProgressBar),
Scopes::Value,
),
(Scopes::State, "state_cultural_acceptance", Scope(Scopes::Culture), Scopes::Value),
(Scopes::State, "state_religious_acceptance", Scope(Scopes::Religion), Scopes::Value),
(
Scopes::War,
"war_exhaustion_from_acceptance_of_dead",
Scope(Scopes::Country),
Scopes::Value,
),
]
};