Skip to content

Commit c0deb40

Browse files
committed
Document occupations and sieges
1 parent 6297dcf commit c0deb40

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

assets/localisation/en-US/alice.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1878,7 +1878,7 @@ amsg_embargod;The nation has been embargoed
18781878
save_name_label;File name (blank = auto)
18791879
save_warning_tooltip;A file with this name already exists
18801880
production_window_title;Production
1881-
production_combine_types_toggle;Combine Types
1881+
production_combine_types_toggle;Collapse Types
18821882
production_table_name_header;Name
18831883
production_table_size_header;Size
18841884
production_table_amount_header;Quantity

docs/features/out-of-battle.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,13 @@
3535

3636
# US18 Ships repairs
3737

38+
# US101 Sieges and Occupations
39+
40+
| AC1 | Forts are built once with construction cost of some goods comparable to an extra factory level. |
41+
| AC2 | Forts reduce siege speed by alice_fort_siege_slowdown factor (0.75 by default) per level. |
42+
| AC3 | Forts increase hostile siege attrition by state.defines.alice_fort_siege_attrition_per_level per level (0.35 by default). |
43+
| AC4 | Forts moderately impact victory points score of a province (+1 per fort level). |
44+
| AC5 | Engineers reduce the effective fort level. Number of engineers required to reduce by 1 level depends on the sieging army size. At least state.defines.engineer_unit_ratio required (0.1 by default) |
45+
| AC6 | Recon units increase occupation speed of any province. At least state.defines.recon_unit_ratio is required (0.1 by default) |
46+
| AC7 | Nation sieges its owned provinces 25% faster. |
47+
| AC8 | Nation sieges its core provinces 10% faster. |

src/gui/gui_province_window.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,7 @@ class province_building_expand_button : public button_element_base {
831831

832832
void button_action(sys::state& state) noexcept override {
833833
auto content = retrieve<dcon::province_id>(state, parent);
834+
// US101AC1
834835
command::begin_province_building_construction(state, state.local_player_nation, content, Value);
835836
}
836837
virtual void button_shift_action(sys::state& state) noexcept override {

src/military/military.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2029,7 +2029,7 @@ float truce_break_cb_infamy(sys::state& state, dcon::cb_type_id t, dcon::nation_
20292029
return total * state.world.cb_type_get_break_truce_infamy_factor(t);
20302030
}
20312031

2032-
// Calculate victory points that a province P is worth in the nation N. Used for warscore, occupation rate.
2032+
// US101AC4 Calculate victory points that a province P is worth in the nation N. Used for warscore, occupation rate.
20332033
// This logic is duplicated in province_victory_points_text UI component
20342034
int32_t province_point_cost(sys::state& state, dcon::province_id p, dcon::nation_id n) {
20352035
/*
@@ -6491,6 +6491,7 @@ float relative_attrition_amount(sys::state& state, dcon::army_id a, dcon::provin
64916491

64926492
auto max_attrition = std::max(0.f, state.world.province_get_modifier_values(prov, sys::provincial_mod_offsets::max_attrition));
64936493

6494+
// US101AC3 Forts increase hostile siege attrition by state.defines.alice_fort_siege_attrition_per_level per level
64946495
float siege_attrition = 0.0f;
64956496
if(state.world.province_get_siege_progress(prov) > 0.f) {
64966497
siege_attrition = state.defines.siege_attrition + hostile_fort * state.defines.alice_fort_siege_attrition_per_level;
@@ -6859,7 +6860,7 @@ float get_reg_org_damage(sys::state& state, dcon::regiment_id damage_dealer, dco
68596860
}
68606861
return dmg_dealer_str * (org_dam_mul / receiver_max_org_divisor) * (unit_dmg_stat * 0.1f + 1.0f) * unit_dmg_support * battle_modifiers / (fort_mod * dmg_receiver_stats.discipline_or_evasion * (1.0f + state.world.nation_get_modifier_values(dmg_receiver_tech_nation, sys::national_mod_offsets::land_organisation)) * (1.0f + receiver_exp));
68616862
}
6862-
// defines the general algorithm for getting the effective fort level with said amount of total strength of units who are enemies with the fort controller,
6863+
// US101AC5 defines the general algorithm for getting the effective fort level with said amount of total strength of units who are enemies with the fort controller,
68636864
// total strength of siege units who are enemies with the fort controller, and the highest siege stat among them.
68646865
int32_t get_effective_fort_level(sys::state& state, dcon::province_id location, float total_strength, float strength_siege_units, float max_siege_value) {
68656866
/*
@@ -9047,7 +9048,7 @@ void update_siege_progress(sys::state& state) {
90479048
assert(bool(first_army));
90489049

90499050
/*
9050-
We find the effective level of the fort by subtracting: (rounding this value down to to the nearest integer)
9051+
US101AC5 We find the effective level of the fort by subtracting: (rounding this value down to to the nearest integer)
90519052
greatest-siege-value-present x
90529053
((the ratio of the strength of regiments with siege present to the total strength of all regiments) ^
90539054
define:ENGINEER_UNIT_RATIO) / define:ENGINEER_UNIT_RATIO, reducing it to a minimum of 0.
@@ -9056,7 +9057,7 @@ void update_siege_progress(sys::state& state) {
90569057
int32_t effective_fort_level = get_effective_fort_level(state, prov, total_sieging_strength, strength_siege_units, max_siege_value);
90579058

90589059
/*
9059-
We calculate the siege speed modifier as: 1 + define:RECON_SIEGE_EFFECT x greatest-reconnaissance-value-present x ((the
9060+
US101AC6. We calculate the siege speed modifier as: 1 + define:RECON_SIEGE_EFFECT x greatest-reconnaissance-value-present x ((the
90609061
ratio of the strength of regiments with reconnaissance present to the total strength of all regiments) ^
90619062
define:RECON_UNIT_RATIO) / define:RECON_UNIT_RATIO.
90629063
*/
@@ -9090,7 +9091,7 @@ void update_siege_progress(sys::state& state) {
90909091

90919092
float added_progress = siege_speed_modifier * num_brigades_modifier *
90929093
progress_table[rng::get_random(state, uint32_t(prov.value)) % 10] *
9093-
(owner_involved ? 1.25f : (core_owner_involved ? 1.1f : 1.0f)) / (effective_fort_level * state.defines.alice_fort_siege_slowdown + 1.0f);
9094+
(owner_involved ? 1.25f : (core_owner_involved ? 1.1f : 1.0f)) / (effective_fort_level * state.defines.alice_fort_siege_slowdown + 1.0f); // US101AC2 Forts reduce siege speed by alice_fort_siege_slowdown factor (0.75 by default) per level.
90949095

90959096
auto& progress = state.world.province_get_siege_progress(prov);
90969097
state.world.province_set_siege_progress(prov, progress + siege_speed_mul * added_progress);

0 commit comments

Comments
 (0)