tiger-lib 1.18.0

Library used by the tools ck3-tiger, vic3-tiger, and imperator-tiger. This library holds the bulk of the code for them. It can be built either for ck3-tiger with the feature ck3, or for vic3-tiger with the feature vic3, or for imperator-tiger with the feature imperator, but not both at the same time.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
//! dynamic variables defined by the game engine

use std::sync::LazyLock;

use crate::helpers::{TigerHashMap, expand_scopes_hoi4};
use crate::item::Item;
use crate::scopes::Scopes;

/// A hashed version of [`VARIABLES`], for quick lookup by name.
pub static VARIABLES_MAP: LazyLock<TigerHashMap<&'static str, (Scopes, Scopes, Suffix)>> =
    LazyLock::new(|| {
        let mut hash = TigerHashMap::default();
        for (from, s, to, suffix) in VARIABLES.iter().copied() {
            let duplicate = hash.insert(s, (expand_scopes_hoi4(from), to, suffix)).is_some();
            assert!(!duplicate, "duplicate variable key {s}");
        }
        hash
    });

/// A hashed version of [`ARRAYS`], for quick lookup by name.
pub static ARRAYS_MAP: LazyLock<TigerHashMap<&'static str, (Scopes, Scopes, Suffix)>> =
    LazyLock::new(|| {
        let mut hash = TigerHashMap::default();
        for (from, s, to, suffix) in ARRAYS.iter().copied() {
            let duplicate = hash.insert(s, (expand_scopes_hoi4(from), to, suffix)).is_some();
            assert!(!duplicate, "duplicate variable key {s}");
        }
        hash
    });

/// What can be expected after `@` for this variable or array.
#[derive(Debug, Clone, Copy)]
pub enum Suffix {
    None,
    Scope(Scopes),
    Item(Item),
    OptionalChoice(&'static [&'static str]),
    Modif,
    ShipTypes,
}

