diff --git a/common/buildings/NEOW_special_buildings.txt b/common/buildings/NEOW_special_buildings.txt index 6cd1b3806..94d497c4d 100644 --- a/common/buildings/NEOW_special_buildings.txt +++ b/common/buildings/NEOW_special_buildings.txt @@ -9060,7 +9060,7 @@ loch_ness_02 = { #Make the lake safer } can_construct = { - scope:holder.culture ?= { has_innovation = household_soldiers } + scope:holder.culture ?= { has_innovation = innovation_redcoats } } cost_gold = 800 diff --git a/common/domiciles/buildings/NEOW_minority_community_buildings.txt b/common/domiciles/buildings/NEOW_minority_community_buildings.txt index 840475d3e..37857ba6e 100644 --- a/common/domiciles/buildings/NEOW_minority_community_buildings.txt +++ b/common/domiciles/buildings/NEOW_minority_community_buildings.txt @@ -1949,7 +1949,7 @@ minority_comm_temple_small_01 = { } } owner = { - faith.religion = religion:islam_religion + rite.religion = religion:islam_religion } } icon = "gfx/interface/icons/domicile_building/domicile_building_shrine.dds" @@ -1985,10 +1985,10 @@ minority_comm_temple_small_01 = { } owner = { OR = { - faith.religion = religion:eastern_orthodox_religion - faith.religion = religion:oriental_orthodox_religion - faith.religion = religion:catholic_religion - faith.religion = religion:protestant_religion + rite.religion = religion:eastern_orthodox_religion + rite.religion = religion:oriental_orthodox_religion + rite.religion = religion:catholic_religion + rite.religion = religion:protestant_religion } } } @@ -2015,10 +2015,10 @@ minority_comm_temple_small_01 = { trigger = { owner = { OR = { - faith.religion = religion:eastern_orthodox_religion - faith.religion = religion:oriental_orthodox_religion - faith.religion = religion:catholic_religion - faith.religion = religion:protestant_religion + rite.religion = religion:eastern_orthodox_religion + rite.religion = religion:oriental_orthodox_religion + rite.religion = religion:catholic_religion + rite.religion = religion:protestant_religion } } } @@ -2084,7 +2084,7 @@ minority_comm_temple_small_02 = { } } owner = { - faith.religion = religion:islam_religion + rite.religion = religion:islam_religion } } icon = "gfx/interface/icons/domicile_building/domicile_building_shrine.dds" @@ -2120,10 +2120,10 @@ minority_comm_temple_small_02 = { } owner = { OR = { - faith.religion = religion:eastern_orthodox_religion - faith.religion = religion:oriental_orthodox_religion - faith.religion = religion:catholic_religion - faith.religion = religion:protestant_religion + rite.religion = religion:eastern_orthodox_religion + rite.religion = religion:oriental_orthodox_religion + rite.religion = religion:catholic_religion + rite.religion = religion:protestant_religion } } } @@ -2150,10 +2150,10 @@ minority_comm_temple_small_02 = { trigger = { owner = { OR = { - faith.religion = religion:eastern_orthodox_religion - faith.religion = religion:oriental_orthodox_religion - faith.religion = religion:catholic_religion - faith.religion = religion:protestant_religion + rite.religion = religion:eastern_orthodox_religion + rite.religion = religion:oriental_orthodox_religion + rite.religion = religion:catholic_religion + rite.religion = religion:protestant_religion } } } @@ -2223,7 +2223,7 @@ minority_comm_temple_small_03 = { } } owner = { - faith.religion = religion:islam_religion + rite.religion = religion:islam_religion } } icon = "gfx/interface/icons/domicile_building/domicile_building_shrine.dds" @@ -2259,10 +2259,10 @@ minority_comm_temple_small_03 = { } owner = { OR = { - faith.religion = religion:eastern_orthodox_religion - faith.religion = religion:oriental_orthodox_religion - faith.religion = religion:catholic_religion - faith.religion = religion:protestant_religion + rite.religion = religion:eastern_orthodox_religion + rite.religion = religion:oriental_orthodox_religion + rite.religion = religion:catholic_religion + rite.religion = religion:protestant_religion } } } @@ -2289,10 +2289,10 @@ minority_comm_temple_small_03 = { trigger = { owner = { OR = { - faith.religion = religion:eastern_orthodox_religion - faith.religion = religion:oriental_orthodox_religion - faith.religion = religion:catholic_religion - faith.religion = religion:protestant_religion + rite.religion = religion:eastern_orthodox_religion + rite.religion = religion:oriental_orthodox_religion + rite.religion = religion:catholic_religion + rite.religion = religion:protestant_religion } } } @@ -2337,7 +2337,7 @@ minority_comm_temple_large_04 = { } parameters = { influence_gain_from_hof_support_4 = yes - reduce_state_faith_cost = yes + reduce_state_rite_cost = yes } ai_value = { @@ -2369,7 +2369,7 @@ minority_comm_temple_large_04 = { } } owner = { - faith.religion = religion:islam_religion + rite.religion = religion:islam_religion } } icon = "gfx/interface/icons/domicile_building/domicile_building_church.dds" @@ -2405,10 +2405,10 @@ minority_comm_temple_large_04 = { } owner = { OR = { - faith.religion = religion:eastern_orthodox_religion - faith.religion = religion:oriental_orthodox_religion - faith.religion = religion:catholic_religion - faith.religion = religion:protestant_religion + rite.religion = religion:eastern_orthodox_religion + rite.religion = religion:oriental_orthodox_religion + rite.religion = religion:catholic_religion + rite.religion = religion:protestant_religion } } } @@ -2435,10 +2435,10 @@ minority_comm_temple_large_04 = { trigger = { owner = { OR = { - faith.religion = religion:eastern_orthodox_religion - faith.religion = religion:oriental_orthodox_religion - faith.religion = religion:catholic_religion - faith.religion = religion:protestant_religion + rite.religion = religion:eastern_orthodox_religion + rite.religion = religion:oriental_orthodox_religion + rite.religion = religion:catholic_religion + rite.religion = religion:protestant_religion } } } @@ -2481,7 +2481,7 @@ minority_comm_temple_large_05 = { } parameters = { influence_gain_from_hof_support_5 = yes - reduce_state_faith_cost = yes + reduce_state_rite_cost = yes } ai_value = { @@ -2513,7 +2513,7 @@ minority_comm_temple_large_05 = { } } owner = { - faith.religion = religion:islam_religion + rite.religion = religion:islam_religion } } icon = "gfx/interface/icons/domicile_building/domicile_building_church.dds" @@ -2549,10 +2549,10 @@ minority_comm_temple_large_05 = { } owner = { OR = { - faith.religion = religion:eastern_orthodox_religion - faith.religion = religion:oriental_orthodox_religion - faith.religion = religion:catholic_religion - faith.religion = religion:protestant_religion + rite.religion = religion:eastern_orthodox_religion + rite.religion = religion:oriental_orthodox_religion + rite.religion = religion:catholic_religion + rite.religion = religion:protestant_religion } } } @@ -2579,10 +2579,10 @@ minority_comm_temple_large_05 = { trigger = { owner = { OR = { - faith.religion = religion:eastern_orthodox_religion - faith.religion = religion:oriental_orthodox_religion - faith.religion = religion:catholic_religion - faith.religion = religion:protestant_religion + rite.religion = religion:eastern_orthodox_religion + rite.religion = religion:oriental_orthodox_religion + rite.religion = religion:catholic_religion + rite.religion = religion:protestant_religion } } } @@ -2626,7 +2626,7 @@ minority_comm_temple_large_06 = { parameters = { influence_gain_from_hof_support_6 = yes - reduce_state_faith_cost = yes + reduce_state_rite_cost = yes more_successful_heresies = yes } @@ -2659,7 +2659,7 @@ minority_comm_temple_large_06 = { } } owner = { - faith.religion = religion:islam_religion + rite.religion = religion:islam_religion } } icon = "gfx/interface/icons/domicile_building/domicile_building_church.dds" @@ -2695,10 +2695,10 @@ minority_comm_temple_large_06 = { } owner = { OR = { - faith.religion = religion:eastern_orthodox_religion - faith.religion = religion:oriental_orthodox_religion - faith.religion = religion:catholic_religion - faith.religion = religion:protestant_religion + rite.religion = religion:eastern_orthodox_religion + rite.religion = religion:oriental_orthodox_religion + rite.religion = religion:catholic_religion + rite.religion = religion:protestant_religion } } } @@ -2725,10 +2725,10 @@ minority_comm_temple_large_06 = { trigger = { owner = { OR = { - faith.religion = religion:eastern_orthodox_religion - faith.religion = religion:oriental_orthodox_religion - faith.religion = religion:catholic_religion - faith.religion = religion:protestant_religion + rite.religion = religion:eastern_orthodox_religion + rite.religion = religion:oriental_orthodox_religion + rite.religion = religion:catholic_religion + rite.religion = religion:protestant_religion } } } @@ -3871,7 +3871,7 @@ communal_gardens_01 = { has_cultural_tradition = tradition_sacred_groves } } - faith ?= { has_doctrine = tenet_sanctity_of_nature } + rite ?= { has_doctrine = tenet_sanctity_of_nature } } } } @@ -3996,7 +3996,7 @@ communal_gardens_02 = { has_cultural_tradition = tradition_sacred_groves } } - faith ?= { has_doctrine = tenet_sanctity_of_nature } + rite ?= { has_doctrine = tenet_sanctity_of_nature } } } } @@ -4121,7 +4121,7 @@ communal_gardens_03 = { has_cultural_tradition = tradition_sacred_groves } } - faith ?= { has_doctrine = tenet_sanctity_of_nature } + rite ?= { has_doctrine = tenet_sanctity_of_nature } } } } @@ -4250,7 +4250,7 @@ communal_gardens_leisure_04 = { has_cultural_tradition = tradition_sacred_groves } } - faith ?= { has_doctrine = tenet_sanctity_of_nature } + rite ?= { has_doctrine = tenet_sanctity_of_nature } } } } @@ -4376,7 +4376,7 @@ communal_gardens_leisure_05 = { has_cultural_tradition = tradition_sacred_groves } } - faith ?= { has_doctrine = tenet_sanctity_of_nature } + rite ?= { has_doctrine = tenet_sanctity_of_nature } } } } @@ -4503,7 +4503,7 @@ communal_gardens_leisure_06 = { has_cultural_tradition = tradition_sacred_groves } } - faith ?= { has_doctrine = tenet_sanctity_of_nature } + rite ?= { has_doctrine = tenet_sanctity_of_nature } } } } @@ -4632,7 +4632,7 @@ communal_gardens_fruit_04 = { has_cultural_tradition = tradition_sacred_groves } } - faith ?= { has_doctrine = tenet_sanctity_of_nature } + rite ?= { has_doctrine = tenet_sanctity_of_nature } } } } @@ -4759,7 +4759,7 @@ communal_gardens_fruit_05 = { has_cultural_tradition = tradition_sacred_groves } } - faith ?= { has_doctrine = tenet_sanctity_of_nature } + rite ?= { has_doctrine = tenet_sanctity_of_nature } } } } @@ -4886,7 +4886,7 @@ communal_gardens_fruit_06 = { has_cultural_tradition = tradition_sacred_groves } } - faith ?= { has_doctrine = tenet_sanctity_of_nature } + rite ?= { has_doctrine = tenet_sanctity_of_nature } } } } diff --git a/common/factions/00_peasant_faction_new.txt b/common/factions/00_peasant_faction_new.txt index 73cfc5ade..adc1bc940 100644 --- a/common/factions/00_peasant_faction_new.txt +++ b/common/factions/00_peasant_faction_new.txt @@ -213,6 +213,12 @@ peasant_faction = { culture != scope:faction.faction_target.culture scope:root.culture = { has_cultural_parameter = county_peasant_and_populist_factions_more_common } } + modifier = { + add = 25 + county_opinion < 0 + rite != scope:faction.faction_target.rite + scope:root.rite = { has_cultural_parameter = county_peasant_and_populist_factions_more_common_rite } + } # Difficulty Settings modifier = { # Easy diff --git a/common/factions/00_populist_faction.txt b/common/factions/00_populist_faction.txt index cc1177f39..276852e1f 100644 --- a/common/factions/00_populist_faction.txt +++ b/common/factions/00_populist_faction.txt @@ -338,6 +338,12 @@ culture != scope:target.culture scope:root.culture = { has_cultural_parameter = county_peasant_and_populist_factions_more_common } } + modifier = { + add = 25 + county_opinion < 0 + rite != scope:faction.faction_target.rite + scope:root.rite = { has_cultural_parameter = county_peasant_and_populist_factions_more_common_rite } + } # Realm Stability Settings modifier = { diff --git a/common/religion/tenet_types/00_pam_tenets.txt b/common/religion/tenet_types/00_pam_tenets.txt index 0c99970f8..ba70df33a 100644 --- a/common/religion/tenet_types/00_pam_tenets.txt +++ b/common/religion/tenet_types/00_pam_tenets.txt @@ -232,6 +232,7 @@ tenet_dulia = { tenet_dulia_extra_relic_modifier tenet_dulia_dynasty_prestige_from_relics tenet_dulia_canonization_faith_bonus + neow_piety_from_temple_construction } personal_tenet_parameters = { diff --git a/common/script_values/00_war_values.txt b/common/script_values/00_war_values.txt new file mode 100644 index 000000000..b87e99bad --- /dev/null +++ b/common/script_values/00_war_values.txt @@ -0,0 +1,1061 @@ +############## +# WAR VALUES # +############## + +# Truce Durations +## Since we want these to work out to nice, even numbers, we calc them manually rather than use multipliers. +standard_truce_duration_days = { + value = 1825 + # Deductions. + ## Flexible truces perk. + if = { + limit = { + scope:attacker = { has_perk = flexible_truces_perk } + } + add = -450 + } + ## Certain struggle phases. + if = { + limit = { + scope:attacker = { + any_character_struggle = { + is_struggle_parameter_active_secondary_character_involvement_either_trigger = { + PARAMETER = truces_by_involved_or_interlopers_within_region_shorter + CHAR = scope:defender + } + } + } + } + add = -900 + } + if = { + limit = { + scope:attacker = { + any_character_struggle = { + is_struggle_parameter_active_secondary_character_involvement_either_trigger = { + PARAMETER = truces_by_involved_or_interlopers_within_region_longer + CHAR = scope:defender + } + } + } + } + add = 900 + } + ## Shorter truce if both sides are nomads + if = { + limit = { + scope:attacker = { government_has_flag = government_is_nomadic } + scope:defender = { government_has_flag = government_is_nomadic } + } + subtract = 730 + } + # A truce should at least give a 2-year breather. + min = 730 + if = { + limit = { + scope:attacker = { + any_character_war = { + primary_attacker = scope:attacker + primary_defender = scope:defender + using_cb = fp2_border_raid + } + } + } + multiply = 2 + } +} + +#Victory Prestige Experience Gain +mongol_invasion_cb_prestige_experience_gain = 10 + +#Ally contribution prestige gain +mongol_invasion_cb_ally_prestige = 100 + +#Prestige gain +mongol_invasion_cb_prestige_gain = 250 + +#White peace prestige values +mongol_invasion_cb_prestige_white_peace = -100 + +# Determined Independence Cultural Tradition +determined_independence_defensive_advantage_value = 15 + +############# +# Raid +############# + +# Practiced Pirates Cultural Tradition +not_tribal_raid_prestige_multiplier = 1.5 + +raid_gold_value = { #How much cash does this settlement generate in a raid? + value = monthly_income + multiply = 10 + + #Sensible max-mins. + min = 30 + max = 100 + + #Give a whole number. + ceiling = yes +} + +tour_tax_gold_value = { + value = monthly_income + multiply = 4 + + #Give a whole number. + ceiling = yes +} + +viking_conquest_ai_score_value = { + value = 1 + scope:attacker = { + if = { + limit = { + can_use_viking_invasion_cbs_trigger = yes + } + if = { + limit = { culture != scope:defender.culture } + add = 0.5 + if = { + limit = { + NOT = { culture = { has_same_culture_heritage = scope:defender.culture } } + } + add = 0.5 + } + } + if = { + limit = { faith != scope:defender.faith } + add = 0.5 + if = { + limit = { faith.religion != scope:defender.faith.religion } + add = 0.5 + } + } + if = { + limit = { + scope:defender.faith = { + has_doctrine_parameter = unreformed + } + } + multiply = 0.2 + } + if = { + limit = { + scope:defender.faith = scope:attacker.faith + } + multiply = 0.2 + } + if = { # Russian Vikings stay home + limit = { + scope:attacker = { + capital_province = { + geographical_region = world_europe_east + } + NOT = { + character_is_realm_neighbor = scope:defender + } + } + } + multiply = 0.1 + } + if = { # Norsemen should prefer their historical targets + limit = { + scope:attacker = { + OR = { + capital_province = { + geographical_region = world_europe_north + } + capital_province = { + geographical_region = world_europe_west + } + capital_province = { + geographical_region = world_europe_west_francia + } + capital_province = { + geographical_region = world_europe_west_germania + } + } + } + scope:defender = { + OR = { + capital_province = { + geographical_region = world_europe_west + } + capital_province = { + geographical_region = world_europe_west_francia + } + capital_province = { + geographical_region = world_europe_west_germania + } + } + } + } + multiply = 10 + } + if = { # Norsemen should not rush the Pope... + limit = { + scope:attacker.faith.religion = faith:norse_pagan.religion + scope:defender = { + has_title = title:k_papal_state + } + } + multiply = 0.01 + } + } + # Haesteinn needs to stop merc'ing East Francia when the resulting kingdom simply will not last. + } +} + +struggle_conquest_ai_score_value = { + value = 1 + scope:attacker = { + # Are they a different faith than me? + if = { + limit = { + faith != scope:defender.faith + } + add = 1 + } + # Are they a different culture than me? + if = { + limit = { + culture != scope:defender.culture + } + add = 1 + } + # Do I have a negative relationship with them? + if = { + limit = { has_relation_nemesis = scope:defender } + add = 2 + } + else_if = { + limit = { + has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:defender } + } + add = 1 + } + # Do I have a positive relationship with them? + if = { + limit = { + OR = { + has_relation_soulmate = scope:defender + has_relation_best_friend = scope:defender + } + } + add = -5 + } + else_if = { + limit = { + has_any_good_relationship_with_character_trigger = { CHARACTER = scope:defender } + } + add = -1 + } + } +} + +byzantium_conquests_ai_score_value = { + value = 1 + # Are we part of the Roman empire? + if = { + limit = { + scope:attacker = { + # We only care about governors and above, so don't worry about counts even if they're within the empire. + highest_held_title_tier >= tier_duchy + # Now check title ownership. + OR = { + is_roman_emperor_trigger = yes + any_liege_or_above = { + is_roman_emperor_trigger = yes + } + # Account for the 4th crusade. + ## Y'know, roughly. + AND = { + NOT = { + exists = title:e_byzantium + } + primary_title = { + tier <= tier_empire + OR = { + empire = title:e_byzantium + empire = title:e_latin_empire + } + } + OR = { + culture = { has_cultural_pillar = heritage_byzantine } + culture = culture:greek + culture = { + any_parent_culture_or_above = { + this = culture:greek + } + } + } + } + } + } + } + # Ok, cool. Now let's set some historical priorities. + every_target_title = { + title_province = { + # Constantinople is king. + if = { + limit = { county = title:c_byzantion } + add = 100 + } + ## We literally do not care about Rome: New York beats OG York, New Rome beats OG Rome. + # Next, we prioritise Anatolia. + else_if = { + limit = { geographical_region = ghw_region_anatolia } + add = 5 + } + # Then Greece and the Balkans. + else_if = { + limit = { + OR = { + geographical_region = ghw_region_greece + geographical_region = ghw_region_thessalonika + geographical_region = custom_eastern_balkans + } + } + add = 4.5 + } + # Then Syria and co. + else_if = { + limit = { geographical_region = custom_roman_syria_palestina } + add = 4 + } + # Egypt. + else_if = { + limit = { geographical_region = custom_roman_aegyptus } + add = 3.5 + } + # Mesopotamia. + else_if = { + limit = { geographical_region = custom_roman_mesopotamia } + add = 3 + } + # Illyria. + else_if = { + limit = { geographical_region = custom_roman_illyricum } + add = 2.5 + } + # North Africa. + else_if = { + limit = { + OR = { + geographical_region = custom_roman_cyrenaica + geographical_region = custom_roman_africa + geographical_region = custom_roman_mauretania + } + } + add = 2 + } + # Italy. + else_if = { + limit = { geographical_region = ghw_region_italy } + add = 1.8 + } + # Iberia. + else_if = { + limit = { geographical_region = custom_roman_hispania } + add = 1.5 + } + # The remainder. + ## Anything we missed in the east. + else_if = { + # You say "why not use Eastern Roman Empire borders?", I say, if the players are gonna obsess over historical borders then so too shall the AI. + limit = { geographical_region = custom_theodosian_ere } + add = 1 + } + ## Then total. + else_if = { + limit = { geographical_region = custom_roman_empire } + add = 0.5 + } + # And _otherwise_, we probably don't want to even look at this thing. + ## May be overridden by weird preferance combination from other values, but generally we'll hopefully get a fairly insular, naval gazing Rome. + } + } + } +} + +muslim_invasions_prefer_nonmuslims_ai_score_value = { + value = 1 + if = { + limit = { + scope:attacker.religion = religion:islam_religion + } + every_in_list = { + list = target_titles + if = { + limit = { + OR = { + AND = { + tier = tier_county + NOT = { holder.top_liege.religion = religion:islam_religion } + any_county_province = { + geographical_region = ghw_region_holy_land + } + } + AND = { + tier > tier_county + any_in_de_jure_hierarchy = { + tier = tier_county + NOT = { holder.top_liege.religion = religion:islam_religion } + any_county_province = { + geographical_region = ghw_region_holy_land + } + } + } + } + } + add = 1000 + } + else_if = { + limit = { + OR = { + AND = { + tier = tier_county + NOT = { holder.top_liege.religion = religion:islam_religion } + any_county_province = { + OR = { + geographical_region = ghw_region_anatolia + geographical_region = world_india + } + } + } + AND = { + tier > tier_county + any_in_de_jure_hierarchy = { + tier = tier_county + NOT = { holder.top_liege.religion = religion:islam_religion } + any_county_province = { + OR = { + geographical_region = ghw_region_anatolia + geographical_region = world_india + } + } + } + } + } + } + add = 200 + } + else_if = { + limit = { + OR = { + AND = { + tier = tier_county + NOT = { holder.top_liege.religion = religion:islam_religion } + } + AND = { + tier > tier_county + any_in_de_jure_hierarchy = { + tier = tier_county + NOT = { holder.top_liege.religion = religion:islam_religion } + } + } + } + } + add = 2 + } + } + } +} + +# PAM Peace of God: stays at 1 for everyone else, so it is inert. +pam_peace_of_god_coreligionist_war_ai_score_value = { + value = 1 + if = { + limit = { + exists = scope:defender + scope:defender = { faith = scope:attacker.faith } + scope:attacker = { + OR = { + AND = { + has_trait = zealous + rite ?= { rite_has_parameter = tenet_peace_of_god_coreligionist_war_reluctance } + } + has_personal_tenet_flag = tenet_peace_of_god_personal_coreligionist_war_reluctance + } + } + } + multiply = 0.15 + } +} + +zealous_war_on_head_of_faith_ai_score_value = { + value = 1 + if = { + limit = { + exists = scope:defender + scope:attacker = { + has_trait = zealous + faith.religious_head ?= scope:defender + } + } + multiply = 0.15 + } +} + +# Raid for captives +raid_for_captives_ai_score_value = { + value = 10 + scope:attacker = { + if = { + limit = { + piety < 0 + } + add = 15 + } + if = { + limit = { + ai_zeal >= medium_positive_ai_value + piety < 500 + } + add = 5 + } + if = { + limit = { + ai_zeal >= very_high_positive_ai_value + } + add = ai_zeal + } + if = { + limit = { + piety > 500 + } + multiply = 0.5 + } + if = { + limit = { + ai_zeal < 0 + NOT = { + piety < -100 + } + } + multiply = 0 + } + } +} + +# Artifact wars + +relic_artifact_war_ai_score_value = { + value = 10 + scope:attacker = { + if = { + limit = { + ai_greed > 0 + } + add = { + value = ai_greed + divide = 2 + } + } + if = { + limit = { + ai_zeal > 0 + } + add = ai_zeal + } + } +} + +artifact_war_ai_score_value = { + value = 10 + scope:attacker = { + if = { + limit = { + ai_greed > 0 + } + add = { + value = ai_greed + divide = 2 + } + } + if = { + limit = { + ai_vengefulness > 0 + } + add = ai_vengefulness + } + } +} + +chinese_consolidation_ai_score_value = { + value = 1 + scope:attacker = { + # Are they a different faith than me? + if = { + limit = { + NOT = { faith = scope:defender.faith } + } + add = 1 + } + # Are they a different culture than me? + if = { + limit = { + NOT = { culture = scope:defender.culture } + } + add = 1 + } + # Do I have a negative relationship with them? + if = { + limit = { has_relation_nemesis = scope:defender } + add = 2 + } + else_if = { + limit = { + has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:defender } + } + add = 1 + } + # Do I have a positive relationship with them? + if = { + limit = { + OR = { + has_relation_soulmate = scope:defender + has_relation_best_friend = scope:defender + } + } + add = -5 + } + else_if = { + limit = { + has_any_good_relationship_with_character_trigger = { CHARACTER = scope:defender } + } + add = -1 + } + } + +} + +############# +# Vassalization CB +############# + +vassalize_default_size = 4 + +vassalize_growth_per_innovation = 3 + +vassalization_size_limit = { + value = vassalize_default_size + scope:attacker = { + if = { + limit = { + culture = { + has_innovation = innovation_casus_belli + } + } + add = vassalize_growth_per_innovation + } + if = { + limit = { + culture = { + has_innovation = innovation_chronicle_writing + } + } + add = vassalize_growth_per_innovation + } + if = { + limit = { + culture = { + has_innovation = innovation_divine_right + } + } + add = vassalize_growth_per_innovation + } + if = { + limit = { + culture = { + has_innovation = innovation_rightful_ownership + } + } + add = vassalize_growth_per_innovation + } + } +} + +############# +# GHWs +############# +third_of_defenders_strength = { + value = ghw_defenders_strength + multiply = 0.33 +} + +############# +# Siege +############# + +siege_base_capture_chance = { + value = 35 + + # Dynasty Perk: Practiced Kidnappers + if = { + limit = { + scope:occupant = { + dynasty ?= { has_dynasty_perk = fp1_pillage_legacy_3 } + } + } + add = 20 + } + # Personal Tenet: Human Sacrifice + if = { + limit = { + scope:occupant = { + has_personal_tenet_flag = tenet_human_sacrifice_siege_capture_chance + } + } + add = 25 + } + # peasants capture and kill more nobles + if = { + limit = { + scope:occupant = { has_variable = rebel_leader_peasants } + is_lowborn = no + } + add = 20 + } + # Cultural Parameter: State Ransoms + if = { + limit = { + OR = { + # Either you're involved in large groups of the holding surrendering... + scope:barony.culture = { has_cultural_parameter = knights_die_less_but_are_captured_more } + # ... or you know your liege will pay your ransom. + scope:barony.holder.culture = { has_cultural_parameter = knights_die_less_but_are_captured_more } + } + # Ransoms or no, the primary participants & their heirs know better than to surrender. + character_is_potential_valuable_prisoner = no + # And independent characters likewise have no incentive. + top_liege != this + } + add = 50 + } +} +raid_base_capture_chance = { + value = 20 + + if = { + limit = { + exists = root.army_commander + } + # Trait: Viking + if = { + limit = { root.army_commander = { has_trait = viking } } + add = 5 + } + # Dynasty Perk: Practiced Kidnappers + if = { + limit = { + exists = root.army_commander.dynasty + root.army_commander.dynasty = { has_dynasty_perk = fp1_pillage_legacy_3 } + } + add = 20 + } + } +} + +county_control_loss_value = { + value = -40 + + # Dynasty Perk: No Quarter + if = { + limit = { + root = { + dynasty ?= { has_dynasty_perk = fp1_pillage_legacy_5 } + } + } + add = -40 + } +} + +raid_county_control_loss_value = { + value = -10 + + # Dynasty Perk: No Quarter + if = { + limit = { + scope:raider ?= { + dynasty ?= { has_dynasty_perk = fp1_pillage_legacy_5 } + } + } + add = -20 + } +} + +############# +# CB Costs +############# + + +scale_10_war_defender_win = { + value = 10 + + if = { + limit= { + scope:defender.culture = { + has_cultural_parameter = more_fame_for_successful_defensive_wars + } + } + multiply = 2 + } +} + +###################### +# AI Decision Making # +###################### + +# Compute military strength against *scope:target_military*. +# +# This script value and the one after it are to be used in combination as +# "root_military_strength_higher_than_military_target_value > target_military_strength_root_value" +# to check player vs enemy strength. +root_military_strength_higher_than_military_target_value = { + value = 0 + add = max_military_strength # Add num of troops + if = { + limit = { + any_ally = { + NOT = { has_truce = scope:target_military } + } + } + every_ally = { + limit = { + NOT = { has_truce = scope:target_military } + } + add = max_military_strength + } + } + if = { + limit = { exists = var:ai_strength_multiplier } + multiply = var:ai_strength_multiplier # 1.25 == 25% stronger than, remember to potty train your script and have it remove the variable after usage!! + } +} + +# One above calcs player strength (plus multiplier), this one is enemy strength. +target_military_strength_root_value = { + value = 0 + if = { + limit = { exists = scope:target_military } + add = scope:target_military.max_military_strength # this should be a character, probably a top liege + scope:target_military = { + every_ally = { + limit = { + NOT = { has_truce = root } + } + add = max_military_strength + } + } + } +} + +# Compute military strength against *scope:recipient*. +# +# This script value and the one after it are to be used in combination as +# "root_military_strength_higher_than_recipient_value > recipient_strength_root_value" +# to check player vs enemy strength. +root_military_strength_higher_than_recipient_value = { + value = 0 + add = max_military_strength # Add num of troops + if = { + limit = { + any_ally = { + NOT = { has_truce = scope:recipient } + } + } + every_ally = { + limit = { + NOT = { has_truce = scope:recipient } + } + add = max_military_strength + } + } + if = { + limit = { exists = var:ai_strength_multiplier } + multiply = var:ai_strength_multiplier # 1.25 == 25% stronger than, remember to potty train your script and have it remove the variable after usage!! + } +} + +# One above calcs player strength (plus multiplier), this one is enemy strength. +recipient_strength_root_value = { + value = 0 + if = { + limit = { exists = scope:recipient } + add = scope:recipient.max_military_strength # this should be a character, probably a top liege + scope:recipient = { + every_ally = { + limit = { + NOT = { has_truce = root } + } + add = max_military_strength + } + } + } +} + +war_attacker_total_strength_value = { + value = 0 + every_war_attacker = { add = max_military_strength } +} + +war_defender_total_strength_value = { + value = 0 + every_war_defender = { add = max_military_strength } +} + +war_attacker_total_strength_halved_value = { + value = war_attacker_total_strength_value + divide = 2 +} + +war_defender_total_strength_halved_value = { + value = war_defender_total_strength_value + divide = 2 +} + +war_attacker_total_strength_tenth_value = { + value = war_attacker_total_strength_value + divide = 10 +} + +war_defender_total_strength_tenth_value = { + value = war_defender_total_strength_value + divide = 10 +} + +war_attacker_total_current_strength_value = { + value = 0 + every_war_attacker = { add = current_military_strength } +} + +war_defender_total_current_strength_value = { + value = 0 + every_war_defender = { add = current_military_strength } +} + +war_attacker_total_current_strength_halved_value = { + value = war_attacker_total_current_strength_value + divide = 2 +} + +war_defender_total_current_strength_halved_value = { + value = war_defender_total_current_strength_value + divide = 2 +} + +war_attacker_total_current_strength_tenth_value = { + value = war_attacker_total_current_strength_value + divide = 10 +} + +war_defender_total_current_strength_tenth_value = { + value = war_defender_total_current_strength_value + divide = 10 +} + +war_attacker_total_current_strength_divided_by_defender_value = { + value = war_attacker_total_current_strength_value + divide = war_defender_total_current_strength_value + round = yes +} + +war_defender_total_current_strength_divided_by_attacker_value = { + value = war_defender_total_current_strength_value + divide = war_attacker_total_current_strength_value + round = yes +} + +war_total_participants_current_strength_value = { + value = 0 + every_war_participant = { add = current_military_strength } +} + +war_total_participants_max_strength_value = { + value = 0 + every_war_participant = { add = max_military_strength } +} + +total_war_attacker_strength_value = { + value = 0 + every_character_war = { + limit = { prev = primary_defender } + every_war_attacker = { add = current_military_strength } + } +} + +total_war_enemy_strength_value = { + value = 0 + every_war_enemy = { add = current_military_strength } +} + +house_relation_ai_score_value = { + value = 0 + scope:attacker.house ?= { + if = { + limit = { + scope:defender.house ?= { + NOT = { this = scope:attacker.house } + has_house_relation_with = scope:attacker.house + } + } + every_house_relation = { + limit = { + any_relation_house = { scope:defender.house ?= this } + } + if = { + limit = { has_house_relation_parameter = less_likely_war_target } + add = house_relation_less_likely_war_target_value + } + else_if = { + limit = { has_house_relation_parameter = more_likely_war_target } + add = house_relation_more_likely_war_target_value + } + } + } + } +} +house_relation_less_likely_war_target_value = -150 +house_relation_more_likely_war_target_value = 150 + +frankokratia_leader_protection_value = { + #Multiplied at the end of every ai_score_mult in all CBs for now. + + #Fourth Crusade flavor: + #We protect the Frankokratia leader to avoid breaking the story cycle. + value = 1 + if = { + limit = { + scope:defender = { + any_owned_story = { + type = frankokratia_story + NOT = { has_variable = franko_war_complete } + } + } + } + multiply = 0 + } +} + +### Overlord join probability (fixed point between 0 and 1) +# fallback value if the value is not defined in the selected casus belli. +# Uses same logic and scope as the same field defined in casus_belli. +ai_overlord_defensive_power_impact = { + value = 0.75 + + if = { + limit = { primary_title.tier = tier_hegemony } + multiply = 0 + } + else_if = { + limit = { primary_title.tier = tier_empire } + add = -0.1 + } + else_if = { + limit = { primary_title.tier = tier_kingdom } + add = -0.2 + } + else = {} +} \ No newline at end of file