1061 lines
No EOL
22 KiB
Text
1061 lines
No EOL
22 KiB
Text
##############
|
|
# 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 = {}
|
|
} |