// LAST UPDATED HOI4 VERSION 1.16.4
// See `documentation/dynamic_variables_documentation.md` from the game files.
const VARIABLES: &[(Scopes, &str, Scopes, Suffix)] = &[
    (Scopes::None, "date", Scopes::Value, Suffix::None),
    (Scopes::None, "difficulty", Scopes::Value, Suffix::None),
    (Scopes::None, "num_days", Scopes::Value, Suffix::None),
    (Scopes::None, "num_of_career_profile_points", Scopes::Value, Suffix::None),
    (Scopes::None, "pc_turn", Scopes::Value, Suffix::None),
    (Scopes::None, "power_balance_daily_change", Scopes::Value, Suffix::Item(Item::PowerBalance)),
    (
        Scopes::None.union(Scopes::Country),
        "power_balance_value",
        Scopes::Value,
        Suffix::Item(Item::PowerBalance),
    ),
    (Scopes::None, "power_balance_weekly_change", Scopes::Value, Suffix::Item(Item::PowerBalance)),
    (Scopes::None, "threat", Scopes::Value, Suffix::None),
    (Scopes::None, "year", Scopes::Value, Suffix::None),
    (Scopes::Country, "agency_upgrade_number", Scopes::Value, Suffix::None),
    (Scopes::Country, "ai_attitude_allied_weight", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (Scopes::Country, "ai_attitude_friendly_weight", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (Scopes::Country, "ai_attitude_hostile_weight", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (Scopes::Country, "ai_attitude_is_threatened", Scopes::Value, Suffix::None),
    (Scopes::Country, "ai_attitude_neutral_weight", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (Scopes::Country, "ai_attitude_outraged_weight", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (
        Scopes::Country,
        "ai_attitude_protective_weight",
        Scopes::Value,
        Suffix::Scope(Scopes::Country),
    ),
    (
        Scopes::Country,
        "ai_attitude_threatened_weight",
        Scopes::Value,
        Suffix::Scope(Scopes::Country),
    ),
    (Scopes::Country, "ai_attitude_wants_ally", Scopes::Value, Suffix::None),
    (Scopes::Country, "ai_attitude_wants_antagonize", Scopes::Value, Suffix::None),
    (Scopes::Country, "ai_attitude_wants_ignore", Scopes::Value, Suffix::None),
    (Scopes::Country, "ai_attitude_wants_protect", Scopes::Value, Suffix::None),
    (Scopes::Country, "ai_attitude_wants_weaken", Scopes::Value, Suffix::None),
    (Scopes::Country, "ai_irrationality", Scopes::Value, Suffix::None),
    (Scopes::Country, "ai_strategy_activate_crypto", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (Scopes::Country, "ai_strategy_alliance", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (Scopes::Country, "ai_strategy_antagonize", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (Scopes::Country, "ai_strategy_befriend", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (Scopes::Country, "ai_strategy_conquer", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (Scopes::Country, "ai_strategy_consider_weak", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (Scopes::Country, "ai_strategy_contain", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (Scopes::Country, "ai_strategy_declare_war", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (Scopes::Country, "ai_strategy_decrypt_target", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (
        Scopes::Country,
        "ai_strategy_dont_defend_ally_borders",
        Scopes::Value,
        Suffix::Scope(Scopes::Country),
    ),
    (
        Scopes::Country,
        "ai_strategy_force_defend_ally_borders",
        Scopes::Value,
        Suffix::Scope(Scopes::Country),
    ),
    (Scopes::Country, "ai_strategy_ignore", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (Scopes::Country, "ai_strategy_ignore_claim", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (Scopes::Country, "ai_strategy_influence", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (Scopes::Country, "ai_strategy_invade", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (
        Scopes::Country,
        "ai_strategy_occupation_policy",
        Scopes::Value,
        Suffix::Scope(Scopes::Country),
    ),
    (Scopes::Country, "ai_strategy_prepare_for_war", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (Scopes::Country, "ai_strategy_protect", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (
        Scopes::Country,
        "ai_strategy_send_volunteers_desire",
        Scopes::Value,
        Suffix::Scope(Scopes::Country),
    ),
    (Scopes::Country, "ai_strategy_support", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (Scopes::Country, "ai_wants_divisions", Scopes::Value, Suffix::None),
    (Scopes::Country, "air_chief", Scopes::Character, Suffix::None),
    (Scopes::Country, "air_experience", Scopes::Value, Suffix::None),
    (Scopes::Country, "air_intel", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (Scopes::Country, "alliance_naval_strength_ratio", Scopes::Value, Suffix::None),
    (Scopes::Country, "alliance_strength_ratio", Scopes::Value, Suffix::None),
    (Scopes::Country, "amount_manpower_in_deployment_queue", Scopes::Value, Suffix::None),
    (Scopes::Country, "amount_research_slots", Scopes::Value, Suffix::None),
    (Scopes::Country, "any_war_score", Scopes::Value, Suffix::None),
    (Scopes::Country, "army_chief", Scopes::Character, Suffix::None),
    (Scopes::Country, "army_experience", Scopes::Value, Suffix::None),
    (Scopes::Country, "army_intel", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (Scopes::Country, "autonomy_ratio", Scopes::Value, Suffix::None),
    (Scopes::Country, "capital", Scopes::State, Suffix::None),
    (Scopes::Country, "casualties", Scopes::Value, Suffix::None),
    (Scopes::Country, "casualties_k", Scopes::Value, Suffix::None),
    (Scopes::Country, "civilian_intel", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (Scopes::Country, "command_power", Scopes::Value, Suffix::None),
    (Scopes::Country, "command_power_daily", Scopes::Value, Suffix::None),
    (Scopes::Country, "compare_autonomy_progress_ratio", Scopes::Value, Suffix::None),
    (Scopes::Country, "convoy_threat", Scopes::Value, Suffix::None),
    (Scopes::Country, "core_compliance", Scopes::Value, Suffix::None),
    (Scopes::Country, "core_resistance", Scopes::Value, Suffix::None),
    (Scopes::Country, "country_leader", Scopes::Character, Suffix::None),
    (Scopes::Country, "cryptology_defense_level", Scopes::Value, Suffix::None),
    (Scopes::Country, "current_party_ideology_group", Scopes::Value, Suffix::None),
    (Scopes::Country, "days_decision_timeout", Scopes::Value, Suffix::Item(Item::Decision)),
    (Scopes::Country, "days_mission_timeout", Scopes::Value, Suffix::Item(Item::Decision)),
    (Scopes::Country, "days_since_capitulated", Scopes::Value, Suffix::None),
    (Scopes::Country, "decryption_progress", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (Scopes::Country, "decryption_speed", Scopes::Value, Suffix::None),
    (Scopes::Country, "deployed_airforce_manpower_k", Scopes::Value, Suffix::None),
    (Scopes::Country, "deployed_army_manpower_k", Scopes::Value, Suffix::None),
    (Scopes::Country, "deployed_navy_manpower_k", Scopes::Value, Suffix::None),
    (Scopes::Country, "deployed_total_manpower_k", Scopes::Value, Suffix::None),
    (Scopes::Country, "encryption_strength", Scopes::Value, Suffix::None),
    (Scopes::Country, "enemies_naval_strength_ratio", Scopes::Value, Suffix::None),
    (Scopes::Country, "enemies_strength_ratio", Scopes::Value, Suffix::None),
    (Scopes::Country, "faction_leader", Scopes::Country, Suffix::None),
    (Scopes::Country, "foreign_manpower", Scopes::Country, Suffix::None),
    (Scopes::Country, "fuel_k", Scopes::Value, Suffix::None),
    (Scopes::Country, "fuel_ratio", Scopes::Value, Suffix::None),
    (Scopes::Country, "garrison_manpower_need", Scopes::Value, Suffix::None),
    (Scopes::Country, "has_added_tension_amount", Scopes::Value, Suffix::None),
    (Scopes::Country, "has_collaboration", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (Scopes::Country, "has_convoys_war_support", Scopes::Value, Suffix::None),
    (Scopes::Country, "has_legitimacy", Scopes::Value, Suffix::None),
    (Scopes::Country, "has_manpower", Scopes::Value, Suffix::None),
    (Scopes::Country, "has_political_power", Scopes::Value, Suffix::None),
    (Scopes::Country, "has_stability", Scopes::Value, Suffix::None),
    (Scopes::Country, "has_war_support", Scopes::Value, Suffix::None),
    (
        Scopes::Country,
        "highest_party_ideology",
        Scopes::Value,
        Suffix::OptionalChoice(&["exclude_ruling_party"]),
    ),
    (
        Scopes::Country,
        "highest_party_popularity",
        Scopes::Value,
        Suffix::OptionalChoice(&["exclude_ruling_party"]),
    ),
    (Scopes::Country, "host", Scopes::Country, Suffix::None),
    (Scopes::Country, "land_doctrine_level", Scopes::Value, Suffix::None),
    (Scopes::Country, "legitimacy", Scopes::Value, Suffix::None),
    (Scopes::Country, "longest_war_length", Scopes::Value, Suffix::None),
    (Scopes::Country, "manpower", Scopes::Value, Suffix::None), // TODO: deprecated; warn
    (Scopes::Country, "manpower_k", Scopes::Value, Suffix::None),
    (Scopes::Country, "manpower_per_military_factory", Scopes::Value, Suffix::None),
    (Scopes::Country, "max_available_manpower", Scopes::Value, Suffix::None), // TODO: deprecated; warn
    (Scopes::Country, "max_available_manpower_k", Scopes::Value, Suffix::None),
    (Scopes::Country, "mine_threat", Scopes::Value, Suffix::None),
    (
        Scopes::Country.union(Scopes::State).union(Scopes::IndustrialOrg),
        "modifier",
        Scopes::Value.union(Scopes::Bool),
        Suffix::Modif,
    ),
    (Scopes::Country, "navy_chief", Scopes::Character, Suffix::None),
    (Scopes::Country, "navy_experience", Scopes::Value, Suffix::None),
    (Scopes::Country, "navy_intel", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (Scopes::Country, "network_national_coverage", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (Scopes::Country, "num_armies", Scopes::Value, Suffix::None),
    (Scopes::Country, "num_armies_in_state", Scopes::Value, Suffix::Scope(Scopes::State)),
    (Scopes::Country, "num_armies_with_type", Scopes::Value, Suffix::Item(Item::Equipment)),
    (Scopes::Country, "num_controlled_states", Scopes::Value, Suffix::None),
    (Scopes::Country, "num_core_states", Scopes::Value, Suffix::None),
    (Scopes::Country, "num_deployed_planes", Scopes::Value, Suffix::None),
    (
        Scopes::Country,
        "num_deployed_planes_with_type",
        Scopes::Value,
        Suffix::Item(Item::Equipment),
    ),
    (Scopes::Country, "num_divisions", Scopes::Value, Suffix::None),
    (
        Scopes::Country.union(Scopes::Character),
        "num_equipment",
        Scopes::Value,
        Suffix::Item(Item::Equipment),
    ),
    (Scopes::Country, "num_equipment_in_armies", Scopes::Value, Suffix::Item(Item::Equipment)),
    (Scopes::Country, "num_equipment_in_armies_k", Scopes::Value, Suffix::Item(Item::Equipment)),
    (Scopes::Country, "num_faction_members", Scopes::Value, Suffix::None),
    (Scopes::Country, "num_fake_intel_divisions", Scopes::Value, Suffix::None),
    (Scopes::Country, "num_free_operative_slots", Scopes::Value, Suffix::None),
    (Scopes::Country, "num_nukes_being_dropped", Scopes::Value, Suffix::None),
    (Scopes::Country, "num_nukes_left_to_drop", Scopes::Value, Suffix::None),
    (Scopes::Country, "num_occupied_states", Scopes::Value, Suffix::None),
    (Scopes::Country, "num_of_available_civilian_factories", Scopes::Value, Suffix::None),
    (Scopes::Country, "num_of_available_military_factories", Scopes::Value, Suffix::None),
    (Scopes::Country, "num_of_available_naval_factories", Scopes::Value, Suffix::None),
    (Scopes::Country, "num_of_civilian_factories", Scopes::Value, Suffix::None),
    (
        Scopes::Country,
        "num_of_civilian_factories_available_for_projects",
        Scopes::Value,
        Suffix::None,
    ),
    (
        Scopes::Country,
        "num_of_civilian_factories_in_cores",
        Scopes::Value,
        Suffix::Scope(Scopes::Country),
    ),
    (Scopes::Country, "num_of_controlled_factories", Scopes::Value, Suffix::None),
    (Scopes::Country, "num_of_controlled_states", Scopes::Value, Suffix::None),
    (Scopes::Country, "num_of_factories", Scopes::Value, Suffix::None),
    (Scopes::Country, "num_of_military_factories", Scopes::Value, Suffix::None),
    (
        Scopes::Country,
        "num_of_military_factories_in_cores",
        Scopes::Value,
        Suffix::Scope(Scopes::Country),
    ),
    (Scopes::Country, "num_of_naval_factories", Scopes::Value, Suffix::None),
    (
        Scopes::Country,
        "num_of_naval_factories_in_cores",
        Scopes::Value,
        Suffix::Scope(Scopes::Country),
    ),
    (Scopes::Country, "num_of_nukes", Scopes::Value, Suffix::None),
    (Scopes::Country, "num_of_operatives", Scopes::Value, Suffix::None),
    (Scopes::Country, "num_of_owned_factories", Scopes::Value, Suffix::None),
    (Scopes::Country, "num_of_supply_nodes", Scopes::Value, Suffix::None),
    (Scopes::Country, "num_operative_slots", Scopes::Value, Suffix::None),
    (Scopes::Country, "num_orders_groups", Scopes::Value, Suffix::None),
    (Scopes::Country, "num_owned_controlled_states", Scopes::Value, Suffix::None),
    (Scopes::Country, "num_owned_states", Scopes::Value, Suffix::None),
    (Scopes::Country, "num_researched_technologies", Scopes::Value, Suffix::None),
    (Scopes::Country.union(Scopes::Character), "num_ships", Scopes::Value, Suffix::None),
    (
        Scopes::Country.union(Scopes::Character),
        "num_ships_with_type",
        Scopes::Value,
        Suffix::ShipTypes,
    ),
    (Scopes::Country, "num_subjects", Scopes::Value, Suffix::None),
    (
        Scopes::Country,
        "num_target_equipment_in_armies",
        Scopes::Value,
        Suffix::Item(Item::Equipment),
    ),
    (
        Scopes::Country,
        "num_target_equipment_in_armies_k",
        Scopes::Value,
        Suffix::Item(Item::Equipment),
    ),
    (Scopes::Country, "num_tech_sharing_groups", Scopes::Value, Suffix::None),
    (Scopes::Country, "opinion", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (Scopes::Country, "original_research_slots", Scopes::Value, Suffix::Scope(Scopes::Country)),
    (Scopes::Country, "original_tag", Scopes::Country, Suffix::None),
    (Scopes::Country, "overlord", Scopes::Country, Suffix::None),
    (Scopes::Country, "party_popularity", Scopes::Value, Suffix::Item(Item::IdeologyGroup)),
    (Scopes::Country, "party_popularity_100", Scopes::Value, Suffix::Item(Item::IdeologyGroup)),
    (Scopes::Country, "pc_current_score", Scopes::Value, Suffix::None),
    (Scopes::Country, "pc_total_score", Scopes::Value, Suffix::None),
    (Scopes::Country, "political_power", Scopes::Value, Suffix::None),
    (Scopes::Country, "political_power_daily", Scopes::Value, Suffix::None),
    (Scopes::Country, "political_power_growth", Scopes::Value, Suffix::None),
    (Scopes::Country, "power_balance_daily", Scopes::Value, Suffix::None),
    (Scopes::Country, "power_balance_weekly", Scopes::Value, Suffix::None),
    (Scopes::Country.union(Scopes::State), "resource", Scopes::Value, Suffix::Item(Item::Resource)),
    (Scopes::Country, "resource_consumed", Scopes::Value, Suffix::Item(Item::Resource)),
    (Scopes::Country, "resource_exported", Scopes::Value, Suffix::Item(Item::Resource)),
    (Scopes::Country, "resource_imported", Scopes::Value, Suffix::Item(Item::Resource)),
    (Scopes::Country, "resource_produced", Scopes::Value, Suffix::Item(Item::Resource)),
    (Scopes::Country, "stability", Scopes::Value, Suffix::None),
    (Scopes::Country, "surrender_progress", Scopes::Value, Suffix::None),
    (Scopes::Country, "theorist", Scopes::Character, Suffix::None),
    // TODO: see if mods can add to this list of buildings
    (Scopes::Country, "total_constructed_air_base", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_constructed_anti_air", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_constructed_civilian_factory", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_constructed_dockyard", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_constructed_fuel_silo", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_constructed_gun_emplacement", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_constructed_infrastructure", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_constructed_land_fort", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_constructed_military_factory", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_constructed_naval_fort", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_constructed_nuclear_reactor", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_constructed_other", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_constructed_port", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_constructed_radar", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_constructed_refinery", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_constructed_rocket_site", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_constructed_supply_node", Scopes::Value, Suffix::None),
    // TODO: how is this used?
    (Scopes::Country, "total_equipment_produced_", Scopes::Value, Suffix::None),
    // TODO: see if mods can add to this list of equipment types
    (Scopes::Country, "total_equipment_produced_air_transport", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_amphibious", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_anti_air", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_anti_tank", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_armor", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_artillery", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_ballistic_missile", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_capital_ship", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_carrier", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_cas", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_convoy", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_emplacement_gun_ammo", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_fighter", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_flame", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_floating_harbor", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_heavy_fighter", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_infantry", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_interceptor", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_land_cruiser", Scopes::Value, Suffix::None),
    (
        Scopes::Country,
        "total_equipment_produced_maritime_patrol_plane",
        Scopes::Value,
        Suffix::None,
    ),
    (Scopes::Country, "total_equipment_produced_mechanized", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_missile", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_missile_launcher", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_motorized", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_naval_bomber", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_nuclear_missile", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_railway_gun", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_rocket", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_sam_missile", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_scout_plane", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_screen_ship", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_strategic_bomber", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_submarine", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_suicide", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_support", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_tactical_bomber", Scopes::Value, Suffix::None),
    (Scopes::Country, "total_equipment_produced_train", Scopes::Value, Suffix::None),
    (Scopes::State, "arms_factory_level", Scopes::Value, Suffix::None),
    (Scopes::State, "building_level", Scopes::Value, Suffix::Item(Item::Building)),
    (Scopes::State, "compliance", Scopes::Value, Suffix::None),
    (Scopes::State, "compliance_speed", Scopes::Value, Suffix::None),
    (Scopes::State, "controller", Scopes::Country, Suffix::None),
    (Scopes::State, "damaged_building_level", Scopes::Value, Suffix::Item(Item::Building)),
    (Scopes::State, "days_since_last_strategic_bombing", Scopes::Value, Suffix::None),
    (Scopes::State, "distance_to", Scopes::Value, Suffix::Scope(Scopes::State)),
    (Scopes::State, "industrial_complex_level", Scopes::Value, Suffix::None),
    (Scopes::State, "infrastructure_level", Scopes::Value, Suffix::None),
    (Scopes::State, "non_damaged_building_level", Scopes::Value, Suffix::Item(Item::Building)),
    (Scopes::State, "owner", Scopes::Country, Suffix::None),
    (Scopes::State, "resistance", Scopes::Value, Suffix::None),
    (Scopes::State, "resistance_target", Scopes::Value, Suffix::None),
    (Scopes::State, "state_and_terrain_strategic_value", Scopes::Value, Suffix::None),
    (Scopes::State, "state_population", Scopes::Value, Suffix::None),
    (Scopes::State, "state_population_k", Scopes::Value, Suffix::None),
    (Scopes::State, "state_strategic_value", Scopes::Value, Suffix::None),
    (Scopes::Character, "army_attack_level", Scopes::Value, Suffix::None),
    (Scopes::Character, "army_defense_level", Scopes::Value, Suffix::None),
    (Scopes::Character, "attack_level", Scopes::Value, Suffix::None),
    (Scopes::Character, "attack_skill_level", Scopes::Value, Suffix::None),
    (Scopes::Character, "average_stats", Scopes::Value, Suffix::None),
    (Scopes::Character, "avg_combat_status", Scopes::Value, Suffix::None),
    (Scopes::Character, "avg_defensive_combat_status", Scopes::Value, Suffix::None),
    (Scopes::Character, "avg_offensive_combat_status", Scopes::Value, Suffix::None),
    (Scopes::Character, "avg_unit_planning_ratio", Scopes::Value, Suffix::None),
    (Scopes::Character, "avg_units_acclimation", Scopes::Value, Suffix::None),
    (Scopes::Character, "coordination_level", Scopes::Value, Suffix::None),
    (Scopes::Character, "defense_level", Scopes::Value, Suffix::None),
    (Scopes::Character, "defense_skill_level", Scopes::Value, Suffix::None),
    (Scopes::Character, "has_orders_group", Scopes::Value, Suffix::None),
    (Scopes::Character, "intel_yield_factor_on_capture", Scopes::Value, Suffix::None),
    (Scopes::Character, "logistics_level", Scopes::Value, Suffix::None),
    (Scopes::Character, "logistics_skill_level", Scopes::Value, Suffix::None),
    (Scopes::Character, "maneuvering_level", Scopes::Value, Suffix::None),
    (Scopes::Character, "num_armored", Scopes::Value, Suffix::None),
    (Scopes::Character, "num_artillery", Scopes::Value, Suffix::None),
    (Scopes::Character, "num_assigned_traits", Scopes::Value, Suffix::None),
    (Scopes::Character, "num_basic_traits", Scopes::Value, Suffix::None),
    (Scopes::Character, "num_battalions", Scopes::Value, Suffix::None),
    (Scopes::Character, "num_battalions_with_type", Scopes::Value, Suffix::Item(Item::Equipment)),
    (Scopes::Character, "num_battle_plans", Scopes::Value, Suffix::None),
    (Scopes::Character, "num_cavalry", Scopes::Value, Suffix::None),
    (Scopes::Character, "num_infantry", Scopes::Value, Suffix::None),
    (Scopes::Character, "num_max_traits", Scopes::Value, Suffix::None),
    (Scopes::Character, "num_mechanized", Scopes::Value, Suffix::None),
    (Scopes::Character, "num_motorized", Scopes::Value, Suffix::None),
    (Scopes::Character, "num_personality_traits", Scopes::Value, Suffix::None),
    (Scopes::Character, "num_rocket", Scopes::Value, Suffix::None),
    (Scopes::Character, "num_special", Scopes::Value, Suffix::None),
    (Scopes::Character, "num_status_traits", Scopes::Value, Suffix::None),
    (Scopes::Character, "num_target_equipment", Scopes::Value, Suffix::Item(Item::Equipment)),
    (Scopes::Character, "num_terrain_traits", Scopes::Value, Suffix::None),
    (Scopes::Character, "num_traits", Scopes::Value, Suffix::None),
    (Scopes::Character, "num_units", Scopes::Value, Suffix::None),
    (Scopes::Character, "num_units_crossing_river", Scopes::Value, Suffix::None),
    (Scopes::Character, "num_units_defensive_combats", Scopes::Value, Suffix::None),
    (
        Scopes::Character,
        "num_units_defensive_combats_on",
        Scopes::Value,
        Suffix::Item(Item::Terrain),
    ),
    (Scopes::Character, "num_units_in_combat", Scopes::Value, Suffix::None),
    (Scopes::Character, "num_units_in_state", Scopes::Value, Suffix::Scope(Scopes::State)),
    (Scopes::Character, "num_units_offensive_combats", Scopes::Value, Suffix::None),
    (
        Scopes::Character,
        "num_units_offensive_combats_against",
        Scopes::Value,
        Suffix::Item(Item::Terrain),
    ),
    (Scopes::Character, "num_units_on_climate", Scopes::Value, Suffix::Item(Item::Acclimatation)),
    (Scopes::Character, "num_units_with_type", Scopes::Value, Suffix::Item(Item::Equipment)),
    (Scopes::Character, "operation_country", Scopes::Country.union(Scopes::Value), Suffix::None),
    (Scopes::Character, "operation_state", Scopes::State.union(Scopes::Value), Suffix::None),
    (Scopes::Character, "operation_type", Scopes::Value, Suffix::None),
    (Scopes::Character, "operative_captor", Scopes::Country, Suffix::None),
    (Scopes::Character, "own_capture_chance_factor", Scopes::Value, Suffix::None),
    (Scopes::Character, "own_forced_into_hiding_time_factor", Scopes::Value, Suffix::None),
    (Scopes::Character, "own_harmed_time_factor", Scopes::Value, Suffix::None),
    (Scopes::Character, "planning_level", Scopes::Value, Suffix::None),
    (Scopes::Character, "planning_skill_level", Scopes::Value, Suffix::None),
    (Scopes::Character, "skill", Scopes::Value, Suffix::None),
    (Scopes::Character, "skill_level", Scopes::Value, Suffix::None),
    (
        Scopes::Character,
        "sum_unit_terrain_modifier",
        Scopes::Value.union(Scopes::Bool),
        Suffix::Modif,
    ),
    (Scopes::Character, "unit_modifier", Scopes::Value.union(Scopes::Bool), Suffix::Modif),
    (Scopes::Character, "unit_ratio_ready_for_plan", Scopes::Value, Suffix::None),
    (Scopes::IndustrialOrg, "funds", Scopes::Value, Suffix::None),
    (Scopes::IndustrialOrg, "max_task_capacity", Scopes::Value, Suffix::None),
    (Scopes::IndustrialOrg, "number_of_currently_assigned_tasks", Scopes::Value, Suffix::None),
    (Scopes::IndustrialOrg, "number_of_unlocked_traits", Scopes::Value, Suffix::None),
    (Scopes::IndustrialOrg, "number_of_unused_trait_points", Scopes::Value, Suffix::None),
    (Scopes::IndustrialOrg, "research_bonus", Scopes::Value, Suffix::None),
    (Scopes::IndustrialOrg, "size", Scopes::Value, Suffix::None),
    (Scopes::SpecialProject, "facility_province_id", Scopes::Value, Suffix::None),
    (Scopes::SpecialProject, "facility_state", Scopes::State, Suffix::None),
    (Scopes::SpecialProject, "scientist", Scopes::Character, Suffix::None),
];

// LAST UPDATED HOI4 VERSION 1.16.4
// See `documentation/dynamic_variables_documentation.md` from the game files.
const ARRAYS: &[(Scopes, &str, Scopes, Suffix)] = &[
    (Scopes::None, "countries", Scopes::Country, Suffix::None),
    (Scopes::None, "ideology_groups", Scopes::Value, Suffix::None),
    (Scopes::None, "majors", Scopes::Country, Suffix::None),
    (Scopes::None, "operations", Scopes::Value, Suffix::None),
    (Scopes::None, "province_controllers", Scopes::Country, Suffix::None),
    (Scopes::None, "states", Scopes::Country, Suffix::None),
    (Scopes::None, "technology", Scopes::Value, Suffix::None),
    (Scopes::Country, "allies", Scopes::Country, Suffix::None),
    (Scopes::Country, "army_leaders", Scopes::Character, Suffix::None),
    (Scopes::Country, "controlled_states", Scopes::State, Suffix::None),
    (Scopes::Country, "core_states", Scopes::State, Suffix::None),
    (Scopes::Country, "enemies", Scopes::Country, Suffix::None),
    (Scopes::Country, "enemies_of_allies", Scopes::Country, Suffix::None),
    (Scopes::Country, "exiles", Scopes::Country, Suffix::None),
    (Scopes::Country, "faction_members", Scopes::Country, Suffix::None),
    (Scopes::Country, "high_command", Scopes::Character, Suffix::None),
    (Scopes::Country, "navy_leaders", Scopes::Character, Suffix::None),
    (Scopes::Country, "neighbors", Scopes::Country, Suffix::None),
    (Scopes::Country, "neighbors_owned", Scopes::Country, Suffix::None),
    (Scopes::Country, "occupied_countries", Scopes::Country, Suffix::None),
    (Scopes::Country, "operatives", Scopes::Character, Suffix::None),
    (Scopes::Country, "owned_controlled_states", Scopes::State, Suffix::None),
    (Scopes::Country, "owned_states", Scopes::State, Suffix::None),
    (Scopes::Country, "political_advisor", Scopes::Character, Suffix::None),
    (Scopes::Country, "potential_and_current_enemies", Scopes::Country, Suffix::None),
    (Scopes::Country, "researched_techs", Scopes::Value, Suffix::None),
    (Scopes::Country, "subjects", Scopes::Country, Suffix::None),
    (Scopes::State, "core_countries", Scopes::Country, Suffix::None),
];