Skip to content

Commit

Permalink
AI now won't declare wars if it's already at war, even as an ally
Browse files Browse the repository at this point in the history
  • Loading branch information
zijistark committed Feb 16, 2019
1 parent 5db50bc commit c4e0009
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions EMF/EMF_changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
EMF 9.01 [BETA]
*CHANGES:*
The AI will now never declare war, unless it's a forced-by-script war, when it is already involved in any other type of war, even as an ally.
The Varangian Guard's title culture (controls the culture of characters which spawn in its court) is no longer forced to be the same as the first holder in a campaign.
Holy War (Religious Subjugation):
It is now permitted for emperor-tier rulers to convert and bend the knee. It's highly unlikely that they'll not have a county within their realm outside of the target duchy, which would make them refuse automatically, but if they indeed do not, emperor-tier attackers can subjugate them (and their empire titles will be destroyed, as in all of the same-tier attacker-defender cases).
Expand Down
15 changes: 13 additions & 2 deletions EMF/common/scripted_triggers/emf_cb_triggers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ emf_cb_is_war_legal = {
}

# Does the attacker NOT have a blanket blocker on declaring war?
#
# NOTE: This is used in both regular and third-party CBs in the attacker scope (ROOT or FROMFROM, respectively), so if
# referring to the defender, always use ROOT_FROM for safety (else it'd be a FROM nested inside of a FROMFROM for 3rd-party)
# and refrain from using the ROOT scope (is the 3rd-party in those CBs, attacker otherwise), instead using PREV gymnastics to
# refer to whatever scope is the scripted trigger's base scope.
emf_cb_lacks_main_war_block = {
OR = {
ai = no
Expand All @@ -131,7 +136,6 @@ emf_cb_lacks_main_war_block = {
has_flag = planning_coronation
# Prevent AI rulers from inappropriately declaring war before their coronation:
AND = {
ai = yes
emf_needs_coronation = yes
NAND = {
OR = {
Expand All @@ -140,13 +144,20 @@ emf_cb_lacks_main_war_block = {
}
NOT = { trait = patient }
}
# HF coronation-for-war flags:
# HF coronation-for-war flags that obviously must exempt the needs-to-be-coronated ruler from DoWs:
NOR = {
has_flag = flag_antipope_for_coronation
has_flag = flag_excommunicated_for_coronation
has_flag = flag_pepin_for_coronation
}
}
# Prevent AI from declaring war if already in a war (even as an ally) unless scripted to do so (emf_cb_pass_tmp)
any_war = {
OR = {
any_attacker = { character = PREVPREV }
any_defender = { character = PREVPREV }
}
}
}
}
}
Expand Down

0 comments on commit c4e0009

Please sign in to comment.