From 0a1f4595df6fbb5b99fd77b52dd6411412dac168 Mon Sep 17 00:00:00 2001 From: trashmasteruni Date: Sat, 10 Oct 2026 22:14:56 +0200 Subject: [PATCH] character interactions update --- common/character_interactions/00_alliance.txt | 3694 --------- .../00_faction_interactions.txt | 171 - .../00_house_head_interactions.txt | 1216 --- .../00_marriage_interactions.txt | 6902 ----------------- common/character_interactions/00_war.txt | 2191 ------ .../10_ach_interactions.txt | 851 -- 6 files changed, 15025 deletions(-) delete mode 100644 common/character_interactions/00_alliance.txt delete mode 100644 common/character_interactions/00_faction_interactions.txt delete mode 100644 common/character_interactions/00_house_head_interactions.txt delete mode 100644 common/character_interactions/00_marriage_interactions.txt delete mode 100644 common/character_interactions/00_war.txt delete mode 100644 common/character_interactions/10_ach_interactions.txt diff --git a/common/character_interactions/00_alliance.txt b/common/character_interactions/00_alliance.txt deleted file mode 100644 index 62452ee3f..000000000 --- a/common/character_interactions/00_alliance.txt +++ /dev/null @@ -1,3694 +0,0 @@ -call_ally_interaction = { - category = interaction_category_diplomacy - desc = call_ally_interaction_desc - interface_priority = 60 - interface = call_ally - special_interaction = call_ally_interaction - popup_on_receive = yes - pause_on_receive = yes - icon = alliance - - greeting = positive - notification_text = CALL_ALLY_NOTIFICATION - - is_available = { - is_at_war = yes - } - - is_shown = { - scope:actor = { - trigger_if = { # Avoid calling Adventurers without armies or landed rulers who have been devastated - limit = { - is_ai = yes - } - scope:recipient.current_military_strength >= 100 - } - trigger_if = { - limit = { - liege = scope:recipient # The recipient is actor's liege - } - subject_contract_has_flag = vassal_contract_liege_forced_war_override - } - trigger_if = { - limit = { - scope:recipient = { - is_tributary_of = scope:actor - NOT = { is_allied_to = scope:actor } - } - } - has_realm_law_flag = can_call_tributaries_for_piety - piety >= 50 - } - } - scope:recipient = { - OR = { - is_allied_to = scope:actor - AND = { - this ?= scope:actor.diarch - scope:actor = { - any_character_war = { diarch_callable_in_internal_war_trigger = yes } - } - } - scope:actor = { - is_vassal_of = prev - subject_contract_has_flag = vassal_contract_liege_forced_war_override - } - scope:actor = { - is_tributary_of = prev - subject_contract_has_flag = tributary_contract_suzerain_guarantee_override - } - AND = { - is_tributary_of = scope:actor - scope:actor = { - piety >= 50 - has_realm_law_flag = can_call_tributaries_for_piety - } - } - } - } - scope:actor = { #If you can call them as a House Member then do that - NOT = { - is_character_interaction_valid = { - recipient = scope:recipient - interaction = call_house_member_to_war_interaction - } - } - } - } - - has_valid_target = { - exists = scope:target - } - - has_valid_target_showing_failures_only = { - scope:target = { - is_war_leader = scope:actor - } - - scope:actor = { - trigger_if = { - limit = { # if you're invoking your suzerain's defensive guarantee, it has to be for a defensive war - NOT = { is_allied_to = scope:recipient } - suzerain = scope:recipient - subject_contract_has_flag = tributary_contract_suzerain_guarantee_override - } - scope:target = { - primary_defender = scope:actor - } - } - - trigger_if = { - limit = { - scope:target = { - OR = { - using_cb = undirected_great_holy_war - using_cb = directed_great_holy_war - } - } - } - - trigger_if = { - limit = { - this = scope:target.casus_belli.primary_attacker - } - #if it's a religious war the recipient has to be of the same faith - custom_description = { - text = is_of_wrong_faith_for_holy_war - subject = scope:actor - object = scope:recipient - faith = scope:recipient.faith - } - } - trigger_else = { - custom_description = { - text = is_of_attacker_faith_in_holy_war - subject = scope:actor - object = scope:recipient - scope:target = { primary_attacker.faith != scope:recipient.faith } - } - } - } - } - - joiner_not_already_in_another_war_with_any_target_war_participants_trigger = { - WARRIOR = scope:actor - JOINER = scope:recipient - } - } - - - is_valid_showing_failures_only = { - - scope:recipient = { - is_ruler = yes - - # Only rulers of a high enough rank may call a hegemon into wars - custom_tooltip = { - text = too_low_rank_to_call_hegemon - trigger_if = { - limit = { highest_held_title_tier = tier_hegemony } - scope:actor = { highest_held_title_tier >= tier_empire } - } - } - } - - scope:actor = { - # Only War Leaders can call allies - custom_description = { - text = must_be_war_leader - any_character_war = { - is_war_leader = scope:actor - } - } - - # Cannot call the same character multiple times - custom_description = { - text = cannot_call_same_character_multiple_times - object = scope:recipient - any_character_war = { - ALL_FALSE = { - was_called = scope:recipient - is_participant = scope:recipient - } - } - } - - # Cannot call a character of the "wrong" religion to a Great Holy War - trigger_if = { - limit = { - faith != scope:recipient.faith - } - custom_description = { - text = is_of_wrong_faith_for_holy_war - subject = scope:actor - object = scope:recipient - any_character_war = { - NOR = { - using_cb = undirected_great_holy_war - using_cb = directed_great_holy_war - } - } - } - } - } - - can_potentially_call_ally_trigger = { - WARRIOR = scope:actor - JOINER = scope:recipient - } - } - - can_be_picked = { - can_join_war_liege_vassal_check_trigger = { WARRIOR = scope:actor JOINER = scope:recipient } - - scope:target = { - is_war_leader = scope:actor - - # not already in target war - custom_description = { - text = join_war_interaction_already_in_target_war - NOR = { - any_war_attacker = { this = scope:recipient } - any_war_defender = { this = scope:recipient } - } - } - - # Diarchs can only be called to internal wars. - custom_tooltip = { - text = call_ally_interaction.tt.diarchs_called_to_internal_wars - trigger_if = { - limit = { scope:recipient ?= scope:actor.diarch } - primary_defender = scope:actor - diarch_callable_in_internal_war_trigger = yes - } - } - } - - # You cannot call a suzerain against their own tributary - trigger_if = { - limit = { - scope:target.casus_belli.primary_defender = scope:actor - scope:target.casus_belli.primary_attacker = { is_tributary_of_suzerain_or_above = scope:recipient } - } - NOT = { - scope:target.casus_belli.primary_attacker = { is_tributary_of_suzerain_or_above = scope:recipient } - } - } - trigger_else_if = { - limit = { - scope:target.casus_belli.primary_attacker = scope:actor - scope:target.casus_belli.primary_defender = { is_tributary_of_suzerain_or_above = scope:recipient } - } - NOT = { - scope:target.casus_belli.primary_defender = { is_tributary_of_suzerain_or_above = scope:recipient } - } - } - trigger_else = {} - - # You cannot call a tributary against their suzerain - trigger_if = { - limit = { - scope:target.casus_belli.primary_defender = scope:actor - scope:recipient = { is_tributary_of_suzerain_or_above = scope:target.casus_belli.primary_attacker } - } - NOT = { - scope:recipient = { is_tributary_of_suzerain_or_above = scope:target.casus_belli.primary_attacker } - } - } - trigger_else_if = { - limit = { - scope:target.casus_belli.primary_attacker = scope:actor - scope:recipient = { is_tributary_of_suzerain_or_above = scope:target.casus_belli.primary_defender } - } - NOT = { - scope:recipient = { is_tributary_of_suzerain_or_above = scope:target.casus_belli.primary_defender } - } - } - trigger_else = {} - } - - on_auto_accept = { - scope:recipient = { - trigger_event = call_ally.0001 - } - scope:target = { - if = { - limit = { - is_religious_war = yes - scope:recipient = { - any_active_accolade = { - accolade_parameter = acclaimed_knight_piety_from_battle - } - } - } - scope:recipient = { - add_piety = miniscule_piety_gain - } - } - if = { - limit = { - is_religious_war = yes - scope:recipient = { - any_active_accolade = { - accolade_parameter = acclaimed_knight_piety_from_battle_high - } - } - } - scope:recipient = { - add_piety = minor_piety_gain - } - } - } - } - - on_accept = { - call_ally_interaction_effect = yes - - save_scope_value_as = { - name = call_ally_interaction - value = yes - } - - scope:actor = { - hidden_effect = { #To nudge friendship - if = { - limit = { - NOR = { - has_relation_friend = scope:recipient - has_relation_potential_friend = scope:recipient - } - } - set_relation_potential_friend = scope:recipient - } - } - trigger_event = call_ally.0100 - } - scope:target = { - if = { - limit = { - is_religious_war = yes - scope:recipient = { - any_active_accolade = { - accolade_parameter = acclaimed_knight_piety_from_battle - } - } - } - scope:recipient = { - add_piety = minor_piety_gain - } - } - if = { - limit = { - is_religious_war = yes - scope:recipient = { - any_active_accolade = { - accolade_parameter = acclaimed_knight_piety_from_battle_high - } - } - } - scope:recipient = { - add_piety = medium_piety_gain - } - } - } - } - - on_decline = { - #The war could theoretically end on the day the decline is sent - if = { - limit = { - exists = scope:target - } - scope:target = { - if = { - limit = { - is_attacker = scope:actor - } - scope:actor = { - add_opinion = { - modifier = rejected_call_to_offensive_war - target = scope:recipient - } - } - scope:recipient = { - #Why should Mandalas care about bickering tributaries in an offensive war - if = { - limit = { - NOT = { government_has_flag = government_is_mandala } - } - add_prestige_experience = major_prestige_loss - } - } - } - else = { - scope:actor = { - add_opinion = { - modifier = rejected_call_to_defensive_war - target = scope:recipient - } - } - scope:recipient = { - if = { - limit = { government_has_flag = government_is_mandala } - add_prestige_experience = major_prestige_loss - add_piety_level = -1 - } - else = { add_prestige_experience = massive_prestige_loss } - } - } - if = { - limit = { - scope:actor = { - has_relation_blood_brother = scope:recipient - } - } - scope:recipient = { - add_piety_experience = massive_piety_loss - add_character_modifier = { - modifier = broke_blood_brotherhood_modifier - desc = broke_blood_brotherhood_modifier_acceptance_tt - years = 25 - } - remove_relation_blood_brother = scope:actor - } - scope:actor = { - set_relation_rival = { - target = scope:recipient - reason = rival_blood_brother_refused_call_reason - } - } - } - # Nomad Vassals and Tributaries stop being Obedient if they have the Liege War Support / Suzerain Defensive Guarantee contract right - if = { - limit = { - scope:recipient = scope:actor.obedience_target - scope:actor = { - OR = { - subject_contract_has_flag = vassal_contract_liege_forced_war_override - subject_contract_has_flag = tributary_contract_suzerain_guarantee_override - } - } - } - scope:actor = { - set_variable = { - name = not_obedient_declined_call - value = scope:recipient - years = 5 - } - } - } - if = { - limit = { - scope:recipient = scope:actor.suzerain - is_defender = scope:actor - scope:actor = { - subject_contract_has_flag = tributary_contract_suzerain_guarantee_override - } - } - scope:actor = { - end_tributary = yes - } - } - hidden_effect = { - if = { - limit = { - NOT = { was_called = scope:recipient } - } - set_called_to = scope:recipient - } - } - } - scope:actor = { - trigger_event = call_ally.0101 - } - - # If we're a clan this interaction affects unity - refuse_call_to_arms_add_clan_unity_effect = yes - - scope:recipient = { - if = { - limit = { - exists = house - is_house_head = yes - exists = scope:actor.house - } - house = { - change_house_relation_effect = { - HOUSE = scope:actor.house - VALUE = house_relation_damage_medium_value - REASON = ally_call_ignored - CHAR = scope:recipient - TARGET_CHAR = scope:actor - TITLE = scope:dummy_gender - } - } - } - } - } - } - - auto_accept = { - OR = { - # Always accept a call from a Spouse - custom_description = { - text = "recipient_is_spouse" - subject = scope:actor - object = scope:recipient - scope:recipient = { - is_spouse_of = scope:actor - is_ai = yes - } - } - # Always accept a call from the Heir - custom_description = { - text = "is_recipients_player_heir" - subject = scope:actor - object = scope:recipient - - exists = scope:recipient.player_heir - scope:recipient = { - player_heir = scope:actor - is_close_or_extended_family_of = scope:actor # Only for family - is_ai = yes - } - } - # Always accept a call from the one you are heir of - custom_description = { - text = "is_player_heir" - subject = scope:recipient - object = scope:actor - - exists = scope:actor.player_heir - scope:actor.player_heir = scope:recipient - scope:actor = { # Shouldn't be able to force your liege to join just because you've not got any family... - is_close_or_extended_family_of = scope:recipient - } - scope:recipient = { - is_ai = yes - } - } - } - } - - ai_accept = { - base = 20 - - modifier = { # Conquerors do not help anyone but themselves - add = -1000 - desc = NO_FRIVOLOUS_ACTIVITIES_REASON - scope:recipient = { has_variable = conqueror } - } - - modifier = { # AI's that need to save gold will not help their lesser AI allies, unless it's a player war - add = -1000 - desc = NO_FRIVOLOUS_ACTIVITIES_REASON - scope:actor = { - is_ai = yes - primary_title.tier < scope:recipient.primary_title.tier - } - scope:target.casus_belli = { - primary_attacker = { is_ai = yes } - primary_defender = { is_ai = yes } - } - scope:recipient = { ai_should_focus_on_building_in_their_capital = yes } - } - - modifier = { # Refuse call to conflicts of little benefit - add = -1000 - desc = WONT_FIGHT_MEANINGLESS_REASON - trigger_if = { - limit = { exists = scope:target } - scope:target = { using_cb = fp2_border_raid } - scope:recipient = { # Unless they like going on raids - NOR = { - has_trait = viking - has_trait = reaver - } - } - } - trigger_else = { always = no } - } - - modifier = { # Refuse call against Heir - add = -1000 - exists = scope:recipient.player_heir - trigger_if = { - limit = { scope:target.casus_belli.primary_defender = scope:actor } - scope:target.casus_belli.primary_attacker = scope:recipient.player_heir - } - trigger_else = { - scope:target.casus_belli.primary_defender = scope:recipient.player_heir - } - desc = WONT_FIGHT_HEIR_REASON - } - - modifier = { # Refuse call against Spouse - add = -1000 - scope:recipient = { - trigger_if = { - limit = { scope:target.casus_belli.primary_defender = scope:actor } - any_spouse = { - this = scope:target.casus_belli.primary_attacker - } - } - trigger_else = { - any_spouse = { - this = scope:target.casus_belli.primary_defender - } - } - - } - desc = WONT_FIGHT_SPOUSE_REASON - } - - modifier = { # Refuse call against Suzerain if Obedient - add = -1000 - trigger_if = { - limit = { - exists = scope:recipient.suzerain - trigger_if = { - limit = { scope:target.casus_belli.primary_defender = scope:actor } - scope:recipient.suzerain = scope:target.casus_belli.primary_attacker - } - trigger_else = { - scope:recipient.suzerain = scope:target.casus_belli.primary_defender - } - scope:recipient = { - exists = obedience_target - is_obedient = yes - } - } - } - trigger_else = { always = no } - desc = WONT_FIGHT_OBEDIENT_REASON - } - - opinion_modifier = { # Opinion Factor - who = scope:recipient - opinion_target = scope:actor - multiplier = 1.0 - desc = AI_OPINION_REASON - } - - # Honor factor - ai_value_modifier = { - ai_honor = 1 - min = 0 - } - - modifier = { # Tends to join defensive wars - add = 50 - scope:target.casus_belli.primary_defender = scope:actor - desc = DEFENSIVE_WAR_REASON - } - - modifier = { # Same language - add = 5 - desc = speaks_same_language_interaction_reason - trigger = { - scope:actor = { - knows_language_of_culture = scope:recipient.culture - } - } - } - - modifier = { # Shared Court Language (non-spoken) - add = 10 - desc = foreign_realm_court_language_non_spoken_interaction_reason - trigger = { - scope:actor = { - has_royal_court = yes - has_dlc_feature = royal_court - NOT = { knows_court_language_of = this } - } - scope:actor.top_liege != scope:recipient.top_liege - OR = { - AND = { - scope:recipient = { - has_royal_court = yes - } - scope:actor = { # You share Court Language - has_same_court_language = scope:recipient - } - } - - scope:recipient = { # The recipient doesn't have a royal court, but their liege does - liege != this - has_royal_court = no - any_liege_or_above = { - has_royal_court = yes - has_same_court_language = scope:actor - save_temporary_scope_as = liege_temp - NOT = { - prev = { - any_liege_or_above = { - has_royal_court = yes - is_vassal_or_below_of = scope:liege_temp - } - } - } - } - } - } - } - } - - modifier = { # Shared Court Language (spoken) - add = 30 - desc = foreign_realm_court_language_spoken_interaction_reason - trigger = { - scope:actor = { - has_royal_court = yes - has_dlc_feature = royal_court - knows_court_language_of = this - } - scope:actor.top_liege != scope:recipient.top_liege - OR = { - AND = { - scope:recipient = { - has_royal_court = yes - } - scope:actor = { # You share Court Language - has_same_court_language = scope:recipient - } - } - - scope:recipient = { # The recipient doesn't have a royal court, but their liege does - liege != this - has_royal_court = no - any_liege_or_above = { - has_royal_court = yes - has_same_court_language = scope:actor - save_temporary_scope_as = liege_temp - NOT = { - prev = { - any_liege_or_above = { - has_royal_court = yes - is_vassal_or_below_of = scope:liege_temp - } - } - } - } - } - } - } - } - - modifier = { # Serious diarchs wish to support their liege - add = 50 - desc = ENTRENCHED_REGENT_WILL_SUPPORT_LIEGE - trigger_if = { - limit = { scope:recipient ?= scope:actor.diarch } - scope:actor = { has_diarchy_parameter = diarchy_type_is_entrenched_regency } - } - trigger_else = { always = no } - } - - compare_modifier = { # Likes fighting infidels - trigger = { - scope:recipient.faith = scope:actor.faith - OR = { - AND = { - scope:target.casus_belli.primary_attacker = { - this = scope:actor - faith = { - faith_hostility_level = { - target = scope:target.casus_belli.primary_defender.faith - value >= religious_cb_enabled_hostility_level - } - } - } - } - AND = { - scope:target.casus_belli.primary_defender = { - this = scope:actor - faith = { - faith_hostility_level = { - target = scope:target.casus_belli.primary_defender.faith - value >= religious_cb_enabled_hostility_level - } - } - } - } - } - } - target = scope:recipient - value = ai_zeal - desc = "ZEAL_AGAINST_INFIDELS" - min = 0 - multiplier = 0.5 - } - - modifier = { # Reluctant to attack another ally - add = -50 - scope:target.casus_belli.primary_attacker = scope:actor - scope:recipient = { - is_allied_to = scope:target.casus_belli.primary_defender - } - desc = ATTACK_ON_ALLY_REASON - } - - modifier = { # Reluctant to defend against another ally - add = -25 - scope:target.casus_belli.primary_defender = scope:actor - scope:recipient = { - is_allied_to = scope:target.casus_belli.primary_attacker - } - desc = WAR_WITH_ALLY_REASON - } - - modifier = { # Reluctant to join wars against religious brethren. - add = -50 - scope:recipient.faith != scope:actor.faith - scope:target.casus_belli.primary_attacker = scope:actor - scope:target.casus_belli.primary_defender.faith = scope:recipient.faith - scope:target.casus_belli.war = { - OR = { - using_cb = minor_religious_war - using_cb = religious_war - using_cb = major_religious_war - using_cb = undirected_great_holy_war - using_cb = directed_great_holy_war - } - } - desc = WONT_ATTACK_RELIGIOUS_BRETHREN_REASON - } - - modifier = { # Reluctant to join against Friends - add = -50 - trigger_if = { - limit = { - scope:target.casus_belli.primary_defender = scope:actor - } - has_relation_friend = scope:target.casus_belli.primary_attacker - } - trigger_else = { - has_relation_friend = scope:target.casus_belli.primary_defender - } - desc = WONT_FIGHT_FRIEND_REASON - } - - modifier = { # Reluctant to join against Best Friends - add = -100 - trigger_if = { - limit = { - scope:target.casus_belli.primary_defender = scope:actor - } - has_relation_best_friend = scope:target.casus_belli.primary_attacker - } - trigger_else = { - has_relation_best_friend = scope:target.casus_belli.primary_defender - } - desc = WONT_FIGHT_BEST_FRIEND_REASON - } - modifier = { # Reluctant to join against Lovers - add = -100 - trigger_if = { - limit = { - scope:target.casus_belli.primary_defender = scope:actor - } - has_relation_lover = scope:target.casus_belli.primary_attacker - } - trigger_else = { - has_relation_lover = scope:target.casus_belli.primary_defender - } - desc = WONT_FIGHT_LOVER_REASON - } - modifier = { # Reluctant to join against Soulmate - add = -200 - trigger_if = { - limit = { - scope:target.casus_belli.primary_defender = scope:actor - } - has_relation_soulmate = scope:target.casus_belli.primary_attacker - } - trigger_else = { - has_relation_soulmate = scope:target.casus_belli.primary_defender - } - desc = WONT_FIGHT_SOULMATE_REASON - } - modifier = { # Reluctant to join tributaries - add = -200 - scope:actor = { - is_tributary_of = scope:recipient - NOT = { subject_contract_has_flag = tributary_contract_suzerain_guarantee_override } - } - scope:recipient = { - NOR = { - has_relation_lover = scope:actor - has_relation_friend = scope:actor - is_allied_to = scope:actor - } - } - desc = WONT_FIGHT_MEANINGLESS_REASON - } - modifier = { # Refuse call for hostages' safety - any_home_court_hostage = { - warden = { - OR = { - is_at_war_with = scope:actor - any_ally = { is_at_war_with = scope:actor } - } - } - } - add = { - value = 0 - every_home_court_hostage = { - limit = { - warden = { - OR = { - is_at_war_with = scope:actor - any_ally = { is_at_war_with = scope:actor } - } - } - } - subtract = call_to_arms_hostage_value - } - multiply = 0.25 - } - desc = HOSTAGE_ENEMY_CALL_TO_ARMS_REASON - } - - modifier = { - scope:recipient.house.house_confederation ?= { - trigger_if = { - limit = { scope:actor = { is_defender_in_war = scope:target } } - this = scope:target.casus_belli.primary_attacker.house.house_confederation - } - trigger_else = { this = scope:target.casus_belli.primary_defender.house.house_confederation } - } - add = -100 - desc = BLOC_MEMBER_CALL_TO_ARMS_REASON - } - - modifier = { - add = 200 - scope:actor = { - is_tributary_of = scope:recipient - subject_contract_has_flag = tributary_contract_suzerain_guarantee_override - } - desc = MANDALA_GUARANTEE_REASON - } - - fp3_struggle_resist_allied_wars_modifier = yes - - } - - # Score above 0 means the AI will call this ally. Note that DESIRED_WAR_SIDE_STRENGTH still applies and can prevent calling the ally - ai_will_do = { - base = 100 - - modifier = { # If the player is at war, do not bother them with offensive calls - scope:target.casus_belli.primary_attacker = scope:actor - scope:recipient = { - is_ai = no - any_character_war = { - primary_defender = scope:recipient - } - } - factor = 0 - } - - modifier = { # Do not call the player if they are in debt - scope:recipient = { - is_ai = no - gold <= -1 - } - factor = 0 - } - - modifier = { # Don't call players in against their heirs (they wouldn't accept the reverse situation... don't be a hypocrite) - exists = scope:recipient.player_heir - scope:recipient = { - is_ai = no - } - trigger_if = { - limit = { scope:target.casus_belli.primary_defender = scope:actor } - scope:target.casus_belli.primary_attacker = scope:recipient.player_heir - } - trigger_else = { - scope:target.casus_belli.primary_defender = scope:recipient.player_heir - } - factor = 0 - } - - modifier = { # Same with spouses - scope:recipient = { - is_ai = no - } - trigger_if = { - limit = { scope:target.casus_belli.primary_defender = scope:actor } - any_spouse = { - this = scope:target.casus_belli.primary_attacker - } - } - trigger_else = { - any_spouse = { - this = scope:target.casus_belli.primary_defender - } - } - factor = 0 - } - - modifier = { # Don't call brand-new allies into old wars, at least until some time has elapsed. - has_variable = delay_calling_recent_ally - var:delay_calling_recent_ally = scope:recipient - scope:target = { - war_days >= 30 - } - factor = 0 - - } - - modifier = { # If the recipient is allied to both the attacker and the defender, the attacker shouldn't call - scope:target.casus_belli.primary_attacker = scope:actor - scope:target.casus_belli.primary_defender = { - is_allied_to = scope:recipient - } - factor = 0 - } - - #You're a Mandala Suzerain; you don't get off the hook that easily - modifier = { - scope:actor = { subject_contract_has_flag = tributary_contract_suzerain_guarantee_override } - scope:recipient = scope:actor.suzerain - add = 500 - } - } -} - -negotiate_alliance_interaction = { - category = interaction_category_diplomacy - ai_min_reply_days = 4 - ai_max_reply_days = 9 - icon = alliance - - send_name = negotiate_alliance_interaction - - interface_priority = 60 - desc = negotiate_alliance_interaction_desc - - greeting = positive - notification_text = NEGOTIATE_ALLIANCE_NOTIFICATION - - is_available = { - trigger_if = { - limit = { is_ai = yes } - is_at_war = no - } - } - - is_shown = { - scope:puppet_or_actor ?= { - OR = { - highest_held_title_tier >= 2 - scope:actor = { is_ai = no } - } - is_ruler = yes - #childhood friendship with hostage event, where they swear to be friends forever - OR = { - is_any_family_relation_or_spouse_trigger = { CHARACTER = scope:recipient } - hostage_oath_of_friendship_trigger = yes - #Parents/spouse were blood brothers - has_opinion_modifier = { - modifier = blood_brother_close_family_opinion - target = scope:recipient - } - house ?= { - house_head ?= scope:puppet_or_actor - any_house_relation = { - any_relation_house = { - exists = house_head - scope:recipient = house_head - } - has_house_relation_parameter = unlocks_house_head_negotiate_alliance - } - } - } - } - scope:recipient = { - this != scope:puppet_or_actor - NOT = { is_allied_to = scope:puppet_or_actor } - is_ruler = yes - } - } - - is_valid_showing_failures_only = { - scope:recipient = { - is_playable_character = yes - is_imprisoned = no - highest_held_title_tier < tier_hegemony - } - scope:puppet_or_actor ?= { - is_playable_character = yes - is_imprisoned = no - NOT = { - is_at_war_with = scope:recipient - } - highest_held_title_tier < tier_hegemony - OR = { - #Ruler has the defensive negotiations perk - has_perk = defensive_negotiations_perk - #Ruler is married to other ruler. - is_spouse_of = scope:recipient - #Ruler is relative of other ruler - is_parent_of = scope:recipient - is_grandparent_of = scope:recipient - is_great_grandparent_of = scope:recipient - is_child_of = scope:recipient - is_grandchild_of = scope:recipient - is_great_grandchild_of = scope:recipient - is_uncle_or_aunt_of = scope:recipient - is_nibling_of = scope:recipient - is_sibling_of = scope:recipient - #Parents/spouse were blood brothers - has_opinion_modifier = { - modifier = blood_brother_close_family_opinion - target = scope:recipient - } - - - custom_description = { - text = rulers_family_is_married_to_other_ruler_trigger - subject = scope:recipient - object = scope:puppet_or_actor - #Ruler's child/parent/sibling/grandchild/grandparent/uncle/aunt/niece/nephew is married to other ruler. - scope:recipient = { - any_spouse = { - OR = { - is_close_family_of = scope:puppet_or_actor - is_nibling_of = scope:puppet_or_actor - is_uncle_or_aunt_of = scope:puppet_or_actor - } - } - } - } - - custom_description = { - text = rulers_family_is_married_to_other_ruler_trigger - subject = scope:puppet_or_actor - object = scope:recipient - #Other ruler's child/parent/sibling/grandchild/grandparent/uncle/aunt/niece/nephew is married to first ruler. - any_spouse = { - OR = { - is_close_family_of = scope:recipient - is_nibling_of = scope:recipient - is_uncle_or_aunt_of = scope:recipient - } - } - } - - custom_description = { - text = rulers_child_parent_sibling_is_married_to_other_rulers_trigger - subject = scope:recipient - object = scope:puppet_or_actor - # Ruler's child/parent/sibling is married to other ruler's child/parent/sibling. - any_close_family_member = { - OR = { - is_parent_of = scope:puppet_or_actor - is_child_of = scope:puppet_or_actor - is_sibling_of = scope:puppet_or_actor - } - any_spouse = { - OR = { - is_parent_of = scope:recipient - is_child_of = scope:recipient - is_sibling_of = scope:recipient - } - } - } - } - - custom_description = { - text = hostage_oath_of_friendship_trigger - subject = scope:recipient - object = scope:puppet_or_actor - #childhood friendship with hostage event, where they swear to be friends forever - hostage_oath_of_friendship_trigger = yes - } - - custom_tooltip = { - text = house_relation_alliance_trigger - house ?= { - house_head ?= scope:puppet_or_actor - any_house_relation = { - any_relation_house = { - exists = house_head - scope:recipient = house_head - } - has_house_relation_parameter = unlocks_house_head_negotiate_alliance - } - } - } - } - } - custom_description = { - text = "has_already_rejected_renegotiation" - subject = scope:recipient - NOT = { - scope:puppet_or_actor = { - has_opinion_modifier = { - modifier = refused_alliance_opinion - target = scope:recipient - } - } - } - } - } - - on_auto_accept = { - scope:recipient = { - trigger_event = char_interaction.0234 - } - } - - #Use hook - send_option = { - is_valid = { - scope:puppet_or_actor = { - has_usable_hook = scope:recipient - } - } - flag = hook - localization = GENERIC_SPEND_A_HOOK - } - should_use_extra_icon = { - scope:puppet_or_actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - # Admin Gov can spend Influence to increase AI acceptance towards other same-realm admin characters - send_option = { - is_shown = { - scope:puppet_or_actor = { - government_has_flag = government_has_influence - } - scope:recipient = { - top_liege = scope:puppet_or_actor.top_liege - government_has_flag = government_has_influence - } - } - is_valid = { - scope:puppet_or_actor = { - influence >= major_influence_value - } - custom_tooltip = { - text = ALREADY_USING_HOOK - NOT = { scope:hook = yes } - } - } - flag = influence - localization = SPEND_INFLUENCE - } - - send_options_exclusive = no - - is_highlighted = { - scope:recipient = { - this != scope:puppet_or_actor - NOT = { is_allied_to = scope:puppet_or_actor } - is_ruler = yes - } - scope:puppet_or_actor = { - is_ruler = yes - OR = { - scope:actor = { is_ai = no } - highest_held_title_tier >= 2 - } - has_opinion_modifier = { - modifier = blood_brother_close_family_opinion - target = scope:recipient - } - } - } - - on_accept = { - scope:puppet_or_actor = { - trigger_event = char_interaction.0235 - - stress_and_fulfillment_impact = { - shy = minor_stress_impact_gain - } - - if = { - limit = { - scope:hook = yes - has_usable_hook = scope:recipient - } - use_hook = scope:recipient - } - if = { - limit = { - scope:influence = yes - } - change_influence = major_influence_loss - } - } - - scope:recipient = { - custom_tooltip = negotiate_alliance_effect_recipient_tooltip - } - - #Set up alliance, depending on relation between rulers. - hidden_effect = { - #Prioritize marriage between rulers and/or direct blood relation between rulers first. - if = { - limit = { - scope:puppet_or_actor = { - OR = { - is_spouse_of = scope:recipient - is_child_of = scope:recipient - is_parent_of = scope:recipient - is_sibling_of = scope:recipient - is_grandparent_of = scope:recipient - is_great_grandparent_of = scope:recipient - is_grandchild_of = scope:recipient - is_great_grandchild_of = scope:recipient - is_uncle_or_aunt_of = scope:recipient - is_nibling_of = scope:recipient - } - } - } - scope:puppet_or_actor = { - create_alliance = { - target = scope:recipient - allied_through_owner = scope:puppet_or_actor - allied_through_target = scope:recipient - } - } - } - #...Then marriage between close family members and either actor or recipient. - else_if = { - limit = { - scope:recipient = { - any_spouse = { - OR = { - is_close_family_of = scope:puppet_or_actor - is_nibling_of = scope:puppet_or_actor - is_uncle_or_aunt_of = scope:puppet_or_actor - } - } - } - } - scope:recipient = { - random_spouse = { - limit = { - OR = { - is_close_family_of = scope:puppet_or_actor - is_nibling_of = scope:puppet_or_actor - is_uncle_or_aunt_of = scope:puppet_or_actor - } - } - save_scope_as = recipient_spouse - } - } - scope:puppet_or_actor = { - create_alliance = { - target = scope:recipient - allied_through_owner = scope:recipient_spouse - allied_through_target = scope:recipient - } - } - } - else_if = { - limit = { - scope:puppet_or_actor = { - any_spouse = { - OR = { - is_close_family_of = scope:recipient - is_nibling_of = scope:recipient - is_uncle_or_aunt_of = scope:recipient - } - } - } - } - scope:puppet_or_actor = { - random_spouse = { - limit = { - OR = { - is_close_family_of = scope:recipient - is_nibling_of = scope:recipient - is_uncle_or_aunt_of = scope:recipient - } - } - save_scope_as = actor_spouse - } - } - scope:puppet_or_actor = { - create_alliance = { - target = scope:recipient - allied_through_owner = scope:puppet_or_actor - allied_through_target = scope:actor_spouse - } - } - } - #...And finally marriage between close relatives and close relatives. - else_if = { - limit = { - scope:puppet_or_actor = { - any_close_family_member = { - OR = { - is_child_of = scope:puppet_or_actor - is_parent_of = scope:puppet_or_actor - is_sibling_of = scope:puppet_or_actor - } - any_spouse = { - OR = { - is_child_of = scope:recipient - is_parent_of = scope:recipient - is_sibling_of = scope:recipient - } - } - } - } - } - scope:puppet_or_actor = { - random_close_family_member = { - limit = { - OR = { - is_child_of = scope:puppet_or_actor - is_parent_of = scope:puppet_or_actor - is_sibling_of = scope:puppet_or_actor - } - any_spouse = { - OR = { - is_child_of = scope:recipient - is_parent_of = scope:recipient - is_sibling_of = scope:recipient - } - } - } - save_scope_as = actor_spouse - random_spouse = { - limit = { - OR = { - is_child_of = scope:recipient - is_parent_of = scope:recipient - is_sibling_of = scope:recipient - } - } - save_scope_as = recipient_spouse - } - } - } - scope:puppet_or_actor = { - create_alliance = { - target = scope:recipient - allied_through_owner = scope:actor_spouse - allied_through_target = scope:recipient_spouse - } - } - } - else_if = { - limit = { - scope:puppet_or_actor = { has_perk = defensive_negotiations_perk } - } - scope:puppet_or_actor = { - create_alliance = { - target = scope:recipient - allied_through_owner = scope:puppet_or_actor - allied_through_target = scope:recipient - } - } - scope:recipient = { # This opinion modifier controls the interaction, and is removed when breaking the alliance in any way (though on_actions) - add_opinion = { - modifier = perk_negotiated_alliance_opinion - target = scope:puppet_or_actor - } - } - } - else_if = { - limit = { - scope:puppet_or_actor = { - hostage_oath_of_friendship_trigger = yes - } - } - scope:puppet_or_actor = { - create_alliance = { - target = scope:recipient - allied_through_owner = scope:puppet_or_actor - allied_through_target = scope:recipient - } - } - } - } - - add_clan_unity_interaction_effect = { - CHARACTER = scope:puppet_or_actor - TARGET = scope:recipient - VALUE = minor_unity_gain - DESC = clan_unity_alliance.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - on_decline = { - scope:puppet_or_actor = { - trigger_event = char_interaction.0236 - } - scope:puppet_or_actor = { - add_opinion = { - modifier = refused_alliance_opinion - target = scope:recipient - } - } - - add_clan_unity_interaction_effect = { - CHARACTER = scope:puppet_or_actor - TARGET = scope:recipient - VALUE = minor_unity_loss - DESC = clan_unity_alliance_refusal.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - auto_accept = { - custom_description = { - text = "spending_hook" - subject = scope:puppet_or_actor - object = scope:recipient - scope:hook = yes - } - } - ai_accept = { - base = 0 - - negotiate_alliance_interaction_ai_acceptance = yes - - # Tier Difference (+/-) - # Inheritance (+) - # Opinion (+/-) - # Dynasty Prestige. (+) - # Different Faith. (-) - # Liege is asking (+) - # Dread (+) - # Power difference (+/-) - # Claimants (+/-) - # Same House (+) - # Declared war opinion - # Actor is at war penalty - - modifier = { - add = 20 - scope:recipient = { - is_close_family_of = scope:puppet_or_actor - } - desc = CLOSE_FAMILY_REASON - } - - modifier = { - add = 10 - scope:recipient = { - NOT = { is_close_family_of = scope:puppet_or_actor } - is_extended_family_of = scope:puppet_or_actor - } - desc = EXTENDED_FAMILY_REASON - } - - modifier = { - add = -20 - scope:recipient = { - NOT = { is_close_or_extended_family_of = scope:puppet_or_actor } - any_spouse = { - NOT = { is_close_family_of = scope:puppet_or_actor } - is_extended_family_of = scope:puppet_or_actor - } - } - desc = DISTANT_FAMILY_CONNECTION_REASON - } - - modifier = { - scope:recipient = { - has_relation_lover = scope:puppet_or_actor - } - add = { - value = 25 - } - desc = WE_ARE_LOVERS - } - modifier = { - scope:recipient = { - has_relation_friend = scope:puppet_or_actor - } - add = { - value = 25 - } - desc = WE_ARE_FRIENDS - } - modifier = { - scope:recipient = { - is_heir_of = scope:puppet_or_actor - } - scope:puppet_or_actor = { - tier_difference = { - target = scope:recipient - value > 0 - } - } - add = { - value = 10 - if = { - limit = { - scope:puppet_or_actor = { player_heir = scope:recipient } - } - add = 10 - } - } - desc = IS_HEIR_REASON - } - modifier = { - add = 20 - desc = FAMILY_BLOOD_BROTHERHOOD_REASON - scope:puppet_or_actor = { - has_opinion_modifier = { - modifier = blood_brother_close_family_opinion - target = scope:recipient - } - } - } - - # Unity modifiers - evaluate_action_increasing_house_unity = { - VALUE = 100 - } - - fp3_struggle_resist_allied_wars_modifier = yes - - # LOW LEGITIMACY - modifier = { - desc = "LOW_LEGITIMACY_REASON" - scope:puppet_or_actor = { - OR = { - has_legitimacy_flag = reduced_alliance_acceptance - has_legitimacy_flag = very_reduced_alliance_acceptance - has_legitimacy_flag = massively_reduced_alliance_acceptance - } - } - add = { - value = 0 - if = { - limit = { scope:puppet_or_actor = { has_legitimacy_flag = reduced_alliance_acceptance } } - add = -25 - } - if = { - limit = { scope:puppet_or_actor = { has_legitimacy_flag = very_reduced_alliance_acceptance } } - add = -50 - } - if = { - limit = { scope:puppet_or_actor = { has_legitimacy_flag = massively_reduced_alliance_acceptance } } - add = -100 - } - } - } - - # HIGH LEGITIMACY - modifier = { - desc = "HIGH_LEGITIMACY_REASON" - scope:puppet_or_actor = { - OR = { - has_legitimacy_flag = increased_alliance_acceptance - has_legitimacy_flag = very_increased_alliance_acceptance - has_legitimacy_flag = extra_increased_alliance_acceptance - } - } - add = { - value = 0 - if = { - limit = { scope:puppet_or_actor = { has_legitimacy_flag = increased_alliance_acceptance } } - add = 10 - } - if = { - limit = { scope:puppet_or_actor = { has_legitimacy_flag = very_increased_alliance_acceptance } } - add = 25 - } - if = { - limit = { scope:puppet_or_actor = { has_legitimacy_flag = extra_increased_alliance_acceptance } } - add = 50 - } - } - } - - # TGP ALLIANCE WITH NF HOUSE HEAD - modifier = { - add = 750 - scope:puppet_or_actor = { - is_house_head = yes - scope:recipient.house ?= this.house - any_held_title = { is_noble_family_title = yes } - } - desc = JAPANESE_HOUSE_HEAD_ALLIANCE_REASON - } - - modifier = { - add = 10 - desc = pam_praised_hunting_alliance_accept_reason - scope:recipient = { - exists = var:pam_praised_hunting_alliance_var - var:pam_praised_hunting_alliance_var = scope:puppet_or_actor - } - } - } - - ai_targets = { - ai_recipients = dynasty - max = 20 - } - - ai_targets = { - ai_recipients = family - max = 10 - } - - ai_targets = { - ai_recipients = spouses - } - ai_frequency_by_tier = { - barony = 0 - county = 144 - duchy = 72 - kingdom = 36 - empire = 36 - hegemony = 36 - } - - ai_will_do = { - base = 0 - - modifier = { - add = 100 - any_ally = { - count < 2 - } - scope:recipient = { # Don't propose alliances to tiny insignificant rulers just because - OR = { - current_military_strength >= scope:puppet_or_actor.eighty_percent_of_current_military_strength - primary_title.tier >= scope:puppet_or_actor.primary_title.tier - AND = { - primary_title.tier >= tier_duchy - scope:puppet_or_actor.primary_title.tier < tier_empire - } - } - } - } - - modifier = { # Clans always want alliances with Vassals - add = 100 - scope:puppet_or_actor = { - government_has_flag = government_is_clan - } - scope:recipient = { - is_vassal_of = scope:puppet_or_actor - } - } - - # Unity modifiers - evaluate_action_increasing_house_unity = { - VALUE = 100 - } - - modifier = { # The AI shouldn't propose to their Lieges - factor = 0 - is_liege_or_above_of = scope:recipient - } - - modifier = { # The AI shouldn't propose to their Vassals unless Clan - factor = 0 - scope:puppet_or_actor = { - NOT = { government_has_flag = government_is_clan } - } - scope:recipient = { - is_vassal_of = scope:puppet_or_actor - } - } - } -} - -perk_alliance_interaction = { - category = interaction_category_diplomacy - ai_min_reply_days = 4 - ai_max_reply_days = 9 - icon = alliance - - - interface_priority = 60 - desc = perk_alliance_interaction_desc - - greeting = positive - notification_text = PERK_NEGOTIATE_ALLIANCE_NOTIFICATION - - is_available = { - trigger_if = { - limit = { is_ai = yes } - is_at_war = no - any_ally = { - count < 2 - } - } - } - - is_shown = { - scope:puppet_or_actor ?= { - has_perk = defensive_negotiations_perk - is_landless_adventurer = no - NOR = { - government_has_flag = government_is_herder - # This interaction is harder to push through than Negotiate Alliance, and does the same thing, so don't show both - is_character_interaction_shown = { - recipient = scope:recipient - interaction = negotiate_alliance_interaction - } - } - } - scope:recipient = { - NOR = { - this = scope:puppet_or_actor - is_allied_to = scope:puppet_or_actor - target_is_vassal_or_below = scope:puppet_or_actor # Can only sign with external rulers/peer vassals, though the alliance is preserved if they somehow become your vassals - target_is_liege_or_above = scope:puppet_or_actor - government_has_flag = government_is_herder - } - is_ruler = yes - primary_title.tier > tier_barony - } - } - - is_valid_showing_failures_only = { - scope:puppet_or_actor ?= { - is_landless_adventurer = no - } - scope:recipient = { - NOT = { target_is_vassal_or_below = scope:puppet_or_actor } # Can only sign with external rulers/peer vassals, though the alliance is preserved if they somehow become your vassals - NOT = { target_is_liege_or_above = scope:puppet_or_actor } - } - - custom_description = { - text = "already_has_an_alliance_deal" - subject = scope:recipient - scope:puppet_or_actor = { - NOT = { - any_ally = { - has_opinion_modifier = { - modifier = perk_negotiated_alliance_opinion - target = scope:puppet_or_actor - } - } - } - } - } - - scope:recipient = { - is_playable_character = yes - is_at_war = no - is_imprisoned = no - } - - scope:puppet_or_actor = { - is_playable_character = yes - is_at_war = no - is_imprisoned = no - } - - custom_description = { - text = "has_already_rejected_renegotiation" - subject = scope:recipient - scope:puppet_or_actor = { - NOT = { - has_opinion_modifier = { - modifier = refused_alliance_opinion - target = scope:recipient - } - } - } - } - } - - can_send = { - custom_description = { # Exploit prevention - text = "has_sent_interaction_already" - subject = scope:recipient - scope:puppet_or_actor = { - NOT = { - has_pending_interaction_of_type = perk_alliance_interaction - } - } - } - } - - on_auto_accept = { - scope:recipient = { - trigger_event = char_interaction.0234 - } - } - - #Use hook - send_option = { - is_valid = { - scope:puppet_or_actor = { - has_usable_hook = scope:recipient - } - } - flag = hook - localization = GENERIC_SPEND_A_HOOK - } - should_use_extra_icon = { - scope:puppet_or_actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - # Admin Gov can spend Influence to increase AI acceptance towards other same-realm admin characters - send_option = { - is_shown = { - scope:puppet_or_actor = { - government_has_flag = government_has_influence - } - scope:recipient = { - top_liege = scope:puppet_or_actor.top_liege - government_has_flag = government_has_influence - } - } - is_valid = { - scope:puppet_or_actor = { - influence >= major_influence_value - } - custom_tooltip = { - text = ALREADY_USING_HOOK - NOT = { scope:hook = yes } - } - } - flag = influence - localization = SPEND_INFLUENCE - } - - send_options_exclusive = no - - on_accept = { - save_scope_value_as = { #So that we can show the opinion gain in the response event - name = perk_alliance_interaction - value = yes - } - scope:puppet_or_actor = { - custom_tooltip = negotiate_alliance_effect_tooltip - trigger_event = char_interaction.0235 - create_alliance = { - target = scope:recipient - allied_through_owner = scope:puppet_or_actor - allied_through_target = scope:recipient - } - - stress_and_fulfillment_impact = { - shy = minor_stress_impact_gain - } - - if = { - limit = { scope:hook = yes } - use_hook = scope:recipient - } - - if = { - limit = { - scope:influence = yes - } - change_influence = major_influence_loss - } - } - scope:recipient = { # This opinion modifier controls the interaction, and is removed when breaking the alliance in any way (though on_actions) - add_opinion = { - modifier = perk_negotiated_alliance_opinion - target = scope:puppet_or_actor - } - } - - add_clan_unity_interaction_effect = { - CHARACTER = scope:puppet_or_actor - TARGET = scope:recipient - VALUE = medium_unity_gain - DESC = clan_unity_alliance.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - on_decline = { - scope:puppet_or_actor = { - trigger_event = char_interaction.0236 - } - scope:puppet_or_actor = { - add_opinion = { - modifier = refused_alliance_opinion - target = scope:recipient - } - } - - add_clan_unity_interaction_effect = { - CHARACTER = scope:puppet_or_actor - TARGET = scope:recipient - VALUE = minor_unity_loss - DESC = clan_unity_alliance_refusal.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - auto_accept = { - custom_description = { - text = "spending_hook" - subject = scope:puppet_or_actor - object = scope:recipient - scope:hook = yes - } - } - - ai_accept = { # Similar to Negotiate Alliance, but without modifiers for Liege, being an heir, etc. - base = -25 - - negotiate_alliance_interaction_ai_acceptance = yes - - # Unity modifiers - evaluate_action_increasing_house_unity = { - VALUE = 10 - } - } - - ai_targets = { - ai_recipients = neighboring_rulers - max = 10 - } - - ai_targets = { - ai_recipients = peer_vassals - max = 5 - } - ai_frequency_by_tier = { - barony = 0 - county = 144 - duchy = 72 - kingdom = 72 - empire = 72 - hegemony = 72 - } - - ai_will_do = { - base = 100 - - # Unity modifiers - evaluate_action_increasing_house_unity = { - VALUE = 100 - } - - modifier = { # Don't disturb the player with pointless asks - add = -5000 - scope:recipient = { - is_ai = no - } - NOR = { - scope:puppet_or_actor.current_military_strength >= scope:recipient.current_military_strength - scope:puppet_or_actor.primary_title.tier >= scope:recipient.primary_title.tier - } - } - - modifier = { - add = -5000 - scope:recipient.current_military_strength <= 100 - } - } - -} - -join_war_interaction = { - category = interaction_category_diplomacy - interface = interfere_in_war - special_interaction = interfere_in_war_interaction - popup_on_receive = yes - desc = join_war_interaction_desc - icon = alliance - interface_priority = 29 - - greeting = positive - notification_text = join_war_interaction_notification - - is_shown = { - scope:recipient = { - is_at_war = yes - NOR = { - this = scope:actor - is_at_war_with = scope:actor - } - } - } - - is_valid_showing_failures_only = { - - # recipient is not in (any) war against your liege(s) or suzerain(s) - trigger_if = { - limit = { exists = scope:actor.liege } - custom_description = { - text = join_war_interaction_recipient_warring_with_my_liege - subject = scope:recipient - scope:actor = { - NOT = { - any_liege_or_above = { - is_at_war_with = scope:recipient - } - } - } - } - } - - # special exception for liege trying to put down his vassal's peasant revolt - trigger_if = { - limit = { - scope:actor = { - target_is_vassal_or_below = scope:recipient - } - } - custom_description = { - text = join_war_interaction_recipient_not_fighting_peasant_faction - subject = scope:recipient - scope:recipient = { - any_war_enemy = { - is_leading_faction_type = peasant_faction - } - } - } - } - # antipope wars - trigger_else_if = { - limit = { - scope:actor.faith = scope:recipient.faith - scope:recipient = { - any_character_war = { - OR = { - using_cb = pam_challenge_hof_cb - AND = { - using_cb = pam_antiking_cb - scope:actor.religious_head_or_challenger ?= scope:recipient - } - } - } - } - } - } - # if the target is neither a vassal-or-below, nor a liege-or-above, the recipient must either be an ally or defending against a qualifying holy war - unless the character is an adventurer in which case other rules apply - trigger_else_if = { - limit = { - scope:actor = { - NOT = { target_is_liege_or_above = scope:recipient } - } - } - trigger_if = { - limit = { - scope:actor = { has_government = landless_adventurer_government } - } - # bypass the requirements, unless you were invloved in a war and decided to leave it - scope:recipient = { - trigger_if = { - limit = { - any_character_war = { - has_variable_list = left_voluntarily - } - } - custom_tooltip = { - text = laamp_war_change_sides_interaction.left_voluntarily - is_target_in_variable_list = { - name = left_voluntarily - target = scope:actor - } - } - } - } - } - trigger_else_if = { - limit = { - scope:recipient = { - any_character_war = { - OR = { - #Must be either the same faith as the character being holy warred... - scope:recipient.faith = scope:actor.faith - #... Or, same religion, *and* you couldn't holy war them yourself. - AND = { - scope:recipient.faith.religion = scope:actor.faith.religion - scope:actor.faith = { - faith_hostility_level = { - target = scope:recipient.faith - value < religious_cb_enabled_hostility_level - } - } - } - #... Or, the target is your liege and they are being attacked for your held title. - AND = { - scope:recipient = { target_is_liege_or_above = scope:actor } - casus_belli = { - any_target_title = { - holder = { - OR = { - this = scope:actor - is_vassal_or_below_of = scope:actor - } - } - } - - } - } - } - any_war_defender = { this = scope:recipient } - } - } - } - # Deliberately blank; we've passed the trigger and making a desc out of this doesn't make sense - } - # Special case for Iberians helping each other after FP2 Conciliation ending after FP2 Conciliation ending - trigger_else_if = { - limit = { - fp2_struggle_conciliation_recipient_actor_involved_trigger = yes - scope:recipient = { - any_character_war = { - primary_defender = scope:recipient - primary_attacker = { save_temporary_scope_as = attacker_temp } - fp2_struggle_conciliation_scope_uninvolved_trigger = { SCOPE = scope:attacker_temp } - } - } - } - # Deliberately blank; we've passed the trigger and making a desc out of this doesn't make sense - } - - # if the actor and recipient is in the same confederation, they can always come to each others' aid - trigger_else_if = { - limit = { - exists = scope:recipient.confederation - scope:actor = { is_member_of_confederation = scope:recipient.confederation } - } - scope:actor = { is_member_of_confederation = scope:recipient.confederation } # for localization only - } - - # suzerains can always join their tributaries' defensive wars - trigger_else_if = { - limit = { - scope:recipient = { - is_tributary_of_suzerain_or_above = scope:actor - } - } - custom_tooltip = { - text = join_war_interaction_recipient_tributary_no_defensive_war - scope:recipient = { - any_character_war = { - primary_defender = scope:recipient - } - } - } - } - # tributaries can always offer to join their direct suzerains' defensive wars - trigger_else_if = { - limit = { - scope:actor = { - is_tributary_of = scope:recipient - } - } - custom_tooltip = { - text = join_war_interaction_recipient_tributary_no_defensive_war - scope:recipient = { - any_character_war = { - primary_defender = scope:recipient - } - } - } - } - - # if we haven't already passed any of the qualified conditions above, then we need to be allies - trigger_else = { - custom_description = { - text = join_war_interaction_recipient_not_ally - subject = scope:recipient - scope:recipient = { - is_allied_to = scope:actor - } - } - } - } - - # recipient is liege - trigger_else = { - custom_description = { - text = join_war_interaction_recipient_not_liege - subject = scope:recipient - scope:actor = { - target_is_liege_or_above = scope:recipient - } - } - } - - scope:actor = { - trigger_if = { - limit = { - has_government = landless_adventurer_government - } - custom_tooltip = { - text = reinforce_soldiers_any_regiment_tt - maa_regiments_count >= 1 - } - } - } - - # Adventurers can't join wars in places they're exiled from. - custom_tooltip = { - text = the_wake_1 - NOT = { - is_laamp_exiled_from_province_trigger = { - PROVINCE = scope:recipient.capital_province - LAAMP = scope:actor - } - } - } - } - - can_be_picked = { - scope:target ?= { - - # recipient is war leader - is_war_leader = scope:recipient - - # special exception for tributaries and suzerains to fight for one another - trigger_if = { - limit = { - OR = { - scope:actor = { - is_tributary_of_suzerain_or_above = scope:recipient - } - scope:recipient = { - is_tributary_of = scope:actor - } - } - } - # if this is directed at a tributary, make sure they're the primary defender - trigger_if = { - limit = { - scope:recipient = { is_tributary_of = scope:actor } - } - custom_tooltip = { - text = join_war_interaction_recipient_tributary_not_primary_defender - primary_defender = scope:recipient - } - } - trigger_else = { always = yes } - } - - #allow targets of a Grand Campaign to bypass the requirements - trigger_else_if = { - limit = { - var:grand_campaign_project ?= { - save_temporary_scope_as = great_project - any_in_list = { - variable = grand_campaign_titles - any_in_de_jure_hierarchy = { - exists = holder - holder.top_overlord = { - OR = { - this = scope:recipient - this = scope:actor - } - } - } - } - } - } - } - - #allow laamp_join_war_contract to bypass the requirements - trigger_else_if = { - limit = { - scope:actor = { - has_government = landless_adventurer_government - } - } - } - trigger_else_if = { - limit = { - scope:actor.faith ?= scope:recipient.faith - scope:target = { - OR = { - using_cb = pam_challenge_hof_cb - AND = { - using_cb = pam_antiking_cb - scope:actor.religious_head_or_challenger ?= scope:recipient - } - } - } - } - } - # if holy war, recipient is defender of same faith - # and not too far away - trigger_else_if = { - limit = { is_religious_war = yes } - trigger_if = { #Only if you're not allies - limit = { - NOT = { scope:actor = { is_allied_to = scope:recipient } } - NOR = { - scope:recipient = { target_is_liege_or_above = scope:actor } - casus_belli = { - any_target_title = { - holder ?= { - OR = { - this = scope:actor - is_vassal_or_below_of = scope:actor - } - } - } - } - } - # Special case for Iberians helping each other after FP2 Conciliation ending - AND = { - fp2_struggle_conciliation_recipient_actor_involved_trigger = no - NOT = { - fp2_struggle_conciliation_scope_uninvolved_trigger = { SCOPE = scope:target.primary_attacker } - } - } - } - custom_description = { - text = join_war_interaction_recipient_not_def_GHW - subject = scope:recipient - scope:recipient.faith.religion = scope:actor.faith.religion - any_war_defender = { this = scope:recipient } - } - } - casus_belli = { - any_target_title = { save_temporary_scope_as = war_target } - } - custom_description = { - text = join_war_interaction_recipient_too_distant - subject = scope:war_target - object = scope:war_target - scope:actor = { - realm_to_title_distance_squared = { - target = scope:war_target - value <= squared_distance_almost_massive # Approximately 1.5 HREs in distance away. Any further and does it really make sense for you to join what is essentially a regional power struggle? - } - } - } - } - # If not holy war, special exception for liege trying to put down his vassal's peasant revolt. - trigger_else_if = { - limit = { - is_religious_war = no - scope:actor = { target_is_vassal_or_below = scope:recipient } - primary_defender = scope:recipient - primary_attacker = { - is_leading_faction_type = peasant_faction - } - # Special case for Iberians helping each other after FP2 Conciliation ending - AND = { - fp2_struggle_conciliation_recipient_actor_involved_trigger = no - NOT = { - fp2_struggle_conciliation_scope_uninvolved_trigger = { SCOPE = scope:target.primary_attacker } - } - } - } - always = yes - } - #Confederation members can choose to join each others' offensive wars - trigger_else_if = { - limit = { - scope:actor = { NOT = { is_allied_to = scope:recipient } } - exists = scope:recipient.confederation - primary_attacker = scope:recipient - } - scope:actor = { - is_member_of_confederation = scope:recipient.confederation - } - } - # ...otherwise, recipient must be an ally... - trigger_else_if = { - limit = { - is_religious_war = no - scope:actor = { NOT = { target_is_liege_or_above = scope:recipient } } - # Special case for Iberians helping each other after FP2 Conciliation ending - AND = { - fp2_struggle_conciliation_recipient_actor_involved_trigger = no - NOT = { - fp2_struggle_conciliation_scope_uninvolved_trigger = { SCOPE = scope:target.primary_attacker } - } - } - } - custom_description = { - text = join_war_interaction_recipient_not_ally - subject = scope:recipient - scope:actor = { - is_allied_to = scope:recipient - } - } - trigger_if = { - limit = { - scope:actor = { - target_is_vassal_or_below = scope:recipient - NOT = { is_allied_to = scope:recipient } - } - } - # If they are an unallied vassal, inform the player that we could have aided them if this was a peasant revolt. - custom_description = { - text = join_war_interaction_recipient_not_fighting_peasant_faction - subject = scope:recipient - primary_defender = scope:recipient - primary_attacker = { - is_leading_faction_type = peasant_faction - } - } - } - } - - # ...or our liege. - trigger_else_if = { - limit = { - is_religious_war = no - scope:actor = { NOT = { is_allied_to = scope:recipient } } - } - # recipient is liege - custom_description = { - text = join_war_interaction_recipient_not_liege - subject = scope:recipient - scope:actor = { - target_is_liege_or_above = scope:recipient - } - } - } - # making the default behavior explicit if no other trigger_(else_)ifs are valid - trigger_else = { - always = yes - } - } - - joiner_not_already_in_another_war_with_any_target_war_participants_trigger = { - WARRIOR = scope:recipient - JOINER = scope:actor - } - - can_join_war_liege_vassal_check_trigger = { WARRIOR = scope:recipient JOINER = scope:actor } - } - - is_highlighted = { - scope:actor = { - any_character_task_contract = { - has_task_contract_type = laamp_join_war_contract - task_contract_employer = scope:recipient - } - } - } - - on_accept = { - scope:target ?= { - hidden_effect = { - set_called_to = scope:actor - } - if = { - limit = { is_attacker = scope:recipient } - add_attacker = scope:actor - if = { - limit = { - OR = { - scope:actor = { - any_home_court_hostage = { - warden ?= { is_defender_in_war = scope:target } - } - } - scope:target = { - any_war_defender = { - any_warden_hostage = { home_court ?= scope:actor } - } - } - } - } - custom_tooltip = hostage_execution_warning_tt - } - } - else = { - add_defender = scope:actor - if = { - limit = { - OR = { - scope:actor = { - any_home_court_hostage = { - warden ?= { is_attacker_in_war = scope:target } - } - } - scope:target = { - any_war_attacker = { - any_warden_hostage = { home_court ?= scope:actor } - } - } - } - } - custom_tooltip = hostage_execution_warning_tt - } - } - if = { - limit = { - is_religious_war = yes - scope:actor = { - any_active_accolade = { - accolade_parameter = acclaimed_knight_piety_from_battle - } - } - } - scope:actor = { - add_piety = medium_piety_gain - } - } - if = { - limit = { - is_religious_war = yes - scope:actor = { - any_active_accolade = { - accolade_parameter = acclaimed_knight_piety_from_battle_high - } - } - } - scope:actor = { - add_piety = major_piety_gain - } - } - } - scope:actor = { - stress_and_fulfillment_impact = { - craven = medium_stress_impact_gain - } - add_to_variable_list = { - name = joined_as_ally - target = scope:target - } - } - scope:recipient = { - show_as_tooltip = { - if = { # if war leader is AI, will directly increase friendship for contributing - limit = { - is_ai = yes - } - progress_towards_friend_effect = { - CHARACTER = scope:actor - OPINION = 0 - REASON = friend_alliance - } - } - else = { # otherwise will create potential friendship - hidden_effect = { #To nudge friendship - if = { - limit = { - NOR = { - has_relation_friend = scope:actor - has_relation_potential_friend = scope:actor - } - } - set_relation_potential_friend = scope:actor - } - } - } - } - } - - # If we're a clan this interaction affects unity - but only when we attemp to aid a house member against a non-house member - if = { - limit = { - exists = scope:target - scope:target = { - OR = { - AND = { - primary_attacker = scope:recipient - scope:recipient.house = scope:actor.house - primary_defender = { - house != scope:actor.house - } - } - AND = { - primary_defender = scope:recipient - scope:recipient.house = scope:actor.house - primary_attacker = { - house != scope:actor.house - } - } - } - } - } - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = medium_unity_gain - DESC = clan_unity_join_war.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - } - - on_decline = { - scope:actor = { - trigger_event = char_interaction.0236 - } - } - - auto_accept = yes - - ai_accept = { - base = 100 # everyone wants help - } -} - -# Referenced in code, do not rename or remove -join_vassal_war_interaction = { - category = interaction_category_diplomacy - interface = interfere_in_war - special_interaction = interfere_in_war_interaction - popup_on_receive = yes - desc = join_vassal_war_interaction_desc - icon = alliance - interface_priority = 29 - common_interaction = yes - - greeting = positive - notification_text = join_war_interaction_notification - - is_available = { - trigger_if = { - limit = { is_ai = yes } - is_at_war = no - } - } - - is_shown = { - scope:recipient = { - OR = { - AND = { - is_tributary_of = scope:actor - subject_contract_has_flag = tributary_contract_suzerain_guarantee_override - scope:actor = { - has_realm_law = top_liege_not_redirected_to_border_wars_law - } - } - AND = { - is_vassal_or_below_of = scope:actor - any_liege_or_above = { - has_realm_law = top_liege_not_redirected_to_border_wars_law - } - } - } - is_at_war = yes - NOR = { - this = scope:actor - is_at_war_with = scope:actor - } - any_character_war = { - primary_attacker = { - NOT = { - is_vassal_or_below_of = scope:actor - } - } - } - } - } - is_valid_showing_failures_only = { - scope:actor = { is_at_war = no } - } - - can_be_picked = { - scope:target ?= { - # we don't care about infighting - custom_tooltip = { - text = war_aid_liege_not_my_liege_tt - primary_attacker.top_overlord != scope:actor - } - # only defensive wars - primary_defender = scope:recipient - # only wars that would take titles in your hierarchy - trigger_if = { - limit = { - scope:recipient = { is_vassal_of = scope:actor } - } - custom_tooltip = { - text = war_aid_liege_relevant_titles_tt - casus_belli = { - any_target_title = { - OR = { - target_is_de_facto_liege_or_above = scope:actor.primary_title - is_de_facto_liege_or_above_target = scope:actor.primary_title - } - } - } - } - } - #Unless you're a guaranteed tributary - trigger_else_if = { - limit = { - scope:recipient = { is_tributary_of_suzerain_or_above = scope:actor } - } - custom_tooltip = { - text = suzerain_war_participation_guarantee_tt - scope:recipient = { subject_contract_has_flag = tributary_contract_suzerain_guarantee_override } - } - } - trigger_else = { - always = yes - } - custom_tooltip = { - text = war_aid_liege_cooldown_tt - war_days > border_war_grace_period_days - } - } - } - - on_accept = { - scope:target ?= { - hidden_effect = { - set_called_to = scope:actor - } - add_defender = scope:actor - if = { - limit = { - OR = { - scope:actor = { - any_home_court_hostage = { - warden ?= { is_attacker_in_war = scope:target } - } - } - scope:target = { - any_war_attacker = { - any_warden_hostage = { home_court ?= scope:actor } - } - } - } - } - custom_tooltip = hostage_execution_warning_tt - } - if = { - limit = { - is_religious_war = yes - scope:actor = { - any_active_accolade = { - accolade_parameter = acclaimed_knight_piety_from_battle - } - } - } - scope:actor = { - add_piety = medium_piety_gain - } - } - if = { - limit = { - is_religious_war = yes - scope:actor = { - any_active_accolade = { - accolade_parameter = acclaimed_knight_piety_from_battle_high - } - } - } - scope:actor = { - add_piety = major_piety_gain - } - } - scope:actor = { - stress_and_fulfillment_impact = { - craven = medium_stress_impact_gain - } - add_to_variable_list = { - name = joined_as_ally - target = scope:target - } - } - } - # If we're a clan this interaction affects unity - but only when we attemp to aid a house member against a non-house member - if = { - limit = { - exists = scope:target - scope:target = { - primary_defender = scope:recipient - scope:recipient.house = scope:actor.house - primary_attacker = { - house != scope:actor.house - } - } - } - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = medium_unity_gain - DESC = clan_unity_join_war.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - } - - on_decline = { - scope:actor = { - trigger_event = char_interaction.0236 - } - } - - auto_accept = yes - - ai_targets = { - ai_recipients = vassals - ai_recipients = tributaries - } - ai_frequency_by_tier = { - barony = 0 - county = 0 - duchy = 24 - kingdom = 6 - empire = 6 - hegemony = 6 - } - - ai_accept = { - base = 100 #no reason to refuse help - } - - # this value is also evaluated in the declare war interaction screen to decide whether the liege will join the vassal's war. - # as such, scope:target may not be defined, and anything war-related will be instead provided in the same way - # we evaluate the war cost in casus_belli.cost - ai_will_do = { - base = 100 - - modifier = { # Less likely if just one title - scope:actor = { - is_ai = yes - is_liege_or_above_of = scope:recipient - } - OR = { - scope:target ?= { - casus_belli = { - any_target_title = { - tier <= tier_duchy - count = 1 - } - } - } - any_in_list = { - list = target_titles - tier <= tier_duchy - count = 1 - } - - } - add = -100 - desc = war_aid_vassal_only_one_title - } - modifier = { # Less likely if not kingdoms or above - scope:actor = { - is_ai = yes - is_liege_or_above_of = scope:recipient - } - NOR = { - scope:target ?= { - casus_belli = { - any_target_title = { - tier >= tier_kingdom - } - } - } - any_in_list = { - list = target_titles - tier >= tier_kingdom - } - } - add = -100 - desc = war_aid_vassal_below_kingdom_title - } - modifier = { # Do not join if in debt - scope:actor = { - OR = { - gold <= -1 - AND = { - has_treasury = yes - treasury <= -1 - } - } - is_ai = yes - is_liege_or_above_of = scope:recipient - } - add = -100 - desc = war_aid_liege_is_bankrupt - } - modifier = { # Do not join if at war - scope:actor = { - is_at_war = yes - is_ai = yes - } - add = -100 - desc = war_aid_liege_is_at_war - } - modifier = { # Do not join if recipient is stronger then the enemy - scope:actor = { - is_ai = yes - is_liege_or_above_of = scope:recipient - } - OR = { - scope:attacker ?= { - current_military_strength < scope:recipient.current_military_strength - } - scope:target ?= { - primary_attacker.current_military_strength < scope:recipient.current_military_strength - } - } - add = -100 - desc = war_aid_vassal_can_fend_the_attacker_alone - } - modifier = { # Player decides on it's own - scope:actor = { - is_ai = no - } - add = -100 - desc = war_aid_liege_is_player - } - } -} - -religious_head_call_to_war_interaction = { - icon = icon_scheme_challenge_status - category = interaction_category_diplomacy - interface_priority = 60 - - desc = religious_head_call_to_war_interaction_desc - - interface = call_ally - special_interaction = call_ally_interaction - popup_on_receive = yes - pause_on_receive = yes - - greeting = positive - notification_text = CALL_ALLY_NOTIFICATION - - is_shown = { - scope:puppet_or_actor.religious_head_or_challenger ?= scope:puppet_or_actor - scope:recipient = { - religious_head_or_challenger ?= scope:puppet_or_actor - this != scope:puppet_or_actor - highest_held_title_tier >= tier_county - } - scope:puppet_or_actor ?= { - any_character_war = { - is_war_leader = scope:puppet_or_actor - trigger_if = { - limit = { primary_attacker = scope:puppet_or_actor } - scope:puppet_or_actor.faith.religious_head = { - target_is_same_character_or_above = prev.primary_defender - } - } - trigger_else = { - primary_attacker = { - OR = { - pam_is_antipope_trigger = yes - pam_is_antipope_sponsor_trigger = yes - } - faith.religious_head = scope:puppet_or_actor - } - } - } - liege != scope:recipient - } - - scope:puppet_or_actor = { #If you can call them as a House Member then do that - NOR = { - is_character_interaction_valid = { - recipient = scope:recipient - interaction = call_house_member_to_war_interaction - } - is_character_interaction_valid = { - recipient = scope:recipient - interaction = call_ally_interaction - } - } - } - } - - has_valid_target = { - exists = scope:target - } - - has_valid_target_showing_failures_only = { - scope:target = { - is_war_leader = scope:puppet_or_actor - } - joiner_not_already_in_another_war_with_any_target_war_participants_trigger = { - WARRIOR = scope:puppet_or_actor - JOINER = scope:recipient - } - } - - is_valid_showing_failures_only = { - scope:puppet_or_actor.dynasty = { dynasty_prestige >= medium_dynasty_prestige_value } - scope:recipient = { - NOT = { government_has_flag = government_is_mercenary } - NOT = { government_has_flag = government_is_holy_order } - } - custom_description = { - text = "is_already_in_all_wars" - scope:puppet_or_actor = { - any_character_war = { - NOR = { - is_participant = scope:recipient - was_called = scope:recipient - } - OR = { - primary_attacker = scope:puppet_or_actor - primary_defender = scope:puppet_or_actor - } - } - } - } - } - - can_be_picked = { - can_join_war_liege_vassal_check_trigger = { WARRIOR = scope:puppet_or_actor JOINER = scope:recipient } - } - - auto_accept = { - scope:recipient = { - is_clergy = yes - } - } - - on_auto_accept = { - scope:recipient = { - trigger_event = call_ally.0001 - } - scope:target = { - if = { - limit = { - scope:recipient = { - any_active_accolade = { - accolade_parameter = acclaimed_knight_piety_from_battle - } - } - } - scope:recipient = { - add_piety = miniscule_piety_gain - } - } - if = { - limit = { - scope:recipient = { - any_active_accolade = { - accolade_parameter = acclaimed_knight_piety_from_battle_high - } - } - } - scope:recipient = { - add_piety = minor_piety_gain - } - } - } - } - - on_accept = { - call_ally_interaction_effect = yes - - save_scope_value_as = { - name = call_ally_interaction - value = yes - } - - scope:actor = { - hidden_effect = { #To nudge friendship - if = { - limit = { - NOR = { - has_relation_friend = scope:recipient - has_relation_potential_friend = scope:recipient - } - } - set_relation_potential_friend = scope:recipient - } - } - trigger_event = call_ally.0100 - } - scope:target = { - if = { - limit = { - scope:recipient = { - any_active_accolade = { - accolade_parameter = acclaimed_knight_piety_from_battle - } - } - } - scope:recipient = { - add_piety = minor_piety_gain - } - } - if = { - limit = { - scope:recipient = { - any_active_accolade = { - accolade_parameter = acclaimed_knight_piety_from_battle_high - } - } - } - scope:recipient = { - add_piety = medium_piety_gain - } - } - } - } - - on_decline = { - #The war could theoretically end on the day the decline is sent - if = { - limit = { - exists = scope:target - } - scope:target = { - if = { - limit = { - is_attacker = scope:actor - } - scope:actor = { - add_opinion = { - modifier = rejected_call_to_offensive_war - target = scope:recipient - } - } - scope:recipient = { - #Why should Mandalas care about bickering tributaries in an offensive war - if = { - limit = { - NOT = { government_has_flag = government_is_mandala } - } - add_prestige_experience = major_prestige_loss - } - } - } - else = { - scope:actor = { - add_opinion = { - modifier = rejected_call_to_defensive_war - target = scope:recipient - } - } - scope:recipient = { - if = { - limit = { government_has_flag = government_is_mandala } - add_prestige_experience = major_prestige_loss - add_piety_level = -1 - } - else = { add_prestige_experience = massive_prestige_loss } - } - } - if = { - limit = { - scope:actor = { - has_relation_blood_brother = scope:recipient - } - } - scope:recipient = { - add_piety_experience = massive_piety_loss - add_character_modifier = { - modifier = broke_blood_brotherhood_modifier - desc = broke_blood_brotherhood_modifier_acceptance_tt - years = 25 - } - remove_relation_blood_brother = scope:actor - } - scope:actor = { - set_relation_rival = { - target = scope:recipient - reason = rival_blood_brother_refused_call_reason - } - } - } - # Nomad Vassals and Tributaries stop being Obedient if they have the Liege War Support / Suzerain Defensive Guarantee contract right - if = { - limit = { - scope:recipient = scope:actor.obedience_target - scope:actor = { - OR = { - subject_contract_has_flag = vassal_contract_liege_forced_war_override - subject_contract_has_flag = tributary_contract_suzerain_guarantee_override - } - } - } - scope:actor = { - set_variable = { - name = not_obedient_declined_call - value = scope:recipient - years = 5 - } - } - } - if = { - limit = { - scope:recipient = scope:actor.suzerain - is_defender = scope:actor - scope:actor = { - subject_contract_has_flag = tributary_contract_suzerain_guarantee_override - } - } - scope:actor = { - end_tributary = yes - } - } - hidden_effect = { - if = { - limit = { - NOT = { was_called = scope:recipient } - } - set_called_to = scope:recipient - } - } - } - scope:actor = { - trigger_event = call_ally.0101 - } - - # If we're a clan this interaction affects unity - refuse_call_to_arms_add_clan_unity_effect = yes - - scope:recipient = { - if = { - limit = { - exists = house - is_house_head = yes - exists = scope:actor.house - } - house = { - change_house_relation_effect = { - HOUSE = scope:actor.house - VALUE = house_relation_damage_medium_value - REASON = ally_call_ignored - CHAR = scope:recipient - TARGET_CHAR = scope:actor - TITLE = scope:dummy_gender - } - } - } - } - } - } - - ai_accept = { - base = 50 - - modifier = { # Conquerors do not help anyone but themselves - add = -1000 - desc = NO_FRIVOLOUS_ACTIVITIES_REASON - scope:recipient = { has_variable = conqueror } - } - - modifier = { # Refuse call against Heir - add = -1000 - exists = scope:recipient.player_heir - trigger_if = { - limit = { scope:target.casus_belli.primary_defender = scope:actor } - scope:target.casus_belli.primary_attacker = scope:recipient.player_heir - } - trigger_else = { - scope:target.casus_belli.primary_defender = scope:recipient.player_heir - } - desc = WONT_FIGHT_HEIR_REASON - } - - modifier = { # Refuse call against Spouse - add = -1000 - scope:recipient = { - trigger_if = { - limit = { scope:target.casus_belli.primary_defender = scope:actor } - any_spouse = { - this = scope:target.casus_belli.primary_attacker - } - } - trigger_else = { - any_spouse = { - this = scope:target.casus_belli.primary_defender - } - } - - } - desc = WONT_FIGHT_SPOUSE_REASON - } - - modifier = { # Refuse call against Suzerain if Obedient - add = -1000 - trigger_if = { - limit = { - exists = scope:recipient.suzerain - trigger_if = { - limit = { scope:target.casus_belli.primary_defender = scope:actor } - scope:recipient.suzerain = scope:target.casus_belli.primary_attacker - } - trigger_else = { - scope:recipient.suzerain = scope:target.casus_belli.primary_defender - } - scope:recipient = { - exists = obedience_target - is_obedient = yes - } - } - } - trigger_else = { always = no } - desc = WONT_FIGHT_OBEDIENT_REASON - } - - modifier = { # AI's that need to save gold less likely help their lesser AI allies, unless it's a player war - add = -100 - desc = NO_FRIVOLOUS_ACTIVITIES_REASON - scope:actor = { - is_ai = yes - primary_title.tier < scope:recipient.primary_title.tier - } - scope:target.casus_belli = { - primary_attacker = { is_ai = yes } - primary_defender = { is_ai = yes } - } - scope:recipient = { ai_should_focus_on_building_in_their_capital = yes } - } - - opinion_modifier = { # Opinion Factor - who = scope:recipient - opinion_target = scope:actor - multiplier = 1.0 - desc = AI_OPINION_REASON - } - - # Honor factor - ai_value_modifier = { - ai_honor = 0.5 - ai_zeal = 1 - min = 0 - } - - modifier = { # Tends to join defensive wars - add = 50 - scope:target.casus_belli.primary_defender = scope:actor - desc = DEFENSIVE_WAR_REASON - } - - modifier = { # Same language - add = 5 - desc = speaks_same_language_interaction_reason - trigger = { - scope:actor = { - knows_language_of_culture = scope:recipient.culture - } - } - } - - modifier = { # Shared Court Language (non-spoken) - add = 10 - desc = foreign_realm_court_language_non_spoken_interaction_reason - trigger = { - scope:actor = { - has_royal_court = yes - has_dlc_feature = royal_court - NOT = { knows_court_language_of = this } - } - scope:actor.top_liege != scope:recipient.top_liege - OR = { - AND = { - scope:recipient = { - has_royal_court = yes - } - scope:actor = { # You share Court Language - has_same_court_language = scope:recipient - } - } - - scope:recipient = { # The recipient doesn't have a royal court, but their liege does - liege != this - has_royal_court = no - any_liege_or_above = { - has_royal_court = yes - has_same_court_language = scope:actor - save_temporary_scope_as = liege_temp - NOT = { - prev = { - any_liege_or_above = { - has_royal_court = yes - is_vassal_or_below_of = scope:liege_temp - } - } - } - } - } - } - } - } - - modifier = { # Shared Court Language (spoken) - add = 30 - desc = foreign_realm_court_language_spoken_interaction_reason - trigger = { - scope:actor = { - has_royal_court = yes - has_dlc_feature = royal_court - knows_court_language_of = this - } - scope:actor.top_liege != scope:recipient.top_liege - OR = { - AND = { - scope:recipient = { - has_royal_court = yes - } - scope:actor = { # You share Court Language - has_same_court_language = scope:recipient - } - } - - scope:recipient = { # The recipient doesn't have a royal court, but their liege does - liege != this - has_royal_court = no - any_liege_or_above = { - has_royal_court = yes - has_same_court_language = scope:actor - save_temporary_scope_as = liege_temp - NOT = { - prev = { - any_liege_or_above = { - has_royal_court = yes - is_vassal_or_below_of = scope:liege_temp - } - } - } - } - } - } - } - } - - modifier = { # Serious diarchs wish to support their liege - add = 50 - desc = ENTRENCHED_REGENT_WILL_SUPPORT_LIEGE - trigger_if = { - limit = { scope:recipient ?= scope:actor.diarch } - scope:actor = { has_diarchy_parameter = diarchy_type_is_entrenched_regency } - } - trigger_else = { always = no } - } - - modifier = { # Reluctant to attack another ally - add = -50 - scope:target.casus_belli.primary_attacker = scope:actor - scope:recipient = { - is_allied_to = scope:target.casus_belli.primary_defender - } - desc = ATTACK_ON_ALLY_REASON - } - - modifier = { # Reluctant to defend against another ally - add = -25 - scope:target.casus_belli.primary_defender = scope:actor - scope:recipient = { - is_allied_to = scope:target.casus_belli.primary_attacker - } - desc = WAR_WITH_ALLY_REASON - } - - modifier = { # Reluctant to join against Friends - add = -50 - trigger_if = { - limit = { - scope:target.casus_belli.primary_defender = scope:actor - } - has_relation_friend = scope:target.casus_belli.primary_attacker - } - trigger_else = { - has_relation_friend = scope:target.casus_belli.primary_defender - } - desc = WONT_FIGHT_FRIEND_REASON - } - - modifier = { # Reluctant to join against Best Friends - add = -100 - trigger_if = { - limit = { - scope:target.casus_belli.primary_defender = scope:actor - } - has_relation_best_friend = scope:target.casus_belli.primary_attacker - } - trigger_else = { - has_relation_best_friend = scope:target.casus_belli.primary_defender - } - desc = WONT_FIGHT_BEST_FRIEND_REASON - } - modifier = { # Reluctant to join against Lovers - add = -100 - trigger_if = { - limit = { - scope:target.casus_belli.primary_defender = scope:actor - } - has_relation_lover = scope:target.casus_belli.primary_attacker - } - trigger_else = { - has_relation_lover = scope:target.casus_belli.primary_defender - } - desc = WONT_FIGHT_LOVER_REASON - } - modifier = { # Reluctant to join against Soulmate - add = -200 - trigger_if = { - limit = { - scope:target.casus_belli.primary_defender = scope:actor - } - has_relation_soulmate = scope:target.casus_belli.primary_attacker - } - trigger_else = { - has_relation_soulmate = scope:target.casus_belli.primary_defender - } - desc = WONT_FIGHT_SOULMATE_REASON - } - modifier = { # Reluctant to join tributaries - add = -200 - scope:actor = { - is_tributary_of = scope:recipient - NOT = { subject_contract_has_flag = tributary_contract_suzerain_guarantee_override } - } - scope:recipient = { - NOR = { - has_relation_lover = scope:actor - has_relation_friend = scope:actor - is_allied_to = scope:actor - } - } - desc = WONT_FIGHT_MEANINGLESS_REASON - } - modifier = { # Refuse call for hostages' safety - any_home_court_hostage = { - warden = { - OR = { - is_at_war_with = scope:actor - any_ally = { is_at_war_with = scope:actor } - } - } - } - add = { - value = 0 - every_home_court_hostage = { - limit = { - warden = { - OR = { - is_at_war_with = scope:actor - any_ally = { is_at_war_with = scope:actor } - } - } - } - subtract = call_to_arms_hostage_value - } - multiply = 0.25 - } - desc = HOSTAGE_ENEMY_CALL_TO_ARMS_REASON - } - - modifier = { - add = 200 - scope:actor = { - is_tributary_of = scope:recipient - subject_contract_has_flag = tributary_contract_suzerain_guarantee_override - } - desc = MANDALA_GUARANTEE_REASON - } - - fp3_struggle_resist_allied_wars_modifier = yes - } - - # Score above 0 means the AI will call this ally. Note that DESIRED_WAR_SIDE_STRENGTH still applies and can prevent calling the ally - ai_will_do = { - base = 100 - - modifier = { # If the player is at war, do not bother them with offensive calls - scope:target.casus_belli.primary_attacker = scope:actor - scope:recipient = { - is_ai = no - any_character_war = { - primary_defender = scope:recipient - } - } - factor = 0 - } - - modifier = { # Do not call the player if they are in debt - scope:recipient = { - is_ai = no - gold <= -1 - } - factor = 0 - } - - modifier = { # Don't call players in against their heirs (they wouldn't accept the reverse situation... don't be a hypocrite) - exists = scope:recipient.player_heir - scope:recipient = { - is_ai = no - } - trigger_if = { - limit = { scope:target.casus_belli.primary_defender = scope:actor } - scope:target.casus_belli.primary_attacker = scope:recipient.player_heir - } - trigger_else = { - scope:target.casus_belli.primary_defender = scope:recipient.player_heir - } - factor = 0 - } - - modifier = { # If the recipient is allied to both the attacker and the defender, the attacker shouldn't call - scope:target.casus_belli.primary_attacker = scope:actor - scope:target.casus_belli.primary_defender = { - is_allied_to = scope:recipient - } - factor = 0 - } - - #You're a Mandala Suzerain; you don't get off the hook that easily - modifier = { - scope:actor = { subject_contract_has_flag = tributary_contract_suzerain_guarantee_override } - scope:recipient = scope:actor.suzerain - add = 500 - } - } -} diff --git a/common/character_interactions/00_faction_interactions.txt b/common/character_interactions/00_faction_interactions.txt deleted file mode 100644 index 12aff73d3..000000000 --- a/common/character_interactions/00_faction_interactions.txt +++ /dev/null @@ -1,171 +0,0 @@ -#Interactions relating to factions - -force_join_faction_interaction = { - category = interaction_category_vassal - special_interaction = force_join_faction - desc = force_join_faction_interaction_desc - icon = scroll_scales - - force_notification = yes - greeting = positive - notification_text = FORCE_JOIN_FACTION_NOTIFICATION - - is_available = { - is_a_faction_member = yes - trigger_if = { - limit = { is_ai = yes } - top_liege != this - - # Only force others to join a faction if you joined by your own free will - is_forced_into_faction = no - } - } - - is_shown = { - scope:actor = { - liege ?= scope:recipient.liege - NOR = { - joined_faction ?= scope:recipient.joined_faction - scope:recipient = scope:actor.liege - } - } - } - - is_valid_showing_failures_only = { - scope:actor = { - trigger_if = { - limit = { government_has_mechanic = administrative } - custom_tooltip = { - text = force_join_faction_admin_requirement_desc - OR = { - has_strong_usable_hook = scope:recipient - AND = { - influence >= { value = scope:actor.monumental_influence_value multiply = 2 } - scope:recipient ?= { - NOT = { opinion = { target = scope:actor value <= -50 } } - NOT = { opinion = { target = scope:recipient.liege value >= 50 } } - } - } - } - } - } - trigger_else = { - has_strong_usable_hook = scope:recipient # Make sure to update the NFaction::POTENTIAL_FORCE_JOIN_HOOK_TYPE define if you change the type of hook used here - } - NOT = { is_at_war_with = scope:recipient } - } - scope:recipient = { - trigger_if = { - limit = { is_a_faction_member = yes } - joined_faction.faction_leader ?= { is_ai = yes } - } - is_forced_into_faction = no - can_join_faction = scope:actor.joined_faction - } - custom_description = { - text = barons_joining_independence_factions - NAND = { - scope:actor.joined_faction = { faction_is_type = independence_faction } - scope:recipient.highest_held_title_tier = tier_barony - } - } - } - - on_accept = { - scope:actor = { - send_interface_message = { - type = event_faction_neutral - title = force_join_faction_interaction_notification - right_icon = scope:recipient - if = { - limit = { scope:hook = yes } - use_hook = scope:recipient - } - else_if = { - limit = { scope:influence = yes } - change_influence = { - value = monumental_influence_value - multiply = -2 - } - } - scope:recipient = { - join_faction_forced = { - faction = scope:actor.joined_faction - forced_by = scope:actor - years = 10 - } - } - } - } - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = medium_unity_loss - DESC = clan_unity_forced_faction_joinage.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - auto_accept = yes - - #Use hook - send_option = { - is_valid = { - exists = scope:recipient - scope:actor ?= { has_strong_usable_hook = scope:recipient } - } - flag = hook - localization = GENERIC_SPEND_A_HOOK - } - - #Spend influence - send_option = { - is_shown = { - scope:actor = { government_has_flag = government_has_influence } - scope:actor.top_liege ?= { government_has_flag = government_has_influence } - } - is_valid = { # Convincing someone with influence is not available if they hate you or love the liege - scope:actor ?= { influence >= { value = scope:actor.monumental_influence_value multiply = 2 } } - scope:recipient ?= { - NOT = { opinion = { target = scope:actor value <= -50 } } - NOT = { opinion = { target = scope:recipient.liege value >= 50 } } - } - } - flag = influence - localization = SPEND_INFLUENCE - } - - send_options_exclusive = yes - - # AI - ai_targets = { - ai_recipients = peer_vassals - } - ai_frequency_by_tier = { - barony = 0 - county = 24 - duchy = 12 - kingdom = 12 - empire = 12 - hegemony = 0 - } - - ai_will_do = { - base = 100 - - # Don't steal players' factions' members - modifier = { - factor = 0 - scope:recipient = { - is_a_faction_member = yes - joined_faction = { - faction_leader = { - is_ai = no - } - } - } - } - } -} diff --git a/common/character_interactions/00_house_head_interactions.txt b/common/character_interactions/00_house_head_interactions.txt deleted file mode 100644 index 0be890efa..000000000 --- a/common/character_interactions/00_house_head_interactions.txt +++ /dev/null @@ -1,1216 +0,0 @@ -#Interactions relating to the head of the house - -call_house_member_to_war_interaction = { - category = interaction_category_diplomacy - icon = alliance - - - interface_priority = 60 - - desc = call_house_member_to_war_interaction_desc - - interface = call_ally - special_interaction = call_ally_interaction - popup_on_receive = yes - pause_on_receive = yes - - notification_text = CALL_HOUSE_MEMBER_NOTIFICATION - - is_available = { - OR = { - is_house_head = yes - AND = { - exists = dynasty - # Standard check - dynasty ?= { has_dynasty_perk = fp2_coterie_legacy_3 } - # DLC checking - has_fp2_dlc_trigger = yes - } - } - } - - is_shown = { - scope:recipient != scope:actor - - scope:actor = { - religion ?= scope:recipient.religion - house ?= scope:recipient.house - any_character_war = { - is_war_leader = scope:actor - } - } - - scope:recipient = { - is_playable_character = yes - } - - scope:recipient = { - NOT = { - target_is_liege_or_above = scope:actor - } - } - } - - has_valid_target = { - exists = scope:target - } - - has_valid_target_showing_failures_only = { - scope:target = { - is_war_leader = scope:actor - } - joiner_not_already_in_another_war_with_any_target_war_participants_trigger = { - WARRIOR = scope:actor - JOINER = scope:recipient - } - } - - is_valid_showing_failures_only = { - custom_description = { - text = "is_already_in_all_wars" - scope:actor = { - any_character_war = { - NOR = { - is_participant = scope:recipient - was_called = scope:recipient - } - OR = { - primary_attacker = scope:actor - primary_defender = scope:actor - } - } - } - } - } - - can_be_picked = { - can_join_war_liege_vassal_check_trigger = { WARRIOR = scope:actor JOINER = scope:recipient } - } - - on_auto_accept = { - scope:recipient = { - trigger_event = call_ally.0001 - } - } - - on_accept = { - call_house_member_to_war_interaction_effect = yes - - save_scope_value_as = { - name = call_house_member_to_war_interaction - value = yes - } - - if = { - limit = { - exists = scope:target - } - - scope:actor = { - trigger_event = call_ally.0100 - } - } - - scope:actor = { - if = { - limit = { NOT = { is_house_head = yes } } - add_prestige = medium_prestige_loss - } - } - - # If the Dynasty has the Unity Legacy perk, the recipient is rewarded with some Prestige - if = { - limit = { scope:actor.dynasty = { has_dynasty_perk = fp2_coterie_legacy_3 } } - scope:recipient = { add_prestige = medium_prestige_gain } - } - } - - on_decline = { - #The war could theoretically end on the day the decline is sent - if = { - limit = { - exists = scope:target - } - - scope:target = { - if = { - limit = { - is_attacker = scope:actor - } - scope:actor = { - add_opinion = { - modifier = rejected_call_to_offensive_war - target = scope:recipient - } - } - } - else = { - scope:actor = { - add_opinion = { - modifier = rejected_call_to_defensive_war - target = scope:recipient - } - } - } - scope:actor = { - trigger_event = call_ally.0101 - } - } - - # If we're a clan this interaction affects unity - refuse_call_to_arms_add_clan_unity_effect = yes - } - } - - ai_accept = { - base = 20 - - modifier = { # Refuse call to conflicts of little benefit - add = -1000 - desc = WONT_FIGHT_MEANINGLESS_REASON - trigger_if = { - limit = { exists = scope:target } - scope:target = { using_cb = fp2_border_raid } - scope:recipient = { # Unless they like going on raids - NOR = { - has_trait = viking - has_trait = reaver - } - } - } - trigger_else = { always = no } - } - - modifier = { # Refuse call against Heir - add = -1000 - exists = scope:recipient.player_heir - trigger_if = { - limit = { scope:target.casus_belli.primary_defender = scope:actor } - scope:target.casus_belli.primary_attacker = scope:recipient.player_heir - } - trigger_else = { - scope:target.casus_belli.primary_defender = scope:recipient.player_heir - } - desc = WONT_FIGHT_HEIR_REASON - } - - modifier = { # Refuse call against Spouse - add = -1000 - scope:recipient = { - trigger_if = { - limit = { scope:target.casus_belli.primary_defender = scope:actor } - any_spouse = { - this = scope:target.casus_belli.primary_attacker - } - } - trigger_else = { - any_spouse = { - this = scope:target.casus_belli.primary_defender - } - } - - } - desc = WONT_FIGHT_SPOUSE_REASON - } - - opinion_modifier = { # Opinion Factor - who = scope:recipient - opinion_target = scope:actor - multiplier = 1.0 - desc = AI_OPINION_REASON - } - - # Honor factor - ai_value_modifier = { - ai_honor = 1 - min = 0 - } - - modifier = { # Tends to join defensive wars - add = 50 - scope:target.casus_belli.primary_defender = scope:actor - desc = DEFENSIVE_WAR_REASON - } - - compare_modifier = { # Likes fighting infidels - trigger = { - scope:recipient.faith = scope:actor.faith - OR = { - AND = { - scope:target.casus_belli.primary_attacker = { - this = scope:actor - faith = { - faith_hostility_level = { - target = scope:target.casus_belli.primary_defender.faith - value >= religious_cb_enabled_hostility_level - } - } - } - } - AND = { - scope:target.casus_belli.primary_defender = { - this = scope:actor - faith = { - faith_hostility_level = { - target = scope:target.casus_belli.primary_attacker.faith - value >= religious_cb_enabled_hostility_level - } - } - } - } - } - } - target = scope:recipient - value = ai_zeal - desc = "ZEAL_AGAINST_INFIDELS" - min = 0 - multiplier = 0.5 - } - - modifier = { # Reluctant to attack another ally - add = -50 - scope:target.casus_belli.primary_attacker = scope:actor - scope:recipient = { - is_allied_to = scope:target.casus_belli.primary_defender - } - desc = ATTACK_ON_ALLY_REASON - } - - modifier = { # Reluctant to defend against another ally - add = -25 - scope:target.casus_belli.primary_defender = scope:actor - scope:recipient = { - is_allied_to = scope:target.casus_belli.primary_attacker - } - desc = WAR_WITH_ALLY_REASON - } - - modifier = { # Reluctant to join wars against religious brethren. - add = -50 - scope:recipient.faith != scope:actor.faith - scope:target.casus_belli.primary_attacker = scope:actor - scope:target.casus_belli.primary_defender.faith = scope:recipient.faith - scope:target.casus_belli.war = { - OR = { - using_cb = minor_religious_war - using_cb = religious_war - using_cb = major_religious_war - using_cb = undirected_great_holy_war - using_cb = directed_great_holy_war - } - } - desc = WONT_ATTACK_RELIGIOUS_BRETHREN_REASON - } - - modifier = { # Happy to gain Prestige thanks to the Unity perk - add = 50 - dynasty = { has_dynasty_perk = fp2_coterie_legacy_3 } - desc = "UNITY_PERK_BONUS" - } - - fp3_struggle_resist_allied_wars_modifier = yes - } - - # Score above 0 means the AI will call this ally. Note that DESIRED_WAR_SIDE_STRENGTH still applies and can prevent calling the ally - ai_will_do = { - base = 100 - - modifier = { # If the player is at war, do not bother them with offensive calls - scope:target.casus_belli.primary_attacker = scope:actor - scope:recipient = { - is_ai = no - any_character_war = { - primary_defender = scope:recipient - } - } - factor = 0 - } - - modifier = { # Do not call the player if they are in debt - scope:recipient = { - is_ai = no - gold <= -1 - } - factor = 0 - } - - modifier = { # Don't call players in against their heirs (they wouldn't accept the reverse situation... don't be a hypocrite) - exists = scope:recipient.player_heir - scope:recipient = { - is_ai = no - } - trigger_if = { - limit = { scope:target.casus_belli.primary_defender = scope:actor } - scope:target.casus_belli.primary_attacker = scope:recipient.player_heir - } - trigger_else = { - scope:target.casus_belli.primary_defender = scope:recipient.player_heir - } - factor = 0 - } - - modifier = { # Same with spouses - scope:recipient = { - is_ai = no - } - trigger_if = { - limit = { scope:target.casus_belli.primary_defender = scope:actor } - any_spouse = { - this = scope:target.casus_belli.primary_attacker - } - } - trigger_else = { - any_spouse = { - this = scope:target.casus_belli.primary_defender - } - } - factor = 0 - } - - modifier = { # Don't call brand-new allies into old wars, at least until some time has elapsed. - has_variable = delay_calling_recent_ally - var:delay_calling_recent_ally = scope:recipient - scope:target = { - war_days >= 30 - } - factor = 0 - - } - - modifier = { # If the recipient is allied to both the attacker and the defender, the attacker shouldn't call - scope:target.casus_belli.primary_attacker = scope:actor - scope:target.casus_belli.primary_defender = { - is_allied_to = scope:recipient - } - factor = 0 - } - - #You're a Mandala Suzerain; you don't get off the hook that easily - modifier = { - scope:actor = { subject_contract_has_flag = tributary_contract_suzerain_guarantee_override } - scope:recipient = scope:actor.suzerain - add = 500 - } - } - - auto_accept = { - custom_description = { - text = "spending_hook" - subject = scope:actor - object = scope:recipient - scope:hook = yes - } - } - - send_option = { - is_valid = { - scope:actor = { - has_usable_hook = scope:recipient - } - } - flag = hook - localization = SCHEME_HOOK - } - should_use_extra_icon = { - scope:actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - send_options_exclusive = no -} - - -#Head legitimizes child or actor requests from head to legitimize -legitimize_bastard_interaction = { - category = interaction_category_diplomacy - special_interaction = legitimize_bastard - icon = legitimized_bastard - - greeting = positive - notification_text = ASK_TO_legitimize_bastard_interaction - - desc = { - first_valid = { - triggered_desc = { - trigger = { scope:actor.house.house_head = scope:actor } - desc = legitimize_bastard_interaction_desc_house_head - } - desc = legitimize_bastard_interaction_desc_not_house_head - } - } - - is_available = { - is_lowborn = no - is_concubine = no - } - - is_shown = { - scope:actor.rite ?= { - rite_has_parameter = bastards_legitimize - } - scope:actor.house.house_head.rite ?= { - rite_has_parameter = bastards_legitimize - } - scope:secondary_recipient ?= { - rite ?= { - rite_has_parameter = bastards_legitimize - } - this != scope:actor - has_trait = bastard - OR = { - father ?= scope:actor - mother ?= scope:actor - scope:actor.house.house_head ?= scope:actor - } - OR = { - house ?= scope:actor.house - AND = { - OR = { - father.house ?= scope:actor.house - mother.house ?= scope:actor.house - } - has_dynasty = no - } - AND = { - scope:actor.rite ?= { - rite_has_parameter = tenet_adoptionism_legitimize_own_children - } - OR = { - father ?= scope:actor - mother ?= scope:actor - } - } - } - } - } - - is_valid_showing_failures_only = { - } - - cost = { - prestige = { - value = bastard_legitimization_prestige_cost - } - } - - ai_accept = { - base = -50 - - modifier = { - trigger = { - scope:actor != scope:actor.house.house_head - } - add = { - value = scope:actor.prestige_level - multiply = 20 - } - desc = PRESTIGOUS_IN_OUR_HOUSE - } - - modifier = { - trigger = { - always = scope:hook - } - add = 100 - desc = SCHEME_WEAK_HOOK_USED - } - - opinion_modifier = { - trigger = { - scope:actor != scope:actor.house.house_head - } - who = scope:recipient - opinion_target = scope:actor - multiplier = 1 - } - - opinion_modifier = { - trigger = { - scope:actor != scope:actor.house.house_head - } - who = scope:recipient - opinion_target = scope:secondary_recipient - multiplier = 0.25 - } - - modifier = { - add = intimidated_reason_value - scope:recipient = { - target_is_liege_or_above = scope:actor - has_dread_level_towards = { - target = scope:actor - level = 1 - } - } - desc = INTIMIDATED_REASON - } - modifier = { - add = cowed_reason_value - scope:recipient = { - target_is_liege_or_above = scope:actor - has_dread_level_towards = { - target = scope:actor - level = 2 - } - } - desc = COWED_REASON - } - - modifier = { - add = intimidated_external_reason_value - scope:recipient = { - NOT = { target_is_liege_or_above = scope:actor } - has_dread_level_towards = { - target = scope:actor - level = 1 - } - } - desc = INTIMIDATED_REASON - } - modifier = { - add = cowed_external_reason_value - scope:recipient = { - NOT = { target_is_liege_or_above = scope:actor } - has_dread_level_towards = { - target = scope:actor - level = 2 - } - } - desc = COWED_REASON - } - - # Unity modifiers - evaluate_action_decreasing_house_unity = { - VALUE = 100 - } - } - - auto_accept = { - OR = { - scope:actor = scope:actor.house.house_head - AND = { - always = scope:hook - scope:actor = { has_strong_hook = scope:recipient } - } - } - } - - on_accept = { - scope:actor = { - stress_and_fulfillment_impact = { - arrogant = minor_stress_impact_gain - } - - legitimize_bastard_interaction_opinions_effect = { - BASTARD = scope:secondary_recipient - HOUSE_HEAD = scope:actor.house.house_head - LEGITIMIZER = scope:actor - } - - if = { - limit = { always = scope:hook } - scope:actor = { - use_hook = scope:recipient - } - } - } - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = miniscule_unity_loss - DESC = clan_unity_bastardry.desc - REVERSE_NON_HOUSE_TARGET = no - } - - hidden_effect = { - scope:actor = { - if = { - limit = { - has_character_modifier = oath_of_children - } - hidden_effect = { - remove_character_modifier = oath_of_children - add_character_modifier = oath_of_children - } - } - } - } - } - - on_decline = { - scope:actor = { - send_interface_toast = { - type = event_toast_effect_bad - title = legitimize_bastard_interaction_decline_notification - - left_icon = scope:actor.house.house_head - right_icon = scope:secondary_recipient - } - } - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = miniscule_unity_gain - DESC = clan_unity_bastardry_refusal.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - send_option = { - is_shown = { - scope:actor != scope:recipient - } - is_valid = { - scope:actor = { - has_usable_hook = scope:recipient - } - } - flag = hook - localization = SCHEME_HOOK - } - should_use_extra_icon = { - scope:actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - send_options_exclusive = no -} - -accuse_of_decandence_interaction = { - icon = antagonistic - category = interaction_category_hostile - interface_priority = 60 - common_interaction = yes - - cooldown = { years = 3 } - - desc = accuse_of_decandence_interaction_desc - - is_available = { - government_has_flag = government_is_clan - house.house_head ?= this - trigger_if = { - limit = { is_ai = yes } - is_adult = yes - NOT = { - has_trait = forgiving - } - is_at_war = no - } - } - - is_shown = { - scope:recipient != scope:actor - scope:recipient.house ?= scope:actor.house - scope:recipient = { - NOT = { - has_trait = decadent - } - } - } - - is_valid_showing_failures_only = { - scope:recipient = { is_adult = yes } - scope:recipient = { NOT = { has_strong_hook = scope:actor } } - custom_tooltip = { - text = cannot_take_overt_hostile_actions_against_diarch.tt - NOT = { scope:recipient ?= scope:actor.diarch } - } - } - - on_auto_accept = { - scope:recipient = { - trigger_event = char_interaction.0041 - } - } - - on_accept = { - scope:actor = { - # Only get stressed/SP penalties if you don't have the parameter - if = { - limit = { - NOT = { sp_hostile_schemes_except_murder_no_stress_or_fulfillment_trigger = yes } - } - stress_and_fulfillment_impact = { - forgiving = minor_stress_impact_gain - compassionate = minor_stress_impact_gain - } - } - send_interface_toast = { - type = event_toast_effect_neutral - title = accuse_of_decandence_interaction_notification - - left_icon = scope:actor - right_icon = scope:recipient - - scope:recipient = { - add_stress = major_stress_gain - if = { - limit = { - has_trait = extolled - } - remove_trait = extolled - } - else = { - add_trait = decadent - } - add_opinion = { - modifier = accused_of_decadence_opinion - target = scope:actor - } - } - } - } - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = major_unity_loss - DESC = clan_unity_decadence.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - cost = { - piety = { - value = { - add = minor_piety_value - if = { - limit = { - scope:recipient = { - num_virtuous_traits > 0 - } - } - add = { - value = minor_piety_value - multiply = scope:recipient.num_virtuous_traits - } - } - if = { - limit = { - scope:recipient = { - num_sinful_traits > 0 - } - } - add = { - value = minor_piety_value - multiply = 0.5 - multiply = scope:recipient.num_sinful_traits - min = 10 - } - } - } - } - } - - auto_accept = yes - - ai_targets = { - ai_recipients = dynasty - max = 30 - } - - ai_targets = { - ai_recipients = vassals - } - - ai_frequency_by_tier = { - barony = 0 - county = 96 - duchy = 36 - kingdom = 36 - empire = 36 - hegemony = 36 - } - - ai_will_do = { - base = 0 - - modifier = { - add = 100 - scope:recipient = { - OR = { - has_relation_rival = scope:actor - has_relation_nemesis = scope:actor - } - } - } - - modifier = { - add = 50 - scope:actor = { - ai_wants_low_unity = yes - NOT = { house ?= { has_house_unity_stage = antagonistic } } - } - scope:recipient = { - num_sinful_traits >= 1 - } - } - - modifier = { - add = 100 - scope:actor = { - ai_wants_low_unity = yes - NOT = { house ?= { has_house_unity_stage = antagonistic } } - } - scope:recipient = { - num_sinful_traits >= 2 - } - } - - modifier = { - add = 20 - scope:actor = { - ai_wants_low_unity = yes - NOT = { house ?= { has_house_unity_stage = antagonistic } } - } - scope:recipient = { - number_of_opposing_personality_traits = { - target = scope:actor - value >= 1 - } - } - } - - modifier = { - add = 100 - scope:actor = { - ai_wants_low_unity = yes - NOT = { house ?= { has_house_unity_stage = antagonistic } } - } - scope:recipient = { - number_of_opposing_personality_traits = { - target = scope:actor - value >= 2 - } - } - } - - modifier = { - add = 50 - scope:actor = { - ai_wants_low_unity = yes - NOT = { house ?= { has_house_unity_stage = antagonistic } } - } - OR = { - AND = { - scope:recipient = { - has_trait = incestuous - } - NOT = { is_incestuous_trigger = yes } - trait_is_criminal_in_rite_trigger = { TRAIT = trait:incestuous RITE = scope:actor.rite GENDER_CHARACTER = scope:recipient } - } - AND = { - scope:recipient = { - has_trait = kinslayer - } - NOT = { has_trait = kinslayer } - } - AND = { - scope:recipient = { - has_trait = adulterer - } - NOR = { - has_trait = adulterer - has_trait = fornicator - } - trait_is_criminal_in_rite_trigger = { TRAIT = trait:adulterer RITE = scope:actor.rite GENDER_CHARACTER = scope:recipient } - } - AND = { - scope:recipient = { - has_trait = fornicator - } - NOR = { - has_trait = adulterer - has_trait = fornicator - } - trait_is_criminal_in_rite_trigger = { TRAIT = trait:fornicator RITE = scope:actor.rite GENDER_CHARACTER = scope:recipient } - } - AND = { - scope:recipient = { - has_trait = deviant - } - is_deviant_trigger = no - trait_is_criminal_in_rite_trigger = { TRAIT = trait:deviant RITE = scope:actor.rite GENDER_CHARACTER = scope:recipient } - } - AND = { - scope:recipient = { - has_trait = witch - } - is_witch_trigger = no - trait_is_criminal_in_rite_trigger = { TRAIT = trait:witch RITE = scope:actor.rite GENDER_CHARACTER = scope:recipient } - } - AND = { - scope:recipient = { - has_trait = sodomite - } - NOR = { - has_trait = sodomite - any_secret = { - type = secret_homosexual - } - } - trait_is_criminal_in_rite_trigger = { TRAIT = trait:sodomite RITE = scope:actor.rite GENDER_CHARACTER = scope:recipient } - } - AND = { - scope:recipient = { - has_trait = cannibal - } - is_cannibal_trigger = no - trait_is_criminal_in_rite_trigger = { TRAIT = trait:cannibal RITE = scope:actor.rite GENDER_CHARACTER = scope:recipient } - } - } - } - - modifier = { - factor = 0.25 - scope:recipient = { - is_powerful_vassal_of = scope:actor - } - } - - modifier = { - factor = 0 - scope:recipient = { - OR = { - has_relation_friend = scope:actor - has_relation_best_friend = scope:actor - } - } - } - - modifier = { - factor = 0 - scope:recipient = { - is_primary_heir_of = scope:actor - } - } - } -} - -extoll_virtuousness_interaction = { - icon = unity_harmonious - category = interaction_category_friendly - interface_priority = 60 - common_interaction = yes - - cooldown = { years = 3 } - - desc = extoll_virtuousness_interaction_desc - - is_available = { - government_has_flag = government_is_clan - house.house_head ?= this - trigger_if = { - limit = { is_ai = yes } - is_adult = yes - NOT = { - has_trait = paranoid - } - is_at_war = no - } - } - - is_shown = { - scope:recipient != scope:actor - scope:recipient.house ?= scope:actor.house - scope:recipient = { - NOT = { - has_trait = extolled - } - } - } - - is_valid_showing_failures_only = { - scope:recipient = { is_adult = yes } - } - - on_auto_accept = { - scope:recipient = { - trigger_event = char_interaction.0042 - } - } - - on_accept = { - scope:actor = { - stress_and_fulfillment_impact = { - sadistic = minor_stress_impact_gain - callous = minor_stress_impact_gain - } - send_interface_toast = { - type = event_toast_effect_neutral - title = extoll_interaction_notification - - left_icon = scope:actor - right_icon = scope:recipient - - scope:recipient = { - if = { - limit = { - has_trait = decadent - } - remove_trait = decadent - } - else = { - add_trait = extolled - } - add_opinion = { - modifier = extolled_virtue_opinion - target = scope:actor - } - } - } - } - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = major_unity_gain - DESC = clan_unity_extolled.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - cost = { - piety = { - value = { - add = medium_piety_value - if = { - limit = { - scope:recipient = { - num_sinful_traits > 0 - } - } - add = { - value = medium_piety_value - multiply = scope:recipient.num_sinful_traits - } - } - if = { - limit = { - scope:recipient = { - num_virtuous_traits > 0 - } - } - add = { - value = medium_piety_value - multiply = 0.5 - multiply = scope:recipient.num_virtuous_traits - min = 10 - } - } - } - } - } - - auto_accept = yes - - ai_targets = { - ai_recipients = dynasty - max = 30 - } - - ai_targets = { - ai_recipients = vassals - } - - ai_frequency_by_tier = { - barony = 0 - county = 96 - duchy = 36 - kingdom = 36 - empire = 36 - hegemony = 36 - } - - ai_will_do = { - base = 0 - - modifier = { - add = 100 - scope:actor = { - NOT = { ai_wants_low_unity = yes } - } - scope:recipient = { - OR = { - has_relation_friend = scope:actor - has_relation_best_friend = scope:actor - is_primary_heir_of = scope:actor - } - } - } - - modifier = { - add = 50 - scope:actor = { - ai_wants_high_unity = yes - NOT = { house ?= { has_house_unity_stage = harmonious } } - } - scope:recipient = { - num_virtuous_traits >= 1 - } - } - - modifier = { - add = 100 - scope:actor = { - ai_wants_high_unity = yes - NOT = { house ?= { has_house_unity_stage = harmonious } } - } - scope:recipient = { - num_virtuous_traits >= 2 - } - } - - modifier = { - add = 20 - scope:actor = { - ai_wants_high_unity = yes - NOT = { house ?= { has_house_unity_stage = harmonious } } - } - scope:recipient = { - number_of_personality_traits_in_common = { - target = scope:actor - value >= 1 - } - } - } - - modifier = { - add = 100 - scope:actor = { - ai_wants_high_unity = yes - NOT = { house ?= { has_house_unity_stage = harmonious } } - } - scope:recipient = { - number_of_personality_traits_in_common = { - target = scope:actor - value >= 2 - } - } - } - - modifier = { - factor = 1.5 - scope:recipient = { - is_vassal_of = scope:actor - } - } - - modifier = { - factor = 0 - scope:recipient = { - OR = { - has_relation_rival = scope:actor - has_relation_nemesis = scope:actor - } - } - } - } -} diff --git a/common/character_interactions/00_marriage_interactions.txt b/common/character_interactions/00_marriage_interactions.txt deleted file mode 100644 index 0142fcc09..000000000 --- a/common/character_interactions/00_marriage_interactions.txt +++ /dev/null @@ -1,6902 +0,0 @@ - - -### -# SPECIAL NOTE -# -# When evaluating whether or not the AI can send this interaction to the -# player, the AI will use the ai_accept value and send a proposal to the -# player IF AND ONLY IF the player, as an AI actor, would have positive -# ai_accept value. This is a special case for this specific interaction, -# and is being calculated specifically in code. -# -arrange_marriage_interaction = { - icon = icon_marriage - category = interaction_category_diplomacy - common_interaction = yes - filter_tags = { ceremonial_liege } - - override_background = { reference = relaxing_room } - - special_interaction = arrange_marriage_interaction - interface = marriage - use_diplomatic_range = { - trigger_if = { - limit = { exists = scope:secondary_actor.betrothed } - NOT = { - scope:secondary_actor = { - betrothed = scope:secondary_recipient - } - } - } - } - - recipient_recieve_cooldown = { - years = marriage_recieve_proposal_cooldown - } - - ignore_recipient_recieve_cooldown = { - AND = { - is_ai = no - scope:recipient = { is_ai = no } - } - } - - desc = { - first_valid = { - triggered_desc = { - trigger = { - scope:puppet_or_actor = scope:recipient - } - desc = arrange_marriage_interaction_desc_ruler_at_own_court - } - triggered_desc = { - trigger = { - scope:puppet_or_actor = { - can_marry_character_trigger = { - CHARACTER = scope:recipient - } - } - scope:recipient = { is_ruler = yes } - } - desc = arrange_marriage_interaction_desc_both_rulers_can_marry - } - triggered_desc = { - trigger = { - scope:recipient = { - is_ruler = yes - can_marry_trigger = yes - } - } - desc = arrange_marriage_interaction_desc_both_rulers_recipient_only_can_marry - } - triggered_desc = { - trigger = { - scope:recipient = { - is_ruler = yes - } - } - desc = arrange_marriage_interaction_desc_both_rulers_recipient_neither_can_marry - } - triggered_desc = { - trigger = { - scope:puppet_or_actor = { - can_marry_character_trigger = { - CHARACTER = scope:recipient - } - } - } - desc = arrange_marriage_interaction_desc_one_ruler_can_marry - } - desc = arrange_marriage_interaction_desc_recipient_one_ruler_cannot_marry - } - } - - redirect = { - # If the define MARRIAGE_OWNER_IS_MATCHMAKER is set to yes, the actor must end up as the "matchmaker" link for courtiers - scope:puppet_or_actor = { - if = { - limit = { - exists = matchmaker - NOT = { this = matchmaker } - } - save_scope_as = secondary_actor - matchmaker = { - save_scope_as = actor - save_scope_as = puppet_or_actor - } - } - if = { - limit = { - is_betrothed = yes - betrothed = scope:recipient - } - - save_scope_as = secondary_actor - } - } - - scope:recipient = { - if = { - limit = { - is_betrothed = yes - betrothed.matchmaker = scope:puppet_or_actor - is_adult = yes - betrothed = { - is_adult = yes - } - } - - save_scope_as = secondary_recipient - matchmaker = { - save_scope_as = recipient - } - betrothed = { - save_scope_as = secondary_actor - } - } - - # marriage interactions are special, and code sets scopes in an unusual way - # secondary recipient must always be set for marriage script, - # but marriage UI only sets primary recipient - # make sure redirect solves this issue - if = { - limit = { - exists = matchmaker - this = matchmaker - NOT = { exists = scope:secondary_recipient } - } - save_scope_as = secondary_recipient - } - if = { - limit = { - exists = matchmaker - NOT = { this = matchmaker } - } - save_scope_as = secondary_recipient - matchmaker = { - save_scope_as = recipient - } - } - } - } - - populate_actor_list = { - scope:puppet_or_actor = { - if = { - limit = { - trigger_if = { - limit = { exists = scope:secondary_recipient } - can_marry_character_trigger = { CHARACTER = scope:secondary_recipient } - } - } - add_to_list = characters - } - every_courtier = { - limit = { - trigger_if = { - limit = { - is_concubine = yes - } - is_concubine_of = scope:puppet_or_actor - } - trigger_if = { - limit = { exists = scope:secondary_recipient } - can_marry_character_trigger = { CHARACTER = scope:secondary_recipient } - } - } - add_to_list = characters - } - every_courtier_away = { - limit = { - trigger_if = { - limit = { - is_concubine = yes - } - is_concubine_of = scope:puppet_or_actor - } - trigger_if = { - limit = { exists = scope:secondary_recipient } - can_marry_character_trigger = { CHARACTER = scope:secondary_recipient } - } - } - add_to_list = characters - } - every_child = { - even_if_dead = yes - if = { - limit = { - is_alive = yes - NOT = { is_in_list = characters } - trigger_if = { - limit = { - is_concubine = yes - } - is_concubine_of = scope:puppet_or_actor - } - trigger_if = { - limit = { exists = scope:secondary_recipient } - can_marry_character_trigger = { CHARACTER = scope:secondary_recipient } - } - } - add_to_list = characters - } - every_child = { - even_if_dead = yes - if = { - limit = { - is_alive = yes - NOT = { is_in_list = characters } - OR = { - top_liege = scope:puppet_or_actor - house.house_head = scope:puppet_or_actor - dynasty.dynast = scope:puppet_or_actor - } - trigger_if = { - limit = { - is_concubine = yes - } - is_concubine_of = scope:puppet_or_actor - } - trigger_if = { - limit = { exists = scope:secondary_recipient } - can_marry_character_trigger = { CHARACTER = scope:secondary_recipient } - } - } - add_to_list = characters - } - every_child = { - if = { - limit = { - is_alive = yes - NOT = { is_in_list = characters } - OR = { - top_liege = scope:puppet_or_actor - house.house_head = scope:puppet_or_actor - dynasty.dynast = scope:puppet_or_actor - } - trigger_if = { - limit = { - is_concubine = yes - } - is_concubine_of = scope:puppet_or_actor - } - trigger_if = { - limit = { exists = scope:secondary_recipient } - can_marry_character_trigger = { CHARACTER = scope:secondary_recipient } - } - } - add_to_list = characters - } - } - } - } - } - } - - populate_recipient_list = { - scope:recipient = { - if = { - limit = { - trigger_if = { - limit = { exists = scope:secondary_actor } - can_marry_character_trigger = { CHARACTER = scope:secondary_actor } - } - } - add_to_list = characters - } - every_courtier = { - limit = { - trigger_if = { - limit = { exists = scope:secondary_actor } - can_marry_character_trigger = { CHARACTER = scope:secondary_actor } - } - } - add_to_list = characters - } - every_courtier_away = { - limit = { - trigger_if = { - limit = { exists = scope:secondary_actor } - can_marry_character_trigger = { CHARACTER = scope:secondary_actor } - } - } - add_to_list = characters - } - every_child = { - limit = { - NOT = { is_in_list = characters } - trigger_if = { - limit = { exists = scope:secondary_actor } - can_marry_character_trigger = { CHARACTER = scope:secondary_actor } - } - } - add_to_list = characters - } - } - } - - interface_priority = 60 - - cost = { - prestige = { - value = 0 - if = { - limit = { - exists = scope:puppet_or_actor - exists = scope:recipient - exists = scope:secondary_recipient - exists = scope:secondary_actor - scope:secondary_actor = { is_close_family_of = scope:puppet_or_actor } - scope:recipient = { - OR = { - AND = { - vassal_contract_has_flag = vassal_contract_marriage_favor - is_allied_to = scope:puppet_or_actor - } - NOT = { vassal_contract_has_flag = vassal_contract_marriage_favor} - } - } - } - add = { - scope:puppet_or_actor = { - every_vassal = { - limit = { - vassal_contract_has_flag = vassal_contract_marriage_favor - NOT = { is_allied_to = scope:puppet_or_actor } - NOR = { - this = scope:recipient - this = scope:secondary_recipient - } - } - add = medium_prestige_value - } - } - desc = VASSAL_WITH_MARRIAGE_FAVOR - } - } - } - -# piety = { -# value = 0 -# if = { -# limit = { scope:piety_cost_reduction = yes } -# add = scope:puppet_or_actor.medium_piety_value -# desc = STRUGGLE_MARRIAGE_ACCEPTANCE_USING_PIETY_AS_CURRENCY -# } -# if = { -# limit = { -# exists = scope:puppet_or_actor -# exists = scope:recipient -# exists = scope:secondary_recipient -# exists = scope:secondary_actor -# scope:secondary_actor = { -# faith != scope:secondary_recipient.faith -# } -# scope:puppet_or_actor = { -# any_character_struggle = { -# has_struggle_phase_parameter = interfaith_marriages_between_involved_characters_costs_piety -# } -# } -# } -# add = { -# value = major_piety_value -# desc = CB_STRUGGLE_PHASE_SURCHARGE -# } -# } -# } - - influence = { - value = 0 - if = { - limit = { scope:influence_send_option = yes } - add = scope:puppet_or_actor.medium_influence_value - desc = INFLUENCE_INTERACTION_ACCEPTANCE_SEND_OPTION - } - } - } - - # actor, recipient ... characters arranging the marriage - # secondary_actor, secondary_recipient ... characters that should marry - - is_shown = { - scope:puppet_or_actor ?= { - OR = { - is_ruler = yes #Can arrange marriages for others - #You're just a courtier? Only use the interaction on characters you can marry - can_marry_character_trigger = { CHARACTER = scope:recipient } - } - } - # Block further marriage proposals for people who have a pending grand wedding - NOR = { - scope:secondary_actor ?= { has_been_promised_grand_wedding = yes } - scope:secondary_recipient ?= { has_been_promised_grand_wedding = yes } - } - #If you're interacting with someone who isn't their own matchmaker, only show the interaction if they can get married. (If someone isn't their own matchmaker, they will be set as secondary_recipient by code and their matchmaker becomes recipient) - trigger_if = { - limit = { - exists = scope:secondary_recipient - scope:secondary_recipient.matchmaker != scope:secondary_recipient - } - scope:secondary_recipient = { - OR = { - marriage_interaction_can_be_picked_trigger = yes #Can marry anyone - AND = { - ready_to_marry_betrothed_trigger = yes - OR = { - betrothed ?= scope:secondary_actor - trigger_if = { - limit = { exists = betrothed.liege } - betrothed.liege = scope:puppet_or_actor - } - } - } - } - #To account for a person marrying their concubines - trigger_if = { - limit = { - is_concubine = yes - } - is_concubine_of = scope:puppet_or_actor - can_marry_character_trigger = { CHARACTER = scope:puppet_or_actor } - } - } - } - #allow landless adventurers to marry only within their camp, or with Contact list courtiers (after using request_marriage option in contact_list_request_interaction), or prieviously betrothed characters - trigger_if = { - limit = { - scope:puppet_or_actor = { - government_has_flag = government_is_landless_adventurer - } - } - trigger_if = { - limit = { - OR = { - scope:puppet_or_actor ?= { - is_target_in_variable_list = { - name = contact_list_marriage - target = scope:recipient - } - } - scope:recipient = { - is_betrothed = yes - betrothed ?= { - OR = { - scope:puppet_or_actor ?= this - scope:secondary_actor ?= this - } - } - } - scope:secondary_recipient ?= { - is_betrothed = yes - betrothed ?= { - OR = { - scope:puppet_or_actor ?= this - scope:secondary_actor ?= this - } - } - } - } - } - always = yes - } - trigger_else = { - scope:recipient = scope:puppet_or_actor - } - } - } - - is_valid_showing_failures_only = { - pam_ai_marriage_respects_clerical_restraint_trigger = yes - #If we're opening this interaction through the interaction menu (i.e. not all scopes exist yet) - #This was giving double-warnings about a marry-able character existing so it's commented out for now - #custom_description = { - # text = character_to_marry_exists - # object = scope:recipient - # scope:recipient = { - # OR = { - # any_courtier = { - # is_at_home = yes - # marriage_interaction_can_be_picked_trigger= yes - # } - # any_child = { - # marriage_interaction_can_be_picked_trigger= yes - # } - # } - # } - #} - trigger_if = { - limit = { - NAND = { - exists = scope:secondary_actor - exists = scope:secondary_recipient - } - } - #There is an available marriage - custom_description = { - text = "basic_can_marry_check_recipient" - subject = scope:puppet_or_actor - object = scope:recipient - scope:recipient = { - OR = { - AND = { - #Recipient can marry - can_marry_trigger = yes - #To account for a person marrying their concubines - trigger_if = { - limit = { - is_concubine = yes - } - is_concubine_of = scope:puppet_or_actor - can_marry_character_trigger = { CHARACTER = scope:puppet_or_actor } - } - } - AND = { - is_ruler = yes #(Following are only for rulers) - OR = { - any_child = { - matchmaker = scope:puppet_or_actor - OR = { - #Any of recipient's children can marry - AND = { - can_marry_trigger = yes - #To account for a person marrying their concubines - trigger_if = { - limit = { - is_concubine = yes - } - is_concubine_of = scope:puppet_or_actor - } - } - #Any of recipient's children are ready to marry their betrothed - AND = { - ready_to_marry_betrothed_trigger = yes - betrothed.matchmaker = scope:puppet_or_actor - } - } - } - any_courtier = { - OR = { - #Any of recipient's courtiers can marry - AND = { - can_marry_trigger = yes - #To account for a person marrying their concubines - trigger_if = { - limit = { - is_concubine = yes - } - is_concubine_of = scope:puppet_or_actor - } - } - #Any of recipient's courtiers are ready to marry their betrothed - AND = { - ready_to_marry_betrothed_trigger = yes - betrothed.matchmaker = scope:puppet_or_actor - } - } - } - } - } - } - } - } - } - #Diplomatic availability & prison - scope:recipient = { - is_imprisoned = no - } - NOT = { - scope:puppet_or_actor = { - is_at_war_with = scope:recipient - } - } - trigger_if = { #(must be here because secondary_recipient can be set at the start) - limit = { - exists = scope:secondary_recipient - scope:secondary_recipient != scope:recipient - } - scope:secondary_recipient = { - is_imprisoned = no - bp2_valid_for_standard_interactions_trigger = yes - } - } - trigger_if = { #(must be here because secondary_recipient can be set at the start) - limit = { - exists = scope:secondary_actor - scope:secondary_actor != scope:puppet_or_actor - } - scope:secondary_actor = { - is_imprisoned = no - bp2_valid_for_standard_interactions_trigger = yes - } - } - # Account for regents being bolshy. - marriage_interaction_non_loyal_diarchs_refuse_secondary_marriage_trigger = { TARGET = secondary_actor } - marriage_interaction_non_loyal_diarchs_refuse_secondary_marriage_trigger = { TARGET = secondary_recipient } - marriage_interaction_non_loyal_diarchs_refuse_secondary_marriage_trigger = { TARGET = puppet_or_actor } - marriage_interaction_non_loyal_diarchs_refuse_secondary_marriage_trigger = { TARGET = recipient } - } - - # whether a character can be picked for the interaction, interface only (e.g. picking the first character in the marriage interaction) - # in character scope, actor and recipient event targets can be used, but not the secondary characters (because none exist yet) - can_be_picked = { - OR = { - marriage_interaction_can_be_picked_trigger = yes - AND = { - exists = scope:secondary_actor - exists = scope:secondary_recipient - scope:secondary_actor.betrothed = scope:secondary_recipient - } - } - } - - #Is evaluated only after secondary_recipient and secondary_actor are both chosen - has_valid_target_showing_failures_only = { - marriage_interaction_valid_target_trigger = yes #Checks marriage status, betrothed, gender, consanguinity, faith hostility etc. - - #Blocks AI from marrying player guests - scope:secondary_recipient = { - trigger_if = { - limit = { - is_pool_guest = yes - host = { - is_ai = no - this != scope:puppet_or_actor - } - } - NOT = { is_pool_guest_of = host } - } - } - - #Blocks most AI's from marrying Evil faiths - trigger_if = { - limit = { - scope:puppet_or_actor = { - is_ai = yes - NOT = { has_trait = cynical } - #AI should honor betrothal even if faiths change - scope:secondary_actor.betrothed != scope:secondary_recipient - } - } - scope:recipient.faith = { - faith_hostility_level = { - target = scope:puppet_or_actor.faith - value < faith_hostility_prevents_marriage_level - } - } - } - - #Blocks AI from marrying single mayors in their area unless they are also mayors - trigger_if = { - limit = { - scope:puppet_or_actor = { - is_ai = yes - NOT = { government_has_flag = government_is_republic } - } - } - NOT = { - scope:recipient = { government_has_flag = government_is_republic } - } - } - - trigger_if = { # Cultural Traditions, for AI - limit = { - scope:puppet_or_actor = { - is_ai = yes - culture = { - has_cultural_parameter = dislikes_marrying_outside_of_culture - } - } - } - OR = { - scope:puppet_or_actor.culture = scope:recipient.culture - scope:puppet_or_actor.culture = scope:secondary_recipient.culture - } - } - trigger_if = { # Pastoral Isolation personal tenet, for AI - limit = { - scope:puppet_or_actor = { - is_ai = yes - has_personal_tenet_flag = tenet_pastoral_isolation_endogamy - } - } - OR = { - scope:puppet_or_actor.faith = scope:recipient.faith - scope:puppet_or_actor.faith = scope:secondary_recipient.faith - } - } - } - - pre_auto_accept = { - if = { - limit = { - NOR = { - scope:recipient = scope:puppet_or_actor - scope:secondary_actor = { has_been_promised_grand_wedding = yes } - scope:secondary_recipient = { has_been_promised_grand_wedding = yes } - } - } - scope:recipient = { - if = { - limit = { scope:secondary_actor.betrothed = scope:secondary_recipient } - send_interface_toast = { - type = msg_betrothal_fulfilled - left_icon = scope:secondary_actor - right_icon = scope:secondary_recipient - } - } - else = { - send_interface_toast = { - type = msg_marriage_forced - left_icon = scope:secondary_actor - right_icon = scope:secondary_recipient - } - } - } - } - } - - on_send = { - if = { - limit = { - scope:grand_wedding_promise = yes - } - scope:puppet_or_actor = { - set_variable = { - name = grand_wedding_promise_pending - days = 10 - } - if = { - limit = { - is_ai = yes - } - remove_short_term_gold = ai_wedding_promise_gold_actor - } - #if = { # Activity count debugging, left in for QA purposes - # limit = { - # NOT = { - # exists = global_var:wedding_promise - # } - # } - # set_global_variable = { - # name = wedding_promise - # value = 1 - # } - #} - #else = { - # change_global_variable = { - # name = wedding_promise - # add = 1 - # } - #} - } - } - } - - on_accept = { - marriage_interaction_on_accept_effect = yes - scope:puppet_or_actor = { - if = { - limit = { - scope:herd_send_option = yes - } - pay_herd = { - target = scope:recipient - value = scope:puppet_or_actor.domicile.medium_herd_value - } - } - if = { - limit = { - has_variable = grand_wedding_promise_pending - } - remove_variable = grand_wedding_promise_pending - } - if = { - limit = { - is_target_in_variable_list = { - name = contact_list_marriage - target = scope:recipient - } - } - remove_list_variable = { - name = contact_list_marriage - target = scope:recipient - } - } - } - } - - on_decline = { - scope:puppet_or_actor = { - if = { - limit = { this != scope:recipient } - trigger_event = marriage_interaction.0011 - } - if = { - limit = { - has_variable = grand_wedding_promise_pending - } - remove_variable = grand_wedding_promise_pending - } - } - scope:secondary_actor = { - add_character_flag = { - flag = player_declined_marriage - years = 5 - } - } - } - - auto_accept = { - marriage_interaction_auto_accept_trigger = yes #Strong hook conditions - } - - ai_accept = { - base = 0 - - marriage_ai_accept_modifier = yes - } - - # If you want the AI to set these options then it needs to be hooked into the code as well - send_option = { - flag = grand_wedding_promise - localization = GRAND_WEDDING_PROMISE - - is_shown = { - scope:puppet_or_actor = { #Can organize a Grand Wedding - highest_held_title_tier > tier_barony - is_landed_or_landless_administrative_or_theocratic = yes - trigger_if = { - limit = { - is_ai = yes - } - is_at_war = no - } - # DLC locked - has_dlc_feature = tours_and_tournaments - has_dlc_feature = advanced_activities - } - } - - current_description = { - desc = "GRAND_WEDDING_PROMISE_INFO" - } - - is_valid = { - scope:puppet_or_actor = { - gold >= real_wedding_cost_actor_scope - is_available = yes - custom_tooltip = { - text = grand_wedding_already_promised_tt - NOR = { - var:promised_grand_wedding_marriage_countdown ?= { is_alive = yes } - has_variable = grand_wedding_promise_pending - } - } - } - trigger_if = { - limit = { - exists = scope:secondary_actor - } - custom_tooltip = { - text = grand_wedding_only_dominant_side - trigger_if = { - limit = { - scope:secondary_actor ?= { - is_female = yes - } - } - OR = { - scope:secondary_actor ?= { matrilinear_betrothal = yes } - scope:matrilineal = yes - } - } - trigger_else = { - NOR = { - scope:secondary_actor ?= { matrilinear_betrothal = yes } - scope:matrilineal = yes - } - } - } - custom_tooltip = { - text = grand_wedding_only_family - scope:secondary_actor ?= { - is_close_or_extended_family_of = scope:puppet_or_actor - } - } - # Cannot promise grand weddings with regents due to regency and travel limitations - custom_tooltip = { - text = grand_wedding_secondary_regent - NOT = { - scope:secondary_actor.liege = { - diarch = scope:secondary_actor - has_active_diarchy = yes - } - } - } - } - # Safety check because players shouldn't be spouse_2 - trigger_if = { - limit = { - has_multiple_players = yes - } - custom_tooltip = { - text = grand_wedding_mp_ai - trigger_if = { - limit = { - OR = { - scope:puppet_or_actor = { is_ai = no } - scope:secondary_actor ?= { is_ai = no } - } - } - scope:secondary_recipient ?= { - is_ai = yes - } - } - } - } - trigger_if = { - limit = { - scope:secondary_recipient.liege ?= { - diarch = scope:secondary_recipient - has_active_diarchy = yes - } - } - # Cannot promise grand weddings with regents due to regency and travel limitations - custom_tooltip = { - text = grand_wedding_secondary_regent - NOT = { - scope:secondary_recipient.liege = { - diarch = scope:secondary_recipient - has_active_diarchy = yes - } - } - } - } - } - } - - send_option = { - flag = matrilineal - localization = MATRILINEAL_OFFER - is_shown = { - NAND = { - scope:secondary_actor ?= { is_male = yes } - scope:secondary_recipient ?= { is_male = yes } - } - } - current_description = { - triggered_desc = { - trigger = { - scope:secondary_actor ?= { - betrothed = scope:secondary_recipient - matrilinear_betrothal = yes - } - } - desc = "MATRILINEAL_OFFER_BETROTHAL_INFO" - } - } - can_be_changed = { - trigger_if = { - limit = { - exists = scope:secondary_actor - } - OR = { - NOT = { - exists = scope:secondary_recipient - } - scope:secondary_actor = { - betrothed != scope:secondary_recipient - } - } - } - # so they can use grand wedding... - NAND = { - scope:secondary_actor ?= { is_female = yes } - scope:secondary_recipient ?= { is_female = yes } - } - } - starts_enabled = { - trigger_if = { - limit = { - scope:secondary_actor ?= { - betrothed = scope:secondary_recipient - } - } - scope:secondary_actor = { - matrilinear_betrothal = yes - } - } - trigger_else_if = { - limit = { - scope:secondary_actor ?= scope:puppet_or_actor - scope:puppet_or_actor = { - is_female = yes - is_ai = no - } - } - always = yes - } - trigger_else = { - scope:puppet_or_actor = { - OR = { - rite = { - rite_has_doctrine = doctrine_gender_female_dominated - } - AND = { - this = scope:recipient - scope:secondary_recipient ?= { - is_female = yes - } - rite = { rite_has_doctrine = doctrine_gender_equal } - } - AND = { - scope:secondary_actor ?= this - is_female = yes - is_ai = no - } - AND = { - scope:secondary_actor ?= { is_female = yes } - scope:secondary_recipient ?= { is_female = yes } - } - } - } - } - } - } - - send_option = { - is_shown = { - scope:secondary_actor = { - betrothed != scope:secondary_recipient - } - } - is_valid = { - scope:puppet_or_actor = { - has_usable_hook = scope:recipient - } - } - flag = hook - localization = MARRIAGE_HOOK - } - -# send_option = { # FP3 -# is_shown = { -# scope:puppet_or_actor = { -# any_character_struggle = { -# is_struggle_type = persian_struggle -# has_struggle_phase_parameter = can_trade_piety_for_marriage_acceptance -# } -# } -# } -# is_valid = { -# scope:puppet_or_actor = { -# any_character_struggle = { -# involvement = involved -# is_struggle_type = persian_struggle -# } -# } -# scope:recipient = { -# any_character_struggle = { -# involvement = involved -# is_struggle_type = persian_struggle -# } -# } -# } -# flag = piety_cost_reduction -# localization = TRADE_PIETY_FOR_BETTER_AI_ACCEPTANCE -# } - - send_option = { # EP3 Influence - is_shown = { # Actor must have a government that uses influence - scope:puppet_or_actor = { - government_has_flag = government_has_influence - } - } - is_valid = { - # Actor has enough influence - scope:puppet_or_actor = { influence >= medium_influence_value } - # Both characters are within the same top realm - custom_tooltip = { - text = not_same_realm_tt - scope:recipient.top_liege = scope:puppet_or_actor.top_liege - } - } - flag = influence_send_option - localization = TRADE_INFLUENCE_FOR_BETTER_AI_ACCEPTANCE - } - - send_option = { # MPO Herd - is_shown = { # Actor must have a government that uses Herd - scope:puppet_or_actor = { - government_has_flag = government_is_nomadic - is_ai = no - } - # Recipient must care about Herd - scope:recipient = { - government_has_flag = government_is_nomadic - } - } - is_valid = { - # Actor has enough Herd - scope:puppet_or_actor = { domicile.herd >= domicile.medium_herd_value } - } - flag = herd_send_option - localization = TRADE_HERD_FOR_BETTER_AI_ACCEPTANCE - } - - should_use_extra_icon = { - scope:puppet_or_actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - send_options_exclusive = no - - show_effects_in_notification = no - greeting = positive - - notification_text = { - first_valid = { - triggered_desc = { - trigger = { - scope:secondary_actor = { - is_adult = yes - } - scope:secondary_recipient = { - is_adult = yes - } - NOR = { - scope:secondary_actor = { has_been_promised_grand_wedding = yes } - scope:secondary_recipient = { has_been_promised_grand_wedding = yes } - } - } - desc = { - first_valid = { - triggered_desc = { - trigger = { - scope:matrilineal = yes - scope:secondary_actor = scope:puppet_or_actor - scope:secondary_recipient = scope:recipient - } - desc = MARRIAGE_NOTIFICATION_BOTH_PERSONAL_MATRI - } - triggered_desc = { - trigger = { - scope:matrilineal = yes - scope:secondary_actor = scope:puppet_or_actor - } - desc = MARRIAGE_NOTIFICATION_ACTOR_PERSONAL_MATRI - } - triggered_desc = { - trigger = { - scope:matrilineal = yes - scope:secondary_recipient = scope:recipient - } - desc = MARRIAGE_NOTIFICATION_RECIPIENT_PERSONAL_MATRI - } - triggered_desc = { - trigger = { - scope:matrilineal = yes - } - desc = MARRIAGE_NOTIFICATION_MATRI - } - triggered_desc = { - trigger = { - scope:secondary_actor = scope:puppet_or_actor - scope:secondary_recipient = scope:recipient - } - desc = MARRIAGE_NOTIFICATION_BOTH_PERSONAL - } - triggered_desc = { - trigger = { - scope:secondary_actor = scope:puppet_or_actor - } - desc = MARRIAGE_NOTIFICATION_ACTOR_PERSONAL - } - triggered_desc = { - trigger = { - scope:secondary_recipient = scope:recipient - } - desc = MARRIAGE_NOTIFICATION_RECIPIENT_PERSONAL - } - desc = MARRIAGE_NOTIFICATION - } - } - } - desc = { - first_valid = { - triggered_desc = { - trigger = { - scope:matrilineal = yes - scope:secondary_actor = scope:puppet_or_actor - scope:secondary_recipient = scope:recipient - } - desc = BETROTHAL_NOTIFICATION_BOTH_PERSONAL_MATRI - } - triggered_desc = { - trigger = { - scope:matrilineal = yes - scope:secondary_actor = scope:puppet_or_actor - } - desc = BETROTHAL_NOTIFICATION_ACTOR_PERSONAL_MATRI - } - triggered_desc = { - trigger = { - scope:matrilineal = yes - scope:secondary_recipient = scope:recipient - } - desc = BETROTHAL_NOTIFICATION_RECIPIENT_PERSONAL_MATRI - } - triggered_desc = { - trigger = { - scope:matrilineal = yes - } - desc = BETROTHAL_NOTIFICATION_MATRI - } - triggered_desc = { - trigger = { - scope:secondary_actor = scope:puppet_or_actor - scope:secondary_recipient = scope:recipient - } - desc = BETROTHAL_NOTIFICATION_BOTH_PERSONAL - } - triggered_desc = { - trigger = { - scope:secondary_actor = scope:puppet_or_actor - } - desc = BETROTHAL_NOTIFICATION_ACTOR_PERSONAL - } - triggered_desc = { - trigger = { - scope:secondary_recipient = scope:recipient - } - desc = BETROTHAL_NOTIFICATION_RECIPIENT_PERSONAL - } - desc = BETROTHAL_NOTIFICATION - } - } - } - } -} - -#This interaction is referenced in code! If it's renamed you have to ping a coder -marry_off_interaction = { - icon = icon_marriage - category = interaction_category_diplomacy - common_interaction = yes - - desc = marry_off_interaction_desc - - send_name = marry_off_send - needs_recipient_to_open = no - special_interaction = arrange_marriage_interaction - interface = marriage - redirect = { - if = { - limit = { - exists = scope:secondary_actor - } - scope:recipient = { - save_scope_as = secondary_recipient - matchmaker = { - save_scope_as = recipient - } - } - - } - else = { - scope:recipient = { - save_scope_as = secondary_actor - } - clear_saved_scope = recipient - } - } - - populate_recipient_list = { - #populate only with your courtiers or children/grandchildren if you are a landless adventurer - if = { - limit = { - scope:puppet_or_actor = { - has_government = landless_adventurer_government - } - } - scope:secondary_actor = { - if = { - limit = { - scope:puppet_or_actor != this - } - add_to_list = characters - } - every_courtier = { - limit = { - trigger_if = { - limit = { - is_concubine = yes - } - is_concubine_of = scope:puppet_or_actor - can_marry_character_trigger = { CHARACTER = scope:puppet_or_actor } - } - } - add_to_list = characters - } - every_courtier_away = { - limit = { - trigger_if = { - limit = { - is_concubine = yes - } - is_concubine_of = scope:puppet_or_actor - can_marry_character_trigger = { CHARACTER = scope:puppet_or_actor } - } - } - add_to_list = characters - } - every_child = { - even_if_dead = yes - if = { - limit = { - is_alive = yes - NOT = { is_in_list = characters } - trigger_if = { - limit = { - is_concubine = yes - } - is_concubine_of = scope:puppet_or_actor - can_marry_character_trigger = { CHARACTER = scope:puppet_or_actor } - } - } - add_to_list = characters - } - every_child = { - even_if_dead = yes - if = { - limit = { - is_alive = yes - NOT = { is_in_list = characters } - trigger_if = { - limit = { - is_concubine = yes - } - is_concubine_of = scope:puppet_or_actor - can_marry_character_trigger = { CHARACTER = scope:puppet_or_actor } - } - } - add_to_list = characters - } - every_child = { - if = { - limit = { - is_alive = yes - NOT = { is_in_list = characters } - trigger_if = { - limit = { - is_concubine = yes - } - is_concubine_of = scope:puppet_or_actor - can_marry_character_trigger = { CHARACTER = scope:puppet_or_actor } - } - } - add_to_list = characters - } - } - } - } - } - } - #otherwise, populate with anyone eligible - else = { - scope:secondary_actor = { - if = { - limit = { - culture = { has_cultural_parameter = reduced_marriage_acceptance_distant_realms } - } - every_opposite_sex_spouse_candidate = { - limit = { - top_liege.culture = scope:secondary_actor.top_liege.culture - } - add_to_list = characters - } - if = { - limit = { allowed_to_marry_same_sex_trigger = yes } - every_same_sex_spouse_candidate = { - limit = { - scope:secondary_actor != this - top_liege.culture = scope:secondary_actor.top_liege.culture - } - add_to_list = characters - } - } - } - else = { - every_opposite_sex_spouse_candidate = { - add_to_list = characters - } - if = { - limit = { allowed_to_marry_same_sex_trigger = yes } - every_same_sex_spouse_candidate = { - limit = { - scope:secondary_actor != this - } - add_to_list = characters - } - } - } - } - } - } - - cost = { - prestige = { - value = 0 - if = { - limit = { - exists = scope:puppet_or_actor - exists = scope:recipient - exists = scope:secondary_recipient - exists = scope:secondary_actor - scope:secondary_actor = { is_close_family_of = scope:puppet_or_actor } - scope:recipient = { - OR = { - AND = { - vassal_contract_has_flag = vassal_contract_marriage_favor - is_allied_to = scope:puppet_or_actor - } - NOT = { vassal_contract_has_flag = vassal_contract_marriage_favor} - } - } - } - add = { - scope:puppet_or_actor = { - every_vassal = { - limit = { - vassal_contract_has_flag = vassal_contract_marriage_favor - NOT = { is_allied_to = scope:puppet_or_actor } - NOR = { - this = scope:recipient - this = scope:secondary_recipient - } - } - add = medium_prestige_value - } - } - desc = VASSAL_WITH_MARRIAGE_FAVOR - } - } - } - - influence = { - value = 0 - if = { - limit = { scope:influence_send_option = yes } - add = scope:puppet_or_actor.medium_influence_value - desc = INFLUENCE_INTERACTION_ACCEPTANCE_SEND_OPTION - } - } - -# piety = { -# value = 0 -# if = { -# limit = { -# exists = scope:puppet_or_actor -# exists = scope:recipient -# exists = scope:secondary_recipient -# exists = scope:secondary_actor -# scope:secondary_actor = { -# faith != scope:secondary_recipient.faith -# } -# scope:puppet_or_actor = { -# any_character_struggle = { -# has_struggle_phase_parameter = interfaith_marriages_between_involved_characters_costs_piety -# } -# } -# } -# add = { -# value = major_piety_value -# desc = CB_STRUGGLE_PHASE_SURCHARGE -# } -# } -# } - } - - interface_priority = 60 - - # actor, recipient ... characters arranging the marriage - # secondary_actor, secondary_recipient ... characters that should marry - - is_shown = { - # Enable only for yourself if you're a landless adventurer - trigger_if = { - limit = { - scope:puppet_or_actor = { - has_government = landless_adventurer_government - } - } - scope:secondary_actor = { - scope:puppet_or_actor = this - } - } - scope:secondary_actor ?= { - #Is this someone I can marry off? - OR = { - is_courtier_of = scope:puppet_or_actor - AND = { - is_child_of = scope:puppet_or_actor - target_is_liege_or_above = scope:puppet_or_actor - } - scope:puppet_or_actor ?= this - } - #They can be married - can_marry_trigger = yes - #To account for a person marrying their concubines - trigger_if = { - limit = { - is_concubine = yes - } - is_concubine_of = scope:puppet_or_actor - can_marry_character_trigger = { CHARACTER = scope:puppet_or_actor } - } - } - # Block further marriage proposals for people who have a pending grand wedding - NOR = { - scope:secondary_actor ?= { has_been_promised_grand_wedding = yes } - scope:secondary_recipient ?= { has_been_promised_grand_wedding = yes } - } - } - - is_valid_showing_failures_only = { - #Diplomatic availability & prison - scope:secondary_actor = { - is_imprisoned = no - bp2_valid_for_standard_interactions_trigger = yes - } - marriage_interaction_non_loyal_diarchs_refuse_secondary_marriage_trigger = { TARGET = secondary_actor } - trigger_if = { - limit = { - scope:secondary_actor != scope:secondary_recipient - } - marriage_interaction_non_loyal_diarchs_refuse_secondary_marriage_trigger = { TARGET = secondary_recipient } - } - marriage_interaction_non_loyal_diarchs_refuse_secondary_marriage_trigger = { TARGET = puppet_or_actor } - marriage_interaction_non_loyal_diarchs_refuse_secondary_marriage_trigger = { TARGET = recipient } - } - - has_valid_target_showing_failures_only = { - marriage_interaction_valid_target_trigger = yes #Checks marriage status, betrothed, gender, consanguinity, faith hostility etc. - - #Diplomatic availability & prison (located here because these will never be set at the start) - scope:recipient = { - is_imprisoned = no - } - NOT = { - scope:puppet_or_actor = { - is_at_war_with = scope:recipient - } - } - trigger_if = { - limit = { scope:recipient != scope:secondary_recipient } - scope:secondary_recipient = { - is_imprisoned = no - bp2_valid_for_standard_interactions_trigger = yes - } - } - #secondary_actor is checked above because they are always available - - #Blocks AI from marrying player guests - scope:secondary_recipient = { - trigger_if = { - limit = { - is_pool_guest = yes - host = { - is_ai = no - this != scope:puppet_or_actor - } - } - NOT = { is_pool_guest_of = host } - } - } - } - - on_send = { - if = { - limit = { - scope:grand_wedding_promise = yes - } - scope:puppet_or_actor = { - set_variable = { - name = grand_wedding_promise_pending - days = 10 - } - if = { - limit = { - is_ai = yes - } - remove_short_term_gold = ai_wedding_promise_gold_actor - } - #if = { # Activity count debugging, left in for QA purposes - # limit = { - # NOT = { - # exists = global_var:wedding_promise - # } - # } - # set_global_variable = { - # name = wedding_promise - # value = 1 - # } - #} - #else = { - # change_global_variable = { - # name = wedding_promise - # add = 1 - # } - #} - } - } - } - - on_accept = { - marriage_interaction_on_accept_effect = yes - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:puppet_or_actor - TARGET = scope:recipient - VALUE = medium_unity_gain - DESC = clan_unity_marry_off.desc - REVERSE_NON_HOUSE_TARGET = no - } - - scope:puppet_or_actor = { - if = { - limit = { - scope:herd_send_option = yes - } - pay_herd = { - target = scope:recipient - value = scope:puppet_or_actor.domicile.medium_herd_value - } - } - if = { - limit = { - has_variable = grand_wedding_promise_pending - } - remove_variable = grand_wedding_promise_pending - } - } - } - - on_decline = { - scope:puppet_or_actor = { - if = { - limit = { this != scope:recipient } - trigger_event = marriage_interaction.0011 - } - if = { - limit = { - has_variable = grand_wedding_promise_pending - } - remove_variable = grand_wedding_promise_pending - } - } - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:puppet_or_actor - TARGET = scope:recipient - VALUE = medium_unity_loss - DESC = clan_unity_marry_off_decline.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - auto_accept = { - marriage_interaction_auto_accept_trigger = yes #Strong hook conditions - } - - ai_accept = { - base = 0 # Should be 0 for all interactions - - marriage_ai_accept_modifier = yes - - # Unity modifiers - evaluate_action_increasing_house_unity = { - VALUE = 100 - } - } - - send_option = { - flag = grand_wedding_promise - localization = GRAND_WEDDING_PROMISE - - is_shown = { - scope:puppet_or_actor = { #Can organize a Grand Wedding - highest_held_title_tier > tier_barony - is_landed_or_landless_administrative_or_theocratic = yes - trigger_if = { - limit = { - is_ai = yes - } - is_at_war = no - } - # DLC locked - has_dlc_feature = tours_and_tournaments - has_dlc_feature = advanced_activities - } - } - - current_description = { - desc = "GRAND_WEDDING_PROMISE_INFO" - } - - is_valid = { - scope:puppet_or_actor = { - gold >= real_wedding_cost_actor_scope - is_available = yes - custom_tooltip = { - text = grand_wedding_already_promised_tt - NOR = { - AND = { - has_variable = promised_grand_wedding_marriage_countdown - var:promised_grand_wedding_marriage_countdown = { is_alive = yes } - } - has_variable = grand_wedding_promise_pending - } - } - } - custom_tooltip = { - text = grand_wedding_only_dominant_side - trigger_if = { - limit = { - scope:secondary_actor ?= { - is_female = yes - } - } - OR = { - scope:secondary_actor ?= { matrilinear_betrothal = yes } - scope:matrilineal = yes - } - } - trigger_else = { - NOR = { - scope:secondary_actor ?= { matrilinear_betrothal = yes } - scope:matrilineal = yes - } - } - } - custom_tooltip = { - text = grand_wedding_only_family - scope:secondary_actor ?= { - is_close_or_extended_family_of = scope:puppet_or_actor - } - } - } - } - - send_option = { - flag = matrilineal - localization = "MATRILINEAL_OFFER" - is_shown = { - NAND = { - scope:secondary_actor ?= { is_male = yes } - scope:secondary_recipient ?= { is_male = yes } - } - } - starts_enabled = { - scope:puppet_or_actor = { - OR = { - rite = { - rite_has_doctrine = doctrine_gender_female_dominated - } - AND = { - scope:secondary_actor ?= { is_female = yes } - rite = { rite_has_doctrine = doctrine_gender_equal } - } - AND = { - scope:secondary_actor ?= this - is_female = yes - is_ai = no - } - AND = { - scope:secondary_actor ?= { is_female = yes } - scope:secondary_recipient ?= { is_female = yes } - } - } - } - } - # so they can use grand wedding... - can_be_changed = { - NAND = { - scope:secondary_actor ?= { is_female = yes } - scope:secondary_recipient ?= { is_female = yes } - } - } - } - - send_option = { - is_valid = { - scope:puppet_or_actor = { - has_usable_hook = scope:recipient - } - } - flag = hook - localization = MARRIAGE_HOOK - } - #This option cannot be linked with the hook icon, because recipient isn't known in the right-click menu - - send_option = { # EP3 Influence - is_shown = { # Actor must have a government that uses influence - scope:puppet_or_actor = { - government_has_flag = government_has_influence - } - } - is_valid = { - # Actor has enough influence - scope:puppet_or_actor = { influence >= medium_influence_value } - # Both characters are within the same top realm - custom_tooltip = { - text = not_same_realm_tt - scope:recipient.top_liege = scope:puppet_or_actor.top_liege - } - } - flag = influence_send_option - localization = TRADE_INFLUENCE_FOR_BETTER_AI_ACCEPTANCE - } - send_option = { # MPO Herd - is_shown = { # Actor must have a government that uses Herd - scope:puppet_or_actor = { - government_has_flag = government_is_nomadic - is_ai = no - } - # Recipient must care about Herd - scope:recipient = { - government_has_flag = government_is_nomadic - } - } - is_valid = { - # Actor has enough Herd - scope:puppet_or_actor = { domicile.herd >= domicile.medium_herd_value } - } - flag = herd_send_option - localization = TRADE_HERD_FOR_BETTER_AI_ACCEPTANCE - } - - send_options_exclusive = no - - show_effects_in_notification = no - greeting = positive - - notification_text = { - first_valid = { - triggered_desc = { - trigger = { - scope:secondary_actor = { - is_adult = yes - } - scope:secondary_recipient = { - is_adult = yes - } - NOR = { - scope:secondary_actor = { has_been_promised_grand_wedding = yes } - scope:secondary_recipient = { has_been_promised_grand_wedding = yes } - } - } - desc = { - first_valid = { - triggered_desc = { - trigger = { - scope:matrilineal = yes - scope:secondary_actor = scope:puppet_or_actor - scope:secondary_recipient = scope:recipient - } - desc = MARRIAGE_NOTIFICATION_BOTH_PERSONAL_MATRI - } - triggered_desc = { - trigger = { - scope:matrilineal = yes - scope:secondary_actor = scope:puppet_or_actor - } - desc = MARRIAGE_NOTIFICATION_ACTOR_PERSONAL_MATRI - } - triggered_desc = { - trigger = { - scope:matrilineal = yes - scope:secondary_recipient = scope:recipient - } - desc = MARRIAGE_NOTIFICATION_RECIPIENT_PERSONAL_MATRI - } - triggered_desc = { - trigger = { - scope:matrilineal = yes - } - desc = MARRIAGE_NOTIFICATION_MATRI - } - triggered_desc = { - trigger = { - scope:secondary_actor = scope:puppet_or_actor - scope:secondary_recipient = scope:recipient - } - desc = MARRIAGE_NOTIFICATION_BOTH_PERSONAL - } - triggered_desc = { - trigger = { - scope:secondary_actor = scope:puppet_or_actor - } - desc = MARRIAGE_NOTIFICATION_ACTOR_PERSONAL - } - triggered_desc = { - trigger = { - scope:secondary_recipient = scope:recipient - } - desc = MARRIAGE_NOTIFICATION_RECIPIENT_PERSONAL - } - desc = MARRIAGE_NOTIFICATION - } - } - } - desc = { - first_valid = { - triggered_desc = { - trigger = { - scope:matrilineal = yes - scope:secondary_actor = scope:puppet_or_actor - scope:secondary_recipient = scope:recipient - } - desc = BETROTHAL_NOTIFICATION_BOTH_PERSONAL_MATRI - } - triggered_desc = { - trigger = { - scope:matrilineal = yes - scope:secondary_actor = scope:puppet_or_actor - } - desc = BETROTHAL_NOTIFICATION_ACTOR_PERSONAL_MATRI - } - triggered_desc = { - trigger = { - scope:matrilineal = yes - scope:secondary_recipient = scope:recipient - } - desc = BETROTHAL_NOTIFICATION_RECIPIENT_PERSONAL_MATRI - } - triggered_desc = { - trigger = { - scope:matrilineal = yes - } - desc = BETROTHAL_NOTIFICATION_MATRI - } - triggered_desc = { - trigger = { - scope:secondary_actor = scope:puppet_or_actor - scope:secondary_recipient = scope:recipient - } - desc = BETROTHAL_NOTIFICATION_BOTH_PERSONAL - } - triggered_desc = { - trigger = { - scope:secondary_actor = scope:puppet_or_actor - } - desc = BETROTHAL_NOTIFICATION_ACTOR_PERSONAL - } - triggered_desc = { - trigger = { - scope:secondary_recipient = scope:recipient - } - desc = BETROTHAL_NOTIFICATION_RECIPIENT_PERSONAL - } - desc = BETROTHAL_NOTIFICATION - } - } - } - } -} - -break_betrothal_interaction = { - category = interaction_category_diplomacy - special_interaction = break_betrothal_interaction - use_diplomatic_range = no - icon = icon_marriage - interface_priority = 30 - - is_shown = { - OR = { - #Actor breaking their betrothal to recipient or recipient's courtier/vassal child - scope:puppet_or_actor.betrothed ?= { - break_betrothal_valid_target_trigger = { CHARACTER = scope:recipient } - } - - #Actor breaking the betrothal of their courtier/vassal child - scope:recipient = { - break_betrothal_valid_target_trigger = { CHARACTER = scope:puppet_or_actor } - } - - #Break recipient's betrothal with actor, or actor's vassal child/courtier - scope:recipient.betrothed ?= { - break_betrothal_valid_target_trigger = { CHARACTER = scope:puppet_or_actor } - } - } - } - - populate_actor_list = { - # breaking your own betrothal to recipient or their courtier or unplayable child - if = { - limit = { - betrothed ?= { - break_betrothal_valid_target_trigger = { CHARACTER = scope:recipient } - } - } - add_to_list = characters - } - scope:recipient = { - if = { - limit = { - betrothed ?= { - is_ai = yes - break_betrothal_valid_target_trigger = { CHARACTER = scope:puppet_or_actor } - } - } - add_to_list = characters - } - } - every_courtier = { - limit = { - is_ai = yes - is_betrothed = yes - betrothed ?= { - break_betrothal_valid_target_trigger = { CHARACTER = scope:recipient } - } - OR = { - is_playable_character = no - any_parent = { this = scope:puppet_or_actor } - } - } - add_to_list = characters - } - } - - redirect = { - # secondary_actor is the one under actor's control, could be actor - if = { - limit = { - scope:puppet_or_actor.betrothed ?= { - break_betrothal_valid_target_trigger = { CHARACTER = scope:recipient } - } - } - scope:puppet_or_actor = { save_scope_as = secondary_actor } - } - else_if = { - limit = { - scope:recipient = { - break_betrothal_valid_target_trigger = { CHARACTER = scope:puppet_or_actor } - } - } - scope:recipient = { save_scope_as = secondary_actor } - } - else = { - scope:recipient.betrothed ?= { save_scope_as = secondary_actor } - } - } - - is_valid_showing_failures_only = { - scope:recipient = { NOT = { has_strong_hook = scope:puppet_or_actor } } - # Recipient is the betrothed - custom_description = { - text = break_betrothal_hook_used - object = scope:recipient - trigger_if = { - limit = { - scope:recipient.betrothed ?= { - break_betrothal_valid_target_trigger = { CHARACTER = scope:puppet_or_actor } - } - exists = scope:recipient.var:hook_used_for_betrothal - } - scope:recipient.var:hook_used_for_betrothal = { - this != scope:recipient.betrothed - } - } - } - - custom_description = { - text = break_betrothal_hook_used - object = scope:recipient - trigger_if = { - limit = { - scope:recipient.betrothed ?= { - break_betrothal_valid_target_trigger = { CHARACTER = scope:puppet_or_actor } - } - exists = scope:recipient.betrothed.var:hook_used_for_betrothal - } - scope:recipient.betrothed.var:hook_used_for_betrothal = { - this != scope:recipient - } - } - } - - # Secondary Recipient is the betrothed - custom_description = { - text = break_betrothal_hook_used - object = scope:recipient - trigger_if = { - limit = { - scope:recipient = { - OR = { - #Check for courtiers - any_courtier = { - is_betrothed = yes - betrothed = scope:puppet_or_actor - liege = scope:recipient - var:hook_used_for_betrothal ?= { - this = scope:puppet_or_actor - } - } - #Check for vassal children - any_child = { - is_betrothed = yes - betrothed = scope:puppet_or_actor - OR = { - is_playable_character = no - target_is_liege_or_above = scope:recipient - } - NOT = { - matchmaker = { - is_parent_of = prev - this != scope:puppet_or_actor - } - } - var:hook_used_for_betrothal ?= { - this = scope:puppet_or_actor - } - } - } - } - } - always = no - } - } - - # Secondary Actor and Recipient were promised a Grand Wedding, and the Activity has already been organized and is ongoing - custom_description = { - text = break_betrothal_gwedding_ongoing - trigger_if = { - limit = { - OR = { - scope:recipient = { has_been_promised_grand_wedding = yes } - scope:recipient.betrothed ?= { has_been_promised_grand_wedding = yes } - } - } - NOR = { - scope:recipient.involved_activity ?= { - has_activity_type = activity_wedding - OR = { - special_guest:spouse_1 ?= scope:recipient - special_guest:spouse_2 ?= scope:recipient - special_guest:spouse_1 ?= scope:recipient.betrothed - special_guest:spouse_2 ?= scope:recipient.betrothed - } - } - scope:recipient.betrothed.involved_activity ?= { - has_activity_type = activity_wedding - OR = { - special_guest:spouse_1 ?= scope:recipient - special_guest:spouse_2 ?= scope:recipient - special_guest:spouse_1 ?= scope:recipient.betrothed - special_guest:spouse_2 ?= scope:recipient.betrothed - } - } - } - } - } - } - - on_accept = { - #Identifies the "injured party" - # rejected_betrothed NEVER actor - scope:secondary_actor = { - save_scope_as = rejecting_betrothed - betrothed = { save_scope_as = rejected_betrothed } - } - - # If it was a Grand Wedding, find the host - scope:rejecting_betrothed.var:promised_grand_wedding_by ?= { - save_scope_as = promising_host - } - - scope:recipient = { trigger_event = marriage_interaction.0020 } - - #Tooltip for betrothal breakage - show_as_tooltip = { - scope:rejected_betrothed = { - break_betrothal = scope:rejecting_betrothed - } - } - - #Figures out if the liege of rejected_betrothed cares - scope:rejected_betrothed = { - if = { - limit = { #The liege matter when assigning prestige/opinion hits - matchmaker = { - this != scope:rejected_betrothed - is_close_or_extended_family_of = scope:rejected_betrothed - } - } - - matchmaker = { save_scope_as = rejected_betrothal_owner } - } - - else = { #The liege doesn't matter, only the betrothed - save_scope_as = rejected_betrothal_owner - } - } - - if = { - limit = { #Only if you had no reason to break the betrothal - has_proper_reason_to_break_betrothal_trigger = no - NOR = { - # Prestige loss for Grand Weddings is handled below in the specific effect - scope:rejecting_betrothed = { has_been_promised_grand_wedding = yes } - scope:rejected_betrothed = { has_been_promised_grand_wedding = yes } - } - } - #Prestige penalty - if = { - limit = { - OR = { - scope:rejected_betrothed = { highest_held_title_tier > tier_empire } - scope:rejected_betrothal_owner = { highest_held_title_tier > tier_empire } - } - #Only applied for relevant characters - cost_prestige_for_break_betrothal_trigger = yes - } - scope:puppet_or_actor = { add_prestige = monumental_prestige_loss } - } - - else_if = { - limit = { - OR = { - scope:rejected_betrothed = { highest_held_title_tier = tier_empire } - scope:rejected_betrothal_owner = { highest_held_title_tier = tier_empire } - } - #Only applied for relevant characters - cost_prestige_for_break_betrothal_trigger = yes - } - scope:puppet_or_actor = { add_prestige = massive_prestige_loss } - } - - else_if = { - limit = { - OR = { - scope:rejected_betrothed = { highest_held_title_tier = tier_kingdom } - scope:rejected_betrothal_owner = { highest_held_title_tier = tier_kingdom } - } - #Only applied for relevant characters - cost_prestige_for_break_betrothal_trigger = yes - } - scope:puppet_or_actor = { add_prestige = major_prestige_loss } - } - - else_if = { - limit = { - OR = { - scope:rejected_betrothed = { highest_held_title_tier = tier_duchy } - scope:rejected_betrothal_owner = { highest_held_title_tier = tier_duchy } - } - #Only applied for relevant characters - cost_prestige_for_break_betrothal_trigger = yes - } - scope:puppet_or_actor = { add_prestige = medium_prestige_loss } - } - - else_if = { - limit = { - OR = { - scope:rejected_betrothed = { highest_held_title_tier = tier_county } - scope:rejected_betrothal_owner = { highest_held_title_tier = tier_county } - } - #Only applied for relevant characters - cost_prestige_for_break_betrothal_trigger = yes - } - scope:puppet_or_actor = { add_prestige = minor_prestige_loss } - } - - else_if = { - limit = { - OR = { - scope:rejected_betrothed = { highest_held_title_tier = tier_barony } - scope:rejected_betrothal_owner = { highest_held_title_tier = tier_barony } - } - #Only applied for relevant characters - cost_prestige_for_break_betrothal_trigger = yes - } - scope:puppet_or_actor = { add_prestige = miniscule_prestige_loss } - } - } - - ############################################ - # EP2 - Breaking a Grand Wedding Betrothal # - ############################################ - if = { - limit = { - # There is no forced reason for breaking the betrothal - has_proper_reason_to_break_betrothal_trigger = no - # A Grand Wedding was promised - OR = { - scope:rejecting_betrothed = { - has_been_promised_grand_wedding = yes - } - scope:rejected_betrothed = { - has_been_promised_grand_wedding = yes - } - } - } - scope:puppet_or_actor = { break_grand_wedding_betrothal_effect = yes } - } - - ###################################### - # Opinion hits & notification events # - ###################################### - #Personal opinion hit for the rejected_betrothed - else = { - if = { - limit = { - has_proper_reason_to_break_betrothal_trigger = no - } - scope:rejected_betrothed = { - show_as_tooltip = { - add_opinion = { - target = scope:puppet_or_actor - modifier = broke_betrothal_opinion - } - } - } - if = { - limit = { - scope:puppet_or_actor != scope:rejected_betrothal_owner - scope:rejected_betrothal_owner != scope:rejected_betrothed - } - scope:rejected_betrothal_owner = { - show_as_tooltip = { - add_opinion = { - target = scope:puppet_or_actor - modifier = broke_betrothal_opinion - } - } - } - } - } - if = { - limit = { - scope:puppet_or_actor != scope:rejected_betrothal_owner - } - scope:rejected_betrothal_owner = { trigger_event = marriage_interaction.0001 } - } - else = { - hidden_effect = { - scope:rejecting_betrothed = { - break_betrothal = scope:rejected_betrothed - } - } - } - } - - #Personal opinion hit for other relative - if = { - limit = { - has_proper_reason_to_break_betrothal_trigger = no - } - #Opinion hit for close relatives of the rejected_betrothed (that are not rejected_betrothed_owner) - if = { - limit = { - scope:rejected_betrothed != scope:puppet_or_actor - scope:rejected_betrothed = { - any_close_or_extended_family_member = { - this != scope:rejected_betrothal_owner - count >= 1 - } - } - } - if = { - limit = { - OR = { - scope:rejected_betrothed = { has_been_promised_grand_wedding = yes } - scope:rejecting_betrothed = { has_been_promised_grand_wedding = yes } - } - } - scope:rejected_betrothed = { - every_close_or_extended_family_member = { - limit = { - this != scope:rejected_betrothal_owner - } - custom = all_family_members - - add_opinion = { - target = scope:puppet_or_actor - modifier = broke_betrothal_grand_wedding_opinion - opinion = -50 - } - } - } - } - else = { - scope:rejected_betrothed = { - every_close_or_extended_family_member = { - limit = { - this != scope:rejected_betrothal_owner - } - custom = all_family_members - add_opinion = { - target = scope:puppet_or_actor - modifier = broke_betrothal_opinion - } - } - } - } - } - - #Opinion hit for close relatives of the rejecting_betrothed (that are not also close relatives to rejected_betrothed) - if = { - limit = { - scope:rejecting_betrothed != scope:puppet_or_actor - scope:rejected_betrothed != scope:puppet_or_actor - scope:rejecting_betrothed = { - any_close_or_extended_family_member = { - NOR = { - is_close_or_extended_family_of = scope:rejected_betrothed - this = scope:rejected_betrothal_owner - this = scope:rejected_betrothed - } - count >= 1 - } - } - } - if = { - limit = { - OR = { - scope:rejected_betrothed = { has_been_promised_grand_wedding = yes } - scope:rejecting_betrothed = { has_been_promised_grand_wedding = yes } - } - } - scope:rejecting_betrothed = { - every_close_or_extended_family_member = { - limit = { - NOR = { - is_close_or_extended_family_of = scope:rejected_betrothed - this = scope:rejected_betrothal_owner - this = scope:rejected_betrothed - this = scope:puppet_or_actor - } - } - custom = all_family_members - add_opinion = { - target = scope:puppet_or_actor - modifier = broke_betrothal_grand_wedding_opinion - opinion = -50 - } - } - } - } - else = { - scope:rejecting_betrothed = { - every_close_or_extended_family_member = { - limit = { - NOR = { - is_close_or_extended_family_of = scope:rejected_betrothed - this = scope:rejected_betrothal_owner - this = scope:rejected_betrothed - this = scope:puppet_or_actor - } - } - custom = all_family_members - add_opinion = { - target = scope:puppet_or_actor - modifier = broke_betrothal_opinion - } - } - } - } - } - } - - scope:puppet_or_actor = { - # Was the marriage of relevence to the player? - if = { - limit = { - scope:rejecting_betrothed = { - is_child_of = scope:puppet_or_actor - } - } - hidden_effect = { - send_interface_toast = { - type = msg_break_betrothal_player_heir - title = msg_break_betrothal_player_heir - left_icon = scope:rejecting_betrothed - right_icon = scope:rejected_betrothed - custom_tooltip = break_betrothal_hook_toast_desc - } - } - } - else_if = { - limit = { - scope:puppet_or_actor != scope:rejecting_betrothed - } - hidden_effect = { - send_interface_message = { - type = msg_break_betrothal - title = msg_break_betrothal - left_icon = scope:rejecting_betrothed - right_icon = scope:rejected_betrothed - custom_tooltip = break_betrothal_hook_toast_desc - } - } - } - - #Was the marriage promised to a vassal? - if = { - limit = { - var:promised_to_marry_1 ?= { - this = scope:rejected_betrothed - any_parent = { - is_vassal_of = scope:puppet_or_actor - } - } - var:promised_to_marry_2 ?= { - this = scope:rejecting_betrothed - is_close_family_of = scope:puppet_or_actor - } - } - remove_variable = promised_to_marry_1 - remove_variable = promised_to_marry_2 - trigger_event = clan.1002 - } - } - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:puppet_or_actor - TARGET = scope:recipient - VALUE = major_unity_loss - DESC = clan_unity_betrothal_breakage.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - auto_accept = yes -} - -# Stripped down version of make_concubine_interaction for the AI -# Avoids redirection logic and recipient list building to improve performance -ai_make_concubine_interaction = { - hidden = yes - - ai_targets = { - ai_recipients = prisoners - } - ai_targets = { - ai_recipients = courtiers - max = 10 - } - ai_target_quick_trigger = { - adult = yes - owner_attracted = yes # Not optimal, but saves a lot of performance - } - ai_frequency_by_tier = { - barony = 0 - county = 60 - duchy = 12 - kingdom = 12 - empire = 12 - hegemony = 3 - } - - is_available = { - trigger_if = { - limit = { is_ai = yes } - allowed_more_concubines = yes - is_playable_character = yes - NOR = { - has_trait = chaste - has_sexuality = asexual - has_trait = celibate - } - fertility > 0 - is_adult = yes - } - } - - is_shown = { - make_concubine_is_shown_trigger = yes - } - - is_valid_showing_failures_only = { - make_concubine_is_valid_trigger = yes - } - - auto_accept = yes - - ai_will_do = { - base = 0 - - modifier = { # Basic Filtering - add = 100 - scope:actor = { - number_of_concubines < number_of_desired_concubines - } - scope:recipient = { - can_have_children_with = { CHARACTER = scope:actor } # Only if you can have kids since this is about fertility and genetic traits - fertility > 0.2 - is_young_character = yes - } - } - - modifier = { - add = 100 - scope:recipient = { - is_imprisoned_by = scope:actor - can_have_children_with = { CHARACTER = scope:actor } # Only if you can have kids since this is about fertility and genetic traits - OR = { - is_lowborn = no - num_of_good_genetic_traits > 0 - } - fertility > 0.1 - trigger_if = { - limit = { - is_female = yes - } - is_aging_character = no - } - } - } - - modifier = { - add = 100 - scope:actor = { - allowed_to_marry_same_sex_trigger = yes - sex_same_as = scope:recipient - is_attracted_to_gender_of = scope:recipient - OR = { #If they're not in need of kids, or someone who they can have kids with - any_child = { - count >= 2 - } - any_consort = { - can_have_children_with = { CHARACTER = scope:actor } - fertility > 0.1 - } - } - } - } - - modifier = { #Even if you're allowed to take same-sex concubines we don't want the AI to do so without a good reason if they're not attracted to the person - add = -200 - scope:actor = { - allowed_to_marry_same_sex_trigger = yes - sex_same_as = scope:recipient - NOT = { is_attracted_to_gender_of = scope:recipient } - } - } - - modifier = { # If they don't have a batch of kids and opposite sex consorts to handle that situation - add = -200 - scope:actor = { - allowed_to_marry_same_sex_trigger = yes - sex_same_as = scope:recipient - NOT = { - any_child = { - count >= 2 - } - } - NOT = { - any_consort = { - can_have_children_with = { CHARACTER = scope:actor } - fertility > 0.1 - } - } - } - } - - # Unity modifiers - evaluate_action_increasing_house_unity = { - VALUE = 100 - } - - modifier = { # Incest Filtering: Hard NO! - factor = 0 - scope:actor = { - relation_with_character_is_incestuous_in_my_rite_trigger = { CHARACTER = scope:recipient } - NOR = { - accepts_incest_with_trigger = { CHARACTER = scope:recipient } - sexually_liberal_trigger = yes - AND = { - primary_heir ?= { dynasty != root.dynasty } - NOT = { - primary_title = { - any_title_heir = { dynasty = root.dynasty } - } - } - } - } - } - } - - modifier = { # Incest Filtering: Not likely, but keep the door open... - factor = 0.2 - scope:actor = { - relation_with_character_is_incestuous_in_my_rite_trigger = { CHARACTER = scope:recipient } - OR = { - accepts_incest_with_trigger = { CHARACTER = scope:recipient } - sexually_liberal_trigger = yes - AND = { - primary_heir ?= { dynasty != root.dynasty } - NOT = { - primary_title = { - any_title_heir = { dynasty = root.dynasty } - } - } - } - } - } - } - - modifier = { # Less likely if married to a player and the target is the player heir - factor = 0.4 - scope:actor = { - any_spouse = { - is_ai = no - scope:recipient = { - OR = { - is_primary_heir_of = prev - is_heir_of = prev - } - } - } - } - } - } - - on_accept = { - scope:actor = { - save_scope_as = secondary_actor - } - scope:recipient = { - save_scope_as = secondary_recipient - } - concubine_on_accept_effect = yes - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = minor_unity_gain - DESC = clan_unity_concubinage.desc - REVERSE_NON_HOUSE_TARGET = no - } - } -} - -make_concubine_interaction = { - category = interaction_category_diplomacy - icon = concubine_icon - - desc = make_concubine_interaction_desc - - interface = concubine_list - - redirect = { - # The UI will open to the already filled left and right first if we don't tell it we've got both sides filled - scope:puppet_or_actor = { - save_scope_as = secondary_actor - } - scope:recipient = { - save_scope_as = secondary_recipient - } - } - - populate_recipient_list = { - scope:puppet_or_actor = { - every_courtier = { - limit = { - can_become_concubine_of_character_trigger = { CHARACTER = scope:puppet_or_actor } - } - add_to_list = characters - } - every_prisoner = { - limit = { - NOT = { is_in_list = characters } - can_become_concubine_of_character_trigger = { CHARACTER = scope:puppet_or_actor } - } - add_to_list = characters - } - } - } - - is_shown = { - make_concubine_is_shown_trigger = yes - } - - is_valid_showing_failures_only = { - make_concubine_is_valid_trigger = yes - } - - auto_accept = yes - - on_accept = { - scope:puppet_or_actor = { - save_scope_as = secondary_actor - } - concubine_on_accept_effect = yes - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:puppet_or_actor - TARGET = scope:recipient - VALUE = minor_unity_gain - DESC = clan_unity_concubinage.desc - REVERSE_NON_HOUSE_TARGET = no - } - } -} - -find_concubine = { - category = interaction_category_diplomacy - icon = concubine_icon - - desc = find_concubine_desc - - interface = concubine_list - - needs_recipient_to_open = no - - redirect = { - scope:puppet_or_actor = { # The UI will open to the already filled left first if we don't tell it we've got "our side" actor which is always ourselves - save_scope_as = secondary_actor - } - if = { - limit = { - # This is needed for the UI to function properly. Initially UI opens with player as both actor and recipient - # After UI opens with empty recipient, player can click on a candidate - # When candidate is selected both primary and secondary recipient must be set for the interaction to work - scope:puppet_or_actor != scope:recipient - } - scope:recipient = { - save_scope_as = secondary_recipient - } - } - } - - populate_recipient_list = { - scope:puppet_or_actor = { - every_courtier = { - limit = { - can_become_concubine_of_character_trigger = { CHARACTER = scope:puppet_or_actor } - } - add_to_list = characters - } - every_prisoner = { - limit = { - NOT = { is_in_list = characters } - can_become_concubine_of_character_trigger = { CHARACTER = scope:puppet_or_actor } - } - add_to_list = characters - } - } - } - - is_shown = { - scope:puppet_or_actor ?= { - allowed_concubines = yes - is_adult = yes - trigger_if = { #So that we show the recipient list, but can also only use this on ourselves, we have to do this check in the beginning - limit = { - NOT = { exists = scope:secondary_recipient } - } - scope:puppet_or_actor = scope:recipient - } - } - trigger_if = { - limit = { - scope:puppet_or_actor != scope:recipient - } - scope:puppet_or_actor ?= { - trigger_if = { - limit = { - allowed_to_marry_same_sex_trigger = no - } - sex_opposite_of = scope:recipient - } - NOT = { relation_with_character_is_incestuous_in_my_rite_trigger = { CHARACTER = scope:recipient } } - } - scope:recipient = { - can_become_concubine_of_character_trigger = { CHARACTER = scope:puppet_or_actor } - is_adult = yes - OR = { - is_imprisoned_by = scope:puppet_or_actor - is_courtier_of = scope:puppet_or_actor - } - } - } - } - - is_valid_showing_failures_only = { - custom_description = { - text = take_concubine_allowed_more - object = scope:recipient - scope:puppet_or_actor = { - allowed_more_concubines = yes - } - } - custom_description = { - text = take_concubine_available_character_opp - object = scope:puppet_or_actor - scope:puppet_or_actor = { - OR = { - any_courtier = { - can_become_concubine_of_character_trigger = { CHARACTER = scope:puppet_or_actor } - } - any_prisoner = { - can_become_concubine_of_character_trigger = { CHARACTER = scope:puppet_or_actor } - } - } - } - } - trigger_if = { - limit = { - scope:puppet_or_actor != scope:recipient - } - scope:recipient = { - can_become_concubine_of_character_trigger = { CHARACTER = scope:puppet_or_actor } - } - } - } - - can_be_picked = { - is_adult = yes - } - - auto_accept = yes - - ai_will_do = { - base = 0 - } - - on_accept = { - concubine_on_accept_effect = yes - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:puppet_or_actor - TARGET = scope:recipient - VALUE = minor_unity_gain - DESC = clan_unity_concubinage.desc - REVERSE_NON_HOUSE_TARGET = no - } - } -} - -offer_concubine = { - category = interaction_category_diplomacy - icon = concubine_icon - - desc = offer_concubine_desc - - ai_targets = { - ai_recipients = neighboring_rulers - ai_recipients = suzerain - ai_recipients = liege - max = 5 - } - ai_target_quick_trigger = { - adult = yes - } - ai_frequency_by_tier = { - barony = 0 - county = 36 - duchy = 36 - kingdom = 0 - empire = 0 - hegemony = 0 - } - - greeting = positive - notification_text = OFFER_CONCUBINE_NOTIFICATION - - #interface = concubine_list - - populate_recipient_list = { - scope:puppet_or_actor = { - every_courtier = { - limit = { - can_be_offered_as_concubine_to_character_trigger = { - GIVER = scope:puppet_or_actor - CHARACTER = scope:recipient - } - } - add_to_list = characters - } - every_prisoner = { - limit = { - NOT = { is_in_list = characters } - can_be_offered_as_concubine_to_character_trigger = { - GIVER = scope:puppet_or_actor - CHARACTER = scope:recipient - } - } - add_to_list = characters - } - } - } - - is_available = { - trigger_if = { - limit = { is_ai = yes } - allowed_concubines = yes - NOR = { - has_trait = greedy - ai_greed > very_high_positive_ai_value - } - is_adult = yes - is_at_war = no - is_incapable = no - } - } - - is_shown = { - scope:puppet_or_actor != scope:recipient - scope:recipient = { - NOT = { government_has_flag = government_is_herder } - allowed_concubines = yes - is_adult = yes - } - } - - is_valid_showing_failures_only = { - custom_description = { - text = take_concubine_available_character_opp - object = scope:recipient - scope:puppet_or_actor = { - OR = { - any_courtier = { - can_be_offered_as_concubine_to_character_trigger = { - GIVER = scope:puppet_or_actor - CHARACTER = scope:recipient - } - } - any_prisoner = { - can_be_offered_as_concubine_to_character_trigger = { - GIVER = scope:puppet_or_actor - CHARACTER = scope:recipient - } - } - } - } - } - custom_description = { - text = take_concubine_allowed_more - object = scope:recipient - scope:recipient = { - allowed_more_concubines = yes - } - } - - trigger_if = { #Landless adventurers check range - limit = { - scope:puppet_or_actor = { - is_landless_adventurer = yes - } - } - ep3_laamp_diplo_range_trigger = { - TARGET = scope:recipient - LAAMP = scope:puppet_or_actor - } - } - } - - can_be_picked = { - is_adult = yes - } - - can_send = { - custom_description = { - text = character_unavailable_to_be_offered_as_concubine - object = scope:secondary_recipient - scope:secondary_recipient = { - can_be_offered_as_concubine_to_character_trigger = { - GIVER = scope:puppet_or_actor - CHARACTER = scope:recipient - } - } - } - } - - auto_accept = no - - ai_accept = { - base = 50 - - modifier = { - add = { - value = 50 - multiply = scope:secondary_recipient.num_of_good_genetic_traits - } - scope:secondary_recipient = { - num_of_good_genetic_traits > 0 - trigger_if = { - limit = { - is_female = yes - } - is_aging_character = no - } - } - desc = AI_POSITIVE_TRAIT_REASON - } - - modifier = { - add = { - value = 50 - } - scope:secondary_recipient = { - is_lowborn = no - trigger_if = { - limit = { - is_female = yes - } - is_aging_character = no - } - } - desc = AI_DYNASTY_PRESTIGE_REASON_NOBLE - } - - modifier = { - add = { - value = -50 - multiply = scope:secondary_recipient.num_of_bad_genetic_traits - } - scope:secondary_recipient = { - num_of_bad_genetic_traits > 0 - - trigger_if = { - limit = { - is_female = yes - } - is_aging_character = no - } - } - desc = AI_NEGATIVE_TRAIT_REASON - } - - modifier = { - add = { - value = -50 - } - scope:secondary_recipient = { - is_lowborn = yes - num_of_good_genetic_traits = 0 - trigger_if = { - limit = { - is_female = yes - } - is_aging_character = no - } - } - desc = AI_DYNASTY_PRESTIGE_REASON_LOWBORN_NO_POSITIVE_TRAIT - } - - opinion_modifier = { # Opinion of you - who = scope:recipient - opinion_target = scope:puppet_or_actor - multiplier = 1.0 - desc = AI_OPINION_REASON - } - - opinion_modifier = { # Opinion of concubine - who = scope:recipient - opinion_target = scope:secondary_recipient - multiplier = 0.25 - desc = AI_OPINION_REASON - } - - compare_modifier = { # Recipient is reluctant to marry old women (procreation is a key factor) - trigger = { - scope:secondary_recipient = { - is_young_character = no - is_female = yes - } - } - target = scope:secondary_recipient - value = age - multiplier = -5.0 - step = 1 - offset = -29 - desc = MARRY_AGE - } - - modifier = { # A Recipient is unwilling to take a same-sex concubine if their faith doesn't support it - add = -1000 - - scope:recipient = { - allowed_to_marry_same_sex_trigger = no - sex_same_as = scope:secondary_recipient - } - desc = SAME_SEX_MARRIAGE_FAITH_REASON_RECIPIENT - } - - modifier = { # Unwilling if they don't have a batch of kids and opposite sex consorts to handle that situation - add = -200 - scope:recipient = { - allowed_to_marry_same_sex_trigger = yes - sex_same_as = scope:secondary_recipient - trigger_if = { - limit = { - NOT = { - any_consort = { - can_have_children_with = { CHARACTER = scope:recipient } - fertility > 0.1 - } - } - } - any_child = { is_player_heir_of = root } - } - trigger_else = { - always = no - } - } - desc = AI_NO_FERTILITY_REASON - } - - modifier = { - add = 50 - scope:recipient = { - is_attracted_to_gender_of = scope:secondary_recipient - } - desc = AI_ATTRACTION_REASON - } - - modifier = { # A Recipient is more likely to agree if you're their liege - add = 40 - scope:puppet_or_actor = { is_landed = yes } - scope:recipient = { - is_landed = yes - target_is_liege_or_above = scope:puppet_or_actor - } - desc = LIEGE_REASON - } - - #More/Less likely based on difference in rank between actor and recipient - modifier = { - add = 20 - scope:puppet_or_actor = { - tier_difference = { - target = scope:recipient - value = 1 - } - } - desc = AI_RANK_DIFF - } - modifier = { - add = 30 - scope:puppet_or_actor = { - tier_difference = { - target = scope:recipient - value = 2 - } - } - desc = AI_RANK_DIFF - } - modifier = { - add = 40 - scope:puppet_or_actor = { - tier_difference = { - target = scope:recipient - value = 3 - } - } - desc = AI_RANK_DIFF - } - modifier = { - add = 50 - scope:puppet_or_actor = { - tier_difference = { - target = scope:recipient - value = 4 - } - } - desc = AI_RANK_DIFF - } - modifier = { - add = 60 - scope:puppet_or_actor = { - tier_difference = { - target = scope:recipient - value = 5 - } - } - desc = AI_RANK_DIFF - } - modifier = { - add = -20 - scope:puppet_or_actor = { - tier_difference = { - target = scope:recipient - value = -1 - } - } - desc = AI_RANK_DIFF - } - modifier = { - add = -30 - scope:puppet_or_actor = { - tier_difference = { - target = scope:recipient - value = -2 - } - } - desc = AI_RANK_DIFF - } - modifier = { - add = -40 - scope:puppet_or_actor = { - tier_difference = { - target = scope:recipient - value = -3 - } - } - desc = AI_RANK_DIFF - } - modifier = { - add = -50 - scope:puppet_or_actor = { - tier_difference = { - target = scope:recipient - value = -4 - } - } - desc = AI_RANK_DIFF - } - modifier = { - add = -60 - scope:puppet_or_actor = { - tier_difference = { - target = scope:recipient - value = -5 - } - } - desc = AI_RANK_DIFF - } - - modifier = { - add = intimidated_reason_value - scope:recipient = { - target_is_liege_or_above = scope:puppet_or_actor - has_dread_level_towards = { - target = scope:puppet_or_actor - level = 1 - } - } - desc = INTIMIDATED_REASON - } - modifier = { - add = cowed_reason_value - scope:recipient = { - target_is_liege_or_above = scope:puppet_or_actor - has_dread_level_towards = { - target = scope:puppet_or_actor - level = 2 - } - } - desc = COWED_REASON - } - - modifier = { - add = intimidated_external_reason_value - scope:recipient = { - NOT = { target_is_liege_or_above = scope:puppet_or_actor } - has_dread_level_towards = { - target = scope:puppet_or_actor - level = 1 - } - } - desc = INTIMIDATED_REASON - } - modifier = { - add = cowed_external_reason_value - scope:recipient = { - NOT = { target_is_liege_or_above = scope:puppet_or_actor } - has_dread_level_towards = { - target = scope:puppet_or_actor - level = 2 - } - } - desc = COWED_REASON - } - modifier = { - add = -250 - scope:secondary_recipient = { - has_std_trigger = yes - } - desc = AI_STD_REASON - } - modifier = { - add = -250 - scope:secondary_recipient = { - has_trait_with_flag = epidemic_disease - } - desc = AI_CONTAGIOUS_REASON - } - modifier = { - add = -5000 - scope:secondary_recipient = { - fertility <= 0 - } - desc = AI_FERTILITY_REASON - } - modifier = { - scope:hook = yes - add = 500 - scope:puppet_or_actor = { NOT = { has_strong_hook = scope:recipient } } - desc = SCHEME_WEAK_HOOK_USED - } - modifier = { - scope:hook = yes - add = 1000 - scope:puppet_or_actor = { has_strong_hook = scope:recipient } - desc = SCHEME_STRONG_HOOK_USED - } - - # Unity modifiers - evaluate_action_increasing_house_unity = { - VALUE = 100 - } - } - - ai_will_do = { - base = 0 - - modifier = { # Basic Filtering - add = 100 - scope:recipient = { - number_of_concubines < number_of_desired_concubines - } - scope:secondary_recipient = { - trigger_if = { - limit = { - allowed_to_marry_same_sex_trigger = no - } - sex_opposite_of = scope:recipient - } - fertility > 0.2 - is_young_character = yes - NOR = { - is_councillor_of = scope:actor - is_of_major_interest_trigger = { - CHARACTER = scope:actor - } - is_concubine_of = scope:actor - } - } - } - - modifier = { # If secondary_recipient is close to actor, a good character, or if actor should take them as concubine - add = -100 - scope:secondary_recipient = { - is_of_minor_interest_trigger = { - CHARACTER = scope:actor - } - AND = { - can_become_concubine_of_character_trigger = { CHARACTER = scope:actor } - scope:actor = { number_of_concubines < number_of_desired_concubines } - } - } - } - - modifier = { # If secondary_recipient could be an agent... - add = 25 - scope:actor = { - any_scheme = { - scheme_target_character ?= scope:recipient - save_temporary_scope_as = scheme_check - } - } - scope:secondary_recipient = { - char_can_fit_into_scheme_trigger = { SCHEME = scope:scheme_check } - } - } - - modifier = { # More likely if it's a neighboring ruler that you want to like you - add = 50 - scope:recipient = { - any_neighboring_top_liege_realm_owner = { this = scope:actor } - max_military_strength > scope:actor.max_military_strength - } - } - - modifier = { # More likely if it's your friend and it's a nice concubine - add = 50 - scope:recipient = { - OR = { - has_relation_friend = scope:actor - has_relation_best_friend = scope:actor - } - } - scope:secondary_recipient = { - fertility > 0.2 - is_young_character = yes - OR = { - has_trait = lustful - num_of_good_genetic_traits > 0 - } - } - } - - modifier = { #Even if they're allowed to take same-sex concubines we don't want the AI to suggest it without a good reason if they're not attracted to the person - add = -200 - scope:recipient = { - allowed_to_marry_same_sex_trigger = yes - sex_same_as = scope:secondary_recipient - NOT = { is_attracted_to_gender_of = scope:secondary_recipient } - } - } - - # Unity modifiers - evaluate_action_increasing_house_unity = { - VALUE = 100 - } - - modifier = { # No if it's a same-sex concubinage and actor isn't accepting of it - factor = 0 - scope:actor = { - allowed_to_marry_same_sex_trigger = no - scope:recipient = { sex_same_as = scope:secondary_recipient } - } - } - - modifier = { # No if it's a same-sex concubinage and recipient isn't accepting of it - factor = 0 - scope:recipient = { - allowed_to_marry_same_sex_trigger = no - sex_same_as = scope:secondary_recipient - } - } - - modifier = { # Age considerations - factor = 0 - scope:recipient = { - OR = { - age >= scope:secondary_actor.age_plus_10 - age <= scope:secondary_actor.age_minus_10 - scope:secondary_actor.age >= 30 # Concubines are meant to be young... - } - } - } - - modifier = { # Incest Filtering: Hard NO! - factor = 0 - scope:recipient = { - relation_with_character_is_incestuous_in_my_rite_trigger = { CHARACTER = scope:secondary_recipient } - NOR = { - accepts_incest_with_trigger = { CHARACTER = scope:secondary_recipient } - sexually_liberal_trigger = yes - } - } - } - - modifier = { # Incest Filtering: Not likely, but keep the door open... - factor = 0.2 - scope:recipient = { - relation_with_character_is_incestuous_in_my_rite_trigger = { CHARACTER = scope:secondary_recipient } - OR = { - accepts_incest_with_trigger = { CHARACTER = scope:secondary_recipient } - sexually_liberal_trigger = yes - } - } - } - - modifier = { # Faith considerations - factor = 0 - scope:recipient = { - faith = { - faith_hostility_level = { - target = scope:actor.faith - value >= faith_hostile_level - } - } - NOR = { - has_relation_friend = scope:actor - has_relation_best_friend = scope:actor - } - } - } - } - - on_send = { - scope:secondary_recipient = { # to block the same character from being offered twice - add_character_flag = { - flag = has_been_offered_as_concubine - days = 5 - } - } - } - - on_accept = { - concubine_offer_on_accept_effect = yes - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:puppet_or_actor - TARGET = scope:recipient - VALUE = minor_unity_gain - DESC = clan_unity_concubinage_offer.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - on_decline = { - scope:puppet_or_actor = { - send_interface_toast = { - type = event_toast_effect_bad - title = msg_concubine_offer_rejected_title - right_icon = scope:recipient - left_icon = scope:secondary_recipient - custom_tooltip = msg_concubine_offer_rejected - } - } - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:puppet_or_actor - TARGET = scope:recipient - VALUE = medium_unity_loss - DESC = clan_unity_concubinage_offer_decline.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - send_options_exclusive = no - send_option = { - is_valid = { - scope:puppet_or_actor = { - has_usable_hook = scope:recipient - } - } - flag = hook - localization = SCHEME_HOOK - } - should_use_extra_icon = { - scope:puppet_or_actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" -} - -dismiss_concubine_interaction = { - category = interaction_category_diplomacy - use_diplomatic_range = no - icon = concubine_icon - - is_shown = { - scope:recipient = { - is_concubine_of = scope:puppet_or_actor - } - } - - is_valid_showing_failures_only = { - scope:recipient = { NOT = { has_strong_hook = scope:puppet_or_actor } } - scope:puppet_or_actor = { - custom_tooltip = { - NOT = { - var:family_widow_forbidden_divorce ?= scope:recipient - } - text = BOUND_TO_FAMILY_WIDOW - } - } - } - - auto_accept = yes - - on_accept = { - scope:puppet_or_actor = { - stress_and_fulfillment_impact = { - compassionate = minor_stress_impact_gain - } - hidden_effect = { - send_interface_toast = { - type = event_toast_effect_neutral - title = msg_concubine_dismissed_title - right_icon = scope:recipient - remove_concubine = scope:recipient - } - } - } - - scope:recipient = { - # No point in sending a notification since the player can't be an unlanded concubine in any case - # trigger_event = marriage_interaction.0050 - - # Being thrown aside is humiliating, even if you didn't want to be a concubine in the first place. - add_opinion = { - modifier = set_me_aside_opinion - target = scope:puppet_or_actor - } - if = { - limit = { scope:puppet_or_actor = { has_relation_lover = scope:recipient } } - lover_breakup_effect = { - BREAKER = scope:puppet_or_actor - LOVER = scope:recipient - } - } - - # Figure out where we should go now that we're no longer a concubine. - if = { - limit = { - is_councillor_of = scope:puppet_or_actor - } - # Then they should remain in court - } - else_if = { #Dismiss to relevant court, or to pool - limit = { - any_close_family_member = { - is_landed_or_landless_administrative_or_theocratic = yes - } - } - random_close_family_member = { - limit = { - is_child_of = scope:recipient - is_landed_or_landless_administrative_or_theocratic = yes - } - alternative_limit = { - is_parent_of = scope:recipient - is_landed_or_landless_administrative_or_theocratic = yes - } - alternative_limit = { - is_landed_or_landless_administrative_or_theocratic = yes - } - add_courtier = scope:recipient - } - } - else = { - move_to_pool = yes - } - } - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:puppet_or_actor - TARGET = scope:recipient - VALUE = medium_unity_loss - DESC = clan_unity_concubinage_dismissal.desc - REVERSE_NON_HOUSE_TARGET = no - } - } -} - -divorce_character_interaction = { - category = interaction_category_diplomacy - use_diplomatic_range = no - icon = icon_marriage - - desc = divorce_character_interaction_desc - cost = { - piety = { - value = divorce_cost - if = { - limit = { scope:is_puppet_action ?= yes } - multiply = 0 - } - } - } - - is_shown = { - # A clerical ruler holds that religious authority themselves, so no approval is sought - trigger_if = { - limit = { - scope:puppet_or_actor ?= { pam_grants_own_divorce_trigger = no } - } - # We are not required to seek approval of a spiritual HoF - NAND = { - scope:puppet_or_actor.rite ?= { rite_has_doctrine = doctrine_divorce_approval } - scope:puppet_or_actor.faith ?= { - has_doctrine = doctrine_spiritual_head - exists = religious_head - } - } - } - # We are not required to seek approval of a house head - NAND = { - scope:puppet_or_actor.rite ?= { rite_has_doctrine = doctrine_divorce_approval } - exists = scope:puppet_or_actor.house - exists = scope:puppet_or_actor.house.house_head - scope:puppet_or_actor = { is_house_head = no } - } - exists = scope:puppet_or_actor - scope:recipient = { - is_spouse_of = scope:puppet_or_actor - is_concubine = no # Can set aside Concubines at any time - } - } - - is_valid_showing_failures_only = { - trigger_if = { - limit = { scope:actor = scope:puppet_or_actor } - custom_tooltip = { - NOT = { - scope:puppet_or_actor.culture = { - has_cultural_parameter = cannot_divorce - } - } - text = CULTURE_FORBIDS_DIVORCE - } - } - trigger_else = { - custom_tooltip = { - NOT = { - scope:puppet_or_actor.culture = { - has_cultural_parameter = cannot_divorce - } - } - text = CULTURE_FORBIDS_DIVORCE_puppeteer - } - } - OR = { - NOT = { - scope:puppet_or_actor.rite = { - rite_has_doctrine = doctrine_divorce_disallowed - } - } - AND = { - scope:puppet_or_actor.rite = { - rite_has_parameter = tenet_be_fruitful_and_multiply_low_fertility_divorce - } - scope:recipient = { fertility < 0.1 } - } - } - scope:recipient = { NOT = { has_strong_hook = scope:puppet_or_actor } } - scope:puppet_or_actor = { - trigger_if = { - limit = { scope:actor = scope:puppet_or_actor } - custom_tooltip = { - NOT = { - var:family_widow_forbidden_divorce ?= scope:recipient - } - text = BOUND_TO_FAMILY_WIDOW - } - } - trigger_else = { - custom_tooltip = { - NOT = { - var:family_widow_forbidden_divorce ?= scope:recipient - } - text = BOUND_TO_FAMILY_WIDOW_puppeteer - } - } - } - trigger_if = { - limit = { scope:is_puppet_action ?= yes } - scope:puppet_or_actor = { - piety >= divorce_cost - } - } - } - - auto_accept = yes - - on_accept = { - if = { - limit = { scope:is_puppet_action ?= yes } - scope:puppet_or_actor = { - add_piety = { value = { add = divorce_cost max = piety multiply = -1 } } - } - } - scope:puppet_or_actor = { - divorce_effect = { - DIVORCER = scope:puppet_or_actor - DIVORCEE = scope:recipient - } - if = { - limit = { - allowed_concubines = yes - } - if = { - limit = { scope:actor = scope:puppet_or_actor } - custom_tooltip = divorce_cannot_concubine_ex_wife - } - else = { - custom_tooltip = divorce_cannot_concubine_ex_wife_puppeteer - } - } - } - scope:recipient = { - trigger_event = marriage_interaction.0030 - } - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:puppet_or_actor - TARGET = scope:recipient - VALUE = major_unity_loss - DESC = clan_unity_divorce.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - # AI - ai_targets = { - ai_recipients = spouses - } - ai_frequency_by_tier = { - barony = 0 - county = 72 - duchy = 36 - kingdom = 36 - empire = 36 - hegemony = 36 - } - - ai_will_do = { - base = 0 - - modifier = { # The AI wants to divorce should they not have an heir that is their own child, and their spouse is infertile - add = 100 - scope:puppet_or_actor = { - fertility > 0.1 - NOT = { - any_child = { - is_heir_of = scope:puppet_or_actor - } - } - } - scope:recipient = { - is_ai = yes - fertility < 0.1 - } - } - - modifier = { # The AI will divorce if they're in a same-sex marriage and their faith changes its stance on the topic - add = 100 - scope:puppet_or_actor = { - sex_same_as = scope:recipient - allowed_to_marry_same_sex_trigger = no - } - } - } -} - -divorce_character_house_head_interaction = { - category = interaction_category_diplomacy - use_diplomatic_range = no - icon = icon_marriage - - cost = { - piety = { - value = divorce_cost - if = { - limit = { scope:is_puppet_action ?= yes } - multiply = 0 - } - } - } - - redirect = { - scope:recipient = { - save_scope_as = secondary_recipient - } - if = { - limit = { - exists = scope:puppet_or_actor.house.house_head - } - scope:puppet_or_actor.house.house_head = { - save_scope_as = recipient - } - } - } - - greeting = positive - notification_text = ASK_FOR_DIVORCE_NOTIFICATION - - is_shown = { - scope:puppet_or_actor.rite ?= { - rite_has_doctrine = doctrine_divorce_approval - } - exists = scope:puppet_or_actor.house.house_head - scope:puppet_or_actor != scope:puppet_or_actor.house.house_head # no need to ask yourself - # A clerical ruler needs no religious blessing, so their house head is the only approval left to seek - trigger_if = { - limit = { - scope:puppet_or_actor ?= { pam_grants_own_divorce_trigger = no } - } - NAND = { - exists = scope:puppet_or_actor.faith.religious_head - scope:puppet_or_actor.faith = { - has_doctrine = doctrine_spiritual_head - } - } - } - scope:secondary_recipient ?= { - is_spouse_of = scope:puppet_or_actor - is_concubine = no # Can set aside Concubines at any time - } - } - - is_valid_showing_failures_only = { - trigger_if = { - limit = { scope:actor = scope:puppet_or_actor } - custom_tooltip = { - NOT = { - scope:puppet_or_actor.culture = { - has_cultural_parameter = cannot_divorce - } - } - text = CULTURE_FORBIDS_DIVORCE - } - } - trigger_else = { - custom_tooltip = { - NOT = { - scope:puppet_or_actor.culture = { - has_cultural_parameter = cannot_divorce - } - } - text = CULTURE_FORBIDS_DIVORCE_puppeteer - } - } - NOT = { - scope:secondary_recipient = { has_strong_hook = scope:puppet_or_actor } - } - scope:puppet_or_actor = { - trigger_if = { - limit = { scope:actor = scope:puppet_or_actor } - custom_tooltip = { - NOT = { - var:family_widow_forbidden_divorce ?= scope:secondary_recipient - } - text = BOUND_TO_FAMILY_WIDOW - } - } - trigger_else = { - custom_tooltip = { - NOT = { - var:family_widow_forbidden_divorce ?= scope:secondary_recipient - } - text = BOUND_TO_FAMILY_WIDOW_puppeteer - } - } - } - trigger_if = { - limit = { scope:is_puppet_action ?= yes } - scope:puppet_or_actor = { - piety >= divorce_cost - } - } - } - - ai_accept = { - base = 0 # Should be 0 for all interactions - - divorce_character_ai_accept_modifier = yes - - modifier = { # Infertility - add = 20 - desc = DIVORCE_INFERTILE - scope:puppet_or_actor = { - fertility > 0.1 - } - scope:secondary_recipient = { - fertility < 0.1 - is_eunuch_trigger = no - NOT = { - any_child = { - is_child_of = scope:puppet_or_actor - } - } - } - } - - modifier = { # Negative for having given you children - add = -50 - desc = DIVORCE_GIVEN_CHILDREN - scope:secondary_recipient = { - any_child = { - count >= 3 - is_child_of = scope:puppet_or_actor - dynasty ?= scope:puppet_or_actor.dynasty - - } - } - } - - modifier = { # They are of the same dynasty as the House Head - trigger = { scope:recipient != scope:secondary_recipient } - add = -10 - desc = THEY_ARE_MY_DYNASTY_MEMBER - scope:recipient = { - is_lowborn = no - exists = dynasty - NOR = { - is_cousin_of = scope:secondary_recipient - is_close_or_extended_family_of = scope:secondary_recipient - } - dynasty = scope:secondary_recipient.dynasty - NOR = { - house = scope:secondary_recipient.house - is_close_or_extended_family_of = scope:puppet_or_actor - is_cousin_of = scope:puppet_or_actor - is_child_of = scope:puppet_or_actor - AND = { - exists = scope:puppet_or_actor.dynasty - scope:recipient.dynasty = scope:puppet_or_actor.dynasty - } - } - } - } - - modifier = { # They are of the same house as the House Head - trigger = { scope:recipient != scope:secondary_recipient } - add = -20 - desc = THEY_ARE_MY_HOUSE_MEMBER - scope:recipient = { - is_lowborn = no - NOR = { - is_cousin_of = scope:secondary_recipient - is_close_or_extended_family_of = scope:secondary_recipient - } - house = scope:secondary_recipient.house - NOR = { - house = scope:puppet_or_actor.house - is_close_or_extended_family_of = scope:puppet_or_actor - is_cousin_of = scope:puppet_or_actor - is_child_of = scope:puppet_or_actor - scope:recipient.house = scope:puppet_or_actor.house - } - } - } - - modifier = { # They are close kin to the House Head - trigger = { scope:recipient != scope:secondary_recipient } - add = -35 - desc = THEY_ARE_MY_CLOSE_KIN - scope:recipient = { - OR = { - is_cousin_of = scope:secondary_recipient - is_close_or_extended_family_of = scope:secondary_recipient - } - } - } - - modifier = { - add = intimidated_reason_value - scope:recipient = { - target_is_liege_or_above = scope:puppet_or_actor - has_dread_level_towards = { - target = scope:puppet_or_actor - level = 1 - } - } - desc = INTIMIDATED_REASON - } - modifier = { - add = cowed_reason_value - scope:recipient = { - target_is_liege_or_above = scope:puppet_or_actor - has_dread_level_towards = { - target = scope:puppet_or_actor - level = 2 - } - } - desc = COWED_REASON - } - - modifier = { - add = intimidated_external_reason_value - scope:recipient = { - NOT = { target_is_liege_or_above = scope:puppet_or_actor } - has_dread_level_towards = { - target = scope:puppet_or_actor - level = 1 - } - } - desc = INTIMIDATED_REASON - } - modifier = { - add = cowed_external_reason_value - scope:recipient = { - NOT = { target_is_liege_or_above = scope:puppet_or_actor } - has_dread_level_towards = { - target = scope:puppet_or_actor - level = 2 - } - } - desc = COWED_REASON - } - - modifier = { # You're in a same-sex marriage and your faith doesn't allow it - add = 100 - desc = SAME_SEX_MARRIAGE_FAITH_REASON_ACTOR - scope:puppet_or_actor.faith = scope:recipient.faith - scope:puppet_or_actor = { - sex_same_as = scope:secondary_recipient - allowed_to_marry_same_sex_trigger = no - } - } - - modifier = { # You're in a same-sex marriage and their faith doesn't allow it - add = 100 - desc = SAME_SEX_MARRIAGE_FAITH_REASON - scope:secondary_recipient.faith = scope:recipient.faith - scope:secondary_recipient = { - sex_same_as = scope:puppet_or_actor - allowed_to_marry_same_sex_trigger = no - } - } - - # Unity modifiers - evaluate_action_decreasing_house_unity = { - VALUE = 100 - } - } - - auto_accept = { - custom_description = { - text = "spending_hook" - subject = scope:puppet_or_actor - object = scope:recipient - scope:divorce_hook = yes - } - } - - send_option = { - is_shown = { - scope:puppet_or_actor != scope:recipient - } - is_valid = { - scope:puppet_or_actor = { - has_usable_hook = scope:recipient - } - } - flag = divorce_hook - localization = GENERIC_SPEND_A_HOOK - } - should_use_extra_icon = { - scope:puppet_or_actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - send_options_exclusive = no - - ai_min_reply_days = 1 - ai_max_reply_days = 5 - - on_accept = { - if = { - limit = { always = scope:divorce_hook } - scope:puppet_or_actor = { - if = { - limit = { - has_usable_hook = scope:recipient - } - use_hook = scope:recipient - } - } - } - if = { - limit = { scope:is_puppet_action ?= yes } - scope:puppet_or_actor = { - add_piety = { value = { add = divorce_cost max = piety multiply = -1 } } - } - scope:actor = { - send_interface_toast = { - type = event_toast_effect_neutral - title = divorce_interaction_notification_puppeteer - left_icon = scope:puppet_or_actor - right_icon = scope:secondary_recipient - } - } - } - if = { - limit = { - scope:puppet_or_actor = scope:puppet_or_actor.house.house_head - } - scope:puppet_or_actor = { - divorce_effect = { - DIVORCER = scope:puppet_or_actor - DIVORCEE = scope:secondary_recipient - } - } - } - else = { - show_as_tooltip = { - scope:puppet_or_actor = { - divorce_effect = { - DIVORCER = scope:puppet_or_actor - DIVORCEE = scope:secondary_recipient - } - } - } - scope:puppet_or_actor = { - trigger_event = religious_interaction.2 - } - } - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:puppet_or_actor - TARGET = scope:recipient - VALUE = major_unity_loss - DESC = clan_unity_divorce_grant.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - on_decline = { - scope:puppet_or_actor = { - send_interface_toast = { - type = event_toast_effect_bad - title = divorce_character_rel_head_interaction_decline_notification - right_icon = scope:puppet_or_actor.house.house_head - } - } - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:puppet_or_actor - TARGET = scope:recipient - VALUE = minor_unity_loss - DESC = clan_unity_divorce_grant_refusal.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - # AI - ai_targets = { - ai_recipients = spouses - } - ai_frequency_by_tier = { - barony = 0 - county = 72 - duchy = 36 - kingdom = 36 - empire = 36 - hegemony = 36 - } - - ai_will_do = { - base = 0 - - modifier = { # The AI wants to divorce should they not have an heir that is their own child, and their spouse is infertile - add = 100 - scope:puppet_or_actor = { - fertility > 0.1 - NOT = { - any_child = { - is_heir_of = scope:puppet_or_actor - } - } - } - scope:secondary_recipient = { - is_ai = yes - fertility < 0.1 - } - } - - modifier = { # The AI will only use a Hook if they couldn't otherwise do this - scope:divorce_hook = yes - add = -1 - } - - modifier = { # You're in a same-sex marriage and your faith doesn't allow it - add = 100 - scope:puppet_or_actor = { - sex_same_as = scope:secondary_recipient - allowed_to_marry_same_sex_trigger = no - } - } - } -} - -divorce_character_rel_head_interaction = { - category = interaction_category_diplomacy - use_diplomatic_range = no - icon = icon_marriage - - cost = { - piety = { - value = divorce_cost - if = { - limit = { scope:is_puppet_action ?= yes } - multiply = 0 - } - } - } - - redirect = { - scope:recipient = { - save_scope_as = secondary_recipient - } - #Recipient should be cleric or hof - if = { - limit = { - scope:puppet_or_actor = { - government_has_flag = government_is_theocracy - exists = superior - } - } - scope:puppet_or_actor.superior = { save_scope_as = recipient } - } - #Redirect to bishop superior of court chaplain - else_if = { - limit = { - OR = { - scope:puppet_or_actor.highest_held_title_tier < tier_kingdom - scope:puppet_or_actor.faith = { - NOR = { - has_doctrine = doctrine_spiritual_head - exists = scope:faith.religious_head - } - } - } - scope:puppet_or_actor.cp:councillor_court_chaplain ?= { - highest_held_title_tier < tier_duchy - superior ?= { - highest_held_title_tier >= tier_duchy - is_clergy = yes - } - } - } - scope:puppet_or_actor.cp:councillor_court_chaplain.superior = { - save_scope_as = recipient - } - } - #Redirect to bishop - else_if = { - limit = { - OR = { - scope:puppet_or_actor.highest_held_title_tier < tier_kingdom - scope:puppet_or_actor.faith = { - NOR = { - has_doctrine = doctrine_spiritual_head - exists = scope:faith.religious_head - } - } - } - scope:puppet_or_actor.cp:councillor_court_chaplain ?= { - highest_held_title_tier >= tier_duchy - is_clergy = yes - } - } - scope:puppet_or_actor.cp:councillor_court_chaplain = { - save_scope_as = recipient - } - } - else = { - scope:puppet_or_actor.faith.religious_head ?= { - save_scope_as = recipient - } - } - } - - greeting = positive - notification_text = { - desc = ASK_FOR_DIVORCE_NOTIFICATION - first_valid = { - triggered_desc = { - trigger = { - scope:puppet_or_actor = { - faith = scope:recipient.faith - sex_same_as = scope:secondary_recipient - allowed_to_marry_same_sex_trigger = no - } - } - desc = ASK_FOR_DIVORCE_NOTIFICATION_SAME_SEX - } - triggered_desc = { - trigger = { - scope:puppet_or_actor = { - relation_with_character_is_incestuous_in_my_faith_trigger = { CHARACTER = scope:secondary_recipient } - } - } - desc = ASK_FOR_DIVORCE_NOTIFICATION_INCESTUOUS - } - triggered_desc = { - trigger = { - scope:secondary_recipient = { - any_relation = { - type = lover - NOR = { - this = scope:puppet_or_actor - this = scope:recipient - } - relation_with_character_is_incestuous_in_my_rite_trigger = { CHARACTER = scope:secondary_recipient } - } - } - } - desc = ASK_FOR_DIVORCE_NOTIFICATION_INCESTUOUS_LOVER - } - triggered_desc = { - trigger = { - scope:secondary_recipient = { - is_female = no - is_eunuch_trigger = yes - } - } - desc = ASK_FOR_DIVORCE_NOTIFICATION_EUNUCH - } - triggered_desc = { - trigger = { - scope:puppet_or_actor = { - has_opinion_modifier = { - modifier = attempted_murder_me_crime - target = scope:secondary_recipient - } - } - } - desc = ASK_FOR_DIVORCE_NOTIFICATION_ATTEMPTED_MURDER - } - triggered_desc = { - trigger = { - scope:secondary_recipient = { - has_character_modifier = wedding_accused_impotency_modifier - } - } - desc = ASK_FOR_DIVORCE_NOTIFICATION_IMPOTENCE - } - triggered_desc = { - trigger = { - scope:puppet_or_actor = { - any_consort = { - is_alive = yes - this != scope:secondary_recipient - } - any_consort = { - this = scope:secondary_recipient - } - } - scope:secondary_recipient = { - culture = { NOT = { has_cultural_tradition = tradition_polygamous } } - rite = { NOT = { rite_has_doctrine = doctrine_polygamy } } - } - } - desc = ASK_FOR_DIVORCE_NOTIFICATION_MULTIPLE_CONSORTS - } - triggered_desc = { - trigger = { - scope:secondary_recipient.faith = { - faith_hostility_level = { - target = scope:recipient.faith - value >= faith_hostile_level - } - } - } - desc = ASK_FOR_DIVORCE_NOTIFICATION_HOSTILE_FAITH - } - triggered_desc = { - trigger = { - scope:secondary_recipient = { - exposed_cheating_on_spouse_trigger = { SPOUSE = scope:puppet_or_actor } - } - } - desc = ASK_FOR_DIVORCE_NOTIFICATION_EXPOSED_CHEATING - } - triggered_desc = { - trigger = { - scope:secondary_recipient = { - fertility < 0.1 - NOT = { - any_child = { - any_parent = { - this = scope:puppet_or_actor - } - } - } - } - } - desc = ASK_FOR_DIVORCE_NOTIFICATION_INFERTILITY - } - triggered_desc = { - trigger = { - scope:secondary_recipient = { - has_trait = adulterer - } - } - desc = ASK_FOR_DIVORCE_NOTIFICATION_ADULTERY_TRAIT - } - triggered_desc = { - trigger = { - scope:puppet_or_actor = { - opinion = { - target = scope:secondary_recipient - value < -50 - } - } - } - desc = ASK_FOR_DIVORCE_NOTIFICATION_HATRED - } - desc = ASK_FOR_DIVORCE_NOTIFICATION_NOT_JUSTIFIED - } - } - - is_available = { - trigger_if = { - limit = { is_ai = yes } - NOT = { has_character_modifier = rekindled_marriage_modifier } - } - } - - is_shown = { - scope:puppet_or_actor.rite ?= { rite_has_doctrine = doctrine_divorce_approval } - # A clerical ruler grants their own divorce and never petitions for one, least of all themselves - scope:puppet_or_actor ?= { pam_grants_own_divorce_trigger = no } - scope:puppet_or_actor ?= { - OR = { - faith ?= { - has_doctrine = doctrine_spiritual_head - exists = religious_head - } - cp:councillor_court_chaplain ?= { - highest_held_title_tier >= tier_duchy - is_clergy = yes - } - AND = { - government_has_flag = government_is_theocracy - exists = superior - } - cp:councillor_court_chaplain.superior ?= { - highest_held_title_tier >= tier_duchy - is_clergy = yes - } - } - } - scope:secondary_recipient ?= { - is_spouse_of = scope:puppet_or_actor - is_concubine = no # Can set aside Concubines at any time - } - } - - is_valid_showing_failures_only = { - scope:puppet_or_actor = { - NOT = { has_trait = excommunicated } - } - trigger_if = { - limit = { scope:actor = scope:puppet_or_actor } - custom_tooltip = { - NOT = { - scope:puppet_or_actor.culture = { - has_cultural_parameter = cannot_divorce - } - } - text = CULTURE_FORBIDS_DIVORCE - } - } - trigger_else = { - custom_tooltip = { - NOT = { - scope:puppet_or_actor.culture = { - has_cultural_parameter = cannot_divorce - } - } - text = CULTURE_FORBIDS_DIVORCE_puppeteer - } - } - NOT = { - scope:secondary_recipient = { has_strong_hook = scope:puppet_or_actor } - } - scope:puppet_or_actor = { - trigger_if = { - limit = { scope:actor = scope:puppet_or_actor } - custom_tooltip = { - NOT = { - var:family_widow_forbidden_divorce ?= scope:secondary_recipient - } - text = BOUND_TO_FAMILY_WIDOW - } - } - trigger_else = { - custom_tooltip = { - NOT = { - var:family_widow_forbidden_divorce ?= scope:secondary_recipient - } - text = BOUND_TO_FAMILY_WIDOW_puppeteer - } - } - } - scope:puppet_or_actor = { - NOT = { - has_character_modifier = promised_pilgrimage_to_clergy_modifier - } - } - trigger_if = { - limit = { scope:is_puppet_action ?= yes } - scope:puppet_or_actor = { - piety >= divorce_cost - } - } - } - - ai_accept = { - base = 0 # Should be 0 for all interactions - - divorce_character_ai_accept_modifier = yes - - modifier = { # Divine Family is part of the faith - add = -100 - desc = DIVORCE_INCESTUOUS - - scope:puppet_or_actor = { - is_close_or_extended_family_of = scope:secondary_recipient - rite = { rite_has_tenet = tenet_divine_marriage } - } - } - - modifier = { # More likely if the marriage is incestuous, unless Divine Family is part of the faith - add = 100 - desc = DIVORCE_INCESTUOUS - - scope:puppet_or_actor = { - relation_with_character_is_incestuous_in_my_faith_trigger = { CHARACTER = scope:secondary_recipient } - } - } - - modifier = { # They are of the same dynasty as the Head of Faith - add = -5 - desc = THEY_ARE_MY_DYNASTY_MEMBER - scope:recipient = { - is_lowborn = no - exists = dynasty - exists = scope:secondary_recipient.dynasty - dynasty = scope:secondary_recipient.dynasty - NOR = { - house = scope:secondary_recipient.house - is_close_or_extended_family_of = scope:puppet_or_actor - is_cousin_of = scope:puppet_or_actor - is_child_of = scope:puppet_or_actor - scope:recipient.dynasty = scope:puppet_or_actor.dynasty - } - } - } - - modifier = { # You are of the same dynasty as the Head of Faith - add = 5 - desc = YOU_ARE_MY_DYNASTY_MEMBER - scope:recipient = { - is_lowborn = no - exists = dynasty - exists = scope:puppet_or_actor.dynasty - dynasty = scope:puppet_or_actor.dynasty - NOR = { - is_close_or_extended_family_of = scope:puppet_or_actor - is_cousin_of = scope:puppet_or_actor - is_child_of = scope:puppet_or_actor - scope:recipient.dynasty = scope:secondary_recipient.dynasty - } - } - } - - modifier = { # They are of the same house as the Head of Faith - add = -10 - desc = THEY_ARE_MY_HOUSE_MEMBER - scope:recipient = { - is_lowborn = no - exists = house - exists = scope:secondary_recipient.house - house = scope:secondary_recipient.house - NOR = { - house = scope:puppet_or_actor.house - is_close_or_extended_family_of = scope:puppet_or_actor - is_cousin_of = scope:puppet_or_actor - is_child_of = scope:puppet_or_actor - scope:recipient.house = scope:puppet_or_actor.house - } - } - } - - modifier = { # You are of the same house as the Head of Faith - add = 10 - desc = YOU_ARE_MY_HOUSE_MEMBER - scope:recipient = { - is_lowborn = no - exists = house - exists = scope:puppet_or_actor.house - house = scope:puppet_or_actor.house - NOR = { - is_close_or_extended_family_of = scope:puppet_or_actor - is_cousin_of = scope:puppet_or_actor - is_child_of = scope:puppet_or_actor - scope:recipient.house = scope:secondary_recipient.house - } - } - } - - modifier = { # Related to the Head of Faith - add = 25 - desc = YOU_ARE_MY_RELATIVE - scope:recipient = { - OR = { - is_close_or_extended_family_of = scope:puppet_or_actor - is_cousin_of = scope:puppet_or_actor - } - NOT = { is_child_of = scope:puppet_or_actor } - } - } - - modifier = { # Parent of the Head of Faith - add = 50 - desc = PARENTS #YOU_ARE_MY_PARENT - scope:recipient = { - is_child_of = scope:puppet_or_actor - } - } - - modifier = { - add = { - add = 10 - multiply = scope:puppet_or_actor.num_virtuous_traits - } - scope:puppet_or_actor.num_virtuous_traits > 0 - desc = I_AM_VIRTUOUS - } - - modifier = { - add = { - add = -10 - multiply = scope:secondary_recipient.num_virtuous_traits - } - scope:secondary_recipient.num_virtuous_traits > 0 - desc = THEY_ARE_VIRTUOUS - } - - modifier = { - add = { - add = -10 - multiply = scope:puppet_or_actor.num_sinful_traits - } - scope:puppet_or_actor.num_sinful_traits > 0 - desc = I_AM_SINFUL - } - - modifier = { - add = { - add = 10 - multiply = scope:secondary_recipient.num_sinful_traits - } - scope:secondary_recipient.num_sinful_traits > 0 - desc = THEY_ARE_SINFUL - } - - modifier = { # You're in a same-sex marriage and your faith doesn't allow it - add = 100 - desc = SAME_SEX_MARRIAGE_FAITH_REASON_ACTOR - scope:puppet_or_actor.faith = scope:recipient.faith - scope:puppet_or_actor = { - sex_same_as = scope:secondary_recipient - allowed_to_marry_same_sex_trigger = no - } - } - - modifier = { # You're in a same-sex marriage and their faith doesn't allow it - add = 100 - desc = SAME_SEX_MARRIAGE_FAITH_REASON - scope:secondary_recipient.faith = scope:recipient.faith - scope:secondary_recipient = { - sex_same_as = scope:puppet_or_actor - allowed_to_marry_same_sex_trigger = no - } - } - - modifier = { # You have denounced them as impotent (ep2_wedding.1061) - add = 30 - desc = THEY_ARE_ACCUSED_IMPOTENCY - scope:secondary_recipient = { - has_character_modifier = wedding_accused_impotency_modifier - } - } - # Unity modifiers - evaluate_action_decreasing_house_unity = { - VALUE = 100 - } - modifier = { - add = 100 - scope:puppet_or_actor.puppet:theological_agent_puppet ?= scope:recipient - desc = IS_YOUR_PUPPET - } - - modifier = { - add = { - value = 25 - if = { - limit = { - pam_actor_rite_has_core_simony_trigger = yes - } - multiply = 5 - } - } - scope:donate_faith ?= yes - scope:puppet_or_actor.major_gold_value < scope:recipient.minor_gold_value - desc = DONATE_FAITH_INTERACTION_OPTION_REASON - } - modifier = { - add = { - value = 50 - if = { - limit = { - pam_actor_rite_has_core_simony_trigger = yes - } - multiply = 5 - } - } - scope:donate_faith ?= yes - scope:puppet_or_actor.major_gold_value < scope:recipient.major_gold_value - scope:puppet_or_actor.major_gold_value >= scope:recipient.minor_gold_value - desc = DONATE_FAITH_INTERACTION_OPTION_REASON - } - modifier = { - add = { - value = 75 - if = { - limit = { - pam_actor_rite_has_core_simony_trigger = yes - } - multiply = 5 - } - } - scope:donate_faith ?= yes - scope:puppet_or_actor.major_gold_value >= scope:recipient.major_gold_value - scope:puppet_or_actor.major_gold_value < scope:recipient.monumental_gold_value - desc = DONATE_FAITH_INTERACTION_OPTION_REASON - } - modifier = { - add = { - value = 100 - if = { - limit = { - pam_actor_rite_has_core_simony_trigger = yes - } - multiply = 5 - } - } - scope:donate_faith ?= yes - scope:puppet_or_actor.major_gold_value >= scope:recipient.monumental_gold_value - desc = DONATE_FAITH_INTERACTION_OPTION_REASON - } - modifier = { - add = 25 - scope:divorce_justified ?= yes - desc = JUSTIFY_DIVORCE_REASON - } - modifier = { - add = { - value = 20 - if = { - limit = { - scope:puppet_or_actor.highest_held_title_tier > scope:recipient.highest_held_title_tier - } - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = scope:recipient.highest_held_title_tier - add = 1 - } - } - else_if = { - limit = { - scope:puppet_or_actor.highest_held_title_tier < scope:recipient.highest_held_title_tier_minus_one - } - multiply = 0.25 - } - else_if = { - limit = { - scope:puppet_or_actor.highest_held_title_tier < scope:recipient.highest_held_title_tier - } - multiply = 0.5 - } - if = { - limit = { - OR = { - is_liege_or_above_of = scope:recipient - liege ?= scope:recipient.liege - capital_county.holder ?= { - OR = { - this = scope:puppet_or_actor - any_liege_or_above = { - this = scope:puppet_or_actor - } - } - } - } - } - multiply = 3 - } - else_if = { - limit = { - scope:recipient = { - OR = { - any_neighboring_top_liege_realm_owner = { - this = scope:puppet_or_actor - } - capital_county = { - any_neighboring_county = { - OR = { - holder = scope:puppet_or_actor - holder = { - any_liege_or_above = { - this = scope:puppet_or_actor - } - } - } - } - } - } - } - } - multiply = 2 - } - } - scope:threaten_priest = yes - desc = THREATEN_PRIEST_INTERACTION_OPTION_REASON - } - modifier = { - add = pam_offer_pilgrimage_acceptance_value - scope:offer_pilgrimage = yes - desc = OFFER_PILGRIMAGE_INTERACTION_OPTION_REASON - } - secular_to_ecclesiastical_pam_factors_acceptance_modifier = yes - } - - auto_accept = { - custom_description = { - text = "spending_hook" - subject = scope:puppet_or_actor - object = scope:recipient - scope:divorce_hook = yes - } - } - options_heading = DIVORCE_INDUCEMENTS - send_option = { - is_valid = { - scope:puppet_or_actor = { - custom_tooltip = { - text = divorce_justified_tt - divorce_is_justified_trigger = { DIVORCER = scope:puppet_or_actor } - } - } - } - flag = divorce_justified - localization = JUSTIFY_DIVORCE_INTERACTION_OPTION - } - send_option = { - is_valid = { - scope:puppet_or_actor = { - dread >= medium_dread_value - current_military_strength > scope:recipient.current_military_strength - custom_tooltip = { - text = must_neighbor_recipient_tt - OR = { - any_vassal_or_below = { - this = scope:recipient - } - any_sub_realm_county = { - OR = { - clerical_region_title ?= { - holder ?= scope:recipient - } - any_neighboring_county = { - holder = { - OR = { - this = scope:recipient - any_liege_or_above = { - this = scope:recipient - } - } - } - } - } - } - } - } - } - scope:recipient = { - NOR = { - has_trait = stubborn - has_trait = brave - has_trait = arrogant - has_trait = ambitious - } - } - } - flag = threaten_priest - localization = THREATEN_PRIEST_INTERACTION_OPTION - } - send_option = { - is_valid = { - scope:puppet_or_actor = { - trigger_if = { - limit = { - scope:actor = { - is_ai = yes - } - } - short_term_gold >= monumental_gold_value - } - trigger_else = { - gold >= major_gold_value - } - } - } - flag = donate_faith - localization = DONATE_TO_THE_FAITH_INTERACTION_OPTION - } - send_option = { - is_valid = { - scope:puppet_or_actor = { - has_usable_hook = scope:recipient - } - } - flag = divorce_hook - localization = GENERIC_SPEND_A_HOOK - } - send_option = { - is_shown = { - has_pam_dlc_trigger = yes - pam_offer_pilgrimage_option_shown_trigger = { ACTOR = scope:puppet_or_actor } - } - is_valid = { - pam_offer_pilgrimage_option_valid_trigger = { ACTOR = scope:puppet_or_actor } - } - flag = offer_pilgrimage - localization = OFFER_PILGRIMAGE_INTERACTION_OPTION - } - should_use_extra_icon = { - scope:puppet_or_actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - send_options_exclusive = no - - ai_min_reply_days = 1 - ai_max_reply_days = 5 - - on_send = { - #Make sure AI always justifies divorce when valid - scope:puppet_or_actor = { - if = { - limit = { - scope:actor = { is_ai = yes } - divorce_is_justified_trigger = { DIVORCER = scope:puppet_or_actor } - NOT = { - scope:divorce_justified ?= yes - } - } - save_scope_as = ai_divorce_justified - } - } - } - - on_accept = { - scope:puppet_or_actor = { - save_scope_as = divorcer - } - if = { - limit = { scope:is_puppet_action ?= yes } - scope:actor = { - scope:puppet_or_actor = { add_piety = { value = { add = divorce_cost max = piety multiply = -1 } } } - send_interface_toast = { - type = event_toast_effect_neutral - title = divorce_interaction_notification_puppeteer - left_icon = scope:puppet_or_actor - right_icon = scope:secondary_recipient - } - } - } - scope:recipient = { - if = { - limit = { - #No inducement given - NOR = { - scope:divorce_hook ?= yes - scope:donate_faith ?= yes - scope:divorce_justified ?= yes - exists = scope:ai_divorce_justified - scope:threaten_priest ?= yes - scope:offer_pilgrimage ?= yes - } - #One of the methods is possible - OR = { - divorce_can_cause_house_feud_trigger = yes - divorce_can_cause_holy_order_lease_trigger = yes - divorce_can_cause_hook_trigger = yes - divorce_can_put_spouse_in_monastery_trigger = yes - } - } - custom_tooltip = cleric_divorce_fuckery_tt - if = { - limit = { - divorce_can_cause_house_feud_trigger = yes - } - custom_tooltip = cleric_cause_house_feud_tt - } - if = { - limit = { - divorce_can_cause_holy_order_lease_trigger = yes - } - custom_tooltip = cleric_force_holy_order_lease_tt - } - if = { - limit = { - divorce_can_cause_hook_trigger = yes - } - custom_tooltip = cleric_get_hook_tt - } - if = { - limit = { - divorce_can_put_spouse_in_monastery_trigger = yes - } - custom_tooltip = cleric_put_spouse_in_monastery_tt - } - save_scope_as = no_inducement - } - } - if = { - limit = { always = scope:divorce_hook } - scope:puppet_or_actor = { - if = { - limit = { - has_usable_hook = scope:recipient - } - use_hook = scope:recipient - } - } - } - pam_offer_pilgrimage_effect = { - ACTOR = scope:puppet_or_actor - CLERIC = scope:recipient - } - show_as_tooltip = { - scope:divorcer = { - divorce_effect = { - DIVORCER = scope:divorcer - DIVORCEE = scope:secondary_recipient - } - } - } - if = { - limit = { - NOR = { - scope:divorce_justified ?= yes - exists = scope:ai_divorce_justified - } - } - if = { - limit = { - scope:recipient = { - is_ai = no - } - } - scope:recipient = { - change_spiritual_fulfillment = minor_spiritual_fulfillment_loss - } - } - else = { - hidden_effect = { - scope:recipient = { - change_spiritual_fulfillment = miniscule_spiritual_fulfillment_loss - } - } - } - } - else = { - scope:recipient = { add_piety = minor_piety_gain } - } - scope:puppet_or_actor = { - if = { - limit = { - scope:donate_faith ?= yes - } - pay_short_term_gold = { - target = scope:recipient - gold = scope:puppet_or_actor.major_gold_value - } - } - } - #Recipient is free to fuck with the divorce - if = { - limit = { - exists = scope:no_inducement - } - scope:recipient = { - trigger_event = pam_interactions_events.0060 - } - } - #Divorcer (the puppet when puppeted) gets confirmation directly - else = { - scope:divorcer = { - trigger_event = religious_interaction.1 - } - } - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:puppet_or_actor - TARGET = scope:recipient - VALUE = major_unity_loss - DESC = clan_unity_alliance.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - on_decline = { - scope:puppet_or_actor = { - send_interface_toast = { - type = event_toast_effect_bad - title = divorce_character_rel_head_interaction_decline_notification - - right_icon = scope:puppet_or_actor.faith.religious_head - clerical_interaction_refusal_minor_effect = yes - } - } - if = { - limit = { - scope:recipient = { - is_ai = no - } - scope:actor = { - is_ai = yes - } - } - scope:recipient = { - if = { - limit = { - learning > extremely_high_skill_rating - scope:actor = { - is_ai = yes - } - NOR = { - rite = { - trait_is_virtue_rite = lustful - } - rite = { - trait_is_sin_rite = chaste - } - scope:puppet_or_actor = { - has_trait = lustful - } - } - } - custom_tooltip = refuse_divorce_celibacy_tt - } - if = { - limit = { - scope:puppet_or_actor = { - is_imprisoned = no - is_incapable = no - } - scope:secondary_recipient = { - is_imprisoned = no - is_incapable = no - } - } - custom_tooltip = refuse_divorce_comfort_tt - } - custom_tooltip = refuse_divorce_condemn_tt - trigger_event = { - id = pam_interactions_events.0050 - days = 1 - } - #Gain stress for ignoring threat from actor - if = { - limit = { - - scope:threaten_priest ?= yes - } - if = { - limit = { - ai_boldness < 0 - } - add_stress = major_stress_gain - } - else = { - add_stress = medium_stress_gain - } - } - } - } - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:puppet_or_actor - TARGET = scope:recipient - VALUE = minor_unity_loss - DESC = clan_unity_alliance.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - # AI - ai_targets = { - ai_recipients = spouses - } - ai_frequency_by_tier = { - barony = 0 - county = 72 - duchy = 36 - kingdom = 36 - empire = 36 - hegemony = 36 - } - - ai_will_do = { - base = 0 - - modifier = { # The AI wants to divorce should they not have an heir that is their own child, and their spouse is infertile - add = 100 - scope:puppet_or_actor = { - fertility > 0.1 - NOT = { - any_child = { - is_heir_of = scope:puppet_or_actor - } - } - } - scope:secondary_recipient = { - is_ai = yes - fertility < 0.1 - } - } - - modifier = { # The AI will only use a Hook if they couldn't otherwise do this - scope:divorce_hook = yes - add = -1 - } - - modifier = { # You're in a same-sex marriage and your faith doesn't allow it - add = 100 - scope:puppet_or_actor = { - sex_same_as = scope:secondary_recipient - allowed_to_marry_same_sex_trigger = no - } - } - modifier = { - add = -66 - scope:puppet_or_actor = { - NOT = { divorce_is_justified_trigger = { DIVORCER = scope:puppet_or_actor } } - } - } - } -} - -divorce_character_dynast_request_interaction = { - category = interaction_category_diplomacy - use_diplomatic_range = no - icon = icon_dynasty - - desc = divorce_character_dynast_request_interaction_desc - - cost = { - piety = { - value = divorce_cost - if = { - limit = { scope:is_puppet_action ?= yes } - multiply = 0 - } - } - renown = { - value = scope:puppet_or_actor.dynasty.minor_dynasty_prestige_value - if = { - limit = { scope:is_puppet_action ?= yes } - multiply = 0 - } - } - } - - redirect = { - scope:recipient = { - save_scope_as = secondary_actor - } - - if = { - limit = { - exists = scope:recipient.primary_spouse - } - scope:recipient.primary_spouse = { - save_scope_as = recipient - } - } - } - - is_shown = { - scope:secondary_actor != scope:puppet_or_actor - scope:puppet_or_actor ?= { pam_grants_own_divorce_trigger = no } - scope:secondary_actor.dynasty.dynast ?= scope:puppet_or_actor - - # We are not required to seek approval of a spiritual HoF - NAND = { - scope:puppet_or_actor.rite = { rite_has_doctrine = doctrine_divorce_approval } - scope:puppet_or_actor.faith = { - has_doctrine = doctrine_spiritual_head - exists = religious_head - } - } - OR = { - AND = { - scope:puppet_or_actor.faith != scope:secondary_actor.faith - # They are not required to seek approval of a spiritual HoF of the Dynasty Member - scope:secondary_actor.rite ?= { - NOT = { - rite_has_doctrine = doctrine_divorce_approval - } - } - } - scope:puppet_or_actor.faith ?= scope:secondary_actor.faith - } - - scope:recipient = { - is_spouse_of = scope:secondary_actor - is_concubine = no # Can set aside Concubines at any time - } - } - - is_valid_showing_failures_only = { - trigger_if = { - limit = { scope:actor = scope:puppet_or_actor } - custom_tooltip = { - NOT = { - scope:puppet_or_actor.culture = { - has_cultural_parameter = cannot_divorce - } - } - text = CULTURE_FORBIDS_DIVORCE - } - } - trigger_else = { - custom_tooltip = { - NOT = { - scope:puppet_or_actor.culture = { - has_cultural_parameter = cannot_divorce - } - } - text = CULTURE_FORBIDS_DIVORCE_puppeteer - } - } - NOT = { - scope:puppet_or_actor.rite = { - rite_has_doctrine = doctrine_divorce_disallowed - } - } - scope:puppet_or_actor.dynasty = { - dynasty_prestige >= minor_dynasty_prestige_value - } - - NOT = { - scope:secondary_actor.rite = { - rite_has_doctrine = doctrine_divorce_disallowed - } - } - scope:secondary_actor = { NOT = { has_strong_hook = scope:puppet_or_actor } } - trigger_if = { - limit = { - scope:secondary_actor = { - NOR = { - is_child_of = scope:puppet_or_actor - is_grandchild_of = scope:puppet_or_actor - is_great_grandchild_of = scope:puppet_or_actor - } - } - } - custom_description = { - scope:secondary_actor.top_liege = scope:puppet_or_actor.top_liege - subject = scope:puppet_or_actor - text = "same_realm_as" - } - } - scope:puppet_or_actor = { - trigger_if = { - limit = { scope:actor = scope:puppet_or_actor } - custom_tooltip = { - NOT = { - var:family_widow_forbidden_divorce ?= scope:recipient - } - text = BOUND_TO_FAMILY_WIDOW - } - } - trigger_else = { - custom_tooltip = { - NOT = { - var:family_widow_forbidden_divorce ?= scope:recipient - } - text = BOUND_TO_FAMILY_WIDOW_puppeteer - } - } - } - } - - auto_accept = yes - - on_accept = { - if = { - limit = { scope:is_puppet_action ?= yes } - scope:puppet_or_actor = { - add_piety = { value = { add = divorce_cost max = piety multiply = -1 } } - dynasty ?= { add_dynasty_prestige = { value = { add = scope:puppet_or_actor.dynasty.minor_dynasty_prestige_value multiply = -1 } } } - } - } - scope:puppet_or_actor = { - send_interface_toast = { - type = event_toast_effect_good - title = divorce_character_dynast_request_interaction_title - custom_tooltip = divorce_character_dynast_request_interaction_desc - - left_icon = scope:secondary_actor - right_icon = scope:recipient - } - } - - - scope:secondary_actor = { - divorce_effect = { - DIVORCER = scope:secondary_actor - DIVORCEE = scope:recipient - } - - add_opinion = { - modifier = forced_divorce_opinion - target = scope:puppet_or_actor - } - } - if = { - limit = { - scope:recipient != scope:puppet_or_actor - } - scope:recipient = { - trigger_event = marriage_interaction.0030 - - add_opinion = { - modifier = forced_divorce_opinion - target = scope:puppet_or_actor - } - } - } - } - - # AI - ai_targets = { - ai_recipients = dynasty - max = 10 - } - ai_frequency_by_tier = { - barony = 0 - county = 144 - duchy = 72 - kingdom = 72 - empire = 72 - hegemony = 72 - } - - ai_will_do = { - base = 0 - - modifier = { # The AI wants to force a divorce if their heir is not from their dynasty and current marriage within the dynasty are not promising - add = 100 - scope:secondary_actor = { - fertility > 0.1 - } - scope:recipient = { - is_ai = yes - fertility < 0.1 - } - exists = scope:puppet_or_actor.primary_heir - exists = scope:puppet_or_actor.primary_heir.dynasty - scope:puppet_or_actor.primary_heir.dynasty != this.dynasty - } - - #Players should not be targeted - modifier = { - add = -1000 - OR = { - scope:secondary_actor = { is_ai = no } - scope:recipient = { is_ai = no } - } - } - } -} - -divorce_character_dynast_request_rel_head_interaction = { - category = interaction_category_diplomacy - use_diplomatic_range = no - icon = icon_dynasty - - desc = divorce_character_dynast_request_interaction_desc - - cost = { - piety = { - value = divorce_cost - if = { - limit = { scope:is_puppet_action ?= yes } - multiply = 0 - } - } - renown = { - value = scope:puppet_or_actor.dynasty.minor_dynasty_prestige_value - if = { - limit = { scope:is_puppet_action ?= yes } - multiply = 0 - } - } - } - - redirect = { - scope:recipient = { - save_scope_as = secondary_actor - } - - if = { - limit = { - exists = scope:recipient.primary_spouse - } - scope:recipient.primary_spouse = { - save_scope_as = secondary_recipient - } - } - #Recipient should be cleric or hof - if = { - limit = { - scope:puppet_or_actor = { - government_has_flag = government_is_theocracy - exists = superior - } - } - scope:puppet_or_actor.superior = { save_scope_as = recipient } - } - #Redirect to bishop superior of court chaplain - else_if = { - limit = { - OR = { - scope:puppet_or_actor.highest_held_title_tier < tier_kingdom - scope:puppet_or_actor.faith = { - NOR = { - has_doctrine = doctrine_spiritual_head - exists = scope:faith.religious_head - } - } - } - scope:puppet_or_actor.cp:councillor_court_chaplain ?= { - highest_held_title_tier < tier_duchy - superior ?= { - highest_held_title_tier >= tier_duchy - is_clergy = yes - } - } - } - scope:puppet_or_actor.cp:councillor_court_chaplain.superior = { - save_scope_as = recipient - } - } - #Redirect to bishop - else_if = { - limit = { - OR = { - scope:puppet_or_actor.highest_held_title_tier < tier_kingdom - scope:puppet_or_actor.faith = { - NOR = { - has_doctrine = doctrine_spiritual_head - exists = scope:faith.religious_head - } - } - } - scope:puppet_or_actor.cp:councillor_court_chaplain ?= { - highest_held_title_tier >= tier_duchy - is_clergy = yes - } - } - scope:puppet_or_actor.cp:councillor_court_chaplain = { - save_scope_as = recipient - } - } - else = { - scope:puppet_or_actor.faith.religious_head ?= { - save_scope_as = recipient - } - } - } - - greeting = positive - - notification_text = { - desc = ASK_FOR_DIVORCE_THIRD_PERSON_NOTIFICATION - first_valid = { - triggered_desc = { - trigger = { - scope:secondary_actor = { - faith = scope:recipient.faith - sex_same_as = scope:secondary_recipient - allowed_to_marry_same_sex_trigger = no - } - } - desc = ASK_FOR_DIVORCE_NOTIFICATION_SAME_SEX_SECONDARY - } - triggered_desc = { - trigger = { - scope:secondary_actor = { - relation_with_character_is_incestuous_in_my_faith_trigger = { CHARACTER = scope:secondary_recipient } - } - } - desc = ASK_FOR_DIVORCE_NOTIFICATION_INCESTUOUS_SECONDARY - } - triggered_desc = { - trigger = { - scope:secondary_recipient = { - any_relation = { - type = lover - NOR = { - this = scope:secondary_actor - this = scope:recipient - } - relation_with_character_is_incestuous_in_my_rite_trigger = { CHARACTER = scope:secondary_recipient } - } - } - } - desc = ASK_FOR_DIVORCE_NOTIFICATION_INCESTUOUS_LOVER_SECONDARY - } - triggered_desc = { - trigger = { - scope:secondary_recipient = { - is_female = no - is_eunuch_trigger = yes - } - } - desc = ASK_FOR_DIVORCE_NOTIFICATION_EUNUCH_SECONDARY - } - triggered_desc = { - trigger = { - scope:secondary_actor = { - has_opinion_modifier = { - modifier = attempted_murder_me_crime - target = scope:secondary_recipient - } - } - } - desc = ASK_FOR_DIVORCE_NOTIFICATION_ATTEMPTED_MURDER_SECONDARY - } - triggered_desc = { - trigger = { - scope:secondary_recipient = { - has_character_modifier = wedding_accused_impotency_modifier - } - } - desc = ASK_FOR_DIVORCE_NOTIFICATION_IMPOTENCE_SECONDARY - } - triggered_desc = { - trigger = { - scope:secondary_actor = { - any_consort = { - is_alive = yes - this != scope:secondary_recipient - } - any_consort = { - this = scope:secondary_recipient - } - } - scope:secondary_recipient = { - culture = { NOT = { has_cultural_tradition = tradition_polygamous } } - rite = { NOT = { rite_has_doctrine = doctrine_polygamy } } - } - } - desc = ASK_FOR_DIVORCE_NOTIFICATION_MULTIPLE_CONSORTS_SECONDARY - } - triggered_desc = { - trigger = { - scope:secondary_recipient.faith = { - faith_hostility_level = { - target = scope:recipient.faith - value >= faith_hostile_level - } - } - } - desc = ASK_FOR_DIVORCE_NOTIFICATION_HOSTILE_FAITH_SECONDARY - } - triggered_desc = { - trigger = { - scope:secondary_recipient = { - exposed_cheating_on_spouse_trigger = { SPOUSE = scope:secondary_actor } - } - } - desc = ASK_FOR_DIVORCE_NOTIFICATION_EXPOSED_CHEATING_SECONDARY - } - triggered_desc = { - trigger = { - scope:secondary_recipient = { - fertility < 0.1 - NOT = { - any_child = { - any_parent = { - this = scope:secondary_actor - } - } - } - } - } - desc = ASK_FOR_DIVORCE_NOTIFICATION_INFERTILITY_SECONDARY - } - triggered_desc = { - trigger = { - scope:secondary_recipient = { - has_trait = adulterer - } - } - desc = ASK_FOR_DIVORCE_NOTIFICATION_ADULTERY_TRAIT_SECONDARY - } - triggered_desc = { - trigger = { - scope:secondary_actor = { - opinion = { - target = scope:secondary_recipient - value < -50 - } - } - } - desc = ASK_FOR_DIVORCE_NOTIFICATION_HATRED_SECONDARY - } - desc = ASK_FOR_DIVORCE_NOTIFICATION_NOT_JUSTIFIED_SECONDARY - } - } - - is_shown = { - scope:puppet_or_actor.rite ?= { rite_has_doctrine = doctrine_divorce_approval } - scope:puppet_or_actor ?= { pam_grants_own_divorce_trigger = no } - scope:puppet_or_actor ?= { - OR = { - faith ?= { - has_doctrine = doctrine_spiritual_head - exists = religious_head - } - cp:councillor_court_chaplain ?= { - highest_held_title_tier >= tier_duchy - is_clergy = yes - } - AND = { - government_has_flag = government_is_theocracy - exists = superior - } - cp:councillor_court_chaplain.superior ?= { - highest_held_title_tier >= tier_duchy - is_clergy = yes - } - } - } - scope:secondary_actor != scope:puppet_or_actor - - scope:secondary_actor.dynasty.dynast ?= scope:puppet_or_actor - - NOT = { - scope:secondary_actor = { is_spouse_of = scope:puppet_or_actor } - } - exists = scope:secondary_recipient - scope:puppet_or_actor.faith ?= scope:secondary_actor.faith - } - - is_valid_showing_failures_only = { - scope:puppet_or_actor = { - NOT = { - has_character_modifier = promised_pilgrimage_to_clergy_modifier - } - } - trigger_if = { - limit = { scope:actor = scope:puppet_or_actor } - custom_tooltip = { - NOT = { - scope:puppet_or_actor.culture = { - has_cultural_parameter = cannot_divorce - } - } - text = CULTURE_FORBIDS_DIVORCE - } - } - trigger_else = { - custom_tooltip = { - NOT = { - scope:puppet_or_actor.culture = { - has_cultural_parameter = cannot_divorce - } - } - text = CULTURE_FORBIDS_DIVORCE_puppeteer - } - } - - scope:secondary_actor = { NOT = { has_strong_hook = scope:puppet_or_actor } } - trigger_if = { - limit = { - scope:secondary_actor = { - NOR = { - is_child_of = scope:puppet_or_actor - is_grandchild_of = scope:puppet_or_actor - is_great_grandchild_of = scope:puppet_or_actor - } - } - } - custom_description = { - scope:secondary_actor.top_liege = scope:puppet_or_actor.top_liege - subject = scope:puppet_or_actor - text = "same_realm_as" - } - } - scope:puppet_or_actor = { - trigger_if = { - limit = { scope:actor = scope:puppet_or_actor } - custom_tooltip = { - NOT = { - var:family_widow_forbidden_divorce ?= scope:secondary_recipient - } - text = BOUND_TO_FAMILY_WIDOW - } - } - trigger_else = { - custom_tooltip = { - NOT = { - var:family_widow_forbidden_divorce ?= scope:secondary_recipient - } - text = BOUND_TO_FAMILY_WIDOW_puppeteer - } - } - } - trigger_if = { - limit = { scope:is_puppet_action ?= yes } - scope:puppet_or_actor = { - piety >= divorce_cost - } - } - trigger_if = { - limit = { scope:is_puppet_action ?= yes } - scope:puppet_or_actor = { - dynasty ?= { dynasty_prestige >= scope:puppet_or_actor.dynasty.minor_dynasty_prestige_value } - } - } - } - - ai_accept = { - base = 0 # Should be 0 for all interactions - - divorce_character_ai_accept_modifier = yes - - modifier = { # Divine Family is part of the faith - add = -100 - desc = DIVORCE_INCESTUOUS - - scope:secondary_actor = { - is_close_or_extended_family_of = scope:secondary_recipient - rite = { rite_has_tenet = tenet_divine_marriage } - } - } - - modifier = { # More likely if the marriage is incestuous, unless Divine Family is part of the faith - add = 100 - desc = DIVORCE_INCESTUOUS - - scope:secondary_actor = { - relation_with_character_is_incestuous_in_my_faith_trigger = { CHARACTER = scope:secondary_recipient } - } - } - - modifier = { # You are of the same dynasty as the Head of Faith - add = 5 - desc = YOU_ARE_MY_DYNASTY_MEMBER - scope:recipient = { - is_lowborn = no - dynasty = scope:puppet_or_actor.dynasty - NOR = { - is_close_or_extended_family_of = scope:puppet_or_actor - is_cousin_of = scope:puppet_or_actor - is_child_of = scope:puppet_or_actor - scope:recipient.dynasty = scope:secondary_recipient.dynasty - } - } - } - - - modifier = { # You are of the same house as the Head of Faith - add = 10 - desc = YOU_ARE_MY_HOUSE_MEMBER - scope:recipient = { - is_lowborn = no - house = scope:puppet_or_actor.house - NOR = { - is_close_or_extended_family_of = scope:puppet_or_actor - is_cousin_of = scope:puppet_or_actor - is_child_of = scope:puppet_or_actor - scope:recipient.house = scope:secondary_recipient.house - } - } - } - - modifier = { # Related to the Head of Faith - add = 25 - desc = YOU_ARE_MY_RELATIVE - scope:recipient = { - OR = { - is_close_or_extended_family_of = scope:puppet_or_actor - is_cousin_of = scope:puppet_or_actor - } - NOT = { is_child_of = scope:puppet_or_actor } - } - } - - modifier = { # Parent of the Head of Faith - add = 50 - desc = PARENTS #YOU_ARE_MY_PARENT - scope:recipient = { - is_child_of = scope:puppet_or_actor - } - } - - modifier = { - add = { - add = 10 - multiply = scope:puppet_or_actor.num_virtuous_traits - } - scope:puppet_or_actor.num_virtuous_traits > 0 - desc = I_AM_VIRTUOUS - } - - modifier = { - add = { - add = -10 - multiply = scope:secondary_recipient.num_virtuous_traits - } - scope:secondary_recipient.num_virtuous_traits > 0 - desc = THEY_ARE_VIRTUOUS - } - - modifier = { - add = { - add = -10 - multiply = scope:puppet_or_actor.num_sinful_traits - } - scope:puppet_or_actor.num_sinful_traits > 0 - desc = I_AM_SINFUL - } - - modifier = { - add = { - add = 10 - multiply = scope:secondary_recipient.num_sinful_traits - } - scope:secondary_recipient.num_sinful_traits > 0 - desc = THEY_ARE_SINFUL - } - modifier = { - add = 100 - scope:puppet_or_actor.puppet:theological_agent_puppet ?= scope:recipient - desc = IS_YOUR_PUPPET - } - - modifier = { - add = { - value = 25 - if = { - limit = { - pam_actor_rite_has_core_simony_trigger = yes - } - multiply = 5 - } - } - scope:donate_faith ?= yes - scope:puppet_or_actor.major_gold_value < scope:recipient.minor_gold_value - desc = DONATE_FAITH_INTERACTION_OPTION_REASON - } - modifier = { - add = { - value = 50 - if = { - limit = { - pam_actor_rite_has_core_simony_trigger = yes - } - multiply = 5 - } - } - scope:donate_faith ?= yes - scope:puppet_or_actor.major_gold_value < scope:recipient.major_gold_value - scope:puppet_or_actor.major_gold_value >= scope:recipient.minor_gold_value - desc = DONATE_FAITH_INTERACTION_OPTION_REASON - } - modifier = { - add = { - value = 75 - if = { - limit = { - pam_actor_rite_has_core_simony_trigger = yes - } - multiply = 5 - } - } - scope:donate_faith ?= yes - scope:puppet_or_actor.major_gold_value >= scope:recipient.major_gold_value - scope:puppet_or_actor.major_gold_value < scope:recipient.monumental_gold_value - desc = DONATE_FAITH_INTERACTION_OPTION_REASON - } - modifier = { - add = { - value = 100 - if = { - limit = { - pam_actor_rite_has_core_simony_trigger = yes - } - multiply = 5 - } - } - scope:donate_faith ?= yes - scope:puppet_or_actor.major_gold_value >= scope:recipient.monumental_gold_value - desc = DONATE_FAITH_INTERACTION_OPTION_REASON - } - modifier = { - add = 25 - scope:divorce_justified ?= yes - desc = JUSTIFY_DIVORCE_REASON - } - modifier = { - add = { - value = 20 - if = { - limit = { - scope:puppet_or_actor.highest_held_title_tier > scope:recipient.highest_held_title_tier - } - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = scope:recipient.highest_held_title_tier - add = 1 - } - } - else_if = { - limit = { - scope:puppet_or_actor.highest_held_title_tier < scope:recipient.highest_held_title_tier_minus_one - } - multiply = 0.25 - } - else_if = { - limit = { - scope:puppet_or_actor.highest_held_title_tier < scope:recipient.highest_held_title_tier - } - multiply = 0.5 - } - if = { - limit = { - OR = { - is_liege_or_above_of = scope:recipient - liege ?= scope:recipient.liege - capital_county.holder ?= { - OR = { - this = scope:puppet_or_actor - any_liege_or_above = { - this = scope:puppet_or_actor - } - } - } - } - } - multiply = 3 - } - else_if = { - limit = { - scope:recipient = { - OR = { - any_neighboring_top_liege_realm_owner = { - this = scope:puppet_or_actor - } - capital_county = { - any_neighboring_county = { - OR = { - holder = scope:puppet_or_actor - holder = { - any_liege_or_above = { - this = scope:puppet_or_actor - } - } - } - } - } - } - } - } - multiply = 2 - } - } - scope:threaten_priest = yes - desc = THREATEN_PRIEST_INTERACTION_OPTION_REASON - } - modifier = { - add = pam_offer_pilgrimage_acceptance_value - scope:offer_pilgrimage = yes - desc = OFFER_PILGRIMAGE_INTERACTION_OPTION_REASON - } - secular_to_ecclesiastical_pam_factors_acceptance_modifier = yes - } - - auto_accept = { - custom_description = { - text = "spending_hook" - subject = scope:puppet_or_actor - object = scope:recipient - scope:divorce_hook = yes - } - } - - options_heading = DIVORCE_INDUCEMENTS - send_option = { - is_valid = { - scope:secondary_actor = { - custom_tooltip = { - text = divorce_justified_secondary_tt - divorce_is_justified_trigger = { DIVORCER = scope:secondary_actor } - } - } - } - flag = divorce_justified - localization = JUSTIFY_DIVORCE_INTERACTION_OPTION - } - send_option = { - is_valid = { - scope:puppet_or_actor = { - dread >= medium_dread_value - current_military_strength > scope:recipient.current_military_strength - custom_tooltip = { - text = must_neighbor_recipient_tt - OR = { - any_vassal_or_below = { - this = scope:recipient - } - any_sub_realm_county = { - OR = { - clerical_region_title ?= { - holder ?= scope:recipient - } - any_neighboring_county = { - holder = { - OR = { - this = scope:recipient - any_liege_or_above = { - this = scope:recipient - } - } - } - } - } - } - } - } - } - scope:recipient = { - NOR = { - has_trait = stubborn - has_trait = brave - has_trait = arrogant - has_trait = ambitious - } - } - } - flag = threaten_priest - localization = THREATEN_PRIEST_INTERACTION_OPTION - } - send_option = { - is_valid = { - scope:puppet_or_actor = { - trigger_if = { - limit = { - scope:actor = { - is_ai = yes - } - } - short_term_gold >= massive_gold_value - } - trigger_else = { - gold >= medium_gold_value - } - } - } - flag = donate_faith - localization = DONATE_TO_THE_FAITH_INTERACTION_OPTION - } - send_option = { - is_valid = { - scope:puppet_or_actor = { - has_usable_hook = scope:recipient - } - } - flag = divorce_hook - localization = GENERIC_SPEND_A_HOOK - } - send_option = { - is_shown = { - has_pam_dlc_trigger = yes - pam_offer_pilgrimage_option_shown_trigger = { ACTOR = scope:puppet_or_actor } - } - is_valid = { - pam_offer_pilgrimage_option_valid_trigger = { ACTOR = scope:puppet_or_actor } - } - flag = offer_pilgrimage - localization = OFFER_PILGRIMAGE_INTERACTION_OPTION - } - should_use_extra_icon = { - scope:puppet_or_actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - send_options_exclusive = no - - ai_min_reply_days = 1 - ai_max_reply_days = 5 - - on_send = { - #Make sure AI always justifies divorce when valid - scope:puppet_or_actor = { - if = { - limit = { - scope:actor = { is_ai = yes } - scope:secondary_actor = { - divorce_is_justified_trigger = { DIVORCER = scope:secondary_actor } - } - NOT = { - scope:divorce_justified ?= yes - } - } - save_scope_as = ai_divorce_justified - } - } - } - - on_accept = { - if = { - limit = { scope:is_puppet_action ?= yes } - scope:puppet_or_actor = { - add_piety = { value = { add = divorce_cost max = piety multiply = -1 } } - dynasty ?= { add_dynasty_prestige = { value = { add = scope:puppet_or_actor.dynasty.minor_dynasty_prestige_value multiply = -1 } } } - } - } - scope:secondary_actor = { - save_scope_as = divorcer - } - scope:puppet_or_actor = { - save_scope_as = forcing_divorce - } - scope:recipient = { - if = { - limit = { - #No inducement given - NOR = { - scope:divorce_hook ?= yes - scope:donate_faith ?= yes - scope:divorce_justified ?= yes - exists = scope:ai_divorce_justified - scope:threaten_priest ?= yes - scope:offer_pilgrimage ?= yes - } - #One of the methods is possible - OR = { - divorce_can_cause_house_feud_trigger = yes - divorce_can_cause_holy_order_lease_trigger = yes - divorce_can_cause_hook_trigger = yes - divorce_can_put_spouse_in_monastery_trigger = yes - } - } - custom_tooltip = cleric_divorce_fuckery_tt - if = { - limit = { - divorce_can_cause_house_feud_trigger = yes - } - custom_tooltip = cleric_cause_house_feud_tt - } - if = { - limit = { - divorce_can_cause_holy_order_lease_trigger = yes - } - custom_tooltip = cleric_force_holy_order_lease_tt - } - if = { - limit = { - divorce_can_cause_hook_trigger = yes - } - custom_tooltip = cleric_get_hook_forcer_tt - } - if = { - limit = { - divorce_can_put_spouse_in_monastery_trigger = yes - } - custom_tooltip = cleric_put_spouse_in_monastery_tt - } - save_scope_as = no_inducement - } - } - show_as_tooltip = { - scope:secondary_actor = { - divorce_effect = { - DIVORCER = scope:secondary_actor - DIVORCEE = scope:secondary_recipient - } - } - } - - if = { - limit = { always = scope:divorce_hook } - scope:puppet_or_actor = { - if = { - limit = { - has_usable_hook = scope:recipient - } - use_hook = scope:recipient - } - } - } - scope:puppet_or_actor = { - if = { - limit = { - scope:donate_faith ?= yes - } - pay_short_term_gold = { - target = scope:recipient - gold = scope:puppet_or_actor.medium_gold_value - } - } - } - pam_offer_pilgrimage_effect = { - ACTOR = scope:puppet_or_actor - CLERIC = scope:recipient - } - if = { - limit = { - NOR = { - scope:divorce_justified ?= yes - exists = scope:ai_divorce_justified - } - } - if = { - limit = { - scope:recipient = { - is_ai = no - } - } - scope:recipient = { - change_spiritual_fulfillment = minor_spiritual_fulfillment_loss - } - } - else = { - hidden_effect = { - scope:recipient = { - change_spiritual_fulfillment = miniscule_spiritual_fulfillment_loss - } - } - } - } - else = { - scope:recipient = { add_piety = minor_piety_gain } - } - - scope:secondary_actor = { - add_opinion = { - modifier = forced_divorce_opinion - target = scope:puppet_or_actor - } - } - - scope:secondary_recipient = { - add_opinion = { - modifier = forced_divorce_opinion - target = scope:puppet_or_actor - } - } - #For follow-up event - scope:secondary_actor = { - save_scope_as = actor - save_scope_as = puppet_or_actor - } - #Recipient is free to fuck with the divorce - if = { - limit = { - exists = scope:no_inducement - } - scope:recipient = { - trigger_event = pam_interactions_events.0060 - } - } - #Actor just gets confirmation directly - else = { - scope:forcing_divorce = { - trigger_event = religious_interaction.6 - } - } - } - - on_decline = { - scope:puppet_or_actor = { - send_interface_toast = { - type = event_toast_effect_bad - title = divorce_character_dynast_request_rel_head_interaction_decline_notification - - right_icon = scope:recipient - clerical_interaction_refusal_minor_effect = yes - } - } - if = { - limit = { - scope:recipient = { - is_ai = no - } - scope:actor = { - is_ai = yes - } - } - scope:secondary_actor = { - save_scope_as = actor - save_scope_as = puppet_or_actor - } - scope:recipient = { - if = { - limit = { - learning > extremely_high_skill_rating - scope:actor = { - is_ai = yes - } - NOR = { - rite = { - trait_is_virtue_rite = lustful - } - rite = { - trait_is_sin_rite = chaste - } - scope:puppet_or_actor = { - has_trait = lustful - } - } - } - custom_tooltip = refuse_divorce_celibacy_tt - } - if = { - limit = { - scope:puppet_or_actor = { - is_imprisoned = no - is_incapable = no - } - scope:secondary_recipient = { - is_imprisoned = no - is_incapable = no - } - } - custom_tooltip = refuse_divorce_comfort_tt - } - custom_tooltip = refuse_divorce_condemn_tt - trigger_event = { - id = pam_interactions_events.0050 - days = 1 - } - #Gain stress for ignoring threat from actor - if = { - limit = { - scope:threaten_priest ?= yes - } - if = { - limit = { - ai_boldness < 0 - } - add_stress = major_stress_gain - } - else = { - add_stress = medium_stress_gain - } - } - } - } - } - - # AI - ai_targets = { - ai_recipients = dynasty - max = 10 - } - ai_frequency_by_tier = { - barony = 0 - county = 144 - duchy = 72 - kingdom = 72 - empire = 72 - hegemony = 72 - } - - ai_will_do = { - base = 0 - - modifier = { # The AI wants to force a divorce if their heir is not from their dynasty and current marriage within the dynasty are not promising - add = 100 - scope:secondary_actor = { - fertility > 0.1 - } - scope:secondary_recipient = { - is_ai = yes - fertility < 0.1 - } - exists = scope:puppet_or_actor.primary_heir - exists = scope:puppet_or_actor.primary_heir.dynasty - scope:puppet_or_actor.primary_heir.dynasty != this.dynasty - } - - modifier = { # The AI will only use a Hook if they couldn't otherwise do this - scope:divorce_hook = yes - add = -1 - } - - #Players should not be targeted - modifier = { - add = -1000 - OR = { - scope:secondary_actor = { is_ai = no } - scope:secondary_recipient = { is_ai = no } - } - } - modifier = { - add = -66 - scope:secondary_actor = { - NOT = { divorce_is_justified_trigger = { DIVORCER = scope:secondary_actor } } - } - } - } -} - -elope_interaction = { - icon = icon_scheme_elope - category = interaction_category_friendly - - scheme = elope - - desc = elope_interaction_desc - - notification_text = elope_interaction_notification - - ai_targets = { - ai_recipients = realm_characters - chance = 0.25 - } - - ai_target_quick_trigger = { - adult = yes - attracted_to_owner = yes - owner_attracted = yes - } - ai_frequency_by_tier = { - barony = 0 - county = 144 - duchy = 36 - kingdom = 0 - empire = 0 - hegemony = 0 - } - - redirect = { - scope:recipient = { - save_scope_as = secondary_recipient - } - } - - is_available = { - trigger_if = { - limit = { is_ai = yes } - OR = { - any_relation = { type = lover } - any_relation = { type = soulmate } - } - NOR = { - has_trait = celibate - scheme_generic_ai_blocker_trigger = yes - } - is_adult = yes - } - } - - is_shown = { - scope:actor = { - OR = { - has_relation_lover = scope:recipient - has_relation_soulmate = scope:recipient - AND = { - has_perk = accomplished_forger_perk - has_government = landless_adventurer_government - } - } - } - scope:recipient = { - is_adult = yes - is_courtier = yes - NOR = { - is_courtier_of = scope:actor - is_consort_of = scope:actor - } - could_marry_character_trigger = { CHARACTER = scope:actor } - } - } - - - is_valid_showing_failures_only = { - scope:actor = { - can_start_scheme = { - type = elope - target_character = scope:recipient - } - } - - trigger_if = { #For landless adventurers we check range. - limit = { - scope:actor = { - is_landless_adventurer = yes - } - } - ep3_laamp_diplo_range_trigger = { - TARGET = scope:recipient - LAAMP = scope:actor - } - } - } - - - ai_accept = { - base = 0 - - elopment_ai_accept_modifier = yes - } - - ai_min_reply_days = 1 - ai_max_reply_days = 3 - - on_send = { - scope:actor = { - if = { - limit = { - OR = { - has_character_modifier = pam_granted_indulgences_modifier - has_character_modifier = pam_granted_indulgences_modifier_small - } - } - change_spiritual_fulfillment = medium_spiritual_fulfillment_loss - } - } - } - - on_accept = { - scope:actor = { - stress_and_fulfillment_impact = { - honest = minor_stress_impact_gain - just = minor_stress_impact_gain - } - show_as_tooltip = { - elope_success_effect = { - TARGET = scope:recipient - OWNER = scope:actor - } - } - } - hidden_effect = { - scope:actor = { - send_interface_toast = { - type = event_toast_effect_good - title = elope_interaction_notification - - left_icon = scope:actor - right_icon = scope:recipient - - begin_scheme_basic_effect = { - SCHEME_TYPE = elope - TARGET_TYPE = target_character - TARGET_SCOPE = scope:recipient - } - - show_as_tooltip = { - stress_and_fulfillment_impact = { - honest = minor_stress_impact_gain - just = minor_stress_impact_gain - } - } - } - } - } - } - - on_decline = { - scope:actor = { - send_interface_toast = { - type = event_toast_effect_bad - title = elope_interaction_decline_toast - left_icon = scope:recipient - } - } - } - - ai_will_do = { - base = 100 - - #Promised to abstain from sin - modifier = { - OR = { - has_character_modifier = pam_granted_indulgences_modifier - has_character_modifier = pam_granted_indulgences_modifier_small - } - factor = 0.1 - } - } -} diff --git a/common/character_interactions/00_war.txt b/common/character_interactions/00_war.txt deleted file mode 100644 index 2d3f82425..000000000 --- a/common/character_interactions/00_war.txt +++ /dev/null @@ -1,2191 +0,0 @@ -declare_war_interaction = { - category = interaction_category_diplomacy - common_interaction = yes - special_interaction = declare_war_interaction - interface = declare_war - interface_priority = 80 - popup_on_receive = yes - pause_on_receive = no # this is handled by the interface instead - - desc = declare_war_desc - - is_shown = { - scope:recipient != scope:puppet_or_actor - # Only differs from puppet_or_actor on puppet actions; a puppet cannot be ordered to attack their own puppeteer - scope:recipient != scope:actor - scope:recipient = { - is_playable_character = yes - } - scope:puppet_or_actor ?= { - NOT = { - is_at_war_with = scope:recipient - } - } - } - - is_valid_showing_failures_only = { - scope:puppet_or_actor = { - trigger_if = { - limit = { government_has_flag = government_is_theocracy } - custom_tooltip = { - text = theocratic_government_war_restriction - has_any_display_cb_on = scope:recipient - } - } - trigger_else = { - has_any_display_cb_on = scope:recipient - } - allows_declaring_war_against_target_trigger = { TARGET = scope:recipient } - } - } - - has_valid_target_showing_failures_only = { - custom_description = { - text = "declare_war_hook_on_liege" - OR = { - scope:puppet_or_actor = { war_declarer_needs_hook_on_liege = no } - always = scope:hook - } - } - scope:puppet_or_actor = { - NOR = { - is_at_war_with = scope:recipient - custom_description = { #A vassal cannot go to war against someone their Liege is already at war with - text = liege_is_at_war_with_recipient - object = scope:recipient - liege = { - is_at_war_with = scope:recipient - } - } - } - } - } - - send_options_exclusive = no - send_option = { - is_shown = { - scope:puppet_or_actor = { war_declarer_needs_hook_on_liege = yes } - } - is_valid = { - scope:puppet_or_actor = { - has_usable_hook = liege - } - } - flag = hook - localization = WAR_LIEGE_HOOK - can_invalidate_interaction = yes - } - should_use_extra_icon = { - scope:puppet_or_actor = { war_declarer_needs_hook_on_liege = yes } - scope:puppet_or_actor = { has_usable_hook = liege } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - on_accept = { - scope:puppet_or_actor = { - #Feedback! - hidden_effect = { - send_interface_toast = { - type = event_toast_effect_neutral - title = declare_war_interaction_notification - - left_icon = scope:puppet_or_actor - right_icon = scope:recipient - - custom_tooltip = declare_war_interaction_notification_tooltip - - show_as_tooltip = { - if = { - limit = { always = scope:hook } - use_hook = liege - } - } - } - } - - #Has the instigator promised a vassal a war (vassal.2601)? - if = { - limit = { - exists = var:promised_war - var:promised_war = { - is_alive = yes - this != scope:recipient - } - } - trigger_event = { - id = vassal.2610 - days = { 7 10 } - } - } - - if = { - limit = { always = scope:hook } - use_hook = liege - } - - #Send break up event if they are your lover - if = { - limit = { - has_relation_lover = scope:recipient - NOT = { has_relation_rival = scope:recipient } #To enable really strange love stories - any_character_war = { - casus_belli = { - primary_attacker = scope:puppet_or_actor - primary_defender = scope:recipient - any_target_title = { } - } - } - } - scope:recipient = { - trigger_event = { - id = lover.0103 - days = { 14 30 } - } - } - } - - #Invalidate any wars your vassals have going against recipient atm - scope:recipient = { - if = { - limit = { - any_character_war = { - primary_attacker = { - is_vassal_or_below_of = scope:puppet_or_actor - trigger_if = { #Ai should never invalidate a player's war! - limit = { - this = { is_ai = no } - } - scope:actor = { - is_ai = no - } - } - } - } - } - every_character_war = { - limit = { - primary_attacker = { - is_vassal_or_below_of = scope:puppet_or_actor - trigger_if = { #Ai should never invalidate a player's war! - limit = { - this = { is_ai = no } - } - scope:actor = { - is_ai = no - } - } - } - } - show_as_tooltip = { end_war = invalidated } #Actually ended in the event - primary_attacker = { trigger_event = war_event.1001 } - } - } - } - #Notify defender's vassals if the war is targeting one or more of their titles - scope:recipient = { - if = { - limit = { - any_vassal = { - save_temporary_scope_as = attacked_vassal - any_character_war = { - casus_belli = { - primary_attacker = scope:puppet_or_actor - primary_defender = scope:recipient - any_target_title = { - holder = { - OR = { - this = scope:attacked_vassal - is_vassal_or_below_of = scope:attacked_vassal - } - } - } - } - } - } - } - every_vassal = { - save_temporary_scope_as = attacked_vassal - limit = { - any_character_war = { - casus_belli = { - primary_attacker = scope:puppet_or_actor - primary_defender = scope:recipient - any_target_title = { - holder = { - OR = { - this = scope:attacked_vassal - is_vassal_or_below_of = scope:attacked_vassal - } - } - } - } - } - } - send_interface_toast = { - type = msg_war_declared_on_liege - title = declare_war_interaction_notification - - left_icon = scope:puppet_or_actor - right_icon = scope:recipient - - custom_tooltip = declare_war_interaction_notification_tooltip - } - } - } - } - - # If you are admin and had permission to start war, spend said permission - if = { - limit = { - has_variable = admin_permission_to_declare_war - } - remove_variable = admin_permission_to_declare_war - } - } - hidden_effect = { - if = { - limit = { - scope:is_puppet_action ?= yes - } - scope:actor = { - send_interface_toast = { - type = event_toast_effect_neutral - title = declare_war_interaction_notification - - left_icon = scope:puppet_or_actor - right_icon = scope:recipient - - custom_tooltip = declare_war_interaction_notification_tooltip - } - } - } - } - } - - auto_accept = yes -} - -end_war_attacker_victory_interaction = { - special_interaction = end_war_attacker_victory_interaction - hidden = yes - use_diplomatic_range = no - secondary_scopes_optional = yes - - ai_targets = { - ai_recipients = primary_war_enemies - } - - ai_frequency_by_tier = { - barony = 0 - county = 1 - duchy = 1 - kingdom = 1 - empire = 1 - hegemony = 1 - } - - # Depending on who was the attacker, we need to send a different notification message to the recipient. - notification_text = { - first_valid = { - triggered_desc = { - trigger = { - scope:recipient = { - any_character_war = { - casus_belli = { - primary_attacker = scope:actor - } - } - } - } - desc = end_war_attacker_victory_attacker_desc - } - desc = end_war_attacker_victory_defender_desc - } - } - - populate_actor_list = { - scope:actor = { - every_close_family_member = { - limit = { - # Unlanded, at sender's court, child/sibling/nibling/grandchild - bp2_valid_to_offer_as_hostage_trigger = { SENDER = scope:actor } - } - add_to_list = characters - } - } - } - - populate_recipient_list = { - scope:recipient = { - every_close_family_member = { - limit = { - # Unlanded, at sender's court, child/sibling/nibling/grandchild - bp2_valid_to_offer_as_hostage_trigger = { SENDER = scope:recipient } - } - add_to_list = characters - } - } - } - - can_be_picked = { - scope:war ?= { - custom_tooltip = { - text = hostage_exchange_invalid_for_crusade_tt - NOR = { - using_cb = undirected_great_holy_war - using_cb = directed_great_holy_war - } - } - custom_tooltip = { - text = hostage_exchange_invalid_for_cb_tt - bp2_hostage_exchange_invalid_cb_trigger = no - } - } - } - - redirect = { - # secondary recipient is always set, so we need to clear it - # if can_send condition depends on the scope being empty - clear_saved_scope = secondary_recipient - } - - on_accept = { - scope:war ?= { - casus_belli = { - primary_attacker = { - save_scope_as = attacker_winner - set_signature_weapon_effect = yes - } - primary_defender = { - save_scope_as = defender_loser - } - } - if = { - limit = { - NOT = { using_cb = fp3_free_house_member_cb } - } - release_prisoners_of_war_effect = yes - } - } - - - # Hostages - # Save scopes for clarity - if = { - limit = { - scope:war ?= { - NOR = { - using_cb = undirected_great_holy_war - using_cb = directed_great_holy_war - } - bp2_hostage_exchange_invalid_cb_trigger = no - } - } - if = { - limit = { - exists = scope:secondary_actor - scope:recipient = { is_landed_or_landless_administrative_or_theocratic = yes } - } - hostage_depart_effect = { - HOSTAGE = scope:secondary_actor - WARDEN = scope:recipient - HOME_COURT = scope:actor - } - } - if = { - limit = { - exists = scope:secondary_recipient - scope:actor = { is_landed_or_landless_administrative_or_theocratic = yes } - } - hostage_depart_effect = { - HOSTAGE = scope:secondary_recipient - WARDEN = scope:actor - HOME_COURT = scope:recipient - } - } - } - - #Send notification to vassals - hidden_effect = { - scope:attacker_winner = { - if = { - limit = { - any_vassal = { - this != scope:defender_loser - } - } - every_vassal = { - limit = { this != scope:defender_loser } - send_interface_toast = { - type = msg_liege_war_ended_attacker_win - title = war_event.notification_liege_win.t - left_icon = scope:attacker_winner - right_icon = scope:defender_loser - custom_tooltip = war_event.1901 - } - } - } - } - scope:defender_loser = { - if = { - limit = { - any_vassal = { this != scope:attacker_winner } - } - every_vassal = { - limit = { - this != scope:attacker_winner - } - send_interface_toast = { - type = msg_liege_war_ended_attacker_win - title = war_event.notification_liege_loss.t - left_icon = scope:defender_loser - right_icon = scope:attacker_winner - custom_tooltip = war_event.1902 - } - } - } - } - } - - #Special bookmark event for Aella of Northumbria - bookmark_867_northmen_aellas_capture_war_imprisonment_effect = yes - - scope:war ?= { - end_war = attacker - } - } - - on_decline = { - } - - ai_will_do = { - base = 0 - - modifier = { - scope:war = { - primary_attacker = scope:actor - OR = { - attacker_war_score >= 100 - AND = { - OR = { - attacker_war_score >= 90 - AND = { - attacker_war_score >= 80 - root = { - dynasty ?= { has_dynasty_perk = mpo_nomad_legacy_3 } - } - } - } - root = { - has_perk = peacemaker_perk - } - primary_defender = { - is_ai = yes - } - } - AND = { - OR = { - attacker_war_score >= 90 - AND = { - attacker_war_score >= 80 - root = { - has_perk = peacemaker_perk - } - } - } - root = { - dynasty ?= { has_dynasty_perk = mpo_nomad_legacy_3 } - } - primary_defender = { - is_ai = yes - } - } - #SENT A SCARY SEVERED HEAD AAAAHHH - AND = { - attacker_war_score >= 70 - primary_defender = { - is_ai = yes - save_temporary_scope_as = defender - } - root = { - has_variable = peace_acceptance_head_scare - var:peace_acceptance_head_scare = { - this = scope:defender - } - } - } - AND = { - NOR = { - using_cb = undirected_great_holy_war - using_cb = mongol_invasion_war - using_cb = mongol_realm_invasion_war - using_cb = mpo_gok_onslaught_cb - } - primary_defender = { - is_ai = yes - has_variable = conqueror - } - } - } - } - add = 100 - } - modifier = { - scope:war = { - primary_defender = scope:actor - attacker_war_score >= 100 - days_since_max_war_score >= 180 - } - add = 100 - } - } - - ai_accept = { - base = -99 - - compare_modifier = { - target = scope:war - value = attacker_war_score - desc = "WARSCORE_MODIFIER" - } - modifier = { - scope:war.casus_belli = { - primary_attacker = { - has_perk = peacemaker_perk - this != scope:recipient - } - } - - add = peacemaker_value - - desc = "PEACEMAKER_PERK_MODIFIER" - } - modifier = { - scope:war.casus_belli = { - primary_attacker = { - dynasty ?= { has_dynasty_perk = mpo_nomad_legacy_3 } - NOT = { this = scope:recipient } - } - } - - add = 10 - - desc = "NOMAD_LEGACY_PERK_MODIFIER" - } - modifier = { - scope:war.casus_belli = { - primary_defender = { - save_temporary_scope_as = defender - } - primary_attacker = { - has_variable = peace_acceptance_head_scare - var:peace_acceptance_head_scare = { - this = scope:defender - } - } - primary_defender = { - is_ai = yes - } - } - add = 30 - desc = "COWED_BY_SEVERED_HEAD_MODIFIER" - } - - # Hostages - modifier = { - exists = scope:secondary_actor - add = war_actor_hostage_value - desc = WAR_OVERVIEW_HOSTAGE_OFFER_VALUE - } - modifier = { - exists = scope:secondary_recipient - add = war_recipient_hostage_value - desc = WAR_OVERVIEW_HOSTAGE_DEMAND_VALUE - } - # The AI cannot accept the outcome, if they will lose all their land and you try to take a hostage from them - modifier = { - scope:war = { - OR = { - exists = scope:secondary_actor - exists = scope:secondary_recipient - } - casus_belli = { - any_target_title = { - count >= 1 - add_to_temporary_list = target_titles - } - } - NOT = { - scope:recipient = { - any_held_title = { - tier = tier_county - NOT = { - any_this_title_or_de_jure_above = { is_in_list = target_titles } - } - } - } - } - } - add = -10000 - desc = WAR_OVERVIEW_HOSTAGE_DEMAND_BLOCKED - } - # This is a bit of a hidden modifier, only used to make sure we get the right icon when you force it through at 100 war score, and the opponent has more realm left - modifier = { - scope:war = { - attacker_war_score >= 100 - OR = { - exists = scope:secondary_actor - exists = scope:secondary_recipient - } - casus_belli = { - any_target_title = { - count >= 1 - add_to_temporary_list = target_titles - } - } - scope:recipient = { - any_held_title = { - tier = tier_county - NOT = { - any_this_title_or_de_jure_above = { is_in_list = target_titles } - } - } - } - } - add = 1000 - desc = "WARSCORE_MODIFIER" - } - } - - auto_accept = { - trigger_if = { - limit = { - OR = { - scope:war = { - attacker_war_score >= 100 - } - AND = { - scope:recipient = { is_ai = yes } - scope:war.casus_belli.primary_attacker ?= scope:recipient - } - scope:war.casus_belli = { # Conquerors know when to fold - primary_attacker = { - is_ai = yes - current_military_strength >= scope:recipient.fifty_percent_more_of_current_military_strength - } - primary_defender = { - is_ai = yes - has_variable = conqueror - this = scope:recipient - } - } - } - } - always = yes - } - trigger_else = { - always = no - } - # The auto accept kind of messes up the hostage interaction a bit, so we block the auto accept if they try to grab a hostage and all the opponent's land at the same time - scope:war = { - trigger_if = { - limit = { - OR = { - exists = scope:secondary_actor - exists = scope:secondary_recipient - } - casus_belli = { - any_target_title = { - count >= 1 - add_to_temporary_list = target_titles - } - } - NOT = { - scope:recipient = { - any_held_title = { - tier = tier_county - NOT = { - any_this_title_or_de_jure_above = { is_in_list = target_titles } - } - } - } - } - } - always = no - } - } - } - - is_available = { - trigger_if = { - limit = { is_ai = yes } - is_at_war = yes - any_character_war = { - is_war_leader = root - OR = { - attacker_war_score >= 100 - AND = { - primary_defender ?= { - is_ai = yes - } - OR = { - attacker_war_score >= 90 - AND = { - root = { - dynasty ?= { has_dynasty_perk = mpo_nomad_legacy_3 } - } - attacker_war_score >= 80 - } - } - root = { - has_perk = peacemaker_perk - } - } - AND = { - primary_defender ?= { - is_ai = yes - } - root = { - dynasty ?= { has_dynasty_perk = mpo_nomad_legacy_3 } - } - OR = { - attacker_war_score >= 90 - AND = { - root = { - has_perk = peacemaker_perk - } - attacker_war_score >= 80 - } - } - } - #SENT A SCARY SEVERED HEAD AAAAHHH - AND = { - primary_defender ?= { - save_temporary_scope_as = defender - is_ai = yes - } - attacker_war_score >= 70 - root = { - has_variable = peace_acceptance_head_scare - var:peace_acceptance_head_scare ?= { - this = scope:defender - } - } - } - primary_defender ?= { - is_ai = yes - has_variable = conqueror - } - } - } - } - } - - is_valid_showing_failures_only = { - scope:war = { - has_valid_casus_belli = yes - trigger_if = { # Cannot exchange hostages with soon to be landless - limit = { - OR = { - exists = scope:secondary_actor - exists = scope:secondary_recipient - } - casus_belli = { - any_target_title = { - count >= 1 - add_to_temporary_list = target_titles - } - } - } - custom_tooltip = { - text = hostage_no_land_after_war_tt - scope:recipient = { - any_held_title = { - title_tier = county - NOT = { - any_this_title_or_de_jure_above = { is_in_list = target_titles } - } - } - } - } - } - } - } -} - -end_war_attacker_white_peace_interaction = { - - special_interaction = end_war_white_peace_interaction - hidden = yes - use_diplomatic_range = no - secondary_scopes_optional = yes - send_name = "WHITE_PEACE_INTERACTION" - - ai_targets = { - ai_recipients = primary_war_enemies - } - - ai_frequency_by_tier = { - barony = 0 - county = 12 - duchy = 12 - kingdom = 12 - empire = 12 - hegemony = 12 - } - - # Depending on who was the attacker, we need to send a different notification message to the recipient. - notification_text = { - first_valid = { - triggered_desc = { - trigger = { - scope:recipient = { - any_character_war = { - casus_belli = { - primary_attacker = scope:actor - } - } - } - } - desc = end_war_attacker_white_peace_attacker_desc - } - desc = end_war_attacker_white_peace_defender_desc - } - } - - redirect = { - # secondary recipient is always set, so we need to clear it - # if can_send condition depends on the scope being empty - clear_saved_scope = secondary_recipient - } - - populate_actor_list = { - scope:actor = { - every_close_family_member = { - limit = { - # Unlanded, at sender's court, child/sibling/nibling/grandchild - bp2_valid_to_offer_as_hostage_trigger = { SENDER = scope:actor } - } - add_to_list = characters - } - } - } - - populate_recipient_list = { - scope:recipient = { - every_close_family_member = { - limit = { - # Unlanded, at sender's court, child/sibling/nibling/grandchild - bp2_valid_to_offer_as_hostage_trigger = { SENDER = scope:recipient } - } - add_to_list = characters - } - } - } - - can_be_picked = { - scope:war ?= { - custom_tooltip = { - text = hostage_exchange_invalid_for_crusade_tt - NOR = { - using_cb = undirected_great_holy_war - using_cb = directed_great_holy_war - } - } - custom_tooltip = { - text = hostage_exchange_invalid_for_cb_tt - bp2_hostage_exchange_invalid_cb_trigger = no - } - } - } - - on_accept = { - scope:war ?= { - casus_belli = { - primary_attacker = { - save_scope_as = attacker_white_peace - } - primary_defender = { - save_scope_as = defender_white_peace - } - } - if = { - limit = { - NOT = { using_cb = fp3_free_house_member_cb } - } - release_prisoners_of_war_effect = yes - } - } - - # Hostages - # Save scopes for clarity - if = { - limit = { - scope:war ?= { - NOR = { - using_cb = undirected_great_holy_war - using_cb = directed_great_holy_war - } - bp2_hostage_exchange_invalid_cb_trigger = no - } - } - if = { - limit = { - exists = scope:secondary_actor - scope:recipient = { is_landed_or_landless_administrative_or_theocratic = yes } - } - hostage_depart_effect = { - HOSTAGE = scope:secondary_actor - WARDEN = scope:recipient - HOME_COURT = scope:actor - } - } - if = { - limit = { - exists = scope:secondary_recipient - scope:actor = { is_landed_or_landless_administrative_or_theocratic = yes } - } - hostage_depart_effect = { - HOSTAGE = scope:secondary_recipient - WARDEN = scope:actor - HOME_COURT = scope:recipient - } - } - } - - #Send notification to vassals - hidden_effect = { - scope:attacker_white_peace = { - if = { - limit = { - any_vassal = { this != scope:defender_white_peace } - } - every_vassal = { - limit = { - this != scope:defender_white_peace - } - send_interface_toast = { - type = msg_liege_war_ended_white_peace - title = WAR_RESULTS_WHITE_PEACE - left_icon = scope:attacker_white_peace - right_icon = scope:defender_white_peace - custom_tooltip = war_event.1903 - } - } - } - } - scope:defender_white_peace = { - if = { - limit = { - any_vassal = { this != scope:attacker_white_peace } - } - every_vassal = { - limit = { - this != scope:attacker_white_peace - } - send_interface_toast = { - type = msg_liege_war_ended_white_peace - title = WAR_RESULTS_WHITE_PEACE - left_icon = scope:defender_white_peace - right_icon = scope:attacker_white_peace - custom_tooltip = war_event.1904 - } - } - } - } - } - - scope:war ?= { - end_war = white_peace - } - } - - on_decline = { - } - - ai_will_do = { - base = 0 - - # Attacker concerned about defending in other wars - modifier = { - scope:war.casus_belli = { - primary_attacker = root - } - scope:war = { - war_days >= 365 - attacker_war_score <= 0 - } - any_character_war = { - this != scope:war - casus_belli = { - primary_defender = root - } - } - add = { - value = 10 - if = { - limit = { - scope:war = { - attacker_war_score <= -50 - } - } - add = 40 - } - } - } - - # Attacker Greed - ai_value_modifier = { - ai_greed = { - if = { - limit = { - scope:war.casus_belli = { - primary_attacker = root - } - scope:war = { - war_days >= 365 - attacker_war_score <= 10 - } - ai_greed > -20 - } - value = -0.25 - } - } - ai_vengefulness = { - if = { - limit = { ai_vengefulness > 0 } - value = -1 - } - } - } - - # Defender prefers White Peace to loss - modifier = { - scope:war.casus_belli = { - primary_defender = root - } - scope:war = { - war_days >= 182 - defender_war_score <= 15 - } - add = { - value = 10 - if = { - limit = { - scope:war = { - defender_war_score <= -40 - } - } - add = 50 - } - } - } - - # Defenders want to end wars that's taking too long to win - modifier = { - scope:war.casus_belli = { - primary_defender = root - } - scope:war = { - war_days >= 365 - } - add = { - value = scope:war.war_days - divide = 30 - if = { - limit = { - scope:war = { - defender_war_score > 0 - } - } - subtract = scope:war.defender_war_score - } - if = { # If you're this close, perhaps it's worth waiting a few more months for ticking warscore? - limit = { - scope:war = { - defender_war_score >= 70 - } - } - subtract = scope:war.defender_war_score - } - min = 0 - } - } - - # I'm in debt, how about a white peace? Defender - modifier = { - scope:war = { - war_days >= 182 - } - scope:war.casus_belli = { - primary_defender = root - } - OR = { - debt_level >= 1 - treasury_debt_level >= 1 - } - - add = { - value = debt_level - multiply = 20 - - if = { - limit = { scope:war = { defender_war_score > 0 }} - subtract = scope:war.defender_war_score - } - if = { # Push through to the end, it's worth it at this point... - limit = { scope:war = { defender_war_score >= 80 }} - subtract = scope:war.defender_war_score - } - min = 0 - } - } - - - # I'm in debt, how about a white peace? Attacker - modifier = { - scope:war = { - war_days >= 182 - } - scope:war.casus_belli = { - primary_attacker = root - } - OR = { - debt_level >= 1 - treasury_debt_level >= 1 - } - - - add = { - value = debt_level - multiply = 20 - - if = { - limit = { scope:war = { attacker_war_score > 0 }} - subtract = scope:war.attacker_war_score - } - min = 0 - } - } - - # Do not attempt white peace vs. players if you're losing - modifier = { - OR = { - AND = { - scope:war.casus_belli = { - primary_attacker = root - primary_defender = { is_ai = no } - } - scope:war = { - defender_war_score >= 30 - } - } - AND = { - scope:war.casus_belli = { - primary_defender = root - primary_attacker = { is_ai = no } - } - scope:war = { - attacker_war_score >= 30 - } - } - } - factor = 0 - } - # Can end with hostages of equalish value - modifier = { - exists = scope:secondary_recipient - exists = scope:secondary_actor - scope:war = { - war_days >= 365 - NOR = { - defender_war_score >= 30 - attacker_war_score >= 30 - } - } - trigger_if = { - limit = { scope:war.primary_attacker = scope:actor } - interaction_relative_hostage_value > -10 - } - trigger_else = { interaction_relative_hostage_value > -20 } - add = { - value = 0 - if = { - limit = { interaction_relative_hostage_value < 0 } - add = { - value = interaction_relative_hostage_value - multiply = -1 - } - } - else = { add = interaction_relative_hostage_value } - if = { - limit = { scope:actor.ai_boldness < 0 } - add = { - value = scope:actor.ai_boldness - multiply = -0.25 - } - } - if = { - limit = { scope:actor.ai_honor < 0 } - add = { - value = scope:actor.ai_honor - multiply = 0.1 - } - } - else = { - add = { - value = scope:actor.ai_honor - multiply = 0.25 - } - } - if = { - limit = { scope:actor.ai_rationality < 0 } - add = { - value = scope:actor.ai_rationality - multiply = 0.1 - } - } - else = { - add = { - value = scope:actor.ai_rationality - multiply = 0.25 - } - } - if = { - limit = { scope:actor.ai_greed > 0 } - add = { - value = scope:actor.ai_greed - multiply = -0.1 - } - } - else = { - add = { - value = scope:actor.ai_greed - multiply = -0.25 - } - } - } - } - # Can end with hostage demand - modifier = { - exists = scope:secondary_recipient - NOT = { exists = scope:secondary_actor } - scope:war = { - war_days >= 365 - NOR = { - defender_war_score >= 30 - attacker_war_score >= 30 - } - } - add = { - value = 0 - add = { - value = interaction_recipient_hostage_value - multiply = 0.1 - } - if = { - limit = { scope:actor.ai_boldness < 0 } - add = { - value = scope:actor.ai_boldness - multiply = -0.25 - } - } - if = { - limit = { scope:actor.ai_honor < 0 } - add = { - value = scope:actor.ai_honor - multiply = -0.25 - } - } - else = { - add = { - value = scope:actor.ai_honor - multiply = 0.25 - } - } - if = { - limit = { scope:actor.ai_rationality < 0 } - add = { - value = scope:actor.ai_rationality - multiply = 0.25 - } - } - else = { - add = { - value = scope:actor.ai_rationality - multiply = 0.25 - } - } - if = { - limit = { scope:actor.ai_greed > 0 } - add = { - value = scope:actor.ai_greed - multiply = 0.25 - } - } - else = { - add = { - value = scope:actor.ai_greed - multiply = -0.1 - } - } - } - } - - # I don't have time for this, I need to conquer - modifier = { - scope:war.casus_belli = { - primary_defender = { - this = scope:actor - has_variable = conqueror - } - primary_attacker = { is_ai = yes } - } - - add = 100 - } - } - - ai_accept = { - base = -30 - compare_modifier = { - trigger = { - scope:war.casus_belli = { - primary_defender = scope:recipient - } - } - target = scope:war - value = attacker_war_score - desc = "WARSCORE_MODIFIER" - } - compare_modifier = { - trigger = { - scope:war.casus_belli = { - primary_attacker = scope:recipient - } - } - target = scope:war - value = defender_war_score - desc = "WARSCORE_MODIFIER" - } - - # Length of War - compare_modifier = { - target = scope:war - trigger = { - scope:war = { - war_days >= 365 - } - } - value = { - value = war_days - divide = 91 # 40 in 10 years - } - desc = "WAR_LENGTH" - } - - # I'm in debt, how about a white peace? - modifier = { - scope:war = { - war_days >= 182 - } - scope:war.casus_belli = { - primary_defender = root - } - OR = { - debt_level >= 1 - treasury_debt_level >= 1 - } - - - add = { - value = debt_level - multiply = 20 - } - desc = COMPLETELY_BANKRUPT - } - - # Attacker concerned about other wars - modifier = { - scope:war.casus_belli = { - primary_attacker = scope:recipient - } - scope:recipient = { - any_character_war = { - this != scope:war - primary_defender = scope:recipient - } - } - add = 10 - - desc = CONCERN_ABOUT_OTHER_WARS - } - - # Vengefulness - ai_value_modifier = { - trigger = { - scope:war.casus_belli = { - primary_defender = scope:recipient - } - } - ai_vengefulness = { - if = { - limit = { - scope:war.casus_belli = { - primary_defender = scope:recipient - } - } - value = -0.25 - } - } - ai_greed = { - if = { - limit = { - scope:war.casus_belli = { - primary_attacker = scope:recipient - } - } - value = -0.25 - } - } - ai_zeal = { - value = -0.2 - if = { - limit = { - faith = { - faith_hostility_level = { - target = scope:actor.faith - value = 2 - } - } - } - multiply = 2 - } - if = { - limit = { - faith = { - faith_hostility_level = { - target = scope:actor.faith - value = 3 - } - } - } - multiply = 3 - } - if = { - limit = { - OR = { - ai_zeal <= 0 - faith = { - faith_hostility_level = { - target = scope:actor.faith - value <= 0 - } - } - } - } - value = 0 - } - } - } - - # Peacemaker Perk - modifier = { - trigger = { - scope:war.casus_belli = { - primary_defender = scope:recipient - primary_attacker = { has_perk = peacemaker_perk } - } - } - add = peacemaker_value - - desc = "PEACEMAKER_PERK_MODIFIER" - } - modifier = { - trigger = { - scope:war.casus_belli = { - primary_attacker = scope:recipient - primary_defender = { has_perk = peacemaker_perk } - } - } - add = peacemaker_value - - desc = "PEACEMAKER_PERK_MODIFIER" - } - modifier = { - trigger = { - scope:war.casus_belli = { - primary_defender = scope:recipient - primary_attacker = { - dynasty ?= { has_dynasty_perk = mpo_nomad_legacy_3 } - } - } - } - add = 10 - - desc = "NOMAD_LEGACY_PERK_MODIFIER" - } - modifier = { - trigger = { - scope:war.casus_belli = { - primary_attacker = scope:recipient - primary_defender = { - dynasty ?= { has_dynasty_perk = mpo_nomad_legacy_3 } - } - } - } - add = 10 - - desc = "NOMAD_LEGACY_PERK_MODIFIER" - } - modifier = { - trigger = { - scope:war.casus_belli = { - primary_attacker = scope:recipient - primary_attacker = { - is_ai = yes - save_temporary_scope_as = attacker - } - primary_defender = { - has_variable = peace_acceptance_head_scare - var:peace_acceptance_head_scare = { - this = scope:attacker - } - } - } - } - add = 30 - - desc = "COWED_BY_SEVERED_HEAD_MODIFIER" - } - modifier = { - trigger = { - scope:war.casus_belli = { - primary_defender = scope:recipient - primary_defender = { - is_ai = yes - save_temporary_scope_as = defender - } - primary_attacker = { - has_variable = peace_acceptance_head_scare - var:peace_acceptance_head_scare = { - this = scope:defender - } - } - } - } - add = 30 - - desc = "COWED_BY_SEVERED_HEAD_MODIFIER" - } - - # Cultural Traditions - modifier = { - trigger = { - scope:war.casus_belli = { - primary_defender = scope:recipient - primary_attacker = { culture = { has_cultural_parameter = facilitate_white_peace } } - } - } - add = 10 - - desc = "TRADITION_BONUS_WHITE_PEACE" - } - modifier = { - trigger = { - scope:war.casus_belli = { - primary_attacker = scope:recipient - primary_defender = { culture = { has_cultural_parameter = facilitate_white_peace } } - } - } - add = 10 - - desc = "TRADITION_BONUS_WHITE_PEACE" - } - - # Struggles - modifier = { - trigger = { - scope:actor = { - OR = { - any_character_struggle = { - involvement = involved - is_struggle_parameter_active_secondary_character_involvement_either_trigger = { - PARAMETER = white_peace_acceptance_between_involved_or_interloper_with_region_easier - CHAR = scope:recipient - } - } - any_character_struggle = { - involvement = interloper - is_struggle_parameter_active_secondary_character_involvement_either_trigger = { - PARAMETER = white_peace_acceptance_between_involved_or_interloper_with_region_easier - CHAR = scope:recipient - } - } - } - } - } - add = 10 - - desc = "STRUGGLE_INVOLVED_OR_INTERLOPER_PHASE_BONUS" - } - - # GoK war - modifier = { - desc = WAR_OVERVIEW_WHITE_PEACE_GOK - add = -70 - scope:war = { - using_cb = mpo_gok_onslaught_cb - primary_defender = scope:actor - } - } - # GoK war but have counties occupied - modifier = { - desc = WAR_OVERVIEW_WHITE_PEACE_GOK_OCCUPATION - add = { - value = 0 - scope:war.primary_defender = { - every_sub_realm_county = { - limit = { - county_controller = scope:war.primary_attacker - } - add = 2 - } - } - max = 200 - } - scope:war = { - using_cb = mpo_gok_onslaught_cb - attacker_war_score <= 25 - primary_defender = { - any_sub_realm_county = { - county_controller = scope:war.primary_attacker - } - } - primary_defender = scope:actor - } - } - - # Hostages - modifier = { - exists = scope:secondary_actor - add = { - value = war_actor_hostage_value - multiply = 0.5 - } - desc = WAR_OVERVIEW_WHITE_PEACE_HOSTAGE_OFFER_VALUE - } - modifier = { - exists = scope:secondary_recipient - add = { - value = war_recipient_hostage_value - multiply = 0.5 - } - desc = WAR_OVERVIEW_WHITE_PEACE_HOSTAGE_DEMAND_VALUE - } - } - - is_available = { - trigger_if = { - limit = { is_ai = yes } - any_character_war = { - count >= 1 - casus_belli = { - OR = { - primary_attacker ?= root - primary_defender ?= root - } - } - } - - trigger_if = { - limit = { - exists = scope:war - } - NOR = { # Don't send inane white peace offers to the player - scope:war ?= { - casus_belli ?= { - primary_defender ?= root - primary_attacker ?= { - is_ai = no - } - } - attacker_war_score >= 10 - } - scope:war ?= { - casus_belli ?= { - primary_attacker ?= root - primary_defender ?= { - is_ai = no - } - } - defender_war_score >= 70 - } - } - } - } - } - - is_valid_showing_failures_only = { - scope:war ?= { - has_valid_casus_belli = yes - is_white_peace_possible = yes - } - } -} - -end_war_attacker_defeat_interaction = { - special_interaction = end_war_attacker_defeat_interaction - hidden = yes - use_diplomatic_range = no - secondary_scopes_optional = yes - - ai_targets = { - ai_recipients = primary_war_enemies - } - - ai_frequency_by_tier = { - barony = 0 - county = 1 - duchy = 1 - kingdom = 1 - empire = 1 - hegemony = 1 - } - - # Depending on who was the attacker, we need to send a different notification message to the recipient. - notification_text = { - first_valid = { - triggered_desc = { - trigger = { - scope:recipient = { - any_character_war = { - casus_belli = { - primary_attacker = scope:actor - } - } - } - } - desc = end_war_attacker_defeat_attacker_desc - } - desc = end_war_attacker_defeat_defender_desc - } - } - - populate_actor_list = { - scope:actor = { - every_close_family_member = { - limit = { - # Unlanded, at sender's court, child/sibling/nibling/grandchild - bp2_valid_to_offer_as_hostage_trigger = { SENDER = scope:actor } - } - add_to_list = characters - } - } - } - - populate_recipient_list = { - scope:recipient = { - every_close_family_member = { - limit = { - # Unlanded, at sender's court, child/sibling/nibling/grandchild - bp2_valid_to_offer_as_hostage_trigger = { SENDER = scope:recipient } - } - add_to_list = characters - } - } - } - - can_be_picked = { - scope:war ?= { - custom_tooltip = { - text = hostage_exchange_invalid_for_crusade_tt - NOR = { - using_cb = undirected_great_holy_war - using_cb = directed_great_holy_war - } - } - custom_tooltip = { - text = hostage_exchange_invalid_for_cb_tt - bp2_hostage_exchange_invalid_cb_trigger = no - } - } - } - - redirect = { - # secondary recipient is always set, so we need to clear it - # if can_send condition depends on the scope being empty - clear_saved_scope = secondary_recipient - } - - on_accept = { - scope:war ?= { - casus_belli = { - primary_attacker = { - save_scope_as = attacker_loser - } - primary_defender = { - save_scope_as = defender_winner - set_signature_weapon_effect = yes - } - } - if = { - limit = { - NOT = { using_cb = fp3_free_house_member_cb } - } - release_prisoners_of_war_effect = yes - } - } - - # Hostages - # Save scopes for clarity - if = { - limit = { - scope:war ?= { - NOR = { - using_cb = undirected_great_holy_war - using_cb = directed_great_holy_war - } - bp2_hostage_exchange_invalid_cb_trigger = no - } - } - if = { - limit = { - exists = scope:secondary_actor - scope:recipient = { is_landed = yes } - } - hostage_depart_effect = { - HOSTAGE = scope:secondary_actor - WARDEN = scope:recipient - HOME_COURT = scope:actor - } - } - if = { - limit = { - exists = scope:secondary_recipient - scope:actor = { is_landed = yes } - } - hostage_depart_effect = { - HOSTAGE = scope:secondary_recipient - WARDEN = scope:actor - HOME_COURT = scope:recipient - } - } - } - - #Send notification to vassals - hidden_effect = { - scope:attacker_loser = { - if = { - limit = { - any_vassal = { - this != scope:defender_winner - } - } - every_vassal = { - limit = { - this != scope:defender_winner - } - send_interface_toast = { - type = msg_liege_war_ended_defender_win - title = war_event.notification_liege_loss.t - left_icon = scope:attacker_loser - right_icon = scope:defender_winner - custom_tooltip = war_event.1905 - } - } - } - } - scope:defender_winner = { - if = { - limit = { - any_vassal = { this != scope:attacker_loser } - } - every_vassal = { - limit = { - this != scope:attacker_loser - } - send_interface_toast = { - type = msg_liege_war_ended_defender_win - title = war_event.notification_liege_win.t - left_icon = scope:defender_winner - right_icon = scope:attacker_loser - custom_tooltip = war_event.1906 - } - } - } - } - } - - scope:war ?= { - end_war = defender - } - } - - on_decline = { - - } - - ai_will_do = { - base = 0 - - modifier = { - scope:war = { - primary_defender = scope:actor - OR = { - defender_war_score >= 100 - AND = { - defender_war_score >= 90 - scope:actor = { - OR = { - has_perk = peacemaker_perk - culture = { - has_cultural_parameter = can_end_defensive_wars_earlier - } - } - } - primary_attacker = { - is_ai = yes - } - } - AND = { - defender_war_score >= 90 - scope:actor = { - dynasty ?= { has_dynasty_perk = mpo_nomad_legacy_3 } - } - primary_attacker = { - is_ai = yes - } - } - AND = { - defender_war_score >= 70 - primary_attacker = { - is_ai = yes - save_temporary_scope_as = attacker - } - root = { - has_variable = peace_acceptance_head_scare - var:peace_acceptance_head_scare = { - this = scope:attacker - } - } - } - } - } - add = 100 - } - modifier = { - scope:war = { - primary_attacker = scope:actor - defender_war_score >= 100 - days_since_max_war_score >= 180 - } - add = 100 - } - } - - ai_accept = { - base = -99 - - compare_modifier = { - target = scope:war - value = defender_war_score - desc = "WARSCORE_MODIFIER" - } - modifier = { - add = 1000 - scope:war.casus_belli = { - primary_defender = scope:recipient - } - desc = "WOULD_WIN_MODIFIER" - } - modifier = { - scope:war.casus_belli = { - primary_defender = { - has_perk = peacemaker_perk - this != scope:recipient - } - } - - add = peacemaker_value - - desc = "PEACEMAKER_PERK_MODIFIER" - } - modifier = { - scope:war.casus_belli = { - primary_defender = { - dynasty ?= { has_dynasty_perk = mpo_nomad_legacy_3 } - NOT = { this = scope:recipient } - } - } - - add = 10 - - desc = "NOMAD_LEGACY_PERK_MODIFIER" - } - - modifier = { - scope:war.casus_belli = { - primary_attacker = { - is_ai = yes - save_temporary_scope_as = attacker - } - primary_defender = { - has_variable = peace_acceptance_head_scare - var:peace_acceptance_head_scare = { - this = scope:attacker - } - } - } - add = 30 - desc = "COWED_BY_SEVERED_HEAD_MODIFIER" - } - modifier = { - scope:war.casus_belli = { - primary_defender = { - culture = { - has_cultural_parameter = can_end_defensive_wars_earlier - } - this != scope:recipient - } - } - - add = 10 - - desc = "TRADITION_BONUS_DEFENSIVE_WARS" - } - # Hostages - modifier = { - exists = scope:secondary_actor - add = war_actor_hostage_value - desc = WAR_OVERVIEW_HOSTAGE_OFFER_VALUE - } - modifier = { - exists = scope:secondary_recipient - add = war_recipient_hostage_value - desc = WAR_OVERVIEW_HOSTAGE_DEMAND_VALUE - } - } - - auto_accept = { - OR = { - scope:war ?= { - defender_war_score >= 100 - } - AND = { - scope:recipient = { is_ai = yes } - scope:war.casus_belli.primary_defender ?= scope:recipient - } - } - } - - is_available = { - trigger_if = { - limit = { is_ai = yes } - is_at_war = yes - any_character_war = { - is_war_leader = root - OR = { - defender_war_score >= 100 - AND = { - primary_defender ?= { - is_ai = yes - } - OR = { - attacker_war_score >= 90 - AND = { - root = { - dynasty ?= { has_dynasty_perk = mpo_nomad_legacy_3 } - } - attacker_war_score >= 80 - } - } - root = { - has_perk = peacemaker_perk - } - } - AND = { - primary_defender ?= { - is_ai = yes - } - root = { - dynasty ?= { has_dynasty_perk = mpo_nomad_legacy_3 } - } - OR = { - attacker_war_score >= 90 - AND = { - root = { - has_perk = peacemaker_perk - } - attacker_war_score >= 80 - } - } - } - AND = { - primary_attacker ?= { - save_temporary_scope_as = attacker - is_ai = yes - } - defender_war_score >= 70 - root = { - has_variable = peace_acceptance_head_scare - var:peace_acceptance_head_scare ?= { - this = scope:attacker - } - } - } - } - } - } - } - - is_valid_showing_failures_only = { - scope:war ?= { - has_valid_casus_belli = yes - } - } -} - -view_war_interaction = { - category = interaction_category_diplomacy - common_interaction = yes - - special_interaction = offer_peace_interaction - interface = offer_peace - use_diplomatic_range = no - ignores_pending_interaction_block = yes - - is_shown = { - scope:actor = { - is_at_war_with = scope:recipient - NOT = { - any_character_war = { - is_war_leader = scope:actor - is_participant = scope:recipient - } - } - } - } - auto_accept = yes -} - -offer_peace_interaction = { - category = interaction_category_diplomacy - common_interaction = yes - icon = war_won_icon - - special_interaction = offer_peace_interaction - interface = offer_peace - use_diplomatic_range = no - - is_shown = { - scope:puppet_or_actor = { - is_at_war_with = scope:recipient - any_character_war = { - is_war_leader = scope:puppet_or_actor - is_participant = scope:recipient - } - } - } - auto_accept = yes -} diff --git a/common/character_interactions/10_ach_interactions.txt b/common/character_interactions/10_ach_interactions.txt deleted file mode 100644 index c507e4567..000000000 --- a/common/character_interactions/10_ach_interactions.txt +++ /dev/null @@ -1,851 +0,0 @@ -coronation_anointment_request = { - category = interaction_category_religion - icon = coronation_icon - - desc = coronation_anointment_request_desc - - ai_targets = { - ai_recipients = head_of_faith - } - ai_target_quick_trigger = { - adult = yes - } - ai_frequency_by_tier = { - barony = 0 - county = 0 - duchy = 0 - kingdom = 0 - empire = 12 - hegemony = 12 - } - popup_on_receive = yes - pause_on_receive = yes - - cooldown_against_recipient = { years = 5 } - - is_shown = { - NOT = { scope:actor = scope:recipient } - scope:actor = { - NOT = { has_realm_law = crowned_emperor } - coronation_trigger = yes - highest_held_title_tier >= tier_empire - faith = { - OR = { - has_doctrine = doctrine_anointment_permitted - has_doctrine = doctrine_imperial_anointment - } - } - } - scope:recipient = { - this = scope:actor.faith.religious_head - } - } - - is_valid_showing_failures_only = { - scope:actor = { - faith = { - has_doctrine = doctrine_spiritual_head - } - is_imprisoned = no - NOT = { has_trait = excommunicated } - age >= 10 - } - scope:recipient = { - is_imprisoned = no - custom_tooltip = { - text = anointment_request_already_supported - NOT = { - is_target_in_variable_list = { - name = supported_anointments - target = scope:actor - } - } - } - } - } - - cost = { - piety = { - value = 500 - if = { - limit = { - scope:actor = { is_ai = yes } - } - subtract = 500 - } - if = { - limit = { scope:piety_send_option = yes } - add = scope:actor.monumental_piety_value - desc = PIETY_INTERACTION_ACCEPTANCE_SEND_OPTION - } - if = { - limit = { scope:hook = yes } - value = 0 - } - } - gold = { - value = 0 - if = { - limit = { scope:gold_send_option = yes } - add = scope:actor.major_gold_value - desc = GOLD_INTERACTION_ACCEPTANCE_SEND_OPTION - } - } - } - - greeting = positive - notification_text = CORONATION_ANOINTMENT_REQUEST_INTERACTION_NOTIFICATION - - ai_accept = { - base = -60 - modifier = { - add = 80 - scope:actor = { - is_ai = yes - } - } - opinion_modifier = { - opinion_target = scope:actor - who = scope:recipient - multiplier = 0.5 - } - - modifier = { # Same language - add = 5 - desc = speaks_same_language_interaction_reason - trigger = { - scope:actor = { - knows_language_of_culture = scope:recipient.culture - } - } - } - - modifier = { - add = -40 - desc = I_AM_SODOMITE - scope:actor = { - has_trait = sodomite - trait_is_criminal_in_faith_trigger = { - FAITH = scope:actor.faith - TRAIT = trait:sodomite - GENDER_CHARACTER = scope:actor - } - } - } - modifier = { - add = -20 - desc = I_AM_SODOMITE - scope:actor = { - has_trait = sodomite - trait_is_shunned_in_faith_trigger = { - FAITH = scope:actor.faith - TRAIT = trait:sodomite - GENDER_CHARACTER = scope:actor - } - } - } - modifier = { - add = -40 - desc = I_AM_DEVIANT - scope:actor = { - has_trait = deviant - trait_is_criminal_in_faith_trigger = { - FAITH = scope:actor.faith - TRAIT = trait:deviant - GENDER_CHARACTER = scope:actor - } - } - } - modifier = { - add = -20 - desc = I_AM_DEVIANT - scope:actor = { - has_trait = deviant - trait_is_shunned_in_faith_trigger = { - FAITH = scope:actor.faith - TRAIT = trait:deviant - GENDER_CHARACTER = scope:actor - } - } - } - modifier = { - add = -40 - desc = I_AM_ADULTERER - scope:actor = { - has_trait = adulterer - trait_is_criminal_in_faith_trigger = { - FAITH = scope:actor.faith - TRAIT = trait:adulterer - GENDER_CHARACTER = scope:actor - } - } - } - modifier = { - add = -20 - desc = I_AM_ADULTERER - scope:actor = { - has_trait = adulterer - trait_is_shunned_in_faith_trigger = { - FAITH = scope:actor.faith - TRAIT = trait:adulterer - GENDER_CHARACTER = scope:actor - } - } - } - modifier = { - add = -20 - desc = I_AM_ADULTERER - scope:actor = { - has_trait = fornicator - trait_is_criminal_in_faith_trigger = { - FAITH = scope:actor.faith - TRAIT = trait:fornicator - GENDER_CHARACTER = scope:actor - } - } - } - modifier = { - add = -10 - desc = I_AM_ADULTERER - scope:actor = { - has_trait = fornicator - trait_is_shunned_in_faith_trigger = { - FAITH = scope:actor.faith - TRAIT = trait:fornicator - GENDER_CHARACTER = scope:actor - } - } - } - modifier = { - add = -40 - desc = I_AM_WITCH - scope:actor = { - has_trait = witch - trait_is_criminal_in_faith_trigger = { - FAITH = scope:actor.faith - TRAIT = trait:witch - GENDER_CHARACTER = scope:actor - } - } - } - modifier = { - add = -20 - desc = I_AM_WITCH - scope:actor = { - has_trait = witch - trait_is_shunned_in_faith_trigger = { - FAITH = scope:actor.faith - TRAIT = trait:witch - GENDER_CHARACTER = scope:actor - } - } - } - - modifier = { # I am a Murderer - add = -50 - desc = I_AM_MURDERER - scope:actor = { - has_trait = murderer - } - } - - modifier = { # I am Incestous - add = -50 - desc = I_AM_INCESTOUS - scope:actor = { - NOT = { scope:recipient = { faith = { has_doctrine = doctrine_consanguinity_unrestricted } } } - has_trait = incestuous - } - } - - modifier = { # I am a Kinslayer - add = -30 - desc = I_AM_A_KINSLAYER - scope:actor = { - OR = { - AND = { - has_trait = kinslayer_1 - trait_is_criminal_in_faith_trigger = { FAITH = faith TRAIT = trait:kinslayer_1 GENDER_CHARACTER = scope:actor } - } - AND = { - has_trait = kinslayer_2 - trait_is_criminal_in_faith_trigger = { FAITH = faith TRAIT = trait:kinslayer_2 GENDER_CHARACTER = scope:actor } - } - AND = { - has_trait = kinslayer_3 - trait_is_criminal_in_faith_trigger = { FAITH = faith TRAIT = trait:kinslayer_3 GENDER_CHARACTER = scope:actor } - } - } - } - } - modifier = { # I am a Kinslayer - add = -15 - desc = I_AM_A_KINSLAYER - scope:actor = { - OR = { - AND = { - has_trait = kinslayer_1 - trait_is_shunned_in_faith_trigger = { FAITH = faith TRAIT = trait:kinslayer_1 GENDER_CHARACTER = scope:actor } - } - AND = { - has_trait = kinslayer_2 - trait_is_shunned_in_faith_trigger = { FAITH = faith TRAIT = trait:kinslayer_2 GENDER_CHARACTER = scope:actor } - } - AND = { - has_trait = kinslayer_3 - trait_is_shunned_in_faith_trigger = { FAITH = faith TRAIT = trait:kinslayer_3 GENDER_CHARACTER = scope:actor } - } - } - } - } - modifier = { - add = 10 - scope:actor = { - has_trait = zealous - } - desc = ai_acceptance_trait_zealous - } - modifier = { - add = 10 - scope:actor = { - has_trait = pilgrim - } - desc = ai_acceptance_trait_pilgrim - } - modifier = { - add = 5 - scope:actor = { - has_trait = holy_warrior - } - desc = ai_acceptance_trait_holy_warrior - } - modifier = { - add = 25 - scope:recipient = { - is_landed = no - } - OR = { - scope:recipient.liege ?= scope:actor - scope:recipient.top_liege ?= scope:actor - } - desc = I_AM_LIEGE_TOP_LIEGE - } - modifier = { - add = 15 - scope:recipient = { - is_landed = yes - } - OR = { - scope:recipient.liege ?= scope:actor - scope:recipient.top_liege ?= scope:actor - } - desc = I_AM_LIEGE_TOP_LIEGE - } - - modifier = { - desc = RELIGIOUS_HEAD_INTERACTION_SAVIOR - add = 15 - scope:actor = { - has_trait = savior - } - } - modifier = { - desc = RELIGIOUS_HEAD_INTERACTION_DIVINE_BLOOD - add = 5 - scope:actor = { - has_trait = divine_blood - } - } - modifier = { - desc = RELIGIOUS_HEAD_INTERACTION_PARAGON - add = 15 - scope:actor = { - has_trait = paragon - } - } - modifier = { - desc = RELIGIOUS_HEAD_INTERACTION_CONSECRATED_BLOOD - add = 5 - scope:actor = { - has_trait = consecrated_blood - } - } - - modifier = { # You are of the same dynasty as the Head of Faith - add = 5 - desc = YOU_ARE_MY_DYNASTY_MEMBER - scope:recipient = { - is_lowborn = no - dynasty = scope:actor.dynasty - NOR = { - is_close_or_extended_family_of = scope:actor - is_cousin_of = scope:actor - is_child_of = scope:actor - scope:recipient.dynasty = scope:secondary_recipient.dynasty - } - } - } - - modifier = { # You are of the same house as the Head of Faith - add = 10 - desc = YOU_ARE_MY_HOUSE_MEMBER - scope:recipient = { - is_lowborn = no - house = scope:actor.house - NOR = { - is_close_or_extended_family_of = scope:actor - is_cousin_of = scope:actor - is_child_of = scope:actor - scope:recipient.house = scope:secondary_recipient.house - } - } - } - - modifier = { # Related to the Head of Faith - add = 10 - desc = YOU_ARE_MY_RELATIVE - scope:recipient = { - OR = { - is_close_or_extended_family_of = scope:actor - is_cousin_of = scope:actor - } - NOT = { is_child_of = scope:actor } - } - } - - modifier = { # Parent of the Head of Faith - add = 25 - desc = YOU_ARE_MY_PARENT - scope:recipient = { - is_child_of = scope:actor - } - } - - modifier = { # Friend of the Head of Faith - add = 25 - desc = WE_ARE_FRIENDS - scope:recipient = { - has_relation_friend = scope:actor - } - } - - modifier = { # Best Friend of the Head of Faith - add = 50 - desc = WE_ARE_BEST_FRIENDS - scope:recipient = { - has_relation_best_friend = scope:actor - } - } - - modifier = { # Lover of the Head of Faith - add = 10 - desc = WE_ARE_LOVERS - scope:recipient = { - has_relation_lover = scope:actor - } - } - - modifier = { # Rival of the Head of Faith - add = -100 - desc = WE_ARE_RIVALS - scope:recipient = { - has_relation_rival = scope:actor - } - } - - modifier = { # Nemesis of the Head of Faith - add = -500 - desc = WE_ARE_NEMESES - scope:recipient = { - has_relation_nemesis = scope:actor - } - } - - modifier = { - add = { - add = 10 - multiply = scope:actor.num_virtuous_traits - } - scope:actor.num_virtuous_traits > 0 - desc = I_AM_VIRTUOUS - } - - modifier = { - add = { - add = 5 - multiply = scope:actor.piety_level - } - scope:actor.piety_level > 1 - desc = I_AM_PIOUS - } - - modifier = { - add = -30 - scope:actor.piety_level = 0 - desc = I_HAVE_LOW_PIETY - } - - modifier = { - add = { - add = 5 - multiply = scope:actor.piety_level - } - scope:actor.piety_level > 2 - scope:actor.gold < 0 - desc = I_AM_PIOUS_AND_BROKE - } - - modifier = { - add = { - add = -10 - multiply = scope:actor.num_sinful_traits - } - scope:actor.num_sinful_traits > 0 - desc = I_AM_SINFUL - } - - modifier = { - add = 20 - scope:actor = { - has_trait = crusader_king - } - desc = I_HAVE_CRUSADER_KING_TRAIT - } - - modifier = { - add = 20 - scope:actor = { - has_trait = saint - } - desc = I_HAVE_SAINT_TRAIT - } - - modifier = { - add = 30 - scope:actor = { - has_trait = saoshyant - } - desc = I_HAVE_SAOSHYANT_TRAIT - } - - modifier = { - add = 10 - scope:actor = { - has_trait = saoshyant_descendant - } - desc = I_HAVE_SAOSHYANT_DESCENDANT_TRAIT - } - - modifier = { - add = 10 - scope:actor = { - has_trait = sayyid - } - desc = I_HAVE_SAYYID_TRAIT - } - - modifier = { - add = 10 - scope:actor = { - has_trait = order_member - } - desc = I_HAVE_ORDER_MEMBER_TRAIT - } - - modifier = { - add = 10 - scope:actor = { - has_trait = faith_warrior - } - desc = I_HAVE_FAITH_WARRIOR_TRAIT - } - - modifier = { - add = 10 - scope:actor = { - has_trait = theologian - } - desc = I_HAVE_THEOLOGIAN_TRAIT - } - - modifier = { - add = -25 - scope:actor = { - has_trait = despoiler_of_byzantium - } - desc = I_HAVE_DESPOILER_OF_BYZANTIUM_TRAIT - } - - modifier = { - add = -25 - scope:actor = { - has_trait = gallowsbait - } - desc = I_HAVE_GALLOWSBAIT_TRAIT - } - - modifier = { - add = -25 - scope:actor = { - has_trait = decadent - } - desc = I_HAVE_DECADENT_TRAIT - } - - modifier = { - add = -25 - desc = BASE_RELUCTANCE - trigger = { - has_game_rule = hard_difficulty - scope:actor = { - is_ai = no - } - } - } - - modifier = { - add = -75 - desc = BASE_RELUCTANCE - trigger = { - has_game_rule = very_hard_difficulty - scope:actor = { - is_ai = no - } - } - } - - modifier = { - add = 60 - desc = TRADE_GOLD_FOR_BETTER_AI_ACCEPTANCE_TT - scope:gold_send_option = yes - } - - modifier = { - add = 40 - desc = PIETY_INTERACTION_ACCEPTANCE_SEND_OPTION - scope:piety_send_option = yes - } - - modifier = { - add = { - value = 0 - scope:recipient = { - every_held_title = { - limit = { - is_head_of_faith = no - } - every_de_jure_county = { - limit = { - holder = scope:actor - } - add = 20 - } - } - } - } - desc = TRADE_LAND_ACCEPTANCE_SEND_OPTION - scope:land_send_option = yes - } - modifier = { - add = -20 - scope:recipient = { - faith_dominant_gender_female_or_equal = no - } - scope:actor = { - is_female = yes - } - desc = I_AM_FEMALE_WHEN_MALE_IS_PREFERRED - } - modifier = { - add = -20 - scope:recipient = { - faith_dominant_gender_male_or_equal = no - } - scope:actor = { - is_male = yes - } - desc = I_AM_MALE_WHEN_FEMALE_IS_PREFERRED - } - modifier = { - desc = "LOW_LEGITIMACY_REASON" - scope:actor = { - is_ai = no - legitimacy_level <= 0 - } - add = -15 - } - modifier = { - desc = "LOW_LEGITIMACY_REASON" - scope:actor = { - is_ai = no - legitimacy_level = 1 - } - add = -10 - } - modifier = { - desc = "LOW_LEGITIMACY_REASON" - scope:actor = { - is_ai = no - legitimacy_level = 2 - } - add = -5 - } - modifier = { - desc = "HIGH_LEGITIMACY_REASON" - scope:actor = { - legitimacy_level = 4 - } - add = 10 - } - modifier = { - desc = "HIGH_LEGITIMACY_REASON" - scope:actor = { - legitimacy_level >= 5 - } - add = 15 - } - } - - auto_accept = { - custom_description = { - text = "spending_hook" - subject = scope:actor - object = scope:recipient - scope:hook = yes - } - } - - send_option = { # Hook - flag = hook - is_valid = { - scope:actor = { - has_usable_hook = scope:recipient - } - } - localization = GENERIC_SPEND_A_HOOK - } - - should_use_extra_icon = { - scope:actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - send_option = { # Piety - is_shown = { - always = yes - } - is_valid = { - scope:actor = { piety >= monumental_piety_value } - custom_tooltip = { - text = already_using_hook - NOT = { scope:hook = yes } - } - } - flag = piety_send_option - localization = TRADE_PIETY_FOR_BETTER_AI_ACCEPTANCE - } - - send_option = { # Gold - is_shown = { - always = yes - } - is_valid = { - scope:actor = { gold >= major_gold_value } - custom_tooltip = { - text = already_using_hook - NOT = { scope:hook = yes } - } - } - flag = gold_send_option - localization = TRADE_GOLD_FOR_BETTER_AI_ACCEPTANCE - } - - send_option = { # Return land - is_shown = { - always = yes - } - is_valid = { - custom_tooltip = { - text = coronation_request_return_land_trigger - scope:recipient = { - any_held_title = { - is_head_of_faith = no - any_de_jure_county = { - holder = scope:actor - } - } - } - } - } - flag = land_send_option - localization = TRADE_LAND_FOR_BETTER_AI_ACCEPTANCE - } - - send_options_exclusive = no - - on_accept = { - scope:recipient = { - custom_tooltip = anoinment_request_accepted_tt - add_to_variable_list = { - name = supported_anointments - target = scope:actor - } - } - if = { - limit = { - scope:gold_send_option = yes - } - scope:recipient = { - add_short_term_gold = scope:actor.major_gold_value - } - } - if = { - limit = { - scope:land_send_option = yes - } - create_title_and_vassal_change = { - type = returned - save_scope_as = change - } - scope:recipient = { - every_held_title = { - limit = { - is_head_of_faith = no - } - every_de_jure_county = { - limit = { - holder = scope:actor - } - change_title_holder_include_vassals = { - holder = scope:recipient - change = scope:change - } - } - } - } - resolve_title_and_vassal_change = scope:change - } - scope:actor = { - trigger_event = coronation_events.0400 - } - } - - on_decline = { - scope:actor = { - trigger_event = religious_interaction.32 - } - } - - ai_potential = { - age >= 16 - coronation_trigger = yes - } - - ai_will_do = { - base = 50 - modifier = { - has_game_rule = coronation_laws_off - add = -25 - } - } -}