Skip to main content

tiger_lib/vic3/tables/
effects.rs

1use std::sync::LazyLock;
2
3use crate::effect::Effect;
4use crate::effect_validation::*;
5use crate::everything::Everything;
6use crate::helpers::TigerHashMap;
7use crate::item::Item;
8use crate::scopes::*;
9use crate::token::Token;
10use crate::vic3::effect_validation::*;
11use crate::vic3::tables::misc::STATE_TYPES;
12
13use Effect::*;
14
15pub fn scope_effect(name: &Token, _data: &Everything) -> Option<(Scopes, Effect)> {
16    let name_lc = name.as_str().to_ascii_lowercase();
17    SCOPE_EFFECT_MAP.get(&*name_lc).copied()
18}
19
20/// A hashed version of [`SCOPE_EFFECT`], for quick lookup by effect name.
21static SCOPE_EFFECT_MAP: LazyLock<TigerHashMap<&'static str, (Scopes, Effect)>> =
22    LazyLock::new(|| {
23        let mut hash = TigerHashMap::default();
24        for (from, s, effect) in SCOPE_EFFECT.iter().copied() {
25            hash.insert(s, (from, effect));
26        }
27        hash
28    });
29
30// LAST UPDATED VIC3 VERSION 1.12.2
31// See `effects.log` from the game data dumps
32const SCOPE_EFFECT: &[(Scopes, &str, Effect)] = &[
33    (Scopes::InterestGroup, "abandon_revolution", Boolean),
34    (Scopes::State, "activate_building", Vb(validate_activate_building)),
35    (Scopes::Country, "activate_law", Scope(Scopes::LawType)),
36    (
37        Scopes::Country.union(Scopes::State),
38        "activate_production_method",
39        Vb(validate_activate_production_method),
40    ),
41    (Scopes::State, "add_acceptance", TargetValue("target", Scopes::Culture, "value")),
42    (Scopes::Law, "add_amendment", Vb(validate_add_amendment)),
43    (Scopes::StateRegion, "add_arable_land", ScriptValue),
44    (Scopes::Country, "add_banned_goods", Scope(Scopes::Goods)),
45    (Scopes::Character, "add_career_length", Vb(validate_career_length)),
46    (Scopes::Country, "add_change_relations_progress", Vb(validate_country_value)), // Not used in vanilla
47    (Scopes::PoliticalMovement, "add_character_ideology", Item(Item::Ideology)),
48    (Scopes::Character, "add_character_role", Vv(validate_add_character_role)),
49    (Scopes::CivilWar, "add_civil_war_progress", ScriptValue),
50    (Scopes::StateRegion, "add_claim", Scope(Scopes::Country)),
51    (Scopes::PowerBloc, "add_cohesion_number", ScriptValue),
52    (Scopes::PowerBloc, "add_cohesion_percent", ScriptValue),
53    (Scopes::Character, "add_commander_rank", Integer),
54    (Scopes::Country, "add_company", Scope(Scopes::CompanyType)),
55    (Scopes::Company, "add_company_monopoly", Scope(Scopes::BuildingType)),
56    (Scopes::None, "add_contextless_journal_entry", Item(Item::JournalEntry)),
57    (Scopes::Country, "add_country_monopoly", Scope(Scopes::BuildingType)),
58    (Scopes::State, "add_cultural_community", Scope(Scopes::Culture)),
59    (Scopes::Culture, "add_cultural_community_in_state", Scope(Scopes::State)),
60    (Scopes::Culture, "add_cultural_obsession", Item(Item::Goods)),
61    (Scopes::Culture, "add_cultural_taboo", Item(Item::Goods)),
62    (Scopes::Country, "add_culture_acceptance_modifier", Vb(validate_add_culture_modifier)),
63    (Scopes::State, "add_culture_standard_of_living_modifier", Vb(validate_add_culture_modifier)),
64    (Scopes::Country, "add_declared_interest", Removed("1.13", "replaced with `add_involvement`")),
65    (Scopes::StateRegion.union(Scopes::State), "add_devastation", ScriptValue),
66    (
67        Scopes::DiplomaticPlay,
68        "add_diplomatic_play_war_support",
69        TargetValue("target", Scopes::Country, "value"),
70    ),
71    (Scopes::Country, "add_electoral_confidence", ScriptValue),
72    (Scopes::Country, "add_enactment_modifier", Vb(validate_add_enactment_modifier)),
73    (Scopes::Country, "add_enactment_phase", ScriptValue),
74    (Scopes::Country, "add_enactment_setback", ScriptValue),
75    (Scopes::Country, "add_era_researched", Item(Item::TechnologyEra)),
76    (Scopes::DiplomaticPlay, "add_escalation", Integer),
77    (Scopes::Character, "add_experience", ScriptValue),
78    (Scopes::StateGoods, "add_exports", ScriptValue),
79    (Scopes::Culture, "add_fervor", ScriptValue),
80    (Scopes::Country, "add_fervor_target_modifier", Vb(validate_add_culture_modifier)),
81    (Scopes::StateRegion, "add_homeland", ScopeOrItem(Scopes::Culture, Item::Culture)),
82    (Scopes::InterestGroup, "add_ideology", Item(Item::Ideology)),
83    (Scopes::Party, "add_ig_to_party", Scope(Scopes::InterestGroup)),
84    (Scopes::StateGoods, "add_imports", ScriptValue),
85    (Scopes::DiplomaticPlay, "add_initiator_backers", Vb(validate_addremove_backers)),
86    (Scopes::Country, "add_investment_pool", ScriptValue),
87    (Scopes::JournalEntry, "add_involved_country", Scope(Scopes::Country)),
88    (
89        Scopes::Country,
90        "add_involvement",
91        TargetValue("strategic_region", Scopes::StrategicRegion, "value"),
92    ),
93    (Scopes::None, "add_journal_entry", Vb(validate_add_journalentry)),
94    (Scopes::Country, "add_law_progress", ScriptValue),
95    (Scopes::PowerBloc, "add_leverage", TargetValue("target", Scopes::Country, "value")),
96    (Scopes::Country, "add_liberty_desire", ScriptValue),
97    (Scopes::PoliticalLobby, "add_lobby_member", Scope(Scopes::InterestGroup)),
98    (Scopes::Country, "add_loyalists", Vb(validate_add_loyalists)),
99    (Scopes::State, "add_loyalists_in_state", Vb(validate_add_loyalists)),
100    (Scopes::DiplomaticPlay, "add_maneuvers", TargetValue("target", Scopes::Country, "value")),
101    (
102        Scopes::Country
103            .union(Scopes::Building)
104            .union(Scopes::Character)
105            .union(Scopes::Institution)
106            .union(Scopes::InterestGroup)
107            .union(Scopes::JournalEntry)
108            .union(Scopes::PoliticalMovement)
109            .union(Scopes::PowerBloc)
110            .union(Scopes::State),
111        "add_modifier",
112        Vbv(validate_add_modifier),
113    ),
114    (Scopes::Party, "add_momentum", ScriptValue),
115    (Scopes::NewCombatUnit, "add_morale", ScriptValue),
116    (Scopes::MilitaryFormation, "add_organization", ScriptValue), // not used in vanilla
117    (Scopes::Company, "add_owned_country", Scope(Scopes::Country)),
118    (Scopes::StateRegion, "add_pollution", ScriptValue),
119    (Scopes::Pop, "add_pop_wealth", Vb(validate_pop_wealth)),
120    (Scopes::Country, "add_primary_culture", Scope(Scopes::Culture)),
121    (Scopes::PowerBloc, "add_principle", Item(Item::Principle)),
122    (Scopes::JournalEntry, "add_progress", Vb(validate_progress)),
123    (Scopes::Country, "add_radicals", Vb(validate_add_loyalists)),
124    (Scopes::State, "add_radicals_in_state", Vb(validate_add_loyalists)),
125    (Scopes::Character, "add_random_trait", Choice(&["personality", "skill", "condition"])),
126    (
127        Scopes::State,
128        "add_religion_standard_of_living_modifier",
129        Vb(validate_add_religion_sol_modifier),
130    ),
131    (Scopes::State.union(Scopes::StateRegion), "add_resource_potential", Item(Item::BuildingType)),
132    (Scopes::InterestGroup, "add_ruling_interest_group", Boolean),
133    (Scopes::StateRegion, "add_state_trait", Item(Item::StateTrait)),
134    (Scopes::Country, "add_supply_ships", ScriptValue),
135    (Scopes::DiplomaticPlay, "add_target_backers", Vb(validate_addremove_backers)),
136    (Scopes::Country, "add_taxed_goods", Scope(Scopes::Goods)),
137    (Scopes::Country, "add_technology_progress", Vb(validate_add_technology_progress)),
138    (Scopes::Country, "add_technology_researched", Item(Item::Technology)),
139    (Scopes::None, "add_to_global_variable_list", Vb(validate_add_to_variable_list)),
140    (Scopes::None, "add_to_global_variable_map", UncheckedTodo),
141    (Scopes::all(), "add_to_list", Vbv(validate_add_to_list)),
142    (Scopes::None, "add_to_local_variable_list", Vb(validate_add_to_variable_list)),
143    (Scopes::None, "add_to_local_variable_map", UncheckedTodo),
144    (Scopes::all(), "add_to_temporary_list", Vbv(validate_add_to_list)),
145    (Scopes::None, "add_to_variable_list", Vb(validate_add_to_variable_list)),
146    (Scopes::None, "add_to_variable_map", UncheckedTodo),
147    (Scopes::Culture, "add_tradition_trait", Item(Item::TraditionTrait)),
148    (Scopes::Character, "add_trait", Item(Item::CharacterTrait)),
149    (Scopes::Country, "add_treasury", ScriptValue),
150    (Scopes::War, "add_war_exhaustion", TargetValue("target", Scopes::Country, "value")),
151    (Scopes::DiplomaticPlay, "add_war_goal", Vb(validate_add_war_goal)),
152    (Scopes::War, "add_war_war_support", TargetValue("target", Scopes::Country, "value")),
153    (Scopes::Country, "annex", Scope(Scopes::Country)),
154    (Scopes::Country, "annex_as_civil_war", Scope(Scopes::Country)),
155    (Scopes::Country, "annex_with_incorporation", Scope(Scopes::Country)),
156    (Scopes::None, "assert_if", Unchecked),
157    (Scopes::None, "assert_read", Unchecked),
158    (Scopes::Country, "call_election", Vb(validate_call_election)),
159    (Scopes::Country, "cancel_enactment", Yes),
160    // Documentation says scope is None but describes scope as Law
161    (Scopes::Law, "cancel_imposition", Yes),
162    (Scopes::State, "cede_treaty_port", Scope(Scopes::Country)),
163    (Scopes::PoliticalLobby, "change_appeasement", Vb(validate_change_appeasement)),
164    (Scopes::Character, "change_character_culture", Scope(Scopes::Culture)),
165    (Scopes::Character, "change_character_religion", Scope(Scopes::Religion)),
166    (Scopes::None, "change_global_variable", Vb(validate_change_variable)),
167    (Scopes::None, "change_infamy", ScriptValue),
168    (
169        Scopes::Country,
170        "change_institution_investment_level",
171        Vb(validate_change_institution_investment_level),
172    ),
173    (Scopes::None, "change_local_variable", Vb(validate_change_variable)),
174    (Scopes::Pop, "change_pop_culture", TargetValue("target", Scopes::Culture, "value")),
175    (Scopes::Pop, "change_pop_religion", TargetValue("target", Scopes::Religion, "value")),
176    (Scopes::Pop, "change_poptype", Scope(Scopes::PopType)),
177    (Scopes::Country, "change_relations", Vb(validate_country_value)),
178    (
179        Scopes::State.union(Scopes::StateRegion),
180        "change_resource_potential",
181        ItemValue("type", Item::BuildingType, "amount"),
182    ),
183    (Scopes::Country, "change_subject_type", Item(Item::SubjectType)),
184    (Scopes::Country, "change_tag", Item(Item::Country)),
185    (Scopes::Country, "change_tension", Vb(validate_country_value)),
186    (Scopes::None, "change_variable", Vb(validate_change_variable)),
187    (Scopes::None, "clamp_global_variable", Vb(validate_clamp_variable)),
188    (Scopes::None, "clamp_local_variable", Vb(validate_clamp_variable)),
189    (Scopes::None, "clamp_variable", Vb(validate_clamp_variable)),
190    (Scopes::Country, "clear_debt", Boolean),
191    (Scopes::Country, "clear_enactment_modifier", Yes),
192    (Scopes::None, "clear_global_variable_list", Identifier("list name")),
193    (Scopes::None, "clear_global_variable_map", UncheckedTodo),
194    (Scopes::None, "clear_local_variable_list", Identifier("list name")),
195    (Scopes::None, "clear_local_variable_map", UncheckedTodo),
196    (Scopes::Country, "clear_ownership_transfer_fleet", Yes),
197    (Scopes::None, "clear_saved_scope", Identifier("scope name")),
198    (Scopes::Country, "clear_scaled_debt", ScriptValue),
199    (Scopes::None, "clear_variable_list", Identifier("list name")),
200    (Scopes::None, "clear_variable_map", UncheckedTodo),
201    (Scopes::Country, "complete_objective_subgoal", Item(Item::ObjectiveSubgoal)),
202    (Scopes::State, "convert_population", TargetValue("target", Scopes::Religion, "value")),
203    (Scopes::Country, "copy_laws", Scope(Scopes::Country)),
204    (Scopes::Country, "create_bidirectional_truce", Vb(validate_create_truce)),
205    (Scopes::State, "create_building", Vb(validate_create_building)),
206    (Scopes::Country, "create_character", Vb(validate_create_character)),
207    (Scopes::None, "create_country", Vb(validate_create_country)),
208    (Scopes::Country, "create_diplomatic_catalyst", Vb(validate_create_catalyst)),
209    (Scopes::Country, "create_diplomatic_pact", Vb(validate_diplomatic_pact)),
210    (Scopes::Country, "create_diplomatic_play", Vb(validate_create_diplomatic_play)),
211    (Scopes::None, "create_dynamic_country", Vb(validate_create_dynamic_country)),
212    (Scopes::Country, "create_incident", Vb(validate_country_value)),
213    (Scopes::State, "create_mass_migration", Vb(validate_create_mass_migration)),
214    (Scopes::Country, "create_military_formation", Vb(validate_create_military_formation)),
215    (Scopes::Country, "create_political_lobby", Vb(validate_create_lobby)),
216    (Scopes::Country, "create_political_movement", Vb(validate_create_movement)),
217    (Scopes::State, "create_pop", Vb(validate_create_pop)),
218    (Scopes::Country, "create_power_bloc", Vb(validate_create_power_bloc)),
219    (Scopes::Country, "create_ship", Vb(validate_create_ship)),
220    (Scopes::StateRegion, "create_state", Vb(validate_create_state)),
221    (Scopes::Country, "create_trade_route", Removed("1.9", "replaced with world trade system")),
222    (Scopes::None, "create_treaty", Vb(validate_create_treaty)),
223    (
224        Scopes::Country,
225        "create_truce",
226        Removed("1.7", "replaced with create_bidirectional_truce and create_unidirectional_truce"),
227    ),
228    (Scopes::Country, "create_unidirectional_truce", Vb(validate_create_truce)),
229    (Scopes::None, "custom_description", Control),
230    (Scopes::None, "custom_description_no_bullet", Control),
231    (Scopes::None, "custom_label", ControlOrLabel),
232    (Scopes::None, "custom_label_no_bullet", ControlOrLabel),
233    (Scopes::None, "custom_tooltip", ControlOrLabel),
234    (Scopes::None, "custom_tooltip_no_bullet", ControlOrLabel),
235    (Scopes::Ship, "damage_ship_hull", ScriptValue),
236    (Scopes::Ship, "damage_ship_hull_percent", ScriptValue),
237    (Scopes::State, "deactivate_building", Vb(validate_activate_building)),
238    (Scopes::Country, "deactivate_law", Scope(Scopes::LawType)),
239    (Scopes::Country, "deactivate_parties", Yes),
240    (Scopes::None, "debug_log", UncheckedTodo),
241    (Scopes::None, "debug_log_scopes", Boolean),
242    (Scopes::Country, "decrease_autonomy", Yes),
243    (Scopes::Character, "demobilize", Removed("1.6", "")),
244    (Scopes::MilitaryFormation, "deploy_to_front", Vbv(validate_teleport_to_front)),
245    (Scopes::Country, "disable_temporary_hostilities", Vb(validate_temporary_hostilities)),
246    (Scopes::Party, "disband_party", Yes),
247    (Scopes::PoliticalLobby, "disband_political_lobby", Yes),
248    (Scopes::Character, "disinherit_character", Yes),
249    (Scopes::None, "else", Control),
250    (Scopes::None, "else_if", Control),
251    (Scopes::Country, "enable_temporary_hostilities", Vb(validate_temporary_hostilities)),
252    (Scopes::Country, "end_national_awakening", Scope(Scopes::Culture)),
253    (Scopes::DiplomaticPlay, "end_play", Boolean),
254    (Scopes::Country, "end_truce", Scope(Scopes::Country)),
255    (Scopes::None, "error_log", UncheckedTodo),
256    (Scopes::None, "execute_event_option", Vb(validate_execute_event_option)),
257    (Scopes::Character, "exile_character", Yes),
258    (Scopes::StateRegion, "finish_harvest_condition", Item(Item::HarvestConditionType)),
259    // docs say boolean
260    (Scopes::InterestGroup, "finish_negotiation", Item(Item::Localization)),
261    (Scopes::State, "force_resource_depletion", Item(Item::BuildingType)),
262    (Scopes::State, "force_resource_discovery", Item(Item::BuildingType)),
263    (Scopes::Character, "free_character_from_void", Boolean),
264    (Scopes::MilitaryFormation, "fully_mobilize_army", Yes),
265    (Scopes::None, "hidden_effect", Control),
266    (Scopes::None, "if", Control),
267    (Scopes::InterestGroup, "improve_stance", Integer),
268    (Scopes::Country, "increase_autonomy", Yes),
269    (Scopes::Country, "join_power_bloc", Scope(Scopes::Country)),
270    (Scopes::InterestGroup, "join_revolution", Boolean),
271    (Scopes::War, "join_war", Vb(validate_join_war)),
272    (Scopes::Character, "kill_character", Vbv(validate_kill_character)),
273    (Scopes::Ship, "kill_crew", ScriptValue),
274    (Scopes::Ship, "kill_crew_percent", ScriptValue),
275    (Scopes::Country, "kill_population", Vb(validate_kill_population)),
276    (Scopes::State, "kill_population_in_state", Vb(validate_kill_population)),
277    (Scopes::Country, "kill_population_percent", Vb(validate_kill_population)),
278    (Scopes::State, "kill_population_percent_in_state", Vb(validate_kill_population)),
279    (Scopes::Ship, "kill_ship", Boolean),
280    (Scopes::Country.union(Scopes::State), "liberate_slaves", Yes),
281    (Scopes::Country, "liberate_slaves_in_incorporated_states", Yes),
282    (Scopes::Country, "liberate_slaves_in_unincorporated_states", Yes),
283    (Scopes::None, "lock_trade_route", Removed("1.9", "replaced with world trade system")),
284    (Scopes::Country, "make_independent", Boolean),
285    (Scopes::MilitaryFormation, "mobilize_army", Yes),
286    (Scopes::Pop, "move_partial_pop", Vb(validate_move_partial_pop)),
287    (Scopes::Pop, "move_pop", Scope(Scopes::State)),
288    (Scopes::Character, "place_character_in_void", ScriptValue),
289    (Scopes::Country, "play_as", Scope(Scopes::Country)),
290    (Scopes::None, "post_audio_event", Vb(validate_audio_event)),
291    (Scopes::None, "post_notification", Vv(validate_post_notification)),
292    (Scopes::None, "post_proposal", Item(Item::ProposalType)),
293    (Scopes::None, "random", Control),
294    (Scopes::None, "random_list", Vbc(validate_random_list)),
295    (Scopes::None, "random_log_scopes", Boolean),
296    (Scopes::Country, "recalculate_pop_ig_support", Boolean),
297    (Scopes::Country, "regime_change", Scope(Scopes::Country)),
298    (Scopes::Country, "remove_active_objective_subgoal", Item(Item::ObjectiveSubgoal)),
299    (Scopes::Amendment, "remove_amendment", Boolean),
300    (Scopes::Character, "remove_as_interest_group_leader", Yes),
301    (Scopes::Country, "remove_banned_goods", Scope(Scopes::Goods)),
302    (Scopes::State, "remove_building", Item(Item::BuildingType)),
303    (Scopes::PoliticalMovement, "remove_character_ideology", Item(Item::Ideology)),
304    (Scopes::Character, "remove_character_role", Vv(validate_add_character_role)),
305    (Scopes::StateRegion, "remove_claim", Scope(Scopes::Country)),
306    (Scopes::Country, "remove_company", Scope(Scopes::CompanyType)),
307    (Scopes::Culture, "remove_cultural_obsession", Item(Item::Goods)),
308    (Scopes::Culture, "remove_cultural_taboo", Item(Item::Goods)),
309    (Scopes::Country, "remove_diplomatic_pact", Vb(validate_diplomatic_pact)),
310    (Scopes::Country, "remove_enactment_modifier", UncheckedTodo), // No examples in vanilla
311    (Scopes::StateGoods, "remove_exports", ScriptValue),
312    (Scopes::None, "remove_from_global_variable_map", UncheckedTodo),
313    (Scopes::all_but_none(), "remove_from_list", Vv(validate_remove_from_list)),
314    (Scopes::None, "remove_from_local_variable_map", UncheckedTodo),
315    (Scopes::None, "remove_from_variable_map", UncheckedTodo),
316    (Scopes::None, "remove_global_variable", Identifier("variable name")),
317    (Scopes::StateRegion, "remove_homeland", Scope(Scopes::Culture)),
318    (Scopes::InterestGroup, "remove_ideology", Item(Item::Ideology)),
319    (Scopes::Party, "remove_ig_from_party", Scope(Scopes::InterestGroup)),
320    (Scopes::StateGoods, "remove_imports", ScriptValue),
321    (Scopes::DiplomaticPlay, "remove_initiator_backers", Vb(validate_addremove_backers)),
322    (Scopes::JournalEntry, "remove_involved_country", Scope(Scopes::Country)),
323    (Scopes::None, "remove_list_global_variable", Vb(validate_add_to_variable_list)),
324    (Scopes::None, "remove_list_local_variable", Vb(validate_add_to_variable_list)),
325    (Scopes::None, "remove_list_variable", Vb(validate_add_to_variable_list)),
326    (Scopes::PoliticalLobby, "remove_lobby_member", Scope(Scopes::InterestGroup)),
327    (Scopes::None, "remove_local_variable", Identifier("variable name")),
328    (
329        Scopes::Country
330            .union(Scopes::Building)
331            .union(Scopes::Character)
332            .union(Scopes::Institution)
333            .union(Scopes::InterestGroup)
334            .union(Scopes::JournalEntry)
335            .union(Scopes::PoliticalMovement)
336            .union(Scopes::PowerBloc)
337            .union(Scopes::State),
338        "remove_modifier",
339        Item(Item::Modifier),
340    ),
341    (Scopes::Country, "remove_monopoly", Scope(Scopes::BuildingType)),
342    (Scopes::Company, "remove_owned_country", Scope(Scopes::Country)),
343    (Scopes::Country, "remove_primary_culture", Scope(Scopes::Culture)),
344    (Scopes::PowerBloc, "remove_principle", Item(Item::Principle)),
345    (
346        Scopes::State.union(Scopes::StateRegion),
347        "remove_resource_potential",
348        Item(Item::BuildingType),
349    ),
350    (Scopes::InterestGroup, "remove_ruling_interest_group", Boolean),
351    (Scopes::StateRegion, "remove_state_trait", Item(Item::StateTrait)),
352    (Scopes::DiplomaticPlay, "remove_target_backers", Vb(validate_addremove_backers)),
353    (Scopes::Country, "remove_taxed_goods", Scope(Scopes::Goods)),
354    (Scopes::Culture, "remove_tradition_trait", Item(Item::TraditionTrait)),
355    (Scopes::Character, "remove_trait", Item(Item::CharacterTrait)),
356    (Scopes::None, "remove_variable", Identifier("variable name")),
357    (Scopes::DiplomaticPlay, "remove_war_goal", Vb(validate_remove_war_goal)),
358    (Scopes::Character, "replace_character_roles", Vb(validate_replace_character_roles)),
359    (Scopes::State, "reset_hub_names", Yes),
360    (Scopes::State, "reset_state_name", Yes),
361    (Scopes::DiplomaticPlay, "resolve_play_for", Scope(Scopes::Country)),
362    (Scopes::Character, "retire_character", Vbv(validate_kill_character)),
363    (Scopes::Character, "retire_character_if_should_be_culled", Vbv(validate_kill_character)),
364    (Scopes::None, "round_global_variable", Vb(validate_round_variable)),
365    (Scopes::None, "round_local_variable", Vb(validate_round_variable)),
366    (Scopes::None, "round_variable", Vb(validate_round_variable)),
367    (Scopes::all_but_none(), "save_scope_as", Vv(validate_save_scope)),
368    (Scopes::None, "save_scope_value_as", Vb(validate_save_scope_value)),
369    (Scopes::all_but_none(), "save_temporary_scope_as", Vv(validate_save_scope)),
370    (Scopes::None, "save_temporary_scope_value_as", Vb(validate_save_scope_value)),
371    (Scopes::Country, "seize_investment_pool", Boolean),
372    (Scopes::Character, "set_as_adult", Yes),
373    (Scopes::Ship, "set_as_flagship", Boolean),
374    (Scopes::Character, "set_as_interest_group_leader", Boolean),
375    (Scopes::State, "set_available_for_autonomous_investment", Scope(Scopes::BuildingType)),
376    (Scopes::JournalEntry, "set_bar_progress", Vb(validate_progress)),
377    (Scopes::PoliticalMovement, "set_bolstering", Boolean),
378    (Scopes::Country, "set_capital", Item(Item::StateRegion)),
379    (Scopes::Character, "set_career_length", Vb(validate_career_length)),
380    (Scopes::Character, "set_character_as_executive", Scope(Scopes::Company)),
381    (Scopes::Character, "set_character_as_ruler", Yes),
382    (
383        Scopes::Character,
384        "set_character_busy",
385        Removed("1.11", "replaced with set_character_busy_and_immortal"),
386    ),
387    (Scopes::Character, "set_character_busy_and_immortal", Boolean),
388    (Scopes::Character, "set_character_immortal", Boolean),
389    (Scopes::Character, "set_commander_rank", Integer),
390    (Scopes::Company, "set_company_establishment_date", Date),
391    (Scopes::Company, "set_company_state_region", Scope(Scopes::StateRegion)),
392    (Scopes::PoliticalMovement, "set_core_ideology", Item(Item::Ideology)),
393    (Scopes::Country, "set_country_type", Item(Item::CountryType)),
394    (Scopes::StateRegion.union(Scopes::State), "set_devastation", ScriptValue),
395    (Scopes::Country, "set_diplomats_expelled", Scope(Scopes::Country)),
396    (Scopes::Country, "set_electoral_confidence", ScriptValue),
397    (Scopes::Country, "set_export_tariff_level", Vb(validate_tariff_level)),
398    (Scopes::StateGoods, "set_exports", ScriptValue),
399    (Scopes::Culture, "set_fervor", ScriptValue),
400    (Scopes::Character, "set_first_name", Item(Item::Localization)),
401    (Scopes::None, "set_global_variable", Vbv(validate_set_variable)),
402    (Scopes::Country, "set_government_wage_level", Item(Item::Level)),
403    (Scopes::InterestGroup, "set_has_negotiated", Boolean),
404    (Scopes::Country, "set_heir", Scope(Scopes::Character)),
405    (Scopes::Character, "set_home_country", Scope(Scopes::Country)),
406    (Scopes::Character, "set_home_country_definition", Scope(Scopes::CountryDefinition)),
407    (Scopes::Character, "set_home_state", Scope(Scopes::State)),
408    (Scopes::State, "set_hub_name", Vb(validate_set_hub_name)),
409    // Not knowing the state at compile time means the localizations can't be checked.
410    (Scopes::State, "set_hub_names", UncheckedTodo),
411    (Scopes::Character, "set_ideology", Scope(Scopes::Ideology)),
412    (
413        Scopes::InterestGroup,
414        "set_ig_bolstering",
415        Removed("1.8", "see `set_bolstering` for political movements"),
416    ),
417    (
418        Scopes::InterestGroup,
419        "set_ig_suppression",
420        Removed("1.8", "see `set_suppression` for political movements"),
421    ),
422    (Scopes::InterestGroup, "set_ig_trait", Scope(Scopes::InterestGroupTrait)),
423    (Scopes::Country, "set_immune_to_revolutions", Boolean),
424    (Scopes::Country, "set_import_tariff_level", Vb(validate_tariff_level)),
425    (Scopes::StateGoods, "set_imports", ScriptValue),
426    (
427        Scopes::Country,
428        "set_institution_investment_level",
429        Vb(validate_set_institution_investment_level),
430    ),
431    (Scopes::Character, "set_interest_group", Scope(Scopes::InterestGroup)),
432    (Scopes::InterestGroup, "set_interest_group_name", Item(Item::Localization)),
433    (Scopes::Character, "set_is_noble", Boolean),
434    (Scopes::DiplomaticPlay, "set_key", Item(Item::Localization)),
435    (Scopes::Character, "set_last_name", Item(Item::Localization)),
436    (Scopes::None, "set_local_variable", Vbv(validate_set_variable)),
437    (Scopes::Country, "set_market_capital", Item(Item::StateRegion)),
438    (Scopes::Country, "set_military_wage_level", Item(Item::Level)),
439    (Scopes::Country, "set_mutual_secret_goal", Vb(validate_set_secret_goal)),
440    (Scopes::Culture, "set_name_format", Choice(&["first_last", "last_first"])),
441    (Scopes::Country, "set_next_election_date", Date),
442    (Scopes::Country, "set_only_legal_party_from_ig", Scope(Scopes::InterestGroup)),
443    (Scopes::Country, "set_owes_obligation_to", Vb(validate_owes_obligation)),
444    (Scopes::StateRegion, "set_owner_of_provinces", Vb(validate_owner_of_provinces)),
445    (Scopes::Pop, "set_pop_literacy", Vb(validate_pop_literacy)),
446    (Scopes::Pop, "set_pop_qualifications", UncheckedTodo), // No examples in vanilla
447    (Scopes::Pop, "set_pop_wealth", Vb(validate_pop_wealth)),
448    (Scopes::Country, "set_relations", Vb(validate_country_value)),
449    (Scopes::Country, "set_ruling_interest_groups", Vb(validate_ruling_ig)),
450    (Scopes::Party, "set_ruling_party", Yes),
451    (Scopes::Country, "set_secret_goal", Vb(validate_set_secret_goal)),
452    (Scopes::Ship, "set_ship_owner", Scope(Scopes::Country)),
453    (Scopes::Ship, "set_ship_owner_multiple", Scope(Scopes::Country)),
454    (Scopes::Country, "set_social_hierarchy", Item(Item::SocialHierarchy)),
455    (Scopes::State, "set_state_name", Item(Item::Localization)),
456    (Scopes::State, "set_state_owner", Scope(Scopes::Country)),
457    (Scopes::Country, "set_state_religion", Scope(Scopes::Religion)),
458    (Scopes::State, "set_state_type", Choice(STATE_TYPES)),
459    (Scopes::Country, "set_strategy", Item(Item::AiStrategy)),
460    (Scopes::Building, "set_subsidized", Boolean),
461    (Scopes::PoliticalMovement, "set_suppression", Boolean),
462    (Scopes::JournalEntry, "set_target_technology", Scope(Scopes::Technology)),
463    (
464        Scopes::Country,
465        "set_tariffs_export_priority",
466        Removed("1.9", "replaced by world market system"),
467    ),
468    (
469        Scopes::Country,
470        "set_tariffs_import_priority",
471        Removed("1.9", "replaced by world market system"),
472    ),
473    (Scopes::Country, "set_tariffs_no_priority", Removed("1.9", "replaced by world market system")),
474    (Scopes::Country, "set_tax_level", Item(Item::Level)),
475    (Scopes::Country, "set_tension", Vb(validate_country_value)),
476    (Scopes::None, "set_variable", Vbv(validate_set_variable)),
477    (Scopes::DiplomaticPlay, "set_war", Boolean),
478    (Scopes::None, "show_as_tooltip", Control),
479    (Scopes::StateRegion, "spawn_entity_effect", Vb(validate_spawn_entity_effect)),
480    (Scopes::None, "sort_global_variable_list", Vb(validate_sort)),
481    (Scopes::None, "sort_local_variable_list", Vb(validate_sort)),
482    (Scopes::None, "sort_variable_list", Vb(validate_sort)),
483    (Scopes::State, "start_building_construction", Item(Item::BuildingType)),
484    (Scopes::StateRegion, "start_earthquake_effect", Yes),
485    (Scopes::Country, "start_enactment", Scope(Scopes::LawType)),
486    (Scopes::StateRegion, "start_harvest_condition", Item(Item::HarvestConditionType)),
487    (
488        Scopes::StateRegion,
489        "start_harvest_condition_with_params",
490        Vb(validate_start_harvest_condition),
491    ),
492    (Scopes::Country, "start_national_awakening", Vb(validate_national_awakening)),
493    (Scopes::State, "start_privately_funded_building_construction", Item(Item::BuildingType)),
494    (Scopes::Country, "start_research_random_technology", Yes),
495    (Scopes::None, "start_tutorial_lesson", Vb(validate_start_tutorial)),
496    (Scopes::None, "switch", Vb(validate_switch)),
497    (Scopes::Country, "take_on_scaled_debt", TargetValue("who", Scopes::Country, "value")),
498    (Scopes::MilitaryFormation, "teleport_to_front", Vbv(validate_teleport_to_front)),
499    (Scopes::Character, "transfer_character", Scope(Scopes::Country)),
500    (Scopes::Country, "transfer_subject", Scope(Scopes::Country)),
501    (Scopes::Character, "transfer_to_formation", Scope(Scopes::MilitaryFormation)),
502    (Scopes::None, "trigger_event", Vbv(validate_trigger_event)),
503    (Scopes::Country, "try_form_government_with", Vb(validate_form_government)),
504    (Scopes::Character, "unassign_from_formation", Yes),
505    (Scopes::State, "unset_available_for_autonomous_investment", Scope(Scopes::BuildingType)),
506    (Scopes::Country, "unset_only_legal_party", Yes),
507    (Scopes::Country, "update_party_support", Yes),
508    (Scopes::Country, "validate_subsidies", Boolean),
509    (Scopes::Country, "violate_sovereignty_join", Vb(validate_violate_sovereignty_join)),
510    (Scopes::None, "while", Control),
511    (Scopes::Treaty, "withdraw", Vb(validate_withdraw)),
512];