Skip to content

Commit

Permalink
Add 1.4.0 (#5)
Browse files Browse the repository at this point in the history
- Added a new MCT option: Extra points for Faction Leader
- Reordered the MCT panel
  • Loading branch information
msolefonte authored Aug 5, 2022
1 parent abd4e9d commit ca7e3c1
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 17 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- New method `is_faction_punishable(faction)` added to the CBAC lib API
- New method `is_hero(unit_key)` added to the CBAC lib API

## [1.3.0] - 05.08.2022
## [1.3.0] - 04.08.2022

- Added information about unit costs in the Info button
- Added support for localization. Now the mod can be translated!
Expand All @@ -42,3 +42,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated CHANGELOG.md format
- Technical changes:
- New method `gls(localised_string_key)` added to the CBAC lib API

## [1.4.0] - 05.08.2022

- Added a new MCT option: Extra points for Faction Leader
- Reordered the MCT panel
Binary file modified dist/wolfy_cost_based_army_caps.pack
Binary file not shown.
6 changes: 6 additions & 0 deletions src/script/_lib/mod/cbac.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ local cbac = {};
local config = {
army_limit_player = 10500,
army_limit_ai = 12000,
army_limit_fl_bonus = 0,
dynamic_limit = true,
limit_rank = 2,
limit_step = 1000,
Expand Down Expand Up @@ -95,6 +96,7 @@ function cbac:block_mct_settings_if_required()
if (mod_cfg:get_option_by_key("settings_locked"):get_finalized_setting()) then
mod_cfg:get_option_by_key("army_limit_player"):set_read_only(true);
mod_cfg:get_option_by_key("army_limit_ai"):set_read_only(true);
mod_cfg:get_option_by_key("army_limit_fl_bonus"):set_read_only(true);
mod_cfg:get_option_by_key("dynamic_limit"):set_read_only(true);
mod_cfg:get_option_by_key("limit_rank"):set_read_only(true);
mod_cfg:get_option_by_key("limit_step"):set_read_only(true);
Expand Down Expand Up @@ -183,6 +185,10 @@ function cbac:get_army_limit(character)
army_limit = cbac:get_config("army_limit_ai");
end

if character:is_faction_leader() then
army_limit = army_limit + cbac:get_config("army_limit_fl_bonus");
end

if (cbac:get_config("dynamic_limit")) then
local lord_rank = character:rank();
local limit_rank = cbac:get_config("limit_rank");
Expand Down
39 changes: 23 additions & 16 deletions src/script/mct/settings/cbac.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,40 +31,46 @@ option_cbac_hero_cap:slider_set_min_max(0, 19);
option_cbac_hero_cap:slider_set_step_size(1);
option_cbac_hero_cap:set_default_value(2);

local option_cbac_settings_locked = mct_mod:add_new_option("settings_locked", "checkbox");
option_cbac_settings_locked:set_text("Lock settings during campaigns");
option_cbac_settings_locked:set_tooltip_text("If enabled, you can't change these settings during a campaign, only from the main menu.");
option_cbac_settings_locked:set_default_value(false);
option_cbac_settings_locked:set_read_only(true);

local mct_section_dl = mct_mod:add_new_section("2-cbac-dl", "Dynamic Limits Options", false);
local mct_section_extra = mct_mod:add_new_section("2-cbac-extra", "Extra Options", false);

local option_cbac_dynamic_limit = mct_mod:add_new_option("dynamic_limit", "checkbox");
option_cbac_dynamic_limit:set_text("Enable Dynamic Cost Limit");
option_cbac_dynamic_limit:set_tooltip_text("Limit increases with the level of the lord.");
option_cbac_dynamic_limit:set_default_value(true);

local option_cbac_limit_rank = mct_mod:add_new_option("limit_rank", "slider");
option_cbac_limit_rank:set_text("Lord level increase required to increase army limit");
option_cbac_limit_rank:set_tooltip_text("Every x levels gained, a lord's army's limit will go up (if limit is set to dynamic);.");
option_cbac_limit_rank:set_text("Dynamic Limit increase every N levels");
option_cbac_limit_rank:set_tooltip_text("Every x levels gained, a lord's army's limit will go up.");
option_cbac_limit_rank:slider_set_min_max(1, 20);
option_cbac_limit_rank:slider_set_step_size(1);
option_cbac_limit_rank:set_default_value(2);

local option_cbac_limit_step = mct_mod:add_new_option("limit_step", "slider");
option_cbac_limit_step:set_text("Limit increase step size");
option_cbac_limit_step:set_text("Dynamic Limit increase step size");
option_cbac_limit_step:set_tooltip_text("Every time a lord's level increase triggers a limit increase, it goes up by this amount (if limit is set to dynamic);.");
option_cbac_limit_step:slider_set_min_max(100, 5000);
option_cbac_limit_step:slider_set_step_size(100);
option_cbac_limit_step:set_default_value(1000);

local option_cbac_limit_deceleration = mct_mod:add_new_option("limit_deceleration", "slider");
option_cbac_limit_deceleration:set_text("Limit deceleration");
option_cbac_limit_deceleration:set_text("Dynamic Limit deceleration");
option_cbac_limit_deceleration:set_tooltip_text("At every step, the limit increase slows down by this amount, so that the limit rises fast at first, but the increase slows down at higher levels.");
option_cbac_limit_deceleration:slider_set_min_max(0, 2000);
option_cbac_limit_deceleration:slider_set_step_size(10);
option_cbac_limit_deceleration:set_default_value(50);

local option_cbac_supply_lines = mct_mod:add_new_option("supply_lines", "checkbox");
option_cbac_supply_lines:set_text("Enable Cost-based Supply Lines");
option_cbac_supply_lines:set_tooltip_text("Adds Supply Lines unit upkeep increases based on army cost. Use the submod to disable the normal Supply Lines!");
option_cbac_supply_lines:set_default_value(false);

local option_cbac_army_limit_fl_bonus = mct_mod:add_new_option("army_limit_fl_bonus", "slider");
option_cbac_army_limit_fl_bonus:set_text("Extra points for Faction Leader");
option_cbac_army_limit_fl_bonus:set_tooltip_text("How many extra points should have the faction leader?");
option_cbac_army_limit_fl_bonus:slider_set_min_max(0, 10000);
option_cbac_army_limit_fl_bonus:slider_set_step_size(500);
option_cbac_army_limit_fl_bonus:set_default_value(0);

local mct_section_ai = mct_mod:add_new_section("3-cbac-ai", "AI Behaviour Options [NOT READY]", false);

local option_cbac_upgrade_ai = mct_mod:add_new_option("upgrade_ai_armies", "checkbox");
Expand All @@ -86,9 +92,10 @@ option_cbac_autolevel_ai:slider_set_min_max(0, 5);
option_cbac_autolevel_ai:slider_set_step_size(1);
option_cbac_autolevel_ai:set_default_value(3);

local mct_section_sl = mct_mod:add_new_section("4-cbac-sl", "Cost-based Supply Lines Options", false);
local mct_section_sl = mct_mod:add_new_section("4-cbac-sl", "Setting Lock", false);

local option_cbac_supply_lines = mct_mod:add_new_option("supply_lines", "checkbox");
option_cbac_supply_lines:set_text("Enable Cost-based Supply Lines");
option_cbac_supply_lines:set_tooltip_text("Adds Supply Lines unit upkeep increases based on army cost. Use the submod to disable the normal Supply Lines!");
option_cbac_supply_lines:set_default_value(false);
local option_cbac_settings_locked = mct_mod:add_new_option("settings_locked", "checkbox");
option_cbac_settings_locked:set_text("Lock settings during campaigns");
option_cbac_settings_locked:set_tooltip_text("If enabled, you can't change these settings during a campaign, only from the main menu.");
option_cbac_settings_locked:set_default_value(false);
option_cbac_settings_locked:set_read_only(true);

0 comments on commit ca7e3c1

Please sign in to comment.