Skip to content

Commit

Permalink
fix #620; ref #622: fix for king_peace_2 block top liege DoWs
Browse files Browse the repository at this point in the history
  • Loading branch information
zijistark committed Feb 16, 2019
1 parent c4e0009 commit 368f24a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
1 change: 1 addition & 0 deletions EMF/EMF_changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ EMF 9.01 [BETA]
*Imperial Reconquest*:
Latin Empire may now use the CB without the war invalidating immediately.
Hellenic pagans (and their reformed faith) can now use the CB.
King-tier rulers with *Complete King's Peace* on their crown law title (which they hold themselves) will no longer be blocked from all war declarations as if they were a vassal subject to the crown law.


EMF 9.0 [2019-02-14]
Expand Down
33 changes: 18 additions & 15 deletions EMF/common/scripted_triggers/emf_cb_triggers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,25 +84,28 @@ emf_cb_can_use_de_jure_title = {
emf_cb_can_use_magyar_title = yes
}

# Prevent vassal kings from bypassing Complete King's Peace
# Is this war legal according to the laws which affect the attacker and defender?
#
# 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_is_war_legal = {
OR = {
vassal_of = ROOT_FROM # Can always declare war on your de facto liege
NOT = { crownlaw_title = { has_holder = yes } } # No crown law title, no restrictions
crownlaw_title = {
owner = {
# To be affected, the base scope must be a vassal or below of their crown law title holder:
is_liege_or_above_of = PREVPREV
NOR = {
PREV = { has_law = king_peace_2 } # Blocks both internal & external wars
AND = {
PREV = { has_law = king_peace_1 } # Blocks internal wars
ROOT_FROM = {
OR = {
NOT = { is_vassal_or_below_of = PREV } # Not under attacker's crownlaw_title holder
NOT = { crownlaw_title = { always = yes } } # Defender has no crown law title, attack him
NOT = {
crownlaw_title = {
owner = {
# To be affected, the attacker must be a vassal or below of their crown law title holder:
is_vassal_or_below = PREVPREV
OR = {
PREV = { has_law = king_peace_2 } # Blocks both internal & external wars
AND = {
PREV = { has_law = king_peace_1 } # Blocks internal wars
ROOT_FROM = {
is_liege_or_above = PREV # Under attacker's crown law title holder
crownlaw_title = {
NOR = { # Defender's crown law title has no King's Peace at all, attack him
OR = { # Defender's crown laws include at least Internal King's Peace, so he's covered
has_law = king_peace_1
has_law = king_peace_2
}
Expand Down

0 comments on commit 368f24a

Please sign in to comment.