Skip to content

Commit

Permalink
Dynamically generate ai_will_do modifier for democratic in Border Dis…
Browse files Browse the repository at this point in the history
…putes branch (#1715)
  • Loading branch information
cetvrtak authored Jan 26, 2025
1 parent 87c35e4 commit c5ce876
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
12 changes: 4 additions & 8 deletions data/configurables/converterFocuses.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3003,12 +3003,10 @@ focus = {
}
ai_will_do = {
factor = 1
#DEMOCRATIC
modifier = {
factor = 0
OR = {
has_government = democratic
has_government = neutrality
}
has_government = neutrality
}
modifier = {
factor = 0
Expand Down Expand Up @@ -3078,12 +3076,10 @@ focus = {
}
ai_will_do = {
factor = 10
#DEMOCRATIC
modifier = {
factor = 0
OR = {
has_government = democratic
has_government = neutrality
}
has_government = neutrality
}
modifier = {
factor = 0
Expand Down
14 changes: 14 additions & 0 deletions src/HOI4World/HoI4FocusTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1615,6 +1615,13 @@ std::set<std::string> HoI4FocusTree::addConquerBranch(const HoI4::Country& theCo
borderDisputesFocus->xPos = nextFreeColumn;
borderDisputesFocus->yPos = 0;
borderDisputesFocus->updateFocusElement(borderDisputesFocus->aiWillDo, "$TARGET", strategy.getID());
borderDisputesFocus->updateFocusElement(borderDisputesFocus->aiWillDo,
"#DEMOCRATIC",
"modifier = {\n"
"\t\t\t\tfactor = 0\n"
"\t\t\t\thas_government = democratic\n"
"\t\t\t}\n",
majorIdeologies.contains("democratic"));
focuses.push_back(borderDisputesFocus);

auto assertClaimsFocus =
Expand Down Expand Up @@ -1647,6 +1654,13 @@ std::set<std::string> HoI4FocusTree::addConquerBranch(const HoI4::Country& theCo
"#ADDCLAIM",
"add_state_claim = " + claimStateId);
assertClaimsFocus->updateFocusElement(assertClaimsFocus->aiWillDo, "$TARGET", strategy.getID());
assertClaimsFocus->updateFocusElement(assertClaimsFocus->aiWillDo,
"#DEMOCRATIC",
"modifier = {\n"
"\t\t\t\tfactor = 0\n"
"\t\t\t\thas_government = democratic\n"
"\t\t\t}\n",
majorIdeologies.contains("democratic"));
focuses.push_back(assertClaimsFocus);

auto prepareForWarFocus =
Expand Down

0 comments on commit c5ce876

Please sign in to comment.