more error cleaning

This commit is contained in:
Thakia 2026-10-09 16:36:59 -03:00
parent d9c60a5b08
commit 707660e545
65 changed files with 24545 additions and 2406 deletions

View file

@ -0,0 +1,366 @@

###TRIGGER LIST
#opposing_ai_values_trigger - Checks if one character has a positive value and another character has a negative value for the same ai value.
#Needs TARGET and the name of the VALUE
opposing_ai_values_trigger = {
OR = {
AND = {
ai_$VALUE$ < 0
$TARGET$ = { ai_$VALUE$ > 0 }
}
AND = {
ai_$VALUE$ > 0
$TARGET$ = { ai_$VALUE$ < 0 }
}
}
}
ai_has_builder_or_pious_builder_personality = {
ai_has_pious_builder_personality = yes
ai_has_economical_boom_personality = yes
}
ai_has_pious_builder_personality = {
OR = {
AND = {
pious_ai_builder_trigger = yes
ai_has_warlike_personality = no
}
#Or our Devaraja decrees it
AND = {
OR = {
is_tributary = yes
is_independent_ruler = no
}
overlord ?= { has_realm_law_flag = subjects_appear_more_pious }
}
#Weight the AI according to their Aspect
house ?= { has_house_aspiration_parameter = aspect_of_serenity }
}
NOR = {
has_variable = conqueror
#Weight the AI according to their Aspect
house ?= {
OR = {
has_house_aspiration_parameter = aspect_of_creation
has_house_aspiration_parameter = aspect_of_destruction
has_house_aspiration_parameter = aspect_of_trickery
}
}
}
}
ai_has_warlike_personality = {
OR = {
vassal_contract_has_flag = admin_ai_is_warlike # Admin vassals with the "Frontier" administration consider it their job to expand
house ?= { # The unity decision "Organize House Members for War" forces AI house members to adopt this stance
has_house_modifier = unity_house_organized_for_war_modifier
}
AND = { # They are Detractors during the FP3 Struggle in the Unrest Phase
any_character_struggle = {
trigger_if = {
limit = { is_struggle_type = persian_struggle }
is_struggle_phase = struggle_persia_phase_unrest
}
trigger_else = { always = no }
}
has_trait = fp3_struggle_detractor
}
AND = { # Nomads are not 'unpredictable', they are Warlike instead
government_has_flag = government_is_nomadic
ai_has_cautious_personality = no
economical_ai_guts_trigger = no
}
AND = {
ai_boldness > 0
ai_greed >= 0
OR = {
has_trait = wrathful
has_trait = impatient
has_trait = sadistic
has_trait = ambitious
has_trait = vengeful
has_trait = zealous
has_trait = irritable
AND = {
ai_boldness >= 50
ai_greed >= 50
}
AND = {
ai_boldness >= 25
ai_greed >= 100
}
AND = {
ai_boldness >= 100
ai_greed >= 25
}
government_has_flag = government_is_tribal
culture ?= { has_cultural_pillar = ethos_bellicose }
}
NOR = {
ai_compassion >= 75
has_trait = compassionate
has_trait = craven
has_trait = calm
faith ?= { has_doctrine_parameter = pacifist }
culture ?= { has_cultural_parameter = reduced_cost_for_conversion_to_pacifist_faith }
house ?= {
has_house_modifier = unity_house_focused_on_economy_modifier
}
vassal_contract_has_flag = admin_ai_is_builder
}
}
# Or we're on the warpath.
has_variable = imperial_expedition_charged
#Or our Devaraja decrees it
AND = {
OR = {
is_tributary = yes
is_independent_ruler = no
}
overlord ?= { has_realm_law_flag = subjects_appear_more_warlike }
}
#Weight the AI according to their Aspect
house ?= { has_house_aspiration_parameter = aspect_of_destruction }
}
NOR = {
has_variable = conqueror
#Weight the AI according to their Aspect
house ?= {
OR = {
has_house_aspiration_parameter = aspect_of_creation
has_house_aspiration_parameter = aspect_of_serenity
has_house_aspiration_parameter = aspect_of_trickery
}
}
}
}
ai_has_cautious_personality = {
ai_boldness <= 0
OR = {
has_trait = paranoid
has_trait = craven
AND = {
ai_boldness <= -25
OR = {
has_trait = patient
has_trait = calm
has_trait = content
culture = { has_cultural_pillar = ethos_stoic }
culture = { has_cultural_tradition = tradition_stalwart_defenders }
}
}
}
NOR = {
has_trait = fickle
has_trait = lunatic
house ?= {
OR = {
has_house_modifier = unity_house_organized_for_war_modifier
has_house_modifier = unity_house_focused_on_economy_modifier
#Weight the AI according to their Aspect
has_house_aspiration_parameter = aspect_of_creation
has_house_aspiration_parameter = aspect_of_serenity
has_house_aspiration_parameter = aspect_of_trickery
}
}
AND = { # They are Detractors during the FP3 Struggle in the Unrest Phase
any_character_struggle = {
trigger_if = {
limit = { is_struggle_type = persian_struggle }
is_struggle_phase = struggle_persia_phase_unrest
}
trigger_else = { always = no }
}
has_trait = fp3_struggle_detractor
}
vassal_contract_has_flag = admin_ai_is_warlike
vassal_contract_has_flag = admin_ai_is_builder
has_variable = conqueror
}
}
ai_has_economical_boom_personality = {
OR = {
# Admin vassals with the "Civilian" administration consider it their job to improve the economy
vassal_contract_has_flag = admin_ai_is_builder
# The unity decision "Encourage House to Improve the Economy" forces AI house members to adopt this stance
house ?= {
has_house_modifier = unity_house_focused_on_economy_modifier
}
AND = {
economical_ai_guts_trigger = yes
ai_has_warlike_personality = no
}
#Or our Devaraja decrees it
AND = {
OR = {
is_tributary = yes
is_independent_ruler = no
}
overlord ?= { has_realm_law_flag = subjects_appear_more_economical }
}
#Weight the AI according to their Aspect
house ?= { has_house_aspiration_parameter = aspect_of_creation }
}
NOR = {
has_variable = conqueror
#Weight the AI according to their Aspect
house ?= {
OR = {
has_house_aspiration_parameter = aspect_of_destruction
has_house_aspiration_parameter = aspect_of_serenity
has_house_aspiration_parameter = aspect_of_trickery
}
}
}
}
pious_ai_builder_trigger = {
ai_zeal > 0
ai_energy > 0
OR = {
has_focus = learning_theology_focus # Only this focus, which is 33% of all learning focused characters in the world
has_trait = zealous
has_trait = forgiving
has_trait = improvident
has_trait = humble
has_trait = patient
has_trait = diligent
has_trait = generous
has_character_modifier = the_temple_builder_modifier
government_has_flag = government_is_mandala
}
num_virtuous_traits >= 1
num_sinful_traits = 0
NAND = {
has_trait = cynical
has_trait = greedy
house = {
has_house_modifier = unity_house_organized_for_war_modifier
}
}
}
economical_ai_guts_trigger = {
ai_boldness > 0
OR = {
has_focus = stewardship_domain_focus # Only this focus, which is 33% of all stewardship focused characters in the world
has_trait = calm
has_trait = patient
has_trait = diligent
has_trait = generous
has_trait = stubborn
has_trait = profligate
has_character_modifier = the_city_builder_modifier
has_character_modifier = the_castle_builder_modifier
}
NAND = {
has_trait = greedy
has_trait = impatient
house ?= {
has_house_modifier = unity_house_organized_for_war_modifier
}
}
}
ai_wants_low_unity = {
government_has_flag = government_is_clan
# To actively decrease Unity, the AI needs the following personality
OR = {
AND = {
OR = {
has_trait_malicious_trigger = yes
has_trait_dominant_trigger = yes
}
has_trait_submissive_trigger = no
has_trait_benevolent_trigger = no
}
ai_has_warlike_personality = yes
has_variable = conqueror
has_character_flag = agenda_towards_escalation
}
}
ai_wants_high_unity = {
government_has_flag = government_is_clan
# We'll make sure that the AI only wants to actively increase Unity if they have a matching personality
OR = {
AND = {
OR = {
has_trait_benevolent_trigger = yes
has_trait_submissive_trigger = yes
}
has_trait_malicious_trigger = no
}
ai_has_economical_boom_personality = yes
AND = {
NOT = { has_trait = fp3_struggle_detractor }
# House is the most recent Caliphs house
exists = struggle:persian_struggle
trigger_if = {
limit = { exists = title:d_sunni.holder }
house = title:d_sunni.holder.house
}
trigger_else = { house = title:d_sunni.previous_holder.house }
}
has_character_flag = agenda_towards_deescalation
}
# And to make sure the AI doesn't want to increase and decrease Unity at the same time
ai_wants_low_unity = no
}
ai_has_conqueror_personality = {
OR = {
has_trait = conqueror
has_trait = greatest_of_khans
has_character_modifier = the_great_khan_modifier
any_owned_story = {
type = story_conqueror
}
}
}
ai_should_get_conqueror_bonuses = {
has_variable = conqueror
NOT = { has_game_rule = no_conquerors_bonuses }
}
ai_should_get_extreme_conqueror_bonuses = {
has_variable = conqueror
has_character_modifier = ai_extreme_conqueror_modifier
}
ai_should_focus_on_building_in_their_capital = {
is_landed = yes
highest_held_title_tier >= tier_county
NOT = { has_variable = conqueror }
NOT = { government_has_flag = government_is_nomadic }
exists = capital_county
exists = culture
OR = {
capital_county.title_province.free_building_slots > 0
AND = {
culture = { has_innovation = innovation_ledger }
capital_county.title_province.combined_building_level <= 4
}
AND = {
culture = { has_innovation = innovation_baliffs }
capital_county.title_province.combined_building_level <= 6
}
AND = {
culture = { has_innovation = innovation_guilds }
capital_county.title_province.combined_building_level <= 9
}
AND = {
culture = { has_innovation = innovation_cranes }
capital_county.title_province.combined_building_level <= 12
}
}
}

