Project Alice
Loading...
Searching...
No Matches
commands.hpp
Go to the documentation of this file.
1#pragma once
2#include "dcon_generated.hpp"
3#include "common_types.hpp"
4#include "events.hpp"
6
7namespace command {
8
9enum class command_type : uint8_t {
10 invalid = 0,
13 make_leader = 3,
21 delete_factory = 11,
22 make_vassal = 12,
24 war_subsidies = 14,
26 change_budget = 16,
27 start_election = 17,
30 expel_advisors = 20,
31 ban_embassy = 21,
34 add_to_sphere = 24,
38 abandon_colony = 28,
42 civilize_nation = 32,
51 take_decision = 41,
56 fabricate_cb = 46,
60 call_to_arms = 50,
63 cancel_alliance = 53,
65 declare_war = 55,
66 add_war_goal = 56,
70 move_army = 61,
71 move_navy = 62,
72 embark_army = 63,
73 merge_armies = 64,
74 merge_navies = 65,
75 split_army = 66,
76 split_navy = 67,
77 delete_army = 68,
78 delete_navy = 69,
81 naval_retreat = 72,
82 land_retreat = 73,
87 change_admiral = 78,
88 change_general = 79,
91 set_rally_point = 82,
92 save_game = 83,
95 even_split_army = 86,
96 even_split_navy = 87,
100 state_transfer = 91,
101 release_subject = 92,
102 enable_debt = 93,
103 move_capital = 94,
107 pbutton_script = 98,
108 nbutton_script = 99,
110 crisis_add_wargoal = 101,
111 change_unit_type = 102,
112 take_province = 103,
113 grant_province = 104,
114
115 // network
116 notify_player_ban = 106,
117 notify_player_kick = 107,
121 notify_player_oos = 111,
122 notify_save_loaded = 112,
123 notify_start_game = 113, // for synchronized "start game"
124 notify_stop_game = 114, // "go back to lobby"
125 notify_pause_game = 115, // visual aid mostly
126 notify_reload = 116,
127 advance_tick = 120,
128 chat_message = 121,
130
131 // console cheats
132 console_command = 255,
133};
134
136 dcon::gui_def_id button;
137 dcon::province_id id;
138};
140 dcon::gui_def_id button;
141 dcon::nation_id id;
142};
143
145 dcon::state_instance_id target_state;
146 dcon::national_focus_id focus;
147};
148
150 dcon::technology_id tech;
151};
152
155};
156
159};
160
162 dcon::province_id location;
164};
165
167 dcon::state_instance_id location;
168 dcon::factory_type_id type;
170};
171
173 dcon::nation_id target;
174};
175
177 dcon::province_id location;
178 dcon::unit_type_id type;
179 dcon::province_id template_province;
180};
181
183 dcon::province_id location;
184 bool naval = false;
185 bool enable = false;
186};
187
189 dcon::province_id location;
190 dcon::culture_id pop_culture;
191 dcon::unit_type_id type;
192 dcon::province_id template_province;
193};
194
196 dcon::province_id location;
197 dcon::factory_type_id type;
200};
201
203 dcon::national_identity_id ident;
204};
205
207 dcon::nation_id influence_target;
208 dcon::nation_id gp_target;
209};
210
212 dcon::nation_id influence_target;
214};
215
217 dcon::province_id prov;
218};
219
221 dcon::province_id prov;
222 dcon::nation_id n;
223};
224
226 dcon::issue_option_id iopt;
227 dcon::national_identity_id tag;
228};
229
231 dcon::political_party_id p;
232};
233
235 dcon::reform_option_id r;
236};
237
239 dcon::issue_option_id r;
240};
241
250 int8_t poor_tax;
252 int8_t rich_tax;
256 int8_t overseas;
257};
258
260 dcon::war_id war;
262};
263
266};
267
269 float amount;
270 dcon::commodity_id c;
272};
273
275 dcon::decision_id d;
276};
277
279 dcon::nation_id from;
281 bool accept;
282};
283
285 dcon::nation_id target;
286 dcon::state_definition_id state;
287};
288
290 dcon::nation_id target;
291 dcon::war_id war;
292};
293
298 int32_t from_slot;
300 dcon::national_event_id e;
304};
309 dcon::free_national_event_id e;
311};
315 int32_t from_slot;
317 dcon::provincial_event_id e;
318 dcon::province_id p;
321};
326 dcon::free_provincial_event_id e;
327 dcon::province_id p;
329};
330
332 dcon::nation_id target;
333 dcon::cb_type_id type;
334 dcon::state_definition_id target_state;
335};
336
338 dcon::nation_id target;
339 dcon::state_definition_id cb_state;
340 dcon::national_identity_id cb_tag;
341 dcon::nation_id cb_secondary_nation;
342 dcon::cb_type_id primary_cb;
345};
346
348 dcon::nation_id target;
349 dcon::state_definition_id cb_state;
350 dcon::national_identity_id cb_tag;
351 dcon::nation_id cb_secondary_nation;
352 dcon::war_id war;
353 dcon::cb_type_id cb_type;
354};
355
357 dcon::nation_id invited;
358 dcon::nation_id target;
359 dcon::state_definition_id cb_state;
360 dcon::national_identity_id cb_tag;
361 dcon::nation_id cb_secondary_nation;
362 dcon::cb_type_id cb_type;
363};
364
366 dcon::nation_id target;
367 dcon::war_id war;
369};
371 dcon::wargoal_id wg;
372};
373
375 dcon::army_id a;
376 dcon::province_id dest;
377 bool reset;
378};
379
381 dcon::navy_id n;
382 dcon::province_id dest;
383 bool reset;
384};
385
387 dcon::army_id a;
388 dcon::army_id b;
389};
390
392 dcon::navy_id a;
393 dcon::navy_id b;
394};
395
397 dcon::army_id a;
398 dcon::leader_id l;
399};
400
402 dcon::navy_id a;
403 dcon::leader_id l;
404};
405
407 dcon::naval_battle_id b;
408};
409
411 dcon::land_battle_id b;
412};
413
414constexpr inline size_t num_packed_units = 10;
415
417 dcon::regiment_id regs[num_packed_units];
418};
420 dcon::ship_id ships[num_packed_units];
421};
422
424 dcon::regiment_id regs[num_packed_units];
425 dcon::ship_id ships[num_packed_units];
426 dcon::unit_type_id new_type;
427};
428
430 float value;
431};
433 int32_t value;
434};
436 int32_t value;
437 dcon::nation_id as;
438};
439
441 dcon::invention_id invention;
442};
443
445 dcon::factory_type_id factory;
446 float value;
447};
448
451 dcon::nation_id target;
452};
453
455 dcon::nation_id target;
456};
457
460 int32_t speed;
462};
463
467};
471 dcon::nation_id target;
472};
475};
478};
479
480struct payload {
481 union dtype {
545
546 dtype() { }
548 dcon::nation_id source;
550
552};
553
554void save_game(sys::state& state, dcon::nation_id source, bool and_quit);
555
556void set_rally_point(sys::state& state, dcon::nation_id source, dcon::province_id location, bool naval, bool enable);
557
559
560void set_national_focus(sys::state& state, dcon::nation_id source, dcon::state_instance_id target_state, dcon::national_focus_id focus);
561bool can_set_national_focus(sys::state& state, dcon::nation_id source, dcon::state_instance_id target_state, dcon::national_focus_id focus);
562
563void start_research(sys::state& state, dcon::nation_id source, dcon::technology_id tech);
564bool can_start_research(sys::state& state, dcon::nation_id source, dcon::technology_id tech);
565
566void make_leader(sys::state& state, dcon::nation_id source, bool general);
567bool can_make_leader(sys::state& state, dcon::nation_id source, bool general);
568
569void set_factory_type_priority(sys::state& state, dcon::nation_id source, dcon::factory_type_id ftid, float value);
570bool can_set_factory_type_priority(sys::state& state, dcon::nation_id source, dcon::factory_type_id ftid, float value);
571
572void decrease_relations(sys::state& state, dcon::nation_id source, dcon::nation_id target);
573bool can_decrease_relations(sys::state& state, dcon::nation_id source, dcon::nation_id target);
574
575void begin_province_building_construction(sys::state& state, dcon::nation_id source, dcon::province_id p, economy::province_building_type type);
576bool can_begin_province_building_construction(sys::state& state, dcon::nation_id source, dcon::province_id p, economy::province_building_type type);
577
578void begin_factory_building_construction(sys::state& state, dcon::nation_id source, dcon::state_instance_id location, dcon::factory_type_id type, bool is_upgrade);
579bool can_begin_factory_building_construction(sys::state& state, dcon::nation_id source, dcon::state_instance_id location, dcon::factory_type_id type, bool is_upgrade);
580
581void cancel_factory_building_construction(sys::state& state, dcon::nation_id source, dcon::state_instance_id location, dcon::factory_type_id type);
582bool can_cancel_factory_building_construction(sys::state& state, dcon::nation_id source, dcon::state_instance_id location, dcon::factory_type_id type);
583
584void start_naval_unit_construction(sys::state& state, dcon::nation_id source, dcon::province_id location, dcon::unit_type_id type, dcon::province_id template_province = dcon::province_id{});
585bool can_start_naval_unit_construction(sys::state& state, dcon::nation_id source, dcon::province_id location, dcon::unit_type_id type, dcon::province_id template_province = dcon::province_id{});
586
587void start_land_unit_construction(sys::state& state, dcon::nation_id source, dcon::province_id location, dcon::culture_id soldier_culture, dcon::unit_type_id type, dcon::province_id template_province = dcon::province_id{});
588bool can_start_land_unit_construction(sys::state& state, dcon::nation_id source, dcon::province_id location, dcon::culture_id soldier_culture, dcon::unit_type_id type, dcon::province_id template_province = dcon::province_id{});
589
590void cancel_naval_unit_construction(sys::state& state, dcon::nation_id source, dcon::province_id location, dcon::unit_type_id type);
591bool can_cancel_naval_unit_construction(sys::state& state, dcon::nation_id source, dcon::province_id location, dcon::unit_type_id type);
592
593void cancel_land_unit_construction(sys::state& state, dcon::nation_id source, dcon::province_id location, dcon::culture_id soldier_culture, dcon::unit_type_id type);
594bool can_cancel_land_unit_construction(sys::state& state, dcon::nation_id source, dcon::province_id location, dcon::culture_id soldier_culture, dcon::unit_type_id type);
595
596void delete_factory(sys::state& state, dcon::nation_id source, dcon::factory_id f);
597bool can_delete_factory(sys::state& state, dcon::nation_id source, dcon::factory_id f);
598
599void change_factory_settings(sys::state& state, dcon::nation_id source, dcon::factory_id f, uint8_t priority, bool subsidized);
600bool can_change_factory_settings(sys::state& state, dcon::nation_id source, dcon::factory_id f, uint8_t priority, bool subsidized);
601
602void make_vassal(sys::state& state, dcon::nation_id source, dcon::national_identity_id t);
603bool can_make_vassal(sys::state& state, dcon::nation_id source, dcon::national_identity_id t);
604
605void release_and_play_as(sys::state& state, dcon::nation_id source, dcon::national_identity_id t);
606bool can_release_and_play_as(sys::state& state, dcon::nation_id source, dcon::national_identity_id t);
607
608void give_war_subsidies(sys::state& state, dcon::nation_id source, dcon::nation_id target);
609bool can_give_war_subsidies(sys::state& state, dcon::nation_id source, dcon::nation_id target);
610
611void cancel_war_subsidies(sys::state& state, dcon::nation_id source, dcon::nation_id target);
612bool can_cancel_war_subsidies(sys::state& state, dcon::nation_id source, dcon::nation_id target);
613
614void increase_relations(sys::state& state, dcon::nation_id source, dcon::nation_id target);
615bool can_increase_relations(sys::state& state, dcon::nation_id source, dcon::nation_id target);
616
618 return budget_settings_data{ int8_t(-127), int8_t(-127), int8_t(-127), int8_t(-127), int8_t(-127), int8_t(-127), int8_t(-127),
619 int8_t(-127), int8_t(-127), int8_t(-127), int8_t(-127), int8_t(-127), int8_t(-127), int8_t(-127) };
620}
621// when sending new budget settings, leaving any value as int8_t(-127) will cause it to be ignored, leaving the setting the same
622// You can use the function above to easily make an instance of the settings struct that will change no values
623// Also, in consideration for future networking performance, do not send this command as the slider moves; only send it when the
624// player has stopped dragging the slider, in the case of drag, or maybe even only when the window closes / a day passes while the
625// window is open, if you think we can get away with it. In any case, we want to try to minimize how many times the command is
626// sent per average interaction with the budget.
627void change_budget_settings(sys::state& state, dcon::nation_id source, budget_settings_data const& values);
628inline bool can_change_budget_settings(sys::state& state, dcon::nation_id source, budget_settings_data const& values);
629
630void start_election(sys::state& state, dcon::nation_id source);
631bool can_start_election(sys::state& state, dcon::nation_id source);
632
633void change_influence_priority(sys::state& state, dcon::nation_id source, dcon::nation_id influence_target, uint8_t priority);
634bool can_change_influence_priority(sys::state& state, dcon::nation_id source, dcon::nation_id influence_target, uint8_t priority);
635
636void discredit_advisors(sys::state& state, dcon::nation_id source, dcon::nation_id influence_target, dcon::nation_id affected_gp);
637bool can_discredit_advisors(sys::state& state, dcon::nation_id source, dcon::nation_id influence_target, dcon::nation_id affected_gp);
638
639void expel_advisors(sys::state& state, dcon::nation_id source, dcon::nation_id influence_target, dcon::nation_id affected_gp);
640bool can_expel_advisors(sys::state& state, dcon::nation_id source, dcon::nation_id influence_target, dcon::nation_id affected_gp);
641
642void ban_embassy(sys::state& state, dcon::nation_id source, dcon::nation_id influence_target, dcon::nation_id affected_gp);
643bool can_ban_embassy(sys::state& state, dcon::nation_id source, dcon::nation_id influence_target, dcon::nation_id affected_gp);
644
645void increase_opinion(sys::state& state, dcon::nation_id source, dcon::nation_id influence_target);
646bool can_increase_opinion(sys::state& state, dcon::nation_id source, dcon::nation_id influence_target);
647void execute_increase_opinion(sys::state& state, dcon::nation_id source, dcon::nation_id influence_target);
648
649void decrease_opinion(sys::state& state, dcon::nation_id source, dcon::nation_id influence_target, dcon::nation_id affected_gp);
650bool can_decrease_opinion(sys::state& state, dcon::nation_id source, dcon::nation_id influence_target, dcon::nation_id affected_gp);
651void execute_decrease_opinion(sys::state& state, dcon::nation_id source, dcon::nation_id influence_target, dcon::nation_id affected_gp);
652
653void add_to_sphere(sys::state& state, dcon::nation_id source, dcon::nation_id influence_target);
654bool can_add_to_sphere(sys::state& state, dcon::nation_id source, dcon::nation_id influence_target);
655void execute_add_to_sphere(sys::state& state, dcon::nation_id source, dcon::nation_id influence_target);
656
657void remove_from_sphere(sys::state& state, dcon::nation_id source, dcon::nation_id influence_target, dcon::nation_id affected_gp);
658bool can_remove_from_sphere(sys::state& state, dcon::nation_id source, dcon::nation_id influence_target, dcon::nation_id affected_gp);
659void execute_remove_from_sphere(sys::state& state, dcon::nation_id source, dcon::nation_id influence_target, dcon::nation_id affected_gp);
660
661void upgrade_colony_to_state(sys::state& state, dcon::nation_id source, dcon::state_instance_id si);
662bool can_upgrade_colony_to_state(sys::state& state, dcon::nation_id source, dcon::state_instance_id si);
663
664void invest_in_colony(sys::state& state, dcon::nation_id source, dcon::province_id p);
665bool can_invest_in_colony(sys::state& state, dcon::nation_id source, dcon::province_id p);
666
667void abandon_colony(sys::state& state, dcon::nation_id source, dcon::province_id p);
668bool can_abandon_colony(sys::state& state, dcon::nation_id source, dcon::province_id p);
669
670void finish_colonization(sys::state& state, dcon::nation_id source, dcon::province_id p);
671bool can_finish_colonization(sys::state& state, dcon::nation_id source, dcon::province_id p);
672
673void intervene_in_war(sys::state& state, dcon::nation_id source, dcon::war_id w, bool for_attacker);
674bool can_intervene_in_war(sys::state& state, dcon::nation_id source, dcon::war_id w, bool for_attacker);
675void execute_intervene_in_war(sys::state& state, dcon::nation_id source, dcon::war_id w, bool for_attacker);
676
677void suppress_movement(sys::state& state, dcon::nation_id source, dcon::movement_id m);
678bool can_suppress_movement(sys::state& state, dcon::nation_id source, dcon::movement_id m);
679
680void civilize_nation(sys::state& state, dcon::nation_id source);
681bool can_civilize_nation(sys::state& state, dcon::nation_id source);
682
683void appoint_ruling_party(sys::state& state, dcon::nation_id source, dcon::political_party_id p);
684bool can_appoint_ruling_party(sys::state& state, dcon::nation_id source, dcon::political_party_id p);
685
686void enact_reform(sys::state& state, dcon::nation_id source, dcon::reform_option_id r);
687bool can_enact_reform(sys::state& state, dcon::nation_id source, dcon::reform_option_id r);
688
689void enact_issue(sys::state& state, dcon::nation_id source, dcon::issue_option_id i);
690bool can_enact_issue(sys::state& state, dcon::nation_id source, dcon::issue_option_id i);
691
692void become_interested_in_crisis(sys::state& state, dcon::nation_id source);
693bool can_become_interested_in_crisis(sys::state& state, dcon::nation_id source);
694
695void take_sides_in_crisis(sys::state& state, dcon::nation_id source, bool join_attacker);
696bool can_take_sides_in_crisis(sys::state& state, dcon::nation_id source, bool join_attacker);
697
698void change_stockpile_settings(sys::state& state, dcon::nation_id source, dcon::commodity_id c, float target_amount, bool draw_on_stockpiles);
699bool can_change_stockpile_settings(sys::state& state, dcon::nation_id source, dcon::commodity_id c, float target_amount, bool draw_on_stockpiles);
700
701void take_decision(sys::state& state, dcon::nation_id source, dcon::decision_id d);
702bool can_take_decision(sys::state& state, dcon::nation_id source, dcon::decision_id d);
703
704void make_event_choice(sys::state& state, event::pending_human_n_event const& e, uint8_t option_id);
706void make_event_choice(sys::state& state, event::pending_human_p_event const& e, uint8_t option_id);
708
709void fabricate_cb(sys::state& state, dcon::nation_id source, dcon::nation_id target, dcon::cb_type_id type, dcon::state_definition_id target_state = dcon::state_definition_id{});
710bool can_fabricate_cb(sys::state& state, dcon::nation_id source, dcon::nation_id target, dcon::cb_type_id type, dcon::state_definition_id target_state = dcon::state_definition_id{});
711
712void cancel_cb_fabrication(sys::state& state, dcon::nation_id source);
713bool can_cancel_cb_fabrication(sys::state& state, dcon::nation_id source);
714
715void ask_for_military_access(sys::state& state, dcon::nation_id asker, dcon::nation_id target);
716bool can_ask_for_access(sys::state& state, dcon::nation_id asker, dcon::nation_id target, bool ignore_cost = false);
717
718void give_military_access(sys::state& state, dcon::nation_id asker, dcon::nation_id target);
719bool can_give_military_access(sys::state& state, dcon::nation_id asker, dcon::nation_id target, bool ignore_cost = false);
720
721void ask_for_alliance(sys::state& state, dcon::nation_id asker, dcon::nation_id target);
722bool can_ask_for_alliance(sys::state& state, dcon::nation_id asker, dcon::nation_id target, bool ignore_cost = false);
723void execute_ask_for_alliance(sys::state& state, dcon::nation_id asker, dcon::nation_id target);
724
725void toggle_interested_in_alliance(sys::state& state, dcon::nation_id asker, dcon::nation_id target);
726bool can_toggle_interested_in_alliance(sys::state& state, dcon::nation_id asker, dcon::nation_id target);
727
728void call_to_arms(sys::state& state, dcon::nation_id asker, dcon::nation_id target, dcon::war_id w);
729void execute_call_to_arms(sys::state& state, dcon::nation_id asker, dcon::nation_id target, dcon::war_id w);
730bool can_call_to_arms(sys::state& state, dcon::nation_id asker, dcon::nation_id target, dcon::war_id w, bool ignore_cost = false);
731
732void respond_to_diplomatic_message(sys::state& state, dcon::nation_id source, dcon::nation_id from, diplomatic_message::type type, bool accept);
733
734void cancel_military_access(sys::state& state, dcon::nation_id source, dcon::nation_id target);
735bool can_cancel_military_access(sys::state& state, dcon::nation_id source, dcon::nation_id target, bool ignore_cost = false);
736
737void cancel_alliance(sys::state& state, dcon::nation_id source, dcon::nation_id target);
738bool can_cancel_alliance(sys::state& state, dcon::nation_id source, dcon::nation_id target, bool ignore_cost = false);
739void execute_cancel_alliance(sys::state& state, dcon::nation_id source, dcon::nation_id target);
740
741void cancel_given_military_access(sys::state& state, dcon::nation_id source, dcon::nation_id target); // this is for cancelling the access someone has with you
742bool can_cancel_given_military_access(sys::state& state, dcon::nation_id source, dcon::nation_id target, bool ignore_cost = false);
743
744void declare_war(sys::state& state, dcon::nation_id source, dcon::nation_id target, dcon::cb_type_id primary_cb, dcon::state_definition_id cb_state, dcon::national_identity_id cb_tag, dcon::nation_id cb_secondary_nation, bool call_attacker_allies, bool run_conference);
745bool can_declare_war(sys::state& state, dcon::nation_id source, dcon::nation_id target, dcon::cb_type_id primary_cb, dcon::state_definition_id cb_state, dcon::national_identity_id cb_tag, dcon::nation_id cb_secondary_nation);
746void execute_declare_war(sys::state& state, dcon::nation_id source, dcon::nation_id target, dcon::cb_type_id primary_cb, dcon::state_definition_id cb_state, dcon::national_identity_id cb_tag, dcon::nation_id cb_secondary_nation, bool call_attacker_allies, bool run_conference);
747
748void add_war_goal(sys::state& state, dcon::nation_id source, dcon::war_id w, dcon::nation_id target, dcon::cb_type_id primary_cb, dcon::state_definition_id cb_state, dcon::national_identity_id cb_tag, dcon::nation_id cb_secondary_nation);
749bool can_add_war_goal(sys::state& state, dcon::nation_id source, dcon::war_id w, dcon::nation_id target, dcon::cb_type_id primary_cb, dcon::state_definition_id cb_state, dcon::national_identity_id cb_tag, dcon::nation_id cb_secondary_nation);
750
751// NOTE: sending an invalid province id will stop movement of an army or navy;
752// otherwise path will be appended to its current destination if any
753// Thus, if you want to move the unit to a new location from its current location,
754// first stop its current movement and then send the new destination as a second command
755// ALSO: can returns an empty vector if no path could be made
756void move_army(sys::state& state, dcon::nation_id source, dcon::army_id a, dcon::province_id dest, bool reset);
757std::vector<dcon::province_id> calculate_army_path(sys::state& state, dcon::nation_id source, dcon::army_id a, dcon::province_id last_province, dcon::province_id dest);
758
759std::vector<dcon::province_id> can_move_army(sys::state& state, dcon::nation_id source, dcon::army_id a, dcon::province_id dest);
760
761void move_navy(sys::state& state, dcon::nation_id source, dcon::navy_id n, dcon::province_id dest, bool reset);
762std::vector<dcon::province_id> calculate_navy_path(sys::state & state, dcon::nation_id source, dcon::navy_id n, dcon::province_id last_province, dcon::province_id dest);
763std::vector<dcon::province_id> can_move_navy(sys::state& state, dcon::nation_id source, dcon::navy_id n, dcon::province_id dest);
764
765
766// This command is used for getting armies in/out of transports while those transports are docked in port
767// If the army is already embarked, it will disembark; if it is not embarked it will embark
768// Embarking an army onto/off a ship that is off the coast is done by moving the army into the sea/land tile instead.
769void embark_army(sys::state& state, dcon::nation_id source, dcon::army_id a);
770bool can_embark_army(sys::state& state, dcon::nation_id source, dcon::army_id a);
771
772void merge_armies(sys::state& state, dcon::nation_id source, dcon::army_id a, dcon::army_id b);
773bool can_merge_armies(sys::state& state, dcon::nation_id source, dcon::army_id a, dcon::army_id b);
774
775void merge_navies(sys::state& state, dcon::nation_id source, dcon::navy_id a, dcon::navy_id b);
776bool can_merge_navies(sys::state& state, dcon::nation_id source, dcon::navy_id a, dcon::navy_id b);
777
778void split_army(sys::state& state, dcon::nation_id source, dcon::army_id a);
779bool can_split_army(sys::state& state, dcon::nation_id source, dcon::army_id a);
780
781void disband_undermanned_regiments(sys::state& state, dcon::nation_id source, dcon::army_id a);
782bool can_disband_undermanned_regiments(sys::state& state, dcon::nation_id source, dcon::army_id a);
783
784void split_navy(sys::state& state, dcon::nation_id source, dcon::navy_id a);
785bool can_split_navy(sys::state& state, dcon::nation_id source, dcon::navy_id a);
786
787void change_unit_type(sys::state& state, dcon::nation_id source, dcon::regiment_id regiments[num_packed_units], dcon::ship_id ships[num_packed_units], dcon::unit_type_id new_type);
788bool can_change_unit_type(sys::state& state, dcon::nation_id source, dcon::regiment_id regiments[num_packed_units], dcon::ship_id ships[num_packed_units], dcon::unit_type_id new_type);
789void execute_change_unit_type(sys::state& state, dcon::nation_id source, dcon::regiment_id regiments[num_packed_units], dcon::ship_id ships[num_packed_units], dcon::unit_type_id new_type);
790
791void evenly_split_army(sys::state& state, dcon::nation_id source, dcon::army_id a);
792bool can_evenly_split_army(sys::state& state, dcon::nation_id source, dcon::army_id a);
793
794void toggle_rebel_hunting(sys::state& state, dcon::nation_id source, dcon::army_id a);
795void toggle_unit_ai_control(sys::state& state, dcon::nation_id source, dcon::army_id a);
796void toggle_mobilized_is_ai_controlled(sys::state& state, dcon::nation_id source);
797
798void evenly_split_navy(sys::state& state, dcon::nation_id source, dcon::navy_id a);
799bool can_evenly_split_navy(sys::state& state, dcon::nation_id source, dcon::navy_id a);
800
801void delete_army(sys::state& state, dcon::nation_id source, dcon::army_id a);
802bool can_delete_army(sys::state& state, dcon::nation_id source, dcon::army_id a);
803
804void delete_navy(sys::state& state, dcon::nation_id source, dcon::navy_id a);
805bool can_delete_navy(sys::state& state, dcon::nation_id source, dcon::navy_id a);
806
807// Each ship / regiment carries a "to split" flag. When the split command is sent, any marked units will be split off into
808// a new army / navy and their split flag will be unset
809// The commands below *toggle* the split flag (you can also use them to turn the flag off)
810// Fill any unused slots with the invalid handle, but remember that each of these requires some network traffic
811void mark_regiments_to_split(sys::state& state, dcon::nation_id source,
812 std::array<dcon::regiment_id, num_packed_units> const& list);
813void mark_ships_to_split(sys::state& state, dcon::nation_id source, std::array<dcon::ship_id, num_packed_units> const& list);
814
815void retreat_from_naval_battle(sys::state& state, dcon::nation_id source, dcon::naval_battle_id b);
816bool can_retreat_from_naval_battle(sys::state& state, dcon::nation_id source, dcon::naval_battle_id b);
817
818void retreat_from_land_battle(sys::state& state, dcon::nation_id source, dcon::land_battle_id b);
819bool can_retreat_from_land_battle(sys::state& state, dcon::nation_id source, dcon::land_battle_id b);
820
821void change_general(sys::state& state, dcon::nation_id source, dcon::army_id a, dcon::leader_id l);
822bool can_change_general(sys::state& state, dcon::nation_id source, dcon::army_id a, dcon::leader_id l);
823
824void change_admiral(sys::state& state, dcon::nation_id source, dcon::navy_id a, dcon::leader_id l);
825bool can_change_admiral(sys::state& state, dcon::nation_id source, dcon::navy_id a, dcon::leader_id l);
826
827void invite_to_crisis(sys::state& state, dcon::nation_id source, dcon::nation_id invitation_to, dcon::nation_id target, dcon::cb_type_id primary_cb, dcon::state_definition_id cb_state, dcon::national_identity_id cb_tag, dcon::nation_id cb_secondary_nation);
828bool can_invite_to_crisis(sys::state& state, dcon::nation_id source, dcon::nation_id invitation_to, dcon::nation_id target, dcon::cb_type_id primary_cb, dcon::state_definition_id cb_state, dcon::national_identity_id cb_tag, dcon::nation_id cb_secondary_nation);
829
830bool crisis_can_add_wargoal(sys::state& state, dcon::nation_id source, sys::full_wg wg);
831void queue_crisis_add_wargoal(sys::state& state, dcon::nation_id source, sys::full_wg wg);
832void execute_crisis_add_wargoal(sys::state& state, dcon::nation_id source, new_war_goal_data const& data);
833
834void toggle_mobilization(sys::state& state, dcon::nation_id source);
835
836void enable_debt(sys::state& state, dcon::nation_id source, bool debt_is_enabled);
837
838void move_capital(sys::state& state, dcon::nation_id source, dcon::province_id p);
839bool can_move_capital(sys::state& state, dcon::nation_id source, dcon::province_id p);
840
841void take_province(sys::state& state, dcon::nation_id source, dcon::province_id prov);
842bool can_take_province(sys::state& state, dcon::nation_id source, dcon::province_id p);
843void execute_take_province(sys::state& state, dcon::nation_id source, dcon::province_id p);
844
845void use_province_button(sys::state& state, dcon::nation_id source, dcon::gui_def_id d, dcon::province_id p);
846bool can_use_province_button(sys::state& state, dcon::nation_id source, dcon::gui_def_id d, dcon::province_id p);
847
848void use_nation_button(sys::state& state, dcon::nation_id source, dcon::gui_def_id d, dcon::nation_id n);
849bool can_use_nation_button(sys::state& state, dcon::nation_id source, dcon::gui_def_id d, dcon::nation_id n);
850
851/*
852PEACE OFFER COMMANDS:
853
854IMPORTANT:
855Even though these are separate commands, they should be sent as a single sequence with no intermediate other commands:
856send start_peace_offer then repeat add_to_peace_offer to populate it, and then send_peace_offer to finish the process
857DO NOT attempt to issue these commands as the player constructs the offer in the ui
858Note that crisis offers are constructed in basically the same way. You cannot have a normal peace offer under construction / in
859flight while constructing / offering a crisis peace offer
860*/
861
862void start_peace_offer(sys::state& state, dcon::nation_id source, dcon::nation_id target, dcon::war_id war, bool is_concession);
863bool can_start_peace_offer(sys::state& state, dcon::nation_id source, dcon::nation_id target, dcon::war_id war, bool is_concession);
864void execute_start_peace_offer(sys::state& state, dcon::nation_id source, dcon::nation_id target, dcon::war_id war, bool is_concession);
865
866void add_to_peace_offer(sys::state& state, dcon::nation_id source, dcon::wargoal_id goal);
867bool can_add_to_peace_offer(sys::state& state, dcon::nation_id source, dcon::wargoal_id goal);
868void execute_add_to_peace_offer(sys::state& state, dcon::nation_id source, dcon::wargoal_id goal);
869
870void send_peace_offer(sys::state& state, dcon::nation_id source);
871bool can_send_peace_offer(sys::state& state, dcon::nation_id source);
872void execute_send_peace_offer(sys::state& state, dcon::nation_id source);
873
874// CRISIS PEACE OFFER COMMANDS
875
876void start_crisis_peace_offer(sys::state& state, dcon::nation_id source, bool is_concession);
877bool can_start_crisis_peace_offer(sys::state& state, dcon::nation_id source, bool is_concession);
878void execute_start_crisis_peace_offer(sys::state& state, dcon::nation_id source, bool is_concession);
879
880void add_to_crisis_peace_offer(sys::state& state, dcon::nation_id source, dcon::nation_id wargoal_from, dcon::nation_id target, dcon::cb_type_id primary_cb, dcon::state_definition_id cb_state, dcon::national_identity_id cb_tag, dcon::nation_id cb_secondary_nation);
881bool can_add_to_crisis_peace_offer(sys::state& state, dcon::nation_id source, dcon::nation_id wargoal_from, dcon::nation_id target, dcon::cb_type_id primary_cb, dcon::state_definition_id cb_state, dcon::national_identity_id cb_tag, dcon::nation_id cb_secondary_nation);
882
883void send_crisis_peace_offer(sys::state& state, dcon::nation_id source);
884bool can_send_crisis_peace_offer(sys::state& state, dcon::nation_id source);
885void execute_send_crisis_peace_offer(sys::state& state, dcon::nation_id source);
886
887void toggle_select_province(sys::state& state, dcon::nation_id source, dcon::province_id p);
888bool can_toggle_select_province(sys::state& state, dcon::nation_id source, dcon::province_id p);
889
890void toggle_immigrator_province(sys::state& state, dcon::nation_id source, dcon::province_id prov);
891bool can_toggle_immigrator_province(sys::state& state, dcon::nation_id source, dcon::province_id prov);
892
894void chat_message(sys::state& state, dcon::nation_id source, std::string_view body, dcon::nation_id target);
895bool can_chat_message(sys::state& state, dcon::nation_id source, std::string_view body, dcon::nation_id target);
896
897void release_subject(sys::state& state, dcon::nation_id source, dcon::nation_id target);
898bool can_release_subject(sys::state& state, dcon::nation_id source, dcon::nation_id target);
899
900void state_transfer(sys::state& state, dcon::nation_id asker, dcon::nation_id target, dcon::state_definition_id sid);
901bool can_state_transfer(sys::state& state, dcon::nation_id asker, dcon::nation_id target, dcon::state_definition_id sid);
902
903void advance_tick(sys::state& state, dcon::nation_id source);
904void notify_player_ban(sys::state& state, dcon::nation_id source, dcon::nation_id target);
905bool can_notify_player_ban(sys::state& state, dcon::nation_id source, dcon::nation_id target);
906void notify_player_kick(sys::state& state, dcon::nation_id source, dcon::nation_id target);
907bool can_notify_player_kick(sys::state& state, dcon::nation_id source, dcon::nation_id target);
908void notify_player_joins(sys::state& state, dcon::nation_id source, sys::player_name& name, sys::player_password_raw& password);
909bool can_notify_player_joins(sys::state& state, dcon::nation_id source, sys::player_name& name);
910void notify_player_leaves(sys::state& state, dcon::nation_id source, bool make_ai);
911bool can_notify_player_leaves(sys::state& state, dcon::nation_id source, bool make_ai);
912void notify_player_picks_nation(sys::state& state, dcon::nation_id source, dcon::nation_id target);
913bool can_notify_player_picks_nation(sys::state& state, dcon::nation_id source, dcon::nation_id target);
914void notify_player_oos(sys::state& state, dcon::nation_id source);
915void notify_save_loaded(sys::state& state, dcon::nation_id source);
916void notify_reload(sys::state& state, dcon::nation_id source);
917void notify_start_game(sys::state& state, dcon::nation_id source);
918void notify_stop_game(sys::state& state, dcon::nation_id source);
919void notify_pause_game(sys::state& state, dcon::nation_id source);
920
921void execute_command(sys::state& state, payload& c);
923bool can_perform_command(sys::state& state, payload& c);
924
926void network_inactivity_ping(sys::state& state, dcon::nation_id source, sys::date date);
927void execute_network_inactivity_ping(sys::state& state, dcon::nation_id source, sys::date date);
928
929} // namespace command
930
bool can_state_transfer(sys::state &state, dcon::nation_id asker, dcon::nation_id target, dcon::state_definition_id sid)
Definition: commands.cpp:2462
bool can_increase_opinion(sys::state &state, dcon::nation_id source, dcon::nation_id influence_target)
Definition: commands.cpp:1302
void execute_send_peace_offer(sys::state &state, dcon::nation_id source)
Definition: commands.cpp:3159
bool can_cancel_military_access(sys::state &state, dcon::nation_id source, dcon::nation_id target, bool ignore_cost)
Definition: commands.cpp:2587
void mark_ships_to_split(sys::state &state, dcon::nation_id source, std::array< dcon::ship_id, num_packed_units > const &list)
Definition: commands.cpp:4417
constexpr size_t num_packed_units
Definition: commands.hpp:414
void execute_network_inactivity_ping(sys::state &state, dcon::nation_id source, sys::date date)
Definition: commands.cpp:5281
budget_settings_data make_empty_budget_settings()
Definition: commands.hpp:617
bool can_start_research(sys::state &state, dcon::nation_id source, dcon::technology_id tech)
Definition: commands.cpp:188
bool can_release_subject(sys::state &state, dcon::nation_id source, dcon::nation_id target)
Definition: commands.cpp:4042
bool can_send_crisis_peace_offer(sys::state &state, dcon::nation_id source)
Definition: commands.cpp:3222
bool can_expel_advisors(sys::state &state, dcon::nation_id source, dcon::nation_id influence_target, dcon::nation_id affected_gp)
Definition: commands.cpp:1161
void start_land_unit_construction(sys::state &state, dcon::nation_id source, dcon::province_id location, dcon::culture_id soldier_culture, dcon::unit_type_id type, dcon::province_id template_province)
Definition: commands.cpp:694
void enact_issue(sys::state &state, dcon::nation_id source, dcon::issue_option_id i)
Definition: commands.cpp:1907
bool can_change_unit_type(sys::state &state, dcon::nation_id source, dcon::regiment_id regiments[num_packed_units], dcon::ship_id ships[num_packed_units], dcon::unit_type_id new_type)
Definition: commands.cpp:3909
bool can_add_to_sphere(sys::state &state, dcon::nation_id source, dcon::nation_id influence_target)
Definition: commands.cpp:1439
bool can_invite_to_crisis(sys::state &state, dcon::nation_id source, dcon::nation_id invitation_to, dcon::nation_id target, dcon::cb_type_id primary_cb, dcon::state_definition_id cb_state, dcon::national_identity_id cb_tag, dcon::nation_id cb_secondary_nation)
Definition: commands.cpp:4506
bool can_give_war_subsidies(sys::state &state, dcon::nation_id source, dcon::nation_id target)
Definition: commands.cpp:259
bool can_add_war_goal(sys::state &state, dcon::nation_id source, dcon::war_id w, dcon::nation_id target, dcon::cb_type_id cb_type, dcon::state_definition_id cb_state, dcon::national_identity_id cb_tag, dcon::nation_id cb_secondary_nation)
Definition: commands.cpp:2838
bool can_change_admiral(sys::state &state, dcon::nation_id source, dcon::navy_id a, dcon::leader_id l)
Definition: commands.cpp:4386
bool is_console_command(command_type t)
Definition: commands.cpp:21
void execute_start_crisis_peace_offer(sys::state &state, dcon::nation_id source, bool is_concession)
Definition: commands.cpp:2998
bool can_give_military_access(sys::state &state, dcon::nation_id asker, dcon::nation_id target, bool ignore_cost)
Definition: commands.cpp:2349
void execute_call_to_arms(sys::state &state, dcon::nation_id asker, dcon::nation_id target, dcon::war_id w)
Definition: commands.cpp:2538
void toggle_rebel_hunting(sys::state &state, dcon::nation_id source, dcon::army_id a)
Definition: commands.cpp:3814
void execute_take_province(sys::state &state, dcon::nation_id source, dcon::province_id p)
Definition: commands.cpp:4779
bool can_cancel_war_subsidies(sys::state &state, dcon::nation_id source, dcon::nation_id target)
Definition: commands.cpp:304
bool can_cancel_factory_building_construction(sys::state &state, dcon::nation_id source, dcon::state_instance_id location, dcon::factory_type_id type)
Definition: commands.cpp:474
bool can_notify_player_joins(sys::state &state, dcon::nation_id source, sys::player_name &name)
Definition: commands.cpp:4909
bool can_change_general(sys::state &state, dcon::nation_id source, dcon::army_id a, dcon::leader_id l)
Definition: commands.cpp:4367
bool can_intervene_in_war(sys::state &state, dcon::nation_id source, dcon::war_id w, bool for_attacker)
Definition: commands.cpp:1697
bool can_release_and_play_as(sys::state &state, dcon::nation_id source, dcon::national_identity_id t)
Definition: commands.cpp:931
void execute_declare_war(sys::state &state, dcon::nation_id source, dcon::nation_id target, dcon::cb_type_id primary_cb, dcon::state_definition_id cb_state, dcon::national_identity_id cb_tag, dcon::nation_id cb_secondary_nation, bool call_attacker_allies, bool run_conference)
Definition: commands.cpp:2746
bool can_delete_factory(sys::state &state, dcon::nation_id source, dcon::factory_id f)
Definition: commands.cpp:802
bool can_begin_factory_building_construction(sys::state &state, dcon::nation_id source, dcon::state_instance_id location, dcon::factory_type_id type, bool is_upgrade)
Definition: commands.cpp:512
void give_war_subsidies(sys::state &state, dcon::nation_id source, dcon::nation_id target)
Definition: commands.cpp:251
bool can_call_to_arms(sys::state &state, dcon::nation_id asker, dcon::nation_id target, dcon::war_id w, bool ignore_cost)
Definition: commands.cpp:2517
bool can_appoint_ruling_party(sys::state &state, dcon::nation_id source, dcon::political_party_id p)
Definition: commands.cpp:1851
std::vector< dcon::province_id > calculate_navy_path(sys::state &state, dcon::nation_id source, dcon::navy_id n, dcon::province_id last_province, dcon::province_id dest)
Definition: commands.cpp:3541
bool can_begin_province_building_construction(sys::state &state, dcon::nation_id source, dcon::province_id p, economy::province_building_type type)
Definition: commands.cpp:423
bool can_start_election(sys::state &state, dcon::nation_id source)
Definition: commands.cpp:1032
bool can_delete_army(sys::state &state, dcon::nation_id source, dcon::army_id a)
Definition: commands.cpp:4324
void change_budget_settings(sys::state &state, dcon::nation_id source, budget_settings_data const &values)
Definition: commands.cpp:971
bool can_start_crisis_peace_offer(sys::state &state, dcon::nation_id source, bool is_concession)
Definition: commands.cpp:2989
bool can_fabricate_cb(sys::state &state, dcon::nation_id source, dcon::nation_id target, dcon::cb_type_id type, dcon::state_definition_id target_state)
Definition: commands.cpp:2224
void execute_crisis_add_wargoal(sys::state &state, dcon::nation_id source, new_war_goal_data const &data)
Definition: commands.cpp:4608
bool can_notify_player_leaves(sys::state &state, dcon::nation_id source, bool make_ai)
Definition: commands.cpp:4959
bool can_add_to_peace_offer(sys::state &state, dcon::nation_id source, dcon::wargoal_id goal)
Definition: commands.cpp:3013
bool can_ask_for_access(sys::state &state, dcon::nation_id asker, dcon::nation_id target, bool ignore_cost)
Definition: commands.cpp:2309
bool can_change_factory_settings(sys::state &state, dcon::nation_id source, dcon::factory_id f, uint8_t priority, bool subsidized)
Definition: commands.cpp:845
void start_naval_unit_construction(sys::state &state, dcon::nation_id source, dcon::province_id location, dcon::unit_type_id type, dcon::province_id template_province)
Definition: commands.cpp:635
void use_nation_button(sys::state &state, dcon::nation_id source, dcon::gui_def_id d, dcon::nation_id n)
Definition: commands.cpp:4832
void execute_add_to_sphere(sys::state &state, dcon::nation_id source, dcon::nation_id influence_target)
Definition: commands.cpp:1471
void execute_intervene_in_war(sys::state &state, dcon::nation_id source, dcon::war_id w, bool for_attacker)
Definition: commands.cpp:1780
bool can_increase_relations(sys::state &state, dcon::nation_id source, dcon::nation_id target)
Definition: commands.cpp:346
bool can_cancel_cb_fabrication(sys::state &state, dcon::nation_id source)
Definition: commands.cpp:2282
void retreat_from_land_battle(sys::state &state, dcon::nation_id source, dcon::land_battle_id b)
Definition: commands.cpp:4463
void mark_regiments_to_split(sys::state &state, dcon::nation_id source, std::array< dcon::regiment_id, num_packed_units > const &list)
Definition: commands.cpp:4396
bool can_upgrade_colony_to_state(sys::state &state, dcon::nation_id source, dcon::state_instance_id si)
Definition: commands.cpp:1576
bool can_civilize_nation(sys::state &state, dcon::nation_id source)
Definition: commands.cpp:1836
bool can_set_national_focus(sys::state &state, dcon::nation_id source, dcon::state_instance_id target_state, dcon::national_focus_id focus)
Definition: commands.cpp:122
void evenly_split_army(sys::state &state, dcon::nation_id source, dcon::army_id a)
Definition: commands.cpp:4110
bool can_retreat_from_land_battle(sys::state &state, dcon::nation_id source, dcon::land_battle_id b)
Definition: commands.cpp:4472
bool can_use_province_button(sys::state &state, dcon::nation_id source, dcon::gui_def_id d, dcon::province_id p)
Definition: commands.cpp:4816
void release_and_play_as(sys::state &state, dcon::nation_id source, dcon::national_identity_id t)
Definition: commands.cpp:923
bool can_enact_reform(sys::state &state, dcon::nation_id source, dcon::reform_option_id r)
Definition: commands.cpp:1891
std::vector< dcon::province_id > calculate_army_path(sys::state &state, dcon::nation_id source, dcon::army_id a, dcon::province_id last_province, dcon::province_id dest)
Definition: commands.cpp:3303
bool can_set_factory_type_priority(sys::state &state, dcon::nation_id source, dcon::factory_type_id ftid, float value)
Definition: commands.cpp:243
bool can_evenly_split_army(sys::state &state, dcon::nation_id source, dcon::army_id a)
Definition: commands.cpp:4118
bool can_abandon_colony(sys::state &state, dcon::nation_id source, dcon::province_id pr)
Definition: commands.cpp:1637
bool can_ban_embassy(sys::state &state, dcon::nation_id source, dcon::nation_id influence_target, dcon::nation_id affected_gp)
Definition: commands.cpp:1231
void execute_start_peace_offer(sys::state &state, dcon::nation_id source, dcon::nation_id target, dcon::war_id war, bool is_concession)
Definition: commands.cpp:2973
bool can_decrease_relations(sys::state &state, dcon::nation_id source, dcon::nation_id target)
Definition: commands.cpp:386
bool can_move_capital(sys::state &state, dcon::nation_id source, dcon::province_id p)
Definition: commands.cpp:4713
void set_national_focus(sys::state &state, dcon::nation_id source, dcon::state_instance_id target_state, dcon::national_focus_id focus)
Definition: commands.cpp:111
bool can_start_peace_offer(sys::state &state, dcon::nation_id source, dcon::nation_id target, dcon::war_id war, bool is_concession)
Definition: commands.cpp:2932
bool can_notify_player_kick(sys::state &state, dcon::nation_id source, dcon::nation_id target)
Definition: commands.cpp:5027
bool can_toggle_select_province(sys::state &state, dcon::nation_id source, dcon::province_id prov)
Definition: commands.cpp:4004
void queue_crisis_add_wargoal(sys::state &state, dcon::nation_id source, sys::full_wg wg)
Definition: commands.cpp:4595
bool can_start_land_unit_construction(sys::state &state, dcon::nation_id source, dcon::province_id location, dcon::culture_id soldier_culture, dcon::unit_type_id type, dcon::province_id template_province)
Definition: commands.cpp:705
void execute_remove_from_sphere(sys::state &state, dcon::nation_id source, dcon::nation_id influence_target, dcon::nation_id affected_gp)
Definition: commands.cpp:1532
bool can_evenly_split_navy(sys::state &state, dcon::nation_id source, dcon::navy_id a)
Definition: commands.cpp:4174
void execute_send_crisis_peace_offer(sys::state &state, dcon::nation_id source)
Definition: commands.cpp:3233
void add_to_crisis_peace_offer(sys::state &state, dcon::nation_id source, dcon::nation_id wargoal_from, dcon::nation_id target, dcon::cb_type_id primary_cb, dcon::state_definition_id cb_state, dcon::national_identity_id cb_tag, dcon::nation_id cb_secondary_nation)
Definition: commands.cpp:3076
void retreat_from_naval_battle(sys::state &state, dcon::nation_id source, dcon::naval_battle_id b)
Definition: commands.cpp:4436
void execute_increase_opinion(sys::state &state, dcon::nation_id source, dcon::nation_id influence_target)
Definition: commands.cpp:1330
bool can_disband_undermanned_regiments(sys::state &state, dcon::nation_id source, dcon::army_id a)
Definition: commands.cpp:3799
bool can_take_sides_in_crisis(sys::state &state, dcon::nation_id source, bool join_attacker)
Definition: commands.cpp:1982
bool crisis_can_add_wargoal(sys::state &state, dcon::nation_id source, sys::full_wg wg)
Definition: commands.cpp:4625
bool can_change_stockpile_settings(sys::state &state, dcon::nation_id source, dcon::commodity_id c, float target_amount, bool draw_on_stockpiles)
Definition: commands.cpp:2021
void disband_undermanned_regiments(sys::state &state, dcon::nation_id source, dcon::army_id a)
Definition: commands.cpp:3791
bool can_take_decision(sys::state &state, dcon::nation_id source, dcon::decision_id d)
Definition: commands.cpp:2052
void enact_reform(sys::state &state, dcon::nation_id source, dcon::reform_option_id r)
Definition: commands.cpp:1883
bool can_make_leader(sys::state &state, dcon::nation_id source, bool general)
Definition: commands.cpp:227
bool can_send_peace_offer(sys::state &state, dcon::nation_id source)
Definition: commands.cpp:3153
bool can_cancel_land_unit_construction(sys::state &state, dcon::nation_id source, dcon::province_id location, dcon::culture_id soldier_culture, dcon::unit_type_id type)
Definition: commands.cpp:778
void execute_add_to_peace_offer(sys::state &state, dcon::nation_id source, dcon::wargoal_id goal)
Definition: commands.cpp:3071
bool can_make_vassal(sys::state &state, dcon::nation_id source, dcon::national_identity_id t)
Definition: commands.cpp:904
bool can_merge_navies(sys::state &state, dcon::nation_id source, dcon::navy_id a, dcon::navy_id b)
Definition: commands.cpp:3744
void notify_console_command(sys::state &state)
Definition: commands.cpp:4051
bool can_discredit_advisors(sys::state &state, dcon::nation_id source, dcon::nation_id influence_target, dcon::nation_id affected_gp)
Definition: commands.cpp:1086
bool can_add_to_crisis_peace_offer(sys::state &state, dcon::nation_id source, dcon::nation_id wargoal_from, dcon::nation_id target, dcon::cb_type_id primary_cb, dcon::state_definition_id cb_state, dcon::national_identity_id cb_tag, dcon::nation_id cb_secondary_nation)
Definition: commands.cpp:3091
bool can_cancel_naval_unit_construction(sys::state &state, dcon::nation_id source, dcon::province_id location, dcon::unit_type_id type)
Definition: commands.cpp:754
bool can_remove_from_sphere(sys::state &state, dcon::nation_id source, dcon::nation_id influence_target, dcon::nation_id affected_gp)
Definition: commands.cpp:1499
void execute_cancel_alliance(sys::state &state, dcon::nation_id source, dcon::nation_id target)
Definition: commands.cpp:2685
bool can_retreat_from_naval_battle(sys::state &state, dcon::nation_id source, dcon::naval_battle_id b)
Definition: commands.cpp:4444
bool can_change_budget_settings(sys::state &state, dcon::nation_id source, budget_settings_data const &values)
Definition: commands.cpp:967
bool can_become_interested_in_crisis(sys::state &state, dcon::nation_id source)
Definition: commands.cpp:1939
bool can_split_navy(sys::state &state, dcon::nation_id source, dcon::navy_id a)
Definition: commands.cpp:4277
bool can_decrease_opinion(sys::state &state, dcon::nation_id source, dcon::nation_id influence_target, dcon::nation_id affected_gp)
Definition: commands.cpp:1360
command_type
Definition: commands.hpp:9
bool can_suppress_movement(sys::state &state, dcon::nation_id source, dcon::movement_id m)
Definition: commands.cpp:1808
void post_chat_message(sys::state &state, ui::chat_message &m)
Definition: commands.cpp:4857
bool can_delete_navy(sys::state &state, dcon::nation_id source, dcon::navy_id a)
Definition: commands.cpp:4345
void use_province_button(sys::state &state, dcon::nation_id source, dcon::gui_def_id d, dcon::province_id i)
Definition: commands.cpp:4807
bool can_split_army(sys::state &state, dcon::nation_id source, dcon::army_id a)
Definition: commands.cpp:4229
bool can_invest_in_colony(sys::state &state, dcon::nation_id source, dcon::province_id p)
Definition: commands.cpp:1591
bool can_chat_message(sys::state &state, dcon::nation_id source, std::string_view body, dcon::nation_id target)
Definition: commands.cpp:4889
bool can_cancel_alliance(sys::state &state, dcon::nation_id source, dcon::nation_id target, bool ignore_cost)
Definition: commands.cpp:2665
bool can_notify_player_ban(sys::state &state, dcon::nation_id source, dcon::nation_id target)
Definition: commands.cpp:4993
void evenly_split_navy(sys::state &state, dcon::nation_id source, dcon::navy_id a)
Definition: commands.cpp:4166
bool can_declare_war(sys::state &state, dcon::nation_id source, dcon::nation_id target, dcon::cb_type_id primary_cb, dcon::state_definition_id cb_state, dcon::national_identity_id cb_tag, dcon::nation_id cb_secondary_nation)
Definition: commands.cpp:2709
bool can_take_province(sys::state &state, dcon::nation_id source, dcon::province_id p)
Definition: commands.cpp:4752
bool can_embark_army(sys::state &state, dcon::nation_id source, dcon::army_id a)
Definition: commands.cpp:3633
bool can_toggle_interested_in_alliance(sys::state &state, dcon::nation_id asker, dcon::nation_id target)
Definition: commands.cpp:2439
void add_to_peace_offer(sys::state &state, dcon::nation_id source, dcon::wargoal_id goal)
Definition: commands.cpp:3005
bool can_use_nation_button(sys::state &state, dcon::nation_id source, dcon::gui_def_id d, dcon::nation_id n)
Definition: commands.cpp:4841
bool can_merge_armies(sys::state &state, dcon::nation_id source, dcon::army_id a, dcon::army_id b)
Definition: commands.cpp:3689
bool can_finish_colonization(sys::state &state, dcon::nation_id source, dcon::province_id p)
Definition: commands.cpp:1660
std::vector< dcon::province_id > can_move_navy(sys::state &state, dcon::nation_id source, dcon::navy_id n, dcon::province_id dest)
Definition: commands.cpp:3522
void make_event_choice(sys::state &state, event::pending_human_n_event const &e, uint8_t option_id)
Definition: commands.cpp:2087
bool can_notify_player_picks_nation(sys::state &state, dcon::nation_id source, dcon::nation_id target)
Definition: commands.cpp:5061
bool can_perform_command(sys::state &state, payload &c)
Definition: commands.cpp:5293
bool can_enact_issue(sys::state &state, dcon::nation_id source, dcon::issue_option_id i)
Definition: commands.cpp:1915
bool can_change_influence_priority(sys::state &state, dcon::nation_id source, dcon::nation_id influence_target, uint8_t priority)
Definition: commands.cpp:1049
bool can_cancel_given_military_access(sys::state &state, dcon::nation_id source, dcon::nation_id target, bool ignore_cost)
Definition: commands.cpp:2626
bool can_toggle_immigrator_province(sys::state &state, dcon::nation_id source, dcon::province_id prov)
Definition: commands.cpp:4023
void execute_pending_commands(sys::state &state)
Definition: commands.cpp:6047
void execute_decrease_opinion(sys::state &state, dcon::nation_id source, dcon::nation_id influence_target, dcon::nation_id affected_gp)
Definition: commands.cpp:1404
bool can_ask_for_alliance(sys::state &state, dcon::nation_id asker, dcon::nation_id target, bool ignore_cost)
Definition: commands.cpp:2384
void execute_command(sys::state &state, payload &c)
Definition: commands.cpp:5666
void execute_change_unit_type(sys::state &state, dcon::nation_id source, dcon::regiment_id regiments[num_packed_units], dcon::ship_id ships[num_packed_units], dcon::unit_type_id new_type)
Definition: commands.cpp:3979
bool can_start_naval_unit_construction(sys::state &state, dcon::nation_id source, dcon::province_id location, dcon::unit_type_id type, dcon::province_id template_province)
Definition: commands.cpp:646
void execute_ask_for_alliance(sys::state &state, dcon::nation_id asker, dcon::nation_id target)
Definition: commands.cpp:2416
std::vector< dcon::province_id > can_move_army(sys::state &state, dcon::nation_id source, dcon::army_id a, dcon::province_id dest)
Definition: commands.cpp:3284
province_building_type
Definition: constants.hpp:578
slot_type
Definition: events.hpp:11
constexpr uint32_t max_chat_message_len
Definition: constants.hpp:586
uint uint32_t
uchar uint8_t
sys::checksum_key checksum
Definition: commands.hpp:459
dcon::province_id dest
Definition: commands.hpp:376
dcon::nation_id target
Definition: commands.hpp:290
dcon::state_definition_id target_state
Definition: commands.hpp:334
dcon::regiment_id regs[num_packed_units]
Definition: commands.hpp:424
dcon::ship_id ships[num_packed_units]
Definition: commands.hpp:425
dcon::unit_type_id new_type
Definition: commands.hpp:426
dcon::nation_id target
Definition: commands.hpp:451
char body[ui::max_chat_message_len]
Definition: commands.hpp:450
dcon::nation_id as
Definition: commands.hpp:437
dcon::invention_id invention
Definition: commands.hpp:441
dcon::province_id prov
Definition: commands.hpp:221
dcon::national_identity_id cb_tag
Definition: commands.hpp:360
dcon::state_definition_id cb_state
Definition: commands.hpp:359
dcon::nation_id cb_secondary_nation
Definition: commands.hpp:361
dcon::decision_id d
Definition: commands.hpp:275
dcon::nation_id target
Definition: commands.hpp:173
dcon::state_instance_id location
Definition: commands.hpp:167
dcon::factory_type_id type
Definition: commands.hpp:168
dcon::province_id location
Definition: commands.hpp:196
dcon::factory_type_id type
Definition: commands.hpp:197
dcon::nation_id influence_target
Definition: commands.hpp:207
dcon::nation_id influence_target
Definition: commands.hpp:212
dcon::issue_option_id r
Definition: commands.hpp:239
dcon::land_battle_id b
Definition: commands.hpp:411
dcon::nation_id from
Definition: commands.hpp:279
diplomatic_message::type type
Definition: commands.hpp:280
dcon::national_identity_id tag
Definition: commands.hpp:227
dcon::issue_option_id iopt
Definition: commands.hpp:226
dcon::nation_id target
Definition: commands.hpp:455
dcon::national_focus_id focus
Definition: commands.hpp:146
dcon::state_instance_id target_state
Definition: commands.hpp:145
dcon::naval_battle_id b
Definition: commands.hpp:407
dcon::province_id dest
Definition: commands.hpp:382
dcon::gui_def_id button
Definition: commands.hpp:140
dcon::nation_id id
Definition: commands.hpp:141
dcon::nation_id target
Definition: commands.hpp:366
dcon::nation_id target
Definition: commands.hpp:338
dcon::cb_type_id primary_cb
Definition: commands.hpp:342
dcon::state_definition_id cb_state
Definition: commands.hpp:339
dcon::national_identity_id cb_tag
Definition: commands.hpp:340
dcon::nation_id cb_secondary_nation
Definition: commands.hpp:341
dcon::cb_type_id cb_type
Definition: commands.hpp:353
dcon::state_definition_id cb_state
Definition: commands.hpp:349
dcon::nation_id target
Definition: commands.hpp:348
dcon::nation_id cb_secondary_nation
Definition: commands.hpp:351
dcon::national_identity_id cb_tag
Definition: commands.hpp:350
sys::player_name player_name
Definition: commands.hpp:465
sys::player_password_raw player_password
Definition: commands.hpp:466
sys::checksum_key checksum
Definition: commands.hpp:474
command_type type
Definition: commands.hpp:549
union command::payload::dtype data
dcon::nation_id source
Definition: commands.hpp:548
dcon::gui_def_id button
Definition: commands.hpp:136
dcon::province_id id
Definition: commands.hpp:137
dcon::free_national_event_id e
Definition: commands.hpp:309
dcon::free_provincial_event_id e
Definition: commands.hpp:326
dcon::national_event_id e
Definition: commands.hpp:300
dcon::provincial_event_id e
Definition: commands.hpp:317
dcon::political_party_id p
Definition: commands.hpp:231
dcon::province_id location
Definition: commands.hpp:162
economy::province_building_type type
Definition: commands.hpp:163
dcon::province_id location
Definition: commands.hpp:183
dcon::reform_option_id r
Definition: commands.hpp:235
dcon::factory_type_id factory
Definition: commands.hpp:445
dcon::regiment_id regs[num_packed_units]
Definition: commands.hpp:417
dcon::ship_id ships[num_packed_units]
Definition: commands.hpp:420
dcon::technology_id tech
Definition: commands.hpp:150
dcon::state_definition_id state
Definition: commands.hpp:286
dcon::national_identity_id ident
Definition: commands.hpp:203
Holds important data about the game world, state, and other data regarding windowing,...
save_game_data save_game
Definition: commands.hpp:535
war_target_data war_target
Definition: commands.hpp:496
influence_priority_data influence_priority
Definition: commands.hpp:494
rally_point_data rally_point
Definition: commands.hpp:531
new_general_data new_general
Definition: commands.hpp:527
pending_human_p_event_data pending_human_p_event
Definition: commands.hpp:506
call_to_arms_data call_to_arms
Definition: commands.hpp:511
set_factory_priority_data set_factory_priority_data
Definition: commands.hpp:544
naval_battle_data naval_battle
Definition: commands.hpp:524
pending_human_f_p_event_data pending_human_f_p_event
Definition: commands.hpp:507
army_movement_data army_movement
Definition: commands.hpp:517
generic_location_data generic_location
Definition: commands.hpp:495
cheat_location_data cheat_location
Definition: commands.hpp:538
budget_settings_data budget_data
Definition: commands.hpp:492
split_regiments_data split_regiments
Definition: commands.hpp:521
new_admiral_data new_admiral
Definition: commands.hpp:528
split_ships_data split_ships
Definition: commands.hpp:522
land_battle_data land_battle
Definition: commands.hpp:525
change_unit_type_data change_unit_type
Definition: commands.hpp:523
cheat_event_data cheat_event
Definition: commands.hpp:533
nation_pick_data nation_pick
Definition: commands.hpp:529
state_transfer_data state_transfer
Definition: commands.hpp:510
national_focus_data nat_focus
Definition: commands.hpp:482
message_data message
Definition: commands.hpp:509
influence_action_data influence_action
Definition: commands.hpp:493
crisis_invitation_data crisis_invitation
Definition: commands.hpp:526
pending_human_f_n_event_data pending_human_f_n_event
Definition: commands.hpp:505
naval_unit_construction_data naval_unit_construction
Definition: commands.hpp:488
movement_data movement
Definition: commands.hpp:497
new_war_goal_data new_war_goal
Definition: commands.hpp:513
cheat_data_int cheat_int
Definition: commands.hpp:532
province_building_data start_province_building
Definition: commands.hpp:485
crisis_join_data crisis_join
Definition: commands.hpp:501
chat_message_data chat_message
Definition: commands.hpp:530
factory_data factory
Definition: commands.hpp:491
political_party_data political_party
Definition: commands.hpp:498
new_offer_data new_offer
Definition: commands.hpp:514
pending_human_n_event_data pending_human_n_event
Definition: commands.hpp:504
diplo_action_data diplo_action
Definition: commands.hpp:486
nbutton_data nbutton
Definition: commands.hpp:541
new_war_data new_war
Definition: commands.hpp:512
stockpile_settings_data stockpile_settings
Definition: commands.hpp:502
notify_reload_data notify_reload
Definition: commands.hpp:537
advance_tick_data advance_tick
Definition: commands.hpp:534
navy_movement_data navy_movement
Definition: commands.hpp:518
factory_building_data start_factory_building
Definition: commands.hpp:487
land_unit_construction_data land_unit_construction
Definition: commands.hpp:489
make_leader_data make_leader
Definition: commands.hpp:484
notify_save_loaded_data notify_save_loaded
Definition: commands.hpp:536
offer_wargoal_data offer_wargoal
Definition: commands.hpp:515
tag_target_data tag_target
Definition: commands.hpp:490
start_research_data start_research
Definition: commands.hpp:483
cb_fabrication_data cb_fabrication
Definition: commands.hpp:508
notify_leaves_data notify_leave
Definition: commands.hpp:540
notify_joins_data notify_join
Definition: commands.hpp:539
cheat_invention_data_t cheat_invention_data
Definition: commands.hpp:543
decision_data decision
Definition: commands.hpp:503
merge_navy_data merge_navy
Definition: commands.hpp:520
reform_selection_data reform_selection
Definition: commands.hpp:499
merge_army_data merge_army
Definition: commands.hpp:519
pbutton_data pbutton
Definition: commands.hpp:542
issue_selection_data issue_selection
Definition: commands.hpp:500