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 nations {
7inline uint32_t tag_to_int(char first, char second, char third) {
8 return (uint32_t(first) << 16) | (uint32_t(second) << 8) | (uint32_t(third) << 0);
9}
10inline std::string int_to_tag(uint32_t v) {
11 char values[] = {char((v >> 16) & 0xFF), char((v >> 8) & 0xFF), char((v >> 0) & 0xFF)};
12 return std::string(values, values + 3);
13}
14
16 dcon::modifier_id linked_modifier;
17 dcon::trigger_key trigger_condition;
18};
19
21 int16_t chance; //0,2
22 dcon::national_event_id id; //2,2
23 dcon::trigger_key condition; //4,2
24 uint16_t padding = 0; //6,2
25};
27 int16_t chance; //0,2
28 dcon::national_event_id id; //2,2
29 dcon::trigger_key condition; //4,2
30 dcon::issue_id issue_group; //6,1
31 uint8_t padding = 0; //7,1
32};
34 int16_t chance; //0,2
35 dcon::provincial_event_id id; //2,2
36 dcon::trigger_key condition; //4,2
37 uint16_t padding = 0; //6,2
38};
39
40enum class focus_type : uint8_t {
41 unknown = 0,
42 rail_focus = 1,
48 //non-vanilla
49 policy_focus = 7,
50 tier_1_focus = 8,
51 tier_2_focus = 9,
52 tier_3_focus = 10,
53 tier_4_focus = 11,
54 tier_5_focus = 12,
55 tier_6_focus = 13,
56 tier_7_focus = 14,
57 tier_8_focus = 15,
58 building_focus = 16,
64};
65
67 std::vector<triggered_modifier> triggered_modifiers;
68 std::vector<dcon::bitfield_type> global_flag_variables;
69 std::vector<dcon::nation_id> nations_by_rank;
70
74
75 dcon::national_identity_id rebel_id;
76
77 dcon::modifier_id very_easy_player;
78 dcon::modifier_id easy_player;
79 dcon::modifier_id hard_player;
80 dcon::modifier_id very_hard_player;
81 dcon::modifier_id very_easy_ai;
82 dcon::modifier_id easy_ai;
83 dcon::modifier_id hard_ai;
84 dcon::modifier_id very_hard_ai;
85
86 // provincial
87 dcon::modifier_id overseas;
88 dcon::modifier_id coastal;
89 dcon::modifier_id non_coastal;
90 dcon::modifier_id coastal_sea;
91 dcon::modifier_id sea_zone;
92 dcon::modifier_id land_province;
93 dcon::modifier_id blockaded;
94 dcon::modifier_id no_adjacent_controlled;
95 dcon::modifier_id core;
96 dcon::modifier_id has_siege;
97 dcon::modifier_id occupied;
98 dcon::modifier_id nationalism;
99 dcon::modifier_id infrastructure;
100
101 // national
102 dcon::modifier_id base_values;
103 dcon::modifier_id war;
104 dcon::modifier_id peace;
105 dcon::modifier_id disarming;
106 dcon::modifier_id war_exhaustion;
107 dcon::modifier_id badboy;
108 dcon::modifier_id debt_default_to;
109 dcon::modifier_id bad_debter;
110 dcon::modifier_id great_power;
111 dcon::modifier_id second_power;
112 dcon::modifier_id civ_nation;
113 dcon::modifier_id unciv_nation;
114 dcon::modifier_id average_literacy;
115 dcon::modifier_id plurality;
116 dcon::modifier_id generalised_debt_default;
117 dcon::modifier_id total_occupation;
118 dcon::modifier_id total_blockaded;
119 dcon::modifier_id in_bankrupcy;
120
124
125 dcon::national_focus_id flashpoint_focus;
126 dcon::national_focus_id clergy_focus;
127 dcon::national_focus_id soldier_focus;
128 dcon::national_focus_id aristocrat_focus;
129 dcon::national_focus_id capitalist_focus;
130 dcon::national_focus_id primary_factory_worker_focus;
131 dcon::national_focus_id secondary_factory_worker_focus;
132
133 float flashpoint_amount = 0.15f;
134
135 std::vector<fixed_event> on_yearly_pulse;
136 std::vector<fixed_event> on_quarterly_pulse;
137 std::vector<fixed_province_event> on_battle_won;
138 std::vector<fixed_province_event> on_battle_lost;
139 std::vector<fixed_event> on_surrender;
140 std::vector<fixed_event> on_new_great_nation;
141 std::vector<fixed_event> on_lost_great_nation;
142 std::vector<fixed_election_event> on_election_tick;
143 std::vector<fixed_event> on_colony_to_state;
144 std::vector<fixed_event> on_state_conquest;
145 std::vector<fixed_event> on_colony_to_state_free_slaves;
146 std::vector<fixed_event> on_debtor_default;
147 std::vector<fixed_event> on_debtor_default_small;
148 std::vector<fixed_event> on_debtor_default_second;
149 std::vector<fixed_event> on_civilize;
150 std::vector<fixed_event> on_my_factories_nationalized;
151 std::vector<fixed_event> on_crisis_declare_interest;
152 std::vector<fixed_event> on_election_started;
153 std::vector<fixed_event> on_election_finished;
154
155 bool gc_pending = false;
156
157 bool is_global_flag_variable_set(dcon::global_flag_id id) const;
158 void set_global_flag_variable(dcon::global_flag_id id, bool state);
159};
160
161namespace influence {
162
163constexpr inline uint8_t level_mask = uint8_t(0x07);
164constexpr inline uint8_t level_neutral = uint8_t(0x00);
165constexpr inline uint8_t level_opposed = uint8_t(0x01);
166constexpr inline uint8_t level_hostile = uint8_t(0x02);
167constexpr inline uint8_t level_cordial = uint8_t(0x03);
168constexpr inline uint8_t level_friendly = uint8_t(0x04);
169constexpr inline uint8_t level_in_sphere = uint8_t(0x05);
170
171constexpr inline uint8_t priority_mask = uint8_t(0x18);
172constexpr inline uint8_t priority_zero = uint8_t(0x00);
173constexpr inline uint8_t priority_one = uint8_t(0x08);
174constexpr inline uint8_t priority_two = uint8_t(0x10);
175constexpr inline uint8_t priority_three = uint8_t(0x18);
176
177// constexpr inline uint8_t is_expelled = uint8_t(0x20); // <-- didn't need this; free bit
178constexpr inline uint8_t is_discredited = uint8_t(0x40);
179constexpr inline uint8_t is_banned = uint8_t(0x80);
180
182 switch(v & level_mask) {
183 case level_neutral:
184 return uint8_t((v & ~level_mask) | level_cordial);
185 case level_opposed:
186 return uint8_t((v & ~level_mask) | level_neutral);
187 case level_hostile:
188 return uint8_t((v & ~level_mask) | level_opposed);
189 case level_cordial:
190 return uint8_t((v & ~level_mask) | level_friendly);
191 case level_friendly:
192 return uint8_t((v & ~level_mask) | level_in_sphere);
193 case level_in_sphere:
194 return v;
195 default:
196 return v;
197 }
198}
200 switch(v & level_mask) {
201 case level_neutral:
202 return uint8_t((v & ~level_mask) | level_opposed);
203 case level_opposed:
204 return uint8_t((v & ~level_mask) | level_hostile);
205 case level_hostile:
206 return v;
207 case level_cordial:
208 return uint8_t((v & ~level_mask) | level_neutral);
209 case level_friendly:
210 return uint8_t((v & ~level_mask) | level_cordial);
211 case level_in_sphere:
212 return uint8_t((v & ~level_mask) | level_friendly);
213 default:
214 return v;
215 }
216}
218 if((v & priority_mask) != priority_three) {
219 return uint8_t(v + priority_one);
220 } else {
221 return v;
222 }
223}
225 if((v & priority_mask) != priority_zero) {
226 return uint8_t(v - priority_one);
227 } else {
228 return v;
229 }
230}
231inline bool is_influence_level_greater(int32_t l, int32_t r) {
232 switch(l) {
233 case level_hostile:
234 return false;
235 case level_opposed:
236 return r == level_hostile;
237 case level_neutral:
238 return r == level_hostile || r == level_opposed;
239 case level_cordial:
240 return r <= 2;
241 case level_friendly:
242 return r <= 3;
243 case level_in_sphere:
244 return r <= 4;
245 default:
246 return false;
247 }
248}
249inline bool is_influence_level_greater_or_equal(int32_t l, int32_t r) {
250 return l == r || is_influence_level_greater(l, r);
251}
252int32_t get_level(sys::state& state, dcon::nation_id gp, dcon::nation_id target);
253
254} // namespace influence
255
256dcon::nation_id get_nth_great_power(sys::state const& state, uint16_t n);
257
258dcon::nation_id owner_of_pop(sys::state const& state, dcon::pop_id pop_ids);
259
260bool can_release_as_vassal(sys::state const& state, dcon::nation_id n, dcon::national_identity_id releasable);
261bool identity_has_holder(sys::state const& state, dcon::national_identity_id ident);
262dcon::nation_id get_relationship_partner(sys::state const& state, dcon::diplomatic_relation_id rel_id, dcon::nation_id query);
263
268
269dcon::text_key name_from_tag(sys::state& state, dcon::national_identity_id tag);
270
272
273float daily_research_points(sys::state& state, dcon::nation_id n);
275
278void update_rankings(sys::state& state);
279void update_ui_rankings(sys::state& state);
280
281bool is_great_power(sys::state const& state, dcon::nation_id n);
282float prestige_score(sys::state const& state, dcon::nation_id n);
283
285status get_status(sys::state& state, dcon::nation_id n);
286
287sys::date get_research_end_date(sys::state& state, dcon::technology_id, dcon::nation_id);
288dcon::technology_id current_research(sys::state const& state, dcon::nation_id n);
289float suppression_points(sys::state const& state, dcon::nation_id n);
290
291float diplomatic_points(sys::state const& state, dcon::nation_id n);
292float monthly_diplomatic_points(sys::state const& state, dcon::nation_id n);
293
294float leadership_points(sys::state const& state, dcon::nation_id n);
295float get_treasury(sys::state& state, dcon::nation_id n);
296float get_bank_funds(sys::state& state, dcon::nation_id n);
297float get_debt(sys::state& state, dcon::nation_id n);
298float tariff_efficiency(sys::state& state, dcon::nation_id n);
299float tax_efficiency(sys::state& state, dcon::nation_id n);
300float colonial_points_from_naval_bases(sys::state& state, dcon::nation_id n);
301float colonial_points_from_ships(sys::state& state, dcon::nation_id n);
302float colonial_points_from_technology(sys::state& state, dcon::nation_id n);
303float used_colonial_points(sys::state& state, dcon::nation_id n);
304int32_t free_colonial_points(sys::state& state, dcon::nation_id n);
305int32_t max_colonial_points(sys::state& state, dcon::nation_id n);
307
308bool has_political_reform_available(sys::state& state, dcon::nation_id n);
309bool has_social_reform_available(sys::state& state, dcon::nation_id n);
310bool has_reform_available(sys::state& state, dcon::nation_id n);
311bool has_decision_available(sys::state& state, dcon::nation_id n);
312int32_t max_national_focuses(sys::state& state, dcon::nation_id n);
313int32_t national_focuses_in_use(sys::state& state, dcon::nation_id n);
314bool can_expand_colony(sys::state& state, dcon::nation_id n);
315bool is_losing_colonial_race(sys::state& state, dcon::nation_id n);
316bool sphereing_progress_is_possible(sys::state& state, dcon::nation_id n); // can increase opinion or add to sphere
317bool is_involved_in_crisis(sys::state const& state, dcon::nation_id n);
318bool is_committed_in_crisis(sys::state const& state, dcon::nation_id n);
319bool can_put_flashpoint_focus_in_state(sys::state& state, dcon::state_instance_id s, dcon::nation_id fp_nation);
320int64_t get_monthly_pop_increase_of_nation(sys::state& state, dcon::nation_id n);
321bool can_accumulate_influence_with(sys::state& state, dcon::nation_id gp, dcon::nation_id target, dcon::gp_relationship_id rel);
322bool are_allied(sys::state& state, dcon::nation_id a, dcon::nation_id b);
323bool is_landlocked(sys::state& state, dcon::nation_id n);
324
325bool nth_crisis_war_goal_is_for_attacker(sys::state& state, int32_t index);
327int32_t num_crisis_wargoals(sys::state& state);
328
329void get_active_political_parties(sys::state& state, dcon::nation_id n, std::vector<dcon::political_party_id>& parties);
330
332
333// may create a relationship DO NOT call in a context where two or more such functions may run in parallel
334void adjust_relationship(sys::state& state, dcon::nation_id a, dcon::nation_id b, float delta);
335// used for creating a "new" nation when it is released
336void create_nation_based_on_template(sys::state& state, dcon::nation_id n, dcon::nation_id base);
337// call after a nation loses its last province
338void cleanup_nation(sys::state& state, dcon::nation_id n);
339
340void adjust_prestige(sys::state& state, dcon::nation_id n, float delta);
341void destroy_diplomatic_relationships(sys::state& state, dcon::nation_id n);
342void release_vassal(sys::state& state, dcon::overlord_id rel);
343void make_vassal(sys::state& state, dcon::nation_id subject, dcon::nation_id overlord);
344void make_substate(sys::state& state, dcon::nation_id subject, dcon::nation_id overlord);
345void break_alliance(sys::state& state, dcon::diplomatic_relation_id rel);
346void break_alliance(sys::state& state, dcon::nation_id a, dcon::nation_id b);
347void make_alliance(sys::state& state, dcon::nation_id a, dcon::nation_id b);
348void adjust_influence(sys::state& state, dcon::nation_id great_power, dcon::nation_id target, float delta);
349void adjust_influence_with_overflow(sys::state& state, dcon::nation_id great_power, dcon::nation_id target, float delta);
350void adjust_foreign_investment(sys::state& state, dcon::nation_id great_power, dcon::nation_id target, float delta);
351void enact_issue(sys::state& state, dcon::nation_id source, dcon::issue_option_id i);
352void enact_reform(sys::state& state, dcon::nation_id source, dcon::reform_option_id i);
353
354float get_foreign_investment(sys::state& state, dcon::nation_id n);
355float get_foreign_investment_as_gp(sys::state& state, dcon::nation_id n);
356float get_base_shares(sys::state& state, dcon::gp_relationship_id gp, float total_gain, int32_t total_influence_shares);
357bool has_sphere_neighbour(sys::state& state, dcon::nation_id n, dcon::nation_id target);
358
360void update_influence(sys::state& state);
361void update_revanchism(sys::state& state);
362
365void update_crisis(sys::state& state);
366
367void add_as_primary_crisis_defender(sys::state& state, dcon::nation_id n);
368void add_as_primary_crisis_attacker(sys::state& state, dcon::nation_id n);
370void cleanup_crisis(sys::state& state);
371void cleanup_crisis_peace_offer(sys::state& state, dcon::peace_offer_id peace);
372void accept_crisis_peace_offer(sys::state& state, dcon::nation_id from, dcon::nation_id to, dcon::peace_offer_id peace);
373
374void update_pop_acceptance(sys::state& state, dcon::nation_id n);
375void liberate_nation_from(sys::state& state, dcon::national_identity_id liberated, dcon::nation_id from);
376void release_nation_from(sys::state& state, dcon::national_identity_id liberated,
377 dcon::nation_id from); // difference from liberate: only non-cores can be lost with release
378void remove_cores_from_owned(sys::state& state, dcon::nation_id n, dcon::national_identity_id tag);
379void perform_nationalization(sys::state& state, dcon::nation_id n);
380
381float get_yesterday_income(sys::state& state, dcon::nation_id n);
382
383void make_civilized(sys::state& state, dcon::nation_id n);
384void make_uncivilized(sys::state& state, dcon::nation_id n);
385
386void run_gc(sys::state& state);
387
388} // namespace nations
constexpr uint8_t is_banned
Definition: nations.hpp:179
constexpr uint8_t level_friendly
Definition: nations.hpp:168
uint8_t decrease_level(uint8_t v)
Definition: nations.hpp:199
constexpr uint8_t is_discredited
Definition: nations.hpp:178
uint8_t decrease_priority(uint8_t v)
Definition: nations.hpp:224
constexpr uint8_t priority_zero
Definition: nations.hpp:172
constexpr uint8_t level_opposed
Definition: nations.hpp:165
constexpr uint8_t level_neutral
Definition: nations.hpp:164
constexpr uint8_t level_hostile
Definition: nations.hpp:166
constexpr uint8_t priority_three
Definition: nations.hpp:175
uint8_t increase_level(uint8_t v)
Definition: nations.hpp:181
constexpr uint8_t priority_mask
Definition: nations.hpp:171
constexpr uint8_t priority_one
Definition: nations.hpp:173
constexpr uint8_t level_in_sphere
Definition: nations.hpp:169
constexpr uint8_t level_mask
Definition: nations.hpp:163
int32_t get_level(sys::state &state, dcon::nation_id gp, dcon::nation_id target)
Definition: nations.cpp:23
uint8_t increase_priority(uint8_t v)
Definition: nations.hpp:217
constexpr uint8_t priority_two
Definition: nations.hpp:174
bool is_influence_level_greater_or_equal(int32_t l, int32_t r)
Definition: nations.hpp:249
bool is_influence_level_greater(int32_t l, int32_t r)
Definition: nations.hpp:231
constexpr uint8_t level_cordial
Definition: nations.hpp:167
void remove_cores_from_owned(sys::state &state, dcon::nation_id n, dcon::national_identity_id tag)
Definition: nations.cpp:2650
void cleanup_crisis_peace_offer(sys::state &state, dcon::peace_offer_id peace)
Definition: nations.cpp:2009
float colonial_points_from_naval_bases(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:674
bool nth_crisis_war_goal_is_for_attacker(sys::state &state, int32_t index)
Definition: nations.cpp:2458
void make_uncivilized(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:2865
status get_status(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:580
void accept_crisis_peace_offer(sys::state &state, dcon::nation_id from, dcon::nation_id to, dcon::peace_offer_id peace)
Definition: nations.cpp:2017
bool is_great_power(sys::state const &state, dcon::nation_id id)
Definition: nations.cpp:503
void enact_reform(sys::state &state, dcon::nation_id source, dcon::reform_option_id r)
Definition: nations.cpp:2890
int32_t free_colonial_points(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:739
void break_alliance(sys::state &state, dcon::diplomatic_relation_id rel)
Definition: nations.cpp:1442
std::string int_to_tag(uint32_t v)
Definition: nations.hpp:10
bool is_losing_colonial_race(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:774
void run_gc(sys::state &state)
Definition: nations.cpp:1220
bool can_release_as_vassal(sys::state const &state, dcon::nation_id n, dcon::national_identity_id releasable)
Definition: nations.cpp:176
void adjust_prestige(sys::state &state, dcon::nation_id n, float delta)
Definition: nations.cpp:1330
bool has_political_reform_available(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:805
void destroy_diplomatic_relationships(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1348
void restore_unsaved_values(sys::state &state)
Definition: nations.cpp:116
bool is_committed_in_crisis(sys::state const &state, dcon::nation_id n)
Definition: nations.cpp:1080
void daily_update_flashpoint_tension(sys::state &state)
Definition: nations.cpp:1773
bool is_involved_in_crisis(sys::state const &state, dcon::nation_id n)
Definition: nations.cpp:1066
float get_foreign_investment(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:314
void monthly_flashpoint_update(sys::state &state)
Definition: nations.cpp:1696
bool identity_has_holder(sys::state const &state, dcon::national_identity_id ident)
Definition: nations.cpp:193
void make_vassal(sys::state &state, dcon::nation_id subject, dcon::nation_id overlord)
Definition: nations.cpp:1393
void update_administrative_efficiency(sys::state &state)
Definition: nations.cpp:231
void release_vassal(sys::state &state, dcon::overlord_id rel)
Definition: nations.cpp:1378
bool are_allied(sys::state &state, dcon::nation_id a, dcon::nation_id b)
Definition: nations.cpp:198
void reject_crisis_participation(sys::state &state)
Definition: nations.cpp:1948
focus_type
Definition: nations.hpp:40
military::full_wg get_nth_crisis_war_goal(sys::state &state, int32_t index)
Definition: nations.cpp:2497
void release_nation_from(sys::state &state, dcon::national_identity_id liberated, dcon::nation_id from)
Definition: nations.cpp:2626
void update_pop_acceptance(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:2583
int32_t num_crisis_wargoals(sys::state &state)
Definition: nations.cpp:2439
void get_active_political_parties(sys::state &state, dcon::nation_id n, std::vector< dcon::political_party_id > &parties)
Definition: nations.cpp:892
float tariff_efficiency(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1055
void make_alliance(sys::state &state, dcon::nation_id a, dcon::nation_id b)
Definition: nations.cpp:1467
void adjust_foreign_investment(sys::state &state, dcon::nation_id great_power, dcon::nation_id target, float delta)
Definition: nations.cpp:2735
void adjust_influence_with_overflow(sys::state &state, dcon::nation_id great_power, dcon::nation_id target, float delta)
Definition: nations.cpp:2681
float used_colonial_points(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:717
float get_base_shares(sys::state &state, dcon::gp_relationship_id gp, float total_gain, int32_t total_influence_shares)
Definition: nations.cpp:1513
bool has_sphere_neighbour(sys::state &state, dcon::nation_id n, dcon::nation_id target)
Definition: nations.cpp:1529
bool can_expand_colony(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:759
void liberate_nation_from(sys::state &state, dcon::national_identity_id liberated, dcon::nation_id from)
Definition: nations.cpp:2602
void adjust_influence(sys::state &state, dcon::nation_id great_power, dcon::nation_id target, float delta)
Definition: nations.cpp:2669
bool can_put_flashpoint_focus_in_state(sys::state &state, dcon::state_instance_id s, dcon::nation_id fp_nation)
Definition: nations.cpp:1667
void enact_issue(sys::state &state, dcon::nation_id source, dcon::issue_option_id i)
Definition: nations.cpp:2935
float diplomatic_points(sys::state const &state, dcon::nation_id n)
Definition: nations.cpp:645
void update_influence(sys::state &state)
Definition: nations.cpp:1539
bool has_social_reform_available(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:817
void update_military_scores(sys::state &state)
Definition: nations.cpp:370
float get_debt(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1050
float suppression_points(sys::state const &state, dcon::nation_id n)
Definition: nations.cpp:610
float get_yesterday_income(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:2744
void add_as_primary_crisis_defender(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1890
void cleanup_nation(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1241
dcon::nation_id get_nth_great_power(sys::state const &state, uint16_t n)
Definition: nations.cpp:57
bool is_landlocked(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:203
void update_monthly_points(sys::state &state)
Definition: nations.cpp:943
float prestige_score(sys::state const &state, dcon::nation_id n)
Definition: nations.cpp:396
void add_as_primary_crisis_attacker(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1904
float colonial_points_from_technology(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:708
void generate_initial_state_instances(sys::state &state)
Definition: nations.cpp:143
void update_cached_values(sys::state &state)
Definition: nations.cpp:109
void make_substate(sys::state &state, dcon::nation_id subject, dcon::nation_id overlord)
Definition: nations.cpp:1416
float leadership_points(sys::state const &state, dcon::nation_id n)
Definition: nations.cpp:614
float monthly_diplomatic_points(sys::state const &state, dcon::nation_id n)
Definition: nations.cpp:649
float daily_research_points(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:254
bool has_decision_available(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:876
dcon::nation_id get_relationship_partner(sys::state const &state, dcon::diplomatic_relation_id rel_id, dcon::nation_id query)
Definition: nations.cpp:207
void make_civilized(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:2758
float get_bank_funds(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1046
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:223
void update_revanchism(sys::state &state)
Definition: nations.cpp:913
void adjust_relationship(sys::state &state, dcon::nation_id a, dcon::nation_id b, float delta)
Definition: nations.cpp:1094
int64_t get_monthly_pop_increase_of_nation(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:38
bool sphereing_progress_is_possible(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:785
sys::date get_research_end_date(sys::state &state, dcon::technology_id tech_id, dcon::nation_id n)
Definition: nations.cpp:599
uint32_t tag_to_int(char first, char second, char third)
Definition: nations.hpp:7
void create_nation_based_on_template(sys::state &state, dcon::nation_id n, dcon::nation_id base)
Definition: nations.cpp:1106
void update_industrial_scores(sys::state &state)
Definition: nations.cpp:330
void update_research_points(sys::state &state)
Definition: nations.cpp:279
void perform_nationalization(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:2658
void restore_state_instances(sys::state &state)
Definition: nations.cpp:74
int32_t national_focuses_in_use(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:634
bool has_reform_available(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:829
float get_foreign_investment_as_gp(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:322
void update_great_powers(sys::state &state)
Definition: nations.cpp:507
void cleanup_crisis(sys::state &state)
Definition: nations.cpp:1860
dcon::nation_id owner_of_pop(sys::state const &state, dcon::pop_id pop_ids)
Definition: nations.cpp:69
dcon::technology_id current_research(sys::state const &state, dcon::nation_id n)
Definition: nations.cpp:606
bool can_accumulate_influence_with(sys::state &state, dcon::nation_id gp, dcon::nation_id target, dcon::gp_relationship_id rel)
Definition: nations.cpp:1500
int32_t max_national_focuses(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:618
float get_treasury(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1042
void update_ui_rankings(sys::state &state)
Definition: nations.cpp:432
void update_rankings(sys::state &state)
Definition: nations.cpp:401
float tax_efficiency(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1061
int32_t max_colonial_points(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:747
float colonial_points_from_ships(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:655
void update_crisis(sys::state &state)
Definition: nations.cpp:2025
uint uint32_t
uchar uint8_t
@ ident
dcon::national_event_id id
Definition: nations.hpp:28
dcon::issue_id issue_group
Definition: nations.hpp:30
dcon::trigger_key condition
Definition: nations.hpp:29
dcon::national_event_id id
Definition: nations.hpp:22
dcon::trigger_key condition
Definition: nations.hpp:23
dcon::trigger_key condition
Definition: nations.hpp:36
dcon::provincial_event_id id
Definition: nations.hpp:35
std::vector< fixed_event > on_surrender
Definition: nations.hpp:139
std::vector< fixed_event > on_colony_to_state
Definition: nations.hpp:143
std::vector< fixed_event > on_lost_great_nation
Definition: nations.hpp:141
dcon::modifier_id overseas
Definition: nations.hpp:87
std::vector< fixed_event > on_yearly_pulse
Definition: nations.hpp:135
dcon::modifier_id total_occupation
Definition: nations.hpp:117
dcon::modifier_id total_blockaded
Definition: nations.hpp:118
std::vector< fixed_event > on_civilize
Definition: nations.hpp:149
std::vector< fixed_event > on_debtor_default_small
Definition: nations.hpp:147
std::vector< fixed_event > on_state_conquest
Definition: nations.hpp:144
std::vector< fixed_event > on_election_started
Definition: nations.hpp:152
dcon::modifier_id land_province
Definition: nations.hpp:92
dcon::modifier_id easy_ai
Definition: nations.hpp:82
tagged_vector< dcon::text_key, dcon::national_variable_id > variable_names
Definition: nations.hpp:73
dcon::modifier_id very_hard_ai
Definition: nations.hpp:84
std::vector< dcon::nation_id > nations_by_rank
Definition: nations.hpp:69
dcon::modifier_id base_values
Definition: nations.hpp:102
dcon::modifier_id generalised_debt_default
Definition: nations.hpp:116
dcon::modifier_id coastal_sea
Definition: nations.hpp:90
dcon::national_identity_id rebel_id
Definition: nations.hpp:75
dcon::modifier_id very_hard_player
Definition: nations.hpp:80
dcon::modifier_id hard_ai
Definition: nations.hpp:83
std::vector< fixed_event > on_election_finished
Definition: nations.hpp:153
dcon::modifier_id nationalism
Definition: nations.hpp:98
bool is_global_flag_variable_set(dcon::global_flag_id id) const
Definition: nations.cpp:212
std::vector< fixed_province_event > on_battle_won
Definition: nations.hpp:137
dcon::modifier_id debt_default_to
Definition: nations.hpp:108
dcon::modifier_id badboy
Definition: nations.hpp:107
dcon::modifier_id coastal
Definition: nations.hpp:88
tagged_vector< dcon::text_key, dcon::global_flag_id > global_flag_variable_names
Definition: nations.hpp:72
std::vector< fixed_event > on_colony_to_state_free_slaves
Definition: nations.hpp:145
dcon::modifier_id hard_player
Definition: nations.hpp:79
dcon::modifier_id very_easy_ai
Definition: nations.hpp:81
dcon::modifier_id unciv_nation
Definition: nations.hpp:113
std::vector< fixed_event > on_quarterly_pulse
Definition: nations.hpp:136
dcon::modifier_id non_coastal
Definition: nations.hpp:89
dcon::modifier_id in_bankrupcy
Definition: nations.hpp:119
dcon::modifier_id disarming
Definition: nations.hpp:105
dcon::modifier_id easy_player
Definition: nations.hpp:78
dcon::modifier_id bad_debter
Definition: nations.hpp:109
void set_global_flag_variable(dcon::global_flag_id id, bool state)
Definition: nations.cpp:218
tagged_vector< dcon::text_key, dcon::national_flag_id > flag_variable_names
Definition: nations.hpp:71
dcon::modifier_id civ_nation
Definition: nations.hpp:112
dcon::national_focus_id flashpoint_focus
Definition: nations.hpp:125
dcon::national_focus_id secondary_factory_worker_focus
Definition: nations.hpp:131
dcon::modifier_id plurality
Definition: nations.hpp:115
dcon::modifier_id no_adjacent_controlled
Definition: nations.hpp:94
std::vector< fixed_event > on_debtor_default
Definition: nations.hpp:146
std::vector< fixed_event > on_crisis_declare_interest
Definition: nations.hpp:151
dcon::national_focus_id clergy_focus
Definition: nations.hpp:126
dcon::modifier_id sea_zone
Definition: nations.hpp:91
dcon::national_focus_id aristocrat_focus
Definition: nations.hpp:128
dcon::modifier_id blockaded
Definition: nations.hpp:93
dcon::national_focus_id capitalist_focus
Definition: nations.hpp:129
dcon::modifier_id peace
Definition: nations.hpp:104
std::vector< triggered_modifier > triggered_modifiers
Definition: nations.hpp:67
std::vector< fixed_event > on_my_factories_nationalized
Definition: nations.hpp:150
dcon::modifier_id great_power
Definition: nations.hpp:110
std::vector< fixed_election_event > on_election_tick
Definition: nations.hpp:142
dcon::national_focus_id primary_factory_worker_focus
Definition: nations.hpp:130
dcon::modifier_id war_exhaustion
Definition: nations.hpp:106
dcon::national_focus_id soldier_focus
Definition: nations.hpp:127
dcon::modifier_id infrastructure
Definition: nations.hpp:99
dcon::modifier_id average_literacy
Definition: nations.hpp:114
dcon::modifier_id second_power
Definition: nations.hpp:111
dcon::modifier_id occupied
Definition: nations.hpp:97
dcon::modifier_id very_easy_player
Definition: nations.hpp:77
dcon::modifier_id has_siege
Definition: nations.hpp:96
dcon::modifier_id core
Definition: nations.hpp:95
std::vector< fixed_event > on_new_great_nation
Definition: nations.hpp:140
std::vector< fixed_event > on_debtor_default_second
Definition: nations.hpp:148
std::vector< fixed_province_event > on_battle_lost
Definition: nations.hpp:138
std::vector< dcon::bitfield_type > global_flag_variables
Definition: nations.hpp:68
dcon::trigger_key trigger_condition
Definition: nations.hpp:17
dcon::modifier_id linked_modifier
Definition: nations.hpp:16