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    (
101        Scopes::Country
102            .union(Scopes::Building)
103            .union(Scopes::Character)
104            .union(Scopes::Institution)
105            .union(Scopes::InterestGroup)
106            .union(Scopes::JournalEntry)
107            .union(Scopes::PoliticalMovement)
108            .union(Scopes::PowerBloc)
109            .union(Scopes::State),
110        "add_modifier",
111        Vbv(validate_add_modifier),
112    ),
113    (Scopes::Party, "add_momentum", ScriptValue),
114    (Scopes::NewCombatUnit, "add_morale", ScriptValue),
115    (Scopes::MilitaryFormation, "add_organization", ScriptValue), // not used in vanilla
116    (Scopes::Company, "add_owned_country", Scope(Scopes::Country)),
117    (Scopes::StateRegion, "add_pollution", ScriptValue),
118    (Scopes::Pop, "add_pop_wealth", Vb(validate_pop_wealth)),
119    (Scopes::Country, "add_primary_culture", Scope(Scopes::Culture)),
120    (Scopes::PowerBloc, "add_principle", Item(Item::Principle)),
121    (Scopes::JournalEntry, "add_progress", Vb(validate_progress)),
122    (Scopes::Country, "add_radicals", Vb(validate_add_loyalists)),
123    (Scopes::State, "add_radicals_in_state", Vb(validate_add_loyalists)),
124    (Scopes::Character, "add_random_trait", Choice(&["personality", "skill", "condition"])),
125    (
126        Scopes::State,
127        "add_religion_standard_of_living_modifier",
128        Vb(validate_add_religion_sol_modifier),
129    ),
130    (Scopes::State.union(Scopes::StateRegion), "add_resource_potential", Item(Item::BuildingType)),
131    (Scopes::InterestGroup, "add_ruling_interest_group", Boolean),
132    (Scopes::StateRegion, "add_state_trait", Item(Item::StateTrait)),
133    (Scopes::Country, "add_supply_ships", ScriptValue),
134    (Scopes::DiplomaticPlay, "add_target_backers", Vb(validate_addremove_backers)),
135    (Scopes::Country, "add_taxed_goods", Scope(Scopes::Goods)),
136    (Scopes::Country, "add_technology_progress", Vb(validate_add_technology_progress)),
137    (Scopes::Country, "add_technology_researched", Item(Item::Technology)),
138    (Scopes::None, "add_to_global_variable_list", Vb(validate_add_to_variable_list)),
139    (Scopes::all(), "add_to_list", Vbv(validate_add_to_list)),
140    (Scopes::None, "add_to_local_variable_list", Vb(validate_add_to_variable_list)),
141    (Scopes::all(), "add_to_temporary_list", Vbv(validate_add_to_list)),
142    (Scopes::None, "add_to_variable_list", Vb(validate_add_to_variable_list)),
143    (Scopes::Culture, "add_tradition_trait", Item(Item::TraditionTrait)),
144    (Scopes::Character, "add_trait", Item(Item::CharacterTrait)),
145    (Scopes::Country, "add_treasury", ScriptValue),
146    (Scopes::War, "add_war_exhaustion", TargetValue("target", Scopes::Country, "value")),
147    (Scopes::DiplomaticPlay, "add_war_goal", Vb(validate_add_war_goal)),
148    (Scopes::War, "add_war_war_support", TargetValue("target", Scopes::Country, "value")),
149    (Scopes::Country, "annex", Scope(Scopes::Country)),
150    (Scopes::Country, "annex_as_civil_war", Scope(Scopes::Country)),
151    (Scopes::Country, "annex_with_incorporation", Scope(Scopes::Country)),
152    (Scopes::None, "assert_if", Unchecked),
153    (Scopes::None, "assert_read", Unchecked),
154    (Scopes::Country, "call_election", Vb(validate_call_election)),
155    (Scopes::Country, "cancel_enactment", Yes),
156    // Documentation says scope is None but describes scope as Law
157    (Scopes::Law, "cancel_imposition", Yes),
158    (Scopes::State, "cede_treaty_port", Scope(Scopes::Country)),
159    (Scopes::PoliticalLobby, "change_appeasement", Vb(validate_change_appeasement)),
160    (Scopes::Character, "change_character_culture", Scope(Scopes::Culture)),
161    (Scopes::Character, "change_character_religion", Scope(Scopes::Religion)),
162    (Scopes::None, "change_global_variable", Vb(validate_change_variable)),
163    (Scopes::None, "change_infamy", ScriptValue),
164    (
165        Scopes::Country,
166        "change_institution_investment_level",
167        Vb(validate_change_institution_investment_level),
168    ),
169    (Scopes::None, "change_local_variable", Vb(validate_change_variable)),
170    (Scopes::Pop, "change_pop_culture", TargetValue("target", Scopes::Culture, "value")),
171    (Scopes::Pop, "change_pop_religion", TargetValue("target", Scopes::Religion, "value")),
172    (Scopes::Pop, "change_poptype", Scope(Scopes::PopType)),
173    (Scopes::Country, "change_relations", Vb(validate_country_value)),
174    (
175        Scopes::State.union(Scopes::StateRegion),
176        "change_resource_potential",
177        ItemValue("type", Item::BuildingType, "amount"),
178    ),
179    (Scopes::Country, "change_subject_type", Item(Item::SubjectType)),
180    (Scopes::Country, "change_tag", Item(Item::Country)),
181    (Scopes::Country, "change_tension", Vb(validate_country_value)),
182    (Scopes::None, "change_variable", Vb(validate_change_variable)),
183    (Scopes::None, "clamp_global_variable", Vb(validate_clamp_variable)),
184    (Scopes::None, "clamp_local_variable", Vb(validate_clamp_variable)),
185    (Scopes::None, "clamp_variable", Vb(validate_clamp_variable)),
186    (Scopes::Country, "clear_debt", Boolean),
187    (Scopes::Country, "clear_enactment_modifier", Yes),
188    (Scopes::None, "clear_global_variable_list", Identifier("list name")),
189    (Scopes::None, "clear_local_variable_list", Identifier("list name")),
190    (Scopes::Country, "clear_ownership_transfer_fleet", Yes),
191    (Scopes::None, "clear_saved_scope", Identifier("scope name")),
192    (Scopes::Country, "clear_scaled_debt", ScriptValue),
193    (Scopes::None, "clear_variable_list", Identifier("list name")),
194    (Scopes::Country, "complete_objective_subgoal", Item(Item::ObjectiveSubgoal)),
195    (Scopes::State, "convert_population", TargetValue("target", Scopes::Religion, "value")),
196    (Scopes::Country, "copy_laws", Scope(Scopes::Country)),
197    (Scopes::Country, "create_bidirectional_truce", Vb(validate_create_truce)),
198    (Scopes::State, "create_building", Vb(validate_create_building)),
199    (Scopes::Country, "create_character", Vb(validate_create_character)),
200    (Scopes::None, "create_country", Vb(validate_create_country)),
201    (Scopes::Country, "create_diplomatic_catalyst", Vb(validate_create_catalyst)),
202    (Scopes::Country, "create_diplomatic_pact", Vb(validate_diplomatic_pact)),
203    (Scopes::Country, "create_diplomatic_play", Vb(validate_create_diplomatic_play)),
204    (Scopes::None, "create_dynamic_country", Vb(validate_create_dynamic_country)),
205    (Scopes::Country, "create_incident", Vb(validate_country_value)),
206    (Scopes::State, "create_mass_migration", Vb(validate_create_mass_migration)),
207    (Scopes::Country, "create_military_formation", Vb(validate_create_military_formation)),
208    (Scopes::Country, "create_political_lobby", Vb(validate_create_lobby)),
209    (Scopes::Country, "create_political_movement", Vb(validate_create_movement)),
210    (Scopes::State, "create_pop", Vb(validate_create_pop)),
211    (Scopes::Country, "create_power_bloc", Vb(validate_create_power_bloc)),
212    (Scopes::Country, "create_ship", Vb(validate_create_ship)),
213    (Scopes::StateRegion, "create_state", Vb(validate_create_state)),
214    (Scopes::Country, "create_trade_route", Removed("1.9", "replaced with world trade system")),
215    (Scopes::None, "create_treaty", Vb(validate_create_treaty)),
216    (
217        Scopes::Country,
218        "create_truce",
219        Removed("1.7", "replaced with create_bidirectional_truce and create_unidirectional_truce"),
220    ),
221    (Scopes::Country, "create_unidirectional_truce", Vb(validate_create_truce)),
222    (Scopes::None, "custom_description", Control),
223    (Scopes::None, "custom_description_no_bullet", Control),
224    (Scopes::None, "custom_label", ControlOrLabel),
225    (Scopes::None, "custom_label_no_bullet", ControlOrLabel),
226    (Scopes::None, "custom_tooltip", ControlOrLabel),
227    (Scopes::None, "custom_tooltip_no_bullet", ControlOrLabel),
228    (Scopes::Ship, "damage_ship_hull", ScriptValue),
229    (Scopes::Ship, "damage_ship_hull_percent", ScriptValue),
230    (Scopes::State, "deactivate_building", Vb(validate_activate_building)),
231    (Scopes::Country, "deactivate_law", Scope(Scopes::LawType)),
232    (Scopes::Country, "deactivate_parties", Yes),
233    (Scopes::None, "debug_log", UncheckedTodo),
234    (Scopes::None, "debug_log_scopes", Boolean),
235    (Scopes::Country, "decrease_autonomy", Yes),
236    (Scopes::Character, "demobilize", Removed("1.6", "")),
237    (Scopes::MilitaryFormation, "deploy_to_front", Vbv(validate_teleport_to_front)),
238    (Scopes::Country, "disable_temporary_hostilities", Vb(validate_temporary_hostilities)),
239    (Scopes::Party, "disband_party", Yes),
240    (Scopes::PoliticalLobby, "disband_political_lobby", Yes),
241    (Scopes::Character, "disinherit_character", Yes),
242    (Scopes::None, "else", Control),
243    (Scopes::None, "else_if", Control),
244    (Scopes::Country, "enable_temporary_hostilities", Vb(validate_temporary_hostilities)),
245    (Scopes::Country, "end_national_awakening", Scope(Scopes::Culture)),
246    (Scopes::DiplomaticPlay, "end_play", Boolean),
247    (Scopes::Country, "end_truce", Scope(Scopes::Country)),
248    (Scopes::None, "error_log", UncheckedTodo),
249    (Scopes::None, "execute_event_option", Vb(validate_execute_event_option)),
250    (Scopes::Character, "exile_character", Yes),
251    (Scopes::StateRegion, "finish_harvest_condition", Item(Item::HarvestConditionType)),
252    // docs say boolean
253    (Scopes::InterestGroup, "finish_negotiation", Item(Item::Localization)),
254    (Scopes::State, "force_resource_depletion", Item(Item::BuildingType)),
255    (Scopes::State, "force_resource_discovery", Item(Item::BuildingType)),
256    (Scopes::Character, "free_character_from_void", Boolean),
257    (Scopes::MilitaryFormation, "fully_mobilize_army", Yes),
258    (Scopes::None, "hidden_effect", Control),
259    (Scopes::None, "if", Control),
260    (Scopes::InterestGroup, "improve_stance", Integer),
261    (Scopes::Country, "increase_autonomy", Yes),
262    (Scopes::Country, "join_power_bloc", Scope(Scopes::Country)),
263    (Scopes::InterestGroup, "join_revolution", Boolean),
264    (Scopes::War, "join_war", Vb(validate_join_war)),
265    (Scopes::Character, "kill_character", Vbv(validate_kill_character)),
266    (Scopes::Ship, "kill_crew", ScriptValue),
267    (Scopes::Ship, "kill_crew_percent", ScriptValue),
268    (Scopes::Country, "kill_population", Vb(validate_kill_population)),
269    (Scopes::State, "kill_population_in_state", Vb(validate_kill_population)),
270    (Scopes::Country, "kill_population_percent", Vb(validate_kill_population)),
271    (Scopes::State, "kill_population_percent_in_state", Vb(validate_kill_population)),
272    (Scopes::Ship, "kill_ship", Boolean),
273    (Scopes::Country.union(Scopes::State), "liberate_slaves", Yes),
274    (Scopes::Country, "liberate_slaves_in_incorporated_states", Yes),
275    (Scopes::Country, "liberate_slaves_in_unincorporated_states", Yes),
276    (Scopes::None, "lock_trade_route", Removed("1.9", "replaced with world trade system")),
277    (Scopes::Country, "make_independent", Boolean),
278    (Scopes::MilitaryFormation, "mobilize_army", Yes),
279    (Scopes::Pop, "move_partial_pop", Vb(validate_move_partial_pop)),
280    (Scopes::Pop, "move_pop", Scope(Scopes::State)),
281    (Scopes::Character, "place_character_in_void", ScriptValue),
282    (Scopes::Country, "play_as", Scope(Scopes::Country)),
283    (Scopes::None, "post_audio_event", Vb(validate_audio_event)),
284    (Scopes::None, "post_notification", Vv(validate_post_notification)),
285    (Scopes::None, "post_proposal", Item(Item::ProposalType)),
286    (Scopes::None, "random", Control),
287    (Scopes::None, "random_list", Vbc(validate_random_list)),
288    (Scopes::None, "random_log_scopes", Boolean),
289    (Scopes::Country, "recalculate_pop_ig_support", Boolean),
290    (Scopes::Country, "regime_change", Scope(Scopes::Country)),
291    (Scopes::Country, "remove_active_objective_subgoal", Item(Item::ObjectiveSubgoal)),
292    (Scopes::Amendment, "remove_amendment", Boolean),
293    (Scopes::Character, "remove_as_interest_group_leader", Yes),
294    (Scopes::Country, "remove_banned_goods", Scope(Scopes::Goods)),
295    (Scopes::State, "remove_building", Item(Item::BuildingType)),
296    (Scopes::PoliticalMovement, "remove_character_ideology", Item(Item::Ideology)),
297    (Scopes::Character, "remove_character_role", Item(Item::CharacterRole)),
298    (Scopes::StateRegion, "remove_claim", Scope(Scopes::Country)),
299    (Scopes::Country, "remove_company", Scope(Scopes::CompanyType)),
300    (Scopes::Culture, "remove_cultural_obsession", Item(Item::Goods)),
301    (Scopes::Culture, "remove_cultural_taboo", Item(Item::Goods)),
302    (Scopes::Country, "remove_diplomatic_pact", Vb(validate_diplomatic_pact)),
303    (Scopes::Country, "remove_enactment_modifier", UncheckedTodo), // No examples in vanilla
304    (Scopes::StateGoods, "remove_exports", ScriptValue),
305    (Scopes::all_but_none(), "remove_from_list", Vv(validate_remove_from_list)),
306    (Scopes::None, "remove_global_variable", Identifier("variable name")),
307    (Scopes::StateRegion, "remove_homeland", Scope(Scopes::Culture)),
308    (Scopes::InterestGroup, "remove_ideology", Item(Item::Ideology)),
309    (Scopes::Party, "remove_ig_from_party", Scope(Scopes::InterestGroup)),
310    (Scopes::StateGoods, "remove_imports", ScriptValue),
311    (Scopes::DiplomaticPlay, "remove_initiator_backers", Vb(validate_addremove_backers)),
312    (Scopes::JournalEntry, "remove_involved_country", Scope(Scopes::Country)),
313    (Scopes::None, "remove_list_global_variable", Vb(validate_add_to_variable_list)),
314    (Scopes::None, "remove_list_local_variable", Vb(validate_add_to_variable_list)),
315    (Scopes::None, "remove_list_variable", Vb(validate_add_to_variable_list)),
316    (Scopes::PoliticalLobby, "remove_lobby_member", Scope(Scopes::InterestGroup)),
317    (Scopes::None, "remove_local_variable", Identifier("variable name")),
318    (
319        Scopes::Country
320            .union(Scopes::Building)
321            .union(Scopes::Character)
322            .union(Scopes::Institution)
323            .union(Scopes::InterestGroup)
324            .union(Scopes::JournalEntry)
325            .union(Scopes::PoliticalMovement)
326            .union(Scopes::PowerBloc)
327            .union(Scopes::State),
328        "remove_modifier",
329        Item(Item::Modifier),
330    ),
331    (Scopes::Country, "remove_monopoly", Scope(Scopes::BuildingType)),
332    (Scopes::Company, "remove_owned_country", Scope(Scopes::Country)),
333    (Scopes::Country, "remove_primary_culture", Scope(Scopes::Culture)),
334    (Scopes::PowerBloc, "remove_principle", Item(Item::Principle)),
335    (
336        Scopes::State.union(Scopes::StateRegion),
337        "remove_resource_potential",
338        Item(Item::BuildingType),
339    ),
340    (Scopes::InterestGroup, "remove_ruling_interest_group", Boolean),
341    (Scopes::StateRegion, "remove_state_trait", Item(Item::StateTrait)),
342    (Scopes::DiplomaticPlay, "remove_target_backers", Vb(validate_addremove_backers)),
343    (Scopes::Country, "remove_taxed_goods", Scope(Scopes::Goods)),
344    (Scopes::Culture, "remove_tradition_trait", Item(Item::TraditionTrait)),
345    (Scopes::Character, "remove_trait", Item(Item::CharacterTrait)),
346    (Scopes::None, "remove_variable", Identifier("variable name")),
347    (Scopes::DiplomaticPlay, "remove_war_goal", Vb(validate_remove_war_goal)),
348    (Scopes::Character, "replace_character_roles", Vb(validate_replace_character_roles)),
349    (Scopes::State, "reset_hub_names", Yes),
350    (Scopes::State, "reset_state_name", Yes),
351    (Scopes::DiplomaticPlay, "resolve_play_for", Scope(Scopes::Country)),
352    (Scopes::Character, "retire_character", Vbv(validate_kill_character)),
353    (Scopes::Character, "retire_character_if_should_be_culled", Vbv(validate_kill_character)),
354    (Scopes::None, "round_global_variable", Vb(validate_round_variable)),
355    (Scopes::None, "round_local_variable", Vb(validate_round_variable)),
356    (Scopes::None, "round_variable", Vb(validate_round_variable)),
357    (Scopes::all_but_none(), "save_scope_as", Vv(validate_save_scope)),
358    (Scopes::None, "save_scope_value_as", Vb(validate_save_scope_value)),
359    (Scopes::all_but_none(), "save_temporary_scope_as", Vv(validate_save_scope)),
360    (Scopes::None, "save_temporary_scope_value_as", Vb(validate_save_scope_value)),
361    (Scopes::Country, "seize_investment_pool", Boolean),
362    (Scopes::Character, "set_as_adult", Yes),
363    (Scopes::Ship, "set_as_flagship", Boolean),
364    (Scopes::Character, "set_as_interest_group_leader", Boolean),
365    (Scopes::State, "set_available_for_autonomous_investment", Scope(Scopes::BuildingType)),
366    (Scopes::JournalEntry, "set_bar_progress", Vb(validate_progress)),
367    (Scopes::PoliticalMovement, "set_bolstering", Boolean),
368    (Scopes::Country, "set_capital", Item(Item::StateRegion)),
369    (Scopes::Character, "set_career_length", Vb(validate_career_length)),
370    (Scopes::Character, "set_character_as_executive", Scope(Scopes::Company)),
371    (Scopes::Character, "set_character_as_ruler", Yes),
372    (
373        Scopes::Character,
374        "set_character_busy",
375        Removed("1.11", "replaced with set_character_busy_and_immortal"),
376    ),
377    (Scopes::Character, "set_character_busy_and_immortal", Boolean),
378    (Scopes::Character, "set_character_immortal", Boolean),
379    (Scopes::Character, "set_commander_rank", Integer),
380    (Scopes::Company, "set_company_establishment_date", Date),
381    (Scopes::Company, "set_company_state_region", Scope(Scopes::StateRegion)),
382    (Scopes::PoliticalMovement, "set_core_ideology", Item(Item::Ideology)),
383    (Scopes::Country, "set_country_type", Item(Item::CountryType)),
384    (Scopes::StateRegion.union(Scopes::State), "set_devastation", ScriptValue),
385    (Scopes::Country, "set_diplomats_expelled", Scope(Scopes::Country)),
386    (Scopes::Country, "set_electoral_confidence", ScriptValue),
387    (Scopes::Country, "set_export_tariff_level", Vb(validate_tariff_level)),
388    (Scopes::StateGoods, "set_exports", ScriptValue),
389    (Scopes::Culture, "set_fervor", ScriptValue),
390    (Scopes::Character, "set_first_name", Item(Item::Localization)),
391    (Scopes::None, "set_global_variable", Vbv(validate_set_variable)),
392    (Scopes::Country, "set_government_wage_level", Item(Item::Level)),
393    (Scopes::InterestGroup, "set_has_negotiated", Boolean),
394    (Scopes::Country, "set_heir", Scope(Scopes::Character)),
395    (Scopes::Character, "set_home_country", Scope(Scopes::Country)),
396    (Scopes::Character, "set_home_country_definition", Scope(Scopes::CountryDefinition)),
397    (Scopes::Character, "set_home_state", Scope(Scopes::State)),
398    (Scopes::State, "set_hub_name", Vb(validate_set_hub_name)),
399    // Not knowing the state at compile time means the localizations can't be checked.
400    (Scopes::State, "set_hub_names", UncheckedTodo),
401    (Scopes::Character, "set_ideology", Scope(Scopes::Ideology)),
402    (
403        Scopes::InterestGroup,
404        "set_ig_bolstering",
405        Removed("1.8", "see `set_bolstering` for political movements"),
406    ),
407    (
408        Scopes::InterestGroup,
409        "set_ig_suppression",
410        Removed("1.8", "see `set_suppression` for political movements"),
411    ),
412    (Scopes::InterestGroup, "set_ig_trait", Scope(Scopes::InterestGroupTrait)),
413    (Scopes::Country, "set_immune_to_revolutions", Boolean),
414    (Scopes::Country, "set_import_tariff_level", Vb(validate_tariff_level)),
415    (Scopes::StateGoods, "set_imports", ScriptValue),
416    (
417        Scopes::Country,
418        "set_institution_investment_level",
419        Vb(validate_set_institution_investment_level),
420    ),
421    (Scopes::Character, "set_interest_group", Scope(Scopes::InterestGroup)),
422    (Scopes::InterestGroup, "set_interest_group_name", Item(Item::Localization)),
423    (Scopes::Character, "set_is_noble", Boolean),
424    (Scopes::DiplomaticPlay, "set_key", Item(Item::Localization)),
425    (Scopes::Character, "set_last_name", Item(Item::Localization)),
426    (Scopes::None, "set_local_variable", Vbv(validate_set_variable)),
427    (Scopes::Country, "set_market_capital", Item(Item::StateRegion)),
428    (Scopes::Country, "set_military_wage_level", Item(Item::Level)),
429    (Scopes::Country, "set_mutual_secret_goal", Vb(validate_set_secret_goal)),
430    (Scopes::Culture, "set_name_format", Choice(&["first_last", "last_first"])),
431    (Scopes::Country, "set_next_election_date", Date),
432    (Scopes::Country, "set_only_legal_party_from_ig", Scope(Scopes::InterestGroup)),
433    (Scopes::Country, "set_owes_obligation_to", Vb(validate_owes_obligation)),
434    (Scopes::StateRegion, "set_owner_of_provinces", Vb(validate_owner_of_provinces)),
435    (Scopes::Pop, "set_pop_literacy", Vb(validate_pop_literacy)),
436    (Scopes::Pop, "set_pop_qualifications", UncheckedTodo), // No examples in vanilla
437    (Scopes::Pop, "set_pop_wealth", Vb(validate_pop_wealth)),
438    (Scopes::Country, "set_relations", Vb(validate_country_value)),
439    (Scopes::Country, "set_ruling_interest_groups", Vb(validate_ruling_ig)),
440    (Scopes::Party, "set_ruling_party", Yes),
441    (Scopes::Country, "set_secret_goal", Vb(validate_set_secret_goal)),
442    (Scopes::Ship, "set_ship_owner", Scope(Scopes::Country)),
443    (Scopes::Ship, "set_ship_owner_multiple", Scope(Scopes::Country)),
444    (Scopes::Country, "set_social_hierarchy", Item(Item::SocialHierarchy)),
445    (Scopes::State, "set_state_name", Item(Item::Localization)),
446    (Scopes::State, "set_state_owner", Scope(Scopes::Country)),
447    (Scopes::Country, "set_state_religion", Scope(Scopes::Religion)),
448    (Scopes::State, "set_state_type", Choice(STATE_TYPES)),
449    (Scopes::Country, "set_strategy", Item(Item::AiStrategy)),
450    (Scopes::Building, "set_subsidized", Boolean),
451    (Scopes::PoliticalMovement, "set_suppression", Boolean),
452    (Scopes::JournalEntry, "set_target_technology", Scope(Scopes::Technology)),
453    (
454        Scopes::Country,
455        "set_tariffs_export_priority",
456        Removed("1.9", "replaced by world market system"),
457    ),
458    (
459        Scopes::Country,
460        "set_tariffs_import_priority",
461        Removed("1.9", "replaced by world market system"),
462    ),
463    (Scopes::Country, "set_tariffs_no_priority", Removed("1.9", "replaced by world market system")),
464    (Scopes::Country, "set_tax_level", Item(Item::Level)),
465    (Scopes::Country, "set_tension", Vb(validate_country_value)),
466    (Scopes::None, "set_variable", Vbv(validate_set_variable)),
467    (Scopes::DiplomaticPlay, "set_war", Boolean),
468    (Scopes::None, "show_as_tooltip", Control),
469    (Scopes::StateRegion, "spawn_entity_effect", Vb(validate_spawn_entity_effect)),
470    (Scopes::None, "sort_global_variable_list", Vb(validate_sort)),
471    (Scopes::None, "sort_local_variable_list", Vb(validate_sort)),
472    (Scopes::None, "sort_variable_list", Vb(validate_sort)),
473    (Scopes::State, "start_building_construction", Item(Item::BuildingType)),
474    (Scopes::StateRegion, "start_earthquake_effect", Yes),
475    (Scopes::Country, "start_enactment", Scope(Scopes::LawType)),
476    (Scopes::StateRegion, "start_harvest_condition", Item(Item::HarvestConditionType)),
477    (
478        Scopes::StateRegion,
479        "start_harvest_condition_with_params",
480        Vb(validate_start_harvest_condition),
481    ),
482    (Scopes::Country, "start_national_awakening", Vb(validate_national_awakening)),
483    (Scopes::State, "start_privately_funded_building_construction", Item(Item::BuildingType)),
484    (Scopes::Country, "start_research_random_technology", Yes),
485    (Scopes::None, "start_tutorial_lesson", Vb(validate_start_tutorial)),
486    (Scopes::None, "switch", Vb(validate_switch)),
487    (Scopes::Country, "take_on_scaled_debt", TargetValue("who", Scopes::Country, "value")),
488    (Scopes::MilitaryFormation, "teleport_to_front", Vbv(validate_teleport_to_front)),
489    (Scopes::Character, "transfer_character", Scope(Scopes::Country)),
490    (Scopes::Country, "transfer_subject", Scope(Scopes::Country)),
491    (Scopes::Character, "transfer_to_formation", Scope(Scopes::MilitaryFormation)),
492    (Scopes::None, "trigger_event", Vbv(validate_trigger_event)),
493    (Scopes::Country, "try_form_government_with", Vb(validate_form_government)),
494    (Scopes::Character, "unassign_from_formation", Yes),
495    (Scopes::State, "unset_available_for_autonomous_investment", Scope(Scopes::BuildingType)),
496    (Scopes::Country, "unset_only_legal_party", Yes),
497    (Scopes::Country, "update_party_support", Yes),
498    (Scopes::Country, "validate_subsidies", Boolean),
499    (Scopes::Country, "violate_sovereignty_join", Vb(validate_violate_sovereignty_join)),
500    (Scopes::None, "while", Control),
501    (Scopes::Treaty, "withdraw", Vb(validate_withdraw)),
502];