From e9011611486c75ed22f0c067f008c842a232ecca Mon Sep 17 00:00:00 2001 From: Fishedotjpg Date: Thu, 3 Dec 2026 13:24:42 +0000 Subject: [PATCH] CBs done --- .../00_casus_belli_groups.txt | 4 +- .../_casus_belli_groups.info | 81 + common/casus_belli_types/00_claim.txt | 11 +- common/casus_belli_types/00_conquest.txt | 93 +- common/casus_belli_types/00_dejure_war.txt | 28 +- common/casus_belli_types/00_invasion_war.txt | 87 +- common/casus_belli_types/00_religious_war.txt | 591 +- common/casus_belli_types/00_subjugation.txt | 86 +- common/casus_belli_types/06_ce1_wars.txt | 16 +- common/casus_belli_types/07_ep3_admin_cbs.txt | 138 +- .../casus_belli_types/10_tgp_china_wars.txt | 8 +- .../casus_belli_types/10_tgp_japan_wars.txt | 5146 ++++++++--------- 12 files changed, 2813 insertions(+), 3476 deletions(-) create mode 100644 common/casus_belli_groups/_casus_belli_groups.info diff --git a/common/casus_belli_groups/00_casus_belli_groups.txt b/common/casus_belli_groups/00_casus_belli_groups.txt index fa609fe98..0a7b4f3cb 100644 --- a/common/casus_belli_groups/00_casus_belli_groups.txt +++ b/common/casus_belli_groups/00_casus_belli_groups.txt @@ -8,7 +8,7 @@ count = all } } - faith ?= { + faith = { NOR = { has_doctrine_parameter = unreformed # Unreformed Pagans cannot Holy War AND = { @@ -37,7 +37,7 @@ religious_disorganised = { count = all } } - faith ?= { + faith = { NOT = { has_doctrine_parameter = holy_wars_forbidden } # Pacifists cannot Holy War } herders_and_tributary_constraints = yes diff --git a/common/casus_belli_groups/_casus_belli_groups.info b/common/casus_belli_groups/_casus_belli_groups.info new file mode 100644 index 000000000..60eb5411b --- /dev/null +++ b/common/casus_belli_groups/_casus_belli_groups.info @@ -0,0 +1,81 @@ +### Brief: key ( database key ) +# Name of 'casus_belli_group' +# A group that casus belli types belong to through their 'group' field (see ../casus_belli_types/_casus_belli.info). +# The group adds restrictions and flags shared by every casus belli in it. +# The groups 'religious' and 'de_jure' are referenced by code and must exist: +# religious: used to find holy wars (e.g. counting the holy wars of a faith) +# de_jure: skipped in one of the AI casus belli searches, since de jure targets are handled separately +# +key = { + ### Brief: allowed_for_character ( optional trigger ) + # Must be true for the attacker to use any casus belli in this group. + # Evaluated together with, and before, the casus belli type's own 'allowed_for_character'. + # Also re-checked when the primary attacker of an ongoing war changes. + # Default: empty (always true) + # + # Supported scopes: + # root ( character ): the attacker + # scope:attacker ( character ) + # scope:defender ( character ): may be unset depending on how the trigger is tested + # list target_titles ( landed titles ): only set when the targeted titles are known + # + allowed_for_character = { + + } + + ### Brief: allowed_for_character_display_regardless ( optional trigger ) + # Like 'allowed_for_character', but failing it does not hide the group's casus bellis + # from the declare war interface. They are still listed, with this trigger's failure shown as the reason. + # Must be true for the attacker to actually use any casus belli in this group, including for the AI. + # Evaluated after the casus belli type's own 'allowed_for_character', + # and before its 'allowed_for_character_display_regardless'. + # Also re-checked when the primary attacker of an ongoing war changes. + # Default: empty (always true) + # + # Supported scopes: same as 'allowed_for_character' + # + allowed_for_character_display_regardless = { + + } + + ### Brief: should_invalidate ( optional trigger ) + # Checked for ongoing wars using a casus belli of this group. If true, the war is invalidated. + # Evaluated before the casus belli type's own 'should_invalidate'; either being true invalidates the war. + # Default: empty (never invalidates) + # + # Supported scopes: + # root ( casus belli ): the war's casus belli + # scope:attacker ( character ): the primary attacker + # scope:defender ( character ): the primary defender + # scope:claimant ( character ): may be unset + # scope:war ( war ) + # list target_titles ( landed titles ) + # list attackers ( characters ): all attackers, including the primary attacker + # list defenders ( characters ): all defenders, including the primary defender + # + should_invalidate = { + + } + + ### Brief: can_only_start_via_script ( optional bool ) + # If yes, casus bellis in this group are never offered in the declare war interface nor used by the AI, + # and can only be started from script. + # Default: no + # + can_only_start_via_script = yes/no + + ### Brief: should_check_for_interface_availability ( optional bool ) + # If no, casus bellis in this group are skipped when the interface checks whether any casus belli + # is available against a character. + # Does not affect the AI or the war declaration logic itself. + # Default: yes + # + should_check_for_interface_availability = yes/no + + ### Brief: debug ( optional bool ) + # Marks the group as a debug/test group. The AI never picks casus bellis from it when looking for wars. + # Does not hide the casus bellis from players. + # Default: no + # + debug = yes/no +} diff --git a/common/casus_belli_types/00_claim.txt b/common/casus_belli_types/00_claim.txt index 1705f82fd..b76dfa054 100644 --- a/common/casus_belli_types/00_claim.txt +++ b/common/casus_belli_types/00_claim.txt @@ -194,7 +194,7 @@ has_realm_law = camp_purpose_legitimists } } - #tgp_japan_offensive_wars_ban_trigger = yes + tgp_japan_offensive_wars_ban_trigger = yes } cost = { @@ -276,7 +276,6 @@ this = scope:attacker is_vassal_or_below_of = scope:attacker is_courtier_of = scope:attacker - #tgp_is_any_minister = yes } } } @@ -317,7 +316,7 @@ on_victory_aggressive_war_effect = yes pam_notify_claim_war_instigator_effect_win = yes - #gg_claim_unites_pope_and_emperor_tooltip_effect = yes + gg_claim_unites_pope_and_emperor_tooltip_effect = yes #Grab the higher title tier ordered_in_list = { @@ -663,8 +662,8 @@ } multiply = 0.4 } - multiply = pam_peace_of_god_coreligionist_war_ai_score_value - multiply = zealous_war_on_head_of_faith_ai_score_value - add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing + + multiply = aggressive_cb_ai_score_mult + multiply = common_cb_ai_score_mult } } diff --git a/common/casus_belli_types/00_conquest.txt b/common/casus_belli_types/00_conquest.txt index 1f95d6f7b..9d14ec5af 100644 --- a/common/casus_belli_types/00_conquest.txt +++ b/common/casus_belli_types/00_conquest.txt @@ -43,26 +43,9 @@ ai_score_mult = { value = viking_conquest_ai_score_value - # As a feudal gov, do not attack owner of tribal holdings if you have a tribal holding to convert already - add = { - every_in_list = { - list = target_titles - if = { - limit = { feudal_clan_tribal_conquest_constraints = yes } - add = -1000 - } - } - } - # HOUSE RELATIONS - add = house_relation_ai_score_value - # AI in struggles act insularly for wars that don't have a familial or legal basis. - multiply = struggle_wars_prioritise_struggle_targets_value - # Tell the Romans to stop going adventuring into the steppe for no gods-damned reason. - multiply = byzantium_conquests_ai_score_value - - multiply = pam_peace_of_god_coreligionist_war_ai_score_value - multiply = zealous_war_on_head_of_faith_ai_score_value - add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing + add = common_cb_ai_score_mult_additive + multiply = aggressive_cb_ai_score_mult + multiply = common_cb_ai_score_mult } valid_to_start = { @@ -273,37 +256,7 @@ duchy_conquest_cb = { prestige_level > -1 } trigger_else = { - trigger_if = { - limit = { - government_has_flag = government_is_clan - house ?= { - has_house_unity_stage = antagonistic - } - culture ?= { - has_cultural_parameter = cb_lower_prestige_level_requirement - } - } - prestige_level >= 1 - } - trigger_else_if = { - limit = { - OR = { - AND = { - government_has_flag = government_is_clan - house ?= { - has_house_unity_stage = antagonistic - } - } - culture ?= { - has_cultural_parameter = cb_lower_prestige_level_requirement - } - } - } - prestige_level >= 2 - } - trigger_else = { - prestige_level >= 3 - } + has_required_prestige_level_to_declare_war = { LEVEL = 3 } } # Struggle constraint @@ -332,27 +285,9 @@ duchy_conquest_cb = { ai_score_mult = { value = viking_conquest_ai_score_value - # As a feudal gov, do not attack tribal - add = { - every_in_list = { - list = target_titles - if = { - limit = { feudal_clan_tribal_conquest_constraints = yes } - add = -1000 - } - } - } - # HOUSE RELATIONS - add = house_relation_ai_score_value - # AI in struggles act insularly for wars that don't have a familial or legal basis. - multiply = struggle_wars_prioritise_struggle_targets_value - # Tell the Romans to stop going adventuring into the steppe for no gods-damned reason. - multiply = byzantium_conquests_ai_score_value - multiply = muslim_invasions_prefer_nonmuslims_ai_score_value - - multiply = pam_peace_of_god_coreligionist_war_ai_score_value - multiply = zealous_war_on_head_of_faith_ai_score_value - add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing + add = common_cb_ai_score_mult_additive + multiply = aggressive_cb_ai_score_mult + multiply = common_cb_ai_score_mult } valid_to_start = { @@ -837,9 +772,10 @@ ducal_conquest_cb = { ai_score_mult = { value = 1 - multiply = pam_peace_of_god_coreligionist_war_ai_score_value - multiply = zealous_war_on_head_of_faith_ai_score_value - add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing + + add = common_cb_ai_score_mult_additive + multiply = aggressive_cb_ai_score_mult + multiply = common_cb_ai_score_mult } } @@ -1096,8 +1032,9 @@ ireland_laudabiliter_conquest_cb = { ai_score_mult = { value = 1 - multiply = pam_peace_of_god_coreligionist_war_ai_score_value - multiply = zealous_war_on_head_of_faith_ai_score_value - add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing + + add = common_cb_ai_score_mult_additive + multiply = aggressive_cb_ai_score_mult + multiply = common_cb_ai_score_mult } } diff --git a/common/casus_belli_types/00_dejure_war.txt b/common/casus_belli_types/00_dejure_war.txt index 9751fa606..f7488ff03 100644 --- a/common/casus_belli_types/00_dejure_war.txt +++ b/common/casus_belli_types/00_dejure_war.txt @@ -5,7 +5,7 @@ allowed_for_character = { scope:attacker = { - culture ?= { + culture = { has_innovation = innovation_divine_right } NOR = { @@ -253,9 +253,11 @@ ai_score_mult = { value = 1 - multiply = pam_peace_of_god_coreligionist_war_ai_score_value - multiply = zealous_war_on_head_of_faith_ai_score_value - add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing + + + add = common_cb_ai_score_mult_additive + multiply = aggressive_cb_ai_score_mult + multiply = common_cb_ai_score_mult } } @@ -269,7 +271,7 @@ individual_county_de_jure_cb = { allowed_for_character = { scope:attacker = { - culture ?= { + culture = { has_innovation = innovation_casus_belli } NOT = { government_has_flag = government_is_nomadic } @@ -534,9 +536,10 @@ individual_county_de_jure_cb = { ai_score_mult = { value = 1 - multiply = pam_peace_of_god_coreligionist_war_ai_score_value - multiply = zealous_war_on_head_of_faith_ai_score_value - add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing + + add = common_cb_ai_score_mult_additive + multiply = aggressive_cb_ai_score_mult + multiply = common_cb_ai_score_mult } } @@ -551,7 +554,7 @@ individual_duchy_de_jure_cb = { allowed_for_character = { scope:attacker = { - culture ?= { + culture = { has_innovation = innovation_casus_belli } NOT = { government_has_flag = government_is_nomadic } @@ -829,9 +832,10 @@ individual_duchy_de_jure_cb = { ai_score_mult = { value = 1 - multiply = pam_peace_of_god_coreligionist_war_ai_score_value - multiply = zealous_war_on_head_of_faith_ai_score_value - add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing + + add = common_cb_ai_score_mult_additive + multiply = aggressive_cb_ai_score_mult + multiply = common_cb_ai_score_mult } } diff --git a/common/casus_belli_types/00_invasion_war.txt b/common/casus_belli_types/00_invasion_war.txt index 30b95a24b..02f1cac22 100644 --- a/common/casus_belli_types/00_invasion_war.txt +++ b/common/casus_belli_types/00_invasion_war.txt @@ -11,7 +11,7 @@ OR = { government_has_flag = government_is_tribal government_has_flag = government_is_nomadic - rite ?= { + rite = { rite_has_parameter = invasion_cb_enabled } has_character_flag = bp2_inspired_culture_for_conquest @@ -35,27 +35,10 @@ limit = { has_character_flag = bp2_inspired_culture_for_conquest } - culture ?= { - has_cultural_parameter = cb_lower_prestige_level_requirement - } - ai_should_get_extreme_conqueror_bonuses = no + prestige_level >= 0 } - prestige_level >= 2 - } - trigger_else_if = { - limit = { - OR = { - AND = { - government_has_flag = government_is_clan - house ?= { - has_house_unity_stage = antagonistic - } - } - culture ?= { - has_cultural_parameter = cb_lower_prestige_level_requirement - } - } - ai_should_get_extreme_conqueror_bonuses = no + trigger_else = { + has_required_prestige_level_to_declare_war = { LEVEL = 4 } } } @@ -79,17 +62,10 @@ } ai_score_mult = { value = viking_conquest_ai_score_value - # HOUSE RELATIONS - add = house_relation_ai_score_value - # AI in struggles act insularly for wars that don't have a familial or legal basis. - multiply = struggle_wars_prioritise_struggle_targets_value - # Tell the Romans to stop going adventuring into the steppe for no gods-damned reason. - multiply = byzantium_conquests_ai_score_value - multiply = muslim_invasions_prefer_nonmuslims_ai_score_value - - multiply = pam_peace_of_god_coreligionist_war_ai_score_value - multiply = zealous_war_on_head_of_faith_ai_score_value - add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing + + add = common_cb_ai_score_mult_additive + multiply = aggressive_cb_ai_score_mult + multiply = common_cb_ai_score_mult } valid_to_start = { @@ -361,37 +337,7 @@ clan_invasion_war = { } allowed_for_character_display_regardless = { - trigger_if = { - limit = { - government_has_flag = government_is_clan - house ?= { - has_house_unity_stage = antagonistic - } - culture ?= { - has_cultural_parameter = cb_lower_prestige_level_requirement - } - } - prestige_level >= 2 - } - trigger_else_if = { - limit = { - OR = { - AND = { - government_has_flag = government_is_clan - house ?= { - has_house_unity_stage = antagonistic - } - } - culture ?= { - has_cultural_parameter = cb_lower_prestige_level_requirement - } - } - } - prestige_level >= 3 - } - trigger_else = { - prestige_level >= 4 - } + has_required_prestige_level_to_declare_war = { LEVEL = 4 } custom_tooltip = { text = struggle_involvement_cb_check_failure @@ -411,17 +357,10 @@ clan_invasion_war = { ai_score_mult = { value = 1 - # HOUSE RELATIONS - add = house_relation_ai_score_value - # AI in struggles act insularly for wars that don't have a familial or legal basis. - multiply = struggle_wars_prioritise_struggle_targets_value - # Tell the Romans to stop going adventuring into the steppe for no gods-damned reason. - multiply = byzantium_conquests_ai_score_value - multiply = muslim_invasions_prefer_nonmuslims_ai_score_value - - multiply = pam_peace_of_god_coreligionist_war_ai_score_value - multiply = zealous_war_on_head_of_faith_ai_score_value - add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing + + add = common_cb_ai_score_mult_additive + multiply = aggressive_cb_ai_score_mult + multiply = common_cb_ai_score_mult } valid_to_start = { diff --git a/common/casus_belli_types/00_religious_war.txt b/common/casus_belli_types/00_religious_war.txt index c03510dbd..a11fa8e5d 100644 --- a/common/casus_belli_types/00_religious_war.txt +++ b/common/casus_belli_types/00_religious_war.txt @@ -18,7 +18,7 @@ # Already defined in 00_casus_belli_groups.txt allowed_for_character = { - scope:attacker.faith ?= { + scope:attacker.faith = { NOT = { has_doctrine_parameter = unreformed } NOT = { has_doctrine_parameter = holy_wars_forbidden } } @@ -45,58 +45,7 @@ NOT = { piety_level = -1 } } trigger_else = { - trigger_if = { - limit = { - is_alive = yes - has_variable_list = humsacd_hofs - is_target_in_variable_list = { - name = humsacd_hofs - target = scope:attacker.faith - } - } - trigger_if = { - limit = { - OR = { - culture ?= { - has_cultural_parameter = cb_lower_piety_level_requirement - } - # Iberian Struggle Hostility Reward - house ?= { - OR = { - has_house_modifier = fp2_struggle_hostility_house_faith_modifier - has_house_modifier = fp2_struggle_hostility_house_combined_modifier - } - } - } - } - piety_level >= 0 - } - trigger_else = { - piety_level >= 0 - } - } - trigger_else = { - trigger_if = { - limit = { - OR = { - culture ?= { - has_cultural_parameter = cb_lower_piety_level_requirement - } - # Iberian Struggle Hostility Reward - house ?= { - OR = { - has_house_modifier = fp2_struggle_hostility_house_faith_modifier - has_house_modifier = fp2_struggle_hostility_house_combined_modifier - } - } - } - } - piety_level >= 0 - } - trigger_else = { - piety_level >= 1 - } - } + has_required_piety_level_to_declare_war = { LEVEL = 2 } } } } @@ -172,7 +121,10 @@ ai_score_mult = { value = 1 - add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing + add = common_cb_ai_score_mult_additive + multiply = religious_cb_ai_score_mult + multiply = aggressive_cb_ai_score_mult + multiply = common_cb_ai_score_mult } cost = { @@ -202,7 +154,7 @@ first_valid = { triggered_desc = { trigger = { - scope:attacker.rite ?= { + scope:attacker.rite = { rite_has_doctrine = doctrine_pluralism_pluralistic } } @@ -266,22 +218,7 @@ } # Piety Progress for the Attacker - every_in_list = { - list = target_titles - scope:attacker = { - add_piety_experience = { - add = religious_cb_piety_gain_county - if = { - limit = { - scope:attacker.faith ?= { - has_doctrine_parameter = bonus_holy_war_piety_active - } - } - multiply = 1.5 - } - } - } - } + scope:attacker = { add_piety_for_war_effect = { TYPE = piety_experience } } ordered_in_list = { list = target_titles @@ -291,13 +228,13 @@ save_scope_as = war_goal_title } - scope:attacker.faith ?= { + scope:attacker.faith = { change_fervor = { value = trivial_fervor_gain desc = fervor_loss_religious_war } } - scope:defender.faith ?= { + scope:defender.faith = { change_fervor = { value = modest_fervor_gain desc = fervor_gain_religious_war @@ -361,44 +298,7 @@ } # piety change - every_in_list = { - list = target_titles - - scope:defender = { - add_piety = { - add = religious_cb_piety_gain_county - if = { - limit = { - scope:defender.faith ?= { - has_doctrine_parameter = bonus_holy_war_piety_active - } - } - multiply = 1.5 - } - } - } - - #scope:attacker = { - #if = { - #limit = { - #monthly_character_income > 0 - #} - #pay_short_term_income = { - #years = 2 - #target = scope:defender - #} - #} - #else = { - #pay_short_term_gold = { - #target = scope:defender - #gold = medium_gold_value - #} - #} - #} - } - - # Truce - add_truce_attacker_defeat_effect = yes + scope:defender = { add_piety_for_war_effect = { TYPE = piety } } scope:attacker = { pay_short_term_gold_reparations_effect = { @@ -452,8 +352,8 @@ religious_war = { # Additional requirements to the defines in 00_casus_belli_groups.txt allowed_for_character = { - scope:attacker.faith ?= { - NOR = { + scope:attacker.faith = { + NOR = { has_doctrine_parameter = unreformed has_doctrine_parameter = holy_wars_forbidden } @@ -481,58 +381,7 @@ religious_war = { NOT = { piety_level = -1 } } trigger_else = { - trigger_if = { - limit = { - is_alive = yes - has_variable_list = humsacd_hofs - is_target_in_variable_list = { - name = humsacd_hofs - target = scope:attacker.faith - } - } - trigger_if = { - limit = { - OR = { - culture ?= { - has_cultural_parameter = cb_lower_piety_level_requirement - } - # Iberian Struggle Hostility Reward - house ?= { - OR = { - has_house_modifier = fp2_struggle_hostility_house_faith_modifier - has_house_modifier = fp2_struggle_hostility_house_combined_modifier - } - } - } - } - piety_level >= 0 - } - trigger_else = { - piety_level >= 1 - } - } - trigger_else = { - trigger_if = { - limit = { - OR = { - culture ?= { - has_cultural_parameter = cb_lower_piety_level_requirement - } - # Iberian Struggle Hostility Reward - house ?= { - OR = { - has_house_modifier = fp2_struggle_hostility_house_faith_modifier - has_house_modifier = fp2_struggle_hostility_house_combined_modifier - } - } - } - } - piety_level >= 1 - } - trigger_else = { - piety_level >= 2 - } - } + has_required_piety_level_to_declare_war = { LEVEL = 2 } } } } @@ -674,7 +523,7 @@ religious_war = { first_valid = { triggered_desc = { trigger = { - scope:attacker.rite ?= { + scope:attacker.rite = { rite_has_doctrine = doctrine_pluralism_pluralistic } } @@ -737,22 +586,7 @@ religious_war = { } # Piety Progress for the Attacker - every_in_list = { - list = target_titles - scope:attacker = { - add_piety_experience = { - add = religious_cb_piety_gain_duchy - if = { - limit = { - scope:attacker.faith ?= { - has_doctrine_parameter = bonus_holy_war_piety_active - } - } - multiply = 1.5 - } - } - } - } + scope:attacker = { add_piety_for_war_effect = { TYPE = piety_experience } } ordered_in_list = { list = target_titles @@ -762,13 +596,13 @@ religious_war = { save_scope_as = war_goal_title } - scope:attacker.faith ?= { + scope:attacker.faith = { change_fervor = { value = small_fervor_gain desc = fervor_loss_religious_war } } - scope:defender.faith ?= { + scope:defender.faith = { change_fervor = { value = slight_fervor_gain desc = fervor_gain_religious_war @@ -824,24 +658,8 @@ religious_war = { } # piety change - every_in_list = { - list = target_titles + scope:defender = { add_piety_for_war_effect = { TYPE = piety } } - scope:defender = { - add_piety = { - add = religious_cb_piety_gain_duchy - if = { - limit = { - scope:defender.faith ?= { - has_doctrine_parameter = bonus_holy_war_piety_active - } - } - multiply = 1.5 - } - } - } - - } scope:attacker = { pay_short_term_gold_reparations_effect = { GOLD_VALUE = 3 @@ -887,32 +705,10 @@ religious_war = { ai_score_mult = { value = 1 - # As a feudal gov, do not attack owner of tribal holdings if you have a tribal holding to convert already - add = { - every_in_list = { - list = target_titles - if = { - limit = { feudal_clan_tribal_conquest_constraints = yes } - add = -1000 - } - } - } - - # Holy War are limited to connected neighbour to limit big empire expansions over weak realms. - add = { - if = { - limit = { religious_war_vassals_constraints = yes } - add = -1000 - } - } - # HOUSE RELATIONS - add = house_relation_ai_score_value - # AI in struggles act insularly for wars that don't have a familial or legal basis. - multiply = struggle_wars_prioritise_struggle_targets_value - # Tell the Romans to stop going adventuring into the steppe for no gods-damned reason. - multiply = byzantium_conquests_ai_score_value - - add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing + add = common_cb_ai_score_mult_additive + multiply = religious_cb_ai_score_mult + multiply = aggressive_cb_ai_score_mult + multiply = common_cb_ai_score_mult } } @@ -932,7 +728,7 @@ major_religious_war = { # Additional requirements to the defines in 00_casus_belli_groups.txt allowed_for_character = { - scope:attacker.faith ?= { + scope:attacker.faith = { NOT = { has_doctrine_parameter = unreformed } } NOR = { @@ -942,71 +738,9 @@ major_religious_war = { } allowed_for_character_display_regardless = { - #Piety level reqs should be ignored if this is an interaction trigger_if = { limit = { - NOT = { has_character_flag = holy_war_incited } - } - trigger_if = { - limit = { - is_alive = yes - has_variable_list = humsacd_hofs - is_target_in_variable_list = { - name = humsacd_hofs - target = scope:attacker.faith - } - } - trigger_if = { - limit = { - OR = { - culture ?= { - has_cultural_parameter = cb_lower_piety_level_requirement - } - # Iberian Struggle Hostility Reward - AND = { - house ?= { - OR = { - has_house_modifier = fp2_struggle_hostility_house_faith_modifier - has_house_modifier = fp2_struggle_hostility_house_combined_modifier - } - } - } - } - } - piety_level >= 1 - } - trigger_else = { - piety_level >= 2 - } - } - trigger_else = { - trigger_if = { - limit = { - OR = { - culture ?= { - has_cultural_parameter = cb_lower_piety_level_requirement - } - # Iberian Struggle Hostility Reward - AND = { - house ?= { - OR = { - has_house_modifier = fp2_struggle_hostility_house_faith_modifier - has_house_modifier = fp2_struggle_hostility_house_combined_modifier - } - } - } - } - } - piety_level >= 2 - } - trigger_else = { - piety_level >= 3 - } - } - } - trigger_if = { - limit = { - culture ?= { + culture = { NOT = { has_cultural_parameter = no_limit_to_kingdom_level_holy_wars } @@ -1036,7 +770,7 @@ major_religious_war = { } allowed_against_character = { - #religious_war_faith_hostility_trigger = yes + religious_war_faith_hostility_trigger = yes scope:attacker = { ALL_FALSE = { top_liege = scope:defender.top_liege @@ -1146,7 +880,7 @@ major_religious_war = { first_valid = { triggered_desc = { trigger = { - scope:attacker.rite ?= { + scope:attacker.rite = { rite_has_doctrine = doctrine_pluralism_pluralistic } } @@ -1236,22 +970,7 @@ major_religious_war = { } # Piety Progress for the Attacker - every_in_list = { - list = target_titles - scope:attacker = { - add_piety_experience = { - add = religious_cb_piety_gain_kingdom - if = { - limit = { - scope:attacker.faith ?= { - has_doctrine_parameter = bonus_holy_war_piety_active - } - } - multiply = 1.5 - } - } - } - } + scope:attacker = { add_piety_for_war_effect = { TYPE = piety_experience } } ordered_in_list = { list = target_titles @@ -1261,13 +980,13 @@ major_religious_war = { save_scope_as = war_goal_title } - scope:attacker.faith ?= { + scope:attacker.faith = { change_fervor = { value = modest_fervor_gain desc = fervor_loss_religious_war } } - scope:defender.faith ?= { + scope:defender.faith = { change_fervor = { value = notable_fervor_gain desc = fervor_gain_religious_war @@ -1326,39 +1045,6 @@ major_religious_war = { # piety change scope:defender = { add_piety_for_war_effect = { TYPE = piety } } - #scope:defender = { - #add_piety = { - #add = religious_cb_piety_gain_kingdom - #if = { - #limit = { - #scope:defender.faith ?= { - #has_doctrine_parameter = bonus_holy_war_piety_active - #} - #} - #multiply = 1.5 - #} - #} - #} - - #scope:attacker = { - #if = { - #limit = { - #monthly_character_income > 0 - #} - #pay_short_term_income = { - #years = 4 - #target = scope:defender - #} - #} - #else = { - #pay_short_term_gold = { - #target = scope:defender - #gold = medium_gold_value - #} - #} - #} - #} - scope:attacker = { pay_short_term_gold_reparations_effect = { GOLD_VALUE = 4 @@ -1404,33 +1090,10 @@ major_religious_war = { ai_score_mult = { value = 1 - # As a feudal gov, do not attack owner of tribal holdings if you have a tribal holding to convert already - add = { - every_in_list = { - list = target_titles - if = { - limit = { feudal_clan_tribal_conquest_constraints = yes } - add = -1000 - } - } - } - - # Holy War are limited to connected neighbour to limit big empire expansions over weak realms. - add = { - if = { - limit = { religious_war_vassals_constraints = yes } - add = -1000 - } - } - # HOUSE RELATIONS - add = house_relation_ai_score_value - # AI in struggles act insularly for wars that don't have a familial or legal basis. - multiply = struggle_wars_prioritise_struggle_targets_value - # Tell the Romans to stop going adventuring into the steppe for no gods-damned reason. - multiply = byzantium_conquests_ai_score_value - multiply = muslim_invasions_prefer_nonmuslims_ai_score_value - - add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing + add = common_cb_ai_score_mult_additive + multiply = religious_cb_ai_score_mult + multiply = aggressive_cb_ai_score_mult + multiply = common_cb_ai_score_mult } } @@ -1452,7 +1115,7 @@ excommunication_war = { has_trait = excommunicated top_liege = this faith = scope:attacker.faith - rite ?= { rite_has_parameter = excommunication_active } + rite = { rite_has_parameter = excommunication_active } } scope:attacker = { @@ -1681,7 +1344,9 @@ excommunication_war = { ai_score_mult = { value = 1 - add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing + add = common_cb_ai_score_mult_additive + multiply = religious_cb_ai_score_mult + multiply = common_cb_ai_score_mult } } @@ -1692,7 +1357,7 @@ flowery_war_cb = { allow_hostages = no allowed_for_character = { - faith ?= { has_doctrine_parameter = flower_war_cb_active } + rite = { rite_has_parameter = flower_war_cb_active } NOT = { #Must not have any leftover sacrificial prisoners/easy ability to get any. any_prisoner = { has_character_modifier = designated_human_sacrifice_modifier } } @@ -1728,11 +1393,11 @@ flowery_war_cb = { should_invalidate = { OR = { AND = { #A formal flowery war only invalidates if neither side is an interested participant. - scope:attacker.faith ?= { - NOT = { has_doctrine_parameter = human_sacrifice_active } + scope:attacker.rite = { + NOT = { rite_has_parameter = human_sacrifice_active } } - scope:defender.faith ?= { - NOT = { has_doctrine_parameter = human_sacrifice_active } + scope:defender.rite = { + NOT = { rite_has_parameter = human_sacrifice_active } } } scope:attacker = { @@ -1776,7 +1441,7 @@ flowery_war_cb = { scope:attacker = { if = { #If the attacker enjoys human sacrifice, then this was sacred. limit = { - faith ?= { has_doctrine_parameter = human_sacrifice_active } + rite = { rite_has_parameter = human_sacrifice_active } } add_piety = { value = scope:defender.tier_scaled_piety_value @@ -1808,7 +1473,7 @@ flowery_war_cb = { scope:attacker = { #If the attacker has the appropriate tenet, grab some suitable courtiers from the defender. if = { limit = { - faith ?= { has_doctrine_parameter = human_sacrifice_active } + rite = { rite_has_parameter = human_sacrifice_active } } custom_tooltip = flowery_war_cb_prisoners.tt_attacker hidden_effect = { @@ -2140,7 +1805,7 @@ flowery_war_cb = { scope:attacker = { #Piety loss for the attacker if appropriate, otherwise prestige loss. if = { limit = { - faith ?= { has_doctrine_parameter = human_sacrifice_active } + rite = { rite_has_parameter = human_sacrifice_active } } add_piety = religious_cb_piety_white_peace } @@ -2176,10 +1841,9 @@ flowery_war_cb = { scope:attacker = { if = { #If the attacker shares the faith of the defender, and both still enjoy human sacrifice, then this war was at least sacred for them. limit = { - faith ?= { - this = scope:defender.faith - has_doctrine_parameter = human_sacrifice_active - } + faith = scope:defender.faith + rite = { rite_has_parameter = human_sacrifice_active } + scope:defender.rite = { rite_has_parameter = human_sacrifice_active } } add_piety = { value = scope:defender.tier_scaled_piety_value @@ -2196,10 +1860,9 @@ flowery_war_cb = { scope:defender = { if = { #If the defender has the same faith as the attacker, and both still enjoy human sacrifice, then this was sacred. limit = { - faith ?= { - this = scope:attacker.faith - has_doctrine_parameter = human_sacrifice_active - } + faith = scope:attacker.faith + rite = { rite_has_parameter = human_sacrifice_active } + scope:attacker.rite = { rite_has_parameter = human_sacrifice_active } } add_piety = { value = scope:attacker.tier_scaled_piety_value @@ -2214,7 +1877,7 @@ flowery_war_cb = { scope:defender = { #If the defender has the appropriate tenet, and doesn't already have sacrificial victims, grab some suitable courtiers from the attacker. if = { limit = { - faith ?= { has_doctrine_parameter = human_sacrifice_active } + rite = { rite_has_parameter = human_sacrifice_active } NOT = { #Must not have any leftover sacrificial prisoners, lest the defender get borked sacrifice-accounting events. any_prisoner = { has_character_modifier = designated_human_sacrifice_modifier } } @@ -2572,27 +2235,10 @@ flowery_war_cb = { ai_score_mult = { value = 1 - # Increase odds if the character is a vassal with Ghazi Contract - add = { - if = { - limit = { - scope:attacker = { - top_liege != this - vassal_contract_has_flag = vassal_contract_cheaper_religious_war - } - } - add = 1 - } - } - # Holy War are limited to connected neighbour to limit big empire expansions over weak realms. - add = { - if = { - limit = { religious_war_vassals_constraints = yes } - add = -1000 - } - } - - add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing + + add = common_cb_ai_score_mult_additive + multiply = religious_cb_ai_score_mult + multiply = common_cb_ai_score_mult } } @@ -2645,7 +2291,7 @@ undirected_great_holy_war = { any_in_de_jure_hierarchy = { #Any ruler in the dejure of the targeted Kingdom follows a Rite that the HoF's Rite is hostile enough to Holy War against. continue = { tier > tier_county } tier = tier_county - scope:attacker.rite ?= { + scope:attacker.rite = { is_hostile_enough_for_holy_war_trigger = { RITE = prev.holder.top_liege.rite } } } @@ -2677,7 +2323,7 @@ undirected_great_holy_war = { scope:defender = { save_scope_as = ghw_defender } - scope:attacker.faith ?= { + scope:attacker.faith = { save_scope_as = the_faith } scope:attacker.faith.great_holy_war = { @@ -2735,7 +2381,7 @@ undirected_great_holy_war = { # First of the Crusader Kings achievement tracking. if = { limit = { - scope:attacker.religion = religion:catholic_religion + scope:attacker.faith = faith:catholic NOT = { exists = global_var:had_first_catholic_crusade } } # Credit where chredit is due. @@ -2753,7 +2399,7 @@ undirected_great_holy_war = { } if = { - limit = { scope:attacker.religion = religion:catholic_religion } + limit = { scope:attacker.faith = faith:catholic } change_global_variable = { name = num_catholic_crusades add = 1 @@ -2782,7 +2428,7 @@ undirected_great_holy_war = { scope:defender = { save_scope_as = ghw_defender } - scope:attacker.faith ?= { + scope:attacker.faith = { save_scope_as = the_faith } scope:attacker.faith.great_holy_war = { @@ -2844,7 +2490,7 @@ undirected_great_holy_war = { scope:defender = { save_scope_as = ghw_defender } - scope:attacker.faith ?= { + scope:attacker.faith = { save_scope_as = the_faith } scope:attacker.faith.great_holy_war = { @@ -2911,11 +2557,11 @@ undirected_great_holy_war = { save_scope_as = title_recipient gender_female_chance = { if = { - limit = { scope:the_faith ?= { main_rite ?= { rite_has_doctrine = doctrine_gender_male_dominated } } } + limit = { scope:the_faith = { main_rite = { rite_has_doctrine = doctrine_gender_male_dominated } } } add = 0 } else_if = { - limit = { scope:the_faith ?= { main_rite ?= { rite_has_doctrine = doctrine_gender_female_dominated } } } + limit = { scope:the_faith = { main_rite = { rite_has_doctrine = doctrine_gender_female_dominated } } } add = 100 } else = { @@ -3264,30 +2910,6 @@ undirected_great_holy_war = { } } } - - #Set 30 years cooldown. - hidden_effect = { - scope:attacker.faith ?= { - set_variable = { - name = variable_ghw_cooldown - value = yes - years = 30 - } - } - if = { #Clear pledged gold flag. - limit = { - any_player = { - has_character_flag = ghw_pledged_gold - } - } - every_player = { - limit = { - has_character_flag = ghw_pledged_gold - } - remove_character_flag = ghw_pledged_gold - } - } - } ordered_in_list = { list = target_titles @@ -3297,13 +2919,13 @@ undirected_great_holy_war = { save_scope_as = war_goal_title } - scope:attacker.faith ?= { + scope:attacker.faith = { change_fervor = { value = substantial_fervor_gain desc = fervor_loss_great_holy_war } } - scope:defender.faith ?= { + scope:defender.faith = { change_fervor = { value = significant_fervor_gain desc = fervor_gain_great_holy_war @@ -3364,7 +2986,7 @@ undirected_great_holy_war = { scope:defender = { save_scope_as = ghw_defender } - scope:attacker.faith ?= { + scope:attacker.faith = { save_scope_as = the_faith } scope:attacker.faith.great_holy_war = { @@ -3372,14 +2994,14 @@ undirected_great_holy_war = { } scope:attacker = { - faith ?= { + faith = { change_fervor = { value = significant_fervor_gain desc = fervor_loss_lost_great_holy_war } } } - scope:defender.faith ?= { + scope:defender.faith = { change_fervor = { value = significant_fervor_gain desc = fervor_gain_great_holy_war @@ -3438,14 +3060,12 @@ undirected_great_holy_war = { } } } - scope:attacker.faith ?= { - set_variable = { - name = variable_ghw_cooldown - value = yes - years = 30 - } - } - if = { #Clear pledged gold flag. + } + debug_log = undirected_ghw_defeat_debug_message + + hidden_effect = { + #Clear pledged gold flag. + every_player = { limit = { has_character_flag = ghw_pledged_gold } @@ -3495,7 +3115,7 @@ directed_great_holy_war = { transfer_behavior = transfer allowed_for_character = { - faith ?= { + faith = { exists = religious_head suitable_faith_for_directed_ghw_trigger = yes #Right Doctrines OR = { @@ -3516,19 +3136,19 @@ directed_great_holy_war = { } custom_description = { text = great_holy_war_cooldown - NOT = { scope:attacker.faith ?= { exists = var:variable_ghw_cooldown }} + NOT = { scope:attacker.faith = { exists = var:variable_ghw_cooldown }} } tgp_japan_offensive_wars_ban_trigger = yes } allowed_against_character = { - scope:attacker.rite ?= { + scope:attacker.rite = { is_hostile_enough_for_holy_war_trigger = { RITE = scope:defender.rite } } } valid_to_start = { - scope:attacker.faith ?= { + scope:attacker.faith = { NOR = { # No active GHW already. exists = great_holy_war @@ -3553,7 +3173,7 @@ directed_great_holy_war = { continue = { tier > tier_county } count >= 5 # The AI doesn't Jihad for an area of less than 5 Counties, for reference, Jerusalem is 8 Counties tier = tier_county - scope:attacker.rite ?= { + scope:attacker.rite = { is_hostile_enough_for_holy_war_trigger = { RITE = prev.holder.top_liege.rite } } } @@ -3562,7 +3182,7 @@ directed_great_holy_war = { any_in_de_jure_hierarchy = { #Any ruler in the dejure of the targeted Kingdom follows a Rite that the Caliph's Rite is hostile enough to Holy War against. continue = { tier > tier_county } tier = tier_county - scope:attacker.rite ?= { + scope:attacker.rite = { is_hostile_enough_for_holy_war_trigger = { RITE = prev.holder.top_liege.rite } } } @@ -3579,7 +3199,7 @@ directed_great_holy_war = { save_scope_as = target } hidden_effect = { - scope:attacker.faith ?= { + scope:attacker.faith = { start_great_holy_war = { target_character = scope:defender target_title = scope:target @@ -3609,10 +3229,10 @@ directed_great_holy_war = { scope:defender = { save_scope_as = ghw_defender } - scope:defender.faith ?= { + scope:defender.faith = { save_scope_as = target_faith } - scope:attacker.faith ?= { + scope:attacker.faith = { save_scope_as = the_faith } scope:attacker.faith.great_holy_war = { @@ -3644,12 +3264,12 @@ directed_great_holy_war = { } trigger_event = great_holy_war.0093 #AI counterpledging. } - scope:attacker.faith ?= { + scope:attacker.faith = { every_faith_holy_order = { trigger_event = great_holy_war.0090 # Military Orders always join } } - scope:defender.faith ?= { + scope:defender.faith = { every_faith_holy_order = { trigger_event = great_holy_war.0091 # Military Orders always join } @@ -3716,7 +3336,7 @@ directed_great_holy_war = { scope:defender = { save_scope_as = ghw_defender } - scope:attacker.faith ?= { + scope:attacker.faith = { save_scope_as = the_faith } scope:attacker.faith.great_holy_war = { @@ -3822,15 +3442,6 @@ directed_great_holy_war = { } } hidden_effect = { - scope:attacker = { - faith ?= { - set_variable = { - name = variable_ghw_cooldown - value = yes - years = 30 - } - } - } scope:attacker.faith.great_holy_war = { #Give Prestige/Piety modifier to Dynasty/House of the winners' Beneficiaries (only if they gained any land in the GHW). every_pledged_attacker = { limit = { exists = ghw_beneficiary } @@ -3847,13 +3458,13 @@ directed_great_holy_war = { save_scope_as = war_goal_title } - scope:attacker.faith ?= { + scope:attacker.faith = { change_fervor = { value = substantial_fervor_gain desc = fervor_loss_great_holy_war } } - scope:defender.faith ?= { + scope:defender.faith = { change_fervor = { value = significant_fervor_gain desc = fervor_gain_great_holy_war @@ -3937,7 +3548,7 @@ directed_great_holy_war = { scope:defender = { save_scope_as = ghw_defender } - scope:attacker.faith ?= { + scope:attacker.faith = { save_scope_as = the_faith } scope:attacker.faith.great_holy_war = { @@ -3970,35 +3581,21 @@ directed_great_holy_war = { } scope:attacker = { - faith ?= { + faith = { change_fervor = { value = significant_fervor_gain desc = fervor_loss_lost_great_holy_war } } } - scope:defender.faith ?= { + scope:defender.faith = { change_fervor = { value = significant_fervor_gain desc = fervor_gain_great_holy_war } } - #Set 30 years cooldown. - hidden_effect = { - scope:attacker = { - faith ?= { - set_variable = { - name = variable_ghw_cooldown - value = yes - years = 30 - } - } - } - } - - #Mandalas gain or lose piety/devotion depending on Decree - mandala_war_defeat_effects = yes + ghw_on_war_end_effect = yes } max_ai_diplo_distance_to_title = 750 diff --git a/common/casus_belli_types/00_subjugation.txt b/common/casus_belli_types/00_subjugation.txt index 33c744c1f..1e3f4a6c1 100644 --- a/common/casus_belli_types/00_subjugation.txt +++ b/common/casus_belli_types/00_subjugation.txt @@ -16,9 +16,9 @@ faith.religious_head = this pam_is_antipope_trigger = yes } - faith ?= { has_doctrine = doctrine_temporal_head } + faith = { has_doctrine = doctrine_temporal_head } } - faith ?= { + faith = { has_doctrine = eastern_hostility_doctrine } house ?= { @@ -68,21 +68,11 @@ government_has_flag = government_is_tribal } } - trigger_if = { - limit = { - culture ?= { - has_cultural_parameter = cb_lower_prestige_level_requirement - } - } - prestige_level >= 1 - } - trigger_else = { - prestige_level >= 2 - } + has_required_prestige_level_to_declare_war = { LEVEL = 2 } } trigger_else_if = { limit = { - faith ?= { has_doctrine = doctrine_temporal_head } + faith = { has_doctrine = doctrine_temporal_head } OR = { AND = { faith.religious_head = scope:attacker @@ -94,61 +84,10 @@ } } } - trigger_if = { - limit = { - OR = { - culture ?= { - has_cultural_parameter = cb_lower_piety_level_requirement - } - # Iberian Struggle Hostility Reward - AND = { - house ?= { - OR = { - has_house_modifier = fp2_struggle_hostility_house_faith_modifier - has_house_modifier = fp2_struggle_hostility_house_combined_modifier - } - } - } - } - } - piety_level >= 2 - } - trigger_else = { - piety_level >= 3 - } + has_required_piety_level_to_declare_war = { LEVEL = 3 } } trigger_else = { - trigger_if = { - limit = { - government_has_flag = government_is_clan - house ?= { - has_house_unity_stage = antagonistic - } - culture ?= { - has_cultural_parameter = cb_lower_prestige_level_requirement - } - } - prestige_level >= 2 - } - trigger_else_if = { - limit = { - OR = { - AND = { - government_has_flag = government_is_clan - house ?= { - has_house_unity_stage = antagonistic - } - } - culture ?= { - has_cultural_parameter = cb_lower_prestige_level_requirement - } - } - } - prestige_level >= 3 - } - trigger_else = { - prestige_level >= 4 - } + has_required_prestige_level_to_declare_war = { LEVEL = 4 } } custom_description = { text = has_used_lifetime_subjugation @@ -194,7 +133,7 @@ } } AND = { # Temporal Subjugation - faith ?= { has_doctrine = doctrine_temporal_head } + faith = { has_doctrine = doctrine_temporal_head } OR = { AND = { faith.religious_head = scope:attacker @@ -207,10 +146,10 @@ } } AND = { # Indian Subjugation - faith ?= { + faith = { has_doctrine = eastern_hostility_doctrine } - scope:defender.faith ?= { + scope:defender.faith = { has_doctrine = eastern_hostility_doctrine } } @@ -538,8 +477,9 @@ ai_score_mult = { value = 1 - multiply = pam_peace_of_god_coreligionist_war_ai_score_value - multiply = zealous_war_on_head_of_faith_ai_score_value - add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing + add = common_cb_ai_score_mult_additive + multiply = vassalization_cb_ai_score_mult + multiply = aggressive_cb_ai_score_mult + multiply = common_cb_ai_score_mult } } diff --git a/common/casus_belli_types/06_ce1_wars.txt b/common/casus_belli_types/06_ce1_wars.txt index 4eb21522a..98845469c 100644 --- a/common/casus_belli_types/06_ce1_wars.txt +++ b/common/casus_belli_types/06_ce1_wars.txt @@ -251,7 +251,10 @@ mythical_ancestor_war = { ai_score_mult = { value = 1 - add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing + + add = common_cb_ai_score_mult_additive + multiply = aggressive_cb_ai_score_mult + multiply = common_cb_ai_score_mult } } @@ -313,7 +316,10 @@ legendary_adventure = { ai_can_target_all_titles = { always = yes } ai_score_mult = { value = varangian_adventure_ai_targeting_value - add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing + + add = common_cb_ai_score_mult_additive + multiply = aggressive_cb_ai_score_mult + multiply = common_cb_ai_score_mult } valid_to_start = { @@ -1785,6 +1791,10 @@ leg_demand_fealty_cb = { ai_score_mult = { value = 1 - add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing + + add = common_cb_ai_score_mult_additive + multiply = aggressive_cb_ai_score_mult + multiply = vassalization_cb_ai_score_mult + multiply = common_cb_ai_score_mult } } diff --git a/common/casus_belli_types/07_ep3_admin_cbs.txt b/common/casus_belli_types/07_ep3_admin_cbs.txt index 3f4a91978..4f1a3b5ce 100644 --- a/common/casus_belli_types/07_ep3_admin_cbs.txt +++ b/common/casus_belli_types/07_ep3_admin_cbs.txt @@ -39,36 +39,9 @@ expansion_cb = { ai_score_mult = { value = viking_conquest_ai_score_value - # As a feudal gov, do not attack owner of tribal holdings if you have a tribal holding to convert already - add = { - every_in_list = { - list = target_titles - if = { - limit = { feudal_clan_tribal_conquest_constraints = yes } - add = -1000 - } - } - } - - # AI in struggles act insularly for wars that don't have a familial or legal basis. - multiply = struggle_wars_prioritise_struggle_targets_value - - add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing - - # Tell the Romans to stop going adventuring into the steppe for no gods-damned reason. - multiply = byzantium_conquests_ai_score_value - #Declaring war on the frankokratia leader can really ruin the whole thing -# if = { -# limit = { -# scope:defender = { -# any_owned_story = { -# story_type = frankokratia_story -# NOT = { has_variable = franko_war_complete } -# } -# } -# } -# multiply = 0 -# } + add = common_cb_ai_score_mult_additive + multiply = aggressive_cb_ai_score_mult + multiply = common_cb_ai_score_mult } valid_to_start = { @@ -313,36 +286,9 @@ duchy_expansion_cb = { ai_score_mult = { value = viking_conquest_ai_score_value - # As a feudal gov, do not attack tribal - add = { - every_in_list = { - list = target_titles - if = { - limit = { feudal_clan_tribal_conquest_constraints = yes } - add = -1000 - } - } - } - - # AI in struggles act insularly for wars that don't have a familial or legal basis. - multiply = struggle_wars_prioritise_struggle_targets_value - - add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing - - # Tell the Romans to stop going adventuring into the steppe for no gods-damned reason. - multiply = byzantium_conquests_ai_score_value - #Declaring war on the frankokratia leader can really ruin the whole thing -# if = { -# limit = { -# scope:defender = { -# any_owned_story = { -# story_type = frankokratia_story -# NOT = { has_variable = franko_war_complete } -# } -# } -# } -# multiply = 0 -# } + add = common_cb_ai_score_mult_additive + multiply = aggressive_cb_ai_score_mult + multiply = common_cb_ai_score_mult } valid_to_start = { @@ -614,36 +560,9 @@ naval_expansion_cb = { ai_score_mult = { value = viking_conquest_ai_score_value - # As a feudal gov, do not attack owner of tribal holdings if you have a tribal holding to convert already - add = { - every_in_list = { - list = target_titles - if = { - limit = { feudal_clan_tribal_conquest_constraints = yes } - add = -1000 - } - } - } - - # AI in struggles act insularly for wars that don't have a familial or legal basis. - multiply = struggle_wars_prioritise_struggle_targets_value - - add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing - - # Tell the Romans to stop going adventuring into the steppe for no gods-damned reason. - multiply = byzantium_conquests_ai_score_value - #Declaring war on the frankokratia leader can really ruin the whole thing -# if = { -# limit = { -# scope:defender = { -# any_owned_story = { -# story_type = frankokratia_story -# NOT = { has_variable = franko_war_complete } -# } -# } -# } -# multiply = 0 -# } + add = common_cb_ai_score_mult_additive + multiply = aggressive_cb_ai_score_mult + multiply = common_cb_ai_score_mult } # Target county has to be coastal and not border you. @@ -886,36 +805,9 @@ naval_duchy_expansion_cb = { ai_score_mult = { value = viking_conquest_ai_score_value - # As a feudal gov, do not attack tribal - add = { - every_in_list = { - list = target_titles - if = { - limit = { feudal_clan_tribal_conquest_constraints = yes } - add = -1000 - } - } - } - - # AI in struggles act insularly for wars that don't have a familial or legal basis. - multiply = struggle_wars_prioritise_struggle_targets_value - - add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing - - # Tell the Romans to stop going adventuring into the steppe for no gods-damned reason. - multiply = byzantium_conquests_ai_score_value - #Declaring war on the frankokratia leader can really ruin the whole thing -# if = { -# limit = { -# scope:defender = { -# any_owned_story = { -# story_type = frankokratia_story -# NOT = { has_variable = franko_war_complete } -# } -# } -# } -# multiply = 0 -# } + add = common_cb_ai_score_mult_additive + multiply = aggressive_cb_ai_score_mult + multiply = common_cb_ai_score_mult } # Target duchy must have counties that are coastal and doesn't border you. @@ -1395,10 +1287,4 @@ influence_war_cb = { max_defender_score_from_occupation = 150 max_attacker_score_from_occupation = 150 - - ai_score_mult = { - value = 1 - - add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing - } } diff --git a/common/casus_belli_types/10_tgp_china_wars.txt b/common/casus_belli_types/10_tgp_china_wars.txt index 51cfcb36d..11eade892 100644 --- a/common/casus_belli_types/10_tgp_china_wars.txt +++ b/common/casus_belli_types/10_tgp_china_wars.txt @@ -2143,8 +2143,6 @@ silk_road_vassalization_cb = { ai_score_mult = { value = 1 - add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing - # If the Silk Road is doing well, absolutely attack it if = { limit = { @@ -2158,6 +2156,12 @@ silk_road_vassalization_cb = { } add = 100 } + + add = common_cb_ai_score_mult_additive + + multiply = vassalization_cb_ai_score_mult + multiply = aggressive_cb_ai_score_mult + multiply = common_cb_ai_score_mult } } diff --git a/common/casus_belli_types/10_tgp_japan_wars.txt b/common/casus_belli_types/10_tgp_japan_wars.txt index fac7c5a1e..180776e24 100644 --- a/common/casus_belli_types/10_tgp_japan_wars.txt +++ b/common/casus_belli_types/10_tgp_japan_wars.txt @@ -1,2604 +1,2544 @@ -# + # War to install Bloc member -- Bloc Expansion -#japan_install_bloc_member_cb = { -# icon = bloc -# group = subjugation -# combine_into_one = yes -# should_show_war_goal_subview = yes -# allow_hostages = no -# ai_only_against_neighbors = yes -# -# target_titles = all -# target_title_tier = county -# ignore_effect = change_title_holder -# -# # scope:attacker -# allowed_for_character = { -# has_tgp_dlc_trigger = yes -# is_landed = yes -# highest_held_title_tier >= tier_county -# tgp_soryo_or_bushido_trigger = yes # Soryo -# exists = house.house_confederation # In a Bloc -# } -# -# # scope:defender -# allowed_against_character = { -# is_landed = yes -# highest_held_title_tier >= tier_county -# top_liege = scope:attacker.top_liege # Same realm -# NOT = { this = scope:attacker.top_liege } # Not top liege -# government_is_japanese_trigger = yes # Soryo or Ritsuryo -# trigger_if = { # Not in same Bloc -# limit = { exists = house.house_confederation } -# house.house_confederation != scope:attacker.house.house_confederation -# } -# } -# -# valid_to_start = { -# scope:target ?= { is_landless_type_title = no } -# } -# -# mutually_exclusive_titles = { always = yes } -# -# cost = { -# prestige = { -# add = { -# value = 100 -# desc = CB_BASE_COST -# } -# multiply = common_cb_prestige_cost_multiplier -# } -# } -# -# should_invalidate = { -# OR = { -# war_should_invalidate_defender_lost_target_lands_trigger = yes -# scope:attacker = { tgp_soryo_or_bushido_trigger = no } -# scope:defender.house.house_confederation ?= scope:attacker.house.house_confederation # Same bloc already -# NOT = { exists = scope:attacker.house.house_confederation } # Bloc destroyed -# } -# } -# -# on_invalidated_desc = { -# desc = japan_install_bloc_member_cb_ended_invalid.desc -# } -# -# on_declaration = { -# on_declared_war = yes -# if = { -# limit = { tgp_japan_internal_soryo_war_is_crime_trigger = yes } -# scope:attacker = { -# # Message for attacker -# send_interface_toast = { -# type = event_war_bad -# title = tgp_japan_soryo_war_is_crime_title -# left_icon = scope:defender -# right_icon = top_liege -# top_liege = { -# send_interface_toast = { -# type = event_war_bad -# title = tgp_japan_soryo_war_is_crime_prime_minister_title -# left_icon = scope:attacker -# right_icon = scope:defender -# add_opinion = { -# target = scope:attacker -# modifier = admin_soryo_conquest_crime -# } -# } -# } -# } -# } -# } -# } -# -# on_victory_desc = { -# desc = { -# desc = japan_install_bloc_member_cb_victory_desc -# triggered_desc = { -# trigger = { tgp_japan_internal_soryo_war_is_crime_trigger = yes } -# desc = japan_soryo_conquest_cb_admin_warning -# } -# } -# } -# -# on_victory = { -# on_victory_effect = yes -# # they lost title but not taken by you -# scope:defender = { ep3_war_loss_adventurer_tt_effect = yes } -# -# scope:attacker.house.house_confederation = { -# leading_house.house_head = { -# if = { -# limit = { -# is_ai = yes -# this != scope:attacker -# } -# add_opinion = { -# target = scope:attacker -# modifier = respect_opinion -# opinion = 25 -# } -# } -# } -# } -# -# #EP2 Accolade glory gain from winning against higher ranked enemy -# scope:attacker = { accolade_attacker_war_end_glory_gain_low_effect = yes } -# -# scope:attacker = { -# add_prestige = { -# value = scope:defender.tier_scaled_prestige_value -# } -# } -# -# scope:defender = { -# add_prestige = { -# value = 0 -# subtract = tier_scaled_prestige_value -# } -# } -# -# scope:attacker = { -# trigger_event = { -# id = tgp_japan_general.8800 -# days = 1 -# } -# } -# -# # Prestige Progress for the Attacker -# every_in_list = { -# list = target_titles -# scope:attacker = { add_prestige_experience = minor_prestige_value } -# } -# -# # Allies on both sides get full prestige value for helping in the war, based on their war participation. -# modify_allies_of_participants_fame_values = { -# WINNER = scope:attacker -# FAME_BASE = major_prestige_value -# IS_RELIGIOUS_WAR = no -# WINNER_ALLY_FAME_SCALE = 1 -# LOSER_ALLY_FAME_SCALE = 1 -# } -# } -# -# on_white_peace_desc = { -# desc = { -# desc = japan_install_bloc_member_cb_white_peace_desc -# triggered_desc = { -# trigger = { tgp_japan_internal_soryo_war_is_crime_trigger = yes } -# desc = japan_soryo_conquest_cb_admin_warning -# } -# } -# } -# -# on_white_peace = { -# on_white_peace_effect = yes -# scope:attacker = { -# add_prestige = medium_prestige_loss -# } -# -# # Allies on both sides get full prestige value for helping in the war, based on their war participation. -# modify_allies_of_participants_fame_values = { -# WINNER = scope:attacker # not important as the scales are identical -# FAME_BASE = major_prestige_value -# IS_RELIGIOUS_WAR = no -# WINNER_ALLY_FAME_SCALE = 1 -# LOSER_ALLY_FAME_SCALE = 1 -# } -# } -# -# on_defeat_desc = { -# desc = { -# desc = japan_install_bloc_member_cb_defeat_desc -# triggered_desc = { -# trigger = { tgp_japan_internal_soryo_war_is_crime_trigger = yes } -# desc = japan_soryo_conquest_cb_admin_warning -# } -# } -# } -# -# on_defeat = { -# on_defeat_effect = yes -# -# scope:defender = { -# #EP2 accolade glory gain for winning against higher ranked enemy -# accolade_defender_war_end_glory_gain_high_effect = yes -# } -# -# scope:attacker = { -# add_prestige = { -# value = 0 -# subtract = tier_scaled_prestige_value -# } -# } -# -# scope:defender = { -# add_prestige = { -# value = tier_scaled_prestige_value -# } -# } -# -# # Allies on both sides get full prestige value for helping in the war, based on their war participation. -# modify_allies_of_participants_fame_values = { -# WINNER = scope:defender -# FAME_BASE = major_prestige_value -# IS_RELIGIOUS_WAR = no -# WINNER_ALLY_FAME_SCALE = 1 -# LOSER_ALLY_FAME_SCALE = 1 -# } -# } -# -# on_primary_attacker_death = inherit -# on_primary_defender_death = inherit -# -# attacker_allies_inherit = yes -# defender_allies_inherit = yes -# -# war_name = "JAPAN_INSTALL_BLOC_MEMBER_WAR_NAME" -# war_name_base = "JAPAN_INSTALL_BLOC_MEMBER_WAR_NAME_BASE" -# cb_name = "JAPAN_INSTALL_BLOC_MEMBER_CB_NAME" -# interface_priority = 100 -# -# ticking_war_score_targets_entire_realm = no -# attacker_ticking_warscore = 0.01 -# attacker_wargoal_percentage = 0.01 -# attacker_score_from_occupation_scale = 100 -# defender_score_from_occupation_scale = 100 -# attacker_score_from_battles_scale = 100 -# defender_score_from_battles_scale = 100 -# -# max_attacker_score_from_battles = 100 -# max_defender_score_from_battles = 100 -# -# max_defender_score_from_occupation = 100 -# max_attacker_score_from_occupation = 100 -# -# max_ai_diplo_distance_to_title = 500 -# -# ai_score = { -# value = japan_install_bloc_member_ai_score_value -# } -# -# ai_score_mult = { -# value = 1 -# add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing -# } -#} -# -## War for landless feudal to take land -#japan_soryo_conquest_county_landless_cb = { -# icon = soryo -# group = conquest -# combine_into_one = yes -# should_show_war_goal_subview = yes -# ai_only_against_neighbors = no -# allow_hostages = no -# target_titles = all -# target_title_tier = county -# target_de_jure_regions_above = yes -# ignore_effect = change_title_holder -# -# mutually_exclusive_titles = { always = yes } -# -# # scope:attacker -# allowed_for_character = { -# has_tgp_dlc_trigger = yes -# is_landed = no -# government_is_japanese_trigger = yes -# tgp_soryo_or_bushido_trigger = yes -# } -# -# # scope:defender -# allowed_against_character = { -# is_landed = yes -# highest_held_title_tier >= tier_county -# government_is_japanese_trigger = yes -# top_liege = { -# # Must be part of same realm -# this = scope:attacker.top_liege -# # But defender must not be liege -# NOT = { this = scope:attacker } -# } -# } -# -# cost = { -# prestige = { -# add = { -# value = 100 -# desc = CB_BASE_COST -# } -# multiply = common_cb_prestige_cost_multiplier -# } -# } -# -# valid_to_start = { -# scope:target = { -# is_landless_type_title = no -# # Also make sure you can't war for, like, the Papal States -# trigger_if = { -# limit = { holder.faith ?= root.faith } -# NOT = { -# holder ?= { is_theocratic_lessee = yes } -# } -# } -# } -# } -# -# should_invalidate = { -# ep3_adventurer_landless_should_invalidate_trigger = yes -# } -# -# on_invalidated_desc = { -# desc = japan_soryo_conquest_cb_ended_invalid.desc -# } -# -# on_declaration = { -# on_declared_war = yes -# if = { -# limit = { tgp_japan_internal_soryo_war_is_crime_trigger = yes } -# scope:attacker = { -# # Message for attacker -# send_interface_toast = { -# type = event_war_bad -# title = tgp_japan_soryo_war_is_crime_title -# left_icon = scope:defender -# right_icon = top_liege -# top_liege = { -# send_interface_toast = { -# type = event_war_bad -# title = tgp_japan_soryo_war_is_crime_prime_minister_title -# left_icon = scope:attacker -# right_icon = scope:defender -# add_opinion = { -# target = scope:attacker -# modifier = admin_soryo_conquest_crime -# } -# } -# } -# } -# } -# } -# } -# -# on_victory_desc = { -# desc = { -# first_valid = { -# triggered_desc = { -# trigger = { scope:attacker = { is_local_player = yes } } -# desc = county_conquest_cb_victory_desc_attacker -# } -# desc = county_conquest_cb_victory_desc -# } -# triggered_desc = { -# trigger = { tgp_japan_internal_soryo_war_is_crime_trigger = yes } -# desc = japan_soryo_conquest_cb_admin_warning -# } -# } -# } -# -# on_victory = { -# on_victory_aggressive_war_effect = yes -# -# #EP2 Accolade glory gain from winning against higher ranked enemy -# scope:attacker = { accolade_attacker_war_end_glory_gain_low_effect = yes } -# -# scope:attacker = { -# add_prestige = { -# value = scope:defender.tier_scaled_prestige_value -# } -# } -# -# scope:defender = { -# add_prestige = { -# value = 0 -# subtract = tier_scaled_prestige_value -# } -# } -# -# create_title_and_vassal_change = { -# type = conquest -# save_scope_as = change -# add_claim_on_loss = yes -# } -# -# #As this is just a county conquest, simply grab the designated county. -# every_in_list = { -# list = target_titles -# change_title_holder = { -# holder = scope:attacker -# change = scope:change -# } -# } -# -# resolve_title_and_vassal_change = scope:change -# -# # Prestige Progress for the Attacker -# every_in_list = { -# list = target_titles -# scope:attacker = { add_prestige_experience = minor_prestige_value } -# } -# -# # Allies on both sides get full prestige value for helping in the war, based on their war participation. -# modify_allies_of_participants_fame_values = { -# WINNER = scope:attacker -# FAME_BASE = major_prestige_value -# IS_RELIGIOUS_WAR = no -# WINNER_ALLY_FAME_SCALE = 1 -# LOSER_ALLY_FAME_SCALE = 1 -# } -# } -# -# on_white_peace_desc = { -# desc = { -# first_valid = { -# triggered_desc = { -# trigger = { scope:defender = { is_local_player = yes } } -# desc = county_conquest_cb_white_peace_desc_defender -# } -# desc = county_conquest_cb_white_peace_desc -# } -# triggered_desc = { -# trigger = { tgp_japan_internal_soryo_war_is_crime_trigger = yes } -# desc = japan_soryo_conquest_cb_admin_warning -# } -# } -# } -# -# on_white_peace = { -# on_white_peace_effect = yes -# scope:attacker = { -# add_prestige = medium_prestige_loss -# } -# -# # Allies on both sides get full prestige value for helping in the war, based on their war participation. -# modify_allies_of_participants_fame_values = { -# WINNER = scope:attacker # not important as the scales are identical -# FAME_BASE = major_prestige_value -# IS_RELIGIOUS_WAR = no -# WINNER_ALLY_FAME_SCALE = 1 -# LOSER_ALLY_FAME_SCALE = 1 -# } -# } -# -# on_defeat_desc = { -# desc = { -# first_valid = { -# triggered_desc = { -# trigger = { scope:attacker = { is_local_player = yes } } -# desc = county_conquest_cb_defeat_desc_attacker -# } -# desc = county_conquest_cb_defeat_desc -# } -# triggered_desc = { -# trigger = { tgp_japan_internal_soryo_war_is_crime_trigger = yes } -# desc = japan_soryo_conquest_cb_admin_warning -# } -# } -# } -# -# on_defeat = { -# on_defeat_aggressive_war_effect = yes -# -# scope:defender = { -# #EP2 accolade glory gain for winning against higher ranked enemy -# accolade_defender_war_end_glory_gain_high_effect = yes -# } -# -# scope:attacker = { -# add_prestige = { -# value = 0 -# subtract = tier_scaled_prestige_value -# } -# } -# -# scope:defender = { -# add_prestige = { -# value = tier_scaled_prestige_value -# } -# } -# -# # Allies on both sides get full prestige value for helping in the war, based on their war participation. -# modify_allies_of_participants_fame_values = { -# WINNER = scope:defender -# FAME_BASE = major_prestige_value -# IS_RELIGIOUS_WAR = no -# WINNER_ALLY_FAME_SCALE = 1 -# LOSER_ALLY_FAME_SCALE = 1 -# } -# } -# -# transfer_behavior = transfer -# -# on_primary_attacker_death = inherit -# on_primary_defender_death = inherit -# -# attacker_allies_inherit = yes -# defender_allies_inherit = yes -# -# interface_priority = 79 -# -# use_de_jure_wargoal_only = yes -# -# attacker_wargoal_percentage = 0.8 -# -# max_attacker_score_from_battles = 75 -# -# max_defender_score_from_occupation = 150 -# max_attacker_score_from_occupation = 150 -# -# war_name = "JAPAN_SORYO_CONQUEST_LANDLESS_WAR_NAME" -# war_name_base = "JAPAN_SORYO_CONQUEST_LANDLESS_WAR_NAME_BASE" -# cb_name = "JAPAN_SORYO_CONQUEST_LANDLESS_COUNTY_CB_NAME" -# -# ai_score_mult = { -# value = 1 -# add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing -# if = { -# limit = { -# current_military_strength < 400 -# } -# multiply = 0 -# } -# multiply = aggressive_cb_ai_score_mult -# multiply = common_cb_ai_score_mult -# } -#} -# -## War for feudal to take land -#japan_soryo_conquest_county_cb = { -# icon = soryo -# group = conquest -# combine_into_one = yes -# ai_only_against_neighbors = yes -# allow_hostages = yes -# should_show_war_goal_subview = yes -# -# target_titles = neighbor_land_or_water -# target_title_tier = county -# ignore_effect = change_title_holder -# -# mutually_exclusive_titles = { always = yes } -# -# # scope:attacker -# allowed_for_character = { -# has_tgp_dlc_trigger = yes -# is_landed = yes -# # Attacker must be Japanese Feudal, or have the Bushido tradition -# tgp_soryo_or_bushido_trigger = yes -# } -# -# # scope:defender -# allowed_against_character = { -# top_liege ?= { -# # Must be part of same realm -# this = scope:attacker.top_liege -# # But defender must not be liege -# NOT = { this = scope:attacker } -# } -# } -# -# cost = { -# prestige = { -# add = { -# value = 100 -# desc = CB_BASE_COST -# } -# multiply = common_cb_prestige_cost_multiplier -# } -# } -# -# should_invalidate = { -# OR = { -# war_should_invalidate_defender_lost_target_lands_trigger = yes -# NOT = { -# scope:attacker = { tgp_soryo_or_bushido_trigger = yes } -# } -# scope:defender.top_liege != scope:attacker.top_liege -# } -# } -# -# on_invalidated_desc = { -# desc = japan_soryo_conquest_cb_ended_invalid.desc -# } -# -# on_declaration = { -# on_declared_war = yes -# if = { -# limit = { tgp_japan_internal_soryo_war_is_crime_trigger = yes } -# scope:attacker = { -# # Message for attacker -# send_interface_toast = { -# type = event_war_bad -# title = tgp_japan_soryo_war_is_crime_title -# left_icon = scope:defender -# right_icon = top_liege -# top_liege = { -# send_interface_toast = { -# type = event_war_bad -# title = tgp_japan_soryo_war_is_crime_prime_minister_title -# left_icon = scope:attacker -# right_icon = scope:defender -# add_opinion = { -# target = scope:attacker -# modifier = admin_soryo_conquest_crime -# } -# } -# } -# } -# } -# } -# } -# -# on_victory_desc = { -# desc = { -# first_valid = { -# triggered_desc = { -# trigger = { scope:attacker = { is_local_player = yes } } -# desc = county_conquest_cb_victory_desc_attacker -# } -# desc = county_conquest_cb_victory_desc -# } -# triggered_desc = { -# trigger = { tgp_japan_internal_soryo_war_is_crime_trigger = yes } -# desc = japan_soryo_conquest_cb_admin_warning -# } -# } -# } -# -# on_victory = { -# on_victory_aggressive_war_effect = yes -# -# #EP2 Accolade glory gain from winning against higher ranked enemy -# scope:attacker = { accolade_attacker_war_end_glory_gain_low_effect = yes } -# -# scope:attacker = { -# add_prestige = { -# value = scope:defender.tier_scaled_prestige_value -# } -# } -# -# scope:defender = { -# add_prestige = { -# value = 0 -# subtract = tier_scaled_prestige_value -# } -# } -# -# create_title_and_vassal_change = { -# type = conquest -# save_scope_as = change -# add_claim_on_loss = yes -# } -# -# #As this is just a county conquest, simply grab the designated county. -# every_in_list = { -# list = target_titles -# change_title_holder = { -# holder = scope:attacker -# change = scope:change -# } -# } -# -# resolve_title_and_vassal_change = scope:change -# -# # Prestige Progress for the Attacker -# every_in_list = { -# list = target_titles -# scope:attacker = { add_prestige_experience = minor_prestige_value } -# } -# -# # Allies on both sides get full prestige value for helping in the war, based on their war participation. -# modify_allies_of_participants_fame_values = { -# WINNER = scope:attacker -# FAME_BASE = major_prestige_value -# IS_RELIGIOUS_WAR = no -# WINNER_ALLY_FAME_SCALE = 1 -# LOSER_ALLY_FAME_SCALE = 1 -# } -# } -# -# on_white_peace_desc = { -# desc = { -# first_valid = { -# triggered_desc = { -# trigger = { scope:defender = { is_local_player = yes } } -# desc = county_conquest_cb_white_peace_desc_defender -# } -# desc = county_conquest_cb_white_peace_desc -# } -# triggered_desc = { -# trigger = { tgp_japan_internal_soryo_war_is_crime_trigger = yes } -# desc = japan_soryo_conquest_cb_admin_warning -# } -# } -# } -# -# on_white_peace = { -# on_white_peace_effect = yes -# scope:attacker = { -# add_prestige = medium_prestige_loss -# } -# -# # Allies on both sides get full prestige value for helping in the war, based on their war participation. -# modify_allies_of_participants_fame_values = { -# WINNER = scope:attacker # not important as the scales are identical -# FAME_BASE = major_prestige_value -# IS_RELIGIOUS_WAR = no -# WINNER_ALLY_FAME_SCALE = 1 -# LOSER_ALLY_FAME_SCALE = 1 -# } -# } -# -# on_defeat_desc = { -# desc = { -# first_valid = { -# triggered_desc = { -# trigger = { scope:attacker = { is_local_player = yes } } -# desc = county_conquest_cb_defeat_desc_attacker -# } -# desc = county_conquest_cb_defeat_desc -# } -# triggered_desc = { -# trigger = { tgp_japan_internal_soryo_war_is_crime_trigger = yes } -# desc = japan_soryo_conquest_cb_admin_warning -# } -# } -# } -# -# on_defeat = { -# on_defeat_aggressive_war_effect = yes -# -# scope:defender = { -# #EP2 accolade glory gain for winning against higher ranked enemy -# accolade_defender_war_end_glory_gain_high_effect = yes -# } -# -# scope:attacker = { -# add_prestige = { -# value = 0 -# subtract = tier_scaled_prestige_value -# } -# } -# -# scope:defender = { -# add_prestige = { -# value = tier_scaled_prestige_value -# } -# } -# -# # Allies on both sides get full prestige value for helping in the war, based on their war participation. -# modify_allies_of_participants_fame_values = { -# WINNER = scope:defender -# FAME_BASE = major_prestige_value -# IS_RELIGIOUS_WAR = no -# WINNER_ALLY_FAME_SCALE = 1 -# LOSER_ALLY_FAME_SCALE = 1 -# } -# } -# -# on_primary_attacker_death = inherit -# on_primary_defender_death = inherit -# -# attacker_allies_inherit = yes -# defender_allies_inherit = yes -# -# war_name = "JAPAN_SORYO_CONQUEST_WAR_NAME" -# war_name_base = "JAPAN_SORYO_CONQUEST_WAR_NAME_BASE" -# cb_name = "JAPAN_SORYO_CONQUEST_COUNTY_CB_NAME" -# interface_priority = 80 -# -# ticking_war_score_targets_entire_realm = yes -# attacker_ticking_warscore = 0.01 -# attacker_wargoal_percentage = 0.01 -# attacker_score_from_occupation_scale = 50 -# defender_score_from_occupation_scale = 50 -# attacker_score_from_battles_scale = 250 -# defender_score_from_battles_scale = 250 -# -# max_attacker_score_from_battles = 200 -# max_defender_score_from_battles = 200 -# -# max_defender_score_from_occupation = 50 -# max_attacker_score_from_occupation = 50 -# -# max_ai_diplo_distance_to_title = 500 -# -# ai_score_mult = { -# value = 1 -# add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing -# } -#} -# -## War to enforce return to Administrative -#japan_demand_administrative_cb = { -# icon = ritsuryo -# group = subjugation -# allow_hostages = no -# ai_only_against_neighbors = yes -# should_show_war_goal_subview = yes -# -# # scope:attacker -# allowed_for_character = { -# government_has_flag = government_is_japan_administrative -# top_liege = { government_has_flag = government_is_japan_administrative } # Cannot enforce admin in a Soryo realm -# tgp_is_ceremonial_liege_trigger = no -# } -# -# # scope:defender -# allowed_against_character = { -# is_landed = yes -# government_has_flag = government_is_japan_feudal -# top_liege = scope:attacker.top_liege -# NOT = { is_liege_or_above_of = scope:attacker } -# } -# -# # root = scope:attacker, scope:defender, scope:target -# valid_to_start = { -# } -# -# cost = { -# prestige = { -# add = { -# value = 100 -# desc = CB_BASE_COST -# } -# multiply = common_cb_prestige_cost_multiplier -# } -# } -# -# should_invalidate = { -# OR = { -# NOT = { -# scope:attacker = { -# government_has_flag = government_is_japan_administrative -# tgp_is_ceremonial_liege_trigger = no -# } -# } -# NOT = { -# scope:defender = { -# government_has_flag = government_is_japan_feudal -# top_liege = scope:attacker.top_liege -# NOT = { is_liege_or_above_of = scope:attacker } -# } -# } -# scope:defender = { is_landed = no } -# } -# } -# -# on_invalidated_desc = { -# first_valid = { -# triggered_desc = { -# trigger = { -# NOT = { -# scope:attacker = { -# government_has_flag = government_is_japan_administrative -# tgp_is_ceremonial_liege_trigger = no -# } -# } -# } -# desc = japan_demand_administrative_cb_ended_invalid.desc.attacker -# } -# desc = japan_demand_administrative_cb_ended_invalid.desc -# } -# } -# -# on_declaration = { -# on_declared_war = yes -# } -# -# on_victory_desc = { -# desc = { -# desc = japan_demand_administrative_cb_victory_desc -# triggered_desc = { -# trigger = { -# scope:attacker = { is_independent_ruler = no } -# } -# desc = japan_demand_administrative_cb_victory_vassal_desc -# } -# } -# } -# -# on_victory = { -# on_victory_effect = yes -# # they lost title but not taken by you -# scope:defender = { ep3_war_loss_adventurer_tt_effect = yes } -# -# #EP2 Accolade glory gain from winning against higher ranked enemy -# scope:attacker = { accolade_attacker_war_end_glory_gain_low_effect = yes } -# -# # Appreciation for re-integration -# scope:attacker = { -# if = { -# limit = { is_independent_ruler = no } -# reverse_add_opinion = { -# target = scope:attacker.top_liege -# modifier = enforced_administrative_opinion -# } -# } -# } -# -# create_title_and_vassal_change = { -# type = conquest -# save_scope_as = change -# add_claim_on_loss = yes -# } -# -# scope:defender = { -# every_held_title = { -# limit = { -# is_landless_type_title = no -# is_noble_family_title = no -# tier >= tier_county -# } -# # Return land to top liege -# change_title_holder = { -# holder = scope:attacker.top_liege -# change = scope:change -# } -# } -# } -# -# # Influence/Fame reward -# scope:attacker = { -# if = { -# limit = { is_independent_ruler = no } -# if = { -# limit = { government_has_flag = government_has_influence } -# change_influence = japan_demand_administrative_war_influence_value -# } -# else = { add_prestige_experience = japan_demand_administrative_war_prestige_value } -# } -# } -# -# resolve_title_and_vassal_change = scope:change -# -# # Prestige Progress for the Attacker -# every_in_list = { -# list = target_titles -# scope:attacker = { add_prestige_experience = minor_prestige_value } -# } -# -# # Allies on both sides get full prestige value for helping in the war, based on their war participation. -# modify_allies_of_participants_fame_values = { -# WINNER = scope:attacker -# FAME_BASE = major_prestige_value -# IS_RELIGIOUS_WAR = no -# WINNER_ALLY_FAME_SCALE = 1 -# LOSER_ALLY_FAME_SCALE = 1 -# } -# } -# -# on_white_peace_desc = { -# desc = japan_demand_administrative_cb_white_peace_desc -# } -# -# on_white_peace = { -# on_white_peace_effect = yes -# scope:attacker = { -# add_prestige = medium_prestige_loss -# } -# -# # Allies on both sides get full prestige value for helping in the war, based on their war participation. -# modify_allies_of_participants_fame_values = { -# WINNER = scope:attacker # not important as the scales are identical -# FAME_BASE = major_prestige_value -# IS_RELIGIOUS_WAR = no -# WINNER_ALLY_FAME_SCALE = 1 -# LOSER_ALLY_FAME_SCALE = 1 -# } -# } -# -# on_defeat_desc = { -# first_valid = { -# triggered_desc = { -# trigger = { scope:attacker = scope:defender.top_liege } -# desc = japan_demand_administrative_cb_defeat_desc_independence -# } -# desc = japan_demand_administrative_cb_defeat_desc -# } -# } -# -# on_defeat = { -# on_defeat_effect = yes -# -# scope:defender = { -# #EP2 accolade glory gain for winning against higher ranked enemy -# accolade_defender_war_end_glory_gain_high_effect = yes -# } -# -# # If Regent themselves failed to assert authority -# if = { -# limit = { scope:attacker = scope:defender.top_liege } -# scope:attacker = { -# add_prestige = major_prestige_loss -# switch = { -# trigger = has_realm_law -# japanese_bureaucracy_3 = { add_realm_law = japanese_bureaucracy_2 } -# japanese_bureaucracy_2 = { add_realm_law = japanese_bureaucracy_1 } -# japanese_bureaucracy_1 = { add_realm_law = japanese_bureaucracy_0 } -# fallback = { force_step_down_landed_titles = yes } -# } -# } -# } -# -# # Allies on both sides get full prestige value for helping in the war, based on their war participation. -# modify_allies_of_participants_fame_values = { -# WINNER = scope:defender -# FAME_BASE = major_prestige_value -# IS_RELIGIOUS_WAR = no -# WINNER_ALLY_FAME_SCALE = 1 -# LOSER_ALLY_FAME_SCALE = 1 -# } -# } -# -# on_primary_attacker_death = inherit -# on_primary_defender_death = inherit -# -# attacker_allies_inherit = yes -# defender_allies_inherit = yes -# -# war_name = "JAPAN_DEMAND_ADMINISTRATIVE_WAR_NAME" -# war_name_base = "JAPAN_DEMAND_ADMINISTRATIVE_WAR_NAME_BASE" -# cb_name = "JAPAN_DEMAND_ADMINISTRATIVE_CB_NAME" -# interface_priority = 80 -# -# ticking_war_score_targets_entire_realm = yes -# attacker_ticking_warscore = 0.01 -# attacker_wargoal_percentage = 0.01 -# attacker_score_from_occupation_scale = 50 -# defender_score_from_occupation_scale = 50 -# attacker_score_from_battles_scale = 250 -# defender_score_from_battles_scale = 250 -# -# max_attacker_score_from_battles = 200 -# max_defender_score_from_battles = 200 -# -# max_defender_score_from_occupation = 50 -# max_attacker_score_from_occupation = 50 -# -# max_ai_diplo_distance_to_title = 500 -# -# ai_score = { -# value = japan_demand_administrative_ai_score_value -# } -# -# ai_score_mult = { -# value = 1 -# add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing -# } -#} -# -## War to conquer Japan -#japan_imperial_expansion_cb = { -# icon = ritsuryo_government -# group = conquest -# combine_into_one = yes -# ai_only_against_neighbors = yes -# allow_hostages = no -# should_show_war_goal_subview = yes -# -# target_titles = all -# target_title_tier = county -# ignore_effect = change_title_holder -# -# mutually_exclusive_titles = { always = yes } -# -# cost = { -# prestige = { -# add = { -# value = 100 -# desc = CB_BASE_COST -# } -# multiply = common_cb_prestige_cost_multiplier -# } -# } -# -# # root = scope:attacker -# allowed_for_character = { -# japan_imperial_expansion_cb_allowed_for_character_trigger = yes -# } -# -# # root = scope:attacker -# allowed_for_character_display_regardless = { -# # Required Policy -# top_liege = { has_realm_law = imperial_expansion_law } -# } -# -# # root = scope:defender, scope:attacker -# allowed_against_character = { -# japan_imperial_expansion_cb_allowed_against_character_trigger = yes -# } -# -# # root = scope:defender, scope:attacker -# allowed_against_character_display_regardless = { -# # Must be neighbours, but we want to show casus belli in list regardless -# custom_tooltip = { -# text = japan_imperial_expansion_cb_neighbour_tt -# any_sub_realm_county = { -# any_title_to_title_neighboring_and_across_water_county = { holder.top_liege = scope:attacker.top_liege } -# } -# } -# } -# -# # root = scope:attacker, scope:defender, scope:target -# valid_to_start_display_regardless = { -# custom_tooltip = { -# text = tgp_japan_pacification_war_valid_empire_tt -# NOT = { scope:target.empire ?= title:e_britannia } -# } -# custom_tooltip = { -# text = tgp_japan_pacification_war_valid_region_tt -# scope:target.title_province ?= { -# OR = { -# geographical_region = world_asia_japan -# geographical_region = world_asia_sakhalin_hokkaido -# } -# } -# } -# } -# -# valid_to_start = { -# scope:target = { -# is_landless_type_title = no -# } -# } -# -# should_invalidate = { -# OR = { -# war_should_invalidate_defender_lost_target_lands_trigger = yes -# scope:attacker = { japan_imperial_expansion_cb_allowed_for_character_trigger = no } -# scope:defender = { japan_imperial_expansion_cb_allowed_against_character_trigger = no } -# } -# } -# -# on_invalidated_desc = { -# first_valid = { -# triggered_desc = { -# trigger = { -# scope:attacker = { japan_imperial_expansion_cb_allowed_for_character_trigger = no } -# } -# desc = japan_imperial_expansion_cb_ended_invalid.desc.attacker -# } -# desc = japan_imperial_expansion_cb_ended_invalid.desc -# } -# } -# -# on_declaration = { -# on_declared_war = yes -# } -# -# on_victory_desc = { -# desc = { -# first_valid = { -# triggered_desc = { -# trigger = { -# scope:attacker = { -# is_local_player = yes -# is_independent_ruler = yes -# } -# } -# desc = japan_imperial_expansion_cb_victory_desc_attacker -# } -# desc = japan_imperial_expansion_cb_victory_desc -# } -# triggered_desc = { -# trigger = { -# scope:attacker = { is_independent_ruler = no } -# } -# desc = japan_demand_administrative_cb_victory_vassal_desc -# } -# } -# } -# -# on_victory = { -# on_victory_aggressive_war_effect = yes -# -# #EP2 Accolade glory gain from winning against higher ranked enemy -# scope:attacker = { accolade_attacker_war_end_glory_gain_low_effect = yes } -# -# create_title_and_vassal_change = { -# type = conquest -# save_scope_as = change -# add_claim_on_loss = yes -# } -# -# #As this is just a county conquest, simply grab the designated county. -# every_in_list = { -# list = target_titles -# change_title_holder = { -# holder = scope:attacker.top_liege # For the top liege -# change = scope:change -# } -# } -# -# resolve_title_and_vassal_change = scope:change -# -# # Appreciation for the Attacker, if relevant -# scope:attacker = { -# if = { -# limit = { is_independent_ruler = no } -# reverse_add_opinion = { -# target = scope:attacker.top_liege -# modifier = enforced_pacification_opinion -# } -# } -# } -# -# # Influence/Prestige Progress for the Attacker -# scope:attacker = { -# if = { -# limit = { is_independent_ruler = no } -# if = { -# limit = { government_has_flag = government_has_influence } -# change_influence = japan_imperial_expansion_war_influence_value -# } -# else = { add_prestige_experience = japan_imperial_expansion_war_prestige_value } -# } -# else = { -# # Prestige Progress for the Attacker -# every_in_list = { -# list = target_titles -# scope:attacker = { add_prestige_experience = medium_prestige_value } -# } -# } -# } -# -# # Allies on both sides get full prestige value for helping in the war, based on their war participation. -# modify_allies_of_participants_fame_values = { -# WINNER = scope:attacker -# FAME_BASE = medium_prestige_value -# IS_RELIGIOUS_WAR = no -# WINNER_ALLY_FAME_SCALE = 1 -# LOSER_ALLY_FAME_SCALE = 1 -# } -# -# if = { # Warning that only counties are changing hands -# limit = { -# any_in_list = { -# list = target_titles -# tier = tier_duchy -# } -# } -# random_in_list = { -# list = target_titles -# limit = { tier = tier_duchy } -# save_scope_as = de_jure_target -# } -# } -# } -# -# on_white_peace_desc = { -# desc = { -# first_valid = { -# triggered_desc = { -# trigger = { scope:defender = { is_local_player = yes } } -# desc = county_conquest_cb_white_peace_desc_defender -# } -# desc = county_conquest_cb_white_peace_desc -# } -# } -# } -# -# on_white_peace = { -# on_white_peace_effect = yes -# -# #EP2 accolade glory gain for doing pretty good against higher ranked enemy -# scope:defender = { accolade_defender_war_end_glory_gain_low_effect = yes } -# -# scope:attacker = { -# add_prestige = { -# value = minor_prestige_value -# multiply = -1.0 -# } -# } -# -# # Allies on both sides get full prestige value for helping in the war, based on their war participation. -# modify_allies_of_participants_fame_values = { -# WINNER = scope:attacker # not impactful as the scale are identical -# FAME_BASE = medium_prestige_value -# IS_RELIGIOUS_WAR = no -# WINNER_ALLY_FAME_SCALE = 1 -# LOSER_ALLY_FAME_SCALE = 1 -# } -# } -# -# on_defeat_desc = { -# desc = { -# first_valid = { -# triggered_desc = { -# trigger = { scope:attacker = { is_local_player = yes } } -# desc = county_conquest_cb_defeat_desc_attacker -# } -# desc = county_conquest_cb_defeat_desc -# } -# } -# } -# -# on_defeat = { -# on_defeat_aggressive_war_effect = yes -# -# scope:defender = { -# #EP2 accolade glory gain for winning against higher ranked enemy -# accolade_defender_war_end_glory_gain_high_effect = yes -# # Prestige for Defender -# add_prestige_war_defender_effect = { -# PRESTIGE_VALUE = medium_prestige_value -# } -# } -# -# # Prestige loss for the attacker -# scope:attacker = { -# pay_short_term_gold_reparations_effect = { -# GOLD_VALUE = 3 -# } -# add_prestige = { -# value = major_prestige_value -# multiply = -1.0 -# } -# } -# -# # Allies on both sides get full prestige value for helping in the war, based on their war participation. -# modify_allies_of_participants_fame_values = { -# WINNER = scope:defender -# FAME_BASE = major_prestige_value -# IS_RELIGIOUS_WAR = no -# WINNER_ALLY_FAME_SCALE = 1 -# LOSER_ALLY_FAME_SCALE = 1 -# } -# } -# -# on_primary_attacker_death = inherit -# on_primary_defender_death = inherit -# -# attacker_allies_inherit = yes -# defender_allies_inherit = yes -# -# war_name = "JAPAN_IMPERIAL_EXPANSION_WAR_NAME" -# war_name_base = "JAPAN_IMPERIAL_EXPANSION_WAR_NAME_BASE" -# cb_name = "JAPAN_IMPERIAL_EXPANSION_CB_NAME" -# interface_priority = 80 -# -# ticking_war_score_targets_entire_realm = yes -# attacker_ticking_warscore = 0.01 -# attacker_wargoal_percentage = 0.01 -# attacker_score_from_occupation_scale = 50 -# defender_score_from_occupation_scale = 50 -# attacker_score_from_battles_scale = 250 -# defender_score_from_battles_scale = 250 -# -# max_attacker_score_from_battles = 200 -# max_defender_score_from_battles = 200 -# -# max_defender_score_from_occupation = 50 -# max_attacker_score_from_occupation = 50 -# -# max_ai_diplo_distance_to_title = 500 -# -# ai_score = { -# value = japan_imperial_expansion_ai_score_value -# } -# -# ai_score_mult = { -# value = 1 -# add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing -# } -#} -# -## War to reconquer Japan -#japan_imperial_reconquest_cb = { -# icon = ritsuryo_government -# group = de_jure -# -# war_name = "JAPAN_IMPERIAL_RECONQUEST_WAR_NAME" -# war_name_base = "JAPAN_IMPERIAL_RECONQUEST_WAR_NAME_BASE" -# cb_name = "JAPAN_IMPERIAL_RECONQUEST_CB_NAME" -# interface_priority = 80 -# -# combine_into_one = yes -# should_show_war_goal_subview = yes -# mutually_exclusive_titles = { always = yes } -# -# cost = { -# prestige = { -# scope:defender = { -# every_sub_realm_county = { -# limit = { empire = title:e_britannia } -# add = { -# value = 50 -# desc = japan_imperial_reconquest_cb_cost_tt -# } -# } -# } -# multiply = common_cb_prestige_cost_multiplier -# } -# } -# -# allow_hostages = no -# -# target_titles = all -# target_title_tier = duchy -# target_de_jure_regions_above = yes -# ignore_effect = change_title_holder -# ai_only_against_neighbors = yes -# -# # root = scope:attacker -# allowed_for_character = { -# japan_imperial_reconquest_cb_allowed_for_character_trigger = yes -# } -# -# # root = scope:attacker -# allowed_for_character_display_regardless = { -# top_liege = { has_realm_law = defense_mobilization_law } -# } -# -# # root = scope:defender, scope:attacker -# allowed_against_character = { -# japan_imperial_reconquest_cb_allowed_against_character_trigger = yes -# } -# -# valid_to_start = { -# scope:target = { -# empire = title:e_japan -# } -# } -# -# # root = scope:attacker, scope:defender, scope:target -# valid_to_start_display_regardless = { -# custom_tooltip = { -# text = tgp_japan_reconquest_war_valid_de_jure_tt -# scope:target.empire ?= title:e_japan -# } -# } -# -# should_invalidate = { -# OR = { -# war_should_invalidate_defender_lost_target_lands_trigger = yes -# scope:attacker = { japan_imperial_reconquest_cb_allowed_for_character_trigger = no } -# scope:defender = { japan_imperial_reconquest_cb_allowed_against_character_trigger = no } -# } -# } -# -# on_invalidated_desc = { -# first_valid = { -# triggered_desc = { -# trigger = { -# scope:attacker = { japan_imperial_reconquest_cb_allowed_for_character_trigger = no } -# } -# desc = japan_imperial_reconquest_cb_ended_invalid.desc.attacker -# } -# desc = japan_imperial_reconquest_cb_ended_invalid.desc -# } -# } -# -# on_declaration = { -# on_declared_war = yes -# } -# -# on_victory_desc = { -# desc = { -# first_valid = { -# triggered_desc = { -# trigger = { scope:attacker = { is_local_player = yes } } -# desc = de_jure_cb_victory_desc_attacker -# } -# desc = japan_imperial_reconquest_cb_victory_desc -# } -# triggered_desc = { -# trigger = { -# scope:attacker = { is_independent_ruler = no } -# } -# desc = japan_demand_administrative_cb_victory_vassal_desc -# } -# } -# } -# -# on_victory = { -# on_victory_aggressive_war_effect = yes -# -# #EP2 Accolade glory gain from winning against higher ranked enemy -# scope:attacker = { accolade_attacker_war_end_glory_gain_low_effect = yes } -# -# # Influence/Prestige Progress reward for Attacker -# scope:attacker = { -# if = { -# limit = { is_independent_ruler = no } -# if = { -# limit = { government_has_flag = government_has_influence } -# change_influence = japan_imperial_reconquest_war_influence_value -# } -# else = { add_prestige_experience = japan_imperial_reconquest_war_prestige_value } -# } -# } -# -# create_title_and_vassal_change = { -# type = conquest -# save_scope_as = change -# add_claim_on_loss = yes -# } -# -# every_in_list = { -# list = target_titles -# save_temporary_scope_as = target -# } -# -# setup_de_jure_cb = { -# attacker = scope:attacker -# defender = scope:defender -# change = scope:change -# title = scope:target -# } -# resolve_title_and_vassal_change = scope:change -# -# # Prestige Progress for the Attacker -# every_in_list = { -# list = target_titles -# scope:attacker = { add_prestige_experience = minor_prestige_value } -# } -# -# # Allies on both sides get full prestige value for helping in the war, based on their war participation. -# modify_allies_of_participants_fame_values = { -# WINNER = scope:attacker -# FAME_BASE = major_prestige_value -# IS_RELIGIOUS_WAR = no -# WINNER_ALLY_FAME_SCALE = 1 -# LOSER_ALLY_FAME_SCALE = 1 -# } -# } -# -# on_white_peace_desc = { -# desc = { -# first_valid = { -# triggered_desc = { -# trigger = { scope:defender = { is_local_player = yes } } -# desc = county_conquest_cb_white_peace_desc_defender -# } -# desc = county_conquest_cb_white_peace_desc -# } -# } -# } -# -# on_white_peace = { -# on_white_peace_effect = yes -# -# #EP2 accolade glory gain for doing ok against higher ranked enemy -# scope:defender = { accolade_defender_war_end_glory_gain_low_effect = yes } -# -# setup_de_jure_cb = { -# attacker = scope:attacker -# defender = scope:defender -# victory = no -# title = scope:target -# } -# } -# -# on_defeat_desc = { -# desc = { -# first_valid = { -# triggered_desc = { -# trigger = { scope:attacker = { is_local_player = yes } } -# desc = county_conquest_cb_defeat_desc_attacker -# } -# desc = county_conquest_cb_defeat_desc -# } -# } -# } -# -# on_defeat = { -# on_defeat_aggressive_war_effect = yes -# -# scope:defender = { -# #EP2 accolade glory gain for winning against higher ranked enemy -# accolade_defender_war_end_glory_gain_high_effect = yes -# } -# -# scope:attacker = { -# pay_short_term_gold_reparations_effect = { -# GOLD_VALUE = 10 -# } -# } -# -# setup_de_jure_cb = { -# attacker = scope:attacker -# defender = scope:defender -# victory = no -# title = scope:target -# } -# } -# -# on_primary_attacker_death = inherit -# on_primary_defender_death = inherit -# -# attacker_allies_inherit = yes -# defender_allies_inherit = yes -# -# attacker_wargoal_percentage = 0.8 -# -# max_defender_score_from_occupation = 150 -# max_attacker_score_from_occupation = 150 -# -# max_ai_diplo_distance_to_title = 500 -# -# ai_score = { -# value = japan_imperial_reconquest_ai_score_value -# } -# -# ai_score_mult = { -# value = 1 -# add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing -# } -#} -# -## War to reimpose Ritsuryo -#japan_refused_ritsuryo_cb = { -# icon = dissolution_war -# group = civil_war -# ai_only_against_liege = yes -# allow_hostages = no -# allowed_for_character = { -# scope:attacker = { -# liege = scope:defender -# NOT = { government_has_flag = government_is_japan_administrative } -# } -# } -# -# allowed_against_character = { -# scope:attacker = { -# liege = scope:defender -# } -# } -# -# target_de_jure_regions_above = yes -# -# valid_to_start = { -# } -# -# should_invalidate = { -# OR = { -# scope:attacker = { -# NOT = { -# any_liege_or_above = { this = scope:defender } -# } -# } -# scope:defender = { is_landed = no } -# } -# } -# -# on_declaration = { -# # save the initial target and their tier for conditioning the depose effect -# if = { -# limit = { NOT = { exists = scope:attacker.var:initial_target } } -# scope:attacker = { -# set_variable = { -# name = initial_target -# value = scope:defender -# } -# set_variable = { -# name = target_tier -# value = scope:defender.primary_title.tier -# } -# } -# } -# } -# -# on_victory_desc = { -# first_valid = { -# triggered_desc = { -# trigger = { -# scope:defender = { is_local_player = yes } -# depose_war_victory_trigger = yes -# } -# desc = japan_refused_ritsuryo_cb_victory_desc_defender -# } -# triggered_desc = { -# trigger = { -# depose_war_victory_trigger = yes -# } -# desc = japan_refused_ritsuryo_cb_victory_desc -# } -# } -# } -# -# on_victory = { -# on_victory_faction_war_effect = yes -# -# #EP2 Accolade glory gain from winning against higher ranked enemy -# scope:attacker = { accolade_attacker_war_end_glory_gain_med_effect = yes } -# -# scope:defender = { -# # If we win the rebellion, our liege loses any legal right to imprison us/banish us/revoke our titles. -# consume_all_criminal_reasons_effect = { -# LIEGE = scope:defender -# CRIMINAL = scope:attacker -# } -# -# add_prestige = -500 -# -# # JAPAN - liege is replaced by the attacker -# create_title_and_vassal_change = { -# type = conquest -# save_scope_as = title_change -# } -# title:c_yamashiro ?= { -# if = { -# limit = { holder = scope:defender } -# change_title_holder_include_vassals = { -# holder = scope:attacker -# change = scope:title_change -# } -# } -# } -# scope:defender = { -# every_held_title = { -# limit = { tier >= tier_empire } -# change_title_holder_include_vassals = { -# holder = scope:attacker -# change = scope:title_change -# } -# } -# } -# resolve_title_and_vassal_change = scope:title_change -# } -# -# hidden_effect = { -# scope:attacker = { -# add_truce_both_ways = { -# character = scope:defender -# days = 1825 -# war = root.war -# result = victory -# } -# } -# } -# } -# -# on_white_peace_desc = { -# first_valid = { -# triggered_desc = { -# trigger = { scope:defender = { is_local_player = yes } } -# desc = japan_refused_ritsuryo_cb_white_peace_desc_defender -# } -# desc = japan_refused_ritsuryo_cb_white_peace_desc -# } -# } -# -# on_white_peace = { -# on_white_peace_faction_war_effect = yes -# } -# -# on_defeat_desc = { -# first_valid = { -# triggered_desc = { -# trigger = { scope:defender = { is_local_player = yes } } -# desc = japan_refused_ritsuryo_cb_defeat_desc_defender -# } -# desc = japan_refused_ritsuryo_cb_defeat_desc -# } -# } -# -# on_defeat = { -# on_defeat_faction_war_effect = yes -# -# scope:defender = { -# add_character_flag = { -# flag = recent_liberty_faction_war -# years = 10 -# } -# add_dread = medium_dread_gain -# } -# -# # For revoking titles of character's imprisoned abroad who have lost a revocation war -# hidden_effect = { -# if = { -# limit = { -# scope:attacker = { -# is_imprisoned = yes -# NOT = { is_imprisoned_by = scope:defender } -# } -# } -# scope:defender = { -# add_opinion = { -# target = scope:attacker -# modifier = foreign_prison_revocation_opinion -# } -# } -# } -# } -# } -# -# on_invalidated_desc = msg_invalidate_war_title -# -# check_attacker_inheritance_validity = no -# -# on_primary_attacker_death = invalidate -# on_primary_defender_death = inherit -# -# transfer_behavior = transfer -# -# attacker_allies_inherit = yes -# defender_allies_inherit = yes -# -# war_name = "JAPAN_REFUSED_RITSURYO_WAR_NAME" -# -# interface_priority = 80 -# -# use_de_jure_wargoal_only = yes -# -# attacker_wargoal_percentage = 0.8 -# -# max_attacker_score_from_battles = 100 -# max_defender_score_from_battles = 50 -# -# max_defender_score_from_occupation = 150 -# max_attacker_score_from_occupation = 150 -# -# max_ai_diplo_distance_to_title = 500 -# -# ai_score_mult = { -# value = 1 -# add = common_cb_ai_score_mult_additive -# multiply = aggressive_cb_ai_score_mult -# multiply = common_cb_ai_score_mult -# } -#} -# -## Eradicate Rival House -#eradicate_house_cb = { -# icon = execute -# group = subjugation -# combine_into_one = yes -# ai_only_against_neighbors = yes -# allow_hostages = no -# should_show_war_goal_subview = no -# -# # scope:attacker -# allowed_for_character = { -# #Display so once a player has bad house relations they can be tempted to make them worse to validate cb -# trigger_if = { -# limit = { -# is_ai = yes -# } -# house ?= { -# any_house_relation = { -# has_house_relation_level = feud -# } -# } -# } -# trigger_else = { -# house ?= { -# any_house_relation = { -# OR = { -# has_house_relation_level = quarrel -# has_house_relation_level = rivalry -# has_house_relation_level = feud -# } -# } -# } -# } -# } -# -# # scope:defender -# allowed_against_character = { -# is_landed = yes -# #Can't be the attacker's top liege -# NOR = { -# is_vassal_or_below_of = scope:attacker -# is_liege_or_above_of = scope:attacker -# } -# } -# -# valid_to_start = { -# #We need the worst house relations -# tgp_has_house_relation_level_trigger = { -# HOUSE_1_MEMBER = scope:attacker -# HOUSE_2_MEMBER = scope:defender -# LEVEL = feud -# } -# } -# -# cost = { -# prestige = { -# add = { -# value = 100 -# desc = CB_BASE_COST -# } -# multiply = common_cb_prestige_cost_multiplier -# } -# } -# -# should_invalidate = { -# #cancel if they become friendly -# OR = { -# NOT = { -# tgp_has_house_relation_level_trigger = { -# HOUSE_1_MEMBER = scope:attacker -# HOUSE_2_MEMBER = scope:defender -# LEVEL = feud -# } -# } -# scope:defender = { is_landed = no } -# } -# } -# -# on_invalidated_desc = { -# desc = eradicate_house_cb_ended_invalid.desc -# } -# -# on_declaration = { -# on_declared_war = yes -# } -# -# on_victory_desc = { -# desc = eradicate_house_cb_victory_desc -# } -# -# on_victory = { -# on_victory_aggressive_war_effect = yes -# -# scope:attacker = { -# if = { -# limit = { -# is_ai = no -# } -# add_achievement_global_variable_effect = { -# VARIABLE = finished_ep4_07_cut_off_the_head_and_the_body_will_follow_achievement -# VALUE = yes -# } -# } -# } -# -# #EP2 Accolade glory gain from winning against higher ranked enemy -# scope:attacker = { accolade_attacker_war_end_glory_gain_low_effect = yes } -# -# scope:attacker = { -# add_prestige = { -# value = scope:defender.tier_scaled_prestige_value -# } -# } -# -# scope:defender = { -# add_prestige = { -# value = 0 -# subtract = tier_scaled_prestige_value -# } -# } -# #Show land transfer -# show_as_tooltip = { -# #loser/winner scopes are only being set here to correctly display the effects of tgp_japan_soryo_eradicate_cb_transfer_effect in the tooltip! -# scope:defender = { -# save_scope_as = loser -# } -# scope:attacker = { -# save_scope_as = winner -# } -# tgp_japan_soryo_eradicate_cb_transfer_effect = yes -# } -# #show death -# show_as_tooltip = { -# scope:defender = { -# death = { -# death_reason = death_eradicated -# killer = scope:attacker -# } -# } -# scope:defender = { -# every_courtier = { -# custom = every_close_family_house_member_in_court_cb_win_desc -# limit = { -# house = scope:defender.house -# NOT = { -# scope:defender.primary_heir ?= this -# } -# } -# death = { -# death_reason = death_eradicated -# killer = scope:attacker -# } -# } -# } -# } -# -# # Allies on both sides get full prestige value for helping in the war, based on their war participation. -# modify_allies_of_participants_fame_values = { -# WINNER = scope:attacker -# FAME_BASE = major_prestige_value -# IS_RELIGIOUS_WAR = no -# WINNER_ALLY_FAME_SCALE = 1 -# LOSER_ALLY_FAME_SCALE = 1 -# } -# -# #Eradicate House follow up event -# scope:defender = { -# trigger_event = tgp_japan_general.9550 -# } -# } -# -# on_white_peace_desc = { -# desc = eradicate_house_cb_white_peace_desc -# } -# on_white_peace = { -# on_white_peace_effect = yes -# scope:attacker = { -# add_prestige = medium_prestige_loss -# } -# -# # Allies on both sides get full prestige value for helping in the war, based on their war participation. -# modify_allies_of_participants_fame_values = { -# WINNER = scope:attacker # not important as the scales are identical -# FAME_BASE = major_prestige_value -# IS_RELIGIOUS_WAR = no -# WINNER_ALLY_FAME_SCALE = 1 -# LOSER_ALLY_FAME_SCALE = 1 -# } -# } -# -# on_defeat_desc = { -# desc = eradicate_house_cb_defeat_desc -# } -# -# on_defeat = { -# on_defeat_aggressive_war_effect = yes -# -# scope:defender = { -# #EP2 accolade glory gain for winning against higher ranked enemy -# accolade_defender_war_end_glory_gain_high_effect = yes -# } -# -# scope:attacker = { -# add_prestige = { -# value = 0 -# subtract = tier_scaled_prestige_value -# } -# } -# scope:defender = { -# add_prestige = { -# value = tier_scaled_prestige_value -# } -# } -# #Show land transfer -# show_as_tooltip = { -# #loser/winner scopes are only being set here to correctly display the effects of tgp_japan_soryo_eradicate_cb_transfer_effect in the tooltip! -# scope:defender = { -# save_scope_as = winner -# } -# scope:attacker = { -# save_scope_as = loser -# } -# tgp_japan_soryo_eradicate_cb_transfer_effect = yes -# } -# #Show killing -# show_as_tooltip = { -# scope:attacker = { -# death = { -# death_reason = death_eradicated -# killer = scope:defender -# } -# } -# scope:attacker = { -# every_courtier = { -# custom = every_close_family_house_member_in_court_cb_lose_desc -# limit = { -# house = scope:attacker.house -# this != scope:attacker.primary_heir -# } -# death = { -# death_reason = death_eradicated -# killer = scope:defender -# } -# } -# } -# } -# # Allies on both sides get full prestige value for helping in the war, based on their war participation. -# modify_allies_of_participants_fame_values = { -# WINNER = scope:defender -# FAME_BASE = major_prestige_value -# IS_RELIGIOUS_WAR = no -# WINNER_ALLY_FAME_SCALE = 1 -# LOSER_ALLY_FAME_SCALE = 1 -# } -# -# #Eradicate House follow up event -# scope:attacker = { -# trigger_event = tgp_japan_general.9550 -# } -# } -# -# on_primary_attacker_death = inherit -# on_primary_defender_death = inherit -# -# attacker_allies_inherit = yes -# defender_allies_inherit = yes -# -# war_name = "ERADICATE_HOUSE_WAR_NAME" -# war_name_base = "ERADICATE_HOUSE_WAR_NAME_BASE" -# cb_name = "ERADICATE_HOUSE_CB_NAME" -# interface_priority = 80 -# -# ticking_war_score_targets_entire_realm = yes -# attacker_ticking_warscore = 0.01 -# attacker_wargoal_percentage = 0.01 -# attacker_score_from_occupation_scale = 100 -# defender_score_from_occupation_scale = 100 -# attacker_score_from_battles_scale = 150 -# defender_score_from_battles_scale = 150 -# -# max_attacker_score_from_battles = 200 -# max_defender_score_from_battles = 200 -# -# max_defender_score_from_occupation = 50 -# max_attacker_score_from_occupation = 50 -# -# max_ai_diplo_distance_to_title = 500 -# -# ai_score_mult = { -# value = 1 -# add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing -# } -#} -# -## War to become Soryo as prime_minister -#japan_establish_soryo_administration_cb = { -# icon = soryo -# group = subjugation -# combine_into_one = yes -# allow_hostages = no -# should_show_war_goal_subview = no -# -# # scope:attacker -# allowed_for_character = { -# has_tgp_dlc_trigger = yes -# always = no # Started by script -# } -# -# should_invalidate = { -# scope:defender = { government_has_flag = government_is_japan_feudal } -# } -# -# on_invalidated_desc = { -# desc = japan_establish_soryo_administration_cb_ended_invalid.desc -# } -# -# on_victory_desc = { -# desc = japan_establish_soryo_administration_cb_victory_desc -# } -# -# on_victory = { -# on_victory_effect = yes -# -# scope:attacker = { -# save_scope_as = leader -# } -# scope:defender = { -# save_scope_as = daijo_daijin -# } -# -# #EP2 Accolade glory gain from winning against higher ranked enemy -# scope:attacker = { accolade_attacker_war_end_glory_gain_low_effect = yes } -# -# scope:attacker = { -# add_prestige = { -# value = scope:defender.tier_scaled_prestige_value -# } -# } -# -# scope:defender = { -# add_prestige = { -# value = 0 -# subtract = tier_scaled_prestige_value -# } -# } -# -# scope:defender = { -# faction_demand_regent_transfer_effect = { -# NEW_REGENT = scope:attacker -# REASON = conquest -# } -# } -# -# # Prestige Progress for the Attacker -# every_in_list = { -# list = target_titles -# scope:attacker = { add_prestige_experience = minor_prestige_value } -# } -# -# # Allies on both sides get full prestige value for helping in the war, based on their war participation. -# modify_allies_of_participants_fame_values = { -# WINNER = scope:attacker -# FAME_BASE = major_prestige_value -# IS_RELIGIOUS_WAR = no -# WINNER_ALLY_FAME_SCALE = 1 -# LOSER_ALLY_FAME_SCALE = 1 -# } -# -# scope:defender = { -# every_character_war = { -# limit = { is_attacker = scope:attacker } -# every_war_defender = { -# limit = { is_imprisoned = no } -# hidden_effect = { -# hard_imprison_character_effect = { -# TARGET = this -# IMPRISONER = scope:attacker -# } -# reverse_add_opinion = { -# target = scope:attacker -# modifier = vassal_lost_faction_revolt_war -# } -# } -# } -# } -# } -# } -# -# on_white_peace_desc = { -# desc = japan_establish_soryo_administration_cb_white_peace_desc -# } -# -# on_white_peace = { -# on_white_peace_effect = yes -# scope:attacker = { -# add_prestige = medium_prestige_loss -# } -# -# # Allies on both sides get full prestige value for helping in the war, based on their war participation. -# modify_allies_of_participants_fame_values = { -# WINNER = scope:attacker # not important as the scales are identical -# FAME_BASE = major_prestige_value -# IS_RELIGIOUS_WAR = no -# WINNER_ALLY_FAME_SCALE = 1 -# LOSER_ALLY_FAME_SCALE = 1 -# } -# } -# -# on_defeat_desc = { -# desc = japan_establish_soryo_administration_cb_defeat_desc -# } -# -# on_defeat = { -# on_defeat_effect = yes -# scope:attacker = { -# save_scope_as = leader -# } -# scope:defender = { -# save_scope_as = daijo_daijin -# show_as_tooltip = { japanese_establish_soryo_administration_reward_effect = yes } -# trigger_event = tgp_japan_decision.9606 -# } -# -# scope:defender = { -# #EP2 accolade glory gain for winning against higher ranked enemy -# accolade_defender_war_end_glory_gain_high_effect = yes -# } -# -# scope:attacker = { -# add_prestige = { -# value = 0 -# subtract = tier_scaled_prestige_value -# } -# } -# -# scope:defender = { -# add_prestige = { -# value = tier_scaled_prestige_value -# } -# } -# -# # Allies on both sides get full prestige value for helping in the war, based on their war participation. -# modify_allies_of_participants_fame_values = { -# WINNER = scope:defender -# FAME_BASE = major_prestige_value -# IS_RELIGIOUS_WAR = no -# WINNER_ALLY_FAME_SCALE = 1 -# LOSER_ALLY_FAME_SCALE = 1 -# } -# -# scope:attacker = { -# every_character_war = { -# limit = { is_defender = scope:defender } -# every_war_attacker = { -# limit = { is_imprisoned = no } -# hidden_effect = { -# hard_imprison_character_effect = { -# TARGET = this -# IMPRISONER = scope:defender -# } -# reverse_add_opinion = { -# target = scope:defender -# modifier = vassal_lost_faction_revolt_war -# } -# } -# } -# } -# } -# } -# -# on_primary_attacker_death = inherit -# on_primary_defender_death = inherit -# -# attacker_allies_inherit = yes -# defender_allies_inherit = yes -# -# war_name = "JAPAN_ESTABLISH_SORYO_ADMINISTRATION_WAR_NAME" -# war_name_base = "JAPAN_ESTABLISH_SORYO_ADMINISTRATION_WAR_NAME_BASE" -# cb_name = "JAPAN_ESTABLISH_SORYO_ADMINISTRATION_CB_NAME" -# interface_priority = 80 -# -# ticking_war_score_targets_entire_realm = yes -# attacker_ticking_warscore = 0.01 -# attacker_wargoal_percentage = 0.01 -# attacker_score_from_occupation_scale = 50 -# defender_score_from_occupation_scale = 50 -# attacker_score_from_battles_scale = 250 -# defender_score_from_battles_scale = 250 -# -# max_attacker_score_from_battles = 200 -# max_defender_score_from_battles = 200 -# -# max_defender_score_from_occupation = 50 -# max_attacker_score_from_occupation = 50 -#} -# -## War to disrupt Bloc -#japan_bloc_war_cb = { -# icon = bloc -# group = subjugation -# combine_into_one = yes -# ai_only_against_neighbors = yes -# allow_hostages = yes -# should_show_war_goal_subview = no -# -# # scope:attacker -# allowed_for_character = { -# has_tgp_dlc_trigger = yes -# # Soryo Bloc leader checks -# tgp_soryo_or_bushido_trigger = yes -# is_house_head = yes -# house.house_confederation.leading_house ?= house -# any_held_title = { is_noble_family_title = yes } -# } -# -# allowed_for_character_display_regardless = { -# custom_tooltip = { -# text = japan_bloc_war_cb_cohesion_requirement_tt -# house.house_confederation.cohesion >= 25 -# } -# } -# -# # scope:defender -# allowed_against_character = { -# tgp_soryo_or_bushido_trigger = yes -# is_house_head = yes -# house.house_confederation.leading_house ?= house -# NOR = { -# # Must be different Bloc -# AND = { -# exists = scope:attacker.house.house_confederation -# house.house_confederation ?= scope:attacker.house.house_confederation -# } -# # Not any ongoing bloc war -# any_character_war = { -# using_cb = japan_bloc_war_cb -# save_temporary_scope_as = war_temp -# scope:attacker = { is_participant_in_war = scope:war_temp } -# } -# } -# # Must be house head -# any_held_title = { is_noble_family_title = yes } -# } -# -# should_invalidate = { -# OR = { -# scope:attacker = { tgp_soryo_or_bushido_trigger = no } -# scope:defender = { -# OR = { -# tgp_soryo_or_bushido_trigger = no -# NOT = { exists = house.house_confederation } # Left bloc -# house.house_confederation ?= scope:attacker.house.house_confederation # Same bloc -# is_landed = no -# } -# } -# } -# } -# -# cost = { -# prestige = { -# add = { -# value = 100 -# desc = CB_BASE_COST -# } -# multiply = common_cb_prestige_cost_multiplier -# } -# } -# -# on_invalidated_desc = { -# desc = japan_bloc_war_cb_ended_invalid.desc -# } -# -# on_declaration = { -# on_declared_war = yes -# add_attacker_bloc_members_on_declared_effect = yes -# } -# -# on_victory_desc = { -# desc = japan_bloc_war_cb_victory_desc -# } -# -# on_victory = { -# on_victory_effect = yes -# -# scope:attacker = { -# save_scope_as = winner -# house.house_confederation = { -# tgp_bloc_change_cohesion_effect = { -# VALUE = tgp_bloc_war_defeat_cohesion_victory_value -# ICON = scope:defender -# REASON = bloc_war_victory -# } -# } -# } -# -# scope:defender = { -# save_scope_as = loser -# house.house_confederation = { -# tgp_bloc_change_cohesion_effect = { -# VALUE = tgp_bloc_war_defeat_cohesion_defeat_value -# ICON = scope:defender -# REASON = bloc_war_defeat -# } -# } -# } -# -# tgp_bloc_war_defeat_member_effect = { -# WINNER = scope:winner -# LOSER = scope:loser -# } -# -# #EP2 Accolade glory gain from winning against higher ranked enemy -# scope:attacker = { accolade_attacker_war_end_glory_gain_low_effect = yes } -# -# scope:attacker = { -# add_prestige = { -# value = scope:defender.tier_scaled_prestige_value -# } -# } -# -# scope:defender = { -# add_prestige = { -# value = 0 -# subtract = tier_scaled_prestige_value -# } -# } -# -# # Prestige Progress for the Attacker -# every_in_list = { -# list = target_titles -# scope:attacker = { add_prestige_experience = minor_prestige_value } -# } -# -# # Allies on both sides get full prestige value for helping in the war, based on their war participation. -# modify_allies_of_participants_fame_values = { -# WINNER = scope:attacker -# FAME_BASE = major_prestige_value -# IS_RELIGIOUS_WAR = no -# WINNER_ALLY_FAME_SCALE = 1 -# LOSER_ALLY_FAME_SCALE = 1 -# } -# } -# -# on_white_peace_desc = { -# desc = japan_bloc_war_cb_white_peace_desc -# } -# -# on_white_peace = { -# on_white_peace_effect = yes -# scope:attacker = { -# add_prestige = medium_prestige_loss -# } -# -# # Allies on both sides get full prestige value for helping in the war, based on their war participation. -# modify_allies_of_participants_fame_values = { -# WINNER = scope:attacker # not important as the scales are identical -# FAME_BASE = major_prestige_value -# IS_RELIGIOUS_WAR = no -# WINNER_ALLY_FAME_SCALE = 1 -# LOSER_ALLY_FAME_SCALE = 1 -# } -# } -# -# on_defeat_desc = { -# desc = japan_bloc_war_cb_defeat_desc -# } -# -# on_defeat = { -# on_defeat_effect = yes -# scope:defender = { -# save_scope_as = winner -# house.house_confederation = { -# tgp_bloc_change_cohesion_effect = { -# VALUE = tgp_bloc_war_defeat_cohesion_victory_value -# ICON = scope:attacker -# REASON = bloc_war_victory -# } -# } -# } -# -# scope:attacker = { -# save_scope_as = loser -# house.house_confederation = { -# tgp_bloc_change_cohesion_effect = { -# VALUE = tgp_bloc_war_defeat_cohesion_defeat_value -# ICON = scope:defender -# REASON = bloc_war_defeat -# } -# } -# } -# -# tgp_bloc_war_defeat_member_effect = { -# WINNER = scope:winner -# LOSER = scope:loser -# } -# -# scope:defender = { -# #EP2 accolade glory gain for winning against higher ranked enemy -# accolade_defender_war_end_glory_gain_high_effect = yes -# } -# -# scope:attacker = { -# add_prestige = { -# value = 0 -# subtract = tier_scaled_prestige_value -# } -# } -# -# scope:defender = { -# add_prestige = { -# value = tier_scaled_prestige_value -# } -# } -# -# # Allies on both sides get full prestige value for helping in the war, based on their war participation. -# modify_allies_of_participants_fame_values = { -# WINNER = scope:defender -# FAME_BASE = major_prestige_value -# IS_RELIGIOUS_WAR = no -# WINNER_ALLY_FAME_SCALE = 1 -# LOSER_ALLY_FAME_SCALE = 1 -# } -# } -# -# on_primary_attacker_death = inherit -# on_primary_defender_death = inherit -# -# attacker_allies_inherit = yes -# defender_allies_inherit = yes -# -# war_name = "JAPAN_BLOC_WAR_NAME" -# war_name_base = "JAPAN_BLOC_WAR_NAME_BASE" -# cb_name = "JAPAN_BLOC_WAR_CB_NAME" -# interface_priority = 80 -# -# ticking_war_score_targets_entire_realm = yes -# attacker_ticking_warscore = 0.01 -# attacker_wargoal_percentage = 0.01 -# attacker_score_from_occupation_scale = 100 -# defender_score_from_occupation_scale = 100 -# attacker_score_from_battles_scale = 150 -# defender_score_from_battles_scale = 150 -# -# max_attacker_score_from_battles = 100 -# max_defender_score_from_battles = 100 -# -# max_defender_score_from_occupation = 100 -# max_attacker_score_from_occupation = 100 -# -# max_ai_diplo_distance_to_title = 500 -# -# ai_score = { -# value = japan_bloc_war_ai_score_value -# } -# -# ai_score_mult = { -# value = 1 -# add = frankokratia_leader_protection_value #Set back to 0. Declaring war on the frankokratia leader can really ruin the whole thing -# } -#} -# \ No newline at end of file +japan_install_bloc_member_cb = { + icon = bloc + group = subjugation + combine_into_one = yes + should_show_war_goal_subview = yes + allow_hostages = no + ai_only_against_neighbors = yes + + target_titles = all + target_title_tier = county + ignore_effect = change_title_holder + + # scope:attacker + allowed_for_character = { + has_tgp_dlc_trigger = yes + is_landed = yes + highest_held_title_tier >= tier_county + tgp_soryo_or_bushido_trigger = yes # Soryo + exists = house.house_confederation # In a Bloc + } + + # scope:defender + allowed_against_character = { + is_landed = yes + highest_held_title_tier >= tier_county + top_liege = scope:attacker.top_liege # Same realm + NOT = { this = scope:attacker.top_liege } # Not top liege + government_is_japanese_trigger = yes # Soryo or Ritsuryo + trigger_if = { # Not in same Bloc + limit = { exists = house.house_confederation } + house.house_confederation != scope:attacker.house.house_confederation + } + } + + valid_to_start = { + scope:target ?= { is_landless_type_title = no } + } + + mutually_exclusive_titles = { always = yes } + + cost = { + prestige = { + add = { + value = 100 + desc = CB_BASE_COST + } + multiply = common_cb_prestige_cost_multiplier + } + } + + should_invalidate = { + OR = { + war_should_invalidate_defender_lost_target_lands_trigger = yes + scope:attacker = { tgp_soryo_or_bushido_trigger = no } + scope:defender.house.house_confederation ?= scope:attacker.house.house_confederation # Same bloc already + NOT = { exists = scope:attacker.house.house_confederation } # Bloc destroyed + } + } + + on_invalidated_desc = { + desc = japan_install_bloc_member_cb_ended_invalid.desc + } + + on_declaration = { + on_declared_war = yes + tgp_japan_internal_soryo_war_crime_effect = yes + } + + on_victory_desc = { + desc = { + desc = japan_install_bloc_member_cb_victory_desc + triggered_desc = { + trigger = { tgp_japan_internal_soryo_war_is_crime_trigger = yes } + desc = japan_soryo_conquest_cb_admin_warning + } + } + } + + on_victory = { + on_victory_effect = yes + # they lost title but not taken by you + scope:defender = { ep3_war_loss_adventurer_tt_effect = yes } + + scope:attacker.house.house_confederation = { + leading_house.house_head = { + if = { + limit = { + is_ai = yes + this != scope:attacker + } + add_opinion = { + target = scope:attacker + modifier = respect_opinion + opinion = 25 + } + } + } + } + + #EP2 Accolade glory gain from winning against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_low_effect = yes } + + scope:attacker = { + add_prestige = { + value = scope:defender.tier_scaled_prestige_value + } + } + + scope:defender = { + add_prestige = { + value = 0 + subtract = tier_scaled_prestige_value + } + } + + scope:attacker = { + trigger_event = { + id = tgp_japan_general.8800 + days = 1 + } + } + + # Prestige Progress for the Attacker + every_in_list = { + list = target_titles + scope:attacker = { add_prestige_experience = minor_prestige_value } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker + FAME_BASE = major_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + } + + on_white_peace_desc = { + desc = { + desc = japan_install_bloc_member_cb_white_peace_desc + triggered_desc = { + trigger = { tgp_japan_internal_soryo_war_is_crime_trigger = yes } + desc = japan_soryo_conquest_cb_admin_warning + } + } + } + + on_white_peace = { + on_white_peace_effect = yes + scope:attacker = { + add_prestige = medium_prestige_loss + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker # not important as the scales are identical + FAME_BASE = major_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + } + + on_defeat_desc = { + desc = { + desc = japan_install_bloc_member_cb_defeat_desc + triggered_desc = { + trigger = { tgp_japan_internal_soryo_war_is_crime_trigger = yes } + desc = japan_soryo_conquest_cb_admin_warning + } + } + } + + on_defeat = { + on_defeat_effect = yes + + scope:defender = { + #EP2 accolade glory gain for winning against higher ranked enemy + accolade_defender_war_end_glory_gain_high_effect = yes + } + + scope:attacker = { + add_prestige = { + value = 0 + subtract = tier_scaled_prestige_value + } + } + + scope:defender = { + add_prestige = { + value = tier_scaled_prestige_value + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:defender + FAME_BASE = major_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + } + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + war_name = "JAPAN_INSTALL_BLOC_MEMBER_WAR_NAME" + war_name_base = "JAPAN_INSTALL_BLOC_MEMBER_WAR_NAME_BASE" + cb_name = "JAPAN_INSTALL_BLOC_MEMBER_CB_NAME" + interface_priority = 100 + + ticking_war_score_targets_entire_realm = no + attacker_ticking_warscore = 0.01 + attacker_wargoal_percentage = 0.01 + attacker_score_from_occupation_scale = 100 + defender_score_from_occupation_scale = 100 + attacker_score_from_battles_scale = 100 + defender_score_from_battles_scale = 100 + + max_attacker_score_from_battles = 100 + max_defender_score_from_battles = 100 + + max_defender_score_from_occupation = 100 + max_attacker_score_from_occupation = 100 + + max_ai_diplo_distance_to_title = 500 + + ai_score = { + value = japan_install_bloc_member_ai_score_value + } + + ai_score_mult = { + value = 1 + add = common_cb_ai_score_mult_additive + multiply = common_cb_ai_score_mult + } +} + +# War for landless feudal to take land +japan_soryo_conquest_county_landless_cb = { + icon = soryo + group = conquest + combine_into_one = yes + should_show_war_goal_subview = yes + ai_only_against_neighbors = no + allow_hostages = no + target_titles = all + target_title_tier = county + target_de_jure_regions_above = yes + ignore_effect = change_title_holder + + mutually_exclusive_titles = { always = yes } + + # scope:attacker + allowed_for_character = { + has_tgp_dlc_trigger = yes + is_landed = no + government_is_japanese_trigger = yes + tgp_soryo_or_bushido_trigger = yes + } + + # scope:defender + allowed_against_character = { + is_landed = yes + highest_held_title_tier >= tier_county + government_is_japanese_trigger = yes + top_liege = { + # Must be part of same realm + this = scope:attacker.top_liege + # But defender must not be liege + NOT = { this = scope:attacker } + } + } + + cost = { + prestige = { + add = { + value = 100 + desc = CB_BASE_COST + } + multiply = common_cb_prestige_cost_multiplier + } + } + + valid_to_start = { + scope:target = { + is_landless_type_title = no + # Also make sure you can't war for, like, the Papal States + trigger_if = { + limit = { holder.faith ?= root.faith } + NOT = { + holder ?= { is_theocratic_lessee = yes } + } + } + } + } + + should_invalidate = { + ep3_adventurer_landless_should_invalidate_trigger = yes + } + + on_invalidated_desc = { + desc = japan_soryo_conquest_cb_ended_invalid.desc + } + + on_declaration = { + on_declared_war = yes + tgp_japan_internal_soryo_war_crime_effect = yes + } + + on_victory_desc = { + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = county_conquest_cb_victory_desc_attacker + } + desc = county_conquest_cb_victory_desc + } + triggered_desc = { + trigger = { tgp_japan_internal_soryo_war_is_crime_trigger = yes } + desc = japan_soryo_conquest_cb_admin_warning + } + } + } + + on_victory = { + on_victory_aggressive_war_effect = yes + + #EP2 Accolade glory gain from winning against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_low_effect = yes } + + scope:attacker = { + add_prestige = { + value = scope:defender.tier_scaled_prestige_value + } + } + + scope:defender = { + add_prestige = { + value = 0 + subtract = tier_scaled_prestige_value + } + } + + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + add_claim_on_loss = yes + } + + #As this is just a county conquest, simply grab the designated county. + every_in_list = { + list = target_titles + change_title_holder = { + holder = scope:attacker + change = scope:change + } + } + + resolve_title_and_vassal_change = scope:change + + # Prestige Progress for the Attacker + every_in_list = { + list = target_titles + scope:attacker = { add_prestige_experience = minor_prestige_value } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker + FAME_BASE = major_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + } + + on_white_peace_desc = { + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = county_conquest_cb_white_peace_desc_defender + } + desc = county_conquest_cb_white_peace_desc + } + triggered_desc = { + trigger = { tgp_japan_internal_soryo_war_is_crime_trigger = yes } + desc = japan_soryo_conquest_cb_admin_warning + } + } + } + + on_white_peace = { + on_white_peace_effect = yes + scope:attacker = { + add_prestige = medium_prestige_loss + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker # not important as the scales are identical + FAME_BASE = major_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + } + + on_defeat_desc = { + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = county_conquest_cb_defeat_desc_attacker + } + desc = county_conquest_cb_defeat_desc + } + triggered_desc = { + trigger = { tgp_japan_internal_soryo_war_is_crime_trigger = yes } + desc = japan_soryo_conquest_cb_admin_warning + } + } + } + + on_defeat = { + on_defeat_aggressive_war_effect = yes + + scope:defender = { + #EP2 accolade glory gain for winning against higher ranked enemy + accolade_defender_war_end_glory_gain_high_effect = yes + } + + scope:attacker = { + add_prestige = { + value = 0 + subtract = tier_scaled_prestige_value + } + } + + scope:defender = { + add_prestige = { + value = tier_scaled_prestige_value + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:defender + FAME_BASE = major_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + } + + transfer_behavior = transfer + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + interface_priority = 79 + + use_de_jure_wargoal_only = yes + + attacker_wargoal_percentage = 0.8 + + max_attacker_score_from_battles = 75 + + max_defender_score_from_occupation = 150 + max_attacker_score_from_occupation = 150 + + war_name = "JAPAN_SORYO_CONQUEST_LANDLESS_WAR_NAME" + war_name_base = "JAPAN_SORYO_CONQUEST_LANDLESS_WAR_NAME_BASE" + cb_name = "JAPAN_SORYO_CONQUEST_LANDLESS_COUNTY_CB_NAME" + + ai_score_mult = { + value = 1 + add = common_cb_ai_score_mult_additive + if = { + limit = { + current_military_strength < 400 + } + multiply = 0 + } + multiply = aggressive_cb_ai_score_mult + multiply = common_cb_ai_score_mult + } +} + +# War for feudal to take land +japan_soryo_conquest_county_cb = { + icon = soryo + group = conquest + combine_into_one = yes + ai_only_against_neighbors = yes + allow_hostages = yes + should_show_war_goal_subview = yes + + target_titles = neighbor_land_or_water + target_title_tier = county + ignore_effect = change_title_holder + + mutually_exclusive_titles = { always = yes } + + # scope:attacker + allowed_for_character = { + has_tgp_dlc_trigger = yes + is_landed = yes + # Attacker must be Japanese Feudal, or have the Bushido tradition + tgp_soryo_or_bushido_trigger = yes + } + + # scope:defender + allowed_against_character = { + top_liege ?= { + # Must be part of same realm + this = scope:attacker.top_liege + # But defender must not be liege + NOT = { this = scope:attacker } + } + } + + cost = { + prestige = { + add = { + value = 100 + desc = CB_BASE_COST + } + multiply = common_cb_prestige_cost_multiplier + } + } + + should_invalidate = { + OR = { + war_should_invalidate_defender_lost_target_lands_trigger = yes + NOT = { + scope:attacker = { tgp_soryo_or_bushido_trigger = yes } + } + scope:defender.top_liege != scope:attacker.top_liege + } + } + + on_invalidated_desc = { + desc = japan_soryo_conquest_cb_ended_invalid.desc + } + + on_declaration = { + on_declared_war = yes + tgp_japan_internal_soryo_war_crime_effect = yes + } + + on_victory_desc = { + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = county_conquest_cb_victory_desc_attacker + } + desc = county_conquest_cb_victory_desc + } + triggered_desc = { + trigger = { tgp_japan_internal_soryo_war_is_crime_trigger = yes } + desc = japan_soryo_conquest_cb_admin_warning + } + } + } + + on_victory = { + on_victory_aggressive_war_effect = yes + + #EP2 Accolade glory gain from winning against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_low_effect = yes } + + scope:attacker = { + add_prestige = { + value = scope:defender.tier_scaled_prestige_value + } + } + + scope:defender = { + add_prestige = { + value = 0 + subtract = tier_scaled_prestige_value + } + } + + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + add_claim_on_loss = yes + } + + #As this is just a county conquest, simply grab the designated county. + every_in_list = { + list = target_titles + change_title_holder = { + holder = scope:attacker + change = scope:change + } + } + + resolve_title_and_vassal_change = scope:change + + # Prestige Progress for the Attacker + every_in_list = { + list = target_titles + scope:attacker = { add_prestige_experience = minor_prestige_value } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker + FAME_BASE = major_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + } + + on_white_peace_desc = { + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = county_conquest_cb_white_peace_desc_defender + } + desc = county_conquest_cb_white_peace_desc + } + triggered_desc = { + trigger = { tgp_japan_internal_soryo_war_is_crime_trigger = yes } + desc = japan_soryo_conquest_cb_admin_warning + } + } + } + + on_white_peace = { + on_white_peace_effect = yes + scope:attacker = { + add_prestige = medium_prestige_loss + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker # not important as the scales are identical + FAME_BASE = major_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + } + + on_defeat_desc = { + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = county_conquest_cb_defeat_desc_attacker + } + desc = county_conquest_cb_defeat_desc + } + triggered_desc = { + trigger = { tgp_japan_internal_soryo_war_is_crime_trigger = yes } + desc = japan_soryo_conquest_cb_admin_warning + } + } + } + + on_defeat = { + on_defeat_aggressive_war_effect = yes + + scope:defender = { + #EP2 accolade glory gain for winning against higher ranked enemy + accolade_defender_war_end_glory_gain_high_effect = yes + } + + scope:attacker = { + add_prestige = { + value = 0 + subtract = tier_scaled_prestige_value + } + } + + scope:defender = { + add_prestige = { + value = tier_scaled_prestige_value + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:defender + FAME_BASE = major_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + } + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + war_name = "JAPAN_SORYO_CONQUEST_WAR_NAME" + war_name_base = "JAPAN_SORYO_CONQUEST_WAR_NAME_BASE" + cb_name = "JAPAN_SORYO_CONQUEST_COUNTY_CB_NAME" + interface_priority = 80 + + ticking_war_score_targets_entire_realm = yes + attacker_ticking_warscore = 0.01 + attacker_wargoal_percentage = 0.01 + attacker_score_from_occupation_scale = 50 + defender_score_from_occupation_scale = 50 + attacker_score_from_battles_scale = 250 + defender_score_from_battles_scale = 250 + + max_attacker_score_from_battles = 200 + max_defender_score_from_battles = 200 + + max_defender_score_from_occupation = 50 + max_attacker_score_from_occupation = 50 + + max_ai_diplo_distance_to_title = 500 + + ai_score_mult = { + value = 1 + add = common_cb_ai_score_mult_additive + multiply = aggressive_cb_ai_score_mult + multiply = common_cb_ai_score_mult + } +} + +# War to enforce return to Administrative +japan_demand_administrative_cb = { + icon = ritsuryo + group = subjugation + allow_hostages = no + ai_only_against_neighbors = yes + should_show_war_goal_subview = yes + + # scope:attacker + allowed_for_character = { + government_has_flag = government_is_japan_administrative + top_liege = { government_has_flag = government_is_japan_administrative } # Cannot enforce admin in a Soryo realm + tgp_is_ceremonial_liege_trigger = no + } + + # scope:defender + allowed_against_character = { + is_landed = yes + government_has_flag = government_is_japan_feudal + top_liege = scope:attacker.top_liege + NOT = { is_liege_or_above_of = scope:attacker } + } + + # root = scope:attacker, scope:defender, scope:target + valid_to_start = { + } + + cost = { + prestige = { + add = { + value = 100 + desc = CB_BASE_COST + } + multiply = common_cb_prestige_cost_multiplier + } + } + + should_invalidate = { + OR = { + NOT = { + scope:attacker = { + government_has_flag = government_is_japan_administrative + tgp_is_ceremonial_liege_trigger = no + } + } + NOT = { + scope:defender = { + government_has_flag = government_is_japan_feudal + top_liege = scope:attacker.top_liege + NOT = { is_liege_or_above_of = scope:attacker } + } + } + scope:defender = { is_landed = no } + } + } + + on_invalidated_desc = { + first_valid = { + triggered_desc = { + trigger = { + NOT = { + scope:attacker = { + government_has_flag = government_is_japan_administrative + tgp_is_ceremonial_liege_trigger = no + } + } + } + desc = japan_demand_administrative_cb_ended_invalid.desc.attacker + } + desc = japan_demand_administrative_cb_ended_invalid.desc + } + } + + on_declaration = { + on_declared_war = yes + } + + on_victory_desc = { + desc = { + desc = japan_demand_administrative_cb_victory_desc + triggered_desc = { + trigger = { + scope:attacker = { is_independent_ruler = no } + } + desc = japan_demand_administrative_cb_victory_vassal_desc + } + } + } + + on_victory = { + on_victory_effect = yes + # they lost title but not taken by you + scope:defender = { ep3_war_loss_adventurer_tt_effect = yes } + + #EP2 Accolade glory gain from winning against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_low_effect = yes } + + # Appreciation for re-integration + scope:attacker = { + if = { + limit = { is_independent_ruler = no } + reverse_add_opinion = { + target = scope:attacker.top_liege + modifier = enforced_administrative_opinion + } + } + } + + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + add_claim_on_loss = yes + } + + scope:defender = { + every_held_title = { + limit = { + is_landless_type_title = no + is_noble_family_title = no + tier >= tier_county + } + # Return land to top liege + change_title_holder = { + holder = scope:attacker.top_liege + change = scope:change + } + } + } + + # Influence/Fame reward + scope:attacker = { + if = { + limit = { is_independent_ruler = no } + if = { + limit = { government_has_flag = government_has_influence } + change_influence = japan_demand_administrative_war_influence_value + } + else = { add_prestige_experience = japan_demand_administrative_war_prestige_value } + } + } + + resolve_title_and_vassal_change = scope:change + + # Prestige Progress for the Attacker + every_in_list = { + list = target_titles + scope:attacker = { add_prestige_experience = minor_prestige_value } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker + FAME_BASE = major_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + } + + on_white_peace_desc = { + desc = japan_demand_administrative_cb_white_peace_desc + } + + on_white_peace = { + on_white_peace_effect = yes + scope:attacker = { + add_prestige = medium_prestige_loss + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker # not important as the scales are identical + FAME_BASE = major_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + } + + on_defeat_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:attacker = scope:defender.top_liege } + desc = japan_demand_administrative_cb_defeat_desc_independence + } + desc = japan_demand_administrative_cb_defeat_desc + } + } + + on_defeat = { + on_defeat_effect = yes + + scope:defender = { + #EP2 accolade glory gain for winning against higher ranked enemy + accolade_defender_war_end_glory_gain_high_effect = yes + } + + # If Regent themselves failed to assert authority + if = { + limit = { scope:attacker = scope:defender.top_liege } + scope:attacker = { + add_prestige = major_prestige_loss + switch = { + trigger = has_realm_law + japanese_bureaucracy_3 = { add_realm_law = japanese_bureaucracy_2 } + japanese_bureaucracy_2 = { add_realm_law = japanese_bureaucracy_1 } + japanese_bureaucracy_1 = { add_realm_law = japanese_bureaucracy_0 } + fallback = { force_step_down_landed_titles = yes } + } + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:defender + FAME_BASE = major_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + } + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + war_name = "JAPAN_DEMAND_ADMINISTRATIVE_WAR_NAME" + war_name_base = "JAPAN_DEMAND_ADMINISTRATIVE_WAR_NAME_BASE" + cb_name = "JAPAN_DEMAND_ADMINISTRATIVE_CB_NAME" + interface_priority = 80 + + ticking_war_score_targets_entire_realm = yes + attacker_ticking_warscore = 0.01 + attacker_wargoal_percentage = 0.01 + attacker_score_from_occupation_scale = 50 + defender_score_from_occupation_scale = 50 + attacker_score_from_battles_scale = 250 + defender_score_from_battles_scale = 250 + + max_attacker_score_from_battles = 200 + max_defender_score_from_battles = 200 + + max_defender_score_from_occupation = 50 + max_attacker_score_from_occupation = 50 + + max_ai_diplo_distance_to_title = 500 + + ai_score = { + value = japan_demand_administrative_ai_score_value + } + + ai_score_mult = { + value = 1 + add = common_cb_ai_score_mult_additive + multiply = common_cb_ai_score_mult + } +} + +# War to conquer Japan +japan_imperial_expansion_cb = { + icon = ritsuryo_government + group = conquest + combine_into_one = yes + ai_only_against_neighbors = yes + allow_hostages = no + should_show_war_goal_subview = yes + + target_titles = all + target_title_tier = county + ignore_effect = change_title_holder + + mutually_exclusive_titles = { always = yes } + + cost = { + prestige = { + add = { + value = 100 + desc = CB_BASE_COST + } + multiply = common_cb_prestige_cost_multiplier + } + } + + # root = scope:attacker + allowed_for_character = { + japan_imperial_expansion_cb_allowed_for_character_trigger = yes + } + + # root = scope:attacker + allowed_for_character_display_regardless = { + # Required Policy + top_liege = { has_realm_law = imperial_expansion_law } + } + + # root = scope:defender, scope:attacker + allowed_against_character = { + japan_imperial_expansion_cb_allowed_against_character_trigger = yes + } + + # root = scope:defender, scope:attacker + allowed_against_character_display_regardless = { + # Must be neighbours, but we want to show casus belli in list regardless + custom_tooltip = { + text = japan_imperial_expansion_cb_neighbour_tt + any_sub_realm_county = { + any_title_to_title_neighboring_and_across_water_county = { holder.top_liege = scope:attacker.top_liege } + } + } + } + + # root = scope:attacker, scope:defender, scope:target + valid_to_start_display_regardless = { + custom_tooltip = { + text = tgp_japan_pacification_war_valid_empire_tt + NOT = { scope:target.empire ?= title:e_japan } + } + custom_tooltip = { + text = tgp_japan_pacification_war_valid_region_tt + scope:target.title_province ?= { + OR = { + geographical_region = world_asia_japan + geographical_region = world_asia_sakhalin_hokkaido + } + } + } + } + + valid_to_start = { + scope:target = { + is_landless_type_title = no + } + } + + should_invalidate = { + OR = { + war_should_invalidate_defender_lost_target_lands_trigger = yes + scope:attacker = { japan_imperial_expansion_cb_allowed_for_character_trigger = no } + scope:defender = { japan_imperial_expansion_cb_allowed_against_character_trigger = no } + } + } + + on_invalidated_desc = { + first_valid = { + triggered_desc = { + trigger = { + scope:attacker = { japan_imperial_expansion_cb_allowed_for_character_trigger = no } + } + desc = japan_imperial_expansion_cb_ended_invalid.desc.attacker + } + desc = japan_imperial_expansion_cb_ended_invalid.desc + } + } + + on_declaration = { + on_declared_war = yes + } + + on_victory_desc = { + desc = { + first_valid = { + triggered_desc = { + trigger = { + scope:attacker = { + is_local_player = yes + is_independent_ruler = yes + } + } + desc = japan_imperial_expansion_cb_victory_desc_attacker + } + desc = japan_imperial_expansion_cb_victory_desc + } + triggered_desc = { + trigger = { + scope:attacker = { is_independent_ruler = no } + } + desc = japan_demand_administrative_cb_victory_vassal_desc + } + } + } + + on_victory = { + on_victory_aggressive_war_effect = yes + + #EP2 Accolade glory gain from winning against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_low_effect = yes } + + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + add_claim_on_loss = yes + } + + #As this is just a county conquest, simply grab the designated county. + every_in_list = { + list = target_titles + change_title_holder = { + holder = scope:attacker.top_liege # For the top liege + change = scope:change + } + } + + resolve_title_and_vassal_change = scope:change + + # Appreciation for the Attacker, if relevant + scope:attacker = { + if = { + limit = { is_independent_ruler = no } + reverse_add_opinion = { + target = scope:attacker.top_liege + modifier = enforced_pacification_opinion + } + } + } + + # Influence/Prestige Progress for the Attacker + scope:attacker = { + if = { + limit = { is_independent_ruler = no } + if = { + limit = { government_has_flag = government_has_influence } + change_influence = japan_imperial_expansion_war_influence_value + } + else = { add_prestige_experience = japan_imperial_expansion_war_prestige_value } + } + else = { + # Prestige Progress for the Attacker + every_in_list = { + list = target_titles + scope:attacker = { add_prestige_experience = medium_prestige_value } + } + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + if = { # Warning that only counties are changing hands + limit = { + any_in_list = { + list = target_titles + tier = tier_duchy + } + } + random_in_list = { + list = target_titles + limit = { tier = tier_duchy } + save_scope_as = de_jure_target + } + } + } + + on_white_peace_desc = { + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = county_conquest_cb_white_peace_desc_defender + } + desc = county_conquest_cb_white_peace_desc + } + } + } + + on_white_peace = { + on_white_peace_effect = yes + + #EP2 accolade glory gain for doing pretty good against higher ranked enemy + scope:defender = { accolade_defender_war_end_glory_gain_low_effect = yes } + + scope:attacker = { + add_prestige = { + value = minor_prestige_value + multiply = -1.0 + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker # not impactful as the scale are identical + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + } + + on_defeat_desc = { + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = county_conquest_cb_defeat_desc_attacker + } + desc = county_conquest_cb_defeat_desc + } + } + } + + on_defeat = { + on_defeat_aggressive_war_effect = yes + + scope:defender = { + #EP2 accolade glory gain for winning against higher ranked enemy + accolade_defender_war_end_glory_gain_high_effect = yes + # Prestige for Defender + add_prestige_war_defender_effect = { + PRESTIGE_VALUE = medium_prestige_value + } + } + + # Prestige loss for the attacker + scope:attacker = { + pay_short_term_gold_reparations_effect = { + GOLD_VALUE = 3 + } + add_prestige = { + value = major_prestige_value + multiply = -1.0 + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:defender + FAME_BASE = major_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + } + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + war_name = "JAPAN_IMPERIAL_EXPANSION_WAR_NAME" + war_name_base = "JAPAN_IMPERIAL_EXPANSION_WAR_NAME_BASE" + cb_name = "JAPAN_IMPERIAL_EXPANSION_CB_NAME" + interface_priority = 80 + + ticking_war_score_targets_entire_realm = yes + attacker_ticking_warscore = 0.01 + attacker_wargoal_percentage = 0.01 + attacker_score_from_occupation_scale = 50 + defender_score_from_occupation_scale = 50 + attacker_score_from_battles_scale = 250 + defender_score_from_battles_scale = 250 + + max_attacker_score_from_battles = 200 + max_defender_score_from_battles = 200 + + max_defender_score_from_occupation = 50 + max_attacker_score_from_occupation = 50 + + max_ai_diplo_distance_to_title = 500 + + ai_score = { + value = japan_imperial_expansion_ai_score_value + } + + ai_score_mult = { + value = 1 + add = common_cb_ai_score_mult_additive + multiply = aggressive_cb_ai_score_mult + multiply = common_cb_ai_score_mult + } +} + +# War to reconquer Japan +japan_imperial_reconquest_cb = { + icon = ritsuryo_government + group = de_jure + + war_name = "JAPAN_IMPERIAL_RECONQUEST_WAR_NAME" + war_name_base = "JAPAN_IMPERIAL_RECONQUEST_WAR_NAME_BASE" + cb_name = "JAPAN_IMPERIAL_RECONQUEST_CB_NAME" + interface_priority = 80 + + combine_into_one = yes + should_show_war_goal_subview = yes + mutually_exclusive_titles = { always = yes } + + cost = { + prestige = { + scope:defender = { + every_sub_realm_county = { + limit = { empire = title:e_japan } + add = { + value = 50 + desc = japan_imperial_reconquest_cb_cost_tt + } + } + } + multiply = common_cb_prestige_cost_multiplier + } + } + + allow_hostages = no + + target_titles = all + target_title_tier = duchy + target_de_jure_regions_above = yes + ignore_effect = change_title_holder + ai_only_against_neighbors = yes + + # root = scope:attacker + allowed_for_character = { + japan_imperial_reconquest_cb_allowed_for_character_trigger = yes + } + + # root = scope:attacker + allowed_for_character_display_regardless = { + top_liege = { has_realm_law = defense_mobilization_law } + } + + # root = scope:defender, scope:attacker + allowed_against_character = { + japan_imperial_reconquest_cb_allowed_against_character_trigger = yes + } + + valid_to_start = { + scope:target = { + empire = title:e_japan + } + } + + # root = scope:attacker, scope:defender, scope:target + valid_to_start_display_regardless = { + custom_tooltip = { + text = tgp_japan_reconquest_war_valid_de_jure_tt + scope:target.empire ?= title:e_japan + } + } + + should_invalidate = { + OR = { + war_should_invalidate_defender_lost_target_lands_trigger = yes + scope:attacker = { japan_imperial_reconquest_cb_allowed_for_character_trigger = no } + scope:defender = { japan_imperial_reconquest_cb_allowed_against_character_trigger = no } + } + } + + on_invalidated_desc = { + first_valid = { + triggered_desc = { + trigger = { + scope:attacker = { japan_imperial_reconquest_cb_allowed_for_character_trigger = no } + } + desc = japan_imperial_reconquest_cb_ended_invalid.desc.attacker + } + desc = japan_imperial_reconquest_cb_ended_invalid.desc + } + } + + on_declaration = { + on_declared_war = yes + } + + on_victory_desc = { + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = de_jure_cb_victory_desc_attacker + } + desc = japan_imperial_reconquest_cb_victory_desc + } + triggered_desc = { + trigger = { + scope:attacker = { is_independent_ruler = no } + } + desc = japan_demand_administrative_cb_victory_vassal_desc + } + } + } + + on_victory = { + on_victory_aggressive_war_effect = yes + + #EP2 Accolade glory gain from winning against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_low_effect = yes } + + # Influence/Prestige Progress reward for Attacker + scope:attacker = { + if = { + limit = { is_independent_ruler = no } + if = { + limit = { government_has_flag = government_has_influence } + change_influence = japan_imperial_reconquest_war_influence_value + } + else = { add_prestige_experience = japan_imperial_reconquest_war_prestige_value } + } + } + + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + add_claim_on_loss = yes + } + + every_in_list = { + list = target_titles + save_temporary_scope_as = target + } + + setup_de_jure_cb = { + attacker = scope:attacker + defender = scope:defender + change = scope:change + title = scope:target + } + resolve_title_and_vassal_change = scope:change + + # Prestige Progress for the Attacker + every_in_list = { + list = target_titles + scope:attacker = { add_prestige_experience = minor_prestige_value } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker + FAME_BASE = major_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + } + + on_white_peace_desc = { + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = county_conquest_cb_white_peace_desc_defender + } + desc = county_conquest_cb_white_peace_desc + } + } + } + + on_white_peace = { + on_white_peace_effect = yes + + #EP2 accolade glory gain for doing ok against higher ranked enemy + scope:defender = { accolade_defender_war_end_glory_gain_low_effect = yes } + + setup_de_jure_cb = { + attacker = scope:attacker + defender = scope:defender + victory = no + title = scope:target + } + } + + on_defeat_desc = { + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = county_conquest_cb_defeat_desc_attacker + } + desc = county_conquest_cb_defeat_desc + } + } + } + + on_defeat = { + on_defeat_aggressive_war_effect = yes + + scope:defender = { + #EP2 accolade glory gain for winning against higher ranked enemy + accolade_defender_war_end_glory_gain_high_effect = yes + } + + scope:attacker = { + pay_short_term_gold_reparations_effect = { + GOLD_VALUE = 10 + } + } + + setup_de_jure_cb = { + attacker = scope:attacker + defender = scope:defender + victory = no + title = scope:target + } + } + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + attacker_wargoal_percentage = 0.8 + + max_defender_score_from_occupation = 150 + max_attacker_score_from_occupation = 150 + + max_ai_diplo_distance_to_title = 500 + + ai_score = { + value = japan_imperial_reconquest_ai_score_value + } + + ai_score_mult = { + value = 1 + add = common_cb_ai_score_mult_additive + multiply = aggressive_cb_ai_score_mult + multiply = common_cb_ai_score_mult + } +} + +# War to reimpose Ritsuryo +japan_refused_ritsuryo_cb = { + icon = dissolution_war + group = civil_war + ai_only_against_liege = yes + allow_hostages = no + allowed_for_character = { + scope:attacker = { + liege = scope:defender + NOT = { government_has_flag = government_is_japan_administrative } + } + } + + allowed_against_character = { + scope:attacker = { + liege = scope:defender + } + } + + target_de_jure_regions_above = yes + + valid_to_start = { + } + + should_invalidate = { + OR = { + scope:attacker = { + NOT = { + any_liege_or_above = { this = scope:defender } + } + } + scope:defender = { is_landed = no } + } + } + + on_declaration = { + # save the initial target and their tier for conditioning the depose effect + if = { + limit = { NOT = { exists = scope:attacker.var:initial_target } } + scope:attacker = { + set_variable = { + name = initial_target + value = scope:defender + } + set_variable = { + name = target_tier + value = scope:defender.primary_title.tier + } + } + } + } + + on_victory_desc = { + first_valid = { + triggered_desc = { + trigger = { + scope:defender = { is_local_player = yes } + depose_war_victory_trigger = yes + } + desc = japan_refused_ritsuryo_cb_victory_desc_defender + } + triggered_desc = { + trigger = { + depose_war_victory_trigger = yes + } + desc = japan_refused_ritsuryo_cb_victory_desc + } + } + } + + on_victory = { + on_victory_faction_war_effect = yes + + #EP2 Accolade glory gain from winning against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_med_effect = yes } + + scope:defender = { + # If we win the rebellion, our liege loses any legal right to imprison us/banish us/revoke our titles. + consume_all_criminal_reasons_effect = { + LIEGE = scope:defender + CRIMINAL = scope:attacker + } + + add_prestige = -500 + + # JAPAN - liege is replaced by the attacker + create_title_and_vassal_change = { + type = conquest + save_scope_as = title_change + } + title:c_yamashiro ?= { + if = { + limit = { holder = scope:defender } + change_title_holder_include_vassals = { + holder = scope:attacker + change = scope:title_change + } + } + } + scope:defender = { + every_held_title = { + limit = { tier >= tier_empire } + change_title_holder_include_vassals = { + holder = scope:attacker + change = scope:title_change + } + } + } + resolve_title_and_vassal_change = scope:title_change + } + + hidden_effect = { + scope:attacker = { + add_truce_both_ways = { + character = scope:defender + days = 1825 + war = root.war + result = victory + } + } + } + } + + on_white_peace_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = japan_refused_ritsuryo_cb_white_peace_desc_defender + } + desc = japan_refused_ritsuryo_cb_white_peace_desc + } + } + + on_white_peace = { + on_white_peace_faction_war_effect = yes + } + + on_defeat_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = japan_refused_ritsuryo_cb_defeat_desc_defender + } + desc = japan_refused_ritsuryo_cb_defeat_desc + } + } + + on_defeat = { + on_defeat_faction_war_effect = yes + + scope:defender = { + add_character_flag = { + flag = recent_liberty_faction_war + years = 10 + } + add_dread = medium_dread_gain + } + + # For revoking titles of character's imprisoned abroad who have lost a revocation war + hidden_effect = { + if = { + limit = { + scope:attacker = { + is_imprisoned = yes + NOT = { is_imprisoned_by = scope:defender } + } + } + scope:defender = { + add_opinion = { + target = scope:attacker + modifier = foreign_prison_revocation_opinion + } + } + } + } + } + + on_invalidated_desc = msg_invalidate_war_title + + check_attacker_inheritance_validity = no + + on_primary_attacker_death = invalidate + on_primary_defender_death = inherit + + transfer_behavior = transfer + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + war_name = "JAPAN_REFUSED_RITSURYO_WAR_NAME" + + interface_priority = 80 + + use_de_jure_wargoal_only = yes + + attacker_wargoal_percentage = 0.8 + + max_attacker_score_from_battles = 100 + max_defender_score_from_battles = 50 + + max_defender_score_from_occupation = 150 + max_attacker_score_from_occupation = 150 + + max_ai_diplo_distance_to_title = 500 + + ai_score_mult = { + value = 1 + add = common_cb_ai_score_mult_additive + multiply = aggressive_cb_ai_score_mult + multiply = common_cb_ai_score_mult + } +} + +# Eradicate Rival House +eradicate_house_cb = { + icon = execute + group = subjugation + combine_into_one = yes + ai_only_against_neighbors = yes + allow_hostages = no + should_show_war_goal_subview = no + + # scope:attacker + allowed_for_character = { + #Display so once a player has bad house relations they can be tempted to make them worse to validate cb + trigger_if = { + limit = { + is_ai = yes + } + house ?= { + any_house_relation = { + has_house_relation_level = feud + } + } + } + trigger_else = { + house ?= { + any_house_relation = { + OR = { + has_house_relation_level = quarrel + has_house_relation_level = rivalry + has_house_relation_level = feud + } + } + } + } + } + + # scope:defender + allowed_against_character = { + is_landed = yes + #Can't be the attacker's top liege + NOR = { + is_vassal_or_below_of = scope:attacker + is_liege_or_above_of = scope:attacker + } + } + + valid_to_start = { + #We need the worst house relations + tgp_has_house_relation_level_trigger = { + HOUSE_1_MEMBER = scope:attacker + HOUSE_2_MEMBER = scope:defender + LEVEL = feud + } + } + + cost = { + prestige = { + add = { + value = 100 + desc = CB_BASE_COST + } + multiply = common_cb_prestige_cost_multiplier + } + } + + should_invalidate = { + #cancel if they become friendly + OR = { + NOT = { + tgp_has_house_relation_level_trigger = { + HOUSE_1_MEMBER = scope:attacker + HOUSE_2_MEMBER = scope:defender + LEVEL = feud + } + } + scope:defender = { is_landed = no } + } + } + + on_invalidated_desc = { + desc = eradicate_house_cb_ended_invalid.desc + } + + on_declaration = { + on_declared_war = yes + } + + on_victory_desc = { + desc = eradicate_house_cb_victory_desc + } + + on_victory = { + on_victory_aggressive_war_effect = yes + + scope:attacker = { + if = { + limit = { + is_ai = no + } + add_achievement_global_variable_effect = { + VARIABLE = finished_ep4_07_cut_off_the_head_and_the_body_will_follow_achievement + VALUE = yes + } + } + } + + #EP2 Accolade glory gain from winning against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_low_effect = yes } + + scope:attacker = { + add_prestige = { + value = scope:defender.tier_scaled_prestige_value + } + } + + scope:defender = { + add_prestige = { + value = 0 + subtract = tier_scaled_prestige_value + } + } + #Show land transfer + show_as_tooltip = { + #loser/winner scopes are only being set here to correctly display the effects of tgp_japan_soryo_eradicate_cb_transfer_effect in the tooltip! + scope:defender = { + save_scope_as = loser + } + scope:attacker = { + save_scope_as = winner + } + tgp_japan_soryo_eradicate_cb_transfer_effect = yes + } + #show death + show_as_tooltip = { + scope:defender = { + death = { + death_reason = death_eradicated + killer = scope:attacker + } + } + scope:defender = { + every_courtier = { + custom = every_close_family_house_member_in_court_cb_win_desc + limit = { + house = scope:defender.house + NOT = { + scope:defender.primary_heir ?= this + } + } + death = { + death_reason = death_eradicated + killer = scope:attacker + } + } + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker + FAME_BASE = major_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + #Eradicate House follow up event + scope:defender = { + trigger_event = tgp_japan_general.9550 + } + } + + on_white_peace_desc = { + desc = eradicate_house_cb_white_peace_desc + } + on_white_peace = { + on_white_peace_effect = yes + scope:attacker = { + add_prestige = medium_prestige_loss + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker # not important as the scales are identical + FAME_BASE = major_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + } + + on_defeat_desc = { + desc = eradicate_house_cb_defeat_desc + } + + on_defeat = { + on_defeat_aggressive_war_effect = yes + + scope:defender = { + #EP2 accolade glory gain for winning against higher ranked enemy + accolade_defender_war_end_glory_gain_high_effect = yes + } + + scope:attacker = { + add_prestige = { + value = 0 + subtract = tier_scaled_prestige_value + } + } + scope:defender = { + add_prestige = { + value = tier_scaled_prestige_value + } + } + #Show land transfer + show_as_tooltip = { + #loser/winner scopes are only being set here to correctly display the effects of tgp_japan_soryo_eradicate_cb_transfer_effect in the tooltip! + scope:defender = { + save_scope_as = winner + } + scope:attacker = { + save_scope_as = loser + } + tgp_japan_soryo_eradicate_cb_transfer_effect = yes + } + #Show killing + show_as_tooltip = { + scope:attacker = { + death = { + death_reason = death_eradicated + killer = scope:defender + } + } + scope:attacker = { + every_courtier = { + custom = every_close_family_house_member_in_court_cb_lose_desc + limit = { + house = scope:attacker.house + this != scope:attacker.primary_heir + } + death = { + death_reason = death_eradicated + killer = scope:defender + } + } + } + } + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:defender + FAME_BASE = major_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + #Eradicate House follow up event + scope:attacker = { + trigger_event = tgp_japan_general.9550 + } + } + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + war_name = "ERADICATE_HOUSE_WAR_NAME" + war_name_base = "ERADICATE_HOUSE_WAR_NAME_BASE" + cb_name = "ERADICATE_HOUSE_CB_NAME" + interface_priority = 80 + + ticking_war_score_targets_entire_realm = yes + attacker_ticking_warscore = 0.01 + attacker_wargoal_percentage = 0.01 + attacker_score_from_occupation_scale = 100 + defender_score_from_occupation_scale = 100 + attacker_score_from_battles_scale = 150 + defender_score_from_battles_scale = 150 + + max_attacker_score_from_battles = 200 + max_defender_score_from_battles = 200 + + max_defender_score_from_occupation = 50 + max_attacker_score_from_occupation = 50 + + max_ai_diplo_distance_to_title = 500 + + ai_score_mult = { + value = 1 + add = common_cb_ai_score_mult_additive + multiply = common_cb_ai_score_mult + } +} + +# War to become Soryo as Kampaku +japan_establish_soryo_administration_cb = { + icon = soryo + group = subjugation + combine_into_one = yes + allow_hostages = no + should_show_war_goal_subview = no + + # scope:attacker + allowed_for_character = { + has_tgp_dlc_trigger = yes + always = no # Started by script + } + + should_invalidate = { + scope:defender = { government_has_flag = government_is_japan_feudal } + } + + on_invalidated_desc = { + desc = japan_establish_soryo_administration_cb_ended_invalid.desc + } + + on_victory_desc = { + desc = japan_establish_soryo_administration_cb_victory_desc + } + + on_victory = { + on_victory_effect = yes + + scope:attacker = { + save_scope_as = leader + } + scope:defender = { + save_scope_as = daijo_daijin + } + + #EP2 Accolade glory gain from winning against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_low_effect = yes } + + scope:attacker = { + add_prestige = { + value = scope:defender.tier_scaled_prestige_value + } + } + + scope:defender = { + add_prestige = { + value = 0 + subtract = tier_scaled_prestige_value + } + } + + scope:defender = { + faction_demand_regent_transfer_effect = { + NEW_REGENT = scope:attacker + REASON = conquest + } + } + + # Prestige Progress for the Attacker + every_in_list = { + list = target_titles + scope:attacker = { add_prestige_experience = minor_prestige_value } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker + FAME_BASE = major_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + scope:defender = { + every_character_war = { + limit = { is_attacker = scope:attacker } + every_war_defender = { + limit = { is_imprisoned = no } + hidden_effect = { + hard_imprison_character_effect = { + TARGET = this + IMPRISONER = scope:attacker + } + reverse_add_opinion = { + target = scope:attacker + modifier = vassal_lost_faction_revolt_war + } + } + } + } + } + } + + on_white_peace_desc = { + desc = japan_establish_soryo_administration_cb_white_peace_desc + } + + on_white_peace = { + on_white_peace_effect = yes + scope:attacker = { + add_prestige = medium_prestige_loss + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker # not important as the scales are identical + FAME_BASE = major_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + } + + on_defeat_desc = { + desc = japan_establish_soryo_administration_cb_defeat_desc + } + + on_defeat = { + on_defeat_effect = yes + scope:attacker = { + save_scope_as = leader + } + scope:defender = { + save_scope_as = daijo_daijin + show_as_tooltip = { japanese_establish_soryo_administration_reward_effect = yes } + trigger_event = tgp_japan_decision.9606 + } + + scope:defender = { + #EP2 accolade glory gain for winning against higher ranked enemy + accolade_defender_war_end_glory_gain_high_effect = yes + } + + scope:attacker = { + add_prestige = { + value = 0 + subtract = tier_scaled_prestige_value + } + } + + scope:defender = { + add_prestige = { + value = tier_scaled_prestige_value + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:defender + FAME_BASE = major_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + scope:attacker = { + every_character_war = { + limit = { is_defender = scope:defender } + every_war_attacker = { + limit = { is_imprisoned = no } + hidden_effect = { + hard_imprison_character_effect = { + TARGET = this + IMPRISONER = scope:defender + } + reverse_add_opinion = { + target = scope:defender + modifier = vassal_lost_faction_revolt_war + } + } + } + } + } + } + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + war_name = "JAPAN_ESTABLISH_SORYO_ADMINISTRATION_WAR_NAME" + war_name_base = "JAPAN_ESTABLISH_SORYO_ADMINISTRATION_WAR_NAME_BASE" + cb_name = "JAPAN_ESTABLISH_SORYO_ADMINISTRATION_CB_NAME" + interface_priority = 80 + + ticking_war_score_targets_entire_realm = yes + attacker_ticking_warscore = 0.01 + attacker_wargoal_percentage = 0.01 + attacker_score_from_occupation_scale = 50 + defender_score_from_occupation_scale = 50 + attacker_score_from_battles_scale = 250 + defender_score_from_battles_scale = 250 + + max_attacker_score_from_battles = 200 + max_defender_score_from_battles = 200 + + max_defender_score_from_occupation = 50 + max_attacker_score_from_occupation = 50 +} + +# War to disrupt Bloc +japan_bloc_war_cb = { + icon = bloc + group = subjugation + combine_into_one = yes + ai_only_against_neighbors = yes + allow_hostages = yes + should_show_war_goal_subview = no + + # scope:attacker + allowed_for_character = { + has_tgp_dlc_trigger = yes + # Soryo Bloc leader checks + tgp_soryo_or_bushido_trigger = yes + is_house_head = yes + house.house_confederation.leading_house ?= house + any_held_title = { is_noble_family_title = yes } + } + + allowed_for_character_display_regardless = { + custom_tooltip = { + text = japan_bloc_war_cb_cohesion_requirement_tt + house.house_confederation.cohesion >= 25 + } + } + + # scope:defender + allowed_against_character = { + tgp_soryo_or_bushido_trigger = yes + is_house_head = yes + house.house_confederation.leading_house ?= house + NOR = { + # Must be different Bloc + AND = { + exists = scope:attacker.house.house_confederation + house.house_confederation ?= scope:attacker.house.house_confederation + } + # Not any ongoing bloc war + any_character_war = { + using_cb = japan_bloc_war_cb + save_temporary_scope_as = war_temp + scope:attacker = { is_participant_in_war = scope:war_temp } + } + } + # Must be house head + any_held_title = { is_noble_family_title = yes } + } + + should_invalidate = { + OR = { + scope:attacker = { tgp_soryo_or_bushido_trigger = no } + scope:defender = { + OR = { + tgp_soryo_or_bushido_trigger = no + NOT = { exists = house.house_confederation } # Left bloc + house.house_confederation ?= scope:attacker.house.house_confederation # Same bloc + is_landed = no + } + } + } + } + + cost = { + prestige = { + add = { + value = 100 + desc = CB_BASE_COST + } + multiply = common_cb_prestige_cost_multiplier + } + } + + on_invalidated_desc = { + desc = japan_bloc_war_cb_ended_invalid.desc + } + + on_declaration = { + on_declared_war = yes + add_attacker_bloc_members_on_declared_effect = yes + } + + on_victory_desc = { + desc = japan_bloc_war_cb_victory_desc + } + + on_victory = { + on_victory_effect = yes + + scope:attacker = { + save_scope_as = winner + house.house_confederation = { + tgp_bloc_change_cohesion_effect = { + VALUE = tgp_bloc_war_defeat_cohesion_victory_value + ICON = scope:defender + REASON = bloc_war_victory + } + } + } + + scope:defender = { + save_scope_as = loser + house.house_confederation = { + tgp_bloc_change_cohesion_effect = { + VALUE = tgp_bloc_war_defeat_cohesion_defeat_value + ICON = scope:defender + REASON = bloc_war_defeat + } + } + } + + tgp_bloc_war_defeat_member_effect = { + WINNER = scope:winner + LOSER = scope:loser + } + + #EP2 Accolade glory gain from winning against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_low_effect = yes } + + scope:attacker = { + add_prestige = { + value = scope:defender.tier_scaled_prestige_value + } + } + + scope:defender = { + add_prestige = { + value = 0 + subtract = tier_scaled_prestige_value + } + } + + # Prestige Progress for the Attacker + every_in_list = { + list = target_titles + scope:attacker = { add_prestige_experience = minor_prestige_value } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker + FAME_BASE = major_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + } + + on_white_peace_desc = { + desc = japan_bloc_war_cb_white_peace_desc + } + + on_white_peace = { + on_white_peace_effect = yes + scope:attacker = { + add_prestige = medium_prestige_loss + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker # not important as the scales are identical + FAME_BASE = major_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + } + + on_defeat_desc = { + desc = japan_bloc_war_cb_defeat_desc + } + + on_defeat = { + on_defeat_effect = yes + scope:defender = { + save_scope_as = winner + house.house_confederation = { + tgp_bloc_change_cohesion_effect = { + VALUE = tgp_bloc_war_defeat_cohesion_victory_value + ICON = scope:attacker + REASON = bloc_war_victory + } + } + } + + scope:attacker = { + save_scope_as = loser + house.house_confederation = { + tgp_bloc_change_cohesion_effect = { + VALUE = tgp_bloc_war_defeat_cohesion_defeat_value + ICON = scope:defender + REASON = bloc_war_defeat + } + } + } + + tgp_bloc_war_defeat_member_effect = { + WINNER = scope:winner + LOSER = scope:loser + } + + scope:defender = { + #EP2 accolade glory gain for winning against higher ranked enemy + accolade_defender_war_end_glory_gain_high_effect = yes + } + + scope:attacker = { + add_prestige = { + value = 0 + subtract = tier_scaled_prestige_value + } + } + + scope:defender = { + add_prestige = { + value = tier_scaled_prestige_value + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:defender + FAME_BASE = major_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + } + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + war_name = "JAPAN_BLOC_WAR_NAME" + war_name_base = "JAPAN_BLOC_WAR_NAME_BASE" + cb_name = "JAPAN_BLOC_WAR_CB_NAME" + interface_priority = 80 + + ticking_war_score_targets_entire_realm = yes + attacker_ticking_warscore = 0.01 + attacker_wargoal_percentage = 0.01 + attacker_score_from_occupation_scale = 100 + defender_score_from_occupation_scale = 100 + attacker_score_from_battles_scale = 150 + defender_score_from_battles_scale = 150 + + max_attacker_score_from_battles = 100 + max_defender_score_from_battles = 100 + + max_defender_score_from_occupation = 100 + max_attacker_score_from_occupation = 100 + + max_ai_diplo_distance_to_title = 500 + + ai_score = { + value = japan_bloc_war_ai_score_value + } + + ai_score_mult = { + value = 1 + add = common_cb_ai_score_mult_additive + multiply = common_cb_ai_score_mult + } +}