diff --git a/common/buildings/00_temple_buildings.txt b/common/buildings/00_temple_buildings.txt index 2944f17dd..cf2f0763a 100644 --- a/common/buildings/00_temple_buildings.txt +++ b/common/buildings/00_temple_buildings.txt @@ -871,6 +871,14 @@ temple_01 = { } county.holder = { add_prestige = massive_prestige_gain } } + if = { + limit = { + county.holder.faith = { + has_doctrine_parameter = neow_piety_from_temple_construction + } + } + county.holder = { add_piety = massive_piety_gain } + } #Holy Legend Seed drop if = { diff --git a/common/character_interactions/00_artifact_interactions.txt b/common/character_interactions/00_artifact_interactions.txt new file mode 100644 index 000000000..b83f0e615 --- /dev/null +++ b/common/character_interactions/00_artifact_interactions.txt @@ -0,0 +1,4567 @@ +# Give away an artifact to improve relations +gift_artifact_interaction = { + category = interaction_category_friendly + common_interaction = no + interface_priority = 30 + desc = gift_artifact_interaction_desc + icon = artisan_inspiration + + target_type = artifact + target_filter = actor_artifacts + + greeting = positive + notification_text = GIFT_ARTIFACT_PROPOSAL + + answer_accept_key = GIFT_ARTIFACT_ACCEPT + answer_reject_key = GIFT_ARTIFACT_REJECT + + ai_targets = { + ai_recipients = scripted_relations + ai_recipients = liege + ai_recipients = spouses + max = 10 + } + ai_targets = { + ai_recipients = neighboring_rulers + ai_recipients = peer_vassals + ai_recipients = vassals + max = 10 + } + ai_targets = { + ai_recipients = family + ai_recipients = children + ai_recipients = dynasty + max = 10 + } + ai_target_quick_trigger = { + adult = yes + } + ai_frequency_by_tier = { + barony = 180 + county = 90 + duchy = 90 + kingdom = 90 + empire = 90 + hegemony = 90 + } + + can_be_picked_artifact = { + trigger_if = { + limit = { + scope:actor = { + is_ai = no + } + } + scope:target = { + is_equipped = no + } + } + scope:actor = { + any_character_artifact = { + this = scope:target + } + } + #Artifacts locked from being giftable by a variable + scope:target = { + artifact_can_be_gift_to_trigger = { RECIPIENT = scope:recipient } + } + } + + + #You can't give yourself a gift, even if it should count as self-care + is_shown = { + scope:recipient != scope:actor + scope:actor = { + has_any_artifact = yes + trigger_if = { + limit = { + exists = involved_activity + } + NOT = { + involved_activity ?= { #do not give out anything during coronation + has_activity_type = activity_coronation + activity_host = scope:actor + } + } + } + } + } + + is_valid_showing_failures_only = { + # needs to have an artifact to give away + scope:actor = { + NOT = { + is_at_war_with = scope:recipient + } + is_imprisoned = no + trigger_if = { + limit = { + is_ai = no + } + custom_description = { + text = "any_unequipped_artifact_tt" + any_character_artifact = { + is_equipped = no + } + } + } + } + # keep this since a bit stricter than common rule + trigger_if = { + limit = { + exists = scope:target.var:banner_dynasty + exists = scope:recipient.dynasty + } + custom_description = { + text = "gift_artifact_dynasty_banner_head_tt" + scope:recipient = scope:target.var:banner_dynasty.dynast + } + } + } + + on_accept = { + # Warning for multiple gifts + if = { + limit = { + scope:recipient = { + has_opinion_modifier = { + target = scope:actor + modifier = gift_artifact_opinion + } + } + } + custom_tooltip = ALREADY_SENT_GIFT_WARNING + } + # Struggle Catalyst + if = { # Struggle Catalyst + limit = { + scope:actor = { + any_character_struggle = { + involvement = involved + activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { + CATALYST = catalyst_gift_independent_ruler + CHAR = scope:recipient + } + } + } + } + hidden_effect = { + scope:actor = { + every_character_struggle = { + involvement = involved + activate_struggle_catalyst = { + catalyst = catalyst_gift_independent_ruler + character = scope:actor + } + } + } + } + } + else_if = { + limit = { + fp3_struggle_involves_one_supporter_and_one_detractor = { + FIRST = scope:actor + SECOND = scope:recipient + } + scope:actor = { + any_character_struggle = { + #involvement = involved + activate_struggle_catalyst_secondary_character_involvement_either_trigger = { + CATALYST = catalyst_gift_supporter_detractor_ruler + CHAR = scope:recipient + } + } + } + } + hidden_effect = { + scope:actor = { + every_character_struggle = { + #involvement = involved + limit = { + activate_struggle_catalyst_secondary_character_involvement_either_trigger = { + CATALYST = catalyst_gift_supporter_detractor_ruler + CHAR = scope:recipient + } + } + activate_struggle_catalyst = { + catalyst = catalyst_gift_supporter_detractor_ruler + character = scope:actor + } + log_debug_variable_for_persian_struggle_effect = { VAR = concession_catalyst_gift_supporter_detractor_ruler } + } + } + } + } + + scope:target = { + set_variable = { + name = suppress_artifact_notifications + value = yes + days = 1 + } + set_variable = { name = gifted_artifact value = yes days = 9125 } + } + scope:recipient = { + # Verify that they could become friend + if = { + limit = { + NAND = { + has_relation_friend = scope:actor + has_relation_lover = scope:actor + has_relation_soulmate = scope:actor + has_relation_best_friend = scope:actor + } + } + gifting_leads_towards_friendship_effect = yes + } + } + scope:actor = { + send_interface_toast = { + type = event_toast_effect_neutral + title = gift_artifact_interaction_notification + left_icon = scope:recipient + right_icon = scope:target + scope:recipient = { + if = { + limit = { scope:target = { can_be_claimed_by = scope:recipient } } + if = { + limit = { any_personal_claimed_artifact = { this = scope:target } } + show_as_tooltip = { remove_personal_artifact_claim = scope:target } + } + else = { show_as_tooltip = { house = { remove_house_artifact_claim = scope:target } } } + } + } + + scope:target = { set_owner = scope:recipient } + + + if = { + limit = { + scope:target = { is_unique = yes } + } + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = medium_unity_gain + DESC = clan_unity_given_artifact.desc + REVERSE_NON_HOUSE_TARGET = no + } + stress_impact = { + greedy = major_stress_impact_gain + generous = major_stress_impact_loss + } + } + else_if = {# Unity goes here, too! + limit = { scope:target = { rarity = masterwork } } + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_gain + DESC = clan_unity_given_artifact.desc + REVERSE_NON_HOUSE_TARGET = no + } + stress_impact = { + greedy = minor_stress_impact_gain + generous = minor_stress_impact_loss + } + } + else_if = { + limit = { scope:target = { rarity = famed } } + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_gain + DESC = clan_unity_given_artifact.desc + REVERSE_NON_HOUSE_TARGET = no + } + stress_impact = { + greedy = medium_stress_impact_gain + generous = medium_stress_impact_loss + } + } + else_if = { + limit = { scope:target = { rarity = illustrious } } + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_gain + DESC = clan_unity_given_artifact.desc + REVERSE_NON_HOUSE_TARGET = no + } + stress_impact = { + greedy = major_stress_impact_gain + generous = major_stress_impact_loss + } + } + if = { + limit = { scope:recipient = { is_ai = yes } } + reverse_add_opinion = { + target = scope:recipient + modifier = gift_artifact_opinion + opinion = gift_artifact_opinion + } + } + #FP3 Tenet Communal Possessions Perk - piety gain for gift giving. + if = { + limit = { + scope:actor = { + faith = { + has_doctrine_parameter = piety_from_gifts_active + } + } + } + scope:actor = { + if = { + limit = { #the better the artifact, the more piety you gain + scope:target = { rarity = illustrious } + } + add_piety = massive_piety_gain + } + else_if = { + limit = { + scope:target = { rarity = famed } + } + add_piety = major_piety_gain + } + else_if = { + limit = { + scope:target = { rarity = masterwork } + } + add_piety = medium_piety_gain + } + else = { + add_piety = minor_piety_gain + } + } + } + } + + # Warning for low opinion gain + if = { + limit = { + scope:target = { + OR = { + AND = { + artifact_max_durability >= define:NInventory|ARTIFACT_DEFAULT_MAX_DURABILITY + artifact_durability <= define:NInventory|ARTIFACT_LOW_DURABILITY + } + AND = { #Check %durability left instead of fixed durability + artifact_max_durability < define:NInventory|ARTIFACT_DEFAULT_MAX_DURABILITY + artifact_durability_percent <= { + value = define:NInventory|ARTIFACT_LOW_DURABILITY + divide = 100 + } + } + } + } + } + custom_tooltip = artifact_gift_low_durability_tt + } + if = { + limit = { + scope:target = { + OR = { + AND = { + artifact_max_durability >= define:NInventory|ARTIFACT_DEFAULT_MAX_DURABILITY + artifact_durability <= define:NInventory|ARTIFACT_VERY_LOW_DURABILITY + } + AND = { #Check %durability left instead of fixed durability + artifact_max_durability < define:NInventory|ARTIFACT_DEFAULT_MAX_DURABILITY + artifact_durability_percent <= { + value = define:NInventory|ARTIFACT_VERY_LOW_DURABILITY + divide = 100 + } + } + } + } + } + custom_tooltip = artifact_gift_very_low_durability_tt + } + if = { + limit = { + scope:target = { + OR = { + AND = { + has_variable = banner_house + NOT = { var:banner_house = scope:recipient.house } + } + AND = { + has_variable = banner_dynasty + NOT = { var:banner_dynasty = scope:recipient.dynasty } + } + } + } + } + custom_tooltip = artifact_gift_useless_banner_tt + } + else_if = { + limit = { + scope:recipient = { + NOR = { + can_equip_artifact = scope:target + can_benefit_from_artifact = scope:target + } + } + } + custom_tooltip = artifact_gift_useless_tt + } + else_if = { + limit = { + scope:recipient = { + NOT = { can_equip_artifact = scope:target } + } + } + custom_tooltip = artifact_gift_equip_tt + } + else_if = { + limit = { + scope:recipient = { + NOT = { can_benefit_from_artifact = scope:target } + } + } + custom_tooltip = artifact_gift_benefit_tt + } + if = { + limit = { scope:recipient.liege = scope:actor } + custom_tooltip = artifact_gift_vassal_tt + } + if = { + limit = { scope:recipient = scope:actor.faith.religious_head } + custom_tooltip = artifact_gift_religious_head_tt + } + } + scope:recipient = { + hidden_effect = { + send_interface_toast = { + type = event_toast_effect_neutral + title = gift_artifact_interaction_notification + left_icon = scope:actor + right_icon = scope:target + + show_as_tooltip = { + scope:target = { set_owner = scope:recipient } + if = { + limit = { is_ai = yes } + add_opinion = { + target = scope:actor + modifier = gift_artifact_opinion + opinion = gift_artifact_opinion + } + } + + # Unity stuff, scales with tier # If we're a clan this interaction affects unity + if = { # In a better world, this would be a switch + limit = { scope:target = { rarity = Masterwork } } + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_gain + DESC = clan_unity_given_artifact.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + else_if = { + limit = { scope:target = { rarity = Famed } } + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = medium_unity_gain + DESC = clan_unity_given_artifact.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + else_if = { + limit = { scope:target = { rarity = Illustrious } } + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = major_unity_gain + DESC = clan_unity_given_artifact.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + } + } + if = { + limit = { + is_ruler = no + trigger_if = { + limit = { + scope:target = { + artifact_slot_type = primary_armament + } + } + OR = { + NOT = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + } + } + AND = { + scope:target = { + rarity = illustrious + } + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + NOT = { + rarity = illustrious + } + } + } + AND = { + scope:target = { + rarity = famed + } + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + NOR = { + rarity = illustrious + rarity = famed + } + } + } + AND = { + scope:target = { + rarity = masterwork + } + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + NOR = { + rarity = illustrious + rarity = famed + rarity = masterwork + } + } + } + AND = { + scope:target = { + rarity = common + } + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + NOR = { + rarity = illustrious + rarity = famed + rarity = masterwork + rarity = common + } + } + } + } + } + trigger_if = { + limit = { + scope:target = { + artifact_slot_type = armor + } + } + OR = { + NOT = { + any_equipped_character_artifact = { + artifact_slot_type = armor + } + } + AND = { + scope:target = { + rarity = illustrious + } + any_equipped_character_artifact = { + artifact_slot_type = armor + NOT = { + rarity = illustrious + } + } + } + AND = { + scope:target = { + rarity = famed + } + any_equipped_character_artifact = { + artifact_slot_type = armor + NOR = { + rarity = illustrious + rarity = famed + } + } + } + AND = { + scope:target = { + rarity = masterwork + } + any_equipped_character_artifact = { + artifact_slot_type = armor + NOR = { + rarity = illustrious + rarity = famed + rarity = masterwork + } + } + } + AND = { + scope:target = { + rarity = common + } + any_equipped_character_artifact = { + artifact_slot_type = armor + NOR = { + rarity = illustrious + rarity = famed + rarity = masterwork + rarity = common + } + } + } + } + } + trigger_if = { + limit = { + scope:target = { + artifact_slot_type = regalia + } + } + OR = { + NOT = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + } + } + AND = { + scope:target = { + rarity = illustrious + } + any_equipped_character_artifact = { + artifact_slot_type = regalia + NOT = { + rarity = illustrious + } + } + } + AND = { + scope:target = { + rarity = famed + } + any_equipped_character_artifact = { + artifact_slot_type = regalia + NOR = { + rarity = illustrious + rarity = famed + } + } + } + AND = { + scope:target = { + rarity = masterwork + } + any_equipped_character_artifact = { + artifact_slot_type = regalia + NOR = { + rarity = illustrious + rarity = famed + rarity = masterwork + } + } + } + AND = { + scope:target = { + rarity = common + } + any_equipped_character_artifact = { + artifact_slot_type = regalia + NOR = { + rarity = illustrious + rarity = famed + rarity = masterwork + rarity = common + } + } + } + } + } + trigger_if = { + limit = { + scope:target = { + artifact_slot_type = helmet + } + } + OR = { + NOT = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + } + } + AND = { + scope:target = { + rarity = illustrious + } + any_equipped_character_artifact = { + artifact_slot_type = helmet + NOT = { + rarity = illustrious + } + } + } + AND = { + scope:target = { + rarity = famed + } + any_equipped_character_artifact = { + artifact_slot_type = helmet + NOR = { + rarity = illustrious + rarity = famed + } + } + } + AND = { + scope:target = { + rarity = masterwork + } + any_equipped_character_artifact = { + artifact_slot_type = helmet + NOR = { + rarity = illustrious + rarity = famed + rarity = masterwork + } + } + } + AND = { + scope:target = { + rarity = common + } + any_equipped_character_artifact = { + artifact_slot_type = helmet + NOR = { + rarity = illustrious + rarity = famed + rarity = masterwork + rarity = common + } + } + } + } + } + } + scope:target = { + equip_artifact_to_owner_replace = yes + } + } + } + } + } + + auto_accept = no + + ai_accept = { + base = 0 + modifier = { + add = 100 + desc = ARTIFACT_REASON + } + modifier = { + add = -80 + NOT = { + can_equip_artifact = scope:target + } + desc = ARTIFACT_NOT_EQUIPPABLE_REASON + } + modifier = { + add = -40 + NOT = { + can_benefit_from_artifact = scope:target + } + desc = ARTIFACT_NOT_BENEFIT_REASON + } + modifier = { + add = 100 + exists = scope:target.var:banner_dynasty + exists = scope:recipient.dynasty + scope:recipient = scope:target.var:banner_dynasty.dynast + desc = ARTIFACT_DYNASTY_BANNER_REASON + } + modifier = { + add = -200 + OR = { + exists = scope:target.var:banner_dynasty + exists = scope:target.var:banner_house + } + exists = scope:recipient.house + trigger_if = { + limit = { exists = scope:target.var:banner_dynasty } + scope:target.var:banner_dynasty != scope:recipient.dynasty + } + trigger_else = { + scope:target.var:banner_house != scope:recipient.house + } + desc = ARTIFACT_USELESS_BANNER_REASON + } + # Struggle motive + modifier = { + desc = AI_STRUGGLE_INTENT + scope:recipient = { + top_liege = this + any_character_struggle = { + involvement = involved + } + } + add = { + value = 0 + if = { + limit = { + scope:recipient = { + any_character_struggle = { + phase_has_catalyst = catalyst_gift_independent_ruler + } + has_character_flag = agenda_towards_escalation + } + } + add = -100 + } + else_if = { + limit = { + scope:recipient = { + any_character_struggle = { + phase_has_catalyst = catalyst_gift_independent_ruler + } + } + } + add = 200 + } + } + } + # Unity modifiers + evaluate_action_increasing_house_unity = { + VALUE = 100 + } + } + + ai_potential = { + has_any_artifact = yes + trigger_if = { + limit = { + exists = scope:target.var:banner_dynasty + exists = scope:recipient.dynasty + scope:recipient = scope:target.var:banner_dynasty.dynast + } + NOT = { + scope:actor = { + has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + } + } + trigger_else = { + is_adult = yes + ai_greed <= high_positive_ai_value + # the AI shouldn't give away equipped artifacts + has_any_unequipped_artifact = yes + + NOT = { + has_trait = greedy + } + } + } + + ai_min_reply_days = 0 + ai_max_reply_days = 0 + + ai_will_do = { + base = 0 + + modifier = { + add = 100 + scope:actor = { + OR = { + has_relation_friend = scope:recipient + has_relation_lover = scope:recipient + is_close_or_extended_family_of = scope:recipient + AND = { + exists = dynasty + exists = scope:recipient.dynasty + dynasty = scope:recipient.dynasty + } + + AND = { + ai_greed <= low_negative_ai_value + OR = { # Lieges/vassals, within realm + is_vassal_of = scope:recipient + target_is_vassal_or_below = scope:recipient + house.house_confederation ?= { # House Bloc + scope:recipient.house.house_confederation ?= this + leading_house ?= scope:recipient.house + has_cohesion_level_parameter = bloc_members_send_leader_gifts + } + } + opinion = { + target = scope:recipient + value >= medium_positive_opinion + } + } + } + } + + scope:target = { + is_equipped = no + } + + scope:recipient = { + OR = { + AND = { # Players like nice gifts + scope:target = { + OR = { + rarity = famed + rarity = illustrious + } + } + is_ai = no + } + AND = { # Might as well give Court Artifacts to their liege if they cant use them themselves + has_royal_court = yes + has_dlc_feature = court_artifacts + target_is_vassal_or_below = scope:actor + scope:actor = { + has_royal_court = no + } + scope:target = { + OR = { + artifact_slot_type = throne + artifact_slot_type = wall_big + artifact_slot_type = wall_small + artifact_slot_type = sculpture + artifact_slot_type = book + artifact_slot_type = pedestal + } + } + } + AND = { + scope:target = { + artifact_slot_type = primary_armament + } + scope:actor = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + } + } + NOT = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + } + } + } + AND = { + scope:target = { + artifact_slot_type = regalia + } + scope:actor = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + } + } + NOT = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + } + } + } + AND = { + scope:target = { + artifact_slot_type = helmet + } + scope:actor = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + } + } + NOT = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + } + } + } + AND = { + scope:target = { + artifact_slot_type = armor + } + scope:actor = { + any_equipped_character_artifact = { + artifact_slot_type = armor + } + } + NOT = { + any_equipped_character_artifact = { + artifact_slot_type = armor + } + } + } + AND = { + can_equip_artifact = scope:target # To avoid gifting old children's toys to adults... + can_benefit_from_artifact = scope:target + scope:target = { + artifact_slot_type = miscellaneous + } + scope:actor = { + any_equipped_character_artifact = { + count >= 4 + artifact_slot_type = miscellaneous + } + } + any_equipped_character_artifact = { + count < 4 + artifact_slot_type = miscellaneous + } + } + AND = { + has_royal_court = yes + scope:target = { + artifact_slot_type = throne + } + scope:actor = { + OR = { + has_royal_court = no + any_equipped_character_artifact = { + artifact_slot_type = throne + } + } + } + NOT = { + any_equipped_character_artifact = { + artifact_slot_type = throne + } + } + } + AND = { + has_royal_court = yes + scope:target = { + artifact_slot_type = wall_big + } + scope:actor = { + OR = { + has_royal_court = no + any_equipped_character_artifact = { + count >= 3 + artifact_slot_type = wall_big + } + } + } + any_equipped_character_artifact = { + count < 3 + artifact_slot_type = wall_big + } + } + AND = { + has_royal_court = yes + scope:target = { + artifact_slot_type = wall_small + } + scope:actor = { + OR = { + has_royal_court = no + any_equipped_character_artifact = { + count >= 3 + artifact_slot_type = wall_small + } + } + } + any_equipped_character_artifact = { + count < 3 + artifact_slot_type = wall_small + } + } + AND = { + has_royal_court = yes + scope:target = { + artifact_slot_type = sculpture + } + scope:actor = { + OR = { + has_royal_court = no + any_equipped_character_artifact = { + count >= 2 + artifact_slot_type = sculpture + } + } + } + any_equipped_character_artifact = { + count < 2 + artifact_slot_type = sculpture + } + } + AND = { + has_royal_court = yes + scope:target = { + artifact_slot_type = book + } + scope:actor = { + OR = { + has_royal_court = no + any_equipped_character_artifact = { + count >= 2 + artifact_slot_type = book + } + } + } + any_equipped_character_artifact = { + count < 2 + artifact_slot_type = book + } + } + AND = { + has_royal_court = yes + scope:target = { + artifact_slot_type = pedestal + } + scope:actor = { + OR = { + has_royal_court = no + any_equipped_character_artifact = { + count >= 4 + artifact_slot_type = pedestal + } + } + } + any_equipped_character_artifact = { + count < 4 + artifact_slot_type = pedestal + } + } + } + } + } + + # Struggle + modifier = { + scope:recipient = { + top_liege = this + } + scope:actor = { + any_character_struggle = { + involvement = involved + } + } + add = { + value = 0 + if = { + limit = { + scope:actor = { + any_character_struggle = { + phase_has_catalyst = catalyst_gift_independent_ruler + } + has_character_flag = agenda_towards_escalation + } + } + add = -100 + } + else_if = { + limit = { + scope:actor = { + any_character_struggle = { + phase_has_catalyst = catalyst_gift_independent_ruler + } + } + } + add = 200 + } + } + } + + # Unity modifiers + evaluate_action_increasing_house_unity = { + VALUE = 100 + } + + modifier = { + factor = 2 + scope:recipient = { + is_ai = no + } + } + + modifier = { + factor = 0.25 + scope:recipient = { + highest_held_title_tier = tier_barony + } + } + + modifier = { # Unlanded characters do not equip artifacts, no point in giving them artifacts + factor = 0 + scope:recipient = { + is_ruler = no + } + } + + modifier = { + factor = 0 + scope:recipient = { + has_relation_rival = scope:actor + } + } + + modifier = { + factor = 0 + scope:target = { + is_equipped = yes + } + } + + modifier = { + factor = 0 + scope:target = { + has_variable = gifted_artifact + } + } + + modifier = { # So that the AI doesn't give player toys + factor = 0 + scope:recipient = { + is_ai = no + NOT = { + can_equip_artifact = scope:target + } + } + } + + modifier = { + factor = 0 + scope:target = { exists = var:relic_religion } + scope:actor = { + has_religion = scope:target.var:relic_religion + } + } + + modifier = { + factor = 0 + OR = { + exists = scope:target.var:banner_house + exists = scope:target.var:banner_dynasty + } + scope:recipient = { + NOT = { + can_benefit_from_artifact = scope:target + } + } + } + + modifier = { + add = 100 + exists = scope:target.var:banner_dynasty + exists = scope:recipient.dynasty + scope:recipient = scope:target.var:banner_dynasty.dynast + NOT = { + scope:actor = { + has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + } + } + + modifier = { + factor = 2 + scope:actor.house.house_confederation ?= { + has_cohesion_level_parameter = bloc_members_send_leader_gifts + leading_house.house_head ?= scope:recipient + } + } + } +} + +# Demand an artifact you have a claim on +demand_artifact_interaction = { + category = interaction_category_diplomacy + common_interaction = yes + interface_priority = 60 + use_diplomatic_range = yes + desc = demand_artifact_interaction_desc + icon = artisan_inspiration + + target_type = artifact + target_filter = recipient_artifacts_claimable + + greeting = negative + notification_text = DEMAND_ARTIFACT_PROPOSAL + + answer_accept_key = DEMAND_ARTIFACT_ACCEPT + answer_reject_key = DEMAND_ARTIFACT_REJECT + + ai_targets = { + ai_recipients = scripted_relations + } + ai_targets = { + ai_recipients = liege + } + ai_targets = { + ai_recipients = neighboring_rulers + ai_recipients = peer_vassals + ai_recipients = nearby_domicile_owners + max = 10 + } + ai_targets = { + ai_recipients = vassals + max = 10 + } + ai_targets = { + ai_recipients = family + max = 10 + } + ai_target_quick_trigger = { + adult = yes + } + ai_frequency_by_tier = { + barony = 0 + county = 0 + duchy = 72 + kingdom = 36 + empire = 36 + hegemony = 36 + } + + is_shown = { + scope:recipient != scope:actor + + custom_description = { + text = "demand_artifact_interaction_valid_tt_1" + scope:recipient = { + # needs to have an artifact we can claim + any_character_artifact = { + can_be_claimed_by = scope:actor + NOT = { has_variable = is_tribute_mission_artifact } + } + } + } + + scope:recipient = { + trigger_if = { + limit = { + exists = involved_activity + } + NOT = { + involved_activity ?= { #do not give out anything during coronation + has_activity_type = activity_coronation + activity_host = scope:recipient + } + } + } + } + + scope:actor = { + OR = { + is_ai = no + max_military_strength >= { + value = { + value = scope:recipient.max_military_strength + multiply = 1.3 + } + } + highest_held_title_tier > scope:recipient.highest_held_title_tier + } + } + } + + is_highlighted = { + always = yes + } + + is_valid_showing_failures_only = { + + scope:actor = { + NOT = { + is_at_war_with = scope:recipient + } + } + + trigger_if = { + limit = { + scope:actor = { + has_variable = demanded_this_artifact_interaction_recently + } + } + custom_description = { + text = "demand_artifact_interaction_is_valid_tt_2" + exists = scope:demanded_artifact + scope:actor = { + has_variable = demanded_this_artifact_interaction_recently + var:demanded_this_artifact_interaction_recently = scope:demanded_artifact + } + } + } + scope:actor = { is_imprisoned = no } + } + + on_accept = { + scope:target = { + save_scope_as = demanded_artifact + } + if = { + limit = { + exists = scope:demanded_artifact + } + scope:actor = { + set_variable = { + name = demanded_this_artifact_interaction_recently + value = scope:demanded_artifact + years = 5 + } + } + } + scope:actor = { + send_interface_toast = { + type = event_toast_effect_neutral + title = demand_artifact_interaction_notification + left_icon = scope:recipient + right_icon = scope:target + scope:target = { + set_owner = scope:actor + } + + scope:recipient = { + add_opinion = { + target = scope:actor + modifier = insult_opinion + opinion = -10 + } + } + if = { + limit = { + scope:recipient = { + can_set_relation_potential_rival_trigger = { CHARACTER = scope:actor } + } + } + scope:recipient = { + set_relation_potential_rival = scope:actor + } + } + } + } + if = { + limit = { + scope:actor = { + is_ai = yes + } + } + scope:actor = { + add_opinion = { + target = scope:recipient + modifier = pleased_opinion + opinion = 30 + } + } + } + + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_loss + DESC = clan_unity_demanded_artifact.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + auto_accept = { + custom_description = { + text = "spending_hook" + subject = scope:actor + object = scope:recipient + scope:hook = yes + scope:actor = { has_strong_hook = scope:recipient } + } + } + + send_option = { + is_shown = { + scope:actor != scope:recipient + } + is_valid = { + scope:actor = { + has_usable_hook = scope:recipient + } + } + flag = hook + 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_options_exclusive = no + + ai_accept = { + base = 0 + modifier = { + add = -50 + desc = ARTIFACT_REASON + } + modifier = { + add = 70 + scope:actor.max_military_strength > scope:recipient.max_military_strength + desc = ARTIFACT_MILITARY_STRONGER_REASON + } + modifier = { + add = -70 + scope:actor.max_military_strength < scope:recipient.max_military_strength + desc = ARTIFACT_MILITARY_WEAKER_REASON + } + modifier = { + add = -50 + scope:target = { can_be_claimed_by = scope:recipient } + desc = ARTIFACT_CLAIM_REASON + } + modifier = { + add = { + value = ai_boldness + multiply = -1 + divide = 2 + } + NOT = { ai_boldness = 0 } + desc = ARTIFACT_BOLDNESS_REASON + } + modifier = { + add = -50 + scope:actor = { + has_relation_rival = scope:recipient + } + desc = ARTIFACT_RIVAL_REASON + } + modifier = { + add = -80 + scope:actor = { + has_relation_nemesis = scope:recipient + } + desc = ARTIFACT_NEMESIS_REASON + } + modifier = { + add = 50 + scope:recipient = { + target_is_liege_or_above = scope:actor + } + desc = ARTIFACT_LIEGE_REASON + } + modifier = { + scope:hook = yes + add = 100 + desc = SCHEME_WEAK_HOOK_USED + } + + # Unity modifiers + evaluate_action_decreasing_house_unity = { VALUE = 100 } + } + + ai_potential = { + is_adult = yes + is_at_war = no + ai_greed >= low_negative_ai_value + has_outstanding_artifact_claims = yes + } + + on_decline = { + scope:target = { + save_scope_as = demanded_artifact + } + if = { + limit = { + exists = scope:demanded_artifact + } + scope:actor = { + set_variable = { + name = demanded_this_artifact_interaction_recently + value = scope:demanded_artifact + years = 5 + } + } + } + scope:actor = { + send_interface_toast = { + type = event_toast_effect_bad + title = demand_artifact_interaction_notification + left_icon = scope:recipient + right_icon = scope:target + custom_tooltip = demand_artifact_interaction_notification_refused + + scope:recipient = { + add_opinion = { + target = scope:actor + modifier = insult_opinion + opinion = -10 + } + } + } + } + if = { + limit = { + scope:actor = { + is_ai = yes + } + } + scope:actor = { + add_opinion = { + target = scope:recipient + modifier = refusal_opinion + opinion = -10 + } + } + } + } + + ai_min_reply_days = 7 + ai_max_reply_days = 14 + + ai_will_do = { + base = 100 + + modifier = { # The AI will only use a Hook if they couldn't otherwise do this + scope:hook = yes + add = -1 + } + + modifier = { + add = 50 + has_relation_rival = scope:recipient + } + modifier = { + add = 80 + has_relation_nemesis = scope:recipient + } + modifier = { + add = -50 + target_is_liege_or_above = scope:recipient + } + # Recipient is flaunting their artifacts and needs to be taken down a peg - from hold_court.3080 + modifier = { + scope:recipient = { + OR = { + has_character_modifier = petition_event_artifact_exhibition_for_prestige + has_character_modifier = petition_event_artifact_exhibition_for_gold + } + } + add = 35 + } + modifier = { # An Intimidated character is very unlikely to raise their hand + add = -25 + scope:actor = { + has_dread_level_towards = { + target = scope:recipient + level = 1 + } + } + } + + # Unity modifiers + evaluate_action_decreasing_house_unity = { + VALUE = 100 + } + + modifier = { # A Cowed character will never take this interaction + factor = 0 + scope:actor = { + has_dread_level_towards = { + target = scope:recipient + level = 2 + } + } + } + modifier = { # The AI doesn't demand from players they like + factor = 0 + scope:recipient = { + is_ai = no + } + scope:actor = { + OR = { + has_relation_friend = scope:recipient + has_relation_lover = scope:recipient + opinion = { + target = scope:recipient + value >= high_positive_opinion + } + } + } + } + modifier = { # The AI doesn't demand from players that have refused already + factor = 0 + scope:recipient = { + is_ai = no + } + scope:actor = { + has_opinion_modifier = { + target = scope:recipient + modifier = refusal_opinion + } + } + } + modifier = { # Only the House Head will demand house claimed artifacts from existing House members + factor = 0 + exists = scope:actor.house.house_head + exists = scope:recipient.house + scope:actor.house.house_head = scope:actor + scope:actor.house = scope:recipient.house + + NOT = { + any_personal_claimed_artifact = { + this = scope:target + } + } + } + modifier = { + scope:actor = { + opinion = { + target = scope:recipient + value >= medium_positive_opinion + } + ai_greed <= high_positive_ai_value + } + factor = 0 + } + modifier = { + scope:recipient = { + OR = { + has_relation_friend = scope:actor + has_relation_lover = scope:actor + } + } + factor = 0 + } + modifier = { + scope:actor = { + has_royal_court = no + } + scope:target = { + OR = { + artifact_slot_type = throne + artifact_slot_type = wall_big + artifact_slot_type = wall_small + artifact_slot_type = sculpture + artifact_slot_type = book + artifact_slot_type = pedestal + } + } + factor = 0 + } + modifier = { + scope:recipient = { + OR = { + AND = { + scope:target = { + artifact_slot_type = primary_armament + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = regalia + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = helmet + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = armor + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = armor + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = armor + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = armor + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = armor + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = miscellaneous + rarity = common + } + any_equipped_character_artifact = { + count >= 4 + artifact_slot_type = miscellaneous + } + } + AND = { + scope:target = { + artifact_slot_type = throne + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = throne + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = throne + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = throne + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = throne + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = wall_big + rarity = common + } + any_equipped_character_artifact = { + count >= 3 + artifact_slot_type = wall_big + } + } + AND = { + scope:target = { + artifact_slot_type = wall_small + rarity = common + } + any_equipped_character_artifact = { + count >= 3 + artifact_slot_type = wall_small + } + } + AND = { + scope:target = { + artifact_slot_type = sculpture + rarity = common + } + any_equipped_character_artifact = { + count >= 2 + artifact_slot_type = sculpture + } + } + AND = { + scope:target = { + artifact_slot_type = book + rarity = common + } + any_equipped_character_artifact = { + count >= 2 + artifact_slot_type = book + } + } + AND = { + scope:target = { + artifact_slot_type = pedestal + rarity = common + } + any_equipped_character_artifact = { + count >= 4 + artifact_slot_type = pedestal + } + } + } + } + factor = 0 + } + } +} + +# Challenge someone to a non-lethal duel for an artifact you have a claim on +challenge_for_artifact_interaction = { + icon = icon_combat + interface_priority = 30 + common_interaction = yes + category = interaction_category_hostile + ai_maybe = yes + ai_max_reply_days = 0 + popup_on_receive = yes + pause_on_receive = yes + use_diplomatic_range = yes + can_send_despite_rejection = yes + desc = challenge_for_artifact_interaction_desc + + target_type = artifact + target_filter = recipient_artifacts_claimable + + greeting = negative + notification_text = REQUEST_ARTIFACT_COMBAT_TEXT + + answer_accept_key = REQUEST_ARTIFACT_COMBAT_ACCEPT + answer_reject_key = REQUEST_ARTIFACT_COMBAT_REJECT + + is_shown = { + # Can't duel yourself. + scope:actor != scope:recipient + custom_description = { + text = "challenge_for_artifact_interaction_valid_tt_1" + scope:recipient = { + # needs to have an artifact we can claim + any_character_artifact = { + can_be_claimed_by = scope:actor + NOT = { has_variable = is_tribute_mission_artifact } + } + } + } + scope:recipient = { + trigger_if = { + limit = { + exists = involved_activity + } + NOT = { + involved_activity ?= { #do not give out anything during coronation + has_activity_type = activity_coronation + activity_host = scope:recipient + } + } + } + } + } + + is_valid_showing_failures_only = { + rival_single_combat_shown_and_not_invalid_trigger = yes + scope:recipient = { can_start_single_combat_trigger = yes } + scope:recipient = { + custom_description = { + text = fp1_tbc_recipient_banned_from_combat + can_start_single_combat_banned_checks_trigger = no + } + } + scope:recipient = { is_imprisoned = no } + scope:actor = { is_imprisoned = no } + } + + can_send = { + scope:actor = { + custom_description = { + text = "character_interactions_hostile_actions_disabled_delay" + NOT = { has_character_flag = flag_hostile_actions_disabled_delay } + } + } + } + + is_highlighted = { + rival_single_combat_shown_and_not_invalid_trigger = yes + # Scope:recipient must be able to fight personally. + scope:recipient = { can_start_single_combat_trigger = yes } + # Scope:recipient must not be banned from single combat. + scope:recipient = { can_start_single_combat_banned_checks_trigger = no } + scope:recipient = { is_imprisoned = no } + scope:actor = { is_imprisoned = no } + } + + cost = { prestige = challenge_for_artifact_prestige_cost_value } + cooldown = { years = 2 } + cooldown_against_recipient = { years = 5 } + + on_send = { + scope:actor = { + add_character_flag = { + flag = flag_hostile_actions_disabled_delay + days = 10 + } + } + } + + on_accept = { + scope:actor = { + remove_character_flag = flag_hostile_actions_disabled_delay + } + # Set up the bout immediately. + ## First inform. + scope:actor = { + custom_tooltip = challenge_to_single_combat_interaction.enter_non_lethal_bout.tt + custom_tooltip = challenge_to_artifact_combat_interaction_victor_gets.tt + custom_tooltip = challenge_to_artifact_combat_interaction_loser_gets.tt + } + ## Finally, begin. + configure_start_single_combat_effect = { + SC_INITIATOR = scope:actor + SC_ATTACKER = scope:actor + SC_DEFENDER = scope:recipient + FATALITY = no + FIXED = no + LOCALE = terrain_scope + OUTPUT_EVENT = artifact.2001 + INVALIDATION_EVENT = fp1_tbc.0021 + } + + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = major_unity_loss + DESC = clan_unity_challenge_artifact.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + on_decline = { + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_gain + DESC = clan_unity_challenge_artifact_refusal.desc + REVERSE_NON_HOUSE_TARGET = no + } + + # Scope:recipient declines processing. + scope:actor = { + # Inform them of the decline & scope:recipient loses some prestige. + send_interface_toast = { + type = event_toast_effect_neutral + title = challenge_to_single_combat_interaction.challenge_rejected.t + left_icon = scope:recipient + right_icon = scope:actor + scope:recipient = { + add_prestige = { + value = 0 + subtract = challenge_for_artifact_prestige_cost_value + } + } + show_as_tooltip = { + add_prestige = challenge_for_artifact_prestige_cost_value + } + } + hidden_effect = { + add_prestige_no_experience = challenge_for_artifact_prestige_cost_value + # Cooldown is removed. + remove_interaction_cooldown = challenge_for_artifact_interaction + } + # Clear up hostile actions flag. + if = { + limit = { + has_character_flag = flag_hostile_actions_disabled_delay + } + remove_character_flag = flag_hostile_actions_disabled_delay + } + } + } + + auto_accept = no + + ai_accept = { + base = 50 # Try to make it 0 for most interactions + + # Relative fighting ability. + modifier = { + desc = CTSC_RELATIVE_PROWESS + scope:actor.prowess < scope:recipient.prowess + add = { + value = scope:recipient.prowess + subtract = scope:actor.prowess + multiply = 2 + } + } + modifier = { + desc = CTSC_RELATIVE_PROWESS + scope:recipient.prowess < scope:actor.prowess + add = { + value = scope:actor.prowess + subtract = scope:recipient.prowess + multiply = -2 + } + } + # Weight up for personality values. + ai_value_modifier = { + who = scope:recipient + ai_boldness = 1 + ai_vengefulness = 0.75 + ai_honor = 0.5 + ai_rationality = -0.25 + ai_greed = -0.5 + } + # Apply tier differences. + ## King -> Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value >= 4 + } + } + add = 15 + } + ## Duke -> Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value = 3 + } + } + add = 10 + } + ## Count -> Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value = 2 + } + } + add = 5 + } + ## King <- Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value = -2 + } + } + add = -20 + } + ## Duke <- Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value = -3 + } + } + add = -30 + } + ## Count <- Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value <= -4 + } + } + add = -40 + } + # Rival modifier + modifier = { + desc = offer_vassalization_interaction_aibehavior_rival_tt + trigger = { + scope:recipient = { + has_relation_rival = scope:actor + } + } + add = 30 + } + # Nemesis modifier + modifier = { + desc = offer_vassalization_interaction_aibehavior_nemesis_tt + trigger = { + scope:recipient = { + has_relation_nemesis = scope:actor + } + } + add = 50 + } + # Prestige too low to decline + modifier = { + desc = cannot_afford_prestige_loss_tt + trigger = { scope:recipient.prestige < challenge_for_artifact_prestige_limit_value } # 1/3rd of potential loss + add = 30 + } + + # Unity modifiers + evaluate_action_decreasing_house_unity = { + VALUE = 100 + } + } + + # AI + ai_potential = { + NOT = { has_trait = craven } + is_imprisoned = no + can_start_single_combat_trigger = yes + ai_greed >= low_negative_ai_value + has_outstanding_artifact_claims = yes + } + + ai_target_quick_trigger = { + adult = yes + } + ai_targets = { + ai_recipients = scripted_relations + } + + ai_targets = { + ai_recipients = liege + } + ai_targets = { + ai_recipients = neighboring_rulers + ai_recipients = peer_vassals + ai_recipients = nearby_domicile_owners + max = 10 + } + ai_targets = { + ai_recipients = family + max = 10 + } + ai_targets = { + ai_recipients = vassals + max = 10 + } + + ai_frequency_by_tier = { + barony = 0 + county = 120 + duchy = 60 + kingdom = 60 + empire = 60 + hegemony = 60 + } + + ai_will_do = { + base = -50 + + # Factor for personality (excluding realism). + modifier = { + add = ai_boldness + } + modifier = { + ai_vengefulness > 0 + add = ai_vengefulness + } + modifier = { + add = { + value = ai_compassion + multiply = -0.25 + } + } + # Don't challenge your spouse, unless they're your nemesis. + modifier = { + scope:recipient = { + is_spouse_of = scope:actor + NOT = { has_relation_nemesis = scope:actor } + } + add = -1000 + } + # Don't challenge people hopelessly out of your league unless you're really, really not seeing things clearly. + modifier = { + scope:actor = { + prowess_diff = { + target = scope:recipient + value <= -15 + } + ai_rationality >= high_negative_ai_value + } + add = -1000 + } + # Don't challenge your liege - it's really bad form - unless you are REALLY motivated + modifier = { + scope:actor = { + is_vassal_of = scope:recipient + } + add = -100 + } + # Challenge them if they are your rival + modifier = { + scope:actor = { + has_relation_rival = scope:recipient + } + add = 30 + } + # Totally challenge them if they are your nemesis! + modifier = { + scope:actor = { + has_relation_nemesis = scope:recipient + } + add = 50 + } + # Recipient is flaunting their artifacts and needs to be taken down a peg - from hold_court.3080 + modifier = { + scope:recipient = { + OR = { + has_character_modifier = petition_event_artifact_exhibition_for_prestige + has_character_modifier = petition_event_artifact_exhibition_for_gold + } + } + add = 35 + } + modifier = { # An Intimidated character is very unlikely to raise their hand + add = -25 + scope:actor = { + has_dread_level_towards = { + target = scope:recipient + level = 1 + } + } + } + + # Unity modifiers + evaluate_action_decreasing_house_unity = { + VALUE = 100 + } + + + modifier = { # A Cowed character will never take this interaction + factor = 0 + scope:actor = { + has_dread_level_towards = { + target = scope:recipient + level = 2 + } + } + } + modifier = { + scope:actor = { + opinion = { + target = scope:recipient + value >= medium_positive_opinion + } + ai_greed <= high_positive_ai_value + } + factor = 0 + } + modifier = { + scope:recipient = { + OR = { + has_relation_friend = scope:actor + has_relation_lover = scope:actor + } + } + factor = 0 + } + modifier = { + scope:actor = { + has_royal_court = no + } + scope:target = { + OR = { + artifact_slot_type = throne + artifact_slot_type = wall_big + artifact_slot_type = wall_small + artifact_slot_type = sculpture + artifact_slot_type = book + artifact_slot_type = pedestal + } + } + factor = 0 + } + modifier = { + scope:recipient = { + OR = { + AND = { + scope:target = { + artifact_slot_type = primary_armament + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = regalia + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = helmet + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = armor + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = armor + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = armor + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = armor + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = armor + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = miscellaneous + rarity = common + } + any_equipped_character_artifact = { + count >= 4 + artifact_slot_type = miscellaneous + } + } + AND = { + scope:target = { + artifact_slot_type = throne + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = throne + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = throne + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = throne + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = throne + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = wall_big + rarity = common + } + any_equipped_character_artifact = { + count >= 3 + artifact_slot_type = wall_big + } + } + AND = { + scope:target = { + artifact_slot_type = wall_small + rarity = common + } + any_equipped_character_artifact = { + count >= 3 + artifact_slot_type = wall_small + } + } + AND = { + scope:target = { + artifact_slot_type = sculpture + rarity = common + } + any_equipped_character_artifact = { + count >= 2 + artifact_slot_type = sculpture + } + } + AND = { + scope:target = { + artifact_slot_type = book + rarity = common + } + any_equipped_character_artifact = { + count >= 2 + artifact_slot_type = book + } + } + AND = { + scope:target = { + artifact_slot_type = pedestal + rarity = common + } + any_equipped_character_artifact = { + count >= 4 + artifact_slot_type = pedestal + } + } + } + } + factor = 0 + } + } +} + +#Steal an artifact that you have a claim on +start_stealing_back_artifact = { + icon = icon_scheme_steal_back_artifact + interface_priority = 70 + category = interaction_category_hostile + common_interaction = yes + + send_name = START_SCHEME + + scheme = steal_back_artifact + ignores_pending_interaction_block = yes + + target_type = artifact + target_filter = recipient_artifacts + + is_shown = { + NOR = { + scope:recipient = scope:actor + scope:recipient = { is_imprisoned_by = scope:actor } + } + OR = { + scope:recipient = { + # needs to have an artifact we can claim + any_character_artifact = { + can_be_claimed_by = scope:actor + } + } + AND = { + scope:recipient = { has_any_artifact = yes } + scope:actor = { + OR = { + employs_court_position = master_thief_camp_officer + any_character_active_contract = { + task_contract_type = laamp_steal_artifact_contract + var:task_contract_target ?= scope:recipient + } + } + } + } + } + } + + is_highlighted = { + always = yes + } + + is_valid_showing_failures_only = { + trigger_if = { + limit = { + scope:actor = { + any_character_artifact = { + scope:actor = { has_artifact_claim = prev } + } + } + } + + custom_description = { + text = steal_back_artifact_can_start_scheme + subject = scope:actor + object = scope:recipient + scope:actor = { + can_start_scheme = { + type = steal_back_artifact + target_character = scope:recipient + } + } + scope:recipient = { has_any_artifact = yes } + } + } + trigger_if = { + limit = { + scope:actor = { + NOR = { + employs_court_position = master_thief_camp_officer + any_character_task_contract = { + task_contract_type = laamp_steal_artifact_contract + var:task_contract_target ?= scope:recipient + } + } + } + } + custom_description = { + text = steal_back_artifact_must_have_claim_blocker + subject = scope:actor + object = scope:recipient + + scope:recipient = { + any_character_artifact = { + scope:actor = { + has_artifact_claim = prev + } + } + } + } + } + custom_description = { + object = scope:recipient + text = you_have_been_caught_trying_to_steal_artifact_from_target + scope:recipient = { + NOT = { + has_opinion_modifier = { + target = scope:actor + modifier = attempted_to_steal_artifact_from_me + } + } + } + } + + custom_description = { + object = scope:recipient + text = you_have_recently_stolen_artifact_from_target + scope:recipient = { + NOT = { + has_opinion_modifier = { + target = scope:actor + modifier = stole_artifact_from_me + } + } + } + } + + trigger_if = { #In range for LAAMP + limit = { + scope:actor = { is_landless_adventurer = yes } + scope:recipient = { + NOT = { + any_character_artifact = { + scope:actor = { has_artifact_claim = prev } + } + } + } + } + ep3_laamp_diplo_range_trigger = { + TARGET = scope:recipient + LAAMP = scope:actor + } + } + } + + desc = { + triggered_desc = { + trigger = { + scope:actor = { + can_start_scheme = { + type = steal_back_artifact + target_character = scope:recipient + } + } + } + desc = scheme_interaction_tt_steal_back_artifact_approved + } + } + can_be_picked_artifact = { + trigger_if = { + limit = { + scope:actor = { + NOR = { + employs_court_position = master_thief_camp_officer + any_character_active_contract = { + task_contract_type = laamp_steal_artifact_contract + var:task_contract_object ?= scope:target + } + } + } + } + scope:actor = { + has_artifact_claim = scope:target + } + } + scope:target = { + NOT = { has_variable = is_tribute_mission_artifact } + } + } + + # Scheme Starter Packages + options_heading = schemes.t.agent_packages + send_options_exclusive = yes + ## Balanced agents. + send_option = { + flag = agent_focus_balance + current_description = start_stealing_back_artifact.tt.agent_focus_balance + } + ## Focused on Success Chance. + send_option = { + flag = agent_focus_success + current_description = start_stealing_back_artifact.tt.agent_focus_success + } + ## Focused on Speed. + send_option = { + flag = agent_focus_speed + current_description = start_stealing_back_artifact.tt.agent_focus_speed + } + ## Focused on Secrecy. + send_option = { + flag = agent_focus_secrecy + current_description = start_stealing_back_artifact.tt.agent_focus_secrecy + } + + on_accept = { + scope:actor = { + stress_impact = { + vengeful = medium_stress_impact_loss + honest = minor_stress_impact_gain + just = minor_stress_impact_loss + } + } + hidden_effect = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_neutral + title = start_stealing_back_artifact_notification + + left_icon = scope:actor + right_icon = scope:recipient + + if = { + limit = { + any_character_active_contract = { + task_contract_type = laamp_steal_artifact_contract + var:task_contract_target ?= scope:recipient + } + } + random_character_active_contract = { + task_contract_type = laamp_steal_artifact_contract + limit = { + var:task_contract_target ?= scope:recipient + } + save_scope_as = scheme_contract + } + # Success. + if = { + limit = { scope:agent_focus_success ?= yes } + begin_contract_scheme_with_agents_effect = { + SCHEME_TYPE = steal_back_artifact + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + TASK_CONTRACT = scope:scheme_contract + # Success. + AGENT_1 = agent_thief + AGENT_2 = agent_thief + AGENT_3 = agent_thug + # Speed. + AGENT_4 = agent_infiltrator + # Secrecy. + AGENT_5 = agent_lookout + } + } + # Speed. + else_if = { + limit = { scope:agent_focus_speed ?= yes } + begin_contract_scheme_with_agents_effect = { + SCHEME_TYPE = steal_back_artifact + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + TASK_CONTRACT = scope:scheme_contract + # Speed. + AGENT_1 = agent_infiltrator + AGENT_2 = agent_infiltrator + AGENT_3 = agent_footpad + # Success. + AGENT_4 = agent_thief + # Secrecy. + AGENT_5 = agent_lookout + } + } + # Secrecy. + else_if = { + limit = { scope:agent_focus_secrecy ?= yes } + begin_contract_scheme_with_agents_effect = { + SCHEME_TYPE = steal_back_artifact + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + TASK_CONTRACT = scope:scheme_contract + # Secrecy. + AGENT_1 = agent_lookout + AGENT_2 = agent_alibi + AGENT_3 = agent_decoy + # Success. + AGENT_4 = agent_thief + # Speed. + AGENT_5 = agent_infiltrator + } + } + # Balanced. + else = { + begin_contract_scheme_with_agents_effect = { + SCHEME_TYPE = steal_back_artifact + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + TASK_CONTRACT = scope:scheme_contract + # Success. + AGENT_1 = agent_thief + AGENT_2 = agent_thief + # Speed. + AGENT_3 = agent_infiltrator + AGENT_4 = agent_infiltrator + # Secrecy. + AGENT_5 = agent_lookout + } + } + } + else = { + # Success. + if = { + limit = { scope:agent_focus_success ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = steal_back_artifact + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Success. + AGENT_1 = agent_thief + AGENT_2 = agent_thief + AGENT_3 = agent_thug + # Speed. + AGENT_4 = agent_infiltrator + # Secrecy. + AGENT_5 = agent_lookout + } + } + # Speed. + else_if = { + limit = { scope:agent_focus_speed ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = steal_back_artifact + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Speed. + AGENT_1 = agent_infiltrator + AGENT_2 = agent_infiltrator + AGENT_3 = agent_footpad + # Success. + AGENT_4 = agent_thief + # Secrecy. + AGENT_5 = agent_lookout + } + } + # Secrecy. + else_if = { + limit = { scope:agent_focus_secrecy ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = steal_back_artifact + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Secrecy. + AGENT_1 = agent_lookout + AGENT_2 = agent_alibi + AGENT_3 = agent_decoy + # Success. + AGENT_4 = agent_thief + # Speed. + AGENT_5 = agent_infiltrator + } + } + # Balanced. + else = { + begin_scheme_with_agents_effect = { + SCHEME_TYPE = steal_back_artifact + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Success. + AGENT_1 = agent_thief + AGENT_2 = agent_thief + # Speed. + AGENT_3 = agent_infiltrator + AGENT_4 = agent_infiltrator + # Secrecy. + AGENT_5 = agent_lookout + } + } + } + scope:new_scheme ?= { + set_variable = { + name = target_artifact + value = scope:target + } + } + show_as_tooltip = { + stress_impact = { + vengeful = medium_stress_impact_loss + honest = minor_stress_impact_gain + just = minor_stress_impact_loss + } + } + } + } + } + } + + # AI + ai_potential = { + is_imprisoned = no + ai_greed >= low_negative_ai_value + intrigue >= low_skill_rating + has_outstanding_artifact_claims = yes + NOT = { + any_scheme = { + OR = { + scheme_type = murder + scheme_type = abduct + scheme_type = claim_throne + scheme_type = fabricate_hook + scheme_type = steal_back_artifact + } + } + } + } + + ai_target_quick_trigger = { + adult = yes + } + ai_targets = { + ai_recipients = scripted_relations + } + + ai_targets = { + ai_recipients = liege + } + ai_targets = { + ai_recipients = neighboring_rulers + ai_recipients = peer_vassals + ai_recipients = nearby_domicile_owners + max = 10 + } + ai_targets = { + ai_recipients = family + max = 10 + } + ai_targets = { + ai_recipients = vassals + max = 10 + } + + ai_frequency_by_tier = { + barony = 0 + county = 144 + duchy = 72 + kingdom = 36 + empire = 36 + hegemony = 36 + } + + ai_will_do = { + base = -30 + # Factor for personality (excluding realism). + modifier = { + add = { + value = ai_boldness + multiply = -1 + } + } + modifier = { + ai_vengefulness > 0 + add = ai_vengefulness + } + modifier = { + add = { + value = ai_compassion + multiply = -0.25 + } + } + modifier = { + scope:actor = { + has_relation_rival = scope:recipient + } + add = 60 + } + modifier = { + scope:actor = { + has_relation_nemesis = scope:recipient + } + add = 150 + } + # Recipient is flaunting their artifacts and needs to be taken down a peg - from hold_court.3080 + modifier = { + scope:recipient = { + OR = { + has_character_modifier = petition_event_artifact_exhibition_for_prestige + has_character_modifier = petition_event_artifact_exhibition_for_gold + } + } + add = 35 + } + modifier = { + scope:actor = { + opinion = { + target = scope:recipient + value >= medium_positive_opinion + } + ai_greed <= high_positive_ai_value + } + factor = 0 + } + modifier = { + scope:recipient = { + OR = { + has_relation_friend = scope:actor + has_relation_lover = scope:actor + } + } + factor = 0 + } + modifier = { + scope:actor = { + has_royal_court = no + } + scope:target = { + OR = { + artifact_slot_type = throne + artifact_slot_type = wall_big + artifact_slot_type = wall_small + artifact_slot_type = sculpture + artifact_slot_type = book + artifact_slot_type = pedestal + } + } + factor = 0 + } + modifier = { + scope:recipient = { + OR = { + AND = { + scope:target = { + artifact_slot_type = primary_armament + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = regalia + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = helmet + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = armor + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = armor + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = armor + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = armor + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = armor + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = miscellaneous + rarity = common + } + any_equipped_character_artifact = { + count >= 4 + artifact_slot_type = miscellaneous + } + } + AND = { + scope:target = { + artifact_slot_type = throne + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = throne + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = throne + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = throne + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = throne + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = wall_big + rarity = common + } + any_equipped_character_artifact = { + count >= 3 + artifact_slot_type = wall_big + } + } + AND = { + scope:target = { + artifact_slot_type = wall_small + rarity = common + } + any_equipped_character_artifact = { + count >= 3 + artifact_slot_type = wall_small + } + } + AND = { + scope:target = { + artifact_slot_type = sculpture + rarity = common + } + any_equipped_character_artifact = { + count >= 2 + artifact_slot_type = sculpture + } + } + AND = { + scope:target = { + artifact_slot_type = book + rarity = common + } + any_equipped_character_artifact = { + count >= 2 + artifact_slot_type = book + } + } + AND = { + scope:target = { + artifact_slot_type = pedestal + rarity = common + } + any_equipped_character_artifact = { + count >= 4 + artifact_slot_type = pedestal + } + } + } + } + factor = 0 + } + start_hostile_scheme_ai_base_modifiers = yes # At the end so Cowed can block it completely + } + + auto_accept = yes +} + +buy_artifact_claim = { + category = interaction_category_diplomacy + common_interaction = yes + ignores_pending_interaction_block = yes + icon = artisan_inspiration + + target_type = artifact + target_filter = recipient_artifacts + + is_shown = { + # interaction locked behind Accomplished Forger perk from the Diplomacy lifestyle + scope:actor = { + has_perk = accomplished_forger_perk + is_landless_adventurer = no + } + NOR = { + # Can't buy from yourself + scope:recipient = scope:actor + # Can't buy from one of your prisoners + scope:recipient = { is_imprisoned_by = scope:actor } + } + scope:recipient = { + in_diplomatic_range = scope:actor + any_character_artifact = { + exists = this + scope:actor = { + NOT = { has_personal_artifact_claim = prev } + } + NOR = { + # maybe? nah. we can't. + has_variable = pope_hat + # This is the only way I have found to exclude dynastic banners + artifact_type = wall_big + } + } + } + scope:recipient = { + trigger_if = { + limit = { + exists = involved_activity + } + NOT = { + involved_activity ?= { #do not give out anything during coronation + has_activity_type = activity_coronation + activity_host = scope:recipient + } + } + } + } + } + + can_be_picked = { + scope:target = { + NOR = { + # can't already have a claim on the artifact + scope:actor = { has_personal_artifact_claim = prev } + # no pope hats or dynastic banners + has_variable = pope_hat + artifact_type = wall_big + has_variable = is_tribute_mission_artifact + has_variable = artifact_prevent_transfer + } + } + } + + is_valid_showing_failures_only = { + # Can't buy an artifact claim against yourself or one of your prisoners + NOR = { + scope:recipient = scope:actor + scope:recipient = { is_imprisoned_by = scope:actor } + } + scope:recipient = { + # needs to have an artifact + any_character_artifact = { + exists = this + # actor can't already have a claim on said artifact + scope:actor = { + NOT = { has_personal_artifact_claim = prev } + } + } + } + + # Claim costs are calculated with scripted values located 00_lifestyle_values. The piety interaction costs copy those used for the regular Buy Claim interaciton and the prestige costs are calculated according to the same method. + + # Checks to determine piety cost for Religious Artifacts + trigger_if = { + limit = { + exists = scope:target.var:relic + scope:target = { rarity = common } + } + scope:actor = { piety >= minor_buy_claim_piety_value } + } + trigger_else_if = { + limit = { + exists = scope:target.var:relic + scope:target = { rarity = masterwork } + } + scope:actor = { piety >= medium_buy_claim_piety_value } + } + trigger_else_if = { + limit = { + exists = scope:target.var:relic + scope:target = { rarity = famed } + } + scope:actor = { piety >= major_buy_claim_piety_value } + } + trigger_else = { + limit = { + exists = scope:target.var:relic + scope:target = { rarity = illustrious } + } + scope:actor = { piety >= massive_buy_claim_piety_value } + } + + # Checks to determine prestige cost for regular artifacts + trigger_if = { + limit = { + exists = scope:target + NOT = { exists = scope:target.var:relic } + scope:target = { rarity = common } + } + scope:actor = { prestige >= minor_buy_claim_prestige_value } + } + trigger_else_if = { + limit = { + exists = scope:target + NOT = { exists = scope:target.var:relic } + scope:target = { rarity = masterwork } + } + scope:actor = { prestige >= medium_buy_claim_prestige_value } + } + trigger_else_if = { + limit = { + exists = scope:target + NOT = { exists = scope:target.var:relic } + scope:target = { rarity = famed } + } + scope:actor = { prestige >= major_buy_claim_prestige_value } + } + trigger_else = { + limit = { + exists = scope:target + NOT = { exists = scope:target.var:relic } + scope:target = { rarity = illustrious } + } + scope:actor = { prestige >= massive_buy_claim_prestige_value } + } + } + + desc = buy_artifact_claim_desc + + auto_accept = yes + + on_accept = { + # If it's a religous artifact... + if = { + limit = { + exists = scope:target.var:relic + } + # Toast to the actor + scope:actor = { + send_interface_toast = { + type = event_artifact_good + title = bought_artifact_claim.t + left_icon = scope:recipient + right_icon = scope:target + # Determine piety cost + if = { + limit = { + exists = scope:target.var:relic + scope:target = { rarity = common } + } + scope:actor = { add_piety = minor_buy_claim_piety_loss } + } + else_if = { + limit = { + exists = scope:target.var:relic + scope:target = { rarity = masterwork } + } + scope:actor = { add_piety = medium_buy_claim_piety_loss } + } + else_if = { + limit = { + exists = scope:target.var:relic + scope:target = { rarity = famed } + } + scope:actor = { add_piety = major_buy_claim_piety_loss } + } + else_if = { + limit = { + exists = scope:target.var:relic + scope:target = { rarity = illustrious } + } + scope:actor = { add_piety = massive_buy_claim_piety_loss } + } + add_personal_artifact_claim = scope:target + } + } + # Toast to the recipient + scope:recipient = { + send_interface_message = { + type = event_artifact_bad_text + title = sold_artifact_claim.t + desc = sold_artifact_claim.desc + left_icon = scope:actor + right_icon = scope:target + } + } + } + # If it's not a religous artifact... + else = { + scope:actor = { + send_interface_toast = { + type = event_artifact_bad + title = bought_artifact_claim.t + left_icon = scope:recipient + right_icon = scope:target + # Determine prestige cost + if = { + limit = { + exists = scope:target + scope:target = { rarity = common } + } + scope:actor = { add_prestige = minor_buy_claim_prestige_loss } + } + else_if = { + limit = { + exists = scope:target + scope:target = { rarity = masterwork } + } + scope:actor = { add_prestige = medium_buy_claim_prestige_loss } + } + else_if = { + limit = { + exists = scope:target + scope:target = { rarity = famed } + } + scope:actor = { add_prestige = major_buy_claim_prestige_loss } + } + else_if = { + limit = { + exists = scope:target + scope:target = { rarity = illustrious } + } + scope:actor = { add_prestige = massive_buy_claim_prestige_loss} + } + add_personal_artifact_claim = scope:target + } + } + + scope:recipient = { + send_interface_message = { + type = event_artifact_bad_text + title = sold_artifact_claim.t + desc = sold_artifact_claim.desc + left_icon = scope:actor + right_icon = scope:target + } + } + } + scope:actor = { + stress_impact = { + just = medium_stress_impact_gain + honest = medium_stress_impact_gain + } + } + scope:recipient = { + add_opinion = { + target = scope:actor + modifier = claimed_my_artifact_opinion + opinion = -40 + } + # Recipient grows closer to forming a rivalry with the actor + if = { + limit = { + can_set_relation_potential_rival_trigger = { + CHARACTER = scope:actor + } + } + set_relation_potential_rival = scope:actor + } + } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_loss + DESC = clan_unity_bought_artifact_claim.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + # AI STUFF + ai_target_quick_trigger = { + adult = yes + } + + ai_targets = { + # Only want AI to target neighbors + ai_recipients = neighboring_rulers + } + + ai_frequency_by_tier = { + barony = 0 + county = 120 + duchy = 30 + kingdom = 30 + empire = 30 + hegemony = 30 + } + + ai_potential = { + # The basic requirements + is_imprisoned = no + is_playable_character = yes + is_available_ai_adult = yes + + # They must be well supplied + prestige > major_prestige_value + piety > major_piety_value + + # Only really greedy AI characters get to use this + ai_greed >= high_positive_ai_value + } + + ai_will_do = { + base = 30 + + # Unity modifiers + evaluate_action_decreasing_house_unity = { + VALUE = 100 + } + + # Make it more likely for AI characters to buy claims if they have a royal court + modifier = { + scope:actor = { + has_royal_court = yes + has_dlc_feature = court_artifacts + } + factor = 2 + } + + # Prevent AI from buying artifact claims for court artifacts if they don't have a royal court + modifier = { + scope:actor = { + has_royal_court = no + } + scope:target = { + OR = { + artifact_slot_type = throne + artifact_slot_type = wall_big + artifact_slot_type = wall_small + artifact_slot_type = sculpture + artifact_slot_type = book + artifact_slot_type = pedestal + } + } + factor = 0 + } + + # AI won't buy claims on artifacts owned by their lovers or friends + modifier = { + scope:recipient = { + OR = { + has_relation_friend = scope:actor + has_relation_lover = scope:actor + #is_close_or_extended_family_of = scope:actor + } + } + factor = 0 + } + } +} + +# Demand an artifact you have a claim on +demand_dynasty_banner_interaction = { + icon = icon_dynasty + category = interaction_category_diplomacy + common_interaction = yes + interface_priority = 60 + use_diplomatic_range = yes + desc = demand_dynasty_banner_interaction_desc + + target_type = artifact + target_filter = recipient_artifacts + + greeting = negative + notification_text = DEMAND_ARTIFACT_PROPOSAL + + answer_accept_key = DEMAND_ARTIFACT_ACCEPT + answer_reject_key = DEMAND_ARTIFACT_REJECT + + ai_targets = { + ai_recipients = scripted_relations + } + ai_targets = { + ai_recipients = liege + } + ai_targets = { + ai_recipients = neighboring_rulers + ai_recipients = peer_vassals + ai_recipients = nearby_domicile_owners + max = 10 + } + ai_targets = { + ai_recipients = vassals + max = 10 + } + ai_targets = { + ai_recipients = family + max = 10 + } + ai_target_quick_trigger = { + adult = yes + } + ai_frequency_by_tier = { + barony = 0 + county = 0 + duchy = 0 + kingdom = 36 + empire = 36 + hegemony = 36 + } + + is_shown = { + scope:recipient != scope:actor + NOT = { #Landless have no court in which to display such a banner, and no real authority over a landed relative + scope:actor = { government_has_flag = government_is_landless_adventurer } + } + exists = scope:actor.dynasty + exists = scope:recipient.dynasty + scope:recipient.dynasty = scope:actor.dynasty + scope:recipient = { + # needs to have a banner of our dynasty + any_character_artifact = { + AND = { + exists = var:banner_dynasty + var:banner_dynasty = scope:recipient.dynasty + var:banner_dynasty.dynast = scope:actor + NOT = { has_variable = is_tribute_mission_artifact } + } + } + } + } + + is_highlighted = { + always = yes + } + + is_valid_showing_failures_only = { + scope:actor = { + NOT = { + is_at_war_with = scope:recipient + } + is_imprisoned = no + } + trigger_if = { + limit = { exists = scope:target } + custom_description = { + text = "demand_dynasty_banner_artifact_tt" + exists = scope:target.var:banner_dynasty + scope:target.var:banner_dynasty = scope:recipient.dynasty + scope:actor = scope:target.var:banner_dynasty.dynast + } + } + } + + on_accept = { + scope:target = { + save_scope_as = demanded_artifact + } + if = { + limit = { + exists = scope:demanded_artifact + } + scope:actor = { + set_variable = { + name = demanded_this_artifact_interaction_recently + value = scope:demanded_artifact + years = 5 + } + } + } + scope:actor = { + send_interface_toast = { + type = event_toast_effect_good + title = demand_artifact_interaction_notification + left_icon = scope:recipient + right_icon = scope:target + scope:target = { + set_owner = scope:actor + } + } + } + if = { + limit = { + scope:actor = { + is_ai = yes + } + } + scope:actor = { + add_opinion = { + target = scope:recipient + modifier = pleased_opinion + opinion = 30 + } + } + } + + # 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_received_banner.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + on_decline = { + scope:target = { + save_scope_as = demanded_artifact + } + if = { + limit = { + exists = scope:demanded_artifact + } + scope:actor = { + set_variable = { + name = demanded_this_artifact_interaction_recently + value = scope:demanded_artifact + years = 5 + } + } + } + scope:actor = { + send_interface_toast = { + type = event_toast_effect_bad + title = demand_artifact_interaction_notification + left_icon = scope:recipient + right_icon = scope:target + custom_tooltip = demand_artifact_interaction_notification_refused + + scope:recipient = { + add_opinion = { + target = scope:actor + modifier = insult_opinion + opinion = -10 + } + } + } + } + if = { + limit = { + scope:actor = { + is_ai = yes + } + } + scope:actor = { + add_opinion = { + target = scope:recipient + modifier = refusal_opinion + opinion = -10 + } + } + } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_loss + DESC = clan_unity_refused_banner.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + auto_accept = { + custom_description = { + text = "spending_hook" + subject = scope:actor + object = scope:recipient + scope:hook = yes + scope:actor = { has_strong_hook = scope:recipient } + } + } + + send_option = { + is_shown = { + scope:actor != scope:recipient + } + is_valid = { + scope:actor = { + has_usable_hook = scope:recipient + } + } + flag = hook + 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_options_exclusive = no + + ai_accept = { + base = 100 + modifier = { + add = 70 + scope:actor.max_military_strength > scope:recipient.max_military_strength + desc = ARTIFACT_MILITARY_STRONGER_REASON + } + modifier = { + add = -70 + scope:actor.max_military_strength < scope:recipient.max_military_strength + desc = ARTIFACT_MILITARY_WEAKER_REASON + } + modifier = { + add = { + value = ai_boldness + multiply = -1 + divide = 2 + } + NOT = { ai_boldness = 0 } + desc = ARTIFACT_BOLDNESS_REASON + } + modifier = { + add = -50 + scope:actor = { + has_relation_rival = scope:recipient + } + desc = ARTIFACT_RIVAL_REASON + } + modifier = { + add = -80 + scope:actor = { + has_relation_nemesis = scope:recipient + } + desc = ARTIFACT_NEMESIS_REASON + } + modifier = { + add = 50 + scope:recipient = { + target_is_liege_or_above = scope:actor + } + desc = ARTIFACT_LIEGE_REASON + } + modifier = { + scope:hook = yes + add = 100 + desc = SCHEME_WEAK_HOOK_USED + } + # Unity modifiers + evaluate_action_increasing_house_unity = { + VALUE = 100 + } + } + + ai_potential = { + is_adult = yes + is_at_war = no + ai_greed >= low_negative_ai_value + has_outstanding_artifact_claims = yes + } + + + + ai_min_reply_days = 7 + ai_max_reply_days = 14 + + ai_will_do = { + base = 100 + + modifier = { # The AI will only use a Hook if they couldn't otherwise do this + scope:hook = yes + add = -1 + } + + modifier = { + add = 50 + has_relation_rival = scope:recipient + } + modifier = { + add = 80 + has_relation_nemesis = scope:recipient + } + modifier = { + add = 50 + target_is_liege_or_above = scope:recipient + } + modifier = { # An Intimidated character is very unlikely to raise their hand + add = -25 + scope:actor = { + has_dread_level_towards = { + target = scope:recipient + level = 1 + } + } + } + # Unity modifiers + evaluate_action_increasing_house_unity = { + VALUE = 100 + } + modifier = { # A Cowed character will never take this interaction + factor = 0 + scope:actor = { + has_dread_level_towards = { + target = scope:recipient + level = 2 + } + } + } + modifier = { + scope:recipient = { + OR = { + has_relation_friend = scope:actor + has_relation_lover = scope:actor + } + } + factor = 0 + } + } +} + +# Destroy Artifact +destroy_artifact_interaction = { + interface_priority = 30 + common_interaction = yes + icon = artifact + category = interaction_category_friendly + desc = destroy_artifact_interaction_desc + + target_type = artifact + target_filter = actor_artifacts + + ai_targets = { + ai_recipients = self + } + + # You can only destroy your own artifacts + is_shown = { + scope:recipient = scope:actor + scope:actor = { + has_any_artifact = yes + } + scope:actor = { + trigger_if = { + limit = { + exists = involved_activity + } + NOT = { + involved_activity ?= { #do not give out anything during coronation + has_activity_type = activity_coronation + activity_host = scope:actor + } + } + } + } + } + + can_be_picked_artifact = { + custom_tooltip = { + text = artifact_is_related_to_contract_tt + scope:target = { + NOR = { + has_variable = 1025_treasure_map + has_variable = is_tribute_mission_artifact + } + } + } + custom_tooltip = { + text = artifact_is_related_to_great_project_construction_tt + scope:target = { + NOT = { has_variable = mandala_capital_05_unconfirmed_talisman } + } + } + } + + has_valid_target_showing_failures_only = { + trigger_if = { + limit = { + NOT = { + scope:recipient.faith = { has_doctrine_parameter = destroying_artifacts_is_pious } + } + } + custom_tooltip = { + text = artifact_is_rarer_than_masterwork_tt + OR = { + scope:target = { rarity = common } + scope:target = { rarity = masterwork } + } + } + } + trigger_if = { + limit = { + NOR = { + scope:target = { rarity = common } + scope:target = { rarity = masterwork } + } + } + custom_tooltip = { + text = destroying_artifacts_is_not_pious_tt + scope:recipient.faith = { has_doctrine_parameter = destroying_artifacts_is_pious } + } + } + scope:actor = { + trigger_if = { + limit = { has_government = landless_adventurer_government } + employs_court_position = armorer_camp_officer + } + } + } + + on_accept = { + destroy_artifact_aniconist_effect = { + ARTIFACT = scope:target + DESTROYER = scope:actor + GIVE_GOLD = yes + PIETY_BY_DEFAULT = no + } + } + + ai_frequency_by_tier = { + barony = 0 + county = 48 + duchy = 24 + kingdom = 24 + empire = 24 + hegemony = 24 + } + + ai_potential = { + OR = { + faith = { # Aniconists will always want to destroy artifacts + has_doctrine_parameter = destroying_artifacts_is_pious + } + gold <= minor_gold_value # Poor rulers will consider getting rid of their trash for gold + AND = { # Economic boom personalities will bolster their treasury by getting rid of trash more often + gold <= medium_gold_value + ai_has_builder_or_pious_builder_personality = yes + } + any_character_artifact = { # All rulers want to get rid of actively detrimental trash + has_variable = unwanted_artifact + } + } + } + + ai_will_do = { + base = 0 + modifier = { # Rulers will always destroy unwanted artifacts + add = 100 + scope:target = { + has_variable = unwanted_artifact + } + } + modifier = { # Rulers will consider destroying trash artifacts if they're poor + add = 100 + scope:target = { + has_variable = ai_to_ai_destroy_in_sieges + } + } + modifier = { # AI rulers will destroy common unequipped artifacts if money is low + add = 100 + OR = { + gold <= minor_gold_value # Poor rulers will consider getting rid of their trash for gold + AND = { # Economic boom personalities will bolster their treasury by getting rid of trash more often + gold <= medium_gold_value + ai_has_builder_or_pious_builder_personality = yes + } + } + scope:target = { + rarity = common + is_equipped = no + } + } + modifier = { # AI rulers will destroy all unequipped artifacts to get out of debt + add = 100 + gold <= 0 + scope:target = { + is_equipped = no + } + } + modifier = { # Common artifact trinkets on their last legs can be considered for destruction if money is low + add = 100 + OR = { + gold <= minor_gold_value # Poor rulers will consider getting rid of their trash for gold + AND = { # Economic boom personalities will bolster their treasury by getting rid of trash more often + gold <= medium_gold_value + ai_has_builder_or_pious_builder_personality = yes + } + } + scope:target = { + rarity = common + artifact_slot_type = miscellaneous + OR = { + AND = { + artifact_max_durability >= define:NInventory|ARTIFACT_DEFAULT_MAX_DURABILITY + artifact_durability <= define:NInventory|ARTIFACT_LOW_DURABILITY + } + AND = { + artifact_max_durability < define:NInventory|ARTIFACT_DEFAULT_MAX_DURABILITY + artifact_durability_percent <= { + value = define:NInventory|ARTIFACT_LOW_DURABILITY + divide = 100 + } + } + } + } + } + modifier = { # Aniconists destroy most things + add = 100 + faith = { + has_doctrine_parameter = destroying_artifacts_is_pious + } + OR = { # This errors in the ai_potential so it's been moved here + has_trait = zealous + scope:target = { is_equipped = no } + scope:target = { exists = var:relic } + } + # The logic below relies on the idea that they have the destroying_artifacts_is_pious doctrine parameter. If the restrictions are loosened, these triggers should be updated + NOR = { + has_trait = cynical + AND = { + has_trait = greedy + NOT = { has_trait = zealous } + } + } + OR = { + has_trait = zealous # Destroy all the artifacts + any_character_artifact = { + is_equipped = no + } + any_character_artifact = { + exists = var:relic + } + } + } + modifier = { #Piety _and_ gold? Sign me up! + add = 50 + ai_has_pious_builder_personality = yes + faith = { + has_doctrine_parameter = destroying_artifacts_is_pious + } + } + modifier = { # Icon venerating faiths will never destroy artifacts + factor = 0 + faith = { + has_doctrine_paramter = destroying_artifacts_costs_piety + } + } + } +} diff --git a/common/religion/doctrine_group_types/00_doctrine_group_types.txt b/common/religion/doctrine_group_types/00_doctrine_group_types.txt index 01a89a602..7d650626e 100644 --- a/common/religion/doctrine_group_types/00_doctrine_group_types.txt +++ b/common/religion/doctrine_group_types/00_doctrine_group_types.txt @@ -568,16 +568,8 @@ doctrine_core_tenets = { tenet_divine_progress tenet_five_points tenet_theomonarchy - tenet_militant_vows - - - - - - - - - + tenet_militant_vows + tenet_iconodulism } } diff --git a/common/religion/doctrine_types/30_core_tenets.txt b/common/religion/doctrine_types/30_core_tenets.txt index 403639728..cf32e70a1 100644 --- a/common/religion/doctrine_types/30_core_tenets.txt +++ b/common/religion/doctrine_types/30_core_tenets.txt @@ -87,6 +87,59 @@ # } # } # } + + tenet_iconodulism = { + icon = core_tenet_iconodulism + piety_cost = { + if = { + limit = { + OR = { + religion_tag = eastern_orthodox_religion + religion_tag = catholic_religion + } + } + value = faith_tenet_cost_low + } + else_if = { + OR = { + religion_tag = protestant_religion + religion_tag = judaism_religion + religion_tag = islam_religion + } + value = faith_tenet_cost_high + } + else = { + value = faith_tenet_cost_mid + } + + # Multiplier for keeping same tenet + if = { + limit = { has_doctrine = tenet_iconodulism } + multiply = faith_unchanged_doctrine_cost_mult + } + } + + can_pick = { + custom_description = { + text = incompatible_tenet_aniconism_trigger + NOT = { doctrine:tenet_aniconism = { is_in_list = selected_doctrines } } + } + } + + character_modifier = { + church_holding_build_speed = 0.2 + church_holding_build_gold_cost = 0.2 + church_holding_holding_build_speed = 0.2 + church_holding_holding_build_gold_cost = 0.2 + } + + parameters = { + destroying_artifacts_costs_piety = yes +# reforging_artifacts_is_pious = yes ## need to figure out the code for this + neow_piety_from_temple_construction = yes + building_temples_gives_development = yes # remove when i figure out number 2 + } + } @@ -1501,6 +1554,10 @@ text = incompatible_doctrine_mummification_trigger NOT = { doctrine:doctrine_funeral_mummification = { is_in_list = selected_doctrines } } } + custom_description = { + text = incompatible_tenet_iconodulism_trigger + NOT = { doctrine:tenet_iconodulism = { is_in_list = selected_doctrines } } + } } character_modifier = { diff --git a/common/religion/religion_types/NEOW_orthodox.txt b/common/religion/religion_types/NEOW_orthodox.txt index 6adbe3792..08f101150 100644 --- a/common/religion/religion_types/NEOW_orthodox.txt +++ b/common/religion/religion_types/NEOW_orthodox.txt @@ -258,9 +258,9 @@ doctrine = special_doctrine_independent_catholic #Tenets - doctrine = tenet_catholic_communion + doctrine = tenet_catholic_communion doctrine = tenet_bhakti - doctrine = tenet_monasticism + doctrine = tenet_iconodulism holy_order_names = { { name = "holy_order_brotherhood_of_the_holy_sepulchre" } diff --git a/common/scripted_effects/00_ep1_artifact_effects.txt b/common/scripted_effects/00_ep1_artifact_effects.txt new file mode 100644 index 000000000..5e4aae0de --- /dev/null +++ b/common/scripted_effects/00_ep1_artifact_effects.txt @@ -0,0 +1,672 @@ +steal_artifact_in_siege_effect = { + if = { + limit = { NOT = { has_variable = artifact_prevent_transfer } } + # Save scopes for localization + $LOCATION$ = { save_scope_as = SAISE_location } + $ATTACKER$ = { save_scope_as = SAISE_attacker } + $DEFENDER$ = { save_scope_as = SAISE_defender } + $ARTIFACT$ = { save_scope_as = this_artifact } + + scope:this_artifact = { + # Suppress generic notifications, as we will send custom ones + set_variable = { + name = suppress_artifact_notifications + value = yes + days = 1 + } + if = { + limit = { + NOT = { has_variable = stolen_artifact } + } + set_variable = { + name = stolen_artifact + value = 1 + } + } + else = { + change_variable = { + name = stolen_artifact + add = 1 + } + } + + # Transfer the artifact to its new owner + if = { + limit = { + has_variable = ai_to_ai_destroy_in_sieges + scope:SAISE_attacker = { + is_ai = yes + } + scope:SAISE_defender = { + is_ai = yes + } + } + destroy_artifact = this + } + else = { + set_owner = { + target = scope:SAISE_attacker + history = { + location = scope:SAISE_location + actor = scope:SAISE_defender + recipient = scope:SAISE_attacker + type = taken_in_siege + } + } + scope:SAISE_defender = { add_personal_artifact_claim = scope:this_artifact } + if = { + limit = { + scope:SAISE_attacker = { + has_ep3_dlc_trigger = yes + is_roman_emperor_trigger = yes + culture = { has_cultural_parameter = holds_triumphs } + } + } + scope:SAISE_attacker = { + set_variable = { + name = byz_valid_for_trophy + value = scope:this_artifact + years = 9 + } + } + } + + # Send notifications to the relevant parties + scope:SAISE_defender = { + send_interface_toast = { + type = msg_artifact_lost + title = artifact_lost_toast + left_icon = scope:this_artifact + right_icon = scope:SAISE_attacker + if = { + limit = { $IS_RAID$ = yes } + custom_tooltip = artifact_lost_in_raid + } + else = { + custom_tooltip = artifact_lost_in_siege + } + } + } + scope:SAISE_attacker = { + send_interface_toast = { + type = msg_artifact_gained + right_icon = scope:this_artifact + } + if = { + limit = { + NOT = { any_claimed_artifact = { this = scope:this_artifact } } + } + scope:this_artifact = { + set_variable = { + name = last_person_to_steal + value = scope:SAISE_attacker + } + } + } + } + } + } + } +} + +steal_artifact_in_event_effect = { + if = { + limit = { exists = $VICTIM$.capital_province } + set_local_variable = { + name = location + value = $VICTIM$.capital_province + } + } + else_if = { + limit = { exists = $VICTIM$.location } + set_local_variable = { + name = location + value = $VICTIM$.location + } + } + + $ARTIFACT$ = { + save_scope_as = artifact_to_steal + hidden_effect = { + if = { + limit = { + exists = local_var:location + } + set_owner = { + target = $THIEF$ + history = { + type = stolen + actor = $VICTIM$ #stolen from + recipient = $THIEF$ #stealer + location = local_var:location + } + } + } + else = { #If no location exists it is "conquered" + set_owner = { + target = $THIEF$ + history = { + type = conquest + actor = $THIEF$ #stealer + recipient = $VICTIM$ #stolen from + } + } + } + if = { + limit = { + NOT = { has_variable = stolen_artifact } + } + set_variable = { + name = stolen_artifact + value = 1 + } + } + else = { + change_variable = { + name = stolen_artifact + add = 1 + } + } + } + } + $VICTIM$ = { + add_personal_artifact_claim = scope:artifact_to_steal + } +} + +damage_artifact_in_battle_effect = { + # Save scopes for localization + $OWNER$ = { + save_scope_as = DAIBE_owner + } + $OPPONENT$ = { save_scope_as = DAIBE_opponent } + $LOCATION$ = { save_scope_as = DAIBE_location } + $ARTIFACT$ = { + save_scope_as = DAIBE_artifact + + # Suppress generic notifications, as we will send custom ones + set_variable = { + name = suppress_artifact_notifications + value = yes + days = 1 + } + + set_variable = { + name = DAIBE_damage + value = $DURABILITY_LOSS$ + days = 1 + } + + # Damage the artifact by the specified amount + add_durability = { + value = 0 + subtract = var:DAIBE_damage + } + } + + # Transformed into an if / else as I found the following note somewhere else: + # NOTE: We must not run ANY script after we destroy an artifact, or we will cause errors + if = { + # If the artifact has no durability left, destroy it now. + limit = { scope:DAIBE_artifact.artifact_durability <= 0 } + destroy_artifact = scope:DAIBE_artifact + } + # Send notifications to the relevant party IF the artifact was not destroyed + else = { + $OWNER$ = { + # Send the toast + send_interface_toast = { + title = artifact_damaged_toast + left_icon = scope:DAIBE_artifact + right_icon = scope:DAIBE_opponent + if = { + limit = { + $IS_DUEL$ = yes + } + custom_tooltip = artifact_damaged_in_duel + } + else = { + custom_tooltip = artifact_damaged_in_siege + } + } + } + } +} + +flag_as_trash_artifact = { + set_variable = { + name = ai_to_ai_destroy_in_sieges + value = yes + } +} + +flag_as_unwanted_artifact = { + set_variable = { + name = unwanted_artifact + value = yes + } +} + +flag_as_cursed_artifact = { + set_variable = { + name = cursed_artifact + value = yes + } +} + +#For use with trinket looks / call this effect (set_up_trinket_adjective_effect = yes) in the line before creating the trinket +#Use this in the trinket's name/description in the loc-file [ROOT.Char.Custom('TrinketLookAdjective')] /and/ [ROOT.Char.Custom('TrinketLookAdverbFollowup')] +#Remember to clear the var:trinket_adjective_followup in your after = { ... } +set_up_trinket_adjective_effect = { + random_list = { + 50 = { + set_variable = { + name = trinket_adjective_followup + value = flag:adorned + } + } + 50 = { + set_variable = { + name = trinket_adjective_followup + value = flag:decorated + } + } + 50 = { + set_variable = { + name = trinket_adjective_followup + value = flag:embellished + } + } + 50 = { + set_variable = { + name = trinket_adjective_followup + value = flag:ornamented + } + } + + } +} + +# Grant claims on familial banners +grant_banner_house_claim_effect = { + save_scope_as = familial_banner + hidden_effect = { + if = { # Dynasty banner not owned or claimed by all child house's already + limit = { + exists = var:banner_dynasty + var:banner_dynasty = { + any_dynasty_member = { + this = house.house_head + house = { artifact_house_not_owns_or_claims_trigger = yes } # House not owns or claims already + } + } + } + var:banner_dynasty = { + every_dynasty_member = { + limit = { + this = house.house_head + house = { artifact_house_not_owns_or_claims_trigger = yes } # House not owns or claims already + } + house = { add_house_artifact_claim = scope:familial_banner } + } + } + } + else_if = { # House banner not owned or claimed by creating house already + limit = { + exists = var:banner_house + var:banner_house = { artifact_house_not_owns_or_claims_trigger = yes } # House not owns or claims already + } + var:banner_house = { add_house_artifact_claim = scope:familial_banner } + } + } +} + +#Determine what type of artifact a court artifact is, for defacement +determine_artifact_damage_type_effect = { + $ARTIFACT$ = { save_scope_as = artifact_to_determine } + scope:artifact_to_determine = { + random_list = { + 10 = { + trigger = { + OR = { + artifact_type = chest + artifact_type = box + artifact_type = cabinet + artifact_type = pedestal + artifact_type = tapestry + artifact_type = animal_hide + artifact_type = animal_hide_big + artifact_type = wall_big + artifact_type = wall_shield + artifact_type = throne + artifact_type = throne_special + artifact_type = book + } + } + set_variable = artifact_burned + } + 10 = { + trigger = { + OR = { + artifact_type = sculpture + artifact_type = box + artifact_type = goblet + artifact_type = pedestal + artifact_type = book + artifact_type = elixir + artifact_type = panacea + artifact_type = philosophers_stone + } + } + set_variable = artifact_knocked_over + } + 10 = { + trigger = { + OR = { + artifact_type = sculpture + artifact_type = chest + artifact_type = box + artifact_type = cabinet + artifact_type = goblet + artifact_type = pedestal + artifact_type = tapestry #cloth + artifact_type = animal_skull + artifact_type = animal_hide + artifact_type = animal_hide_big + artifact_type = wall_big #shields, banners + artifact_type = wall_small #animal trophy + artifact_type = wall_shield + artifact_type = wall_shield_special #kite shields + artifact_type = throne + artifact_type = throne_special + artifact_type = book + artifact_type = elixir + artifact_type = panacea + artifact_type = philosophers_stone #box + } + } + set_variable = artifact_smeared_food + } + 10 = { + trigger = { + OR = { + artifact_type = chest + artifact_type = box + artifact_type = cabinet + artifact_type = pedestal + artifact_type = tapestry + artifact_type = animal_hide + artifact_type = animal_hide_big + artifact_type = wall_big + artifact_type = wall_small + artifact_type = throne + artifact_type = throne_special + artifact_type = book + } + } + set_variable = artifact_spilled_drink + } + 10 = { + trigger = { + OR = { + artifact_type = tapestry + artifact_type = animal_hide + artifact_type = animal_hide_big + artifact_type = book + } + } + set_variable = artifact_tear + } + 10 = { + trigger = { + OR = { + artifact_type = tapestry + artifact_type = animal_skull + artifact_type = animal_hide + artifact_type = animal_hide_big + artifact_type = wall_big + artifact_type = wall_small + artifact_type = wall_shield + artifact_type = wall_shield_special + } + } + set_variable = artifact_tear_down + } + 10 = { + trigger = { + OR = { + artifact_type = chest + artifact_type = box + artifact_type = pedestal + artifact_type = tapestry + artifact_type = animal_hide + artifact_type = animal_hide_big + artifact_type = wall_big + artifact_type = wall_small + artifact_type = wall_shield + artifact_type = wall_shield_special + artifact_type = throne + artifact_type = throne_special + artifact_type = book + } + } + set_variable = artifact_threw_up + } + 10 = { + trigger = { + OR = { + artifact_type = sculpture + artifact_type = chest + artifact_type = box + artifact_type = cabinet + artifact_type = goblet + artifact_type = pedestal + artifact_type = tapestry #cloth + artifact_type = animal_skull + artifact_type = animal_hide + artifact_type = animal_hide_big + artifact_type = wall_big #shields, banners + artifact_type = wall_small #animal trophy + artifact_type = wall_shield + artifact_type = wall_shield_special #kite shields + artifact_type = throne + artifact_type = throne_special + artifact_type = book + artifact_type = elixir + artifact_type = panacea + artifact_type = philosophers_stone #box + } + } + set_variable = artifact_unspeakable + } + 10 = { + trigger = { + NOR = { + artifact_type = sculpture + artifact_type = chest + artifact_type = box + artifact_type = cabinet + artifact_type = goblet + artifact_type = pedestal + artifact_type = tapestry #cloth + artifact_type = animal_skull + artifact_type = animal_hide + artifact_type = animal_hide_big + artifact_type = wall_big #shields, banners + artifact_type = wall_small #animal trophy + artifact_type = wall_shield + artifact_type = wall_shield_special #kite shields + artifact_type = throne + artifact_type = throne_special + artifact_type = book + artifact_type = elixir + artifact_type = panacea + artifact_type = philosophers_stone #box + } + } + set_variable = artifact_damage_fallback + } + } + } +} + +# Destroy Artifact effect +# DESTROYER = Character destroying the artifact +# ARTIFACT = The artifact to destroy +destroy_artifact_aniconist_effect = { + $ARTIFACT$ = { + save_temporary_scope_as = artifact + } + + $DESTROYER$ = { + if = { + limit = { + OR = { + $DESTROYER$.faith = { has_doctrine_parameter = destroying_artifacts_is_pious } + $PIETY_BY_DEFAULT$ = yes + } + } + give_destroyed_artifact_piety = yes + } + if = { + limit = { + OR = { + $DESTROYER$.faith = { has_doctrine_parameter = destroying_artifacts_costs_piety } + $PIETY_BY_DEFAULT$ = yes + } + } + add_piety = medium_piety_loss + } + if = { + limit = { + $GIVE_GOLD$ = yes + } + add_gold = { + if = { + limit = { + scope:artifact = { rarity = illustrious } + } + add = { + value = 25 + } + } + else_if = { + limit = { + scope:artifact = { rarity = famed } + } + add = { + value = 15 + } + } + else_if = { + limit = { + scope:artifact = { rarity = masterwork } + } + add = { + value = 8 + } + } + else = { + add = { + value = 4 + } + } + + # Boost the value up to something meaningful + multiply = { + value = 10 + } + + # multiply by durability percentage + multiply = { + add = scope:artifact.artifact_durability + divide = scope:artifact.artifact_max_durability + divide = 2 + add = 0.5 + } + + #Nerf it to bits for LAAMPs + if = { + limit = { + $DESTROYER$ = { has_government = landless_adventurer_government } + } + multiply = { + value = 0.1 + round = yes + } + } + if = { + limit = { + exists = scope:artifact.var:ai_to_ai_destroy_in_sieges # Trash artifact + } + max = { + value = $DESTROYER$.tiny_gold_value + multiply = 0.5 + } + } + + min = 1 + } + } + destroy_owned_artifact = scope:artifact + } +} + +give_destroyed_artifact_piety = { + add_piety = { + # Base value + value = 5 + # Add the artifact's quality + if = { + limit = { exists = scope:artifact.var:quality } + add = scope:artifact.var:quality + } + # If none can be found, add its wealth + else_if = { + limit = { exists = scope:artifact.var:wealth } + add = scope:artifact.var:wealth + } + # Artifact has no quality or wealth (typical for court artifacts), add something based on rarity + else_if = { + limit = { + scope:artifact = { rarity = illustrious } + } + add = { + value = 20 + } + } + else_if = { + limit = { + scope:artifact = { rarity = famed } + } + add = { + value = 12 + } + } + else_if = { + limit = { + scope:artifact = { rarity = masterwork } + } + add = { + value = 8 + } + } + else = { + add = { + value = 4 + } + } + # Boost the value up to something meaningful + multiply = 20 + # Relics are way cooler to burn, double the final value + if = { + limit = { + scope:artifact = { exists = var:relic } + } + multiply = { + value = 2 + desc = aniconist_destroying_relic + } + } + } +} diff --git a/gfx/interface/icons/faith_doctrines/core_tenet_iconodulism.dds b/gfx/interface/icons/faith_doctrines/core_tenet_iconodulism.dds new file mode 100644 index 000000000..293fd87c4 --- /dev/null +++ b/gfx/interface/icons/faith_doctrines/core_tenet_iconodulism.dds @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce40b167594634e99e5e1a79a8486576ba9c4305d8969f52444512fa57813a4a +size 416128 diff --git a/gfx/interface/icons/faith_doctrines/core_tenet_pilgrimage_mandatory.tga b/gfx/interface/icons/faith_doctrines/core_tenet_pilgrimage_mandatory.tga new file mode 100644 index 000000000..54463a252 --- /dev/null +++ b/gfx/interface/icons/faith_doctrines/core_tenet_pilgrimage_mandatory.tga @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c25fbed1d18d2a44061a83a347fc76615119e53e66d3ad560619684a6c207c5d +size 196587 diff --git a/localization/english/replace/religion/doctrines/zz_NEOW_religion_core_tenets_l_english.yml b/localization/english/replace/religion/doctrines/zz_NEOW_religion_core_tenets_l_english.yml index 09a2872e1..87a83422b 100644 --- a/localization/english/replace/religion/doctrines/zz_NEOW_religion_core_tenets_l_english.yml +++ b/localization/english/replace/religion/doctrines/zz_NEOW_religion_core_tenets_l_english.yml @@ -152,6 +152,15 @@ tenet_chivalric_ideals_desc:0 "It is the duty of each one of us to strive to be the best version of ourselves. We must choose to be knights, lovers, and protectors of the weak." doctrine_parameter_neow_better_spouses:0 "[skills|E] from [spouse|E] [councillor_tasks|E]: #P +25%#!" + + tenet_iconodulism_name:0 "Sacred Icons" + tenet_iconodulism_desc:0 "Icons depicting religious figures should be treated with honour and veneration. Those who destroy them will surely be viewed with contempt in the eyes of the Lord." + + doctrine_parameter_neow_piety_from_temple_construction:0 "[piety|E] from constructing [temple|E] [holdings|E]: [piety_i]#P +750#!" + doctrine_parameter_destroying_artifacts_costs_piety:0 "[rulers|E] of this [faith|E] must spend [piety|E] to destroy [artifacts|E]" + doctrine_parameter_reforging_artifacts_is_pious:0 "[rulers|E] of this [faith|E] can [reforge|E] or [repair|E] [artifacts|E] to earn [piety|E]" + INCOMPATIBLE_TENET_ANICONISM_TRIGGER:1 "Incompatible with the [core_tenet|E] [GetFaithDoctrine('tenet_aniconism').GetName( GetPlayer.GetFaith )]" + INCOMPATIBLE_TENET_ICONODULISM_TRIGGER:1 "Incompatible with the [core_tenet|E] [GetFaithDoctrine('tenet_iconodulism').GetName( GetPlayer.GetFaith )]" tenet_sanctity_of_nature_romanticist_name:0 "Scions of Atlantis" tenet_sanctity_of_nature_romanticist_desc:0 "We must reforge mankind into the ideal vision of Atlantis - an idyllic, equal society in harmony with nature. History has proven that war and greed are not sustainable ways of life."