Project Alice
Loading...
Searching...
No Matches
nations.hpp
Go to the documentation of this file.
1#pragma once
2#include "dcon_generated.hpp"
3#include "culture.hpp"
4#include "military.hpp"
5
6namespace sys {
7enum class crisis_state : uint32_t;
8}
9
10namespace nations {
11inline uint32_t tag_to_int(char first, char second, char third) {
12 return (uint32_t(first) << 16) | (uint32_t(second) << 8) | (uint32_t(third) << 0);
13}
14inline std::string int_to_tag(uint32_t v) {
15 char values[] = {char((v >> 16) & 0xFF), char((v >> 8) & 0xFF), char((v >> 0) & 0xFF)};
16 return std::string(values, values + 3);
17}
18
20 dcon::modifier_id linked_modifier;
21 dcon::trigger_key trigger_condition;
22};
23
25 int16_t chance; //0,2
26 dcon::national_event_id id; //2,2
27 dcon::trigger_key condition; //4,2
28 uint16_t padding = 0; //6,2
29};
31 int16_t chance; //0,2
32 dcon::national_event_id id; //2,2
33 dcon::trigger_key condition; //4,2
34 dcon::issue_id issue_group; //6,1
35 uint8_t padding = 0; //7,1
36};
38 int16_t chance; //0,2
39 dcon::provincial_event_id id; //2,2
40 dcon::trigger_key condition; //4,2
41 uint16_t padding = 0; //6,2
42};
43
44enum class focus_type : uint8_t {
45 unknown = 0,
46 rail_focus = 1,
52 //non-vanilla
53 policy_focus = 7,
54 tier_1_focus = 8,
55 tier_2_focus = 9,
56 tier_3_focus = 10,
57 tier_4_focus = 11,
58 tier_5_focus = 12,
59 tier_6_focus = 13,
60 tier_7_focus = 14,
61 tier_8_focus = 15,
62 building_focus = 16,
68};
69
71 std::vector<triggered_modifier> triggered_modifiers;
72 std::vector<dcon::bitfield_type> global_flag_variables;
73 std::vector<dcon::nation_id> nations_by_rank;
74
78
79 dcon::national_identity_id rebel_id;
80
81 dcon::modifier_id very_easy_player;
82 dcon::modifier_id easy_player;
83 dcon::modifier_id hard_player;
84 dcon::modifier_id very_hard_player;
85 dcon::modifier_id very_easy_ai;
86 dcon::modifier_id easy_ai;
87 dcon::modifier_id hard_ai;
88 dcon::modifier_id very_hard_ai;
89
90 // provincial
91 dcon::modifier_id overseas;
92 dcon::modifier_id coastal;
93 dcon::modifier_id non_coastal;
94 dcon::modifier_id coastal_sea;
95 dcon::modifier_id sea_zone;
96 dcon::modifier_id land_province;
97 dcon::modifier_id blockaded;
98 dcon::modifier_id no_adjacent_controlled;
99 dcon::modifier_id core;
100 dcon::modifier_id has_siege;
101 dcon::modifier_id occupied;
102 dcon::modifier_id nationalism;
103 dcon::modifier_id infrastructure;
104
105 // national
106 dcon::modifier_id base_values;
107 dcon::modifier_id war;
108 dcon::modifier_id peace;
109 dcon::modifier_id disarming;
110 dcon::modifier_id war_exhaustion;
111 dcon::modifier_id badboy;
112 dcon::modifier_id debt_default_to;
113 dcon::modifier_id bad_debter;
114 dcon::modifier_id great_power;
115 dcon::modifier_id second_power;
116 dcon::modifier_id civ_nation;
117 dcon::modifier_id unciv_nation;
118 dcon::modifier_id average_literacy;
119 dcon::modifier_id plurality;
120 dcon::modifier_id generalised_debt_default;
121 dcon::modifier_id total_occupation;
122 dcon::modifier_id total_blockaded;
123 dcon::modifier_id in_bankrupcy;
124
128
129 dcon::national_focus_id flashpoint_focus;
130 dcon::national_focus_id clergy_focus;
131 dcon::national_focus_id soldier_focus;
132 dcon::national_focus_id aristocrat_focus;
133 dcon::national_focus_id capitalist_focus;
134 dcon::national_focus_id primary_factory_worker_focus;
135 dcon::national_focus_id secondary_factory_worker_focus;
136
137 float flashpoint_amount = 0.15f;
138
139 std::vector<fixed_event> on_yearly_pulse;
140 std::vector<fixed_event> on_quarterly_pulse;
141 std::vector<fixed_province_event> on_battle_won;
142 std::vector<fixed_province_event> on_battle_lost;
143 std::vector<fixed_event> on_surrender;
144 std::vector<fixed_event> on_new_great_nation;
145 std::vector<fixed_event> on_lost_great_nation;
146 std::vector<fixed_election_event> on_election_tick;
147 std::vector<fixed_event> on_colony_to_state;
148 std::vector<fixed_event> on_state_conquest;
149 std::vector<fixed_event> on_colony_to_state_free_slaves;
150 std::vector<fixed_event> on_debtor_default;
151 std::vector<fixed_event> on_debtor_default_small;
152 std::vector<fixed_event> on_debtor_default_second;
153 std::vector<fixed_event> on_civilize;
154 std::vector<fixed_event> on_my_factories_nationalized;
155 std::vector<fixed_event> on_crisis_declare_interest;
156 std::vector<fixed_event> on_election_started;
157 std::vector<fixed_event> on_election_finished;
158
159 bool gc_pending = false;
160
161 bool is_global_flag_variable_set(dcon::global_flag_id id) const;
162 void set_global_flag_variable(dcon::global_flag_id id, bool state);
163};
164
165namespace influence {
166
167constexpr inline uint8_t level_mask = uint8_t(0x07);
168constexpr inline uint8_t level_neutral = uint8_t(0x00);
169constexpr inline uint8_t level_opposed = uint8_t(0x01);
170constexpr inline uint8_t level_hostile = uint8_t(0x02);
171constexpr inline uint8_t level_cordial = uint8_t(0x03);
172constexpr inline uint8_t level_friendly = uint8_t(0x04);
173constexpr inline uint8_t level_in_sphere = uint8_t(0x05);
174
175constexpr inline uint8_t priority_mask = uint8_t(0x18);
176constexpr inline uint8_t priority_zero = uint8_t(0x00);
177constexpr inline uint8_t priority_one = uint8_t(0x08);
178constexpr inline uint8_t priority_two = uint8_t(0x10);
179constexpr inline uint8_t priority_three = uint8_t(0x18);
180
181// constexpr inline uint8_t is_expelled = uint8_t(0x20); // <-- didn't need this; free bit
182constexpr inline uint8_t is_discredited = uint8_t(0x40);
183constexpr inline uint8_t is_banned = uint8_t(0x80);
184
186 switch(v & level_mask) {
187 case level_neutral:
188 return uint8_t((v & ~level_mask) | level_cordial);
189 case level_opposed:
190 return uint8_t((v & ~level_mask) | level_neutral);
191 case level_hostile:
192 return uint8_t((v & ~level_mask) | level_opposed);
193 case level_cordial:
194 return uint8_t((v & ~level_mask) | level_friendly);
195 case level_friendly:
196 return uint8_t((v & ~level_mask) | level_in_sphere);
197 case level_in_sphere:
198 return v;
199 default:
200 return v;
201 }
202}
204 switch(v & level_mask) {
205 case level_neutral:
206 return uint8_t((v & ~level_mask) | level_opposed);
207 case level_opposed:
208 return uint8_t((v & ~level_mask) | level_hostile);
209 case level_hostile:
210 return v;
211 case level_cordial:
212 return uint8_t((v & ~level_mask) | level_neutral);
213 case level_friendly:
214 return uint8_t((v & ~level_mask) | level_cordial);
215 case level_in_sphere:
216 return uint8_t((v & ~level_mask) | level_friendly);
217 default:
218 return v;
219 }
220}
222 if((v & priority_mask) != priority_three) {
223 return uint8_t(v + priority_one);
224 } else {
225 return v;
226 }
227}
229 if((v & priority_mask) != priority_zero) {
230 return uint8_t(v - priority_one);
231 } else {
232 return v;
233 }
234}
235inline bool is_influence_level_greater(int32_t l, int32_t r) {
236 switch(l) {
237 case level_hostile:
238 return false;
239 case level_opposed:
240 return r == level_hostile;
241 case level_neutral:
242 return r == level_hostile || r == level_opposed;
243 case level_cordial:
244 return r <= 2;
245 case level_friendly:
246 return r <= 3;
247 case level_in_sphere:
248 return r <= 4;
249 default:
250 return false;
251 }
252}
253inline bool is_influence_level_greater_or_equal(int32_t l, int32_t r) {
254 return l == r || is_influence_level_greater(l, r);
255}
256int32_t get_level(sys::state& state, dcon::nation_id gp, dcon::nation_id target);
257
258} // namespace influence
259
260std::vector<dcon::nation_id> nation_get_subjects(sys::state& state, dcon::nation_id n);
261
262dcon::nation_id get_nth_great_power(sys::state const& state, uint16_t n);
263
264dcon::nation_id owner_of_pop(sys::state const& state, dcon::pop_id pop_ids);
265
266bool can_release_as_vassal(sys::state const& state, dcon::nation_id n, dcon::national_identity_id releasable);
267bool identity_has_holder(sys::state const& state, dcon::national_identity_id ident);
268dcon::nation_id get_relationship_partner(sys::state const& state, dcon::diplomatic_relation_id rel_id, dcon::nation_id query);
269
277
278dcon::text_key name_from_tag(sys::state& state, dcon::national_identity_id tag);
279
281
282float priority_national(sys::state& state, dcon::nation_id n, dcon::factory_type_id ftid);
283float priority_private(sys::state& state, dcon::nation_id n, dcon::factory_type_id ftid);
284
285float daily_research_points(sys::state& state, dcon::nation_id n);
287
290void update_rankings(sys::state& state);
291void update_ui_rankings(sys::state& state);
292
293bool is_great_power(sys::state const& state, dcon::nation_id n);
294float prestige_score(sys::state const& state, dcon::nation_id n);
295
297status get_status(sys::state& state, dcon::nation_id n);
298
299sys::date get_research_end_date(sys::state& state, dcon::technology_id, dcon::nation_id);
300dcon::technology_id current_research(sys::state const& state, dcon::nation_id n);
301float suppression_points(sys::state const& state, dcon::nation_id n);
302
303float diplomatic_points(sys::state const& state, dcon::nation_id n);
304float monthly_diplomatic_points(sys::state const& state, dcon::nation_id n);
305
306float leadership_points(sys::state const& state, dcon::nation_id n);
307float get_treasury(sys::state& state, dcon::nation_id n);
308float get_bank_funds(sys::state& state, dcon::nation_id n);
309float get_debt(sys::state& state, dcon::nation_id n);
310float tariff_efficiency(sys::state& state, dcon::nation_id n);
311float tax_efficiency(sys::state& state, dcon::nation_id n);
312float colonial_points_from_naval_bases(sys::state& state, dcon::nation_id n);
313float colonial_points_from_ships(sys::state& state, dcon::nation_id n);
314float colonial_points_from_technology(sys::state& state, dcon::nation_id n);
315float used_colonial_points(sys::state& state, dcon::nation_id n);
316int32_t free_colonial_points(sys::state& state, dcon::nation_id n);
317int32_t max_colonial_points(sys::state& state, dcon::nation_id n);
319
320bool has_political_reform_available(sys::state& state, dcon::nation_id n);
321bool has_social_reform_available(sys::state& state, dcon::nation_id n);
322bool has_reform_available(sys::state& state, dcon::nation_id n);
323bool has_decision_available(sys::state& state, dcon::nation_id n);
324int32_t max_national_focuses(sys::state& state, dcon::nation_id n);
325int32_t national_focuses_in_use(sys::state& state, dcon::nation_id n);
326bool can_expand_colony(sys::state& state, dcon::nation_id n);
327bool is_losing_colonial_race(sys::state& state, dcon::nation_id n);
328bool sphereing_progress_is_possible(sys::state& state, dcon::nation_id n); // can increase opinion or add to sphere
329bool is_involved_in_crisis(sys::state const& state, dcon::nation_id n);
330bool is_committed_in_crisis(sys::state const& state, dcon::nation_id n);
331bool can_put_flashpoint_focus_in_state(sys::state& state, dcon::state_instance_id s, dcon::nation_id fp_nation);
332int64_t get_monthly_pop_increase_of_nation(sys::state& state, dcon::nation_id n);
333bool can_accumulate_influence_with(sys::state& state, dcon::nation_id gp, dcon::nation_id target, dcon::gp_relationship_id rel);
334bool are_allied(sys::state& state, dcon::nation_id a, dcon::nation_id b);
335bool is_landlocked(sys::state& state, dcon::nation_id n);
336
337void get_active_political_parties(sys::state& state, dcon::nation_id n, std::vector<dcon::political_party_id>& parties);
338
340
341// may create a relationship DO NOT call in a context where two or more such functions may run in parallel
342void adjust_relationship(sys::state& state, dcon::nation_id a, dcon::nation_id b, float delta);
343// used for creating a "new" nation when it is released
344void create_nation_based_on_template(sys::state& state, dcon::nation_id n, dcon::nation_id base);
345// call after a nation loses its last province
346void cleanup_nation(sys::state& state, dcon::nation_id n);
347
348void adjust_prestige(sys::state& state, dcon::nation_id n, float delta);
349void destroy_diplomatic_relationships(sys::state& state, dcon::nation_id n);
350void release_vassal(sys::state& state, dcon::overlord_id rel);
351void make_vassal(sys::state& state, dcon::nation_id subject, dcon::nation_id overlord);
352void make_substate(sys::state& state, dcon::nation_id subject, dcon::nation_id overlord);
353void break_alliance(sys::state& state, dcon::diplomatic_relation_id rel);
354void break_alliance(sys::state& state, dcon::nation_id a, dcon::nation_id b);
355void make_alliance(sys::state& state, dcon::nation_id a, dcon::nation_id b);
356void adjust_influence(sys::state& state, dcon::nation_id great_power, dcon::nation_id target, float delta);
357void adjust_influence_with_overflow(sys::state& state, dcon::nation_id great_power, dcon::nation_id target, float delta);
358void adjust_foreign_investment(sys::state& state, dcon::nation_id great_power, dcon::nation_id target, float delta);
359void enact_issue(sys::state& state, dcon::nation_id source, dcon::issue_option_id i);
360void enact_reform(sys::state& state, dcon::nation_id source, dcon::reform_option_id i);
361
362float get_foreign_investment(sys::state& state, dcon::nation_id n);
363float get_foreign_investment_as_gp(sys::state& state, dcon::nation_id n);
364float get_base_shares(sys::state& state, dcon::gp_relationship_id gp, float total_gain, int32_t total_influence_shares);
365bool has_sphere_neighbour(sys::state& state, dcon::nation_id n, dcon::nation_id target);
366
368void update_influence(sys::state& state);
369void update_revanchism(sys::state& state);
370
374void update_crisis(sys::state& state);
375void crisis_add_wargoal(std::vector<sys::full_wg>& list, sys::full_wg wg);
376
377void add_as_primary_crisis_defender(sys::state& state, dcon::nation_id n);
378void add_as_primary_crisis_attacker(sys::state& state, dcon::nation_id n);
379
380void ask_to_attack_in_crisis(sys::state& state, dcon::nation_id n);
381void ask_to_defend_in_crisis(sys::state & state, dcon::nation_id n);
382
384void cleanup_crisis(sys::state& state);
385void cleanup_crisis_peace_offer(sys::state& state, dcon::peace_offer_id peace);
386void accept_crisis_peace_offer(sys::state& state, dcon::nation_id from, dcon::nation_id to, dcon::peace_offer_id peace);
387
388void update_pop_acceptance(sys::state& state, dcon::nation_id n);
389void liberate_nation_from(sys::state& state, dcon::national_identity_id liberated, dcon::nation_id from);
390void release_nation_from(sys::state& state, dcon::national_identity_id liberated,
391 dcon::nation_id from); // difference from liberate: only non-cores can be lost with release
392void remove_cores_from_owned(sys::state& state, dcon::nation_id n, dcon::national_identity_id tag);
393void perform_nationalization(sys::state& state, dcon::nation_id n);
394
395float get_yesterday_income(sys::state& state, dcon::nation_id n);
396
397void make_civilized(sys::state& state, dcon::nation_id n);
398void make_uncivilized(sys::state& state, dcon::nation_id n);
399
400void run_gc(sys::state& state);
401
402} // namespace nations
constexpr uint8_t is_banned
Definition: nations.hpp:183
constexpr uint8_t level_friendly
Definition: nations.hpp:172
uint8_t decrease_level(uint8_t v)
Definition: nations.hpp:203
constexpr uint8_t is_discredited
Definition: nations.hpp:182
uint8_t decrease_priority(uint8_t v)
Definition: nations.hpp:228
constexpr uint8_t priority_zero
Definition: nations.hpp:176
constexpr uint8_t level_opposed
Definition: nations.hpp:169
constexpr uint8_t level_neutral
Definition: nations.hpp:168
constexpr uint8_t level_hostile
Definition: nations.hpp:170
constexpr uint8_t priority_three
Definition: nations.hpp:179
uint8_t increase_level(uint8_t v)
Definition: nations.hpp:185
constexpr uint8_t priority_mask
Definition: nations.hpp:175
constexpr uint8_t priority_one
Definition: nations.hpp:177
constexpr uint8_t level_in_sphere
Definition: nations.hpp:173
constexpr uint8_t level_mask
Definition: nations.hpp:167
int32_t get_level(sys::state &state, dcon::nation_id gp, dcon::nation_id target)
Definition: nations.cpp:25
uint8_t increase_priority(uint8_t v)
Definition: nations.hpp:221
constexpr uint8_t priority_two
Definition: nations.hpp:178
bool is_influence_level_greater_or_equal(int32_t l, int32_t r)
Definition: nations.hpp:253
bool is_influence_level_greater(int32_t l, int32_t r)
Definition: nations.hpp:235
constexpr uint8_t level_cordial
Definition: nations.hpp:171
void remove_cores_from_owned(sys::state &state, dcon::nation_id n, dcon::national_identity_id tag)
Definition: nations.cpp:3110
void cleanup_crisis_peace_offer(sys::state &state, dcon::peace_offer_id peace)
Definition: nations.cpp:2597
float colonial_points_from_naval_bases(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1239
void make_uncivilized(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:3325
status get_status(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1145
void accept_crisis_peace_offer(sys::state &state, dcon::nation_id from, dcon::nation_id to, dcon::peace_offer_id peace)
Definition: nations.cpp:2605
bool is_great_power(sys::state const &state, dcon::nation_id id)
Definition: nations.cpp:1068
void enact_reform(sys::state &state, dcon::nation_id source, dcon::reform_option_id r)
Definition: nations.cpp:3350
int32_t free_colonial_points(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1304
void break_alliance(sys::state &state, dcon::diplomatic_relation_id rel)
Definition: nations.cpp:2012
std::string int_to_tag(uint32_t v)
Definition: nations.hpp:14
bool is_losing_colonial_race(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1339
void run_gc(sys::state &state)
Definition: nations.cpp:1790
bool can_release_as_vassal(sys::state const &state, dcon::nation_id n, dcon::national_identity_id releasable)
Definition: nations.cpp:663
void adjust_prestige(sys::state &state, dcon::nation_id n, float delta)
Definition: nations.cpp:1900
bool has_political_reform_available(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1370
void destroy_diplomatic_relationships(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1918
void restore_unsaved_values(sys::state &state)
Definition: nations.cpp:134
bool is_committed_in_crisis(sys::state const &state, dcon::nation_id n)
Definition: nations.cpp:1646
void daily_update_flashpoint_tension(sys::state &state)
Definition: nations.cpp:2343
void crisis_state_transition(sys::state &state, sys::crisis_state new_state)
Definition: nations.cpp:2613
bool is_involved_in_crisis(sys::state const &state, dcon::nation_id n)
Definition: nations.cpp:1632
float get_foreign_investment(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:884
void monthly_flashpoint_update(sys::state &state)
Definition: nations.cpp:2266
bool identity_has_holder(sys::state const &state, dcon::national_identity_id ident)
Definition: nations.cpp:680
void make_vassal(sys::state &state, dcon::nation_id subject, dcon::nation_id overlord)
Definition: nations.cpp:1963
void update_administrative_efficiency(sys::state &state)
Definition: nations.cpp:718
void release_vassal(sys::state &state, dcon::overlord_id rel)
Definition: nations.cpp:1948
bool are_allied(sys::state &state, dcon::nation_id a, dcon::nation_id b)
Definition: nations.cpp:685
void reject_crisis_participation(sys::state &state)
Definition: nations.cpp:2536
focus_type
Definition: nations.hpp:44
void release_nation_from(sys::state &state, dcon::national_identity_id liberated, dcon::nation_id from)
Definition: nations.cpp:3086
void update_pop_acceptance(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:3043
void get_active_political_parties(sys::state &state, dcon::nation_id n, std::vector< dcon::political_party_id > &parties)
Definition: nations.cpp:1457
float tariff_efficiency(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1620
void ask_to_attack_in_crisis(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:2523
void make_alliance(sys::state &state, dcon::nation_id a, dcon::nation_id b)
Definition: nations.cpp:2037
void crisis_add_wargoal(std::vector< sys::full_wg > &list, sys::full_wg wg)
Definition: nations.cpp:2430
void adjust_foreign_investment(sys::state &state, dcon::nation_id great_power, dcon::nation_id target, float delta)
Definition: nations.cpp:3195
void adjust_influence_with_overflow(sys::state &state, dcon::nation_id great_power, dcon::nation_id target, float delta)
Definition: nations.cpp:3141
float used_colonial_points(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1282
float get_base_shares(sys::state &state, dcon::gp_relationship_id gp, float total_gain, int32_t total_influence_shares)
Definition: nations.cpp:2083
bool has_sphere_neighbour(sys::state &state, dcon::nation_id n, dcon::nation_id target)
Definition: nations.cpp:2099
bool can_expand_colony(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1324
void liberate_nation_from(sys::state &state, dcon::national_identity_id liberated, dcon::nation_id from)
Definition: nations.cpp:3062
void adjust_influence(sys::state &state, dcon::nation_id great_power, dcon::nation_id target, float delta)
Definition: nations.cpp:3129
bool can_put_flashpoint_focus_in_state(sys::state &state, dcon::state_instance_id s, dcon::nation_id fp_nation)
Definition: nations.cpp:2237
void enact_issue(sys::state &state, dcon::nation_id source, dcon::issue_option_id i)
Definition: nations.cpp:3395
float diplomatic_points(sys::state const &state, dcon::nation_id n)
Definition: nations.cpp:1210
void update_influence(sys::state &state)
Definition: nations.cpp:2109
bool has_social_reform_available(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1382
void update_military_scores(sys::state &state)
Definition: nations.cpp:935
float get_debt(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1615
float suppression_points(sys::state const &state, dcon::nation_id n)
Definition: nations.cpp:1175
float get_yesterday_income(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:3204
void add_as_primary_crisis_defender(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:2482
void cleanup_nation(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1811
void ask_to_defend_in_crisis(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:2510
dcon::nation_id get_nth_great_power(sys::state const &state, uint16_t n)
Definition: nations.cpp:75
bool is_landlocked(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:690
void update_monthly_points(sys::state &state)
Definition: nations.cpp:1508
float prestige_score(sys::state const &state, dcon::nation_id n)
Definition: nations.cpp:961
void add_as_primary_crisis_attacker(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:2496
float colonial_points_from_technology(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1273
void generate_initial_state_instances(sys::state &state)
Definition: nations.cpp:626
void update_cached_values(sys::state &state)
Definition: nations.cpp:127
void make_substate(sys::state &state, dcon::nation_id subject, dcon::nation_id overlord)
Definition: nations.cpp:1986
float leadership_points(sys::state const &state, dcon::nation_id n)
Definition: nations.cpp:1179
float monthly_diplomatic_points(sys::state const &state, dcon::nation_id n)
Definition: nations.cpp:1214
float daily_research_points(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:741
bool has_decision_available(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1441
dcon::nation_id get_relationship_partner(sys::state const &state, dcon::diplomatic_relation_id rel_id, dcon::nation_id query)
Definition: nations.cpp:694
void make_civilized(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:3218
float get_bank_funds(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1611
uint32_t get_total_pop_in_owned_provinces(sys::state &state, dcon::nation_id n)
dcon::text_key name_from_tag(sys::state &state, dcon::national_identity_id tag)
Definition: nations.cpp:710
void update_revanchism(sys::state &state)
Definition: nations.cpp:1478
void adjust_relationship(sys::state &state, dcon::nation_id a, dcon::nation_id b, float delta)
Definition: nations.cpp:1660
float priority_national(sys::state &state, dcon::nation_id n, dcon::factory_type_id ftid)
Definition: nations.cpp:766
int64_t get_monthly_pop_increase_of_nation(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:56
bool sphereing_progress_is_possible(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1350
sys::date get_research_end_date(sys::state &state, dcon::technology_id tech_id, dcon::nation_id n)
Definition: nations.cpp:1164
uint32_t tag_to_int(char first, char second, char third)
Definition: nations.hpp:11
void create_nation_based_on_template(sys::state &state, dcon::nation_id n, dcon::nation_id base)
Definition: nations.cpp:1672
void update_industrial_scores(sys::state &state)
Definition: nations.cpp:900
void update_research_points(sys::state &state)
Definition: nations.cpp:796
void perform_nationalization(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:3118
void restore_state_instances(sys::state &state)
Definition: nations.cpp:92
int32_t national_focuses_in_use(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1199
bool has_reform_available(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1394
float get_foreign_investment_as_gp(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:892
void generate_sea_trade_routes(sys::state &state)
Definition: nations.cpp:288
std::vector< dcon::nation_id > nation_get_subjects(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:40
void update_great_powers(sys::state &state)
Definition: nations.cpp:1072
void cleanup_crisis(sys::state &state)
Definition: nations.cpp:2440
void recalculate_markets_distance(sys::state &state)
Definition: nations.cpp:162
dcon::nation_id owner_of_pop(sys::state const &state, dcon::pop_id pop_ids)
Definition: nations.cpp:87
dcon::technology_id current_research(sys::state const &state, dcon::nation_id n)
Definition: nations.cpp:1171
void generate_initial_trade_routes(sys::state &state)
Definition: nations.cpp:581
bool can_accumulate_influence_with(sys::state &state, dcon::nation_id gp, dcon::nation_id target, dcon::gp_relationship_id rel)
Definition: nations.cpp:2070
int32_t max_national_focuses(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1183
float get_treasury(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1607
void update_ui_rankings(sys::state &state)
Definition: nations.cpp:997
void update_rankings(sys::state &state)
Definition: nations.cpp:966
float tax_efficiency(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1626
int32_t max_colonial_points(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1312
float colonial_points_from_ships(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1220
float priority_private(sys::state &state, dcon::nation_id n, dcon::factory_type_id ftid)
Definition: nations.cpp:781
void update_crisis(sys::state &state)
Definition: nations.cpp:2738
Definition: constants.hpp:4
uint uint32_t
uchar uint8_t
@ ident
dcon::national_event_id id
Definition: nations.hpp:32
dcon::issue_id issue_group
Definition: nations.hpp:34
dcon::trigger_key condition
Definition: nations.hpp:33
dcon::national_event_id id
Definition: nations.hpp:26
dcon::trigger_key condition
Definition: nations.hpp:27
dcon::trigger_key condition
Definition: nations.hpp:40
dcon::provincial_event_id id
Definition: nations.hpp:39
std::vector< fixed_event > on_surrender
Definition: nations.hpp:143
std::vector< fixed_event > on_colony_to_state
Definition: nations.hpp:147
std::vector< fixed_event > on_lost_great_nation
Definition: nations.hpp:145
dcon::modifier_id overseas
Definition: nations.hpp:91
std::vector< fixed_event > on_yearly_pulse
Definition: nations.hpp:139
dcon::modifier_id total_occupation
Definition: nations.hpp:121
dcon::modifier_id total_blockaded
Definition: nations.hpp:122
std::vector< fixed_event > on_civilize
Definition: nations.hpp:153
std::vector< fixed_event > on_debtor_default_small
Definition: nations.hpp:151
std::vector< fixed_event > on_state_conquest
Definition: nations.hpp:148
std::vector< fixed_event > on_election_started
Definition: nations.hpp:156
dcon::modifier_id land_province
Definition: nations.hpp:96
dcon::modifier_id easy_ai
Definition: nations.hpp:86
tagged_vector< dcon::text_key, dcon::national_variable_id > variable_names
Definition: nations.hpp:77
dcon::modifier_id very_hard_ai
Definition: nations.hpp:88
std::vector< dcon::nation_id > nations_by_rank
Definition: nations.hpp:73
dcon::modifier_id base_values
Definition: nations.hpp:106
dcon::modifier_id generalised_debt_default
Definition: nations.hpp:120
dcon::modifier_id coastal_sea
Definition: nations.hpp:94
dcon::national_identity_id rebel_id
Definition: nations.hpp:79
dcon::modifier_id very_hard_player
Definition: nations.hpp:84
dcon::modifier_id hard_ai
Definition: nations.hpp:87
std::vector< fixed_event > on_election_finished
Definition: nations.hpp:157
dcon::modifier_id nationalism
Definition: nations.hpp:102
bool is_global_flag_variable_set(dcon::global_flag_id id) const
Definition: nations.cpp:699
std::vector< fixed_province_event > on_battle_won
Definition: nations.hpp:141
dcon::modifier_id debt_default_to
Definition: nations.hpp:112
dcon::modifier_id badboy
Definition: nations.hpp:111
dcon::modifier_id coastal
Definition: nations.hpp:92
tagged_vector< dcon::text_key, dcon::global_flag_id > global_flag_variable_names
Definition: nations.hpp:76
std::vector< fixed_event > on_colony_to_state_free_slaves
Definition: nations.hpp:149
dcon::modifier_id hard_player
Definition: nations.hpp:83
dcon::modifier_id very_easy_ai
Definition: nations.hpp:85
dcon::modifier_id unciv_nation
Definition: nations.hpp:117
std::vector< fixed_event > on_quarterly_pulse
Definition: nations.hpp:140
dcon::modifier_id non_coastal
Definition: nations.hpp:93
dcon::modifier_id in_bankrupcy
Definition: nations.hpp:123
dcon::modifier_id disarming
Definition: nations.hpp:109
dcon::modifier_id easy_player
Definition: nations.hpp:82
dcon::modifier_id bad_debter
Definition: nations.hpp:113
void set_global_flag_variable(dcon::global_flag_id id, bool state)
Definition: nations.cpp:705
tagged_vector< dcon::text_key, dcon::national_flag_id > flag_variable_names
Definition: nations.hpp:75
dcon::modifier_id civ_nation
Definition: nations.hpp:116
dcon::national_focus_id flashpoint_focus
Definition: nations.hpp:129
dcon::national_focus_id secondary_factory_worker_focus
Definition: nations.hpp:135
dcon::modifier_id plurality
Definition: nations.hpp:119
dcon::modifier_id no_adjacent_controlled
Definition: nations.hpp:98
std::vector< fixed_event > on_debtor_default
Definition: nations.hpp:150
std::vector< fixed_event > on_crisis_declare_interest
Definition: nations.hpp:155
dcon::national_focus_id clergy_focus
Definition: nations.hpp:130
dcon::modifier_id sea_zone
Definition: nations.hpp:95
dcon::national_focus_id aristocrat_focus
Definition: nations.hpp:132
dcon::modifier_id blockaded
Definition: nations.hpp:97
dcon::national_focus_id capitalist_focus
Definition: nations.hpp:133
dcon::modifier_id peace
Definition: nations.hpp:108
std::vector< triggered_modifier > triggered_modifiers
Definition: nations.hpp:71
std::vector< fixed_event > on_my_factories_nationalized
Definition: nations.hpp:154
dcon::modifier_id great_power
Definition: nations.hpp:114
std::vector< fixed_election_event > on_election_tick
Definition: nations.hpp:146
dcon::national_focus_id primary_factory_worker_focus
Definition: nations.hpp:134
dcon::modifier_id war_exhaustion
Definition: nations.hpp:110
dcon::national_focus_id soldier_focus
Definition: nations.hpp:131
dcon::modifier_id infrastructure
Definition: nations.hpp:103
dcon::modifier_id average_literacy
Definition: nations.hpp:118
dcon::modifier_id second_power
Definition: nations.hpp:115
dcon::modifier_id occupied
Definition: nations.hpp:101
dcon::modifier_id very_easy_player
Definition: nations.hpp:81
dcon::modifier_id has_siege
Definition: nations.hpp:100
dcon::modifier_id core
Definition: nations.hpp:99
std::vector< fixed_event > on_new_great_nation
Definition: nations.hpp:144
std::vector< fixed_event > on_debtor_default_second
Definition: nations.hpp:152
std::vector< fixed_province_event > on_battle_lost
Definition: nations.hpp:142
std::vector< dcon::bitfield_type > global_flag_variables
Definition: nations.hpp:72
dcon::trigger_key trigger_condition
Definition: nations.hpp:21
dcon::modifier_id linked_modifier
Definition: nations.hpp:20
Holds important data about the game world, state, and other data regarding windowing,...