View file

@ -237,8 +237,12 @@ building_orchards_requirement_terrain = {
terrain = floodplains
terrain = oasis
has_building_or_higher = qanats_05
culture = {
has_cultural_parameter = vegetarian_fruit_orchard_allowed
AND = {
exists = culture
trigger_if = {
limit = { exists = culture }
culture ?= { has_cultural_parameter = vegetarian_fruit_orchard_allowed }
}
}
}
}
@ -251,7 +255,13 @@ building_farm_estates_requirement_terrain = {
terrain = hills
terrain = jungle
}
county.culture = { has_cultural_parameter = rice_cultivators_can_construct_paddy_fields_in_hills_and_jungle }
AND = {
exists = county.culture
trigger_if = {
limit = { exists = county.culture }
county.culture ?= { has_cultural_parameter = rice_cultivators_can_construct_paddy_fields_in_hills_and_jungle }
}
}
}
}
}
@ -325,14 +335,26 @@ building_paddy_fields_requirement_terrain = {
}
AND = {
terrain = wetlands
county.culture = { has_cultural_parameter = champa_rice_wet_land_paddies }
AND = {
exists = county.culture
trigger_if = {
limit = { exists = county.culture }
county.culture ?= { has_cultural_parameter = champa_rice_wet_land_paddies }
}
}
}
AND = {
OR = {
terrain = hills
terrain = jungle
}
county.culture = { has_cultural_parameter = rice_cultivators_can_construct_paddy_fields_in_hills_and_jungle }
AND = {
exists = county.culture
trigger_if = {
limit = { exists = county.culture }
county.culture ?= { has_cultural_parameter = rice_cultivators_can_construct_paddy_fields_in_hills_and_jungle }
}
}
}
}
}
@ -447,7 +469,13 @@ building_elephant_pens_requirement_terrain = {
terrain = jungle
OR = {
geographical_region = world_innovation_elephants
culture = { has_cultural_parameter = elephant_pens_building_bonuses }
AND = {
exists = culture
trigger_if = {
limit = { exists = culture }
culture ?= { has_cultural_parameter = elephant_pens_building_bonuses }
}
}
}
}
@ -455,7 +483,13 @@ building_horse_pastures_requirement_terrain = {
OR = {
terrain = steppe
geographical_region = world_steppe_east
culture = { has_cultural_parameter = unlock_horse_pastures_building }
AND = {
exists = culture
trigger_if = {
limit = { exists = culture }
culture ?= { has_cultural_parameter = unlock_horse_pastures_building }
}
}
}
}
@ -471,7 +505,13 @@ building_quarries_requirement_terrain = {
OR = {
terrain = mountains
terrain = desert_mountains
culture = { has_cultural_parameter = can_build_quarries_everywhere }
AND = {
exists = culture
trigger_if = {
limit = { exists = culture }
culture ?= { has_cultural_parameter = can_build_quarries_everywhere }
}
}
}
}
@ -486,7 +526,13 @@ building_warrior_lodges_requirement_terrain = {
}
NOT = { geographical_region = world_horse_buildings_in_hills_and_mountains }
}
culture = { has_cultural_parameter = warrior_lodges_lift_restrictions }
AND = {
exists = culture
trigger_if = {
limit = { exists = culture }
culture ?= { has_cultural_parameter = warrior_lodges_lift_restrictions }
}
}
}
}
@ -523,7 +569,7 @@ building_wind_furnace_requirement_terrain = {
}
scope:holder.culture = { has_innovation = innovation_wootz_steel }
scope:holder.culture ?= { has_innovation = innovation_wootz_steel }
}
building_hill_forts_requirement_terrain = {
@ -587,7 +633,13 @@ building_caravanserai_requirement_terrain = {
building_qanats_requirement_terrain = {
county ?= {
culture = { has_cultural_parameter = unlocks_qanat_building }
AND = {
exists = culture
trigger_if = {
limit = { exists = culture }
culture ?= { has_cultural_parameter = unlocks_qanat_building }
}
}
county_has_province_with_terrain = {
terrain = hills
terrain = tells
@ -757,22 +809,22 @@ add_random_building_trigger = {
generic_economic_building_innovation_trigger = {
trigger_if = {
limit = { has_building_or_higher = $BUILDING$_01 }
scope:build_owner.culture = { has_innovation = innovation_crop_rotation }
scope:build_owner.culture ?= { has_innovation = innovation_crop_rotation }
}
trigger_if = {
limit = { has_building_or_higher = $BUILDING$_02 }
building_requirement_castle_city_church = { LEVEL = 02 }
scope:build_owner.culture = { has_innovation = innovation_manorialism }
scope:build_owner.culture ?= { has_innovation = innovation_manorialism }
}
trigger_if = {
limit = { has_building_or_higher = $BUILDING$_04 }
building_requirement_castle_city_church = { LEVEL = 03 }
scope:build_owner.culture = { has_innovation = innovation_guilds }
scope:build_owner.culture ?= { has_innovation = innovation_guilds }
}
trigger_if = {
limit = { has_building_or_higher = $BUILDING$_06 }
building_requirement_castle_city_church = { LEVEL = 04 }
scope:build_owner.culture = { has_innovation = innovation_cranes }
scope:build_owner.culture ?= { has_innovation = innovation_cranes }
}
}
@ -780,22 +832,22 @@ generic_economic_building_innovation_trigger = {
generic_fortification_building_innovations_trigger = {
trigger_if = {
limit = { has_building_or_higher = $BUILDING$_01 }
scope:build_owner.culture = { has_innovation = innovation_motte }
scope:build_owner.culture ?= { has_innovation = innovation_motte }
}
trigger_if = {
limit = { has_building_or_higher = $BUILDING$_02 }
building_requirement_castle_city_church = { LEVEL = 02 }
scope:build_owner.culture = { has_innovation = innovation_battlements }
scope:build_owner.culture ?= { has_innovation = innovation_battlements }
}
trigger_if = {
limit = { has_building_or_higher = $BUILDING$_04 }
building_requirement_castle_city_church = { LEVEL = 03 }
scope:build_owner.culture = { has_innovation = innovation_hoardings }
scope:build_owner.culture ?= { has_innovation = innovation_hoardings }
}
trigger_if = {
limit = { has_building_or_higher = $BUILDING$_06 }
building_requirement_castle_city_church = { LEVEL = 04 }
scope:build_owner.culture = { has_innovation = innovation_machicolations }
scope:build_owner.culture ?= { has_innovation = innovation_machicolations }
}
}
@ -803,22 +855,22 @@ generic_fortification_building_innovations_trigger = {
generic_recruitment_building_innovations_trigger = {
trigger_if = {
limit = { has_building_or_higher = $BUILDING$_01 }
scope:build_owner.culture = { has_innovation = innovation_barracks }
scope:build_owner.culture ?= { has_innovation = innovation_barracks }
}
trigger_if = {
limit = { has_building_or_higher = $BUILDING$_02 }
building_requirement_castle_city_church = { LEVEL = 02 }
scope:build_owner.culture = { has_innovation = innovation_burhs }
scope:build_owner.culture ?= { has_innovation = innovation_burhs }
}
trigger_if = {
limit = { has_building_or_higher = $BUILDING$_04 }
building_requirement_castle_city_church = { LEVEL = 03 }
scope:build_owner.culture = { has_innovation = innovation_castle_baileys }
scope:build_owner.culture ?= { has_innovation = innovation_castle_baileys }
}
trigger_if = {
limit = { has_building_or_higher = $BUILDING$_06 }
building_requirement_castle_city_church = { LEVEL = 04 }
scope:build_owner.culture = { has_innovation = innovation_royal_armory }
scope:build_owner.culture ?= { has_innovation = innovation_royal_armory }
}
}
@ -946,7 +998,7 @@ religious_special_building_exclusion_trigger = { # checks if any special buildin
building_monastic_schools_holding_level_requirement_trigger = {
trigger_if = {
limit = { scope:holder.rite = { rite_has_parameter = monastic_schools_allowed_in_every_holding_type } }
limit = { scope:holder.rite ?= { rite_has_parameter = monastic_schools_allowed_in_every_holding_type } }
OR = {
has_building_or_higher = castle_$LEVEL$
has_building_or_higher = city_$LEVEL$
@ -975,7 +1027,11 @@ building_waterworks_requirement_terrain = {
terrain = mountains
terrain = desert_mountains
}
scope:holder.culture = { has_cultural_parameter = unlocks_waterworks_buildings }
exists = scope:holder.culture
trigger_if = {
limit = { exists = scope:holder.culture }
scope:holder.culture ?= { has_cultural_parameter = unlocks_waterworks_buildings }
}
}
building_spice_plantation_requirement_terrain = {
@ -1014,12 +1070,22 @@ building_breweries_requirement = {
}
OR = {
religion = religion:catholic_religion
faith = { has_doctrine_parameter = allows_brewery }
AND = {
exists = faith
trigger_if = {
limit = { exists = faith }
faith ?= { has_doctrine_parameter = allows_brewery }
}
}
}
}
trigger_else = {
building_requirement_castle_city_church = { LEVEL = $NUMBER$ }
culture = { has_cultural_parameter = allows_brewery }
building_requirement_castle_city_church = { LEVEL = $NUMBER$ }
exists = culture
trigger_if = {
limit = { exists = culture }
culture ?= { has_cultural_parameter = allows_brewery }
}
}
}
@ -1061,7 +1127,11 @@ building_doggerland_ivory_deposits_requirement_terrain = {
building_vineyards_requirement = {
AND = {
root.culture = { has_cultural_parameter = allows_vineyards }
exists = root.culture
trigger_if = {
limit = { exists = root.culture }
root.culture ?= { has_cultural_parameter = allows_vineyards }
}
OR = {
terrain = farmlands
terrain = plains
@ -1072,16 +1142,28 @@ building_vineyards_requirement = {
building_communal_settlement_requirement = {
OR = {
scope:holder.faith = {
has_doctrine_parameter = allows_communal_settlement
AND = {
exists = scope:holder.faith
trigger_if = {
limit = { exists = scope:holder.faith }
scope:holder.faith ?= { has_doctrine_parameter = allows_communal_settlement }
}
}
root.faith = {
has_doctrine_parameter = allows_communal_settlement
AND = {
exists = root.faith
trigger_if = {
limit = { exists = root.faith }
root.faith ?= { has_doctrine_parameter = allows_communal_settlement }
}
}
root.culture = {
has_cultural_parameter = allows_communal_settlement
AND = {
exists = root.culture
trigger_if = {
limit = { exists = root.culture }
root.culture ?= { has_cultural_parameter = allows_communal_settlement }
}
}
}
}

View file

@ -3451,17 +3451,7 @@ portrait_religious_shamanism_nivkh_trigger = { # same as above but shamanists wi
portrait_religious_steppe_trigger = {
OR = {
# religion = religion:tengrism_religion
# religion = religion:qiangic_religion
# religion = religion:siberian_religion
# religion = religion:mundhum_religion
# religion = religion:tani_religion
religion = religion:mediterranean_religion
# faith = {
# portrait_religious_faith_or_foundational_trigger = { FAITH = faith:bon_faith }
# }
}
always = no
}
portrait_religious_buddhist_trigger = {

View file

@ -8,7 +8,7 @@ coa_african_trigger = {
}
coa_african_culture_trigger = {
scope:culture = {
scope:culture ?= {
OR = {
has_coa_gfx = central_african_group_coa_gfx
has_coa_gfx = east_african_coa_gfx
@ -41,7 +41,7 @@ coa_bishopric_trigger = {
coa_breton_trigger = {
OR = {
scope:culture = { has_coa_gfx = breton_coa_gfx }
scope:culture ?= { has_coa_gfx = breton_coa_gfx }
scope:title ?= {
any_this_title_or_de_jure_above = {
this = title:k_brittany
@ -52,7 +52,7 @@ coa_breton_trigger = {
coa_byzantine_trigger = {
OR = {
scope:culture = { has_coa_gfx = byzantine_group_coa_gfx }
scope:culture ?= { has_coa_gfx = byzantine_group_coa_gfx }
# scope:title ?= {
# any_this_title_or_de_jure_above = {
# this = title:e_byzantium
@ -63,7 +63,7 @@ coa_byzantine_trigger = {
coa_castilian_trigger = {
OR = {
scope:culture = { has_coa_gfx = castilian_coa_gfx }
scope:culture ?= { has_coa_gfx = castilian_coa_gfx }
scope:title ?= {
any_this_title_or_de_jure_above = {
this = title:k_castille
@ -84,10 +84,14 @@ coa_coptic_trigger = {
}
coa_cross_trigger = {
scope:faith = {
OR = { religion = religion:catholic_religion religion = religion:eastern_orthodox_religion religion = religion:protestant_religion religion = religion:oriental_orthodox_religion }
NOT = { main_rite = { rite_has_tenet = tenet_aniconism } }
trigger_if = {
limit = { exists = scope:faith }
scope:faith ?= {
OR = { religion = religion:catholic_religion religion = religion:eastern_orthodox_religion religion = religion:protestant_religion religion = religion:oriental_orthodox_religion }
NOT = { main_rite ?= { rite_has_tenet = tenet_aniconism } }
}
}
trigger_else = { always = no }
}
coa_england_switches_to_france_coa_trigger = {
@ -120,27 +124,30 @@ coa_switch_to_norse_trigger = {
}
OR = {
faith.religion = religion:folk_germanic_religion
culture = { has_coa_gfx = norse_coa_gfx }
culture ?= { has_coa_gfx = norse_coa_gfx }
}
}
}
coa_feudal_trigger = {
scope:faith.religion = {
OR = {
this = religion:catholic_religion
this = religion:eastern_orthodox_religion
this = religion:protestant_religion
this = religion:oriental_orthodox_religion
trigger_if = {
limit = { exists = scope:faith.religion }
scope:faith.religion = {
OR = {
this = religion:catholic_religion
this = religion:eastern_orthodox_religion
this = religion:protestant_religion
this = religion:oriental_orthodox_religion
}
}
}
trigger_else = { always = no }
government_has_flag = government_is_feudal
}
coa_french_trigger = {
OR = {
scope:culture = { has_coa_gfx = french_coa_gfx }
scope:culture ?= { has_coa_gfx = french_coa_gfx }
AND = {
exists = root
any_liege_or_above = {
@ -154,7 +161,7 @@ coa_french_trigger = {
coa_irish_trigger = {
OR = {
scope:culture = { has_coa_gfx = irish_coa_gfx }
scope:culture ?= { has_coa_gfx = irish_coa_gfx }
scope:title ?= {
any_this_title_or_de_jure_above = {
this = title:k_ireland
@ -165,7 +172,7 @@ coa_irish_trigger = {
coa_indian_culture_trigger = {
scope:culture = {
scope:culture ?= {
OR = {
has_coa_gfx = burman_group_coa_gfx
has_coa_gfx = dravidian_group_coa_gfx
@ -182,8 +189,14 @@ coa_indian_region_trigger = {
}
}
coa_indian_religion_trigger = {
scope:faith.religion = {
save_temporary_scope_as = religion
trigger_if = {
limit = { exists = scope:faith.religion }
scope:faith.religion = {
save_temporary_scope_as = religion
}
}
trigger_else = {
always = no
}
scope:religion = {
OR = {
@ -201,19 +214,27 @@ coa_indian_trigger = {
coa_indian_region_trigger = yes
coa_indian_religion_trigger = yes
}
scope:culture = { has_graphical_east_asia_culture_group_trigger = no }
scope:culture ?= { has_graphical_east_asia_culture_group_trigger = no }
}
coa_jewish_trigger = {
OR = {
scope:faith.religion = religion:judaism_religion
scope:culture = { has_coa_gfx = israelite_group_coa_gfx }
trigger_if = {
limit = { exists = scope:faith.religion }
scope:faith.religion = religion:judaism_religion
}
trigger_else = { always = no }
trigger_if = {
limit = { exists = scope:culture }
scope:culture ?= { has_coa_gfx = israelite_group_coa_gfx }
}
trigger_else = { always = no }
}
}
coa_leonese_trigger = {
OR = {
scope:culture = { has_coa_gfx = leonese_coa_gfx }
scope:culture ?= { has_coa_gfx = leonese_coa_gfx }
scope:title ?= {
any_this_title_or_de_jure_above = {
this = title:k_leon
@ -246,7 +267,7 @@ coa_manx_trigger = {
coa_mena_trigger = {
OR = {
scope:faith.religion = religion:islam_religion
scope:culture = {
scope:culture ?= {
OR = {
has_coa_gfx = arabic_group_coa_gfx
has_coa_gfx = berber_group_coa_gfx
@ -258,7 +279,7 @@ coa_mena_trigger = {
coa_suomenusko_trigger = {
OR = {
scope:faith.religion = religion:finnic_religion
scope:culture = {
scope:culture ?= {
OR = {
has_coa_gfx = balto_finnic_group_coa_gfx
has_coa_gfx = ugro_permian_group_coa_gfx
@ -270,7 +291,7 @@ coa_suomenusko_trigger = {
coa_polish_trigger = {
OR = {
scope:culture = { has_coa_gfx = polish_coa_gfx }
scope:culture ?= { has_coa_gfx = polish_coa_gfx }
AND = {
exists = root
any_liege_or_above = {
@ -284,7 +305,7 @@ coa_polish_trigger = {
coa_scottish_trigger = {
OR = {
scope:culture = { has_coa_gfx = scottish_coa_gfx }
scope:culture ?= { has_coa_gfx = scottish_coa_gfx }
scope:title ?= {
any_this_title_or_de_jure_above = {
this = title:k_scotland
@ -302,15 +323,15 @@ coa_theocratic_trigger = {
}
coa_welsh_trigger = {
scope:culture = { has_coa_gfx = welsh_coa_gfx }
scope:culture ?= { has_coa_gfx = welsh_coa_gfx }
}
coa_tamga_trigger = {
scope:culture = { has_coa_gfx = steppe_coa_gfx }
scope:culture ?= { has_coa_gfx = steppe_coa_gfx }
}
coa_scandinavian_trigger = {
scope:culture = {
scope:culture ?= {
OR = {
has_coa_gfx = swedish_coa_gfx
has_coa_gfx = norwegian_coa_gfx
@ -320,18 +341,18 @@ coa_scandinavian_trigger = {
}
coa_norse_trigger = {
scope:culture = { has_coa_gfx = norse_coa_gfx }
scope:culture ?= { has_coa_gfx = norse_coa_gfx }
}
coa_germanic_trigger = {
scope:culture = { has_coa_gfx = german_group_coa_gfx }
scope:culture ?= { has_coa_gfx = german_group_coa_gfx }
}
coa_iberian_trigger = {
OR = {
scope:culture = { has_coa_gfx = iberian_group_coa_gfx }
scope:culture ?= { has_coa_gfx = iberian_group_coa_gfx }
AND = {
scope:culture = { has_coa_gfx = arabic_group_coa_gfx }
scope:culture ?= { has_coa_gfx = arabic_group_coa_gfx }
scope:title ?= {
OR = {
this = title:e_spain
@ -343,7 +364,7 @@ coa_iberian_trigger = {
}
coa_iranian_trigger = {
scope:culture = { has_coa_gfx = iranian_group_coa_gfx }
scope:culture ?= { has_coa_gfx = iranian_group_coa_gfx }
}
has_recognizable_chinese_seal = {

View file

@ -33,7 +33,11 @@ can_be_councillor_gender_trigger = {
has_variable = can_be_councillor_override
AND = {
is_female = yes
$COURT_OWNER$.rite = { NOT = { rite_has_parameter = male_dominated_council } }
exists = $COURT_OWNER$.rite
trigger_if = {
limit = { exists = $COURT_OWNER$.rite }
$COURT_OWNER$.rite ?= { NOT = { rite_has_parameter = male_dominated_council } }
}
}
AND = {
is_female = yes
@ -43,7 +47,11 @@ can_be_councillor_gender_trigger = {
}
AND = {
is_male = yes
$COURT_OWNER$.rite = { NOT = { rite_has_parameter = female_dominated_council } }
exists = $COURT_OWNER$.rite
trigger_if = {
limit = { exists = $COURT_OWNER$.rite }
$COURT_OWNER$.rite ?= { NOT = { rite_has_parameter = female_dominated_council } }
}
}
}
}
@ -55,7 +63,7 @@ can_be_chancellor_trigger = {
}
NAND = {
has_council_position = councillor_court_chaplain
rite = { rite_has_parameter = clerical_appointment_fixed }
rite ?= { rite_has_parameter = clerical_appointment_fixed }
}
NOR = {
has_council_position = councillor_spouse
@ -74,7 +82,7 @@ can_be_steward_trigger = {
}
NAND = {
has_council_position = councillor_court_chaplain
rite = { rite_has_parameter = clerical_appointment_fixed }
rite ?= { rite_has_parameter = clerical_appointment_fixed }
}
NOR = {
has_council_position = councillor_spouse
@ -94,7 +102,7 @@ can_be_marshal_trigger = {
is_hostage = no
NAND = {
has_council_position = councillor_court_chaplain
rite = { rite_has_parameter = clerical_appointment_fixed }
rite ?= { rite_has_parameter = clerical_appointment_fixed }
}
NOR = {
has_council_position = councillor_spouse
@ -107,7 +115,7 @@ can_be_marshal_trigger = {
can_be_councillor_gender_trigger = { COURT_OWNER = $COURT_OWNER$ }
AND = {
has_trait = shieldmaiden
$COURT_OWNER$.culture = { has_cultural_parameter = has_access_to_shieldmaidens }
$COURT_OWNER$.culture ?= { has_cultural_parameter = has_access_to_shieldmaidens }
}
}
}
@ -116,7 +124,7 @@ can_be_spymaster_trigger = {
can_be_councillor_basics_trigger = yes
NAND = {
has_council_position = councillor_court_chaplain
rite = { rite_has_parameter = clerical_appointment_fixed }
rite ?= { rite_has_parameter = clerical_appointment_fixed }
}
NOR = {
has_council_position = councillor_spouse
@ -141,11 +149,18 @@ can_be_court_chaplain_trigger = {
liege = { has_diarchy_active_parameter = diarchy_is_vizierate }
}
}
$COURT_OWNER$.rite = { rite_has_allowed_gender_for_clergy = scope:court_chaplain_check }
rite = $COURT_OWNER$.rite
exists = $COURT_OWNER$.rite
trigger_if = {
limit = { exists = $COURT_OWNER$.rite }
$COURT_OWNER$.rite ?= { rite_has_allowed_gender_for_clergy = scope:court_chaplain_check }
}
trigger_if = {
limit = { exists = $COURT_OWNER$.rite }
rite = $COURT_OWNER$.rite
}
trigger_if = {
limit = {
rite = { rite_has_doctrine = doctrine_theocracy_temporal }
rite ?= { rite_has_doctrine = doctrine_theocracy_temporal }
}
OR = {
is_ruler = no
@ -166,7 +181,7 @@ can_be_court_chaplain_trigger = {
}
trigger_if = { # Married characters are excluded if the doctrine is not there
limit = {
rite = {
rite ?= {
NOT = { rite_has_parameter = clergy_can_marry }
}
}
@ -178,7 +193,7 @@ can_be_court_chaplain_trigger = {
can_appoint_own_court_chaplain_trigger = {
OR = {
religious_head_or_challenger ?= this # The appointment authority itself has no one to request a chaplain from
rite = {
rite ?= {
NOT = { rite_has_parameter = clerical_appointment_fixed }
}
tgp_has_access_to_ministry_trigger = yes
@ -266,15 +281,23 @@ can_be_kurultai_trigger = {
is_ruler = yes
AND = {
is_female = yes
$COURT_OWNER$.rite = { NOT = { rite_has_parameter = male_dominated_council } }
exists = $COURT_OWNER$.rite
trigger_if = {
limit = { exists = $COURT_OWNER$.rite }
$COURT_OWNER$.rite ?= { NOT = { rite_has_parameter = male_dominated_council } }
}
}
AND = {
is_male = yes
$COURT_OWNER$.rite = { NOT = { rite_has_parameter = female_dominated_council } }
exists = $COURT_OWNER$.rite
trigger_if = {
limit = { exists = $COURT_OWNER$.rite }
$COURT_OWNER$.rite ?= { NOT = { rite_has_parameter = female_dominated_council } }
}
}
AND = {
has_trait = shieldmaiden
$COURT_OWNER$.culture = { has_cultural_parameter = has_access_to_shieldmaidens }
$COURT_OWNER$.culture ?= { has_cultural_parameter = has_access_to_shieldmaidens }
}
}
}
@ -313,15 +336,15 @@ can_be_any_kurultai_trigger = {
is_ruler = yes
AND = {
is_female = yes
$COURT_OWNER$.rite = { NOT = { rite_has_parameter = male_dominated_council } }
$COURT_OWNER$.rite ?= { NOT = { rite_has_parameter = male_dominated_council } }
}
AND = {
is_male = yes
$COURT_OWNER$.rite = { NOT = { rite_has_parameter = female_dominated_council } }
$COURT_OWNER$.rite ?= { NOT = { rite_has_parameter = female_dominated_council } }
}
AND = {
has_trait = shieldmaiden
$COURT_OWNER$.culture = { has_cultural_parameter = has_access_to_shieldmaidens }
$COURT_OWNER$.culture ?= { has_cultural_parameter = has_access_to_shieldmaidens }
}
}
}
@ -436,7 +459,7 @@ can_be_fired_from_council_trigger = {
has_council_position = councillor_court_chaplain
liege = { tgp_has_access_to_ministry_trigger = no }
}
rite = {
rite ?= {
OR = {
rite_has_doctrine = doctrine_clerical_succession_temporal_appointment
rite_has_doctrine = doctrine_clerical_succession_spiritual_appointment
@ -1094,7 +1117,7 @@ task_conversion_valid_county_trigger = {
}
}
NOT = {
rite = { has_variable = pam_rite_grace_period }
rite ?= { has_variable = pam_rite_grace_period }
}
}
trigger_if = {
@ -1103,7 +1126,7 @@ task_conversion_valid_county_trigger = {
trigger_if = {
limit = {
scope:councillor_liege = {
faith = {
faith ?= {
has_doctrine_parameter = unreformed
}
}
@ -1114,7 +1137,7 @@ task_conversion_valid_county_trigger = {
vassal_is_valid_and_follows_directive_trigger = { VASSAL = this LIEGE = liege }
}
scope:councillor_liege = { ai_zeal >= 50 }
scope:county_check.faith = { has_doctrine_parameter = unreformed }
scope:county_check.faith ?= { has_doctrine_parameter = unreformed }
scope:county_check = { # Always convert holy sites
any_county_province = {
barony = {
@ -1128,7 +1151,7 @@ task_conversion_valid_county_trigger = {
trigger_if = {
limit = {
scope:councillor_liege = {
faith = {
faith ?= {
faith_hostility_level = {
target = scope:county_check.faith
value <= faith_fully_accepted_level
@ -1158,7 +1181,7 @@ task_conversion_valid_county_trigger = {
trigger_if = {
limit = {
scope:councillor_liege = {
faith = {
faith ?= {
faith_hostility_level = {
target = scope:county_check.faith
value <= faith_astray_level
@ -1191,7 +1214,7 @@ task_conversion_valid_county_trigger = {
trigger_else_if = {
limit = {
scope:councillor_liege = {
rite = { rite_has_doctrine = doctrine_pluralism_fundamentalist }
rite ?= { rite_has_doctrine = doctrine_pluralism_fundamentalist }
}
}
OR = {
@ -1261,11 +1284,11 @@ task_conversion_valid_county_trigger = {
limit = {
scope:councillor_liege = {
OR = {
rite = { rite_has_tenet = tenet_tax_nonbelievers }
faith = { has_doctrine = special_doctrine_jizya }
rite ?= { rite_has_tenet = tenet_tax_nonbelievers }
faith ?= { has_doctrine = special_doctrine_jizya }
}
}
scope:councillor_liege.faith = { faith_is_in_same_rf = { FAITH = scope:county_check.faith } }
scope:councillor_liege.faith ?= { faith_is_in_same_rf = { FAITH = scope:county_check.faith } }
}
OR = {
scope:councillor_liege = {
@ -1273,8 +1296,8 @@ task_conversion_valid_county_trigger = {
vassal_is_valid_and_follows_directive_trigger = { VASSAL = this LIEGE = liege }
}
scope:councillor_liege = { ai_zeal >= 50 }
scope:county_check.faith = { has_doctrine_parameter = unreformed }
scope:councillor_liege.faith = {
scope:county_check.faith ?= { has_doctrine_parameter = unreformed }
scope:councillor_liege.faith ?= {
any_holy_site_barony = {
kingdom = scope:county_check.kingdom
}

View file

@ -0,0 +1,30 @@
#Triggers handling questions of military and warfare
#Checks whether scope character has greater military strength than the ratio specified
military_strength_greater_than_ratio_trigger = {
save_temporary_scope_value_as = {
name = ratio
value = {
value = max_military_strength
divide = $TARGET$.max_military_strength
}
}
scope:ratio > $RATIO$
}
valid_for_maa_trigger = {
OR = {
AND = {
has_government = landless_adventurer_government
has_perk = planned_cultivation_perk
location.county.culture ?= { has_cultural_parameter = $PARAMETER$ }
}
culture ?= { has_cultural_parameter = $PARAMETER$ }
}
}
valid_for_nomadic_riders_trigger = {
government_has_flag = government_is_nomadic
}

File diff suppressed because it is too large Load diff

View file

@ -276,7 +276,7 @@ allows_declaring_war_against_target_trigger = {
is_in_activity = no
trigger_if = {
limit = {
culture = { has_cultural_parameter = cannot_attack_allies }
culture ?= { has_cultural_parameter = cannot_attack_allies }
}
NOT = {
is_allied_to = scope:defender_check
@ -284,7 +284,7 @@ allows_declaring_war_against_target_trigger = {
}
trigger_if = {
limit = {
culture = { has_cultural_parameter = cannot_attack_truces }
culture ?= { has_cultural_parameter = cannot_attack_truces }
}
NOT = {
has_truce = scope:defender_check
@ -487,8 +487,16 @@ can_use_conquest_cbs_trigger = {
government_has_flag = government_is_clan
government_has_flag = government_is_nomadic
government_has_flag = government_is_steppe_admin
rite = { rite_has_parameter = conquest_cb_enabled }
culture = { has_cultural_parameter = can_use_conquest_cbs }
trigger_if = {
limit = { exists = rite }
rite ?= { rite_has_parameter = conquest_cb_enabled }
}
trigger_else = { always = no }
trigger_if = {
limit = { exists = culture }
culture ?= { has_cultural_parameter = can_use_conquest_cbs }
}
trigger_else = { always = no }
AND = {
government_has_flag = government_is_japan_feudal
has_realm_law = imperial_expansion_law
@ -506,7 +514,13 @@ can_be_warrior_trigger = {
OR = {
can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = $ARMY_OWNER$ }
AND = {
$ARMY_OWNER$.culture = { has_cultural_parameter = high_prowess_ignores_knight_restrictions }
$ARMY_OWNER$ = {
trigger_if = {
limit = { exists = culture }
culture ?= { has_cultural_parameter = high_prowess_ignores_knight_restrictions }
}
trigger_else = { always = no }
}
prowess >= 10
}
# Japan Onna-musha
@ -517,9 +531,17 @@ can_be_warrior_trigger = {
NOT = {
government_has_mechanic = administrative
}
culture = { has_cultural_parameter = non_admin_close_family_non_martial_gender_knights_in_defensive_wars }
trigger_if = {
limit = { exists = culture }
culture ?= { has_cultural_parameter = non_admin_close_family_non_martial_gender_knights_in_defensive_wars }
}
trigger_else = { always = no }
}
culture = { has_cultural_parameter = non_admin_close_family_non_martial_gender_knights_in_defensive_wars }
trigger_if = {
limit = { exists = culture }
culture ?= { has_cultural_parameter = non_admin_close_family_non_martial_gender_knights_in_defensive_wars }
}
trigger_else = { always = no }
}
AND = {
$ARMY_OWNER$ = { is_at_war_as_defender = yes }
@ -558,8 +580,12 @@ can_be_knight_trigger = {
}
trigger_if = {
limit = {
$ARMY_OWNER$.culture = {
has_cultural_parameter = minimum_prowess_for_knights
exists = $ARMY_OWNER$.culture
trigger_if = {
limit = { exists = $ARMY_OWNER$.culture }
$ARMY_OWNER$.culture ?= {
has_cultural_parameter = minimum_prowess_for_knights
}
}
}
prowess >= 12
@ -569,17 +595,21 @@ can_be_knight_trigger = {
is_clergy = yes
}
OR = {
rite = { rite_has_parameter = clergy_can_fight }
rite ?= { rite_has_parameter = clergy_can_fight }
AND = {
has_personal_tenet_flag = clergy_can_fight_personal
NOT = {
rite = { rite_has_parameter = pacifist }
rite ?= { rite_has_parameter = pacifist }
}
}
culture = { has_cultural_parameter = culture_clergy_can_fight }
culture ?= { has_cultural_parameter = culture_clergy_can_fight }
AND = {
$ARMY_OWNER$.culture = {
has_cultural_parameter = high_prowess_ignores_knight_restrictions
exists = $ARMY_OWNER$.culture
trigger_if = {
limit = { exists = $ARMY_OWNER$.culture }
$ARMY_OWNER$.culture ?= {
has_cultural_parameter = high_prowess_ignores_knight_restrictions
}
}
prowess >= 10
}
@ -587,8 +617,12 @@ can_be_knight_trigger = {
}
OR = {
AND = {
$ARMY_OWNER$.culture = {
has_cultural_parameter = high_prowess_ignores_knight_restrictions
exists = $ARMY_OWNER$.culture
trigger_if = {
limit = { exists = $ARMY_OWNER$.culture }
$ARMY_OWNER$.culture ?= {
has_cultural_parameter = high_prowess_ignores_knight_restrictions
}
}
prowess >= 10
}
@ -953,14 +987,14 @@ religious_cb_holder_under_target_can_be_vassalized = {
OR = {
# For all Faiths, if the attacker views this vassal's faith more favorably than the defender does, they are 'liberated' and become vassals under the attacker.
# For example, if Catholics are crusading against Ash'aris(viewed as Evil), any Messalian vassals (viewed as Hostile) will become vassals under the Catholic attacker.
scope:attacker.faith = {
scope:attacker.faith ?= {
faith_hostility_level_comparison = {
prev.holder.faith < scope:defender.faith
}
}
# Pluralist faiths always attempt to preserve vassals if possible, even if the vassal follows an Evil faith.
scope:attacker.rite = { rite_has_parameter = pluralism_pluralistic_holy_wars_preserve_vassals }
scope:attacker.rite ?= { rite_has_parameter = pluralism_pluralistic_holy_wars_preserve_vassals }
}
}
@ -1009,8 +1043,16 @@ can_use_viking_invasion_cbs_trigger = {
}
can_use_viking_invasion_cbs_dlc_trigger = {
culture = { has_innovation = innovation_longboats }
rite = { rite_has_tenet = tenet_warmonger }
trigger_if = {
limit = { exists = culture }
culture ?= { has_innovation = innovation_longboats }
}
trigger_else = { always = no }
trigger_if = {
limit = { exists = rite }
rite ?= { rite_has_tenet = tenet_warmonger }
}
trigger_else = { always = no }
any_sub_realm_county = { is_coastal_county = yes }
trigger_if = {
limit = { is_ai = yes }
@ -1022,7 +1064,11 @@ can_use_viking_invasion_cbs_dlc_trigger = {
NOT = {
any_liege_or_above = {
NOT = {
rite = { rite_has_tenet = tenet_warmonger }
trigger_if = {
limit = { exists = rite }
rite ?= { rite_has_tenet = tenet_warmonger }
}
trigger_else = { always = no }
}
}
}

View file

@ -0,0 +1,278 @@
# Any theocratic vassal of $LIEGE$'s faith, no matter the rite
pam_valid_antipope_clergy_vassal_trigger = {
save_temporary_scope_as = antipope_temp
is_clergy = yes
custom_tooltip = {
text = pam_antipope_clerical_gender_tt
$LIEGE$.rite = { rite_has_allowed_gender_for_clergy = scope:antipope_temp }
}
faith = $LIEGE$.faith
NOT = { any_held_title = { is_head_of_faith = yes } }
pam_is_antipope_trigger = no
}
# Holds one of their faith's antipope titles
pam_is_antipope_trigger = {
save_temporary_scope_as = pam_antipope_holder_check
faith ?= {
any_religious_head_challenger = {
holder ?= scope:pam_antipope_holder_check
}
}
}
pam_title_is_antipope_office_trigger = {
has_variable = pam_antipope_office
}
# Holds the sponsor title behind one of their faith's antipopes. A self-declared antipope sponsors themselves
pam_is_antipope_sponsor_trigger = {
save_temporary_scope_as = pam_antipope_sponsor_check
faith = {
any_religious_head_challenger = {
challenger_sponsor ?= {
holder ?= scope:pam_antipope_sponsor_check
}
}
}
}
pam_sponsors_other_antipope_trigger = {
save_temporary_scope_as = pam_other_antipope_sponsor_check
faith = {
any_religious_head_challenger = {
NOT = { holder ?= scope:pam_other_antipope_sponsor_check }
challenger_sponsor ?= {
holder ?= scope:pam_other_antipope_sponsor_check
}
}
}
}
# Scoped to an antipope: $SPONSOR$ is the ruler whose title backs them
pam_antipope_is_sponsored_by_trigger = {
save_temporary_scope_as = pam_checked_antipope
$SPONSOR$ = { save_temporary_scope_as = pam_expected_sponsor }
faith = {
any_religious_head_challenger = {
holder ?= scope:pam_checked_antipope
challenger_sponsor ?= {
holder ?= scope:pam_expected_sponsor
}
}
}
}
pam_is_sponsored_antipope_trigger = {
pam_is_antipope_trigger = yes
pam_is_antipope_sponsor_trigger = no
}
pam_antipope_declaration_discounted_trigger = {
situation:the_christian_church ?= {
has_situation_top_phase_parameter = the_christian_church_cheaper_antipope_declaration
}
}
# Covers the antipope, their sponsor, and anyone under either of them
pam_antipope_protected_from_excommunication_trigger = {
is_following_religious_head_challenger = yes
faith.religious_head ?= $EXCOMMUNICATOR$
NOT = { has_personal_tenet_flag = tenet_apostolic_succession_antipope_opposition }
}
# Clerical requests that the mainline hierarchy would answer
# Anyone under an antipope has to take them to that antipope instead
pam_antipope_clerical_request_trigger = {
trigger_if = {
limit = { pam_is_antipope_trigger = yes }
custom_tooltip = {
text = pam_clerical_request_actor_is_antipope_tt
religious_head_or_challenger ?= $RECIPIENT$
}
}
trigger_else_if = {
limit = { pam_is_antipope_sponsor_trigger = yes }
custom_tooltip = {
text = pam_clerical_request_actor_is_antipope_sponsor_tt
religious_head_or_challenger ?= $RECIPIENT$
}
}
trigger_else_if = {
limit = { is_following_religious_head_challenger = yes }
custom_tooltip = {
text = pam_clerical_request_in_antipope_realm_tt
religious_head_or_challenger ?= $RECIPIENT$
}
}
trigger_else = {
always = yes
}
}
pam_antipope_may_grant_clerical_region_trigger = {
trigger_if = {
limit = { scope:actor = { pam_is_antipope_trigger = yes } }
trigger_if = {
limit = { exists = $SEE$.holder }
$SEE$.holder.religious_head_or_challenger ?= scope:actor
}
trigger_else = {
$SEE$.title_capital_county.holder.religious_head_or_challenger ?= scope:actor
}
}
trigger_else = {
always = yes
}
}
# Antipope + Sponsor
pam_can_use_challenge_hof_cb_trigger = {
OR = {
pam_is_antipope_trigger = yes
pam_is_antipope_sponsor_trigger = yes
}
faith = {
exists = religious_head
NOT = { religious_head = scope:attacker }
}
}
pam_challenge_hof_join_war_trigger = {
is_ai = yes
highest_held_title_tier >= tier_county
NOR = {
is_participant_in_war = scope:war
# Don't add vassals of targets
is_vassal_or_below_of = scope:defender
is_vassal_or_below_of = scope:attacker
# Not part of an attacker's realm
any_liege_or_above = { is_participant_in_war = scope:war }
}
OR = {
# Military Holy Orders always join
government_has_flag = government_is_military_holy_order
AND = {
# Landed rulers join if zealous independents or theocrats, prevent every cardinal and monastic abbot joining
is_landed = yes
OR = {
AND = {
is_independent_ruler = yes
# Attackers always join if rite is different, to reward spreading rite
trigger_if = {
limit = {
scope:defender.rite != scope:attacker.rite
rite = scope:attacker.rite
}
always = yes
}
# Otherwise attackers/defenders join only if zealous
trigger_else = {
ai_zeal >= very_high_positive_ai_value
}
}
government_has_flag = government_is_theocracy
}
}
}
}
# Against the Antipope sponsor (which can be the antipope themselves if self-declared)
pam_can_target_antiking_cb_trigger = {
scope:defender = {
pam_is_antipope_sponsor_trigger = yes
faith = scope:attacker.faith
top_liege = this
}
scope:attacker = {
is_landed = yes
faith = scope:defender.faith
NOT = { this = scope:defender }
NOR = {
pam_is_antipope_sponsor_trigger = yes
pam_is_antipope_trigger = yes
}
}
}
antipope_requirements_trigger = {
calc_true_if = {
amount >= $AMOUNT$
has_trait = herald
trigger_if = {
limit = { religion = religion:islam_religion }
# Sayyids get a free pass.
has_trait = sayyid
}
trigger_else_if = {
limit = { religion = religion:zoroastrianism_religion }
OR = {
has_trait = saoshyant
has_trait = saoshyant_descendant
}
}
# to prevent "false" visible, but you should not get this as a potential antipope since this can only be granted to a HoF
trigger_else = {
has_trait = savior
}
has_trait_xp = {
trait = lifestyle_scholar
value >= 100
}
custom_description = {
text = is_head_of_rite_tt
subject = root
rite.head_of_rite ?= this
}
# has_relation_rival has no first-person trigger localization, so describe it explicitly
custom_description = {
text = declare_yourself_antipope_decision_hof_rival_tt
has_relation_rival = faith.religious_head
}
custom_description = {
text = appoint_a_righteous_caliph_decision.caliph_not_in_diplo_range
NOT = { in_diplomatic_range = faith.religious_head }
}
# Having a holy site.
custom_description = {
text = appoint_a_righteous_caliph_decision.control_one_holy_site
faith = {
any_holy_site_barony = {
count >= 1
holder ?= { target_is_same_character_or_above = root }
}
}
}
# Having *2* holy sites.
custom_description = {
text = appoint_a_righteous_caliph_decision.control_two_holy_sites
faith = {
any_holy_site_barony = {
count >= 2
holder ?= { target_is_same_character_or_above = root }
}
}
}
# Having a higher-than-minimum piety level.
piety_level >= very_high_piety_level
custom_description = {
text = declare_yourself_antipope_decision_hof_piety_level_tt
piety_level > faith.religious_head.piety_level
}
# And just having a caliph who doesn't live up to the root's faith's ideals.
custom_description = {
text = appoint_a_righteous_caliph_decision.caliph_has_x_or_more_traits_sinful_to_your_faith
faith.religious_head = {
num_sinful_traits = {
value >= 2
target = root.rite
}
}
}
# Has planned to schism off for a *while*.
custom_description = {
text = appoint_a_righteous_caliph_decision.has_wishes_to_schism_caliphate_flag
has_character_flag = wishes_to_schism_caliphate_flag
}
}
}