Project Alice
Loading...
Searching...
No Matches
rebels.hpp
Go to the documentation of this file.
1#pragma once
2#include "dcon_generated.hpp"
3
4namespace rebel {
5
6dcon::movement_id get_movement_by_position(sys::state& state, dcon::nation_id n, dcon::issue_option_id o);
7dcon::movement_id get_movement_by_independence(sys::state& state, dcon::nation_id n, dcon::national_identity_id i);
8
9void update_movement_values(sys::state& state); // simply updates cached values
10void turn_movement_into_rebels(sys::state& state, dcon::movement_id m);
11void update_movements(sys::state& state); // updates cached values and then possibly turns movements into rebels
12void add_pop_to_movement(sys::state& state, dcon::pop_id p, dcon::movement_id m);
13void remove_pop_from_movement(sys::state& state, dcon::pop_id p);
14void suppress_movement(sys::state& state, dcon::nation_id n, dcon::movement_id m);
15
16void daily_update_rebel_organization(sys::state& state); // increases org based on pop income and militancy
17void update_factions(sys::state& state); // adds pops to factions, deletes invalid factions
18dcon::rebel_faction_id get_faction_by_type(sys::state& state, dcon::nation_id n, dcon::rebel_type_id r);
19void remove_pop_from_rebel_faction(sys::state& state, dcon::pop_id p);
20
21bool sphere_member_has_ongoing_revolt(sys::state& state, dcon::nation_id n);
22int32_t get_faction_brigades_ready(sys::state& state, dcon::rebel_faction_id r);
23int32_t get_faction_brigades_active(sys::state& state, dcon::rebel_faction_id r);
24float get_faction_organization(sys::state& state, dcon::rebel_faction_id r);
25float get_faction_revolt_risk(sys::state& state, dcon::rebel_faction_id r);
26float get_suppression_point_cost(sys::state& state, dcon::movement_id m);
27
30
31namespace impl {
32struct prov_str {
33 dcon::province_id p;
34 float str = 0.0f;
35};
36struct arm_str {
37 dcon::army_id a;
38 float str = 0.0f;
39};
40}
41
42void get_hunting_targets(sys::state& state, dcon::nation_id n, std::vector<impl::prov_str>& rebel_provs);
43void sort_hunting_targets(sys::state& state, impl::arm_str const& ar, std::vector<impl::prov_str>& rebel_provs);
46void trigger_revolt(sys::state& state, dcon::nation_id n, dcon::rebel_type_id t, dcon::ideology_id i, dcon::culture_id c, dcon::religion_id r);
47
48void delete_faction(sys::state& state, dcon::rebel_faction_id reb);
49
50std::string rebel_name(sys::state& state, dcon::rebel_faction_id reb);
51
52void update_armies(sys::state& state);
53
54} // namespace rebel
Definition: rebels.cpp:12
dcon::rebel_faction_id get_faction_by_type(sys::state &state, dcon::nation_id n, dcon::rebel_type_id r)
Definition: rebels.cpp:29
void execute_province_defections(sys::state &state)
Definition: rebels.cpp:1049
void trigger_revolt(sys::state &state, dcon::nation_id n, dcon::rebel_type_id t, dcon::ideology_id i, dcon::culture_id c, dcon::religion_id r)
Definition: rebels.cpp:1269
int32_t get_faction_brigades_active(sys::state &state, dcon::rebel_faction_id r)
Definition: rebels.cpp:1016
void delete_faction(sys::state &state, dcon::rebel_faction_id reb)
Definition: rebels.cpp:711
void rebel_risings_check(sys::state &state)
Definition: rebels.cpp:905
bool sphere_member_has_ongoing_revolt(sys::state &state, dcon::nation_id n)
Definition: rebels.cpp:998
float get_faction_organization(sys::state &state, dcon::rebel_faction_id r)
Definition: rebels.cpp:1025
void update_movement_values(sys::state &state)
Definition: rebels.cpp:37
void update_armies(sys::state &state)
Definition: rebels.cpp:1331
void get_hunting_targets(sys::state &state, dcon::nation_id n, std::vector< impl::prov_str > &rebel_provs)
Definition: rebels.cpp:783
std::string rebel_name(sys::state &state, dcon::rebel_faction_id reb)
Definition: rebels.cpp:1274
void update_factions(sys::state &state)
Definition: rebels.cpp:720
void suppress_movement(sys::state &state, dcon::nation_id n, dcon::movement_id m)
Definition: rebels.cpp:129
void remove_pop_from_movement(sys::state &state, dcon::pop_id p)
Definition: rebels.cpp:120
dcon::movement_id get_movement_by_independence(sys::state &state, dcon::nation_id n, dcon::national_identity_id i)
Definition: rebels.cpp:21
float get_faction_revolt_risk(sys::state &state, dcon::rebel_faction_id r)
Definition: rebels.cpp:1029
void remove_pop_from_rebel_faction(sys::state &state, dcon::pop_id p)
Definition: rebels.cpp:339
float get_suppression_point_cost(sys::state &state, dcon::movement_id m)
Definition: rebels.cpp:1168
void execute_rebel_victories(sys::state &state)
Definition: rebels.cpp:1182
void sort_hunting_targets(sys::state &state, impl::arm_str const &ar, std::vector< impl::prov_str > &rebel_provs)
Definition: rebels.cpp:793
void add_pop_to_movement(sys::state &state, dcon::pop_id p, dcon::movement_id m)
Definition: rebels.cpp:114
void daily_update_rebel_organization(sys::state &state)
Definition: rebels.cpp:736
int32_t get_faction_brigades_ready(sys::state &state, dcon::rebel_faction_id r)
Definition: rebels.cpp:1012
void update_movements(sys::state &state)
Definition: rebels.cpp:318
void turn_movement_into_rebels(sys::state &state, dcon::movement_id m)
Definition: rebels.cpp:143
dcon::movement_id get_movement_by_position(sys::state &state, dcon::nation_id n, dcon::issue_option_id o)
Definition: rebels.cpp:14
void rebel_hunting_check(sys::state &state)
Definition: rebels.cpp:808
dcon::army_id a
Definition: rebels.hpp:37
dcon::province_id p
Definition: rebels.hpp:33