2#include "dcon_generated.hpp"
120static_assert(
sizeof(unit_definition) ==
288bool war_goal_would_be_duplicate(
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);
358bool cb_instance_conditions_satisfied(
sys::state& state, dcon::nation_id actor, dcon::nation_id target, dcon::cb_type_id cb, dcon::state_definition_id st, dcon::national_identity_id tag, dcon::nation_id secondary);
359void add_cb(
sys::state& state, dcon::nation_id n, dcon::cb_type_id cb, dcon::nation_id target);
366dcon::war_id
create_war(
sys::state& state, dcon::nation_id primary_attacker, dcon::nation_id primary_defender,
367 dcon::cb_type_id primary_wargoal, dcon::state_definition_id primary_wargoal_state,
368 dcon::national_identity_id primary_wargoal_tag, dcon::nation_id primary_wargoal_secondary);
371void add_wargoal(
sys::state& state, dcon::war_id wfor, dcon::nation_id added_by, dcon::nation_id target, dcon::cb_type_id type,
372 dcon::state_definition_id sd, dcon::national_identity_id tag, dcon::nation_id secondary_nation);
373void add_to_war(
sys::state& state, dcon::war_id w, dcon::nation_id n,
bool as_attacker,
bool on_war_creation =
false);
379int32_t
peace_cost(
sys::state& state, dcon::war_id war, dcon::cb_type_id wargoal, dcon::nation_id from, dcon::nation_id target,
380 dcon::nation_id secondary_nation, dcon::state_definition_id wargoal_state, dcon::national_identity_id wargoal_t);
389 dcon::nation_id target);
404 dcon::nation_id target, dcon::nation_id secondary_nation, dcon::state_definition_id wargoal_state,
405 dcon::national_identity_id wargoal_t);
constexpr uint32_t po_transfer_provinces
constexpr uint32_t po_destroy_naval_bases
constexpr uint32_t po_reparations
constexpr uint32_t po_add_to_sphere
constexpr uint32_t po_demand_state
constexpr uint32_t po_install_communist_gov_type
constexpr uint32_t all_allowed_states
constexpr uint32_t po_annex
constexpr uint32_t po_status_quo
constexpr uint32_t is_triggered_only
constexpr uint32_t po_disarmament
constexpr uint32_t po_remove_prestige
constexpr uint32_t is_not_constructing_cb
constexpr uint32_t great_war_obligatory
constexpr uint32_t not_in_crisis
constexpr uint32_t po_remove_cores
constexpr uint32_t po_gunboat
constexpr uint32_t is_civil_war
constexpr uint32_t po_destroy_forts
constexpr uint32_t po_release_puppet
constexpr uint32_t po_clear_union_sphere
constexpr uint32_t po_make_puppet
constexpr uint32_t always
constexpr uint32_t po_colony
constexpr uint32_t po_uninstall_communist_gov_type
void execute_cb_discovery(sys::state &state, dcon::nation_id n)
bool province_is_under_siege(sys::state const &state, dcon::province_id ids)
bool are_allied_in_war(sys::state const &state, dcon::nation_id a, dcon::nation_id b)
float truce_break_cb_prestige_cost(sys::state &state, dcon::cb_type_id t)
bool cb_conditions_satisfied(sys::state &state, dcon::nation_id actor, dcon::nation_id target, dcon::cb_type_id cb)
int32_t naval_supply_points_used(sys::state &state, dcon::nation_id n)
float primary_warscore(sys::state &state, dcon::war_id w)
float mobilization_size(sys::state const &state, dcon::nation_id n)
void run_gc(sys::state &state)
float truce_break_cb_infamy(sys::state &state, dcon::cb_type_id t)
void update_naval_supply_points(sys::state &state)
void send_rebel_hunter_to_next_province(sys::state &state, dcon::army_id ar, dcon::province_id prov)
void army_arrives_in_province(sys::state &state, dcon::army_id a, dcon::province_id p, crossing_type crossing, dcon::land_battle_id from)
int32_t free_transport_capacity(sys::state &state, dcon::navy_id n)
void add_to_war(sys::state &state, dcon::war_id w, dcon::nation_id n, bool as_attacker, bool on_war_creation)
float recruited_pop_fraction(sys::state const &state, dcon::nation_id n)
int32_t total_regiments(sys::state &state, dcon::nation_id n)
void eject_ships(sys::state &state, dcon::province_id p)
uint8_t make_dice_rolls(sys::state &state, uint32_t seed)
float directed_warscore(sys::state &state, dcon::war_id w, dcon::nation_id primary, dcon::nation_id secondary)
void disband_regiment_w_pop_death(sys::state &state, dcon::regiment_id reg_id)
constexpr uint8_t defender_bonus_crossing_none
bool rebel_army_in_province(sys::state &state, dcon::province_id p)
int32_t defender_peace_cost(sys::state &state, dcon::war_id war)
constexpr uint8_t defender_bonus_crossing_river
void end_battle(sys::state &state, dcon::land_battle_id b, battle_result result)
bool can_use_cb_against(sys::state &state, dcon::nation_id from, dcon::nation_id target)
void remove_from_common_allied_wars(sys::state &state, dcon::nation_id a, dcon::nation_id b)
void navy_arrives_in_province(sys::state &state, dcon::navy_id n, dcon::province_id p, dcon::naval_battle_id from)
int32_t peace_offer_truce_months(sys::state &state, dcon::peace_offer_id offer)
dcon::pop_id find_available_soldier(sys::state &state, dcon::province_id p, dcon::culture_id pop_culture)
float reinforce_amount(sys::state &state, dcon::army_id a)
void apply_base_unit_stat_modifiers(sys::state &state)
void update_blockade_status(sys::state &state)
void end_wars_between(sys::state &state, dcon::nation_id a, dcon::nation_id b)
bool has_truce_with(sys::state &state, dcon::nation_id attacker, dcon::nation_id target)
int32_t regiments_under_construction_in_province(sys::state &state, dcon::province_id p)
float mobilization_impact(sys::state const &state, dcon::nation_id n)
void reject_peace_offer(sys::state &state, dcon::peace_offer_id offer)
void update_ticking_war_score(sys::state &state)
bool standard_war_joining_is_possible(sys::state &state, dcon::war_id wfor, dcon::nation_id n, bool as_attacker)
dcon::nation_id get_naval_battle_lead_defender(sys::state &state, dcon::naval_battle_id b)
void increase_dig_in(sys::state &state)
war_role get_role(sys::state const &state, dcon::war_id w, dcon::nation_id n)
constexpr uint8_t defender_bonus_dig_in_mask
int32_t main_culture_regiments_under_construction_in_province(sys::state &state, dcon::province_id p)
bool can_retreat_from_battle(sys::state &state, dcon::naval_battle_id battle)
void apply_attrition(sys::state &state)
void reset_unit_stats(sys::state &state)
float effective_army_speed(sys::state &state, dcon::army_id a)
int32_t attacker_peace_cost(sys::state &state, dcon::war_id war)
void update_land_battles(sys::state &state)
void update_battle_leaders(sys::state &state, dcon::land_battle_id b)
float attrition_amount(sys::state &state, dcon::navy_id a)
void remove_from_war(sys::state &state, dcon::war_id w, dcon::nation_id n, bool as_loss)
void update_cbs(sys::state &state)
void cleanup_war(sys::state &state, dcon::war_id w, war_result result)
bool is_attacker(sys::state &state, dcon::war_id w, dcon::nation_id n)
float local_enemy_army_weight_max(sys::state &state, dcon::province_id prov, dcon::nation_id nation)
dcon::ship_id create_new_ship(sys::state &state, dcon::nation_id n, dcon::unit_type_id t)
void cleanup_navy(sys::state &state, dcon::navy_id n)
void add_cb(sys::state &state, dcon::nation_id n, dcon::cb_type_id cb, dcon::nation_id target)
bool joining_as_attacker_would_break_truce(sys::state &state, dcon::nation_id a, dcon::war_id w)
bool is_defender_wargoal(sys::state const &state, dcon::war_id w, dcon::wargoal_id wg)
void regenerate_land_unit_average(sys::state &state)
dcon::nation_id get_land_battle_lead_attacker(sys::state &state, dcon::land_battle_id b)
void recover_org(sys::state &state)
void update_recruitable_regiments(sys::state &state, dcon::nation_id n)
float primary_warscore_from_blockades(sys::state &state, dcon::war_id w)
void add_wargoal(sys::state &state, dcon::war_id wfor, dcon::nation_id added_by, dcon::nation_id target, dcon::cb_type_id type, dcon::state_definition_id sd, dcon::national_identity_id tag, dcon::nation_id secondary_nation)
float cb_infamy(sys::state const &state, dcon::cb_type_id t)
constexpr uint8_t defender_bonus_crossing_mask
bool cb_requires_selection_of_a_valid_nation(sys::state const &state, dcon::cb_type_id t)
economy::commodity_set get_required_supply(sys::state &state, dcon::nation_id owner, dcon::army_id army)
int32_t mobilized_regiments_created_from_province(sys::state &state, dcon::province_id p)
bool are_in_common_war(sys::state const &state, dcon::nation_id a, dcon::nation_id b)
bool can_embark_onto_sea_tile(sys::state &state, dcon::nation_id from, dcon::province_id p, dcon::army_id a)
sys::date arrival_time_to(sys::state &state, dcon::army_id a, dcon::province_id p)
dcon::war_id find_war_between(sys::state const &state, dcon::nation_id a, dcon::nation_id b)
void advance_mobilizations(sys::state &state)
void update_movement(sys::state &state)
bool will_recieve_attrition(sys::state &state, dcon::navy_id a)
uint32_t naval_supply_from_naval_base(sys::state &state, dcon::province_id prov, dcon::nation_id nation)
int32_t regiments_possible_from_pop(sys::state &state, dcon::pop_id p)
dcon::war_id create_war(sys::state &state, dcon::nation_id primary_attacker, dcon::nation_id primary_defender, dcon::cb_type_id primary_wargoal, dcon::state_definition_id primary_wargoal_state, dcon::national_identity_id primary_wargoal_tag, dcon::nation_id primary_wargoal_secondary)
void reinforce_regiments(sys::state &state)
bool state_has_naval_base(sys::state const &state, dcon::state_instance_id si)
void move_land_to_merge(sys::state &state, dcon::nation_id by, dcon::army_id a, dcon::province_id start, dcon::province_id dest)
float crisis_cb_addition_infamy_cost(sys::state &state, dcon::cb_type_id type, dcon::nation_id from, dcon::nation_id target)
void add_truce(sys::state &state, dcon::nation_id a, dcon::nation_id b, int32_t days)
dcon::nation_id get_naval_battle_lead_attacker(sys::state &state, dcon::naval_battle_id b)
int32_t regiments_created_from_province(sys::state &state, dcon::province_id p)
void give_military_access(sys::state &state, dcon::nation_id accessing_nation, dcon::nation_id target)
void apply_regiment_damage(sys::state &state)
void monthly_leaders_update(sys::state &state)
float local_army_weight_max(sys::state &state, dcon::province_id prov)
bool cb_instance_conditions_satisfied(sys::state &state, dcon::nation_id actor, dcon::nation_id target, dcon::cb_type_id cb, dcon::state_definition_id st, dcon::national_identity_id tag, dcon::nation_id secondary)
float truce_break_cb_militancy(sys::state &state, dcon::cb_type_id t)
void update_naval_battles(sys::state &state)
float primary_warscore_from_battles(sys::state &state, dcon::war_id w)
dcon::province_id find_land_rally_pt(sys::state &state, dcon::nation_id by, dcon::province_id start)
dcon::regiment_id create_new_regiment(sys::state &state, dcon::nation_id n, dcon::unit_type_id t)
void update_siege_progress(sys::state &state)
void move_navy_to_merge(sys::state &state, dcon::nation_id by, dcon::navy_id a, dcon::province_id start, dcon::province_id dest)
void start_mobilization(sys::state &state, dcon::nation_id n)
void update_all_recruitable_regiments(sys::state &state)
float effective_navy_speed(sys::state &state, dcon::navy_id n)
float local_army_weight(sys::state &state, dcon::province_id prov)
void call_attacker_allies(sys::state &state, dcon::war_id wfor)
bool leader_is_in_combat(sys::state &state, dcon::leader_id l)
float primary_warscore_from_occupation(sys::state &state, dcon::war_id w)
int32_t mobilized_regiments_possible_from_province(sys::state &state, dcon::province_id p)
void remove_military_access(sys::state &state, dcon::nation_id accessing_nation, dcon::nation_id target)
bool are_at_war(sys::state const &state, dcon::nation_id a, dcon::nation_id b)
void set_initial_leaders(sys::state &state)
bool defenders_have_non_status_quo_wargoal(sys::state const &state, dcon::war_id w)
void invalidate_unowned_wargoals(sys::state &state)
int32_t main_culture_regiments_created_from_province(sys::state &state, dcon::province_id p)
void regenerate_total_regiment_counts(sys::state &state)
int32_t supply_limit_in_province(sys::state &state, dcon::nation_id n, dcon::province_id p)
float primary_warscore_from_war_goals(sys::state &state, dcon::war_id w)
void end_mobilization(sys::state &state, dcon::nation_id n)
bool attackers_have_status_quo_wargoal(sys::state const &state, dcon::war_id w)
int32_t transport_capacity(sys::state &state, dcon::navy_id n)
dcon::leader_id make_new_leader(sys::state &state, dcon::nation_id n, bool is_general)
void cleanup_army(sys::state &state, dcon::army_id n)
void repair_ships(sys::state &state)
constexpr uint8_t defender_bonus_crossing_sea
int32_t total_ships(sys::state &state, dcon::nation_id n)
void daily_leaders_update(sys::state &state)
void kill_leader(sys::state &state, dcon::leader_id l)
float relative_attrition_amount(sys::state &state, dcon::navy_id a, dcon::province_id prov)
bool joining_war_does_not_violate_constraints(sys::state const &state, dcon::nation_id a, dcon::war_id w, bool as_attacker)
void restore_unsaved_values(sys::state &state)
constexpr int32_t days_before_retreat
void implement_peace_offer(sys::state &state, dcon::peace_offer_id offer)
void call_defender_allies(sys::state &state, dcon::war_id wfor)
void implement_war_goal(sys::state &state, dcon::war_id war, dcon::cb_type_id wargoal, dcon::nation_id from, dcon::nation_id target, dcon::nation_id secondary_nation, dcon::state_definition_id wargoal_state, dcon::national_identity_id wargoal_t)
float get_leader_select_score(sys::state &state, dcon::leader_id l)
bool is_civil_war(sys::state const &state, dcon::war_id w)
bool pop_eligible_for_mobilization(sys::state &state, dcon::pop_id p)
int32_t regiments_max_possible_from_province(sys::state &state, dcon::province_id p)
int32_t naval_supply_points(sys::state &state, dcon::nation_id n)
bool cb_requires_selection_of_a_liberatable_tag(sys::state const &state, dcon::cb_type_id t)
bool state_claimed_in_war(sys::state &state, dcon::war_id w, dcon::nation_id from, dcon::nation_id target, dcon::state_definition_id cb_state)
dcon::nation_id get_land_battle_lead_defender(sys::state &state, dcon::land_battle_id b)
dcon::province_id find_naval_rally_pt(sys::state &state, dcon::nation_id by, dcon::province_id start)
void regenerate_ship_scores(sys::state &state)
void update_blackflag_status(sys::state &state, dcon::province_id p)
float peacetime_attrition_limit(sys::state &state, dcon::nation_id n, dcon::province_id prov)
int32_t peace_cost(sys::state &state, dcon::war_id war, dcon::cb_type_id wargoal, dcon::nation_id from, dcon::nation_id target, dcon::nation_id secondary_nation, dcon::state_definition_id wargoal_state, dcon::national_identity_id wargoal_tag)
std::string get_war_name(sys::state &, dcon::war_id)
int32_t main_culture_regiments_max_possible_from_province(sys::state &state, dcon::province_id p)
bool can_add_always_cb_to_war(sys::state &state, dcon::nation_id actor, dcon::nation_id target, dcon::cb_type_id cb, dcon::war_id w)
bool defenders_have_status_quo_wargoal(sys::state const &state, dcon::war_id w)
bool siege_potential(sys::state &state, dcon::nation_id army_controller, dcon::nation_id province_controller)
float fractional_distance_covered(sys::state &state, dcon::army_id a)
bool war_goal_would_be_duplicate(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)
float successful_cb_prestige(sys::state &state, dcon::cb_type_id t, dcon::nation_id actor)
int32_t cost_of_peace_offer(sys::state &state, dcon::peace_offer_id offer)
bool province_is_blockaded(sys::state const &state, dcon::province_id ids)
bool cb_requires_selection_of_a_state(sys::state const &state, dcon::cb_type_id t)
float cb_addition_infamy_cost(sys::state &state, dcon::war_id war, dcon::cb_type_id type, dcon::nation_id from, dcon::nation_id target)
dcon::navy_id find_embark_target(sys::state &state, dcon::nation_id from, dcon::province_id p, dcon::army_id a)
int32_t mobilized_regiments_pop_limit(sys::state &state, dcon::nation_id n)
dcon::state_definition_id state
dcon::nation_id target_nation
dcon::nation_id secondary_nation
dcon::national_identity_id wg_tag
dcon::cb_type_id standard_civil_war
dcon::cb_type_id uninstall_communist_gov
bool pending_blackflag_update
dcon::unit_type_id base_army_unit
dcon::unit_type_id irregular
tagged_vector< unit_definition, dcon::unit_type_id > unit_base_definitions
dcon::unit_type_id infantry
dcon::cb_type_id standard_status_quo
dcon::cb_type_id crisis_liberate
dcon::cb_type_id crisis_colony
dcon::cb_type_id liberate
dcon::cb_type_id standard_great_war
dcon::unit_type_id base_naval_unit
dcon::unit_type_id artillery
dcon::leader_trait_id first_background_trait
dcon::nation_id defending_nation
dcon::leader_id attacking_general
dcon::leader_id defending_general
float attacker_cavalry_losses
bool player_on_winning_side
dcon::province_id location
float defender_cavalry_losses
float attacker_support_losses
dcon::nation_id attacking_nation
float defender_infantry_losses
float attacker_infantry_losses
float defender_support_losses
uint16_t attacker_small_losses
uint16_t defender_big_losses
uint16_t attacker_small_ships
uint16_t defender_small_losses
uint16_t attacker_big_losses
uint16_t attacker_big_ships
bool player_on_winning_side
uint16_t defender_small_ships
dcon::nation_id attacking_nation
uint16_t defender_transport_losses
uint16_t defender_transport_ships
dcon::nation_id defending_nation
dcon::leader_id defending_admiral
dcon::leader_id attacking_admiral
dcon::province_id location
uint16_t defender_big_ships
uint16_t attacker_transport_ships
uint16_t attacker_transport_losses
static constexpr uint16_t type_infantry
static constexpr uint16_t type_support
dcon::regiment_id regiment
static constexpr uint16_t is_attacking
static constexpr uint16_t type_cavalry
static constexpr uint16_t type_mask
static constexpr uint16_t mode_engaged
static constexpr uint16_t type_mask
static constexpr uint16_t type_big
static constexpr uint16_t mode_retreated
static constexpr uint16_t mode_sunk
static constexpr uint16_t type_transport
static constexpr uint16_t distance_mask
static constexpr uint16_t mode_approaching
static constexpr uint16_t mode_seeking
static constexpr uint16_t mode_retreating
static constexpr uint16_t mode_mask
static constexpr uint16_t is_attacking
static constexpr uint16_t type_small
int32_t supply_consumption_score
economy::commodity_set supply_cost
economy::commodity_set build_cost
dcon::national_identity_id wg_tag
dcon::nation_id secondary_nation
dcon::state_definition_id state