#Scripted Modifiers used for buildings ai_general_building_modifier = { modifier = { add = -2 scope:holder.capital_province != this } modifier = { # No time, must conquer! add = -1000 scope:holder = { gold <= conqueror_safe_spending_gold has_variable = conqueror } } } ai_tier_1_building_modifier = { modifier = { # Try to build rank 1 buildings in your capital before anything else add = 20 scope:holder.capital_province = this } } ai_tier_1_economical_building_preference_modifier = { modifier = { # Economy boom AI's like economy buildings add = 5 scope:holder = { OR = { ai_has_economical_boom_personality = yes has_character_flag = ai_desire_economy_buildings } } } } ai_tier_1_pious_building_preference_modifier = { modifier = { # This building gives me piety! add = 5 scope:holder = { ai_has_pious_builder_personality = yes } } } ai_economical_building_preference_modifier = { modifier = { add = ai_economic_preference_value scope:holder = { OR = { ai_rationality >= 25 has_focus_or_focus_trait_trigger = { FOCUS = stewardship_wealth_focus } has_focus_or_focus_trait_trigger = { FOCUS = stewardship_domain_focus } monthly_character_income < monthly_character_expenses_times_three } } } } ai_pious_building_preference_modifier = { modifier = { add = ai_piety_preference_value scope:holder = { OR = { ai_zeal >= 25 ai_has_pious_builder_personality = yes monthly_character_income < monthly_character_expenses_times_three } } } } ai_skirmisher_modifier = { modifier = { add = stationed_maa_bonus has_stationed_regiment_of_base_type = skirmishers } modifier = { add = likes_maa_value scope:holder = { highest_held_title_tier >= tier_county culture ?= { OR = { has_cultural_pillar = heritage_baltic has_cultural_pillar = heritage_ugro_permian has_cultural_pillar = heritage_balto_finnic culture_has_skirmisher_maa = yes } } } } modifier = { add = really_likes_maa_value scope:holder = { highest_held_title_tier >= tier_county max_number_maa_soldiers_of_base_type = { type = skirmishers value >= 600 } } } modifier = { add = dislikes_maa_value scope:holder = { highest_held_title_tier >= tier_county OR = { number_maa_regiments_of_base_type = { type = skirmishers value <= 0 } culture ?= { OR = { has_cultural_pillar = heritage_central_germanic has_cultural_pillar = heritage_frankish has_cultural_pillar = heritage_iberian has_cultural_pillar = heritage_latin } } } } } } ai_archer_modifier = { modifier = { add = stationed_maa_bonus has_stationed_regiment_of_base_type = archers } modifier = { add = likes_maa_value scope:holder = { highest_held_title_tier >= tier_county culture ?= { OR = { has_cultural_pillar = heritage_west_germanic has_cultural_pillar = heritage_brythonic has_cultural_pillar = heritage_east_african has_cultural_pillar = heritage_indo_aryan has_cultural_pillar = heritage_dravidian has_cultural_pillar = heritage_burman has_cultural_pillar = heritage_chinese culture_has_archer_maa = yes } } } } modifier = { add = really_likes_maa_value scope:holder = { highest_held_title_tier >= tier_county max_number_maa_soldiers_of_base_type = { type = archers value >= 600 } } } modifier = { add = dislikes_maa_value scope:holder = { highest_held_title_tier >= tier_county OR = { number_maa_regiments_of_base_type = { type = archers value <= 0 } culture ?= { has_cultural_pillar = heritage_central_germanic } culture ?= { has_cultural_pillar = heritage_frankish } } } } } ai_heavy_infantry_modifier = { modifier = { add = stationed_maa_bonus has_stationed_regiment_of_base_type = heavy_infantry } modifier = { # If the holder has a preference for the MaA add = likes_maa_value scope:holder = { highest_held_title_tier >= tier_county culture ?= { OR = { has_cultural_pillar = heritage_central_germanic has_cultural_pillar = heritage_north_germanic has_cultural_pillar = heritage_west_germanic has_cultural_pillar = heritage_east_slavic culture_has_heavy_infantry_maa = yes } } } } modifier = { # If the holder really likes the MaA type and is suited for it add = really_likes_maa_value scope:holder = { highest_held_title_tier >= tier_county max_number_maa_soldiers_of_base_type = { type = heavy_infantry value >= 400 } } } modifier = { # If the holder doesn't care for the MaA type add = dislikes_maa_value scope:holder = { highest_held_title_tier >= tier_county OR = { number_maa_regiments_of_base_type = { type = heavy_infantry value <= 0 } culture ?= { has_cultural_pillar = heritage_central_germanic } culture ?= { has_cultural_pillar = heritage_latin } } } } } ai_pikemen_modifier = { modifier = { add = stationed_maa_bonus has_stationed_regiment_of_base_type = pikemen } modifier = { # If the holder has a preference for the MaA add = likes_maa_value scope:holder = { highest_held_title_tier >= tier_county culture ?= { OR = { has_cultural_pillar = heritage_central_germanic has_cultural_pillar = heritage_latin culture_has_pikemen_maa = yes } } } } modifier = { # If the holder really likes the MaA type and is suited for it add = really_likes_maa_value scope:holder = { highest_held_title_tier >= tier_county max_number_maa_soldiers_of_base_type = { type = pikemen value >= 400 } } } modifier = { # If the holder doesn't care for the MaA type add = dislikes_maa_value scope:holder = { highest_held_title_tier >= tier_county number_maa_regiments_of_base_type = { type = pikemen value <= 0 } } } } ai_light_cavalry_modifier = { modifier = { add = stationed_maa_bonus has_stationed_regiment_of_base_type = light_cavalry } modifier = { # If the holder has a preference for the MaA add = likes_maa_value scope:holder = { highest_held_title_tier >= tier_county culture ?= { OR = { has_cultural_pillar = heritage_arabic has_cultural_pillar = heritage_iranian has_cultural_pillar = heritage_berber has_cultural_pillar = heritage_iberian has_cultural_pillar = heritage_indo_aryan culture_has_light_cavalry_maa = yes } } } } modifier = { # If the holder really likes the MaA type and is suited for it add = really_likes_maa_value scope:holder = { highest_held_title_tier >= tier_county OR = { max_number_maa_soldiers_of_base_type = { type = light_cavalry value >= 400 } culture ?= { has_cultural_pillar = heritage_iranian } # Steppe cultures culture ?= { has_cultural_pillar = heritage_turkic } culture ?= { has_cultural_pillar = heritage_mongolic } } } } modifier = { # If the holder doesn't care for the MaA type add = dislikes_maa_value scope:holder = { highest_held_title_tier >= tier_county OR = { number_maa_regiments_of_base_type = { type = light_cavalry value <= 0 } culture ?= { OR = { has_cultural_pillar = heritage_central_germanic has_cultural_pillar = heritage_tibetan has_cultural_pillar = heritage_baltic has_cultural_pillar = heritage_burman has_cultural_pillar = heritage_somalian } } } } } } ai_heavy_cavalry_modifier = { modifier = { add = stationed_maa_bonus has_stationed_regiment_of_base_type = heavy_cavalry } modifier = { # If the holder has a preference for the MaA add = likes_maa_value scope:holder = { highest_held_title_tier >= tier_county culture ?= { OR = { has_cultural_pillar = heritage_central_germanic has_cultural_pillar = heritage_frankish has_cultural_pillar = heritage_indo_aryan culture_has_heavy_cavalry_maa = yes } } } } modifier = { # If the holder really likes the MaA type and is suited for it add = really_likes_maa_value scope:holder = { highest_held_title_tier >= tier_county OR = { max_number_maa_soldiers_of_base_type = { type = heavy_cavalry value >= 100 } culture ?= { has_cultural_pillar = heritage_iranian } # Steppe cultures culture ?= { has_cultural_pillar = heritage_turkic } culture ?= { has_cultural_pillar = heritage_mongolic } } } } modifier = { # If the holder doesn't care for the MaA type add = dislikes_maa_value scope:holder = { highest_held_title_tier >= tier_county OR = { number_maa_regiments_of_base_type = { type = heavy_cavalry value <= 0 } culture ?= { OR = { has_cultural_pillar = heritage_tibetan has_cultural_pillar = heritage_baltic has_cultural_pillar = heritage_south_slavic has_cultural_pillar = heritage_sahelian has_cultural_pillar = heritage_senegambian has_cultural_pillar = heritage_west_african has_cultural_pillar = heritage_yoruba has_cultural_pillar = heritage_somalian has_cultural_pillar = heritage_east_african has_cultural_pillar = heritage_burman } } } } } } ai_compensate_heavy_cavalry_modifier = { modifier = { add = compensate_conflict_maa_bonus scope:holder = { highest_held_title_tier >= tier_county culture ?= { OR = { # Likes Heavy Cavalry has_cultural_pillar = heritage_central_germanic has_cultural_pillar = heritage_frankish has_cultural_pillar = heritage_indo_aryan has_cultural_pillar = heritage_iranian has_cultural_pillar = heritage_turkic has_cultural_pillar = heritage_mongolic culture_has_heavy_cavalry_maa = yes } OR = { # Dislikes Light Cavalry has_cultural_pillar = heritage_central_germanic has_cultural_pillar = heritage_tibetan has_cultural_pillar = heritage_baltic has_cultural_pillar = heritage_burman has_cultural_pillar = heritage_somalian } } } } } ai_compensate_light_cavalry_modifier = { modifier = { add = compensate_conflict_maa_bonus scope:holder = { highest_held_title_tier >= tier_county culture ?= { OR = { # Likes Light Cavalry has_cultural_pillar = heritage_arabic has_cultural_pillar = heritage_berber has_cultural_pillar = heritage_iberian has_cultural_pillar = heritage_indo_aryan has_cultural_pillar = heritage_iranian has_cultural_pillar = heritage_turkic has_cultural_pillar = heritage_mongolic culture_has_light_cavalry_maa = yes } OR = { # Dislikes Heavy Cavalry has_cultural_pillar = heritage_tibetan has_cultural_pillar = heritage_baltic has_cultural_pillar = heritage_south_slavic has_cultural_pillar = heritage_sahelian has_cultural_pillar = heritage_senegambian has_cultural_pillar = heritage_west_african has_cultural_pillar = heritage_yoruba has_cultural_pillar = heritage_somalian has_cultural_pillar = heritage_east_african has_cultural_pillar = heritage_burman } } } } } ai_archer_cavalry_modifier = { modifier = { add = stationed_maa_bonus has_stationed_regiment_of_base_type = archer_cavalry } modifier = { # If the holder has a preference for the MaA add = likes_maa_value scope:holder = { highest_held_title_tier >= tier_county OR = { # Steppe cultures culture ?= { has_cultural_pillar = heritage_turkic } culture ?= { has_cultural_pillar = heritage_mongolic } } } } modifier = { # If the holder really likes the MaA type and is suited for it add = really_likes_maa_value scope:holder = { highest_held_title_tier >= tier_county OR = { max_number_maa_soldiers_of_base_type = { type = archer_cavalry value >= 400 } # Steppe cultures culture ?= { has_cultural_pillar = heritage_turkic } culture ?= { has_cultural_pillar = heritage_mongolic } } } } modifier = { # If the holder doesn't care for the MaA type add = dislikes_maa_value scope:holder = { highest_held_title_tier >= tier_county number_maa_regiments_of_base_type = { type = archer_cavalry value <= 0 } } } } ai_camels_modifier = { modifier = { add = stationed_maa_bonus has_stationed_regiment_of_base_type = camel_cavalry } modifier = { # If the holder has a preference for the MaA add = likes_maa_value scope:holder = { highest_held_title_tier >= tier_county OR = { culture = { has_cultural_pillar = heritage_arabic } culture = { has_cultural_pillar = heritage_berber } } } } modifier = { # If the holder really likes the MaA type and is suited for it add = really_likes_maa_value scope:holder = { highest_held_title_tier >= tier_county OR = { max_number_maa_soldiers_of_base_type = { type = camel_cavalry value >= 400 } culture = { has_cultural_pillar = heritage_arabic } culture = { has_cultural_pillar = heritage_berber } } } } modifier = { # If the holder doesn't care for the MaA type add = dislikes_maa_value scope:holder = { highest_held_title_tier >= tier_county number_maa_regiments_of_base_type = { type = camel_cavalry value <= 0 } } } } ai_elephants_modifier = { modifier = { add = stationed_maa_bonus has_stationed_regiment_of_base_type = elephant_cavalry } modifier = { # If the holder has a preference for the MaA add = likes_maa_value scope:holder = { highest_held_title_tier >= tier_county culture = { OR = { has_cultural_pillar = heritage_dravidian has_cultural_pillar = heritage_indo_aryan has_cultural_pillar = heritage_burman } } } } modifier = { # If the holder really likes the MaA type and is suited for it add = really_likes_maa_value scope:holder = { highest_held_title_tier >= tier_county OR = { max_number_maa_soldiers_of_base_type = { type = elephant_cavalry value >= 100 } culture = { has_cultural_pillar = heritage_dravidian } culture = { has_cultural_pillar = heritage_indo_aryan } culture = { has_cultural_pillar = heritage_burman } } } } modifier = { # If the holder doesn't care for the MaA type add = dislikes_maa_value scope:holder = { highest_held_title_tier >= tier_county number_maa_regiments_of_base_type = { type = elephant_cavalry value <= 0 } } } } ai_stacking_bonus_military_camps_modifier = { modifier = { add = stacking_bonus_value has_building_or_higher = military_camps_01 scope:holder = { OR = { max_number_maa_soldiers_of_base_type = { type = skirmishers value >= 200 } max_number_maa_soldiers_of_base_type = { type = archers value >= 200 } } } } } ai_stacking_bonus_smiths_modifier = { modifier = { add = stacking_bonus_value has_building_or_higher = smiths_01 scope:holder = { OR = { max_number_maa_soldiers_of_base_type = { type = heavy_infantry value >= 200 } max_number_maa_soldiers_of_base_type = { type = pikemen value >= 200 } } } } } ai_stacking_bonus_stables_modifier = { modifier = { add = stacking_bonus_value has_building_or_higher = stables_01 scope:holder = { OR = { max_number_maa_soldiers_of_base_type = { type = heavy_cavalry value >= 50 } max_number_maa_soldiers_of_base_type = { type = light_cavalry value >= 200 } } } } } ai_stacking_bonus_horse_pastures_modifier = { modifier = { add = stacking_bonus_value has_building_or_higher = horse_pastures_01 scope:holder = { OR = { max_number_maa_soldiers_of_base_type = { type = archer_cavalry value >= 200 } max_number_maa_soldiers_of_base_type = { type = light_cavalry value >= 200 } } } } } ai_stacking_bonus_hillside_grazing_modifier = { modifier = { add = stacking_bonus_value has_building_or_higher = hillside_grazing_01 scope:holder = { OR = { max_number_maa_soldiers_of_base_type = { type = archer_cavalry value >= 200 } max_number_maa_soldiers_of_base_type = { type = light_cavalry value >= 200 } max_number_maa_soldiers_of_base_type = { type = heavy_cavalry value >= 50 } } } } } ai_stacking_bonus_warrior_lodges_modifier = { modifier = { add = stacking_bonus_value has_building_or_higher = warrior_lodges_01 scope:holder = { OR = { max_number_maa_soldiers_of_base_type = { type = skirmishers value >= 200 } max_number_maa_soldiers_of_base_type = { type = heavy_infantry value >= 200 } max_number_maa_soldiers_of_base_type = { type = pikemen value >= 200 } } } } } ai_stacking_bonus_wind_furnaces_modifier = { modifier = { add = stacking_bonus_value has_building_or_higher = wind_furnace_01 scope:holder = { OR = { max_number_maa_soldiers_of_base_type = { type = pikemen value >= 200 } max_number_maa_soldiers_of_base_type = { type = heavy_infantry value >= 200 } max_number_maa_soldiers_of_base_type = { type = heavy_cavalry value >= 200 } } } } } ai_stacking_bonus_outposts_modifier = { modifier = { add = stacking_bonus_value has_building_or_higher = outposts_01 scope:holder = { OR = { max_number_maa_soldiers_of_base_type = { type = skirmishers value >= 200 } max_number_maa_soldiers_of_base_type = { type = archers value >= 200 } } } } } ai_stacking_bonus_camel_farms_modifier = { modifier = { add = stacking_bonus_value has_building_or_higher = camel_farms_01 scope:holder = { OR = { max_number_maa_soldiers_of_base_type = { type = light_cavalry value >= 200 } max_number_maa_soldiers_of_base_type = { type = camel_cavalry value >= 200 } } } } } ai_stacking_bonus_elephant_pens_modifier = { modifier = { add = stacking_bonus_value has_building_or_higher = elephant_pens_01 scope:holder = { max_number_maa_soldiers_of_base_type = { type = elephant_cavalry value >= 50 } } } } ai_anti_synergy_cavalry_modifier = { modifier = { add = anti_synergy_penalty_value OR = { #has_building_or_higher = camel_farms_01 # Economy building technically has_building_or_higher = horse_pastures_01 has_building_or_higher = hillside_grazing_01 has_building_or_higher = stables_01 has_building_or_higher = jousting_lists_01 } } } ai_anti_synergy_armored_infantry_modifier = { modifier = { add = anti_synergy_penalty_value OR = { has_building_or_higher = smiths_01 has_building_or_higher = blacksmiths_01 has_building_or_higher = warrior_lodges_01 } } } ai_anti_synergy_light_infantry_modifier = { modifier = { add = anti_synergy_penalty_value OR = { has_building_or_higher = military_camps_01 has_building_or_higher = outposts_01 has_building_or_higher = archery_ranges_01 } } } ## Cultural Modifiers culture_likely_to_fortify_modifier = { modifier = { factor = 5 scope:holder.culture ?= { has_cultural_parameter = ai_more_likely_to_fortify } } } ai_tradeport_improvement_from_culture_modifier = { modifier = { add = { value = 0 if = { limit = { scope:holder.culture = { has_cultural_parameter = trade_ports_give_levies } } add = 2 } if = { limit = { scope:holder.culture = { has_cultural_parameter = trade_ports_give_control_growth } } add = 2 } if = { limit = { scope:holder.culture = { has_cultural_parameter = next_level_trade_ports } } add = 1 } } } } ai_pasture_improvement_from_culture_modifier = { modifier = { add = { value = 0 if = { limit = { scope:holder.culture ?= { has_cultural_parameter = pastures_building_bonuses } } add = 2 } if = { limit = { is_coastal = yes scope:holder.culture ?= { has_cultural_parameter = coastal_agriculture_building_bonuses } } add = 2 } } } } ai_hunting_grounds_improvement_from_culture_modifier = { modifier = { add = { value = 0 if = { limit = { scope:holder.culture ?= { has_cultural_parameter = hunting_archery_building_bonuses } } add = 2 } } } } ai_orchard_improvement_from_culture_modifier = { modifier = { add = { value = 0 if = { limit = { scope:holder.culture ?= { has_cultural_parameter = coastal_agriculture_building_bonuses } } add = 2 } } } } ai_farm_estate_improvement_from_culture_modifier = { modifier = { add = { value = 0 if = { limit = { scope:holder.culture = { has_cultural_parameter = coastal_agriculture_building_bonuses } } add = 2 } if = { limit = { OR = { # more productive building than the alternatives for this terrain type terrain = jungle terrain = hills } scope:holder.culture = { # holder's culture, not province's has_cultural_parameter = rice_cultivators_can_construct_paddy_fields_in_hills_and_jungle } } add = 2 } } } } ai_paddy_fields_improvement_from_culture_modifier = { modifier = { add = { value = 0 if = { limit = { OR = { terrain = terraced_hills terrain = wetlands } culture = { # province's culture, not holder's has_cultural_parameter = champa_rice_building_bonuses } } add = 4 } if = { limit = { OR = { # more productive building than the alternatives for this terrain type terrain = jungle terrain = hills } scope:holder.culture = { # holder's culture, not province's has_cultural_parameter = rice_cultivators_can_construct_paddy_fields_in_hills_and_jungle } } add = 2 } } } } ai_cereal_fields_improvement_from_culture_modifier = { modifier = { add = { value = 0 if = { limit = { scope:holder.culture ?= { has_cultural_parameter = coastal_agriculture_building_bonuses } } add = 2 } } } } ai_outposts_improvement_from_culture_modifier = { modifier = { add = { value = 0 if = { limit = { scope:holder.culture = { has_cultural_parameter = outposts_building_bonuses } } add = 2 } } } } ai_barracks_improvement_from_culture_modifier = { modifier = { add = { value = 0 if = { limit = { scope:holder.culture = { has_cultural_parameter = building_barracks_piety_bonuses } } add = 2 } } } } ai_logging_camp_improvement_from_culture_modifier = { modifier = { add = { value = 0 if = { limit = { scope:holder.culture ?= { has_cultural_parameter = logging_camps_building_bonuses } } add = 2 } } } } ai_peat_quarries_improvement_from_culture_modifier = { modifier = { add = { value = 0 if = { limit = { scope:holder.culture ?= { has_cultural_parameter = logging_camps_building_bonuses } } add = 2 } if = { limit = { scope:holder.culture ?= { has_cultural_parameter = peat_quarries_building_bonuses } } add = 2 } } } } ai_hill_farms_improvement_from_culture_modifier = { modifier = { add = { value = 0 if = { limit = { scope:holder.culture ?= { has_cultural_parameter = hill_farms_building_bonuses } } add = 2 } } } } ai_elephant_pens_improvement_from_culture_modifier = { modifier = { add = { value = 0 if = { limit = { scope:holder.culture = { has_cultural_parameter = elephant_pens_building_bonuses } } add = 2 } } } } ai_plantations_improvement_from_culture_modifier = { modifier = { add = { value = 0 if = { limit = { scope:holder.culture ?= { has_cultural_parameter = plantations_building_bonuses } } add = 2 } } } } ai_quarries_improvement_from_culture_modifier = { modifier = { add = { value = 0 if = { limit = { scope:holder.culture ?= { has_cultural_parameter = quarries_building_bonuses } } add = 2 } } } } directive_to_fortify_modifier = { modifier = { add = 10 scope:holder = { has_character_flag = vassal_directive_building_focus_fortification vassal_is_valid_and_follows_directive_trigger = { VASSAL = this LIEGE = liege } } } } directive_to_build_military_modifier = { modifier = { add = 10 scope:holder = { has_character_flag = vassal_directive_building_focus_military vassal_is_valid_and_follows_directive_trigger = { VASSAL = this LIEGE = liege } } } } directive_to_build_economy_modifier = { modifier = { add = 10 scope:holder = { has_character_flag = vassal_directive_building_focus_economy vassal_is_valid_and_follows_directive_trigger = { VASSAL = this LIEGE = liege } } } }