From 4f3775b00e82744693be1be21ecbca22d81b6b03 Mon Sep 17 00:00:00 2001 From: Greekman Date: Wed, 28 Oct 2026 14:30:22 +0000 Subject: [PATCH] fixing clergy wars --- common/casus_belli_types/pam_wars.txt | 833 ++++++++++++++++++++++++++ 1 file changed, 833 insertions(+) create mode 100644 common/casus_belli_types/pam_wars.txt diff --git a/common/casus_belli_types/pam_wars.txt b/common/casus_belli_types/pam_wars.txt new file mode 100644 index 000000000..e6e1bb820 --- /dev/null +++ b/common/casus_belli_types/pam_wars.txt @@ -0,0 +1,833 @@ +#pam_humiliation_cb +#pam_challenge_hof_cb +#pam_antiking_cb + +########## +# Humiliation CB +########## + +pam_humiliation_cb = { + icon = humiliation_cb + group = religious + + ai_only_against_neighbors = yes + defender_faith_can_join = yes + same_faith_defenders_allowed_parameter = { + government_is_theocracy + government_is_holy_order + } + is_holy_war = yes + + allow_hostages = no + allowed_for_character = { + is_landed = yes + # We give the AI a motive, because theocracies lose to secular realms on raw power + trigger_if = { + limit = { + is_ai = yes + government_has_flag = government_uses_church_authority + } + ai_zeal < medium_positive_ai_value + NOT = { has_trait = zealous } + } + trigger_if = { + limit = { + is_ai = yes + NOT = { government_has_flag = government_uses_church_authority } + } + ai_zeal < medium_negative_ai_value + ai_greed > medium_positive_ai_value + } + } + + allowed_against_character = { + scope:defender = { + government_has_flag = government_uses_church_authority + faith = scope:attacker.faith + is_landed = yes + OR = { + has_higher_or_equal_authority_trigger = { AUTHORITY = church CHARACTER = scope:attacker } + piety_level < scope:attacker.piety_level + } + # Must have papal or clerical standing for the victor to strip + OR = { + exists = clerical_elector_title + is_clerical_appointment_valid_base_trigger = { + CANDIDATE = scope:defender + TOP_LIEGE = scope:defender.top_liege + } + } + } + trigger_if = { + limit = { scope:attacker = { is_ai = yes } } + NOT = { scope:attacker.faith.religious_head ?= scope:defender } + } + } + + ignore_effect = change_title_holder + + should_invalidate = { + scope:defender = { NOT = { government_has_flag = government_uses_church_authority } } + } + + on_invalidated_desc = msg_remove_humiliation_cb_invalidated_message + + cost = { + piety = { + add = { + value = 250 + desc = CB_BASE_COST + } + if = { + limit = { + scope:attacker = { + spiritual_fulfillment <= spiritual_fulfillment_minus_3 + } + } + add = { + value = -200 + desc = CB_SPIRITUAL_FULFILLMENT_TIER_0 + } + } + else_if = { + limit = { + scope:attacker = { + spiritual_fulfillment > spiritual_fulfillment_minus_3 + spiritual_fulfillment <= spiritual_fulfillment_minus_2 + } + } + add = { + value = -160 + desc = CB_SPIRITUAL_FULFILLMENT_TIER_1 + } + } + else_if = { + limit = { + scope:attacker = { + spiritual_fulfillment > spiritual_fulfillment_minus_2 + spiritual_fulfillment <= spiritual_fulfillment_minus_1 + } + } + add = { + value = -95 + desc = CB_SPIRITUAL_FULFILLMENT_TIER_2 + } + } + else_if = { + limit = { + scope:attacker = { + spiritual_fulfillment > spiritual_fulfillment_minus_1 + spiritual_fulfillment < spiritual_fulfillment_1 + } + } + add = { + value = 0 + desc = CB_SPIRITUAL_FULFILLMENT_TIER_3 + } + } + else_if = { + limit = { + scope:attacker = { + spiritual_fulfillment >= spiritual_fulfillment_1 + spiritual_fulfillment < spiritual_fulfillment_2 + } + } + add = { + value = 95 + desc = CB_SPIRITUAL_FULFILLMENT_TIER_4 + } + } + else_if = { + limit = { + scope:attacker = { + spiritual_fulfillment >= spiritual_fulfillment_2 + spiritual_fulfillment < spiritual_fulfillment_3 + } + } + add = { + value = 160 + desc = CB_SPIRITUAL_FULFILLMENT_TIER_5 + } + } + else_if = { + limit = { + scope:attacker = { + spiritual_fulfillment >= spiritual_fulfillment_3 + } + } + add = { + value = 200 + desc = CB_SPIRITUAL_FULFILLMENT_TIER_6 + } + } + if = { + limit = { + scope:attacker = { + top_participant_group:the_christian_church ?= { + has_participant_group_parameter = the_christian_church_free_humiliation_cb + } + } + } + multiply = { + value = 0 + desc = CB_CHRISTIAN_CHURCH_DISCOUNT + } + } + } + } + + on_declaration = { + on_declared_war = yes + pam_the_christian_church_humiliation_war_catalyst_effect = yes + } + + on_victory_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = humiliation_cb_victory_desc_attacker + } + desc = humiliation_cb_victory_desc + } + } + + on_victory = { + scope:defender = { + if = { + limit = { + NOT = { realm_law_group_at_minimum_level = church_authority } + } + change_realm_law_level = { + law_group = church_authority + change = -1 + } + } + pay_treasury_or_gold = { + target = scope:attacker + value = { + value = year_character_treasury_income + multiply = 3 + } + } + pam_humiliation_war_church_standing_loss_effect = { + TT = pam_humiliation_cb_papabile_score_loss_tt + } + } + + scope:attacker = { show_pow_release_message_effect = yes } + + # Legitimacy + add_legitimacy_attacker_victory_effect = yes + + #EP2 accolade glory gain for winning against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_med_effect = yes } + + scope:attacker = { play_sound_effect = "event:/DLC/CE2/UI/Notifications/ce2_ui_notifications_migration_positive" } + scope:defender = { play_sound_effect = "event:/DLC/CE2/UI/Notifications/ce2_ui_notifications_migration_negative" } + + # Prestige Progress for the Attacker + scope:attacker = { + add_piety_experience = { + value = minor_piety_value + multiply = scope:defender.highest_held_title_tier + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker + FAME_BASE = medium_piety_value + IS_RELIGIOUS_WAR = yes + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + # Truce + add_truce_attacker_victory_effect = yes + + # FP1: note the victory for future memorialisation via stele (if applicable). + scope:attacker = { fp1_remember_recent_conquest_victory_effect = yes } + } + + on_white_peace_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = humiliation_cb_white_peace_desc_defender + } + desc = humiliation_cb_white_peace_desc + } + } + + on_white_peace = { + scope:attacker = { show_pow_release_message_effect = yes } + + #EP2 accolade glory gain for doing pretty good against higher ranked enemy + scope:defender = { accolade_defender_war_end_glory_gain_low_effect = yes } + + scope:attacker = { + add_piety = minor_piety_loss + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker # not impactful as the scale are identical + FAME_BASE = medium_piety_value + IS_RELIGIOUS_WAR = yes + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + add_truce_white_peace_effect = yes + } + + on_defeat_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = humiliation_cb_defeat_desc_defender + } + desc = humiliation_cb_defeat_desc + } + } + + on_defeat = { + scope:attacker = { show_pow_release_message_effect = yes } + + scope:attacker = { play_sound_effect = "event:/DLC/CE2/UI/Notifications/ce2_ui_notifications_migration_negative" } + scope:defender = { play_sound_effect = "event:/DLC/CE2/UI/Notifications/ce2_ui_notifications_migration_positive" } + + # Legitimacy + add_legitimacy_attacker_defeat_effect = yes + + scope:defender = { + mandala_peacemaker_perk_serenity_effect = yes + #EP2 accolade glory gain for winning against higher ranked enemy + accolade_defender_war_end_glory_gain_high_effect = yes + # Prestige for Defender + add_piety = major_piety_gain + } + + # Prestige loss for the attacker + scope:attacker = { + pay_short_term_gold_reparations_effect = { + GOLD_VALUE = 3 + } + add_piety = major_piety_loss + pam_humiliation_war_church_standing_loss_effect = { + TT = pam_humiliation_cb_papabile_score_loss_attacker_tt + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:defender + FAME_BASE = medium_piety_value + IS_RELIGIOUS_WAR = yes + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + add_truce_attacker_defeat_effect = yes + + scope:attacker = { + save_temporary_scope_as = loser + } + on_lost_aggression_war_discontent_loss = yes + } + + transfer_behavior = transfer + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + war_name = "HUMILIATION_WAR_CB_NAME" + war_name_base = "HUMILIATION_WAR_CB_NAME_BASE" + cb_name = "HUMILIATION_WAR_CB_NAME" + + interface_priority = 79 + + attacker_wargoal_percentage = 0.8 + + max_defender_score_from_battles = 150 + max_attacker_score_from_battles = 150 + + max_defender_score_from_occupation = 150 + max_attacker_score_from_occupation = 150 + + ai_score = { + value = { + value = scope:attacker.ai_zeal + multiply = -0.5 + add = { + value = scope:attacker.ai_greed + multiply = 0.5 + } + } + if = { + limit = { + scope:attacker = { + has_trait = excommunicated + } + } + add = 50 + } + } +} + +########## +# Challenge Head of Faith +########## + +pam_challenge_hof_cb = { + icon = pam_challenge_hof_cb + group = religious + ai_only_against_neighbors = yes + allow_hostages = no + is_holy_war = yes + gui_attacker_faith_might_join = yes + gui_defender_faith_might_join = yes + + same_faith_defenders_allowed_parameter = { + government_is_theocracy + government_is_holy_order + } + + allowed_for_character = { + scope:attacker = { + is_landed = yes + pam_can_use_challenge_hof_cb_trigger = yes + } + } + + allowed_against_character = { + scope:defender = { + is_landed = yes + faith = scope:attacker.faith + scope:attacker.faith.religious_head ?= this + } + scope:attacker = { + NOT = { target_is_liege_or_above = scope:defender } + } + } + + should_invalidate = { + OR = { + scope:defender = { + NOT = { scope:attacker.faith.religious_head ?= this } + } + scope:attacker = { + NOR = { + pam_is_antipope_trigger = yes + pam_is_antipope_sponsor_trigger = yes + } + } + } + } + + on_invalidated_desc = { + first_valid = { + triggered_desc = { + trigger = { + scope:attacker = { + NOR = { + pam_is_antipope_trigger = yes + pam_is_antipope_sponsor_trigger = yes + } + } + } + desc = msg_pam_challenge_hof_cb_invalidated_no_challenger_message + } + desc = msg_pam_challenge_hof_cb_invalidated_message + } + } + + cost = { + piety = major_piety_value + } + + on_declaration = { + on_declared_war = yes + scope:defender = { + random_character_war = { + limit = { + primary_attacker = scope:attacker + primary_defender = scope:defender + } + save_scope_as = war + } + } + if = { + limit = { exists = scope:war } + scope:attacker.faith = { + every_faith_ruler = { + limit = { + OR = { + # Challenger check, but this is essentially never the case + religious_head_or_challenger = scope:attacker.religious_head_or_challenger + # Rite check if relevant + trigger_if = { + limit = { + NOT = { scope:defender.rite = scope:attacker.rite } + } + rite = scope:attacker.rite + } + } + # Shared war joiner checks + pam_challenge_hof_join_war_trigger = yes + # Relations + NOR = { + # Positive + is_allied_to = scope:defender + has_relation_friend = scope:defender + is_spouse_of = scope:defender + is_close_family_of = scope:defender + # Negative + has_relation_rival = scope:attacker + } + } + scope:war = { add_attacker = prev } + } + } + scope:defender.faith = { + every_faith_ruler = { + limit = { + # Ensure other antipope's followers don't join + religious_head_or_challenger = scope:defender.religious_head_or_challenger + # Rite check if relevant + trigger_if = { + limit = { + NOT = { scope:defender.rite = scope:attacker.rite } + } + rite = scope:defender.rite + } + # Shared war joiner checks + pam_challenge_hof_join_war_trigger = yes + # Relations + NOR = { + # Positive + is_allied_to = scope:attacker + has_relation_friend = scope:attacker + is_spouse_of = scope:attacker + is_close_family_of = scope:attacker + # Negative + has_relation_rival = scope:defender + } + } + scope:war = { add_defender = prev } + } + } + } + } + + on_victory_desc = { + first_valid = { + triggered_desc = { + trigger = { + scope:attacker = { + is_local_player = yes + pam_is_antipope_trigger = no + pam_is_antipope_sponsor_trigger = yes + } + } + desc = pam_challenge_hof_cb_victory_desc_attacker_sponsor + } + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = pam_challenge_hof_cb_victory_desc_attacker + } + desc = pam_challenge_hof_cb_victory_desc + } + } + + on_victory = { + scope:attacker = { show_pow_release_message_effect = yes } + pam_antipope_challenge_hof_victory_effect = yes + add_legitimacy_attacker_victory_effect = yes + add_truce_attacker_victory_effect = yes + } + + on_white_peace_desc = { + desc = pam_challenge_hof_cb_white_peace_desc + } + + on_white_peace = { + scope:attacker = { show_pow_release_message_effect = yes } + add_truce_white_peace_effect = yes + } + + on_defeat_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = pam_challenge_hof_cb_defeat_desc_attacker + } + desc = pam_challenge_hof_cb_defeat_desc + } + } + + on_defeat = { + scope:attacker = { show_pow_release_message_effect = yes } + pam_antipope_challenge_hof_defeat_effect = yes + add_truce_attacker_defeat_effect = yes + } + + transfer_behavior = transfer + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + attacker_allies_inherit = yes + defender_allies_inherit = yes + + war_name = "PAM_CHALLENGE_HOF_WAR_CB_NAME" + cb_name = "PAM_CHALLENGE_HOF_WAR_CB_NAME" + interface_priority = 78 + attacker_wargoal_percentage = 0.8 + + ai_score = { + value = { + value = scope:attacker.ai_zeal + multiply = -0.5 + } + if = { + limit = { + scope:attacker = { + has_trait = excommunicated + } + } + add = 50 + } + } +} + +########## +# Antiking — remove a rival's Antipope +########## + +pam_antiking_cb = { + icon = pam_antiking_cb + group = religious + ai_only_against_neighbors = yes + allow_hostages = no + is_holy_war = yes + + allowed_for_character = { + is_landed = yes + highest_held_title_tier >= tier_kingdom + religion = religion:christianity_religion + pam_is_antipope_sponsor_trigger = no + } + + allowed_against_character = { + pam_can_target_antiking_cb_trigger = yes + } + + should_invalidate = { + scope:defender = { + NOT = { pam_is_antipope_sponsor_trigger = yes } + } + } + + on_invalidated_desc = msg_pam_antiking_cb_invalidated_message + + cost = { + piety = { + value = medium_piety_value + } + } + + on_declaration = { + on_declared_war = yes + } + + on_victory_desc = { + first_valid = { + triggered_desc = { + trigger = { + scope:attacker = { + is_local_player = yes + faith = { + exists = religious_head + religious_head != scope:attacker + } + } + } + desc = pam_antiking_cb_victory_desc_attacker + } + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = pam_antiking_cb_victory_desc_attacker_no_gratitude + } + desc = pam_antiking_cb_victory_desc + } + } + + on_victory = { + scope:attacker = { show_pow_release_message_effect = yes } + pam_antiking_victory_effect = yes + add_legitimacy_attacker_victory_effect = yes + add_truce_attacker_victory_effect = yes + } + + on_white_peace_desc = { + desc = pam_antiking_cb_white_peace_desc + } + + on_white_peace = { + scope:attacker = { show_pow_release_message_effect = yes } + add_truce_white_peace_effect = yes + } + + on_defeat_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = pam_antiking_cb_defeat_desc_attacker + } + desc = pam_antiking_cb_defeat_desc + } + } + + on_defeat = { + scope:attacker = { show_pow_release_message_effect = yes } + scope:attacker = { add_piety = medium_piety_loss } + add_truce_attacker_defeat_effect = yes + } + + transfer_behavior = transfer + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + attacker_allies_inherit = yes + defender_allies_inherit = yes + + war_name = "PAM_ANTIKING_WAR_CB_NAME" + cb_name = "PAM_ANTIKING_WAR_CB_NAME" + interface_priority = 77 + attacker_wargoal_percentage = 0.8 + + ai_score = { + value = 20 + if = { + limit = { + scope:attacker = { + has_trait = excommunicated + } + } + multiply = 0 + } + } +} + +########## +# Investiture Open Conflict: war during the Investiture Controversy between two same-faith rulers on opposite +# Clerical Appointment stances. The loser is forced onto the winner's stance (a locked council vote); either +# side may declare, and it invalidates when the crisis ends. +########## +# +#pam_investiture_conflict_cb = { +# icon = pam_investiture_conflict_cb # Reuses the Investiture phase ring until TIT-75809 +# group = religious +# ai_only_against_neighbors = yes +# allow_hostages = no +# is_holy_war = no +# +# allowed_for_character = { +# scope:attacker = { +# is_landed = yes +# pam_can_use_investiture_conflict_cb_trigger = yes +# } +# } +# +# allowed_against_character = { +# scope:defender = { +# is_landed = yes +# pam_valid_investiture_conflict_target_trigger = yes +# } +# } +# +# should_invalidate = { +# # The dispute is moot once the Investiture Controversy phase ends. +# NOT = { +# situation:the_christian_church ?= { +# has_situation_top_phase_parameter = the_christian_church_investiture_controversy +# } +# } +# } +# +# on_invalidated_desc = msg_pam_investiture_conflict_cb_invalidated_message +# +# cost = { +# piety = medium_piety_value +# } +# +# on_declaration = { +# on_declared_war = yes +# } +# +# on_victory_desc = { +# first_valid = { +# triggered_desc = { +# trigger = { scope:attacker = { is_local_player = yes } } +# desc = pam_investiture_conflict_cb_victory_desc_attacker +# } +# triggered_desc = { +# trigger = { scope:defender = { is_local_player = yes } } +# desc = pam_investiture_conflict_cb_victory_desc_defender +# } +# desc = pam_investiture_conflict_cb_victory_desc +# } +# } +# +# on_victory = { +# scope:attacker = { show_pow_release_message_effect = yes } +# pam_investiture_conflict_victory_effect = yes +# add_legitimacy_attacker_victory_effect = yes +# add_truce_attacker_victory_effect = yes +# } +# +# on_white_peace_desc = { +# desc = pam_investiture_conflict_cb_white_peace_desc +# } +# +# on_white_peace = { +# scope:attacker = { show_pow_release_message_effect = yes } +# add_truce_white_peace_effect = yes +# } +# +# on_defeat_desc = { +# first_valid = { +# triggered_desc = { +# trigger = { scope:attacker = { is_local_player = yes } } +# desc = pam_investiture_conflict_cb_defeat_desc_attacker +# } +# triggered_desc = { +# trigger = { scope:defender = { is_local_player = yes } } +# desc = pam_investiture_conflict_cb_defeat_desc_defender +# } +# desc = pam_investiture_conflict_cb_defeat_desc +# } +# } +# +# on_defeat = { +# scope:attacker = { show_pow_release_message_effect = yes } +# pam_investiture_conflict_defeat_effect = yes +# add_truce_attacker_defeat_effect = yes +# } +# +# transfer_behavior = transfer +# on_primary_attacker_death = inherit +# on_primary_defender_death = inherit +# attacker_allies_inherit = yes +# defender_allies_inherit = yes +# +# war_name = "PAM_INVESTITURE_CONFLICT_WAR_CB_NAME" +# cb_name = "PAM_INVESTITURE_CONFLICT_WAR_CB_NAME" +# interface_priority = 76 +# attacker_wargoal_percentage = 0.8 +# +# ai_score = { +# value = 20 +# } +#}