From adfd8589fcf79f10d4fb3a55bef79b21f538d247 Mon Sep 17 00:00:00 2001 From: trashmasteruni Date: Mon, 19 Oct 2026 22:34:17 +0200 Subject: [PATCH] values updated and purged --- common/factions/00_nomadic_faction.txt | 579 ---- common/factions/00_populist_faction.txt | 1837 ------------- common/script_values/00_culture_values.txt | 10 +- common/script_values/00_distance_values.txt | 15 - .../00_dlc_fp3_script_values.txt | 1458 ---------- common/script_values/00_legitimacy_values.txt | 1357 ---------- .../script_values/00_men_at_arms_values.txt | 78 +- common/script_values/01_dynamic_values.txt | 2348 ----------------- common/script_values/02_religion_values.txt | 2 - .../script_values/06_ce1_legends_values.txt | 1547 ----------- .../99_court_chaplain_values.txt | 136 +- .../99_spouse_councillor_values.txt | 109 +- common/script_values/99_steward_values.txt | 1310 --------- common/script_values/tgp_values.txt | 864 ------ 14 files changed, 186 insertions(+), 11464 deletions(-) delete mode 100644 common/factions/00_nomadic_faction.txt delete mode 100644 common/factions/00_populist_faction.txt delete mode 100644 common/script_values/00_distance_values.txt delete mode 100644 common/script_values/00_dlc_fp3_script_values.txt delete mode 100644 common/script_values/00_legitimacy_values.txt delete mode 100644 common/script_values/01_dynamic_values.txt delete mode 100644 common/script_values/06_ce1_legends_values.txt delete mode 100644 common/script_values/99_steward_values.txt delete mode 100644 common/script_values/tgp_values.txt diff --git a/common/factions/00_nomadic_faction.txt b/common/factions/00_nomadic_faction.txt deleted file mode 100644 index d8472f231..000000000 --- a/common/factions/00_nomadic_faction.txt +++ /dev/null @@ -1,579 +0,0 @@ -nomadic_faction = { - casus_belli = nomadic_war - - leaders_allowed_to_leave = no - player_can_join = no - - sort_order = 3 - - name = FACTION_NOMAD_DYNAMIC_NAME - - short_effect_desc = nomadic_faction_short_effect_desc - - discontent_progress = { - base = 0 - - modifier = { - add = 5 - desc = "BASE_COLON" - } - } - - power_threshold = 0 - - requires_county = yes - requires_character = no - - is_valid = { - always = yes - } - - is_county_valid = { - # Counties can only be in a faction against the top liege in their realm (who is inherently independent). - scope:faction.faction_target = holder.top_liege - holder.top_liege = { - NOR = { - has_government = herder_government - any_owned_story = { - OR = { - story_type = story_greatest_of_khans - story_type = story_mongol_invasion - } - } - } - } - - title_province = { - OR = { - has_holding_type = nomad_holding - has_holding_type = herder_holding - } - } - } - - can_character_join = { - joined_faction = scope:faction - } - - can_county_join = { - title_province = { - OR = { - has_holding_type = nomad_holding - has_holding_type = herder_holding - } - } - } - - can_county_create = { - county_opinion < 0 - - # Can only join factions against our top liege (not direct liege) - scope:target = holder.top_liege - holder.top_liege = { - NOR = { - has_government = herder_government - any_owned_story = { - OR = { - story_type = story_greatest_of_khans - story_type = story_mongol_invasion - } - } - } - } - - title_province = { - OR = { - has_holding_type = nomad_holding - has_holding_type = herder_holding - } - } - - #### - # BLOCKERS - #### - # General Faction immunity - custom_description = { - text = character_is_immune_to_factions - subject = scope:target - NOT = { scope:target = { immune_to_factions_trigger = yes } } - } - } - - can_character_become_leader = { - always = yes - } - - county_create_score = { - base = -5 - - compare_modifier = { # Non-nomads get it at -15 county opinion - trigger = { - scope:target = { - NOT = { government_has_flag = government_is_nomadic } - } - } - value = county_opinion - multiplier = -2 - - desc = "FACTION_REASON_COUNTY_OPINION" - } - - compare_modifier = { # Nomads get it at roughly -35 county opinion - trigger = { - scope:target = { - government_has_flag = government_is_nomadic - } - } - value = county_opinion - multiplier = -1 - - desc = "FACTION_REASON_COUNTY_OPINION" - } - - # If the targeted ruler isn't nomadic... time to rumble - modifier = { - add = 20 - scope:target = { - NOR = { - government_has_flag = government_is_nomadic - government_has_flag = government_is_herder - } - } - desc = "FACTION_REASON_DISLIKE_NON_NOMADS" - } - - legalism_virtue_and_sin_modifier = { - TARGET = scope:target - SCORE_PER_TRAIT = 10 - } - - # Realm Stability Settings - modifier = { - add = 25 - has_game_rule = lesser_realm_stability - } - modifier = { - add = -25 - has_game_rule = higher_realm_stability - } - modifier = { - add = -50 - has_game_rule = extreme_realm_stability - } - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_LESSER" - add = 25 - has_game_rule = lesser_realm_stability_ai_only - scope:target = { - is_ai = yes - } - } - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_HIGHER" - add = -25 - has_game_rule = higher_realm_stability_ai_only - scope:target = { - is_ai = yes - } - } - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_EXTREME" - add = -50 - has_game_rule = extreme_realm_stability_ai_only - scope:target = { - is_ai = yes - } - } - - # Conquerors - modifier = { - add = -100 - scope:target = { ai_should_get_conqueror_bonuses = yes } - } - modifier = { - add = -200 - scope:target = { ai_should_get_extreme_conqueror_bonuses = yes } - } - - # 10-year 'grace period' from nomadic factions forming after game start - modifier = { - years_from_game_start <= 10 - factor = { - value = 0 - if = { - limit = { years_from_game_start >= 5 } - add = years_from_game_start - subtract = 5 - divide = 5 # In year 6 factions can begin forming, but at 20% weighting. This increases to 40% in year 7, 60% in year 8, etc., up to 100% in year 10 where things are then normal. - } - } - } - } - - county_join_score = { - base = 0 - - compare_modifier = { # Non-nomads get it at -10 county opinion - trigger = { - scope:faction.faction_target = { - NOT = { government_has_flag = government_is_nomadic } - } - } - value = county_opinion - multiplier = -2 - - desc = "FACTION_REASON_COUNTY_OPINION" - } - - compare_modifier = { # Nomads get it at roughly -30 county opinion - trigger = { - scope:faction.faction_target = { - government_has_flag = government_is_nomadic - } - } - value = county_opinion - multiplier = -1 - - desc = "FACTION_REASON_COUNTY_OPINION" - } - - # If the targeted ruler isn't nomadic... time to rumble - modifier = { - add = 10 - scope:faction.faction_target = { - NOR = { - government_has_flag = government_is_nomadic - government_has_flag = government_is_herder - } - } - desc = "FACTION_REASON_DISLIKE_NON_NOMADS" - } - - legalism_virtue_and_sin_modifier = { - TARGET = scope:faction.faction_target - SCORE_PER_TRAIT = 10 - } - - # Realm Stability Settings - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_LESSER" - add = 25 - has_game_rule = lesser_realm_stability - } - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_HIGHER" - add = -25 - has_game_rule = higher_realm_stability - } - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_EXTREME" - add = -50 - has_game_rule = extreme_realm_stability - } - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_LESSER" - add = 25 - has_game_rule = lesser_realm_stability_ai_only - scope:faction.faction_target = { - is_ai = yes - } - } - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_HIGHER" - add = -25 - has_game_rule = higher_realm_stability_ai_only - scope:faction.faction_target = { - is_ai = yes - } - } - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_EXTREME" - add = -50 - has_game_rule = extreme_realm_stability_ai_only - scope:faction.faction_target = { - is_ai = yes - } - } - - # Conquerors - modifier = { - add = -100 - scope:faction.faction_target = { ai_should_get_conqueror_bonuses = yes } - } - modifier = { - add = -200 - scope:faction.faction_target = { ai_should_get_extreme_conqueror_bonuses = yes } - } - } - - county_power = county_horde_riders_to_raise_power - - ai_join_score = { - } - - on_creation = { - random_faction_county_member = { - save_scope_as = founding_county - } - - set_variable = { - name = faction_culture - value = scope:founding_county.culture - } - set_variable = { - name = faction_faith - value = scope:founding_county.faith - } - } - - on_destroy = { - set_variable = { - name = peasant_destroying - value = yes - } - if = { - limit = { exists = special_character } - special_character = { - save_temporary_scope_as = destroyer_of_titles - if = { - limit = { - has_variable = peasant_title - exists = this.var:peasant_title.holder - } - destroy_title = this.var:peasant_title - } - if = { - limit = { - NOT = { - has_character_flag = successful_nomad_revolt_leader - } - } - every_held_title = { - limit = { - is_landless_type_title = yes - } - scope:destroyer_of_titles = { destroy_title = prev } - } - if = { - limit = { # To make sure we aren't in debt - gold > 0 - } - remove_long_term_gold = gold # Zero out our wallet since the revolt is over and we're going back to being unlanded. - } - } - if = { - limit = { - is_alive = yes # To prevent dead people from being checked for variables - } - if = { - limit = { - has_variable = rebel_leader_peasants - } - remove_variable = rebel_leader_peasants - } - remove_variable = peasant_title - remove_character_flag = peasant_faction_random_peasant - remove_character_flag = peasant_faction_claimant_without_title - if = { - limit = { - has_character_flag = peasant_faction_random_peasant - NOT = { has_character_flag = peasant_revolt_do_not_kill } - } - death = { - death_reason = death_vanished - } - } - } - } - } - } - - demand = { - setup_nomadic_leader_effect = yes - # Faction leader is unhappy if they reach the point of needing to issue an ultimatim. - faction_leader = { - add_opinion = { - modifier = angry_opinion - target = root.faction_target - opinion = -50 - } - } - - # Save scopes that will be used in the demand event. - save_scope_as = faction - special_character = { - save_scope_as = peasant_leader - } - - # Check for relevant vassals that owns any land targeted by the faction. - save_temporary_scope_as = county_faction - every_faction_county_member = { - limit = { - holder = { - NOT = { this = scope:faction.faction_target } - NOT = { is_in_list = nomadic_faction_vassal_targets } - } - } - holder = { - add_to_list = nomadic_faction_vassal_targets - } - } - every_faction_county_member = { - holder = { - every_liege_or_above = { - limit = { - NOT = { this = scope:faction.faction_target } - NOT = { is_in_list = nomadic_faction_vassal_targets } - } - add_to_list = nomadic_faction_vassal_targets - } - } - } - - # Check if there is a player affected by the faction. AI rulers are blocked from accepting the faction demand if so. - if = { - limit = { - any_in_list = { - list = nomadic_faction_vassal_targets - is_ai = no - } - } - scope:faction = { - set_variable = { - name = faction_targets_player - value = yes - } - } - } - - # Fire the demand event. A follow up event will be sent to affected vassals. - scope:faction.faction_target = { - trigger_event = faction_demand.9998 - } - } - - ai_demand_chance = { - base = 100 - - modifier = { - add = -1000 - faction_target = { - involved_activity ?= { - has_activity_type = activity_coronation - activity_host = prev - } - } - } - } - - on_war_start = { - # Duchy initialization so we can concentrate the rebels in just a few important counties instead of spreading them over the entire realm. - every_faction_county_member = { - duchy = { - if = { - limit = { - NOT = { - is_in_list = areas_of_rebellion - } - } - add_to_list = areas_of_rebellion - } - } - } - - # Check where in the duchy the rebellion troops should spawn, then spawn them. - every_in_list = { - list = areas_of_rebellion - save_temporary_scope_as = this_duchy - - # Determine where in the duchy those troops should spawn. - ordered_in_de_jure_hierarchy = { - # Troops can only spawn in counties that belong to our faction! - limit = { - tier = tier_county - any_title_joined_faction = { - this = root - } - } - - order_by = county_fertility - - title_province = { - save_temporary_scope_as = local_center_of_rebellion - } - } - - # Spawn the faction troops in the designated location. - root.faction_leader = { - spawn_nomadic_revolt_troops = yes - } - - # Give the populist leader a commander for each stack of troops. - create_character = { - template = new_commander_character - location = scope:local_center_of_rebellion - faith = root.faction_leader.faith - rite = root.faction_leader.rite - culture = root.faction_leader.culture - save_scope_as = new_populist_commander - gender_female_chance = { - if = { - limit = { root.faction_leader.culture = { has_cultural_parameter = martial_custom_male_only_combatant } } - add = 0 - } - else_if = { - limit = { root.faction_leader.culture = { has_cultural_parameter = martial_custom_female_only_combatant } } - add = 100 - } - else = { - add = 50 - } - } - } - scope:new_populist_commander = { - set_employer = root.faction_leader - add_trait = nomadic_philosophy - } - } - - # Give the populist leader a small purse so they don't immediately go bankrupt with army maintenance. - every_faction_county_member = { - root.faction_leader = { - add_gold = 25 - } - } - } - - leader_leaves = { - # Should only trigger when the leader is captured in battle. - if = { - limit = { - special_character ?= { - is_alive = no - } - } - faction_war = { - end_war = defender - } - destroy_faction = yes - } - if = { - limit = { - NOT = { has_variable = peasant_destroying } - exists = faction_war - } - faction_war = { - end_war = defender - } - } - } - - character_allow_create = no - - special_character_title = "FACTIONS_WINDOW_LEADER" - - inherit_membership = no - - multiple_targeting = no -} - diff --git a/common/factions/00_populist_faction.txt b/common/factions/00_populist_faction.txt deleted file mode 100644 index 00a17a8f3..000000000 --- a/common/factions/00_populist_faction.txt +++ /dev/null @@ -1,1837 +0,0 @@ -populist_faction = { - casus_belli = populist_war - - leaders_allowed_to_leave = no - player_can_join = no - - sort_order = 3 - - name = FACTION_POPULIST_DYNAMIC_NAME - - short_effect_desc = { - first_valid = { - triggered_desc = { - trigger = { - faction_target = { government_allows = state_faith } - } - desc = populist_faction_short_effect_desc_admin - } - desc = populist_faction_short_effect_desc - } - } - - discontent_progress = { - base = 0 - - common_discontent_progress_modifier = yes - modifier = { - faction_target = { can_vassals_be_attacked = yes } - add = 2 - desc = border_war_increased_peasant_discontent - } - modifier = { - faction_target = { - top_participant_group:dynastic_cycle ?= { - has_participant_group_parameter = dynastic_cycle_more_peasant_factions - } - } - add = 2 - desc = instability_increased_peasant_discontent - } - } - - power_threshold = { - base = 80 - - modifier = { - add = 20 - faction_target = { - has_perk = hard_rule_perk - } - desc = "FACTION_POWER_HARD_RULE" - } - - #Lower the threshold depending on the state of other factions - dynamic_power_threshold_scripted_modifier = { - FACTION_TYPE1 = claimant_faction - FACTION_TYPE2 = independence_faction - FACTION_TYPE3 = liberty_faction - } - } - - requires_county = yes - requires_character = no - - # Faction existence is valid - is_valid = { - trigger_if = { - limit = { - exists = special_character - } - special_character = { - is_alive = yes - } - } - } - - ########### - # Counties/characters are allowed to exist in the faction at all (will be kicked out if they fail these checks while already in it). - is_character_valid = { - has_valid_faction_members_trigger = yes - # Only AIs are allowed to be in popular factions. - is_ai = yes - - # Landed rulers can only be in the faction... - trigger_if = { - limit = { - is_playable_character = yes - exists = liege - this != liege - } - - # ... If they are a direct vassal of the faction target. - liege = scope:faction.faction_target - - # ... If they are at least a count. (Barons are not allowed.) - highest_held_title_tier >= tier_county - } - - # A rite other than the Admin State Rite is a grievance even within the same faith - custom_tooltip = { - text = populist_faction_same_culture_faith_as_liege - OR = { - faith != scope:faction.faction_target.faith - culture != scope:faction.faction_target.culture - AND = { - exists = scope:faction.faction_target.primary_title.state_rite - rite != scope:faction.faction_target.primary_title.state_rite - } - } - } - - # Not forbidden from being in factions. - NOT = { - has_character_flag = joining_faction_block - } - is_imprisoned = no - } - - is_county_valid = { - # Counties can only be in a faction against the top liege in their realm (who is inherently independent). - scope:faction.faction_target = holder.top_liege - - # Counties must have a different faith or culture than the faction target; - # in Admin, a rite other than the State Rite also qualifies. - OR = { - faith != scope:faction.faction_target.faith - culture != scope:faction.faction_target.culture - AND = { - exists = scope:faction.faction_target.primary_title.state_rite - rite != scope:faction.faction_target.primary_title.state_rite - } - } - - # Counties must have the same faith as the faction - scope:faction = { - OR = { - NOT = { - has_variable = faction_faith - } - AND = { - has_variable = faction_faith - root.faith = var:faction_faith - } - } - } - - # Player capitals are blocked from joining populist factions (to avoid Game Overing a player due to a populist uprising against their liege, which as a vassal they can't really prevent or fight) - save_temporary_scope_as = this_county - trigger_if = { - limit = { - holder = { - is_ai = no - } - } - this != holder.capital_county - } - title_province = { - NOR = { - has_holding_type = nomad_holding - has_holding_type = herder_holding - } - } - } - - ########### - # Counties/characters are allowed to create/join the faction (but will remain in faction if they fail these after joining). - - can_character_join = { - # Must share this faction's faith. - scope:faction = { - has_variable = faction_faith - root.faith = var:faction_faith - } - } - - can_county_join = { - # In Admin, the faith-driven faction also needs a State Rite grievance - scope:faction = { - trigger_if = { - limit = { has_variable = faction_faith } - root.faith = var:faction_faith - trigger_if = { - limit = { - exists = scope:faction.faction_target.primary_title.state_rite - } - root.rite != scope:faction.faction_target.primary_title.state_rite - } - } - } - - title_province = { - NOR = { - has_holding_type = nomad_holding - has_holding_type = herder_holding - } - } - } - - can_county_create = { - county_opinion < 0 - - # Can only join factions against our top liege (not direct liege) - scope:target = holder.top_liege - - # Must have a culture or faith different from the target's; - # in Admin, a rite other than the State Rite also qualifies. - OR = { - #make sure you do not accept their faith - faith ?= { - faith_hostility_level = { - target = scope:target.faith - value > faith_fully_accepted_level - } - } - culture != scope:target.culture - AND = { - exists = scope:target.primary_title.state_rite - rite != scope:target.primary_title.state_rite - } - } - - #### - # BLOCKERS - #### - # General Faction immunity - custom_description = { - text = character_is_immune_to_factions - subject = scope:target - NOT = { scope:target = { immune_to_factions_trigger = yes } } - } - - title_province = { - NOR = { - has_holding_type = nomad_holding - has_holding_type = herder_holding - } - } - } - - can_character_become_leader = { - has_variable = rebel_leader_peasants - var:rebel_leader_peasants = scope:faction - } - - ########### - # Counties/characters are *willing* to join or remain in the faction (not blocked from being in the faction, but unless these are true they will not join the faction unless forced). - - county_create_score = { - base = -160 # Counties can't create a new faction unless opinion is less than -20 (see summary below). - - # If a suitable Popular Faction already exists (of the same faith), side with it instead. - modifier = { - add = -1000 - scope:target = { - any_targeting_faction = { - faction_type = populist_faction - any_faction_county_member = { - this.title_province.faith = root.title_province.faith - } - } - } - } - # If a suitable Escalated Faction exists, prefer to join it instead. - modifier = { - desc = "FACTION_REASON_PREFER_ESCALATED_FACTION" - add = -100 - scope:target = { - any_targeting_faction = { - faction_type = escalated_peasant_faction - } - } - } - - # Summary of score weights (base + modifiers): - # Different Culture Group + Evil Faith: 100% chance at -32 opinion, 1% chance at -19 opinion - # Different Culture (Same Group) + Hostile Faith: 90% chance at -100 opinion, 1% chance at -46 opinion - # Different Culture AND Astray Faith: 40% chance at -100 opinion, 1% chance at -80 opinion - # Different Culture OR Astray Faith: Never Creates - compare_modifier = { - trigger = { - this.title_province.culture != scope:target.culture - this.title_province.culture = { has_same_culture_heritage = scope:target.culture } - } - value = county_opinion - multiplier = -1.0 - } - compare_modifier = { - trigger = { - NOT = { this.title_province.culture = { has_same_culture_heritage = scope:target.culture } } - } - value = county_opinion - multiplier = -3.0 - } - pluralism_fundamentalism_dual_modifier = { - ASTRAY_BASE_VALUE = faction_county_opinion_astray - HOSTILE_BASE_VALUE = faction_county_opinion_hostile - EVIL_BASE_VALUE = faction_county_opinion_evil - BASE_FAITH = faith - TARGET = scope:target - } - pluralism_fundamentalism_modifier = { - ASTRAY_BASE_VALUE = faction_county_opinion_astray - HOSTILE_BASE_VALUE = faction_county_opinion_hostile - EVIL_BASE_VALUE = faction_county_opinion_evil - BASE_FAITH = faith - TARGET = scope:target - } - - # Greatly reduced chance for a character's capital county to form a faction against them (extra -25 opinion needed). - modifier = { - add = -200 - this.title_province = scope:target.capital_province - } - - legalism_virtue_and_sin_modifier = { - TARGET = scope:target - SCORE_PER_TRAIT = 50 # Worth ~12 opinion per trait. - } - - liege_debt_modifier = { - TARGET = scope:target - SCORE_PER_DEBT_LEVEL = 20 # Worth ~5 opinon per debt level, up to a max of 140 (-35 opinion) - } - - # Ruling Caste - modifier = { - add = -25 - culture != scope:target.culture - scope:target.culture = { - has_cultural_parameter = peasant_and_populist_factions_less_common - } - } - - # Defiant Ambushers - modifier = { - add = 25 - county_opinion < 0 - culture != scope:target.culture - culture = { has_cultural_parameter = county_peasant_and_populist_factions_more_common } - } - - # Realm Stability Settings - modifier = { - add = 50 - has_game_rule = lesser_realm_stability - } - modifier = { - add = -100 - has_game_rule = higher_realm_stability - } - modifier = { - add = -200 - has_game_rule = extreme_realm_stability - } - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_LESSER" - add = 50 - has_game_rule = lesser_realm_stability_ai_only - scope:target = { - is_ai = yes - } - } - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_HIGHER" - add = -100 - has_game_rule = higher_realm_stability_ai_only - scope:target = { - is_ai = yes - } - } - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_EXTREME" - add = -200 - has_game_rule = extreme_realm_stability_ai_only - scope:target = { - is_ai = yes - } - } - - # Conquerors - modifier = { - add = -100 - scope:target = { ai_should_get_conqueror_bonuses = yes } - } - modifier = { - add = -200 - scope:target = { ai_should_get_extreme_conqueror_bonuses = yes } - } - # TGP Dynastic Cycle in Instability phase - modifier = { - desc = "FACTION_REASON_DYNASTIC_CYCLE_INSTABILITY" - add = 25 - scope:target = { - top_participant_group:dynastic_cycle ?= { - has_participant_group_parameter = dynastic_cycle_more_peasant_factions - } - } - } - - # 10-year 'grace period' from populist factions forming after game start - modifier = { - years_from_game_start <= 10 - factor = { - value = 0 - if = { - limit = { years_from_game_start >= 5 } - add = years_from_game_start - subtract = 5 - divide = 5 # In year 6 factions can begin forming, but at 20% weighting. This increases to 40% in year 7, 60% in year 8, etc., up to 100% in year 10 where things are then normal. - } - } - } - } - - county_join_score = { - base = -120 # Counties won't join unless opinion is less than -15 (see summary below). - - modifier = { - add = -1000 - # Do not join if we have nothing to gain (already share Liege faith and will not share new liege Culture (Group)). - AND = { - # We already share a Faith with the Top Liege. - title_province.faith = scope:faction.faction_target.faith - # And we do NOT share a Culture Group with the faction leader. - NOT = { this.title_province.culture = { has_same_culture_heritage = scope:faction.var:faction_culture } } - } - } - # If a suitable Escalated Faction exists, prefer to join it instead. - modifier = { - desc = "FACTION_REASON_PREFER_ESCALATED_FACTION" - add = -100 - scope:faction.faction_target = { - any_targeting_faction = { - faction_type = escalated_peasant_faction - } - } - } - - # Summary of score weights (base + modifiers): - # Different Culture Group + Evil Faith: 100% chance at -28 opinion, 1% chance at -15 opinion - # Different Culture (Same Group) + Hostile Faith: 100% chance at -88 opinion, 1% chance at -34 opinion - # Different Culture (Same Group) AND Astray Faith: 80% chance at -100 opinion, 1% chance at -60 opinion - # Different Culture (Same Group) OR Astray Faith: Never Joins - compare_modifier = { - desc = "FACTION_REASON_CULTURAL_REASONS" - trigger = { - NOR = { - this.title_province.culture = scope:faction.faction_target.culture - AND = { - scope:faction.faction_target = { has_active_diarchy = yes } - this.title_province.culture = scope:faction.faction_target.diarch.culture - } - } - OR = { - this.title_province.culture = { has_same_culture_heritage = scope:faction.faction_target.culture } - AND = { - scope:faction.faction_target = { has_active_diarchy = yes } - this.title_province.culture = { has_same_culture_heritage = scope:faction.faction_target.diarch.culture } - } - } - } - value = county_opinion - multiplier = -1.0 - } - compare_modifier = { - desc = "FACTION_REASON_CULTURAL_REASONS" - trigger = { - NOR = { - this.title_province.culture = scope:faction.faction_target.culture - AND = { - scope:faction.faction_target = { has_active_diarchy = yes } - this.title_province.culture = scope:faction.faction_target.diarch.culture - } - } - } - value = county_opinion - multiplier = -3.0 - } - pluralism_fundamentalism_dual_modifier = { - ASTRAY_BASE_VALUE = faction_county_opinion_astray - HOSTILE_BASE_VALUE = faction_county_opinion_hostile - EVIL_BASE_VALUE = faction_county_opinion_evil - BASE_FAITH = faith - TARGET = scope:faction.faction_target - } - pluralism_fundamentalism_modifier = { - ASTRAY_BASE_VALUE = faction_county_opinion_astray - HOSTILE_BASE_VALUE = faction_county_opinion_hostile - EVIL_BASE_VALUE = faction_county_opinion_evil - BASE_FAITH = faith - TARGET = scope:faction.faction_target - } - - # Reduced chance for a character's capital county to join a faction against them (extra -10 opinion needed). - modifier = { - desc = "FACTION_REASON_CAPITAL_COUNTY" - add = -80 - exists = scope:faction.faction_target.capital_province - this.title_province = scope:faction.faction_target.capital_province - } - - legalism_virtue_and_sin_modifier = { - TARGET = scope:faction.faction_target - SCORE_PER_TRAIT = 50 # Worth ~12 opinion per virtue. - } - - liege_debt_modifier = { - TARGET = scope:faction.faction_target - SCORE_PER_DEBT_LEVEL = 20 # Worth ~5 opinon per debt level, up to a max of 140 (-35 opinion) - } - - # Ruling Caste - modifier = { - desc = "FACTION_REASON_RULING_CASTE" - add = -25 - culture != scope:faction.faction_target.culture - scope:faction.faction_target.culture = { - has_cultural_parameter = peasant_and_populist_factions_less_common - } - } - - # Defiant Ambushers - modifier = { - add = 25 - county_opinion < 0 - culture != scope:faction.faction_target.culture - culture = { has_cultural_parameter = county_peasant_and_populist_factions_more_common } - } - - # Realm Stability Settings - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_LESSER" - add = 50 - has_game_rule = lesser_realm_stability - } - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_HIGHER" - add = -100 - has_game_rule = higher_realm_stability - } - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_EXTREME" - add = -200 - has_game_rule = extreme_realm_stability - } - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_LESSER" - add = 50 - has_game_rule = lesser_realm_stability_ai_only - scope:faction.faction_target = { - is_ai = yes - } - } - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_HIGHER" - add = -100 - has_game_rule = higher_realm_stability_ai_only - scope:faction.faction_target = { - is_ai = yes - } - } - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_EXTREME" - add = -200 - has_game_rule = extreme_realm_stability_ai_only - scope:faction.faction_target = { - is_ai = yes - } - } - - # Conquerors - modifier = { - add = -100 - scope:faction.faction_target = { ai_should_get_conqueror_bonuses = yes } - } - modifier = { - add = -200 - scope:faction.faction_target = { ai_should_get_extreme_conqueror_bonuses = yes } - } - - # Regent - modifier = { - desc = "FACTION_REASON_REGENT_CULTURAL_REASONS" - add = -100 - scope:faction.faction_target.culture != culture - scope:faction.faction_target = { has_active_diarchy = yes } - scope:faction.faction_target.diarch.culture ?= culture - } - modifier = { - desc = "FACTION_REASON_REGENT_FAITH_REASONS" - add = -100 - scope:faction.faction_target.faith != faith - scope:faction.faction_target = { has_active_diarchy = yes } - scope:faction.faction_target.diarch.faith ?= faith - } - # TGP Dynastic Cycle in Instability phase - modifier = { - desc = "FACTION_REASON_DYNASTIC_CYCLE_INSTABILITY" - add = 25 - scope:faction.faction_target = { - top_participant_group:dynastic_cycle ?= { - has_participant_group_parameter = dynastic_cycle_more_peasant_factions - } - } - } - } - - county_power = county_levies_to_raise - - ai_join_score = { - base = -25 - - # Do not join a new faction if I am already at war. - modifier = { - add = -1000 - AND = { - is_at_war = yes - trigger_if = { - limit = { - exists = joined_faction - } - joined_faction != scope:faction - } - } - } - - modifier = { - add = -1000 - # Do not join if we have nothing to gain (already share Liege faith and will not share new liege Culture (Group)). - AND = { - # We already share a Faith with the Top Liege. - faith = scope:faction.faction_target.faith - # And we do NOT share a Culture Group with the faction leader. - NOT = { culture = { has_same_culture_heritage = scope:faction.var:faction_culture } } - } - } - - # Block characters from joining if they have a high opinion of the target - modifier = { - add = -1000 - save_temporary_opinion_value_as = { name = target_opinion target = scope:faction.faction_target } - scope:target_opinion >= 80 - } - - # Opinion of the Liege - opinion_modifier = { - who = root - opinion_target = scope:faction.faction_target - multiplier = -1 - } - - # Not a de jure vassal or consequent part of the realm is out of the De Jure - modifier = { - desc = "FACTION_REASON_RIGHTFUL" - add = { - value = 125 - # Larger realms are inherently more rebellious. - add = { - value = sub_realm_size - multiply = 2 - } - } - OR = { - NOT = { - scope:faction.faction_target = { - is_rightful_liege_of = root - } - } - any_sub_realm_county = { - percent <= 0.5 - save_temporary_scope_as = current_county - scope:faction.faction_target.primary_title = { - any_in_de_jure_hierarchy = { - this = scope:current_county - } - } - } - } - } - - # Cultural and religious differences with liege - modifier = { # Between +50 and +100 based on culture - desc = "FACTION_REASON_CULTURAL_REASONS" - NOT = { culture = { has_same_culture_heritage = scope:faction.faction_target.culture } } - NOT = { culture = { has_cultural_parameter = doesnt_care_about_culture_faith_in_factions } } - culture = { has_same_culture_heritage = scope:faction.var:faction_culture } - add = { - value = 50 - if = { - limit = { - culture != scope:faction.faction_target.culture - culture = scope:faction.var:faction_culture - } - add = 50 - } - } - } - - # Base values can range from +17.5 to +250 depending on hostility and pluralism/fundamentalism levels. - pluralism_fundamentalism_dual_modifier = { - ASTRAY_BASE_VALUE = 35 - HOSTILE_BASE_VALUE = 75 - EVIL_BASE_VALUE = 125 - BASE_FAITH = faith - TARGET = scope:faction.faction_target - } - pluralism_fundamentalism_modifier = { - ASTRAY_BASE_VALUE = 35 - HOSTILE_BASE_VALUE = 75 - EVIL_BASE_VALUE = 125 - BASE_FAITH = faith - TARGET = scope:faction.faction_target - } - - legalism_virtue_and_sin_modifier = { - TARGET = scope:faction.faction_target - SCORE_PER_TRAIT = 25 - } - - liege_debt_modifier = { - TARGET = scope:faction.faction_target - SCORE_PER_DEBT_LEVEL = 10 - } - - tenet_divine_marriage_incestuous_liege_faction_modifier = { - TARGET = scope:faction.faction_target - } - - # The AI is almost always unwilling to join a faction against their friends and lovers. - modifier = { - desc = "FACTION_REASON_TARGET_FRIEND_LOVER" - add = -250 - OR = { - has_relation_lover = scope:faction.faction_target - has_relation_friend = scope:faction.faction_target - } - } - - # Dread. Does not apply if the faction is above the power threshold - intimidated_from_faction_modifier = { - TARGET = scope:faction.faction_target - POWER = scope:faction.faction_power - THRESHOLD = scope:faction.faction_power_threshold - } - - # Leader never leaves - modifier = { - desc = "FACTION_REASON_FACTION_LEADER" - has_variable = rebel_leader_peasants - add = 10000 - } - - # Ruling Caste - modifier = { - desc = "FACTION_REASON_RULING_CASTE" - add = -20 - culture != scope:faction.faction_target.culture - scope:faction.faction_target.culture = { - has_cultural_parameter = peasant_and_populist_factions_less_common - } - } - - # Realm Stability Settings - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_LESSER" - add = 25 - has_game_rule = lesser_realm_stability - } - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_HIGHER" - add = -50 - has_game_rule = higher_realm_stability - } - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_EXTREME" - add = -100 - has_game_rule = extreme_realm_stability - } - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_LESSER" - add = 25 - has_game_rule = lesser_realm_stability_ai_only - scope:faction.faction_target = { - is_ai = yes - } - } - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_HIGHER" - add = -50 - has_game_rule = higher_realm_stability_ai_only - scope:faction.faction_target = { - is_ai = yes - } - } - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_EXTREME" - add = -100 - has_game_rule = extreme_realm_stability_ai_only - scope:faction.faction_target = { - is_ai = yes - } - } - - ########################## - # Faction 'Stacking' Factors, attempts to cluster AI rulers into several powerful factions instead of many weak ones. - join_faction_stacking_modifiers = yes - - # Small multiplier for my neighbors already in the Faction - modifier = { - desc = "FACTION_REASON_NEIGHBORS" - factor = { - value = 1 - scope:faction = { - every_faction_member = { - if = { - limit = { - any_neighboring_realm_same_rank_owner = { - this = root - } - } - add = 0.25 - } - } - } - } - } - - modifier = { - desc = "FACTION_REASON_POWERFUL_VASSAL" - factor = 2 - is_powerful_vassal_of = scope:faction.faction_target - } - #EP3 admin legitimacy event - modifier = { - desc = "FACTION_REASON_LOW_LEGITIMACY_CHALLENGER" - add = 25 - scope:faction = { - any_faction_member = { - has_character_flag = low_legitimacy_admin_factions_flag - } - } - } - # TGP Dynastic Cycle in Instability phase - modifier = { - desc = "FACTION_REASON_DYNASTIC_CYCLE_INSTABILITY" - add = 25 - scope:faction.faction_target = { - top_participant_group:dynastic_cycle ?= { - has_participant_group_parameter = dynastic_cycle_more_peasant_factions - } - } - } - } - - on_creation = { - random_faction_county_member = { - save_scope_as = founding_county - } - - set_variable = { - name = faction_culture - value = scope:founding_county.culture - } - set_variable = { - name = faction_faith - value = scope:founding_county.faith - } - } - - on_destroy = { - set_variable = { - name = peasant_destroying - value = yes - } - if = { - limit = { exists = special_character } - special_character = { - if = { - limit = { - has_variable = { - name = peasant_faction_claimant_without_title - name = peasant_faction_random_peasant - } - has_variable = peasant_title - } - if = { - limit = { - has_variable = peasant_title - } - destroy_title = this.var:peasant_title - } - if = { - limit = { # To make sure we aren't in debt - is_alive = yes - gold > 0 - } - remove_long_term_gold = gold # Zero out our wallet since the revolt is over and we're going back to being unlanded. - } - } - if = { - limit = { - is_alive = yes # To prevent dead people from being checked for variables - } - if = { - limit = { - has_variable = rebel_leader_peasants - } - remove_variable = rebel_leader_peasants - } - remove_variable = peasant_title - remove_character_flag = peasant_faction_random_peasant - remove_character_flag = peasant_faction_claimant_without_title - if = { - limit = { - has_character_flag = peasant_faction_random_peasant - NOT = { has_character_flag = peasant_revolt_do_not_kill } - } - death = { - death_reason = death_vanished - } - } - } - } - } - } - - demand = { - setup_populist_leader_effect = yes - # Faction leader is unhappy if they reach the point of needing to issue an ultimatim. - if = { - limit = { exists = faction_leader } - faction_leader = { - add_opinion = { - modifier = angry_opinion - target = root.faction_target - opinion = -20 - } - } - } - - # Refresh the faction's target title (best target may have changed between creation and pressing demands). - get_popular_revolt_target_effect = { FACTION = this } - - # Save scopes that will be used in the demand event. - save_scope_as = faction - special_character = { - save_scope_as = peasant_leader - save_scope_as = faction_leader - } - special_title = { - save_scope_as = target_title - } - - # Check for relevant vassals that owns any land targeted by the faction. - save_temporary_scope_as = county_faction - every_faction_county_member = { - limit = { - holder = { - this != scope:faction.faction_target - NOT = { - joined_faction ?= { - this = scope:county_faction - } - } - OR = { - is_vassal_of = scope:faction.faction_target - is_ai = no - } - NOT = { is_in_list = popular_faction_vassal_targets } - } - } - holder = { - add_to_list = popular_faction_vassal_targets - } - } - every_faction_county_member = { - holder = { - every_liege_or_above = { - limit = { - this != scope:faction.faction_target - NOT = { - joined_faction ?= { - this = scope:county_faction - } - } - OR = { - is_vassal_of = scope:faction.faction_target - is_ai = no - } - NOT = { is_in_list = popular_faction_vassal_targets } - } - add_to_list = popular_faction_vassal_targets - } - } - } - - # Check if there is a player affected by the faction. AI rulers are blocked from accepting the faction demand if so. - if = { - limit = { - any_in_list = { - list = popular_faction_vassal_targets - is_ai = no - } - } - scope:faction = { - set_variable = { - name = faction_targets_player - value = yes - } - } - } - - # Fire the demand event. A follow up event will be sent to affected vassals. - scope:faction.faction_target = { - trigger_event = faction_demand.1001 - } - } - - ai_demand_chance = { - base = 100 - - modifier = { - add = -1000 - faction_target = { - involved_activity ?= { - has_activity_type = activity_coronation - activity_host = prev - } - } - } - } - - on_war_start = { - # Duchy initialization so we can concentrate the rebels in just a few important counties instead of spreading them over the entire realm. - every_faction_county_member = { - duchy = { - add_to_list = areas_of_rebellion - } - } - - # Check where in the duchy the rebellion troops should spawn, then spawn them. - every_in_list = { - list = areas_of_rebellion - save_temporary_scope_as = this_duchy - - # Determine where in the duchy those troops should spawn. - ordered_in_de_jure_hierarchy = { - # Troops can only spawn in counties that belong to our faction! - limit = { - tier = tier_county - any_title_joined_faction = { - this = root - } - } - - # Sort counties by how many levies they provide; rebels will spawn in the strongest county. - order_by = total_county_levies - - title_province = { - save_temporary_scope_as = local_center_of_rebellion - } - } - - # Spawn the faction troops in the designated location. - root.faction_leader = { - spawn_popular_revolt_troops = yes - } - - # Give the populist leader a commander for each stack of troops. - create_character = { - template = new_commander_character - location = scope:local_center_of_rebellion - faith = root.faction_leader.faith - rite = root.faction_leader.rite - culture = root.faction_leader.culture - save_scope_as = new_populist_commander - gender_female_chance = { - if = { - limit = { root.faction_leader.culture = { has_cultural_parameter = martial_custom_male_only_combatant } } - add = 0 - } - else_if = { - limit = { root.faction_leader.culture = { has_cultural_parameter = martial_custom_female_only_combatant } } - add = 100 - } - else = { - add = 50 - } - } - } - scope:new_populist_commander = { - set_character_rite = root.faction_leader.rite - set_employer = root.faction_leader - } - } - - # Give the populist leader a small purse so they don't immediately go bankrupt with army maintenance. - every_faction_county_member = { - root.faction_leader = { - add_gold = 25 - } - } - } - - leader_leaves = { - # Should only trigger when the leader is captured in battle. - if = { - limit = { - special_character = { - is_alive = no - } - } - if = { - limit = { exists = faction_war } - faction_war = { - end_war = defender - } - } - destroy_faction = yes - } - else_if = { # Not an if: the branch above destroys the faction, leaving this scope invalid - limit = { - NOT = { has_variable = peasant_destroying } - exists = faction_war - } - faction_war = { - end_war = defender - } - } - } - - character_allow_create = no - - special_character_title = "FACTIONS_WINDOW_LEADER" - - inherit_membership = yes - - multiple_targeting = yes -} - -escalated_peasant_faction = { - casus_belli = populist_war - - leaders_allowed_to_leave = no - player_can_join = yes - - sort_order = 3 - - name = FACTION_ESCALATED_PEASANT_DYNAMIC_NAME - - short_effect_desc = escalated_peasant_faction_short_effect_desc - - is_shown = { - always = no - } - - discontent_progress = { - base = 2 - modifier = { - faction_target = { ep3_restored_rome_hard_mode_trigger = yes } - add = 10 - desc = ep3_story_cycle_restoring_rome_faction_discontent - } - modifier = { - faction_target = { can_vassals_be_attacked = yes } - add = 2 - desc = border_war_increased_peasant_discontent - } - modifier = { - faction_target = { - top_participant_group:dynastic_cycle ?= { - has_participant_group_parameter = dynastic_cycle_more_peasant_factions - } - } - add = 2 - desc = instability_increased_peasant_discontent - } - } - - power_threshold = 0 # Peasant Factions place their demand regardless of their Power - - requires_county = yes - requires_character = yes - - # Faction existence is valid - is_valid = { - trigger_if = { - limit = { - exists = special_character - } - special_character = { - is_alive = yes - } - } - } - - ########### - # Counties/characters are allowed to exist in the faction at all (will be kicked out if they fail these checks while already in it). - is_character_valid = { - has_valid_faction_members_trigger = yes - is_imprisoned = no - - # Not forbidden from being in factions. - NOT = { - has_character_flag = joining_faction_block - } - } - - is_county_valid = { - # Only in Dynastic Cycle - any_county_situation = { - situation_type = dynastic_cycle - } - # Counties can only be in a faction against the top liege in their realm (who is inherently independent). - scope:faction.faction_target = holder.top_liege - - # Player capitals are blocked from joining populist factions (to avoid Game Overing a player due to a populist uprising against their liege, which as a vassal they can't really prevent or fight) - trigger_if = { - limit = { - holder = { - is_ai = no - } - } - this != holder.capital_county - } - title_province = { - NOR = { - has_holding_type = nomad_holding - has_holding_type = herder_holding - } - } - - } - - ########### - # Counties/characters are allowed to create/join the faction (but will remain in faction if they fail these after joining). - - can_character_join = { - custom_tooltip = { - text = can_join_escalated_peasant_faction_tt - OR = { - domicile ?= { - has_domicile_parameter = can_join_peasant_factions - } - has_trait = peasant_leader - } - } - } - - can_county_join = { - OR = { - has_county_modifier = peasant_war_lost_county_modifier - holder = scope:faction.faction_target - } - } - - can_character_create = { - OR = { - domicile ?= { - has_domicile_parameter = can_join_peasant_factions - } - has_trait = peasant_leader - } - } - - can_character_become_leader = { - OR = { - domicile ?= { - has_domicile_parameter = can_join_peasant_factions - } - has_trait = peasant_leader - } - } - - county_join_score = { - base = 0 - compare_modifier = { - desc = "FACTION_REASON_COUNTY_OPINION" - value = county_opinion - multiplier = -1.0 - } - # If a suitable Popular Faction exists, perfer to join it instead. - modifier = { - desc = "FACTION_REASON_PREFER_POPULIST_FACTION" - add = -100 - scope:faction.faction_target = { - top_liege = { - any_targeting_faction = { - faction_type = populist_faction - any_faction_county_member = { - this.title_province.faith = root.title_province.faith - } - } - } - } - } - - # Reduced weight for a character's own capital to join a revolt against them. - modifier = { - desc = "FACTION_REASON_CAPITAL_COUNTY" - add = -10 - this.title_province = scope:faction.faction_target.capital_province - } - - legalism_virtue_and_sin_modifier = { - TARGET = scope:faction.faction_target - SCORE_PER_TRAIT = 10 # Worth 10 opinion per virtue. - } - - # Ruling Caste - modifier = { - desc = "FACTION_REASON_RULING_CASTE" - add = -25 - culture != scope:faction.faction_target.culture - scope:faction.faction_target.culture = { has_cultural_parameter = peasant_and_populist_factions_less_common } - } - - # Defiant Ambushers - modifier = { - add = 25 - county_opinion < 0 - culture != scope:faction.faction_target.culture - culture = { has_cultural_parameter = county_peasant_and_populist_factions_more_common } - } - - # Difficulty Settings - modifier = { # Easy - desc = "FACTION_REASON_DIFFICULTY_EASY" - add = -50 - has_game_rule = easy_difficulty - scope:faction.faction_target = { - is_ai = no - } - } - modifier = { # Very Easy - desc = "FACTION_REASON_DIFFICULTY_VERY_EASY" - add = -150 - has_game_rule = very_easy_difficulty - scope:faction.faction_target = { - is_ai = no - } - } - modifier = { # Hard - desc = "FACTION_REASON_DIFFICULTY_HARD" - add = -50 - has_game_rule = hard_difficulty - scope:faction.faction_target = { - is_ai = yes - } - } - modifier = { # Very Hard - desc = "FACTION_REASON_DIFFICULTY_VERY_HARD" - add = -150 - has_game_rule = very_hard_difficulty - scope:faction.faction_target = { - is_ai = yes - } - } - - modifier = { # Conquerors - desc = "NO_FRIVOLOUS_ACTIVITIES_REASON" - add = -85 - scope:faction.faction_target = { - ai_should_get_conqueror_bonuses = yes - } - } - - modifier = { # Conquerors - desc = "NO_FRIVOLOUS_ACTIVITIES_REASON" - add = -150 - scope:faction.faction_target = { - ai_should_get_extreme_conqueror_bonuses = yes - } - } - - # Realm Stability Settings - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_LESSER" - add = 25 - has_game_rule = lesser_realm_stability - } - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_HIGHER" - add = -50 - has_game_rule = higher_realm_stability - } - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_EXTREME" - add = -100 - has_game_rule = extreme_realm_stability - } - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_LESSER" - add = 25 - has_game_rule = lesser_realm_stability_ai_only - scope:faction.faction_target = { - is_ai = yes - } - } - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_HIGHER" - add = -50 - has_game_rule = higher_realm_stability_ai_only - scope:faction.faction_target = { - is_ai = yes - } - } - modifier = { - desc = "FACTION_REASON_GAME_RULE_REALM_STABILITY_EXTREME" - add = -100 - has_game_rule = extreme_realm_stability_ai_only - scope:faction.faction_target = { - is_ai = yes - } - } - - # Conquerors - modifier = { - add = -100 - scope:faction.faction_target = { ai_should_get_conqueror_bonuses = yes } - } - modifier = { - add = -200 - scope:faction.faction_target = { ai_should_get_extreme_conqueror_bonuses = yes } - } - - # stay if at war with the target - modifier = { - desc = "FACTION_REASON_AT_WAR_WITH_TARGET" - add = 1000 - scope:faction = { - faction_is_at_war = yes - } - } - # TGP Dynastic Cycle in Instability phase - modifier = { - desc = "FACTION_REASON_DYNASTIC_CYCLE_INSTABILITY" - add = 25 - county_opinion < 0 - scope:faction.faction_target = { - top_participant_group:dynastic_cycle ?= { - has_participant_group_parameter = dynastic_cycle_more_peasant_factions - } - } - } - # Pure Land - modifier = { - desc = "FACTION_REASON_POPULIST_PEASANT_MORE_LIKELY" - add = 25 - county_opinion < 0 - faith != scope:faction.faction_target.faith - rite = { - rite_has_parameter = peasant_and_populist_factions_more_common - } - } - modifier = { - desc = "FACTION_REASON_ESCALATED_TO_LIEGE" - add = 100 - has_county_modifier = peasant_war_lost_county_modifier - } - } - - county_power = county_levies_to_raise - - ai_create_score = { - base = -10000 #handled by scripted effect peasant_faction_demands_enforced in 00_faction_effects.txt - } - - ai_join_score = { - base = 0 - modifier = { - desc = "FACTION_REASON_ESCALATED_TO_LIEGE" - add = 100 - has_variable = peasant_war_escalates - } - } - - can_county_create = { - holder.top_liege = scope:target - scope:target = { - NAND = { - is_ai = yes - OR = { - has_trait = greatest_of_khans - has_character_modifier = the_great_khan_modifier - } - } - } - - #### - # BLOCKERS - #### - # General Faction immunity - custom_description = { - text = character_is_immune_to_factions - subject = scope:target - NOT = { scope:target = { immune_to_factions_trigger = yes } } - } - - title_province = { - NOR = { - has_holding_type = nomad_holding - has_holding_type = herder_holding - } - } - } - - on_creation = { - } - - on_destroy = { - set_variable = { - name = peasant_destroying - value = yes - } - if = { - limit = { exists = special_character } - special_character = { - if = { - limit = { - has_variable = { - name = peasant_faction_claimant_without_title - name = peasant_faction_random_peasant - } - has_variable = peasant_title - } - if = { - limit = { - has_variable = peasant_title - } - destroy_title = this.var:peasant_title - } - if = { - limit = { # To make sure we aren't in debt - is_alive = yes - gold > 0 - } - remove_long_term_gold = gold # Zero out our wallet since the revolt is over and we're going back to being unlanded. - } - } - if = { - limit = { - is_alive = yes # To prevent dead people from being checked for variables - } - if = { - limit = { - has_variable = rebel_leader_peasants - } - remove_variable = rebel_leader_peasants - } - remove_variable = peasant_title - remove_character_flag = peasant_faction_random_peasant - remove_character_flag = peasant_faction_claimant_without_title - if = { - limit = { - has_character_flag = peasant_faction_random_peasant - NOT = { has_character_flag = peasant_revolt_do_not_kill } - } - death = { - death_reason = death_vanished - } - } - } - } - } - } - - demand = { - setup_populist_leader_effect = yes - # Faction leader is unhappy if they reach the point of needing to issue an ultimatim. - if = { - limit = { exists = faction_leader } - faction_leader = { - add_opinion = { - modifier = angry_opinion - target = root.faction_target - opinion = -20 - } - } - } - - # Refresh the faction's target title (best target may have changed between creation and pressing demands). - get_popular_revolt_target_effect = { FACTION = this } - - # Save scopes that will be used in the demand event. - save_scope_as = faction - if = { - limit = { - special_character.joined_faction ?= root - } - special_character = { - save_scope_as = peasant_leader - } - } - else = { - faction_leader = { - save_scope_as = peasant_leader - } - } - special_title = { - save_scope_as = target_title - } - - # Check for relevant vassals that owns any land targeted by the faction. - save_temporary_scope_as = county_faction - every_faction_county_member = { - limit = { - holder = { - this != scope:faction.faction_target - NOT = { - joined_faction ?= { - this = scope:county_faction - } - } - OR = { - is_vassal_of = scope:faction.faction_target - is_ai = no - } - NOT = { is_in_list = popular_faction_vassal_targets } - } - } - holder = { - add_to_list = popular_faction_vassal_targets - } - } - every_faction_county_member = { - holder = { - every_liege_or_above = { - limit = { - this != scope:faction.faction_target - NOT = { - joined_faction ?= { - this = scope:county_faction - } - } - OR = { - is_vassal_of = scope:faction.faction_target - is_ai = no - } - NOT = { is_in_list = popular_faction_vassal_targets } - } - add_to_list = popular_faction_vassal_targets - } - } - } - - # Check if there is a player affected by the faction. AI rulers are blocked from accepting the faction demand if so. - if = { - limit = { - any_in_list = { - list = popular_faction_vassal_targets - is_ai = no - } - } - scope:faction = { - set_variable = { - name = faction_targets_player - value = yes - } - } - } - - # Fire the demand event. A follow up event will be sent to affected vassals. - scope:faction.faction_target = { - trigger_event = faction_demand.1001 - } - } - - ai_demand_chance = { - base = 100 - - modifier = { - add = -1000 - faction_target = { - involved_activity ?= { - has_activity_type = activity_coronation - activity_host = prev - } - } - } - } - - on_war_start = { - # Duchy initialization so we can concentrate the rebels in just a few important counties instead of spreading them over the entire realm. - every_faction_county_member = { - duchy = { - add_to_list = areas_of_rebellion - } - } - - # Check where in the duchy the rebellion troops should spawn, then spawn them. - every_in_list = { - list = areas_of_rebellion - save_temporary_scope_as = this_duchy - - # Determine where in the duchy those troops should spawn. - ordered_in_de_jure_hierarchy = { - # Troops can only spawn in counties that belong to our faction! - limit = { - tier = tier_county - any_title_joined_faction = { - this = root - } - } - - # Sort counties by how many levies they provide; rebels will spawn in the strongest county. - order_by = total_county_levies - - title_province = { - save_temporary_scope_as = local_center_of_rebellion - } - } - - # Spawn the faction troops in the designated location. - root.faction_leader = { - spawn_popular_revolt_troops = yes - } - - # Give the populist leader a commander for each stack of troops. - create_character = { - template = new_commander_character - location = scope:local_center_of_rebellion - faith = root.faction_leader.faith - rite = root.faction_leader.rite - culture = root.faction_leader.culture - save_scope_as = new_populist_commander - gender_female_chance = { - if = { - limit = { root.faction_leader.culture = { has_cultural_parameter = martial_custom_male_only_combatant } } - add = 0 - } - else_if = { - limit = { root.faction_leader.culture = { has_cultural_parameter = martial_custom_female_only_combatant } } - add = 100 - } - else = { - add = 50 - } - } - } - scope:new_populist_commander = { - set_character_rite = root.faction_leader.rite - set_employer = root.faction_leader - } - } - - # Give the populist leader a small purse so they don't immediately go bankrupt with army maintenance. - every_faction_county_member = { - root.faction_leader = { - add_gold = 25 - } - } - faction_leader = { - spawn_army = { - name = peasant_leader_army_name - men_at_arms = { - type = pikemen_militia - stacks = { - value = root.faction_leader.location.county.county_levies_to_raise - divide = 100 - multiply = { - value = "root.faction_leader.has_trait_xp(peasant_leader)" - multiply = 0.05 - } - round = yes - min = 1 - } - } - men_at_arms = { - type = torch_bearers - stacks = { - value = "root.faction_leader.has_trait_xp(peasant_leader)" - multiply = 0.1 - round = yes - min = 1 - } - } - war = root.faction_war - location = root.faction_leader.location - origin = root.faction_leader.location - inheritable = no - war_keep_on_attacker_victory = yes - } - } - every_faction_member = { - limit = { - NOT = { has_trait = peasant_leader } - } - add_trait = peasant_leader - add_trait_xp = { - trait = peasant_leader - value = peasant_leader_xp_value - } - set_variable = { - name = rebel_leader_peasants - value = root - } - } - } - - leader_leaves = { - # Should only trigger when the leader is captured in battle. - if = { - limit = { - special_character = { - is_alive = no - } - } - if = { - limit = { exists = faction_war } - faction_war = { - end_war = defender - } - } - destroy_faction = yes - } - else_if = { # Not an if: the branch above destroys the faction, leaving this scope invalid - limit = { - NOT = { has_variable = peasant_destroying } - exists = faction_war - } - faction_war = { - end_war = defender - } - } - } - - character_allow_create = yes - - special_character_title = "FACTIONS_WINDOW_LEADER" - - inherit_membership = no - - multiple_targeting = no - - county_can_switch_to_other_faction = no -} diff --git a/common/script_values/00_culture_values.txt b/common/script_values/00_culture_values.txt index aee22d6b2..26235565c 100644 --- a/common/script_values/00_culture_values.txt +++ b/common/script_values/00_culture_values.txt @@ -145,14 +145,6 @@ declare_war_culture_acceptance_impact = { } } -declare_war_culture_acceptance_impact = { - value = 0 - scope:defender.primary_title = { - subtract = tier - add = 1 - } -} - hybridization_threshold_flat_number_value = 40 hybridization_threshold_value = { @@ -266,7 +258,7 @@ culture_divergence_cooldown = { limit = { has_game_rule = no_hybrid_and_divergence_cooldowns } - multiply = 0 + add = -10000 # You can have a "negative age" culture by picking a culture that hasn't been formed yet in the ruler designer. Such a culture would get blocked by a cooldown of 0 years, so the no cooldown rule needs a negative value. } } diff --git a/common/script_values/00_distance_values.txt b/common/script_values/00_distance_values.txt deleted file mode 100644 index 59850517d..000000000 --- a/common/script_values/00_distance_values.txt +++ /dev/null @@ -1,15 +0,0 @@ - -#Values used for checking distance with the 'squared_distance' trigger. - -squared_distance_small = 22500 #150 map-pixels. Roughly one Wales away (top to bottom). -squared_distance_medium = 62500 #250 map-pixels. Roughly one Ireland away (top to bottom). -squared_distance_major = { - value = squared_distance_large - divide = 2 -} -squared_distance_large = 422500 #650 map-pixels. Roughly one France away (top to bottom). -squared_distance_huge = 722500 #850 map-pixels. Roughly one Holy Roman Empire away (left to right). -squared_distance_almost_massive = 1440000 #1200 map-pixels. Roughly 1.5 Holy Roman Empire away (left to right). -squared_distance_massive = 2402500 #1550 map-pixels. -squared_distance_mega = 5202500 -squared_distance_monstrous = 9000000 #3000 map-pixels diff --git a/common/script_values/00_dlc_fp3_script_values.txt b/common/script_values/00_dlc_fp3_script_values.txt deleted file mode 100644 index 92c15348c..000000000 --- a/common/script_values/00_dlc_fp3_script_values.txt +++ /dev/null @@ -1,1458 +0,0 @@ -############# -# FP3 Scripted Values -############# - -################################################## -# Unity - -critical_house_unity = 20 -terrible_house_unity = 40 -low_house_unity = 60 -mediocre_house_unity = 80 -average_house_unity = 100 -decent_house_unity = 120 -good_house_unity = 140 -high_house_unity = 160 -very_high_house_unity = 180 - -opinion_thresholds_for_antagonistic_independence = -50 - -number_of_futuwaa_members = { - value = 0 - every_courtier = { - limit = { fp3_is_valid_futuwaa_member = { SPONSOR = root } } - add = 1 - } - house ?= { - every_house_member = { - limit = { - fp3_is_valid_futuwaa_member = { SPONSOR = root } - NOT = { is_courtier_of = root } - } - add = 1 - } - } -} - -number_of_madrasa_pupils = { - value = 0 - every_courtier = { - limit = { fp3_is_valid_madrasa_pupil = { SPONSOR = root } } - add = 1 - } - house ?= { - every_house_member = { - limit = { - fp3_is_valid_madrasa_pupil = { SPONSOR = root } - NOT = { is_courtier_of = root } - } - add = 1 - } - } -} - -################################################## -# Struggle - -fp3_house_modifier_concession_ending_duration = 100 -fp3_house_modifier_sunder_caliphate_duration = 100 - -fp3_concession_death_countdown = { - value = current_year - subtract = 866 - multiply = 1 -} - -fp3_persia_ownage_percentage_for_foundation = 0.20 - -fp3_persia_supporter_rulers_decimal_value = { - value = 50 - divide = 100 - max = 1 -} - -fp3_persia_supporter_rulers_max_value = { - value = 0 - struggle:persian_struggle ?= { - every_involved_ruler = { - limit = { - is_landed = yes - highest_held_title_tier >= tier_county - OR = { - NOT = { has_title = title:d_sunni } - OR = { - top_liege = this - is_vassal_of = title:d_sunni.holder - } - } - } - add = 1 - } - } -} - -fp3_persia_supporter_rulers_half_value = { - value = fp3_persia_supporter_rulers_max_value - divide = 2 - ceiling = yes -} - -fp3_persia_supporter_rulers_count_value = { - value = 0 - struggle:persian_struggle ?= { - every_involved_ruler = { - limit = { - is_landed = yes - highest_held_title_tier >= tier_county - OR = { - NOT = { has_title = title:d_sunni } - OR = { - top_liege = this - is_vassal_of = title:d_sunni.holder - } - } - # Trigger - has_trait = fp3_struggle_supporter - } - add = 1 - } - } - floor = yes -} - -fp3_persia_iranian_rulers_count_value = { - value = 0 - struggle:persian_struggle ?= { - every_involved_ruler = { - limit = { - is_landed = yes - highest_held_title_tier >= tier_county - culture = { has_cultural_pillar = heritage_iranian } - } - add = 1 - } - every_interloper_ruler = { - limit = { - is_landed = yes - highest_held_title_tier >= tier_county - culture = { has_cultural_pillar = heritage_iranian } - } - add = 1 - } - } - floor = yes -} - -fp3_persia_all_rulers_count_value = { - value = 0 - struggle:persian_struggle ?= { - every_involved_ruler = { - limit = { - is_landed = yes - highest_held_title_tier >= tier_county - } - add = 1 - } - every_interloper_ruler = { - limit = { - is_landed = yes - highest_held_title_tier >= tier_county - } - add = 1 - } - } - floor = yes -} - -fp3_persia_all_rulers_requirement_value = { - value = fp3_persia_all_rulers_count_value - multiply = 0.6 -} - -fp3_persia_all_rulers_percentage_value = { - value = fp3_persia_iranian_rulers_count_value - divide = { - value = fp3_persia_all_rulers_count_value - min = 1 - } -} - -fp3_persia_independent_detractor_rulers_count_value = { - value = 0 - struggle:persian_struggle ?= { - every_involved_ruler = { - limit = { - top_liege = this - is_landed = yes - highest_held_title_tier >= tier_duchy - has_trait = fp3_struggle_detractor - } - add = 1 - } - every_interloper_ruler = { - limit = { - top_liege = this - is_landed = yes - highest_held_title_tier >= tier_duchy - has_trait = fp3_struggle_detractor - } - add = 1 - } - } - floor = yes -} - -fp3_persia_independent_non_sunni_rulers_count_value = { - value = 0 - struggle:persian_struggle ?= { - every_involved_ruler = { - limit = { - top_liege = this - is_landed = yes - highest_held_title_tier >= tier_duchy - rite = { - NOT = { - rite_has_doctrine = muhammad_succession_sunni_doctrine - } - } - } - add = 1 - } - every_interloper_ruler = { - limit = { - top_liege = this - is_landed = yes - highest_held_title_tier >= tier_duchy - rite = { - NOT = { - rite_has_doctrine = muhammad_succession_sunni_doctrine - } - } - } - add = 1 - } - } - floor = yes -} - -fp3_iranian_sub_realm_counties_value = { - value = 0 - every_sub_realm_county = { - limit = { - culture = { has_cultural_pillar = heritage_iranian } - } - add = 1 - } - floor = yes -} - -fp3_persia_flame_of_iran_independent_value = { - value = 0 - struggle:persian_struggle ?= { - every_involved_ruler = { - limit = { - top_liege != this - culture = { has_cultural_pillar = heritage_iranian } - exists = liege - NOT = { - liege.culture = { has_cultural_pillar = heritage_iranian } - } - } - add = 1 - } - } -} - -# Paramameter for percentage of Persia you must control -fp3_persia_owned_for_rekindle_persia_percent_value = 30 - -# Uses above to plug in to script as a decimal -fp3_persia_owned_for_rekindle_persia_decimal_value = { - value = fp3_persia_owned_for_rekindle_persia_percent_value - divide = 100 - max = 1 -} - -fp3_iranian_current_owned_persia_value = { - value = 0 - every_county_in_region = { - region = world_persian_empire - limit = { - holder.top_liege = root - } - add = 1 - } - divide = { - value = 0 - every_county_in_region = { - region = world_persian_empire - add = 1 - } - } - multiply = 100 -} - -# Paramameter for percentage of Persia that must be iranian -fp3_iranian_culture_for_rekindle_persia_percent_value = 75 - -fp3_iranian_culture_for_rekindle_persia_decimal_value = { - value = fp3_iranian_culture_for_rekindle_persia_percent_value - divide = 100 - max = 1 -} - -fp3_iranian_culture_current_persian_culture_value = { - value = 0 - every_county_in_region = { - region = world_persian_empire - limit = { - culture = { has_cultural_pillar = heritage_iranian } - } - add = 1 - } - divide = { - value = 0 - every_county_in_region = { - region = world_persian_empire - add = 1 - } - } - multiply = 100 -} - -fp3_shia_caliphate_ending_conversion_chance_percent_value = 75 - -fp3_shia_caliphate_ending_conversion_chance_decimal_value = { - value = fp3_iranian_culture_for_rekindle_persia_percent_value - divide = 100 - max = 1 -} - -fp3_strengthen_caliphate_ending_conversion_chance_percent_value = 50 - -fp3_strengthen_caliphate_ending_conversion_chance_decimal_value = { - value = fp3_iranian_culture_for_rekindle_persia_percent_value - divide = 100 - max = 1 -} - -fp3_struggle_ending_conversion_modifier_value = 1.5 - -fp3_iranian_faith_for_rekindle_persia_conversion_chance_percent_value = 50 - -fp3_iranian_faith_for_rekindle_persia_conversion_chance_decimal_value = { - value = fp3_iranian_culture_for_rekindle_persia_percent_value - divide = 100 - max = 1 -} - -fp3_current_nb_ally_shia_caliphate = { - value = 0 - every_ally = { - limit = { highest_held_title_tier >= tier_kingdom } - add = 1 - } -} - -################################################## -# Tax Collector -tax_collector_aptitude_miniscule_increase = { value = 5 } - -tax_collector_aptitude_minor_increase = { value = 10 } - -tax_collector_aptitude_medium_increase = { value = 15 } - -tax_collector_aptitude_major_increase = { value = 20 } - -tax_collector_aptitude_massive_increase = { value = 25 } - -base_tax_collector_aptitude_score = { - value = 1 - add = { - value = diplomacy - max = 50 - desc = court_position_skill_diplomacy - } - add = { - value = martial - max = 50 - desc = court_position_skill_martial - } - add = { - value = stewardship - max = 50 - desc = court_position_skill_stewardship - } - add = { - value = intrigue - max = 50 - desc = court_position_skill_intrigue - } - add = { - value = learning - multiply = 2 - max = 50 - desc = court_position_skill_learning - } - - if = { - limit = { - has_trait = just - } - add = { - value = 10 - desc = court_position_just_trait - } - } - if = { - limit = { - has_trait = diplomat - } - add = { - value = 10 - desc = court_position_diplomat_trait - } - } - if = { - limit = { - has_trait = administrator - } - add = { - value = 10 - desc = court_position_administrator_trait - } - } - if = { - limit = { - has_trait = avaricious - } - add = { - value = 10 - desc = court_position_avaricious_trait - } - } - if = { - limit = { - has_character_modifier = fp3_capable_magistrates_modifier - } - add = { - value = tax_collector_aptitude_major_increase - desc = capable_magistrates_modifier - } - } - if = { - limit = { - has_character_flag = fp3_inspired_tax_collector - } - add = { - value = 20 - desc = fp3_inspired_tax_collector - } - } - # Opinion of liege - add = { - desc = opinion_of_liege - value = { - if = { - limit = { - save_temporary_opinion_value_as = { name = target_opinion target = liege } - } - } - if = { - limit = { - scope:target_opinion >= very_high_positive_opinion - } - add = 20 - } - else_if = { - limit = { - scope:target_opinion >= high_positive_opinion - } - add = 15 - } - else_if = { - limit = { - scope:target_opinion >= medium_positive_opinion - } - add = 10 - } - else_if = { - limit = { - scope:target_opinion >= low_positive_opinion - } - add = 5 - } - else = { - add = 0 - } - } - } - - # Cultural Tradition - if = { - limit = { - culture ?= { has_cultural_parameter = characters_are_better_tax_collector } - } - add = { - value = tax_collector_aptitude_medium_increase - desc = traditions_cheaper_value - } - } - - if = { - limit = { - is_landed = yes - } - add = { - value = -10 - desc = court_position_landed_penalty - } - } - - # Flag Check (for debug/event usage) - Use debug.9610 - if = { - limit = { has_character_flag = is_guaranteed_excellent_tax_collector } - add = 130 - } - - add = court_position_aptitude_family_business_value - add = court_position_aptitude_eunuch_tradition_value -} - -tax_collector_aptitude_score = { - value = base_tax_collector_aptitude_score - - # Viziers - if = { - limit = { - liege ?= { - exists = diarch - has_diarchy_active_parameter = diarch_aptitude_helps_tax_collectors_toggle - } - } - # Are we the vizier? If yes, we get a flat boost tied to our Scales of Power swing. - if = { - limit = { this = liege.diarch } - add = { - value = diarch_aptitude_helps_tax_collectors_buffed_by_swing_value - desc = diarchy_tax_collector_boost.scales_of_power - } - } - # Else we're someone different, so we get a fraction of the vizier's aptitude added to our own. - else = { - ## Plenty of vizier's aptitude. - if = { - limit = { - liege = { has_diarchy_active_parameter = diarch_aptitude_helps_tax_collectors_t4 } - } - add = { - value = { - value = liege.diarch.base_tax_collector_aptitude_score - # But remove the buff the vizier got from the SoP swing or things'll get ridiculous. - subtract = diarch_aptitude_helps_tax_collectors_buffed_by_swing_value - # Now, reduce according to the correct percentage. - multiply = diarch_aptitude_helps_tax_collectors_t4_value - # Just in case, let's min things. - min = 1 - } - desc = diarchy_tax_collector_boost.diarch_aptitude.t4 - } - } - ## Most of vizier's aptitude. - else_if = { - limit = { - liege = { has_diarchy_active_parameter = diarch_aptitude_helps_tax_collectors_t3 } - } - add = { - value = { - value = liege.diarch.base_tax_collector_aptitude_score - # But remove the buff the vizier got from the SoP swing or things'll get ridiculous. - subtract = diarch_aptitude_helps_tax_collectors_buffed_by_swing_value - # Now, reduce according to the correct percentage. - multiply = diarch_aptitude_helps_tax_collectors_t3_value - # Just in case, let's min things. - min = 1 - } - desc = diarchy_tax_collector_boost.diarch_aptitude.t3 - } - } - ## Some of vizier's aptitude. - else_if = { - limit = { - liege = { has_diarchy_active_parameter = diarch_aptitude_helps_tax_collectors_t2 } - } - add = { - value = { - value = liege.diarch.base_tax_collector_aptitude_score - # But remove the buff the vizier got from the SoP swing or things'll get ridiculous. - subtract = diarch_aptitude_helps_tax_collectors_buffed_by_swing_value - # Now, reduce according to the correct percentage. - multiply = diarch_aptitude_helps_tax_collectors_t2_value - # Just in case, let's min things. - min = 1 - } - desc = diarchy_tax_collector_boost.diarch_aptitude.t2 - } - } - ## A little of vizier's aptitude. - else_if = { - limit = { - liege = { has_diarchy_active_parameter = diarch_aptitude_helps_tax_collectors_t1 } - } - add = { - value = { - value = liege.diarch.base_tax_collector_aptitude_score - # But remove the buff the vizier got from the SoP swing or things'll get ridiculous. - subtract = diarch_aptitude_helps_tax_collectors_buffed_by_swing_value - # Now, reduce according to the correct percentage. - multiply = diarch_aptitude_helps_tax_collectors_t1_value - # Just in case, let's min things. - min = 1 - } - desc = diarchy_tax_collector_boost.diarch_aptitude.t1 - } - } - } - } -} - -diarch_aptitude_helps_tax_collectors_buffed_by_swing_multiplier_value = 0.5 -diarch_aptitude_helps_tax_collectors_buffed_by_swing_value = { - value = liege.diarchy_swing - multiply = diarch_aptitude_helps_tax_collectors_buffed_by_swing_multiplier_value -} -diarch_aptitude_helps_tax_collectors_t1_value = 0.1 -diarch_aptitude_helps_tax_collectors_t2_value = 0.2 -diarch_aptitude_helps_tax_collectors_t3_value = 0.4 -diarch_aptitude_helps_tax_collectors_t4_value = 0.6 - - -preferred_tax_collector_modifier = { - value = 0 - if = { # Let's prioritize any close family members (cause that's more interesting) - add = 25 - limit = { - is_close_family_of = root - } - } -} -################################################## - -################################################## -# Decisions -embellish_capital_gold_cost = { value = major_gold_value } - -claim_the_imamate_decision_same_faith_county_count = 5 - -claim_the_imamate_decision_same_faith_greater_county_count = 15 - -claim_the_imamate_decision_own_max_sins = 1 - -promote_persian_scripture_piety_cost = { value = major_piety_value } - -promote_persian_scripture_conversion_modifier_value = 1.5 - -promote_persian_scripture_fundamentalist_stress_value = { value = major_stress_gain } - -consulted_house_councillors_percentage = 10 - -favour_skilled_outsiders_decision_prestige_cost_value = { - # Scales to tier. - ## Counts pay basically nothing. - if = { - limit = { highest_held_title_tier = tier_county } - add = minor_prestige_value - } - ## Dukes pay a bit. - else_if = { - limit = { highest_held_title_tier = tier_duchy } - add = medium_prestige_value - } - ## Kings pay a moderate amount. - else_if = { - limit = { highest_held_title_tier = tier_kingdom } - add = 225 - } - ## Emperors pay a substantial amount. - else_if = { - limit = { highest_held_title_tier = tier_empire } - add = 300 - } - else_if = { - limit = { highest_held_title_tier = tier_hegemony } - add = 450 - } -} - - -favour_skilled_outsiders_decision_skill_threshold_value = high_skill_rating - -favour_skilled_outsiders_decision_tally_offended_courtlies_value = { - value = 0 - every_vassal = { - limit = { favour_skilled_outsiders_decision_grab_courtlies_trigger = yes } - } - add = 1 -} - -favour_skilled_outsiders_decision_tally_offended_landless_councillors_value = { - value = 0 - every_councillor = { - limit = { favour_skilled_outsiders_decision_grab_landless_councillors_trigger = yes } - } - add = 1 -} - -favour_skilled_outsiders_decision_tally_offended_non_courtlies_value = { - value = 0 - every_vassal = { - limit = { favour_skilled_outsiders_decision_non_courtlies_trigger = yes } - } - add = 1 -} - -fp3_skilled_outsider_template_diplomacy_min_value = { - # Is this a primary skill for this outsider? - if = { - limit = { scope:outsider_diplomacy_martial = yes } - # Guarantee a nice minimum rather than using the usual variance rules. - add = high_skill_rating - } - # Is this a secondary skill for this outsider? - else_if = { - limit = { scope:outsider_stewardship_diplomacy = yes } - # And again, guarantee a nice minimum without variance. - add = decent_skill_rating - } - # Otherwise, this is an irrelevant skill for this outsider. - else = { add = min_template_low_skill } -} - -fp3_skilled_outsider_template_diplomacy_max_value = { - # Is this a primary skill for this outsider? - if = { - limit = { scope:outsider_diplomacy_martial = yes } - add = max_template_high_skill - } - # Is this a secondary skill for this outsider? - else_if = { - limit = { scope:outsider_stewardship_diplomacy = yes } - add = max_template_decent_skill - } - # Otherwise, this is an irrelevant skill for this outsider. - else = { add = max_template_low_skill } -} - -fp3_skilled_outsider_template_martial_min_value = { - # Is this a primary skill for this outsider? - if = { - limit = { scope:outsider_martial_prowess = yes } - # Guarantee a nice minimum rather than using the usual variance rules. - add = high_skill_rating - } - # Is this a secondary skill for this outsider? - else_if = { - limit = { scope:outsider_diplomacy_martial = yes } - # And again, guarantee a nice minimum without variance. - add = decent_skill_rating - } - # Otherwise, this is an irrelevant skill for this outsider. - else = { add = min_template_low_skill } -} - -fp3_skilled_outsider_template_martial_max_value = { - # Is this a primary skill for this outsider? - if = { - limit = { scope:outsider_martial_prowess = yes } - add = max_template_high_skill - } - # Is this a secondary skill for this outsider? - else_if = { - limit = { scope:outsider_diplomacy_martial = yes } - add = max_template_decent_skill - } - # Otherwise, this is an irrelevant skill for this outsider. - else = { add = max_template_low_skill } -} - -fp3_skilled_outsider_template_stewardship_min_value = { - # Is this a primary skill for this outsider? - if = { - limit = { scope:outsider_stewardship_diplomacy = yes } - # Guarantee a nice minimum rather than using the usual variance rules. - add = high_skill_rating - } - # Is this a secondary skill for this outsider? - else_if = { - limit = { scope:outsider_intrigue_stewardship = yes } - # And again, guarantee a nice minimum without variance. - add = decent_skill_rating - } - # Otherwise, this is an irrelevant skill for this outsider. - else = { add = min_template_low_skill } -} - -fp3_skilled_outsider_template_stewardship_max_value = { - # Is this a primary skill for this outsider? - if = { - limit = { scope:outsider_stewardship_diplomacy = yes } - add = max_template_high_skill - } - # Is this a secondary skill for this outsider? - else_if = { - limit = { scope:outsider_intrigue_stewardship = yes } - add = max_template_decent_skill - } - # Otherwise, this is an irrelevant skill for this outsider. - else = { add = max_template_low_skill } -} - -fp3_skilled_outsider_template_intrigue_min_value = { - # Is this a primary skill for this outsider? - if = { - limit = { scope:outsider_intrigue_stewardship = yes } - # Guarantee a nice minimum rather than using the usual variance rules. - add = high_skill_rating - } - # Is this a secondary skill for this outsider? - else_if = { - limit = { scope:outsider_learning_intrigue = yes } - # And again, guarantee a nice minimum without variance. - add = decent_skill_rating - } - # Otherwise, this is an irrelevant skill for this outsider. - else = { add = min_template_low_skill } -} - -fp3_skilled_outsider_template_intrigue_max_value = { - # Is this a primary skill for this outsider? - if = { - limit = { scope:outsider_intrigue_stewardship = yes } - add = max_template_high_skill - } - # Is this a secondary skill for this outsider? - else_if = { - limit = { scope:outsider_learning_intrigue = yes } - add = max_template_decent_skill - } - # Otherwise, this is an irrelevant skill for this outsider. - else = { add = max_template_low_skill } -} - -fp3_skilled_outsider_template_learning_min_value = { - # Is this a primary skill for this outsider? - if = { - limit = { scope:outsider_learning_intrigue = yes } - # Guarantee a nice minimum rather than using the usual variance rules. - add = high_skill_rating - } - # Is this a secondary skill for this outsider? - else_if = { - limit = { scope:outsider_prowess_learning = yes } - # And again, guarantee a nice minimum without variance. - add = decent_skill_rating - } - # Otherwise, this is an irrelevant skill for this outsider. - else = { add = min_template_low_skill } -} - -fp3_skilled_outsider_template_learning_max_value = { - # Is this a primary skill for this outsider? - if = { - limit = { scope:outsider_learning_intrigue = yes } - add = max_template_high_skill - } - # Is this a secondary skill for this outsider? - else_if = { - limit = { scope:outsider_prowess_learning = yes } - add = max_template_decent_skill - } - # Otherwise, this is an irrelevant skill for this outsider. - else = { add = max_template_low_skill } -} - -fp3_skilled_outsider_template_prowess_min_value = { - # Is this a primary skill for this outsider? - if = { - limit = { scope:outsider_prowess_learning = yes } - # Guarantee a nice minimum rather than using the usual variance rules. - add = high_skill_rating - } - # Is this a secondary skill for this outsider? - else_if = { - limit = { scope:outsider_martial_prowess = yes } - # And again, guarantee a nice minimum without variance. - add = decent_skill_rating - } - # Otherwise, this is an irrelevant skill for this outsider. - else = { add = min_template_low_skill } -} - -fp3_skilled_outsider_template_prowess_max_value = { - # Is this a primary skill for this outsider? - if = { - limit = { scope:outsider_prowess_learning = yes } - add = max_template_high_skill - } - # Is this a secondary skill for this outsider? - else_if = { - limit = { scope:outsider_martial_prowess = yes } - add = max_template_decent_skill - } - # Otherwise, this is an irrelevant skill for this outsider. - else = { add = max_template_low_skill } -} - -fp3_skilled_outsider_minimum_main_skill_batch_b_char1_value = { - # Three points above... - value = 3 - if = { - limit = { scope:outsider_diplomacy_martial = yes } - add = diplomacy - } - if = { - limit = { scope:outsider_martial_prowess = yes } - add = martial - } - if = { - limit = { scope:outsider_prowess_learning = yes } - add = prowess - } - if = { - limit = { scope:outsider_learning_intrigue = yes } - add = learning - } - if = { - limit = { scope:outsider_intrigue_stewardship = yes } - add = intrigue - } - if = { - limit = { scope:outsider_stewardship_diplomacy = yes } - add = stewardship - } -} - -fp3_skilled_outsider_minimum_main_skill_batch_b_char2_value = { - # Two points below... - value = -2 - if = { - limit = { scope:outsider_diplomacy_martial = yes } - add = diplomacy - } - if = { - limit = { scope:outsider_martial_prowess = yes } - add = martial - } - if = { - limit = { scope:outsider_prowess_learning = yes } - add = prowess - } - if = { - limit = { scope:outsider_learning_intrigue = yes } - add = learning - } - if = { - limit = { scope:outsider_intrigue_stewardship = yes } - add = intrigue - } - if = { - limit = { scope:outsider_stewardship_diplomacy = yes } - add = stewardship - } -} - -################################################## -# Military -fp3_realm_based_mercenary_cost = { - # Sample formula - # X * (Y + (Z/10) # Real example: 1162 * (0.6 + (4 / 10)) = 1162, meaning that if you have 4 counties, you get no discount, but no increase either. - # X is the initial cost. It is not in the operation above because it is applied post-facto as a modifier. - # Y is our base value, since we want to make the initial cost cheaper with a multiplication, it is a decimal. I chose 0.6, but it can be tweaked. - # Z is realm size. We turn it into a decimal so that it can then be added to our base value (Y), increasing the cost to either a lesser discount or an upsell based on size. - value = 0.6 - add = { - value = sub_realm_size - divide = 10 - } -} - -fp3_request_invasion_troop_value_estimate = { - value = scope:recipient.max_military_strength - subtract = scope:secondary_recipient.max_military_strength - divide = 20 - round = yes -} - -fp3_request_invasion_troop_value_bonus_troops = { - value = scope:recipient.max_military_strength - subtract = scope:secondary_recipient.max_military_strength - divide = 500 - round = yes - min = 1 - max = 10 -} - -fp3_request_invasion_troop_value_bonus_levy_troops = { - value = fp3_request_invasion_troop_value_bonus_troops - multiply = 100 -} - -fp3_request_invasion_troop_value_bonus_levy_nomads = { - value = fp3_request_invasion_troop_value_bonus_troops -} - - - -# The cost in gold of sponsoring a new research project -fp3_research_base_cost = { - value = medium_gold_value -} - - -################################################## -# Seljuk invaion - -fp3_seljuk_chance_of_appearance = 10 -fp3_chance_female_leader = { - value = 0 - if = { - limit = { has_game_rule = inversed_gender_equality } - add = 100 - } - else_if = { - limit = { has_game_rule = full_gender_equality } - add = 50 - } - else = { - add = 0 - } -} - -fp3_seljuk_invasion_troop_gain_minor = 1 -fp3_seljuk_invasion_troop_gain_small = 2 -fp3_seljuk_invasion_troop_gain_medium = 3 -fp3_seljuk_invasion_troop_gain_major = 4 -fp3_seljuk_invasion_troop_gain_massive = 5 - -fp3_seljuk_stack_miniscule_value = 0.6 -fp3_seljuk_stack_minor_value = 0.8 -fp3_seljuk_stack_medium_value = 1 -fp3_seljuk_stack_major_value = 1.25 -fp3_seljuk_stack_massive_value = 1.5 -fp3_seljuk_stack_monumental_value = 2 - -seljuk_invasion_nomad_strength_score_levy = { - value = 0 - if = { - limit = { has_variable = seljuk_invasion_nomad_strength_score } - add = var:seljuk_invasion_nomad_strength_score - } - multiply = 100 -} - -seljuk_invasion_nomad_strength_score_siege_weapon = { - value = 0 - if = { - limit = { has_variable = seljuk_invasion_nomad_strength_score } - add = var:seljuk_invasion_nomad_strength_score - } - multiply = 0.5 -} - -# Zanj Rebellion - -zanj_rebellion_strength_score_levy = { - value = 0 - if = { - limit = { has_variable = zanj_rebellion_strength_score } - add = var:zanj_rebellion_strength_score - } - multiply = 200 -} - -zanj_rebellion_strength_score_skirmishers = { - value = 0 - if = { - limit = { has_variable = zanj_rebellion_strength_score } - add = var:zanj_rebellion_strength_score - } -} - -zanj_rebellion_strength_score_bowmen = { - value = 0 - if = { - limit = { has_variable = zanj_rebellion_strength_score } - add = var:zanj_rebellion_strength_score - } - multiply = 0.5 -} - -zanj_rebellion_strength_score_pikemen = { - value = 0 - if = { - limit = { has_variable = zanj_rebellion_strength_score } - add = var:zanj_rebellion_strength_score - } - multiply = 0.5 -} - -rescue_house_members_cb_house_unity_gain = { - scope:defender = { - every_prisoner = { - limit = { house ?= scope:attacker.house } - add = medium_unity_gain - } - } - - max = 20 -} - -fp3_struggle_switch_sides_value = { - value = 0 - if = { - limit = { - has_trait = fp3_struggle_supporter - NAND = { - rite = { rite_has_doctrine = muhammad_succession_sunni_doctrine } - has_trait = zealous - } - exists = title:d_sunni.holder - NOR = { - this = title:d_sunni.holder - has_relation_friend = title:d_sunni.holder - has_relation_lover = title:d_sunni.holder - opinion = { - target = title:d_sunni.holder - value >= 50 - } - } - } - if = { - limit = { - has_trait = ambitious - } - add = 10 - } - if = { - limit = { - has_trait = cynical - } - add = 20 - } - if = { - limit = { - has_trait = vengeful - } - add = 5 - } - if = { - limit = { - has_trait = arrogant - } - add = 10 - } - if = { - limit = { - has_trait = arbitrary - } - add = 5 - } - if = { - limit = { - has_trait = disloyal - } - add = 30 - } - if = { - limit = { - has_trait = fickle - } - add = 5 - } - if = { - limit = { - culture = { has_cultural_pillar = heritage_turkic } - } - add = 50 - } - if = { - limit = { - NOT = { - rite = { rite_has_doctrine = muhammad_succession_sunni_doctrine } - } - } - add = 200 - } - if = { - limit = { - ai_zeal < 0 - } - add = { - value = ai_zeal - multiply = -1 - divide = 4 - } - } - if = { - limit = { - exists = title:d_sunni.holder - has_relation_rival = title:d_sunni.holder - } - add = 200 - } - if = { - limit = { - exists = title:d_sunni.holder - opinion = { - target = title:d_sunni.holder - value <= -75 - } - } - add = 50 - } - else_if = { - limit = { - exists = title:d_sunni.holder - opinion = { - target = title:d_sunni.holder - value <= -50 - } - } - add = 40 - } - else_if = { - limit = { - exists = title:d_sunni.holder - opinion = { - target = title:d_sunni.holder - value <= -30 - } - } - add = 30 - } - else_if = { - limit = { - exists = title:d_sunni.holder - opinion = { - target = title:d_sunni.holder - value <= -10 - } - } - add = 20 - } - else_if = { - limit = { - exists = title:d_sunni.holder - opinion = { - target = title:d_sunni.holder - value <= 0 - } - } - add = 10 - } - else_if = { - limit = { - exists = title:d_sunni.holder - opinion = { - target = title:d_sunni.holder - value >= 40 - } - } - add = -30 - } - else_if = { - limit = { - exists = title:d_sunni.holder - opinion = { - target = title:d_sunni.holder - value >= 30 - } - } - add = -20 - } - else_if = { - limit = { - exists = title:d_sunni.holder - opinion = { - target = title:d_sunni.holder - value >= 20 - } - } - add = -10 - } - else_if = { - limit = { - exists = title:d_sunni.holder - opinion = { - target = title:d_sunni.holder - value >= 10 - } - } - add = -5 - } - } - else_if = { - limit = { - has_trait = fp3_struggle_detractor - exists = title:d_sunni.holder - NOR = { - has_relation_rival = title:d_sunni.holder - opinion = { - target = title:d_sunni.holder - value <= -50 - } - } - } - if = { - limit = { - has_trait = content - } - add = 20 - } - if = { - limit = { - has_trait = zealous - } - add = 30 - } - if = { - limit = { - has_trait = trusting - } - add = 10 - } - if = { - limit = { - has_trait = just - } - add = 10 - } - if = { - limit = { - has_trait = humble - } - add = 20 - } - if = { - limit = { - has_trait = loyal - } - add = 30 - } - if = { - limit = { - culture = { has_cultural_pillar = heritage_turkic } - } - add = -50 - } - if = { - limit = { - NOT = { - rite = { rite_has_doctrine = muhammad_succession_sunni_doctrine } - } - } - add = -200 - } - if = { - limit = { - ai_zeal > 0 - rite = { rite_has_doctrine = muhammad_succession_sunni_doctrine } - } - add = { - value = ai_zeal - multiply = -1 - divide = 4 - } - } - if = { - limit = { - exists = title:d_sunni.holder - OR = { - has_relation_friend = title:d_sunni.holder - has_relation_lover = title:d_sunni.holder - } - } - add = 200 - } - if = { - limit = { - exists = title:d_sunni.holder - opinion = { - target = title:d_sunni.holder - value >= 75 - } - } - add = 50 - } - else_if = { - limit = { - exists = title:d_sunni.holder - opinion = { - target = title:d_sunni.holder - value >= 50 - } - } - add = 40 - } - else_if = { - limit = { - exists = title:d_sunni.holder - opinion = { - target = title:d_sunni.holder - value >= 30 - } - } - add = 20 - } - else_if = { - limit = { - exists = title:d_sunni.holder - opinion = { - target = title:d_sunni.holder - value >= 10 - } - } - add = 5 - } - else_if = { - limit = { - exists = title:d_sunni.holder - opinion = { - target = title:d_sunni.holder - value <= -40 - } - } - add = -50 - } - else_if = { - limit = { - exists = title:d_sunni.holder - opinion = { - target = title:d_sunni.holder - value <= -30 - } - } - add = -40 - } - else_if = { - limit = { - exists = title:d_sunni.holder - opinion = { - target = title:d_sunni.holder - value <= -20 - } - } - add = -30 - } - else_if = { - limit = { - exists = title:d_sunni.holder - opinion = { - target = title:d_sunni.holder - value <= 0 - } - } - add = -20 - } - } -} diff --git a/common/script_values/00_legitimacy_values.txt b/common/script_values/00_legitimacy_values.txt deleted file mode 100644 index e7f19070b..000000000 --- a/common/script_values/00_legitimacy_values.txt +++ /dev/null @@ -1,1357 +0,0 @@ -###################### -# Legitimacy -###################### - -# Tier 1-4 -legitimacy_title_tier_value = { - # County = 1 - # Duchy = 2 - # Kingdom = 3 - # Empire = 4 - value = highest_held_title_tier - subtract = 1 - min = 1 -} - -# Era 1-4 -legitimacy_era_value = { - # Tribal = 1 - # Early = 2 - # High = 3 - # Late = 4 - value = 1 - culture ?= { - if = { - limit = { has_cultural_era_or_later = culture_era_late_medieval } - add = 3 - } - else_if = { - limit = { has_cultural_era_or_later = culture_era_high_medieval } - add = 2 - } - else_if = { - limit = { has_cultural_era_or_later = culture_era_early_medieval } - add = 1 - } - } - min = 1 -} - -# Combined Era + Tier 1-8 -legitimacy_title_era_value = { - value = 0 - add = legitimacy_era_value # 1-4 - add = legitimacy_title_tier_value # 1-4 - min = 2 # 1 per era, 1 per title -} - -# Tier Values -# These must be kept as simple as possible for performance's sake - -legitimacy_level_1 = 0 - -# Gap of at least 60 -legitimacy_level_2 = { # 60-240 - value = 30 - multiply = legitimacy_title_era_value -} - -# Gap of at least 80 -legitimacy_level_3 = { # 140-560 - value = 70 - multiply = legitimacy_title_era_value -} - -# Gap of at least 100 -legitimacy_level_4 = { # 240-960 - value = 120 - multiply = legitimacy_title_era_value -} - -# Gap of at least 160 -legitimacy_level_5 = { # 400-1600 - value = 200 - multiply = legitimacy_title_era_value -} - -# Gap of at least 200 -legitimacy_level_6 = { # 600-2400 - value = 300 - multiply = legitimacy_title_era_value -} - -# Gap of at least 300 ( 900 - 600 = 300 ) -legitimacy_level_7 = { # 900-3600 - value = 450 #( 900/2(min multiply) = 450 ) - multiply = legitimacy_title_era_value #(max * 8) -} - -# Gap of at least 400 -legitimacy_level_8 = { # 1300-5200 - value = 650 - multiply = legitimacy_title_era_value -} - -# Gap of at least 700 -legitimacy_level_9 = { # 2000-8000 - value = 1000 - multiply = legitimacy_title_era_value -} - -legitimacy_max = { # 690-2760 - value = legitimacy_level_6 - multiply = 1.15 - round_to = 100 -} - -mandate_legitimacy_max = { # 3450-13800 - value = legitimacy_level_8 - multiply = 1.15 - round_to = 100 -} - -mandala_legitimacy_level_1 = 0 - -# Gap of at least 200 -mandala_legitimacy_level_2 = { # 200-800 - value = 100 #200 - multiply = legitimacy_title_era_value -} - -# Gap of at least 220 -mandala_legitimacy_level_3 = { # 420-1680 - value = 210 #420 - multiply = legitimacy_title_era_value -} - -# Gap of at least 220 -mandala_legitimacy_level_4 = { # 640-2560 - value = 320 #640 - multiply = legitimacy_title_era_value -} - -# Gap of at least 270 -mandala_legitimacy_level_5 = { # 910-3640 - value = 455 #910 - multiply = legitimacy_title_era_value -} - -# Gap of at least 330 -mandala_legitimacy_level_6 = { # 1240-4960 - value = 620 #1240 - multiply = legitimacy_title_era_value -} - -# Gap of at least 390 ( 900 - 600 = 300 ) -mandala_legitimacy_level_7 = { # 1650-6600 - value = 825 #1650 - multiply = legitimacy_title_era_value #(max * 8) -} - -# Gap of at least 550 -mandala_legitimacy_level_8 = { # 2200-8800 - value = 1100 #2200 - multiply = legitimacy_title_era_value -} - -# Gap of at least 800 -mandala_legitimacy_level_9 = { # 3000-12000 - value = 1500 #3000 - multiply = legitimacy_title_era_value -} - -mandala_legitimacy_max = { # 3450-13800 - value = mandala_legitimacy_level_9 - multiply = 1.15 - round_to = 100 -} - -### GAIN/LOSS VALUES - -miniscule_legitimacy_gain = 20 -minor_legitimacy_gain = 50 -medium_legitimacy_gain = 100 -major_legitimacy_gain = 200 -massive_legitimacy_gain = 300 -monumental_legitimacy_gain = 500 - -miniscule_legitimacy_loss = { - value = 0 - subtract = miniscule_legitimacy_gain -} -minor_legitimacy_loss = { - value = 0 - subtract = minor_legitimacy_gain -} -medium_legitimacy_loss = { - value = 0 - subtract = medium_legitimacy_gain -} -major_legitimacy_loss = { - value = 0 - subtract = major_legitimacy_gain -} -massive_legitimacy_loss = { - value = 0 - subtract = massive_legitimacy_gain -} -monumental_legitimacy_loss = { - value = 0 - subtract = monumental_legitimacy_gain -} - -tier_scaled_legitimacy_value = { - switch = { - trigger = primary_title.tier - tier_county = { value = minor_legitimacy_gain } - tier_duchy = { value = medium_legitimacy_gain } - tier_kingdom = { value = major_legitimacy_gain } - tier_empire = { value = massive_legitimacy_gain } - tier_hegemony = { value = monumental_legitimacy_gain } - tier_barony = { value = miniscule_legitimacy_gain } # should not use this tho - } -} - -tier_scaled_legitimacy_value_low = { - switch = { - trigger = primary_title.tier - tier_county = { value = miniscule_legitimacy_gain } - tier_duchy = { value = minor_legitimacy_gain } - tier_kingdom = { value = medium_legitimacy_gain } - tier_empire = { value = major_legitimacy_gain } - tier_hegemony = { value = massive_legitimacy_gain } - } -} - -### BASE CALCULATION VALUES - -# COURT GRANDEUR -base_legitimacy_per_court_grandeur_level_value = 30 -# DYNASTY RENOWN -base_legitimacy_per_dynasty_prestige_level_value = 50 -# DYNASTY PERKS -base_legitimacy_per_legitimacy_track_perk_value = 50 -# DYNASTY OF PREDECESSOR -base_legitimacy_dynasty_of_previous_value = 100 -# RELATION TO PREDECESSOR -succession_legitimacy_ancestor_per_tier_value = 50 -base_legitimacy_predecessor_primary_heir_value = 30 -base_legitimacy_predecessor_child_value = 25 -base_legitimacy_predecessor_close_family_value = 20 -base_legitimacy_predecessor_spouse_value = 15 -base_legitimacy_predecessor_extended_family_value = 10 -# SEX -base_legitimacy_sidelined_sex_value = -15 -# BASTARDRY -base_legitimacy_bastardry_high_value = -50 -base_legitimacy_bastardry_medium_value = -25 -base_legitimacy_bastardry_low_value = -10 -# YEARS AS RULER -base_legitimacy_per_year_as_ruler_value = 20 -# SPECIAL TRAITS -base_legitimacy_per_special_traits_value = 50 - -# Base legitimacy calculation - used for game start and in code -# root - ruler that gets legitimacy -base_legitimacy_value = { # Split into separate values for easy debugging/visibility - value = 0 - - # TIER - add = base_legitimacy_tier_value - - # COURT GRANDEUR - add = base_legitimacy_court_grandeur_value - - # DYNASTY RENOWN - add = base_legitimacy_dynasty_prestige_level_value - - # LEGITIMACY BLOODLINE DYNASTY PERKS - add = base_legitimacy_track_perks_value - - # COUNTY OPINION - derived from average of held counties - add = base_legitimacy_county_opinion_value - - # PREVIOUS HOLDER DYNASTY - add = base_legitimacy_dynasty_of_predecessor_value - - # PREVIOUS HOLDER CHILD - add = base_legitimacy_relation_to_predecessor_value - - # SIDELINED SEX - add = base_legitimacy_sex_value - - # BASTARDRY - add = base_legitimacy_bastardry_value - - # YEARS AS RULER - bonus for startup rulers - add = base_legitimacy_years_as_ruler_value - - # SPECIAL TRAITS - add = base_legitimacy_special_traits_value - - # DIPLOMACY SKILLS - add = base_legitimacy_diplomacy_value - - # ADMINISTRATIVE - if = { - limit = { - exists = this - government_has_mechanic = administrative - } - multiply = 0.75 # To reduce the overall base values - add = base_legitimacy_admin_value # And add anything admin specific - } - - min = 100 # No one starts with Level 0 - round = yes -} - -# SUCESSION LEGITIMACY CALCULATION - USED AS THE INITIAL LEGITIMACY OF NON GAME START CHARACTERS and in code -# root - ruler that gets legitimacy -succession_legitimacy_value = { # Split into separate values for easy debugging/visibility - value = 0 - - # TIER - add = base_legitimacy_tier_value - - # COURT GRANDEUR - add = base_legitimacy_court_grandeur_value - - # DYNASTY RENOWN - new value to avoid Splendor bloating - add = succession_legitimacy_dynasty_prestige_level_value - - # LEGITIMACY BLOODLINE DYNASTY PERKS - add = base_legitimacy_track_perks_value - - # COUNTY OPINION - derived from average of held counties - add = base_legitimacy_county_opinion_value - - # PREVIOUS HOLDER DYNASTY - add = base_legitimacy_dynasty_of_predecessor_value - - # WHO WAS YOUR PARENT - add = succession_legitimacy_ancestor_tier_value - - # PREVIOUS HOLDER CHILD - add = base_legitimacy_relation_to_predecessor_value - - # SIDELINED SEX - add = base_legitimacy_sex_value - - # BASTARDRY - add = base_legitimacy_bastardry_value - - # YEARS AS RULER - bonus for startup rulers - add = base_legitimacy_years_as_ruler_value - - # SPECIAL TRAITS - add = base_legitimacy_special_traits_value - - # DIPLOMACY SKILLS - add = base_legitimacy_diplomacy_value - - # ADMINISTRATIVE - if = { - limit = { - exists = this - government_has_mechanic = administrative - } - multiply = 0.75 # To reduce the overall base values - add = base_legitimacy_admin_value # And add anything admin specific - } - - # ACH HEIR PREPARATION OATH - if = { - limit = { - has_character_modifier = oath_heir_preparation_heir - } - multiply = 1.25 - } - - min = 0 - round = yes -} - -# TIER -base_legitimacy_tier_value = { - value = 0 - if = { - limit = { highest_held_title_tier = tier_county } - add = 0 - } - else_if = { - limit = { highest_held_title_tier = tier_duchy } - add = 50 - } - else_if = { - limit = { highest_held_title_tier = tier_kingdom } - add = 150 - } - else_if = { - limit = { highest_held_title_tier = tier_empire } - add = 400 - } -} - -# COURT GRANDEUR -base_legitimacy_court_grandeur_value = { - value = 0 - if = { - limit = { - has_royal_court = yes - has_dlc_feature = royal_court - } - if = { - limit = { - court_grandeur_current_level >= 9_levels_above_expected_level #you meet expectations - } - add = { - value = base_legitimacy_per_court_grandeur_level_value - multiply = 3 - } - } - else_if = { - limit = { - court_grandeur_current_level >= 7_levels_above_expected_level - } - add = { - value = base_legitimacy_per_court_grandeur_level_value - multiply = 2 - } - } - else_if = { - limit = { - court_grandeur_current_level >= 5_levels_above_expected_level - } - add = { - value = base_legitimacy_per_court_grandeur_level_value - multiply = 1.5 - } - } - else_if = { - limit = { - court_grandeur_current_level >= 3_levels_above_expected_level - } - add = { - value = base_legitimacy_per_court_grandeur_level_value - multiply = 1.25 - } - } - else_if = { - limit = { - court_grandeur_current_level >= 1_levels_above_expected_level - } - add = { - value = base_legitimacy_per_court_grandeur_level_value - } - } - else_if = { - limit = { - court_grandeur_current_level <= 1_levels_below_expected_level - } - subtract = base_legitimacy_per_court_grandeur_level_value - } - else_if = { - limit = { - court_grandeur_current_level <= 3_levels_below_expected_level - } - subtract = { - value = base_legitimacy_per_court_grandeur_level_value - multiply = 1.25 - } - } - else_if = { - limit = { - court_grandeur_current_level <= 5_levels_below_expected_level - } - subtract = { - value = base_legitimacy_per_court_grandeur_level_value - multiply = 1.5 - } - } - else_if = { - limit = { - court_grandeur_current_level <= 7_levels_below_expected_level - } - subtract = { - value = base_legitimacy_per_court_grandeur_level_value - multiply = 2 - } - } - else_if = { - limit = { - court_grandeur_current_level <= 9_levels_below_expected_level - } - subtract = { - value = base_legitimacy_per_court_grandeur_level_value - multiply = 3 - } - } - } -} - -# DYNASTY RENOWN -base_legitimacy_dynasty_prestige_level_value = { - value = 0 - if = { - limit = { - highest_held_title_tier = tier_county - } - add = { - value = base_legitimacy_per_dynasty_prestige_level_value - multiply = dynasty.dynasty_prestige_level - } - } - else_if = { - limit = { - highest_held_title_tier = tier_duchy - } - add = { - value = base_legitimacy_per_dynasty_prestige_level_value - multiply = dynasty.dynasty_prestige_level - multiply = 1.5 - } - } - else_if = { - limit = { - highest_held_title_tier = tier_kingdom - } - add = { - value = base_legitimacy_per_dynasty_prestige_level_value - multiply = dynasty.dynasty_prestige_level - multiply = 2 - } - } - else_if = { - limit = { - highest_held_title_tier = tier_empire - } - add = { - value = base_legitimacy_per_dynasty_prestige_level_value - multiply = dynasty.dynasty_prestige_level - multiply = 2.25 - } - } - if = { # We lower everything if you're in 867 - limit = { - culture ?= { NOT = { has_cultural_era_or_later = culture_era_early_medieval } } - } - multiply = 0.5 - } -} - -succession_legitimacy_dynasty_prestige_level_value = { - value = 0 - if = { - limit = { - highest_held_title_tier = tier_county - } - add = { - value = base_legitimacy_per_dynasty_prestige_level_value - multiply = dynasty.dynasty_prestige_level - multiply = 0.25 - } - } - else_if = { - limit = { - highest_held_title_tier = tier_duchy - } - add = { - value = base_legitimacy_per_dynasty_prestige_level_value - multiply = dynasty.dynasty_prestige_level - multiply = 0.5 - } - } - else_if = { - limit = { - highest_held_title_tier = tier_kingdom - } - add = { - value = base_legitimacy_per_dynasty_prestige_level_value - multiply = dynasty.dynasty_prestige_level - multiply = 0.75 - } - } - else_if = { - limit = { - highest_held_title_tier = tier_empire - } - add = { - value = base_legitimacy_per_dynasty_prestige_level_value - multiply = dynasty.dynasty_prestige_level - } - } - else_if = { - limit = { - highest_held_title_tier = tier_hegemony - } - add = { - value = base_legitimacy_per_dynasty_prestige_level_value - multiply = dynasty.dynasty_prestige_level - multiply = 1.25 - } - } - if = { # We lower everything if you're in 867 - limit = { - culture ?= { NOT = { has_cultural_era_or_later = culture_era_early_medieval } } - } - multiply = 0.5 - } -} - -# LEGITIMACY BLOODLINE DYNASTY PERKS -base_legitimacy_track_perks_value = { - value = 0 - if = { - limit = { dynasty.ce1_legitimacy_legacy_track_perks >= 1 } - add = { - value = base_legitimacy_per_legitimacy_track_perk_value - multiply = dynasty.ce1_legitimacy_legacy_track_perks - } - } -} - -# COUNTY OPINION -base_legitimacy_county_opinion_value = { - value = 0 - if = { # Average of popular opinion in all held counties divided 4 (max 25) - limit = { - any_held_title = { title_tier = county } - } - every_held_title = { - title_tier = county - add = { - value = county_opinion - multiply = 2 - } - } - divide = base_legitimacy_county_opinion_county_count_value - divide = 4 - ceiling = yes - } -} - -base_legitimacy_county_opinion_county_count_value = { - value = 0 - if = { - limit = { - any_held_county = { tier = tier_county } - } - every_held_title = { - title_tier = county - add = 1 - } - } -} - -# PREDECESSOR DYNASTY -base_legitimacy_dynasty_of_predecessor_value = { - value = 0 - if = { - limit = { primary_title.previous_holder.dynasty ?= dynasty } - if = { - limit = { - highest_held_title_tier = tier_county - } - add = base_legitimacy_dynasty_of_previous_value - } - else_if = { - limit = { - highest_held_title_tier = tier_duchy - } - add = { - value = base_legitimacy_dynasty_of_previous_value - multiply = 1.5 - } - } - else_if = { - limit = { - highest_held_title_tier = tier_kingdom - } - add = { - value = base_legitimacy_dynasty_of_previous_value - multiply = 2 - } - } - else_if = { - limit = { - highest_held_title_tier = tier_empire - } - add = { - value = base_legitimacy_dynasty_of_previous_value - multiply = 2.25 - } - } - # How many previous holders were of your same dynasty? - primary_title = { - every_past_holder = { - limit = { - dynasty ?= dynasty - } - add = { - value = base_legitimacy_dynasty_of_previous_value - multiply = 0.05 - } - } - } - if = { # We lower everything if you're in 867 - limit = { - culture ?= { NOT = { has_cultural_era_or_later = culture_era_early_medieval } } - } - multiply = 0.5 - } - } -} - -# SUCCESSION - WHO WAS YOUR DAD/MOM -succession_legitimacy_ancestor_tier_value = { - value = 0 - if = { - limit = { - any_parent = { - is_ruler = yes - highest_held_title_tier = tier_empire - } - } - add = { - value = succession_legitimacy_ancestor_per_tier_value - multiply = 3 - } - } - else_if = { - limit = { - any_parent = { - is_ruler = yes - highest_held_title_tier = tier_kingdom - } - } - add = { - value = succession_legitimacy_ancestor_per_tier_value - multiply = 2 - } - } - else_if = { - limit = { - any_parent = { - is_ruler = yes - highest_held_title_tier = tier_duchy - } - } - add = { - value = succession_legitimacy_ancestor_per_tier_value - multiply = 1.5 - } - } - else_if = { - limit = { - any_parent = { - is_ruler = yes - highest_held_title_tier = tier_county - } - } - add = succession_legitimacy_ancestor_per_tier_value - } - if = { # We lower everything if you're in 867 - limit = { - culture ?= { NOT = { has_cultural_era_or_later = culture_era_early_medieval } } - } - multiply = 0.5 - } -} - - -# RELATION TO PREDECESSOR -base_legitimacy_relation_to_predecessor_value = { - value = 0 - if = { - limit = { exists = primary_title.previous_holder } - if = { - limit = { is_primary_heir_of = primary_title.previous_holder } - if = { - limit = { - highest_held_title_tier = tier_county - } - add = base_legitimacy_predecessor_primary_heir_value - } - else_if = { - limit = { - highest_held_title_tier = tier_duchy - } - add = { - value = base_legitimacy_predecessor_primary_heir_value - multiply = 1.5 - } - } - else_if = { - limit = { - highest_held_title_tier = tier_kingdom - } - add = { - value = base_legitimacy_predecessor_primary_heir_value - multiply = 2 - } - } - else_if = { - limit = { - highest_held_title_tier = tier_empire - } - add = { - value = base_legitimacy_predecessor_primary_heir_value - multiply = 2.25 - } - } - if = { # We lower everything if you're in 867 - limit = { - culture ?= { NOT = { has_cultural_era_or_later = culture_era_early_medieval } } - } - multiply = 0.5 - } - } - if = { - limit = { is_child_of = primary_title.previous_holder } - add = base_legitimacy_predecessor_child_value - } - else_if = { - limit = { is_close_family_of = primary_title.previous_holder } - add = base_legitimacy_predecessor_close_family_value - } - else_if = { - limit = { is_spouse_of = primary_title.previous_holder } - add = base_legitimacy_predecessor_spouse_value - } - else_if = { - limit = { is_extended_family_of = primary_title.previous_holder } - add = base_legitimacy_predecessor_extended_family_value - } - } -} - -# SEX -base_legitimacy_sex_value = { - value = 0 - if = { - limit = { - OR = { - AND = { - is_male = yes - faith_dominant_gender_male_or_equal = no - } - AND = { - is_female = yes - faith_dominant_gender_female_or_equal = no - } - } - } - add = base_legitimacy_sidelined_sex_value - } -} - -# BASTARDRY -base_legitimacy_bastardry_value = { - value = 0 - if = { - limit = { has_trait = bastard } - add = base_legitimacy_bastardry_high_value - } - if = { - limit = { has_trait = disputed_heritage } - add = base_legitimacy_bastardry_medium_value - } - if = { - limit = { - OR = { - has_trait = legitimized_bastard - has_trait = wild_oat - has_trait = child_of_concubine - } - } - add = base_legitimacy_bastardry_low_value - } -} - -# YEARS AS RULER -base_legitimacy_years_as_ruler_value = { - value = 0 - ordered_held_title = { - limit = { tier = prev.highest_held_title_tier } - order_by = title_held_years - add = title_held_years - divide = 2 - } - ceiling = yes -} - -# SPECIAL TRAITS -base_legitimacy_special_traits_value = { - value = 0 - if = { - limit = { has_trait = sayyid } - add = { - value = base_legitimacy_per_special_traits_value - multiply = 2 - } - } - if = { - limit = { has_trait = golden_lineage } - add = { - value = base_legitimacy_per_special_traits_value - multiply = 2 - } - } - if = { - limit = { has_trait = born_in_the_purple } - add = { - value = base_legitimacy_per_special_traits_value - multiply = 2 - } - } - if = { - limit = { has_trait = august } - add = { - value = base_legitimacy_per_special_traits_value - multiply = 2 - } - } - if = { - limit = { has_trait = just } - add = { - value = base_legitimacy_per_special_traits_value - multiply = 2 - } - } - if = { - limit = { num_virtuous_traits >= 1 } - add = { - value = base_legitimacy_per_special_traits_value - multiply = num_virtuous_traits - } - } - if = { - limit = { num_sinful_traits >= 1 } - add = { - value = base_legitimacy_per_special_traits_value - multiply = num_sinful_traits - multiply = -1 - } - } - if = { - limit = { - has_trait = inbred - } - add = { - value = base_legitimacy_per_special_traits_value - multiply = -2 - } - } -} - -# DIPLOMACY SKILLS -base_legitimacy_diplomacy_value = { - value = 0 - add = { - value = diplomacy - multiply = 2 #to make it matter - } -} - -# ADMINISTRATIVE -base_legitimacy_admin_value = { - value = 0 - - - # Am I a dominant or powerful family? - if = { - limit = { - house ?= { is_dominant_family = yes } - } - add = { - value = house.house_power_score - multiply = 1.5 - round = yes - } - } - else_if = { - limit = { - house ?= { is_powerful_family = yes } - NOT = { primary_title.previous_holder.house ?= house } - } - add = { - value = house.house_power_score - } - } - - # Am I allied to any other powerful families? - if = { - limit = { - any_ally = { - house ?= { - house_head = prev - is_powerful_family = yes - } - top_liege = prev.top_liege - } - } - every_ally = { - limit = { - house ?= { - house_head = prev - is_powerful_family = yes - } - top_liege = prev.top_liege - } - add = { - value = 10 - multiply = influence_level - } - } - } - - # What is my Level of Influence? - if = { - limit = { - influence_level >= 2 - } - add = { - value = 5 - multiply = influence_level - } - } - - # What is the popular opinion in the capital? - if = { - limit = { - capital_province.county = { - county_opinion != 0 - } - } - add = { - value = capital_province.county.county_opinion - multiply = 2 - } - } - - # What level is the main building in my Estate? - if = { - limit = { - domicile ?= { has_domicile_building_or_higher = estate_main_02 } - } - if = { - limit = { - domicile ?= { has_domicile_building_or_higher = estate_main_05 } - } - add = 40 - } - else_if = { - limit = { - domicile ?= { has_domicile_building_or_higher = estate_main_04 } - } - add = 30 - } - else_if = { - limit = { - domicile ?= { has_domicile_building_or_higher = estate_main_03 } - } - add = 20 - } - else_if = { - limit = { - domicile ?= { has_domicile_building_or_higher = estate_main_02 } - } - add = 10 - } - } -} - -### EXPECTATIONS - -# AI Expected Legitimacy -default_ai_legitimacy_expectation = { - value = 1 - # De Jure Vassal - if = { - limit = { - scope:liege = { is_rightful_liege_of = root } - } - subtract = 1 - } - # Powerful Vassals expect more - if = { - limit = { - is_powerful_vassal_of = scope:liege - } - add = 1 - } - # How long have you been under this dynasty? - if = { - limit = { - days_since_vassal_contract_liege_dynasty_reign_start >= 18250 #50 years - } - subtract = 1 - } - if = { - limit = { - days_since_vassal_contract_liege_dynasty_reign_start >= 36500 #100 years - } - subtract = 1 - } - # Vassal Stance - if = { - limit = { was_preferred_heir = scope:liege } - subtract = 1 - } - # Relations - if = { - limit = { - scope:liege = { - OR = { - is_spouse_of = root - is_close_family_of = root - } - } - } - subtract = 1 - } - # Tier - more legitimacy required for higher tiers - if = { - limit = { - scope:liege.highest_held_title_tier >= tier_county - } - add = 1 - } - if = { - limit = { - scope:liege.highest_held_title_tier >= tier_duchy - } - add = 1 - } - if = { - limit = { - scope:liege.highest_held_title_tier >= tier_kingdom - } - add = 2 - } - if = { - limit = { - scope:liege.highest_held_title_tier >= tier_empire - } - add = 2 - } - # Era - more legitimacy required as time goes on - if = { - limit = { - scope:liege.culture ?= { has_cultural_era_or_later = culture_era_tribal } - } - subtract = 1 - } - else_if = { - limit = { - scope:liege.culture ?= { has_cultural_era_or_later = culture_era_high_medieval } - } - add = 2 - } - else_if = { - limit = { - scope:liege.culture ?= { has_cultural_era_or_later = culture_era_late_medieval } - } - add = 2 - } - # PAM: you are a theocratic gov with an Apostolic Succession tenet - if = { - limit = { - scope:liege.faith = root.faith - government_has_flag = government_is_theocracy - scope:liege.rite ?= { rite_has_parameter = tenet_apostolic_succession_bishop_legitimacy } - } - subtract = 2 - } - min = 1 - max = 4 -} - -default_legitimacy_opinion_penalty = -10 - -default_ai_mandala_legitimacy_expectation = { - value = 1 - # De Jure Vassal - if = { - limit = { - scope:liege = { is_rightful_liege_of = root } - } - subtract = 1 - } - # Powerful Vassals expect more - if = { - limit = { - is_powerful_vassal_of = scope:liege - } - add = 1 - } - # How long have you been under this dynasty? - if = { - limit = { - days_since_vassal_contract_liege_dynasty_reign_start >= 18250 #50 years - } - subtract = 1 - } - if = { - limit = { - days_since_vassal_contract_liege_dynasty_reign_start >= 36500 #100 years - } - subtract = 1 - } - # Vassal Stance - if = { - limit = { was_preferred_heir = scope:liege } - subtract = 1 - } - # Relations - if = { - limit = { - scope:liege = { - OR = { - is_spouse_of = root - is_close_family_of = root - } - } - } - subtract = 1 - } - # Tier - more legitimacy required for higher tiers - if = { - limit = { - scope:liege.highest_held_title_tier >= tier_county - } - add = 1 - } - if = { - limit = { - scope:liege.highest_held_title_tier >= tier_duchy - } - add = 1 - } - if = { - limit = { - scope:liege.highest_held_title_tier >= tier_kingdom - } - add = 2 - } - if = { - limit = { - scope:liege.highest_held_title_tier >= tier_empire - } - add = 3 - } - # Era - more legitimacy required as time goes on - if = { - limit = { - scope:liege.culture = { has_cultural_era_or_later = culture_era_tribal } - } - subtract = 1 - } - else_if = { - limit = { - scope:liege.culture = { has_cultural_era_or_later = culture_era_high_medieval } - } - add = 2 - } - else_if = { - limit = { - scope:liege.culture = { has_cultural_era_or_later = culture_era_late_medieval } - } - add = 2 - } - #Piety level - if = { - limit = { - scope:liege.piety_level >= very_high_piety_level - } - add = 1 - } - if = { - limit = { - scope:liege.piety_level >= max_piety_level - } - add = 1 - } - if = { - limit = { - scope:liege.piety_level >= max_piety_level_plus_1 - } - add = 1 - } - if = { - limit = { - scope:liege.piety_level >= max_piety_level_plus_2 - } - add = 1 - } - if = { - limit = { - scope:liege.piety_level >= max_piety_level_plus_3 - } - add = 1 - } - min = 1 - max = 7 -} - -### EFFECTS - -legitimacy_regent_swing_scale_multipler_value = { - value = 1 - # LEGITIMACY OF RULER AFFECTS COSTS - if = { - limit = { - scope:actor = { has_legitimacy_flag = massively_increased_swing_scales_cost } - } - multiply = 1.75 - } - if = { - limit = { - scope:actor = { has_legitimacy_flag = very_increased_swing_scales_cost } - } - multiply = 1.5 - } - if = { - limit = { - scope:actor = { has_legitimacy_flag = increased_swing_scales_cost } - } - multiply = 1.25 - } - if = { - limit = { - scope:actor = { has_legitimacy_flag = reduced_swing_scales_cost } - } - multiply = 0.85 - } - if = { - limit = { - scope:actor = { has_legitimacy_flag = very_reduced_swing_scales_cost } - } - multiply = 0.75 - } - if = { - limit = { - scope:actor = { has_legitimacy_flag = extra_reduced_swing_scales_cost } - } - multiply = 0.5 - } -} - -nomadic_legitimacy_claimant_multiplier = { - value = 1 - if = { - limit = { - scope:the_claimant = { government_has_flag = government_is_nomadic } - } - multiply = 1.5 - } -} - -max_legitimacy_level_value = { - value = 5 - if = { - limit = { government_has_flag = government_is_mandala } - add = 3 - } -} diff --git a/common/script_values/00_men_at_arms_values.txt b/common/script_values/00_men_at_arms_values.txt index 62e858ad5..6627ec023 100644 --- a/common/script_values/00_men_at_arms_values.txt +++ b/common/script_values/00_men_at_arms_values.txt @@ -451,7 +451,7 @@ culture_ai_weight_skirmishers = { if = { # Cultures that favours skirmishers limit = { - culture ?= { + culture = { OR = { has_cultural_pillar = heritage_baltic has_cultural_pillar = heritage_ugro_permian @@ -463,7 +463,7 @@ culture_ai_weight_skirmishers = { } if = { # Cultures that dislike skirmishers limit = { - culture ?= { + culture = { OR = { has_cultural_pillar = heritage_central_germanic has_cultural_pillar = heritage_frankish @@ -477,7 +477,7 @@ culture_ai_weight_skirmishers = { if = { # Cultures with a special MaA of that type should avoid the base version of the unit limit = { - culture ?= { + culture = { culture_has_skirmisher_maa = yes } } @@ -490,7 +490,7 @@ culture_ai_weight_archers = { if = { # Cultures that favours archers limit = { - culture ?= { + culture = { OR = { has_cultural_pillar = heritage_west_germanic has_cultural_pillar = heritage_brythonic @@ -507,8 +507,8 @@ culture_ai_weight_archers = { if = { # Cultures that dislike archers limit = { OR = { - culture ?= { has_cultural_pillar = heritage_central_germanic } - culture ?= { has_cultural_pillar = heritage_frankish } + culture = { has_cultural_pillar = heritage_central_germanic } + culture = { has_cultural_pillar = heritage_frankish } } } add = -60 @@ -516,7 +516,7 @@ culture_ai_weight_archers = { if = { # Cultures with a special MaA of that type should avoid the base version of the unit limit = { - culture ?= { + culture = { culture_has_archer_maa = yes } } @@ -529,7 +529,7 @@ culture_ai_weight_heavy_infantry = { if = { # Cultures that favours heavy infantry limit = { - culture ?= { + culture = { OR = { has_cultural_pillar = heritage_central_germanic has_cultural_pillar = heritage_north_germanic @@ -544,7 +544,7 @@ culture_ai_weight_heavy_infantry = { if = { # Cultures with a special MaA of that type should avoid the base version of the unit limit = { OR = { - culture ?= { + culture = { culture_has_heavy_infantry_maa = yes } @@ -563,8 +563,8 @@ culture_ai_weight_pikemen = { if = { # Cultures that favours spearmen limit = { OR = { - culture ?= { has_cultural_pillar = heritage_central_germanic } - culture ?= { has_cultural_pillar = heritage_latin } + culture = { has_cultural_pillar = heritage_central_germanic } + culture = { has_cultural_pillar = heritage_latin } } } add = 40 @@ -572,7 +572,7 @@ culture_ai_weight_pikemen = { if = { # Cultures with a special MaA of that type should avoid the base version of the unit limit = { - culture ?= { + culture = { culture_has_pikemen_maa = yes } } @@ -587,7 +587,7 @@ culture_ai_weight_light_cavalry = { limit = { mpo_can_recruit_nomad_maa_trigger = no OR = { - culture ?= { has_cultural_pillar = heritage_iranian } + culture = { has_cultural_pillar = heritage_iranian } } } add = 80 @@ -595,7 +595,7 @@ culture_ai_weight_light_cavalry = { if = { # Cultures that favours light cavalry limit = { mpo_can_recruit_nomad_maa_trigger = no - culture ?= { + culture = { OR = { has_cultural_pillar = heritage_arabic has_cultural_pillar = heritage_berber @@ -611,11 +611,11 @@ culture_ai_weight_light_cavalry = { if = { # Cultures that dislike light cavalry limit = { OR = { - culture ?= { has_cultural_pillar = heritage_central_germanic } - culture ?= { has_cultural_pillar = heritage_tibetan } - culture ?= { has_cultural_pillar = heritage_baltic } - culture ?= { has_cultural_pillar = heritage_burman } - culture ?= { has_cultural_pillar = heritage_somalian } + culture = { has_cultural_pillar = heritage_central_germanic } + culture = { has_cultural_pillar = heritage_tibetan } + culture = { has_cultural_pillar = heritage_baltic } + culture = { has_cultural_pillar = heritage_burman } + culture = { has_cultural_pillar = heritage_somalian } } } add = -60 @@ -623,7 +623,7 @@ culture_ai_weight_light_cavalry = { if = { # Cultures with a special MaA of that type should avoid the base version of the unit limit = { - culture ?= { + culture = { culture_has_light_cavalry_maa = yes } } @@ -632,12 +632,12 @@ culture_ai_weight_light_cavalry = { if = { # Cultures with a preference for Camel Riders should buy those over normal light cavalry limit = { - culture ?= { + culture = { has_innovation = innovation_war_camels } OR = { - culture ?= { has_cultural_pillar = heritage_arabic } - culture ?= { has_cultural_pillar = heritage_berber } + culture = { has_cultural_pillar = heritage_arabic } + culture = { has_cultural_pillar = heritage_berber } } } add = -200 @@ -651,11 +651,11 @@ culture_ai_weight_heavy_cavalry = { limit = { mpo_can_recruit_nomad_maa_trigger = no OR = { - culture ?= { has_cultural_pillar = heritage_iranian } + culture = { has_cultural_pillar = heritage_iranian } # Steppe cultures - culture ?= { has_cultural_pillar = heritage_turkic } - culture ?= { has_cultural_pillar = heritage_mongolic } + culture = { has_cultural_pillar = heritage_turkic } + culture = { has_cultural_pillar = heritage_mongolic } } } add = 80 @@ -664,16 +664,16 @@ culture_ai_weight_heavy_cavalry = { limit = { mpo_can_recruit_nomad_maa_trigger = no OR = { - culture ?= { has_cultural_pillar = heritage_central_germanic } - culture ?= { has_cultural_pillar = heritage_frankish } - culture ?= { has_cultural_pillar = heritage_indo_aryan } + culture = { has_cultural_pillar = heritage_central_germanic } + culture = { has_cultural_pillar = heritage_frankish } + culture = { has_cultural_pillar = heritage_indo_aryan } } } add = 40 } if = { # Cultures that dislike heavy cavalry limit = { - culture ?= { + culture = { OR = { has_cultural_pillar = heritage_tibetan has_cultural_pillar = heritage_baltic @@ -693,7 +693,7 @@ culture_ai_weight_heavy_cavalry = { if = { # Cultures with a special MaA of that type should avoid the base version of the unit limit = { - culture ?= { + culture = { culture_has_heavy_cavalry_maa = yes } } @@ -707,8 +707,8 @@ culture_ai_weight_camels = { if = { # Cultures that favours camel riders limit = { OR = { - culture ?= { has_cultural_pillar = heritage_arabic } - culture ?= { has_cultural_pillar = heritage_berber } + culture = { has_cultural_pillar = heritage_arabic } + culture = { has_cultural_pillar = heritage_berber } } } add = 80 @@ -721,9 +721,9 @@ culture_ai_weight_elephants = { if = { # Cultures that favours war elephants limit = { OR = { - culture ?= { has_cultural_pillar = heritage_dravidian } - culture ?= { has_cultural_pillar = heritage_indo_aryan } - culture ?= { has_cultural_pillar = heritage_burman } + culture = { has_cultural_pillar = heritage_dravidian } + culture = { has_cultural_pillar = heritage_indo_aryan } + culture = { has_cultural_pillar = heritage_burman } } } add = 60 @@ -808,7 +808,7 @@ counter_synergy_ai_weight_gunpowder = { value = 200 # Since these are hard-limited elsewhere, prefer them highly if = { limit = { - culture ?= { has_cultural_era_or_later = culture_era_late_medieval } + culture = { has_cultural_era_or_later = culture_era_late_medieval } number_maa_regiments_of_base_type = { type = pikemen value >= 3 @@ -824,7 +824,7 @@ counter_synergy_ai_weight_gunpowder = { } if = { limit = { - culture ?= { has_cultural_pillar = heritage_chinese } + culture = { has_cultural_pillar = heritage_chinese } } add = 10 # more gun } @@ -854,7 +854,7 @@ culture_ai_weight_crossbowmen = { if = { # Cultures with a special MaA of that type should avoid the base version of the unit limit = { - culture ?= { + culture = { culture_has_improved_crossbowmen = yes } } diff --git a/common/script_values/01_dynamic_values.txt b/common/script_values/01_dynamic_values.txt deleted file mode 100644 index ad5796f6b..000000000 --- a/common/script_values/01_dynamic_values.txt +++ /dev/null @@ -1,2348 +0,0 @@ - -# Can't reference a named value that hasn't been defined yet, so this file is late in the load order -# Feel free to use other files as well, but be careful about load order -# Please remove the example formulas once there's a few real formulas - - - - -#GOLD - -#Based on income + limits - -tiny_gold_value = { #To be used as flavor (paying a stablehand, throwing coins in a wishing well) - value = monthly_character_income - multiply = tiny_income_multiplier_value # 1.2 months - if = { - limit = { - has_treasury = yes - this != top_liege - is_landed = yes - } - multiply = 0.25 - } - min = tiny_gold_min_value - max = tiny_gold_max_value - - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 -} - -tiny_gold_value_static_max = { #To be used as flavor (paying a stablehand, throwing coins in a wishing well) - value = monthly_character_income - multiply = tiny_income_multiplier_value # 1.2 months - if = { - limit = { - has_treasury = yes - this != top_liege - is_landed = yes - } - multiply = 0.25 - } - min = tiny_gold_min_value - max = tiny_gold_max_value_static - - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 -} - -minor_gold_value = { #To be used as a run-of-the-mill amount - value = monthly_character_income - multiply = minor_income_multiplier_value # 3 months - if = { - limit = { - has_treasury = yes - this != top_liege - is_landed = yes - } - multiply = 0.25 - } - min = minor_gold_min_value - max = minor_gold_max_value - - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 -} - -minor_gold_value_static_max = { #To be used as a run-of-the-mill amount - value = monthly_character_income - multiply = minor_income_multiplier_value # 3 months - if = { - limit = { - has_treasury = yes - this != top_liege - is_landed = yes - } - multiply = 0.25 - } - min = minor_gold_min_value - max = minor_gold_max_value_static - - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 -} - -medium_gold_value = { - value = monthly_character_income - multiply = medium_income_multiplier_value # 6 months - if = { - limit = { - has_treasury = yes - this != top_liege - is_landed = yes - } - multiply = 0.25 - } - min = medium_gold_min_value - max = medium_gold_max_value - - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 -} - -medium_gold_value_static_max = { - value = monthly_character_income - multiply = medium_income_multiplier_value # 6 months - if = { - limit = { - has_treasury = yes - this != top_liege - is_landed = yes - } - multiply = 0.25 - } - min = medium_gold_min_value - max = medium_gold_max_value_static - - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 -} - -major_gold_value = { - value = monthly_character_income - multiply = major_income_multiplier_value # 12 months, a year - if = { - limit = { - has_treasury = yes - this != top_liege - is_landed = yes - } - multiply = 0.25 - } - min = major_gold_min_value - max = major_gold_max_value - - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 -} - -major_gold_value_static_max = { - value = monthly_character_income - multiply = major_income_multiplier_value # 12 months, a year - if = { - limit = { - has_treasury = yes - this != top_liege - is_landed = yes - } - multiply = 0.25 - } - min = major_gold_min_value - max = major_gold_max_value_static - - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 -} - -massive_gold_value = { #Highest gold to be used in events, very rare - value = monthly_character_income - multiply = massive_income_multiplier_value # 18 months, one and a half years - if = { - limit = { - has_treasury = yes - this != top_liege - is_landed = yes - } - multiply = 0.25 - } - min = massive_gold_min_value - max = massive_gold_max_value - - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 -} - -massive_gold_value_static_max = { #Highest gold to be used in events, very rare - value = monthly_character_income - multiply = massive_income_multiplier_value # 18 months, one and a half years - if = { - limit = { - has_treasury = yes - this != top_liege - is_landed = yes - } - multiply = 0.25 - } - min = massive_gold_min_value - max = massive_gold_max_value_static - - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 -} - -monumental_gold_value = { # Only to be used in extreme cases, primarily for player-initiated actions. - value = monthly_character_income - multiply = monumental_income_multiplier_value # 36 months, three years - if = { - limit = { - has_treasury = yes - this != top_liege - is_landed = yes - } - multiply = 0.25 - } - min = monumental_gold_min_value - max = monumental_gold_max_value - - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 -} - -monumental_gold_value_static_max = { # Only to be used in extreme cases, primarily for player-initiated actions. - value = monthly_character_income - multiply = monumental_income_multiplier_value # 36 months, three years - if = { - limit = { - has_treasury = yes - this != top_liege - is_landed = yes - } - multiply = 0.25 - } - min = monumental_gold_min_value - max = monumental_gold_max_value_static - - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 -} - -## Negative Gold Values -tiny_gold_value_negative = { - value = tiny_gold_value - multiply = -1 -} - -minor_gold_value_negative = { - value = minor_gold_value - multiply = -1 -} - -medium_gold_value_negative = { - value = medium_gold_value - multiply = -1 -} - -major_gold_value_negative = { - value = major_gold_value - multiply = -1 -} - -massive_gold_value_negative = { - value = massive_gold_value - multiply = -1 -} - -monumental_gold_value_negative = { - value = monumental_gold_value - multiply = -1 -} -## End negative gold values - -tiny_gold_loss = { - add = tiny_gold_value - multiply = -1 -} - -minor_gold_loss = { - add = minor_gold_value - multiply = -1 -} - -medium_gold_loss = { - add = medium_gold_value - multiply = -1 -} - -major_gold_loss = { - add = major_gold_value - multiply = -1 -} - -massive_gold_loss = { - add = massive_gold_value - multiply = -1 -} - -monumental_gold_loss = { - add = monumental_gold_value - multiply = -1 -} - -gift_interaction_cutoff = { - value = yearly_character_income - multiply = 3 - min = 10 - max = 300 -} - -head_of_faith_gold_value = { - value = monthly_character_income - multiply = massive_income_multiplier_value - min = medium_gold_min_value - max = monumental_gold_max_value -} - -head_of_faith_treasury_value = { - value = monthly_character_treasury_variable_income - multiply = massive_income_multiplier_value - min = medium_treasury_min_value - max = monumental_treasury_max_value -} - -head_of_faith_treasury_or_gold_value = { - value = 0 - if = { - limit = { - has_treasury = yes - } - add = head_of_faith_treasury_value - } - else = { - add = head_of_faith_gold_value - } -} - -# Paying cleric is the scope -# The ask itself scales off the petitioner -hof_ask_for_gold_request_value = { - value = scope:actor.head_of_faith_treasury_or_gold_value - max = hof_ask_for_gold_cleric_capacity_value - min = medium_gold_min_value -} - -hof_ask_for_gold_cleric_capacity_value = { - value = 0 - if = { - limit = { - has_treasury = yes - } - add = treasury - } - else = { - add = gold - } - multiply = 0.5 -} - -tiny_treasury_value = { - value = monthly_character_treasury_variable_income - multiply = tiny_income_multiplier_value # 1.2 months - min = tiny_treasury_min_value - max = tiny_treasury_max_value - - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 -} - -minor_treasury_value = { - value = monthly_character_treasury_variable_income - min = minor_treasury_min_value - max = minor_treasury_max_value - - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 -} - -medium_treasury_value = { - value = monthly_character_treasury_variable_income - multiply = minor_income_multiplier_value # 3 months - min = medium_treasury_min_value - max = medium_treasury_max_value - - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 -} - -major_treasury_value = { - value = monthly_character_treasury_variable_income - multiply = medium_income_multiplier_value # 6 months - min = major_treasury_min_value - max = major_treasury_max_value - - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 -} - -massive_treasury_value = { - value = monthly_character_treasury_variable_income - multiply = major_income_multiplier_value # 12 months, a year - min = massive_treasury_min_value - max = massive_treasury_max_value - - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 -} - -monumental_treasury_value = { - value = monthly_character_treasury_variable_income - multiply = monumental_income_multiplier_value # 36 months, three years - min = monumental_treasury_min_value - max = monumental_treasury_max_value - - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 -} - -tiny_treasury_or_gold_value = { - value = 0 - if = { - limit = { - has_treasury = yes - } - add = tiny_treasury_value - } - else = { - add = tiny_gold_value - } -} - -minor_treasury_or_gold_value = { - value = 0 - if = { - limit = { - has_treasury = yes - } - add = minor_treasury_value - } - else = { - add = minor_gold_value - } -} - -medium_treasury_or_gold_value = { - value = 0 - if = { - limit = { - has_treasury = yes - } - add = medium_treasury_value - } - else = { - add = medium_gold_value - } -} - -major_treasury_or_gold_value = { - value = 0 - if = { - limit = { - has_treasury = yes - } - add = major_treasury_value - } - else = { - add = major_gold_value - } -} - -massive_treasury_or_gold_value = { - value = 0 - if = { - limit = { - has_treasury = yes - } - add = massive_treasury_value - } - else = { - add = massive_gold_value - } -} - -monumental_treasury_or_gold_value = { - value = 0 - if = { - limit = { - has_treasury = yes - } - add = monumental_treasury_value - } - else = { - add = monumental_gold_value - } -} - -seek_indulgences_major_criminal_trait_value = { - value = head_of_faith_gold_value - multiply = 2.5 -} -seek_indulgences_medium_criminal_trait_value = { - value = head_of_faith_gold_value - multiply = 2.0 -} -seek_indulgences_minor_criminal_trait_value = { - value = head_of_faith_gold_value - multiply = 1.5 -} -seek_indulgences_buy_piety_value = { - value = head_of_faith_gold_value - # Base price of the indulgence, paid on every petition. Absolving a sin is charged on top through the criminal-trait values above, so this stays modest. - multiply = 0.25 - min = medium_gold_min_value - if = { - limit = { - situation:the_christian_church ?= { - has_situation_top_phase_parameter = the_christian_church_better_indulgences - } - } - multiply = 0.75 - } -} - -seek_indulgences_antipope_buy_piety_value = { - value = seek_indulgences_buy_piety_value - multiply = 0.3 # 30% of what you would normally pay -} - -holy_order_gold_value = { - value = monthly_character_income - multiply = major_income_multiplier_value - min = medium_gold_max_value - max = massive_gold_max_value -} - -create_duchy_title_value = { - add = 300 - multiply = { - value = 1 - #Legitimacy discounts - if = { - limit = { legitimacy_level = 5 } - subtract = 0.35 - } - if = { - limit = { legitimacy_level = 4 } - subtract = 0.25 - } - if = { - limit = { legitimacy_level = 3 } - subtract = 0.2 - } - if = { - limit = { legitimacy_level = 2 } - subtract = 0.15 - } - if = { - limit = { has_perk = ducal_conquest_perk } # Ducal Conquest - subtract = 0.2 - } - if = { - limit = { - culture = { has_innovation = innovation_divine_right } # Divine Right - } - subtract = 0.2 - } - if = { - limit = { government_has_flag = government_is_tribal } # Tribal - subtract = 0.5 - } - if = { - limit = { government_has_flag = government_is_nomadic } # Nomads - subtract = 0.5 - } - if = { - limit = { - rite = { rite_has_tenet = tenet_pursuit_of_power } # Pursuit of Power - } - subtract = 0.5 - } - if = { - limit = { - culture = { has_cultural_pillar = ethos_courtly } # Courtly - } - subtract = 0.15 - } - if = { - limit = { - culture = { has_cultural_tradition = tradition_legalistic } # Legalistic - } - subtract = 0.3 - } - if = { - limit = { - dynasty ?= { has_dynasty_perk = law_legacy_2 } # Faithful Magistrates - } - subtract = 0.2 - } - min = 0.2 # 80% max discount from defines - } -} - -create_kingdom_title_value = { - add = 600 - multiply = { - value = 1 - #Legitimacy discounts - if = { - limit = { legitimacy_level = 5 } - subtract = 0.35 - } - if = { - limit = { legitimacy_level = 4 } - subtract = 0.25 - } - if = { - limit = { legitimacy_level = 3 } - subtract = 0.2 - } - if = { - limit = { legitimacy_level = 2 } - subtract = 0.15 - } - if = { - limit = { has_perk = ducal_conquest_perk } # Ducal Conquest - subtract = 0.2 - } - if = { - limit = { - culture = { has_innovation = innovation_divine_right } # Divine Right - } - subtract = 0.2 - } - if = { - limit = { government_has_flag = government_is_tribal } # Tribal - subtract = 0.5 - } - if = { - limit = { government_has_flag = government_is_nomadic } # Nomads - subtract = 0.5 - } - if = { - limit = { - rite = { rite_has_tenet = tenet_pursuit_of_power } # Pursuit of Power - } - subtract = 0.5 - } - if = { - limit = { - culture = { has_cultural_pillar = ethos_courtly } # Courtly - } - subtract = 0.15 - } - if = { - limit = { - culture = { has_cultural_tradition = tradition_legalistic } # Legalistic - } - subtract = 0.3 - } - if = { - limit = { - dynasty = { has_dynasty_perk = law_legacy_2 } # Faithful Magistrates - } - subtract = 0.2 - } - min = 0.2 # 80% max discount from defines - } -} - -create_empire_title_value = { - add = 1200 - multiply = { - value = 1 - #Legitimacy discounts - if = { - limit = { legitimacy_level = 5 } - subtract = 0.35 - } - if = { - limit = { legitimacy_level = 4 } - subtract = 0.25 - } - if = { - limit = { legitimacy_level = 3 } - subtract = 0.2 - } - if = { - limit = { legitimacy_level = 2 } - subtract = 0.15 - } - if = { - limit = { has_perk = ducal_conquest_perk } # Ducal Conquest - subtract = 0.2 - } - if = { - limit = { - culture = { has_innovation = innovation_divine_right } # Divine Right - } - subtract = 0.2 - } - if = { - limit = { government_has_flag = government_is_tribal } # Tribal - subtract = 0.5 - } - if = { - limit = { government_has_flag = government_is_nomadic } # Nomads - subtract = 0.5 - } - if = { - limit = { - rite = { rite_has_tenet = tenet_pursuit_of_power } # Pursuit of Power - } - subtract = 0.5 - } - if = { - limit = { - culture = { has_cultural_pillar = ethos_courtly } # Courtly - } - subtract = 0.15 - } - if = { - limit = { - culture = { has_cultural_tradition = tradition_legalistic } # Legalistic - } - subtract = 0.3 - } - if = { - limit = { - dynasty = { has_dynasty_perk = law_legacy_2 } # Faithful Magistrates - } - subtract = 0.2 - } - min = 0.2 # 80% max discount from defines - } -} - -create_hegemony_title_value = { - add = 2400 - multiply = { - value = 1 - #Legitimacy discounts - if = { - limit = { legitimacy_level = 5 } - subtract = 0.35 - } - if = { - limit = { legitimacy_level = 4 } - subtract = 0.25 - } - if = { - limit = { legitimacy_level = 3 } - subtract = 0.2 - } - if = { - limit = { legitimacy_level = 2 } - subtract = 0.15 - } - if = { - limit = { has_perk = ducal_conquest_perk } # Ducal Conquest - subtract = 0.2 - } - if = { - limit = { - culture = { has_innovation = innovation_divine_right } # Divine Right - } - subtract = 0.2 - } - if = { - limit = { government_has_flag = government_is_tribal } # Tribal - subtract = 0.5 - } - if = { - limit = { - rite = { rite_has_tenet = tenet_pursuit_of_power } # Pursuit of Power - } - subtract = 0.5 - } - if = { - limit = { - culture = { has_cultural_pillar = ethos_courtly } # Courtly - } - subtract = 0.15 - } - if = { - limit = { - culture = { has_cultural_tradition = tradition_legalistic } # Legalistic - } - subtract = 0.3 - } - if = { - limit = { - dynasty = { has_dynasty_perk = law_legacy_2 } # Faithful Magistrates - } - subtract = 0.2 - } - min = 0.2 # 80% max discount from defines - } -} - - -#DUEL -duel_skill_multiplier_base = { #How many more skill points an extremely skilled character has than the averagely skilled character - add = extremely_high_skill_rating - subtract = medium_skill_rating -} - -#When used in a duel_value compare modifier, where the duel character has extremely good skill and the target has avarage skill, these modifiers will add... - -#10 -tiny_positive_duel_skill_multiplier = { - add = 10 - divide = duel_skill_multiplier_base -} - -#25 -low_positive_duel_skill_multiplier = { - add = 25 - divide = duel_skill_multiplier_base -} - -#50 -medium_positive_duel_skill_multiplier = { - add = 50 - divide = duel_skill_multiplier_base -} - -#75 -high_positive_duel_skill_multiplier = { - add = 75 - divide = duel_skill_multiplier_base -} - -#10 -tiny_negative_duel_skill_multiplier = { - add = -10 - divide = duel_skill_multiplier_base -} - -#-25 -low_negative_duel_skill_multiplier = { - add = -25 - divide = duel_skill_multiplier_base -} - -#-50 -medium_negative_duel_skill_multiplier = { - add = -50 - divide = duel_skill_multiplier_base -} - -#-75 -high_negative_duel_skill_multiplier = { - add = -75 - divide = duel_skill_multiplier_base -} - - -# Referenced by code. Amount of gold gained by the winning side per 1000 men who died in battle (hard casualties) -# Root is the winner main participant -# scope:enemy_battle_owner is the main enemy participant -# scope:combat is the combat itself -battle_winner_gold_gain = { - value = 0 - - if = { # Cultural tradition - limit = { - culture = { - has_cultural_parameter = gain_gold_from_battles - } - } - add = 10 - } - - if = { # Bonus for legacy - limit = { - dynasty ?= { - has_dynasty_perk = fp1_pillage_legacy_4 - } - } - add = 50 - } - - if = { # Master of Spoils Camp Officer - limit = { - employs_court_position = master_of_spoils_camp_officer - } - add = { - value = court_position:master_of_spoils_camp_officer.aptitude:master_of_spoils_camp_officer - add = 1 - multiply = 10 - } - } -} - -# Referenced by code. Amount of prestige gained by the winning side per 1000 men who died in battle (hard casualties) -# Root is the winner main participant -# scope:enemy_battle_owner is the main enemy participant -# scope:combat is the combat itself -battle_winner_prestige_gain = { - value = 75 - - if = { # Bonus for tribals - limit = { - government_has_flag = government_is_tribal - } - add = 75 - } - - if = { # Leading the troops yourself adds a bit - limit = { - OR = { - scope:combat = { - combat_attacker = { - side_commander ?= { - this = root - } - } - } - scope:combat = { - combat_defender = { - side_commander ?= { - this = root - } - } - } - } - } - add = 40 - } - - if = { # Bonus for legacy - limit = { - dynasty ?= { - has_dynasty_perk = fp1_pillage_legacy_1 - } - } - multiply = 2 - } - - if = { # Cultural tradition - limit = { - culture = { - has_cultural_parameter = less_prestige_from_battles - } - } - multiply = 0.1 - } - - # Fighting Peasants Rebellion - if = { - limit = { - scope:enemy_battle_owner = { has_variable = rebel_leader_peasants } - } - multiply = 0.25 # to test - } - - if = { # Reduced for LAAMPs - limit = { - has_government = landless_adventurer_government - } - multiply = 0.75 - } - - if = { # Master of Spoils Camp Officer - limit = { - employs_court_position = master_of_spoils_camp_officer - } - add = { - value = court_position:master_of_spoils_camp_officer.aptitude:master_of_spoils_camp_officer - add = 1 - multiply = 10 - } - } - - if = { # BP3 - Kings of the Wilds Perk - limit = { - has_perk = personal_touch_perk - landless_inspector_king_of_the_wilds = yes - } - multiply = 1.5 - } -} - -# Referenced by code. Amount of piety gained by the winning side per 1000 men who died in battle (hard casualties) -# Root is the winner main participant -# scope:enemy_battle_owner is the main enemy participant -# scope:combat is the combat itself -battle_winner_piety_gain = { - value = 0 - if = { - limit = { - faith = { - faith_hostility_level = { - target = scope:enemy_battle_owner.faith - value >= religious_cb_enabled_hostility_level - } - } - } - value = 35 - - if = { # Bonus for tribals - limit = { - government_has_flag = government_is_tribal - } - add = 50 - } - - if = { # Leading the troops yourself adds a bit - limit = { - OR = { - scope:combat = { - combat_attacker = { - side_commander ?= { - this = root - } - } - } - scope:combat = { - combat_defender = { - side_commander ?= { - this = root - } - } - } - } - } - add = 20 - } - - if = { # Master of Spoils Camp Officer - limit = { - employs_court_position = master_of_spoils_camp_officer - } - add = { - value = court_position:master_of_spoils_camp_officer.aptitude:master_of_spoils_camp_officer - add = 1 - multiply = 10 - } - } - } - - # Fighting Peasants Rebellion - if = { - limit = { - scope:enemy_battle_owner = { has_variable = rebel_leader_peasants } - } - multiply = 0.25 # to test - } - - if = { # Reduced for LAAMPs - limit = { - has_government = landless_adventurer_government - } - multiply = 0.75 - } -} - -# Referenced by code. Chance 0-100 that a randomly created ruler will be female -# Root is the new liege or previous holder of the title -random_ruler_chance_for_female = { - value = 0 - faith ?= { - if = { - limit = { has_dominant_ruling_gender = dummy_female } # if faith allows females to rule, then add 50% chance - add = 50 - } - if = { - limit = { NOT = { has_dominant_ruling_gender = dummy_male } } # if faith forbids males to rule, then add 50% chance - add = 50 - } - } -} - -# Referenced by code. Chance 0-100 that a randomly created ruler for a temple will be female -# Root is the new liege or previous holder of the title -random_theocratic_ruler_chance_for_female = { - value = 0 - rite ?= { - if = { - limit = { rite_has_doctrine = doctrine_clerical_gender_female_only } - add = 100 - } - if = { - limit = { rite_has_doctrine = doctrine_clerical_gender_male_only } - add = 0 - } - if = { - limit = { rite_has_doctrine = doctrine_clerical_gender_either } - add = 50 - } - } -} - -age_compared_to_root_plus_ten = { - add = age - subtract = root.age - add = 10 -} - -age_compared_to_root_minus_ten = { - add = age - subtract = root.age - subtract = 10 -} - -age_compared_to_root_plus_ten_always_adult = { - add = age - subtract = root.age - add = 10 - if = { - limit = { - is_male = yes - } - min = define:NCharacter|MALE_ADULT_AGE - } - if = { - limit = { - is_female = yes - } - min = define:NCharacter|FEMALE_ADULT_AGE - } -} - -age_compared_to_root_minus_ten_always_adult = { - add = age - subtract = root.age - subtract = 10 - if = { - limit = { - is_male = yes - } - min = define:NCharacter|MALE_ADULT_AGE - } - if = { - limit = { - is_female = yes - } - min = define:NCharacter|FEMALE_ADULT_AGE - } -} - - -#EXAMPLES -example_total_family_age = { - add = age - add = father.age - add = mother.age - modulo = 10 -} - -example_fancy_gold = { - add = gold - multiply = 3 - divide = 2 - subtract = 500 - max = 2500 - min = 1000 -} - -example_age_based_gold = { - add = 1000 - if = { - limit = { age > 30 } - divide = 2 - } - else_if = { - limit = { age < 20 } - divide = 4 - } - else = { - divide = 8 - } -} - -genetic_character_value = { - value = 0 - #BEAUTY - if = { - limit = { has_trait = beauty_bad_1 } - add = -1 - } - if = { - limit = { has_trait = beauty_bad_2 } - add = -2 - } - if = { - limit = { has_trait = beauty_bad_3 } - add = -3 - } - if = { - limit = { has_trait = beauty_good_1 } - add = 1 - } - if = { - limit = { has_trait = beauty_good_2 } - add = 2 - } - if = { - limit = { has_trait = beauty_good_3 } - add = 3 - } - #INTELLECT - if = { - limit = { has_trait = intellect_bad_1 } - add = -1 - } - if = { - limit = { has_trait = intellect_bad_2 } - add = -2 - } - if = { - limit = { has_trait = intellect_bad_3 } - add = -3 - } - if = { - limit = { has_trait = intellect_good_1 } - add = 1 - } - if = { - limit = { has_trait = intellect_good_2 } - add = 2 - } - if = { - limit = { has_trait = intellect_good_3 } - add = 3 - } - #PHYSIQUE - if = { - limit = { has_trait = physique_bad_1 } - add = -1 - } - if = { - limit = { has_trait = physique_bad_2 } - add = -2 - } - if = { - limit = { has_trait = physique_bad_3 } - add = -3 - } - if = { - limit = { has_trait = physique_good_1 } - add = 1 - } - if = { - limit = { has_trait = physique_good_2 } - add = 2 - } - if = { - limit = { has_trait = physique_good_3 } - add = 3 - } - #MISC GOOD GENETIC - if = { - limit = { has_trait = fecund } - add = 1 - } - #MISC BAD GENETIC - if = { - limit = { has_trait = clubfooted } - add = -1 - } - if = { - limit = { has_trait = hunchbacked } - add = -1 - } - if = { - limit = { has_trait = lisping } - add = -1 - } - if = { - limit = { has_trait = stuttering } - add = -1 - } - if = { - limit = { has_trait = giant } - add = -1 - } - if = { - limit = { has_trait = inbred } - add = -3 - } - if = { - limit = { has_trait = spindly } - add = -1 - } - if = { - limit = { has_trait = scaly } - add = -1 - } - if = { - limit = { has_trait = albino } - add = -1 - } - if = { - limit = { has_trait = wheezing } - add = -1 - } - if = { - limit = { has_trait = bleeder } - add = -1 - } - if = { - limit = { has_trait = infertile } - add = -1 - } - if = { - limit = { has_trait = depressed_genetic } - add = -1 - } - if = { - limit = { has_trait = lunatic_genetic } - add = -1 - } - if = { - limit = { has_trait = possessed_genetic } - add = -1 - } -} - -individual_recruit_guest_interaction_cost = { - add = 15 - - ###CLAIMS### - if = { - limit = { - save_temporary_scope_as = claim_holder - any_claim = { - courtier_or_guest_claim_trigger = { RULER = scope:claim_holder.host } - } - } - if = { - limit = { - save_temporary_scope_as = claim_holder - any_claim = { - courtier_or_guest_claim_trigger = { RULER = scope:claim_holder.host } - tier >= tier_duchy - } - } - add = 50 - } - else_if = { - limit = { - save_temporary_scope_as = claim_holder - any_claim = { - courtier_or_guest_claim_trigger = { RULER = scope:claim_holder.host } - tier = tier_county - } - } - add = 25 - } - } - - ###DYNASTY### - if = { - limit = { exists = dynasty } - add = { - value = dynasty.dynasty_prestige_level #0-10 - multiply = 5 #Max 50 - } - } - - ###GENETIC TRAITS### - add = { - value = genetic_character_value - multiply = 3 - min = -15 - max = 15 - } - - ###COMMANDER TRAITS### - if = { - limit = { number_of_commander_traits >= 1 } - add = { - value = number_of_commander_traits - multiply = 5 - min = 0 - } - - } - - ###COURT PHYSICIAN TRAITS### - if = { - limit = { - OR = { - AND = { - has_trait = lifestyle_physician - has_trait_xp = { - trait = lifestyle_physician - value >= 100 - } - } - AND = { - has_trait = lifestyle_mystic - has_trait_xp = { - trait = lifestyle_mystic - value >= 100 - } - } - } - } - add = 20 - } - else_if = { - limit = { - OR = { - has_trait = lifestyle_herbalist - AND = { - has_trait = lifestyle_physician - has_trait_xp = { - trait = lifestyle_physician - value >= 50 - } - } - AND = { - has_trait = lifestyle_mystic - has_trait_xp = { - trait = lifestyle_mystic - value >= 50 - } - } - } - } - add = 15 - } - else_if = { - limit = { - OR = { - has_trait = lifestyle_physician - has_trait = lifestyle_mystic - } - } - add = 10 - } - - ###SKILLS### - if = { - limit = { diplomacy >= good_skill_level } - add = 5 - } - if = { - limit = { martial >= good_skill_level } - add = 5 - } - if = { - limit = { stewardship >= good_skill_level } - add = 5 - } - if = { - limit = { intrigue >= good_skill_level } - add = 5 - } - if = { - limit = { learning >= good_skill_level } - add = 5 - } - if = { - limit = { prowess >= good_skill_level } - add = 5 - } - - ###PERSONALITY MULTIPLIER### - if = { - limit = { - OR = { - ai_greed >= high_positive_ai_value - has_trait = arrogant - } - } - multiply = 1.2 - } - else_if = { - limit = { - OR = { - ai_greed <= high_negative_ai_value - has_trait = humble - } - } - multiply = 0.8 - } - - ###AMENITIES MULTIPLIER### - if = { - limit = { - host = { - has_royal_court = yes - has_dlc_feature = royal_court - court_owner = { - amenity_level = { target = court_servants value = medium_amenity_level } - } - } - } - multiply = 0.8 - } - else_if = { - limit = { - host = { - has_royal_court = yes - has_dlc_feature = royal_court - court_owner = { - amenity_level = { target = court_servants value = high_amenity_level } - } - } - } - multiply = 0.7 - } - else_if = { - limit = { - host = { - has_royal_court = yes - has_dlc_feature = royal_court - court_owner = { - amenity_level = { target = court_servants value = very_high_amenity_level } - } - } - } - multiply = 0.6 - } - else_if = { - limit = { - host = { - has_royal_court = yes - has_dlc_feature = royal_court - court_owner = { - amenity_level = { target = court_servants value = max_amenity_level } - } - } - } - multiply = 0.5 - } - - min = 10 - - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 - - if = { # Cultural Traditions - limit = { - host = { - culture = { - has_cultural_parameter = cheaper_guest_recruitment - } - } - } - multiply = 0.8 - min = 8 - } - - if = { # Dynasty legacy - limit = { - host = { - dynasty ?= { - has_dynasty_perk = erudition_legacy_1 - } - } - } - multiply = 0.7 - min = 7 - } - - if = { # Japanese Manor upgrade - limit = { - host = { - domicile ?= { has_domicile_parameter = japanese_manor_recruit_guest_discount } - } - } - multiply = 0.7 - min = 7 - } - - if = { # Tribal rulers pay less - limit = { - host = { - government_has_flag = government_is_tribal - } - } - multiply = 0.5 - min = 10 - } -} - -recruit_guest_interaction_cost = { - value = 0 - every_traveling_family_member = { - add = individual_recruit_guest_interaction_cost - } -} -recruit_guest_interaction_cost_with_list = { - value = 0 - every_in_list = { - list = recruiting_family - add = individual_recruit_guest_interaction_cost - } - if = { - limit = { - scope:actor = { - is_ai = yes - } - OR = { - has_game_rule = hard_difficulty - has_game_rule = very_hard_difficulty - } - } - multiply = 0 - } - if = { - limit = { - scope:actor.culture = { - has_cultural_parameter = frugal_blacksmith_cheaper_recruit_to_court - } - } - multiply = 0.5 - } -} - -root_attraction_based_female_chance = { - if = { - limit = { - root = { - is_attracted_to_women = yes - is_attracted_to_men = no - } - } - add = 100 - } - else_if = { - limit = { - root = { - is_attracted_to_women = yes - is_attracted_to_men = yes - } - } - add = 50 - } - else = { - add = 0 - } -} - -scope_attraction_based_female_chance = { - if = { - limit = { - scope:attraction_check = { - is_attracted_to_women = yes - is_attracted_to_men = no - } - } - add = 100 - } - else_if = { - limit = { - scope:attraction_check = { - is_attracted_to_women = yes - is_attracted_to_men = yes - } - } - add = 50 - } - else = { - add = 0 - } -} - -root_faith_clergy_gender_female_chance = { - if = { - limit = { - root.rite = { rite_has_parameter = clergy_must_be_male } - } - add = 0 - } - else_if = { - limit = { - root.rite = { rite_has_parameter = clergy_must_be_female } - } - add = 100 - } - else = { - add = 50 - } -} - -scope_actor_faith_clergy_gender_female_chance = { - if = { - limit = { - scope:actor.rite = { rite_has_parameter = clergy_must_be_male } - } - add = 0 - } - else_if = { - limit = { - scope:actor.rite = { rite_has_parameter = clergy_must_be_female } - } - add = 100 - } - else = { - add = 50 - } -} - -scope_monk_employer_faith_clergy_gender_female_chance = { - if = { - limit = { - scope:monk_employer.rite = { rite_has_parameter = clergy_must_be_male } - } - add = 0 - } - else_if = { - limit = { - scope:monk_employer.rite = { rite_has_parameter = clergy_must_be_female } - } - add = 100 - } - else = { - add = 50 - } -} - -scope_value_target_soldier_female_chance = { - if = { - limit = { - NOT = { - dummy_female = { - can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:value_target } - } - } - dummy_male = { - can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:value_target } - } - } - add = 0 - } - else_if = { - limit = { - dummy_female = { - can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:value_target } - } - NOT = { - dummy_male = { - can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:value_target } - } - } - } - add = 100 - } - else = { - add = 50 - } -} - -root_soldier_female_chance = { - if = { - limit = { - NOT = { dummy_female = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root } } } - dummy_male = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root } } - } - add = 0 - } - else_if = { - limit = { - dummy_female = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root } } - NOT = { dummy_male = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root } } } - } - add = 100 - } - else = { - add = 50 - } -} - -root_non_combatant_female_chance = { - if = { - limit = { - NOT = { dummy_female = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root } } } - dummy_male = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root } } - } - add = 100 - } - else_if = { - limit = { - dummy_female = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root } } - NOT = { dummy_male = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root } } } - } - add = 0 - } - else = { - add = 50 - } -} - -host_soldier_female_chance = { - if = { - limit = { - NOT = { dummy_female = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:host } } } - dummy_male = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:host } } - } - add = 0 - } - else_if = { - limit = { - dummy_female = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:host } } - NOT = { dummy_male = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:host } } } - } - add = 100 - } - else = { - add = 50 - } -} - -host_non_combatant_female_chance = { - if = { - limit = { - NOT = { dummy_female = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:host } } } - dummy_male = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:host } } - } - add = 100 - } - else_if = { - limit = { - dummy_female = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:host } } - NOT = { dummy_male = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:host } } } - } - add = 0 - } - else = { - add = 50 - } -} - -actor_soldier_female_chance = { - if = { - limit = { - NOT = { dummy_female = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:actor } } } - dummy_male = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:actor } } - } - add = 0 - } - else_if = { - limit = { - dummy_female = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:actor } } - NOT = { dummy_male = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:actor } } } - } - add = 100 - } - else = { - add = 50 - } -} - -recipient_soldier_female_chance = { - if = { - limit = { - NOT = { dummy_female = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:recipient } } } - dummy_male = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:recipient } } - } - add = 0 - } - else_if = { - limit = { - dummy_female = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:recipient } } - NOT = { dummy_male = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:recipient } } } - } - add = 100 - } - else = { - add = 50 - } -} - -root_faith_dominant_gender_female_chance = { - if = { - limit = { root.rite = { rite_has_doctrine = doctrine_gender_male_dominated } } - add = 0 - } - else_if = { - limit = { root.rite = { rite_has_doctrine = doctrine_gender_female_dominated } } - add = 100 - } - else = { - add = 50 - } -} - -activity_location_faith_dominant_gender_female_chance = { - if = { - limit = { scope:activity.activity_location.rite = { rite_has_doctrine = doctrine_gender_male_dominated } } - add = 0 - } - else_if = { - limit = { scope:activity.activity_location.rite = { rite_has_doctrine = doctrine_gender_female_dominated } } - add = 100 - } - else = { - add = 50 - } -} - -location_faith_dominant_gender_female_chance = { - if = { - limit = { location.rite = { rite_has_doctrine = doctrine_gender_male_dominated } } - add = 0 - } - else_if = { - limit = { location.rite = { rite_has_doctrine = doctrine_gender_female_dominated } } - add = 100 - } - else = { - add = 50 - } -} - -# Variant for landed_title scopes (e.g. county titles in faction outcome effects) -title_faith_dominant_gender_female_chance = { - if = { - limit = { rite = { rite_has_doctrine = doctrine_gender_male_dominated } } - add = 0 - } - else_if = { - limit = { rite = { rite_has_doctrine = doctrine_gender_female_dominated } } - add = 100 - } - else = { - add = 50 - } -} - -root_faith_dominant_gender_female_reversed_chance = { - if = { - limit = { root.rite = { rite_has_doctrine = doctrine_gender_male_dominated } } - add = 100 - } - else_if = { - limit = { root.rite = { rite_has_doctrine = doctrine_gender_female_dominated } } - add = 0 - } - else = { - add = 50 - } -} - -root_faith_dominant_gender_adjusted_female_chance = { - if = { - limit = { root.rite ?= { rite_has_doctrine = doctrine_gender_male_dominated } } - add = 20 - } - else_if = { - limit = { root.rite ?= { rite_has_doctrine = doctrine_gender_female_dominated } } - add = 80 - } - else = { - add = 50 - } -} - -root_self_based_female_chance = { - if = { - limit = { - root = { - is_female = yes - } - } - add = 100 - } - else = { - add = 0 - } -} - -root_self_based_reverse_female_chance = { - if = { - limit = { - root = { - is_male = yes - } - } - add = 100 - } - else = { - add = 0 - } -} - -marriage_gender_adjusted_female_chance = { - if = { - limit = { - allowed_to_marry_same_sex_trigger = yes - is_female = yes - is_attracted_to_women = yes - is_attracted_to_men = no - OR = { #Already have an heir of their dynasty or don't care - AND = { - exists = primary_heir - dynasty ?= primary_heir.dynasty - } - is_lowborn = yes - } - } - add = 100 - } - else_if = { - limit = { - allowed_to_marry_same_sex_trigger = yes - is_female = yes - is_attracted_to_women = yes - is_attracted_to_men = yes - OR = { #Already have an heir of their dynasty or don't care - AND = { - exists = primary_heir - dynasty ?= primary_heir.dynasty - } - is_lowborn = yes - } - } - add = 50 - } - else_if = { - limit = { - is_female = yes - } - add = 0 - } - else_if = { - limit = { - allowed_to_marry_same_sex_trigger = yes - is_male = yes - is_attracted_to_men = yes - is_attracted_to_women = no - OR = { #Already have an heir of their dynasty or don't care - AND = { - exists = primary_heir - dynasty ?= primary_heir.dynasty - } - is_lowborn = yes - } - } - add = 0 - } - else_if = { - limit = { - allowed_to_marry_same_sex_trigger = yes - is_male = yes - is_attracted_to_men = yes - is_attracted_to_women = yes - OR = { #Already have an heir of their dynasty or don't care - AND = { - exists = primary_heir - dynasty ?= primary_heir.dynasty - } - is_lowborn = yes - } - } - add = 50 - } - else = { - add = 100 - } -} - -root_sexuality_female_chance = { - if = { - limit = { - root = { - is_attracted_to_women = yes - is_attracted_to_men = no - } - } - add = 100 - } - else_if = { - limit = { - root = { - is_attracted_to_women = no - is_attracted_to_men = yes - } - } - add = 0 - } - else = { # Asexual/bi - add = 50 - } -} - -# Referenced by code when auto-assigning perks. Root is a character. Supports the use of randomization -num_perk_points = { - add = age - subtract = 16 - - divide = 3 - min = 0 - max = 20 -} - -stewardship_wealth_5002_investment_duration = 30 -stewardship_wealth_5002_good_tax_increase = 0.1 -stewardship_wealth_5002_great_tax_increase = 0.2 - -stewardship_wealth_5002_payment = { - value = capital_province.monthly_income - multiply = 12 - multiply = stewardship_wealth_5002_investment_duration - multiply = stewardship_wealth_5002_good_tax_increase #Now we're at the amount of extra tax you'd make - divide = 3 - - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 -} - -stewardship_wealth_5002_one_time_gain = { - value = stewardship_wealth_5002_payment - divide = 2 - - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 -} - -infidelity_event_delay = 3 - -half_monthly_character_income = { - value = monthly_character_income - multiply = 0.5 -} - -monthly_character_income_minus_expenses = { - value = monthly_character_income - subtract = monthly_character_expenses -} - -monthly_character_expenses_plus_fourty_percent = { - value = monthly_character_expenses - multiply = 1.4 -} - -monthly_character_expenses_times_three = { - value = monthly_character_expenses - multiply = 3 -} - -ai_war_chest_desired_gold_value = { - value = yearly_character_income - multiply = 3 - min = 100 - max = 2000 -} - -ai_inspiration_desired_gold_value = { - value = yearly_character_income - min = basic_fund_inspiration_cost - max = 2000 -} - -ai_war_chest_defender_holy_war_gold_value = { - value = yearly_character_income - multiply = 2 - min = 50 - max = 2000 -} - -steward_convert_culture_value = { - value = yearly_character_income - multiply = 3 - min = 100 -} - -steward_increase_development_value = { - value = yearly_character_income - multiply = 2 - min = 50 -} - -minimum_ai_gold_value_for_tyranny_wars = { - value = yearly_character_income - min = 10 -} - -comfortable_ai_gold_value_for_tyranny_wars = { - value = yearly_character_income - multiply = 3 - min = 25 -} - -minimum_ai_treasury_value_for_tyranny_wars = { - value = year_character_treasury_variable_income - min = 10 -} - -comfortable_ai_treasury_value_for_tyranny_wars = { - value = year_character_treasury_variable_income - multiply = 3 - min = 25 -} - -uncomfortable_ai_bancruptcy_for_wars = { - value = yearly_character_income - multiply = -2 -} - -very_uncomfortable_ai_bancruptcy_for_wars = { - value = yearly_character_income - multiply = -4 -} - -ai_economic_preference_value = { - value = 1 - if = { - limit = { - scope:holder.capital_province = this - free_building_slots <= 0 - } - add = 1 - } - if = { - limit = { - has_building_or_higher = tax_assessor_01 - free_building_slots <= 0 - } - add = 1 - } -} - -ai_piety_preference_value = { - value = 1 - if = { - limit = { - scope:holder = { - government_has_flag = government_is_mandala - capital_province = prev - } - free_building_slots <= 0 - } - add = 1 - } - if = { - limit = { - scope:holder = { - OR = { - AND = { - OR = { - is_tributary = yes - is_independent_ruler = no - } - overlord = { has_realm_law_flag = subjects_appear_more_pious } - } - has_realm_law_flag = subjects_appear_more_pious - } - } - free_building_slots <= 0 - } - add = 1 - } -} - -dislikes_maa_value = -9 -compensate_conflict_maa_bonus = 9 -likes_maa_value = 1 -stationed_maa_bonus = 3 -non_stationed_maa_bonus = -3 -really_likes_maa_value = 2 -stacking_bonus_value = 4 -anti_synergy_penalty_value = -9 - -fp2_2007_calculate_architect_competence = { # Intended for use with fp2_2007 in specific, not for general architects. - value = 0 - if = { limit = { culture = { has_cultural_parameter = architect_trait_prestige } } add = 15 } # Collapsed into one line for compactness - if = { limit = { has_trait = organizer } add = 2 } - if = { limit = { has_trait = logistician } add = 5 } - if = { limit = { has_trait = military_engineer } add = 15 } - if = { limit = { has_trait = strategist } add = 4 } - if = { limit = { has_trait = shrewd } add = 5 } - if = { limit = { has_trait = diligent } add = 5 } - if = { limit = { has_trait = temperate } add = 3 } - if = { limit = { has_trait = patient } add = 2 } - if = { limit = { has_trait = paranoid } add = 2 } - if = { limit = { has_trait = erudite } add = 1 } - if = { limit = { has_trait = architect } add = 12 } - if = { limit = { has_trait = content } subtract = 1 } - if = { limit = { has_trait = fickle } subtract = 5 } - if = { limit = { has_trait = arrogant } subtract = 10 } - if = { limit = { has_trait = lazy } subtract = 4 } - if = { limit = { has_trait = impatient } subtract = 5 } - if = { limit = { has_trait = greedy } subtract = 2 } - if = { limit = { has_trait = avaricious } subtract = 1 } - if = { limit = { has_trait = dull } subtract = 10 } -} - -activity_host_faith_dominant_gender_adjusted_female_chance = { - if = { - limit = { - scope:activity.activity_host.rite = { rite_has_doctrine = doctrine_gender_male_dominated } - } - add = 20 - } - else_if = { - limit = { - scope:activity.activity_host.rite = { rite_has_doctrine = doctrine_gender_female_dominated } - } - add = 80 - } - else = { add = 50 } -} - -activity_host_clergy_gender_female_chance = { - if = { - limit = { - scope:activity.activity_host.rite = { rite_has_parameter = clergy_must_be_male } - } - add = 0 - } - else_if = { - limit = { - scope:activity.activity_host.rite = { rite_has_parameter = clergy_must_be_female } - } - add = 100 - } - else = { add = 50 } -} - -five_times_monumental_value = { - add = monumental_gold_value - multiply = 5 -} diff --git a/common/script_values/02_religion_values.txt b/common/script_values/02_religion_values.txt index 59710eb4e..4e3f008ee 100644 --- a/common/script_values/02_religion_values.txt +++ b/common/script_values/02_religion_values.txt @@ -3204,8 +3204,6 @@ great_holy_war_target_kingdom_weight = { limit = { # Belongs to an Islamic religion. scope:the_faith.religion = religion:islam_religion - # Not the Qarmatians. Since they weren't exactly fans of the Holy Cities. - NOT = { scope:the_faith = faith:qarmatian } # Definitely actually considers at least Mecca or Medina holy. OR = { title:c_mecca = { diff --git a/common/script_values/06_ce1_legends_values.txt b/common/script_values/06_ce1_legends_values.txt deleted file mode 100644 index 4e840397e..000000000 --- a/common/script_values/06_ce1_legends_values.txt +++ /dev/null @@ -1,1547 +0,0 @@ -###################### -# Legends -###################### - -#### SPREAD CHANCE ### -# Chance for an legend of this quality to spread to an adjacent province per month -# % from 0-100 inclusive -# root = potential province -# scope:legend = the legend - -### CONTROL VALUES ### -# These should be enough to change the balance of legends - -# legend seed drop chance - -legend_seed_chance_very_low = 5 -legend_seed_chance_low = 15 -legend_seed_chance_medium = 40 -legend_seed_chance_high = 75 - -# Spread - -legend_spread_chance_base = 0.5 - -legend_spread_increase_add_miniscule = 0.06 -legend_spread_increase_add_very_low = 0.12 -legend_spread_increase_add_low = 0.25 -legend_spread_increase_add_medium = 0.5 -legend_spread_increase_add_high = 1 -legend_spread_increase_add_very_high = 1.5 - -legend_spread_decrease_add_very_low = -0.12 -legend_spread_decrease_add_low = -0.25 -legend_spread_decrease_add_medium = -0.5 -legend_spread_decrease_add_high = -1 - -legend_spread_increase_mult_low = 0.25 -legend_spread_increase_mult_medium = 0.75 -legend_spread_increase_mult_high = 1.5 - -legend_spread_decrease_mult_low = -0.15 -legend_spread_decrease_mult_medium = -0.25 -legend_spread_decrease_mult_high = -0.5 -legend_spread_decrease_mult_unlikely = -0.99 - - - -spread_chance_legends_default_value = { - value = legend_spread_chance_base - - scope:legend = { - if = { - limit = { - legend_quality = illustrious - } - add = legend_spread_increase_add_low - } - else_if = { - limit = { - legend_quality = mythical - } - add = legend_spread_increase_add_medium - } - - #prestige levels - legend_owner = { - if = { - limit = { - prestige_level > 4 - } - add = legend_spread_increase_add_low - } - else_if = { - limit = { - prestige_level > 3 - } - add = legend_spread_increase_add_very_low - } - } - } - - #Buildings in which people gossip - if = { - limit = { - has_building_or_higher = common_tradeport_07 - } - add = legend_spread_increase_add_low - add = legend_spread_increase_add_low - add = legend_spread_increase_add_very_low - add = legend_spread_increase_add_miniscule - } - else_if = { - limit = { - has_building_or_higher = common_tradeport_05 - } - add = legend_spread_increase_add_low - add = legend_spread_increase_add_very_low - add = legend_spread_increase_add_miniscule - } - else_if = { - limit = { - has_building_or_higher = common_tradeport_03 - } - add = legend_spread_increase_add_very_low - add = legend_spread_increase_add_miniscule - } - else_if = { - limit = { - has_building_or_higher = common_tradeport_01 - } - add = legend_spread_increase_add_miniscule - } - - if = { - limit = { - has_building_or_higher = city_03 - } - add = legend_spread_increase_add_low - add = legend_spread_increase_add_miniscule - } - else_if = { - limit = { - has_building_or_higher = city_02 - } - add = legend_spread_increase_add_miniscule - } - - # This can be else_if because market villages and cities are exclusive and cannot be in the same province - else_if = { - limit = { - has_building_or_higher = market_villages_02 - } - add = legend_spread_increase_add_low - add = legend_spread_increase_add_miniscule - } - else_if = { - limit = { - has_building_or_higher = market_villages_01 - } - add = legend_spread_increase_add_miniscule - } - - # Legend type bonuses - - if = { - limit = { - has_building_or_higher = warrior_lodges_05 - scope:legend.legend_type = legend_type:heroic - } - add = legend_spread_increase_add_low - add = legend_spread_increase_add_low - } - else_if = { - limit = { - has_building_or_higher = warrior_lodges_03 - scope:legend.legend_type = legend_type:heroic - } - add = legend_spread_increase_add_low - } - - if = { - limit = { - faith = scope:legend.legend_owner.faith - scope:legend.legend_type = legend_type:holy - } - add = legend_spread_increase_add_very_low - } - else_if = { - limit = { - scope:legend.legend_type = legend_type:holy - faith = { - faith_hostility_level = { - target = scope:legend.legend_owner.faith - value >= faith_astray_level - } - } - } - add = legend_spread_decrease_add_medium - } - else_if = { - limit = { - scope:legend.legend_type = legend_type:holy - faith = { - faith_hostility_level = { - target = scope:legend.legend_owner.faith - value > faith_astray_level - } - } - } - add = legend_spread_decrease_add_high - } - - if = { - limit = { - scope:legend.legend_type = legend_type:legitimizing - county.holder = { - OR = { - dynasty = scope:legend.legend_owner.dynasty - top_liege.dynasty = scope:legend.legend_owner.dynasty - } - } - } - add = legend_spread_increase_add_very_low - } - else_if = { - limit = { - scope:legend.legend_type = legend_type:legitimizing - } - add = legend_spread_decrease_add_low - } - - - #Terrain - if = { - limit = { - OR = { - terrain = hills - terrain = drylands - terrain = forest - terrain = floodplains - terrain = wetlands - } - } - add = legend_spread_decrease_add_low - } - else_if = { - limit = { - OR = { - terrain = jungle - terrain = taiga - } - } - add = legend_spread_decrease_add_medium - } - else_if = { - limit = { - OR = { - terrain = desert - terrain = desert_mountains - terrain = mountains - } - } - add = legend_spread_decrease_add_high - } - #Island? - if = { - limit = { - geographical_region = divergence_island_regions - } - add = legend_spread_decrease_add_medium - } - - #Less patchy - if = { - limit = { - county = { - any_county_province = { - any_province_legend = { - this = scope:legend - } - } - } - } - add = legend_spread_increase_add_very_low - } - - - #Is this in your realm? - county.holder = { - if = { - limit = { this = scope:legend.legend_owner } - add = legend_spread_increase_add_very_high - } - else_if = { - limit = { promoted_legend ?= scope:legend } - add = legend_spread_increase_add_high - } - else_if = { - limit = { top_liege = scope:legend.legend_owner } - add = legend_spread_increase_add_medium - } - else_if = { - limit = { top_liege.promoted_legend ?= scope:legend } - add = legend_spread_increase_add_low - } - else = { - add = legend_spread_decrease_add_low - } - - #County holder opinion of legend owner - if = { - limit = { - has_any_moderate_good_relationship_with_character_trigger = { CHARACTER = scope:legend.legend_owner } - } - add = legend_spread_increase_add_medium - } - else_if = { - limit = { - has_relation_rival = scope:legend.legend_owner - } - add = legend_spread_decrease_add_high - } - else = { - add = legend_spread_decrease_add_low - } - } - - #Languages - - if = { - limit = { - culture = { has_same_culture_language = scope:legend.legend_owner.culture } - } - add = legend_spread_increase_add_low - } - else_if = { - limit = { - county.holder = { knows_language_of_culture = scope:legend.legend_owner.culture } - } - add = legend_spread_increase_add_very_low - } - else_if = { - limit = { - scope:legend.legend_owner = { - has_royal_court = yes - has_dlc_feature = royal_court - } - county.holder = { knows_court_language_of = scope:legend.legend_owner } - } - add = legend_spread_increase_add_very_low - } - else_if = { - limit = { - culture = { has_same_culture_heritage = scope:legend.legend_owner.culture } - } - add = legend_spread_increase_add_miniscule - } - else_if = { - limit = { - scope:legend.legend_owner = { - has_royal_court = yes - has_dlc_feature = royal_court - } - OR = { - county.holder.top_liege = { - has_royal_court = yes - has_same_court_language = scope:legend.legend_owner - } - county.holder = { - has_royal_court = yes - has_same_court_language = scope:legend.legend_owner - } - } - } - add = legend_spread_decrease_add_very_low - } - else_if = { - limit = { - culture = { - cultural_acceptance = { target = scope:legend.legend_owner.culture value > 40 } - } - } - add = legend_spread_decrease_add_low - } - else_if = { - limit = { - culture = { - cultural_acceptance = { target = scope:legend.legend_owner.culture value > 20 } - } - } - add = legend_spread_decrease_add_medium - } - - else = { - add = legend_spread_decrease_add_high - } - - #Coastal Statistics Squash - if = { - limit = { - OR = { - is_coastal = yes - is_riverside_province = yes - } - NOR = { - county = { - any_county_province = { - any_province_legend = { - this = scope:legend - } - } - } - culture = { has_same_culture_language = scope:legend.legend_owner.culture } - } - } - add = legend_spread_decrease_add_high - } -} - -spread_chance_legends_mult_value = { - #NO ADD AFTER THIS POINT - #NO ADD ONLY MULT - value = 1 - min = 0.001 - - #Coastal Statistics Squash - if = { - limit = { - OR = { - is_coastal = yes - is_riverside_province = yes - } - NOR = { - county = { - any_county_province = { - any_province_legend = { - this = scope:legend - } - } - } - } - } - add = legend_spread_decrease_mult_high - } - - county = { - #Is this in your realm? - holder = { - if = { - limit = { - this = scope:legend.legend_owner - } - add = legend_spread_increase_mult_medium - } - else_if = { - limit = { - OR = { - top_liege = scope:legend.legend_owner - promoted_legend ?= scope:legend - top_liege.promoted_legend ?= scope:legend - } - } - add = legend_spread_increase_mult_low - } - else = { - add = legend_spread_decrease_mult_medium - } - - #County holder and top liege opinion of legend owner - if = { - limit = { #slight mult increase for owner and promoter domain - OR = { - this = scope:legend.legend_owner - promoted_legend ?= scope:legend - } - } - add = legend_spread_increase_mult_medium - } - else_if = { - limit = { - OR = { - has_any_moderate_good_relationship_with_character_trigger = { CHARACTER = scope:legend.legend_owner } - top_liege = { has_any_moderate_good_relationship_with_character_trigger = { CHARACTER = scope:legend.legend_owner } } - } - } - add = legend_spread_increase_mult_low - } - else_if = { - limit = { - OR = { - has_relation_rival = scope:legend.legend_owner - top_liege = { has_relation_rival = scope:legend.legend_owner } - } - } - add = legend_spread_decrease_mult_high - } - else = { - add = legend_spread_decrease_mult_low - } - } - - #Cultural Traditions - culture = { - if = { - limit = { - OR = { - has_cultural_tradition = tradition_chanson_de_geste - has_cultural_tradition = tradition_fp1_northern_stories - has_cultural_tradition = tradition_storytellers - has_cultural_tradition = tradition_poetry - } - } - add = legend_spread_increase_mult_medium - } - else_if = { - limit = { - OR = { - has_cultural_tradition = tradition_esteemed_hospitality - has_cultural_tradition = tradition_horse_lords - has_cultural_tradition = tradition_caravaneers - has_cultural_tradition = tradition_seafaring - has_cultural_tradition = tradition_city_keepers - has_cultural_tradition = tradition_maritime_mercantilism - } - } - add = legend_spread_increase_mult_low - } - else_if = { - limit = { - OR = { - has_cultural_tradition = tradition_practiced_pirates - has_cultural_tradition = tradition_parochialism - } - } - add = legend_spread_increase_mult_low - } - } - - #Development - if = { - limit = { - development_level >= good_development_level - } - add = legend_spread_decrease_mult_medium - } - else_if = { - limit = { - development_level >= medium_development_level - } - add = legend_spread_decrease_mult_low - } - } - - # Game rules - if = { - limit = { - has_game_rule = legend_spread_chance_high - } - add = legend_spread_increase_mult_low - } - else_if = { - limit = { - has_game_rule = legend_spread_chance_very_high - } - add = legend_spread_increase_mult_medium - } - else_if = { - limit = { - has_game_rule = legend_spread_chance_low - } - add = legend_spread_decrease_mult_low - } - else_if = { - limit = { - has_game_rule = legend_spread_chance_very_low - } - add = legend_spread_decrease_mult_medium - } -} - -### GOLD COSTS ### - -legend_base_cost_value = { - value = 200 -} - -legend_base_cost = { - value = legend_base_cost_value - #Scale by tier - multiply = { - value = root.primary_title.tier - subtract = 1 - multiply = 0.5 - min = 1 - } - if = { - limit = { - root = { - government_has_flag = government_is_tribal - } - } - multiply = 0.8 - } - #Scale by era - add = { - value = legend_base_cost_value - multiply = legend_cost_scale_by_era - subtract = legend_base_cost_value - desc = legend_cost_scale_by_era_desc - } - #Legends Dynasty Track discounts - add = legend_cost_dynasty_discounts - - # Game rules - if = { - limit = { - has_game_rule = legend_cost_high - } - multiply = 2 - } - else_if = { - limit = { - has_game_rule = legend_cost_very_high - } - multiply = 4 - } - else_if = { - limit = { - has_game_rule = legend_cost_low - } - divide = 2 - } - else_if = { - limit = { - has_game_rule = legend_cost_very_low - } - divide = 4 - } -} - -legend_cost_scale_by_era = { - value = 0 - if = { - limit = { - exists = culture - } - culture ?= { - if = { - limit = { - has_cultural_era_or_later = culture_era_late_medieval - } - add = 1.6 - } - else_if = { - limit = { - has_cultural_era_or_later = culture_era_high_medieval - } - add = 1.4 - } - else_if = { - limit = { - has_cultural_era_or_later = culture_era_early_medieval - } - add = 1.2 - } - else = { - add = 1 - } - } - } -} - -legend_cost_dynasty_discounts = { - if = { - limit = { - dynasty ?= { - ce1_heroic_track_perks >= 4 - } - } - multiply = 0.75 - } - else_if = { - limit = { - dynasty ?= { - ce1_heroic_track_perks >= 3 - } - } - multiply = 0.85 - } -} - -legend_upgrade_cost = { - value = legend_base_cost #includes scaling by era, tier and game rules - multiply = 0.8 - if = { - limit = { - promoted_legend ?= { has_variable = legend_quality_progress } - } - subtract = { - #Legend costs until now - value = legend_base_cost - multiply = 0.6 - #We give you 50% discount max based on your progress - multiply = { - value = promoted_legend.var:legend_quality_progress - divide = 200 - } - } - } -} - -legend_era_cost = { - value = monthly_character_income - multiply = legend_cost_scale_by_era - subtract = monthly_character_income - desc = legend_cost_scale_by_era_desc -} - -legend_game_rule_multiplier = { - value = 1 - - # Game rules - if = { - limit = { - has_game_rule = legend_cost_high - } - value = 2 - } - else_if = { - limit = { - has_game_rule = legend_cost_very_high - } - value = 4 - } - else_if = { - limit = { - has_game_rule = legend_cost_low - } - value = 0.5 - } - else_if = { - limit = { - has_game_rule = legend_cost_very_low - } - value = 0.25 - } -} - -famed_legend_owner_cost = { - value = monthly_character_income - multiply = 0.1 - min = 3 - add = 1 - multiply = legend_cost_scale_by_era - multiply = legend_game_rule_multiplier - max = 300 -} - -illustrious_legend_owner_cost = { - value = monthly_character_income - multiply = 0.15 - min = 4.5 - add = 2 - multiply = legend_cost_scale_by_era - multiply = legend_game_rule_multiplier - max = 450 -} - -mythical_legend_owner_cost = { - value = monthly_character_income - multiply = 0.25 - min = 8 - add = 4 - multiply = legend_cost_scale_by_era - multiply = legend_game_rule_multiplier - max = 800 -} - -# Promoter costs - -famed_legend_promoter_cost = { - value = monthly_character_income - multiply = 0.05 - add = 0.5 - multiply = legend_cost_scale_by_era - multiply = legend_game_rule_multiplier -} - -illustrious_legend_promoter_cost = { - value = monthly_character_income - multiply = 0.1 - add = 1 - multiply = legend_cost_scale_by_era - multiply = legend_game_rule_multiplier -} - -mythical_legend_promoter_cost = { - value = monthly_character_income - multiply = 0.2 - add = 1.5 - multiply = legend_cost_scale_by_era - multiply = legend_game_rule_multiplier -} - -# We want higher AI income than cost when starting promoting, so we do not toggle start/stop promoting too much, or spend all their income on it - -ai_famed_legend_promoter_start_required_income = { - value = famed_legend_promoter_cost - multiply = 1.4 -} - -ai_illustrious_legend_promoter_start_required_income = { - value = illustrious_legend_promoter_cost - multiply = 1.4 -} - -ai_mythical_legend_promoter_start_required_income = { - value = mythical_legend_promoter_cost - multiply = 1.4 -} - -### Prestige costs ### - -legend_prestige_cost = { - value = 200 - #Scale by tier - multiply = { - value = root.primary_title.tier - subtract = 1 - multiply = 0.5 - min = 1 - } - if = { - limit = { - root = { - government_has_flag = government_is_tribal - } - } - multiply = 0.8 - } - #Scale by era - add = { - value = legend_base_cost_value - multiply = legend_cost_scale_by_era - subtract = legend_base_cost_value - desc = legend_cost_scale_by_era_desc - } - - # Game rules - if = { - limit = { - has_game_rule = legend_cost_high - } - multiply = 2 - } - else_if = { - limit = { - has_game_rule = legend_cost_very_high - } - multiply = 4 - } - else_if = { - limit = { - has_game_rule = legend_cost_low - } - divide = 2 - } - else_if = { - limit = { - has_game_rule = legend_cost_very_low - } - divide = 4 - } -} - -### Piety costs ### - -legend_piety_cost = { - value = 200 - #Scale by tier - multiply = { - value = root.primary_title.tier - subtract = 1 - multiply = 0.5 - min = 1 - } - if = { - limit = { - root = { - government_has_flag = government_is_tribal - } - } - multiply = 0.8 - } - #Scale by era - add = { - value = legend_base_cost_value - multiply = legend_cost_scale_by_era - subtract = legend_base_cost_value - desc = legend_cost_scale_by_era_desc - } - - # Game rules - if = { - limit = { - has_game_rule = legend_cost_high - } - multiply = 2 - } - else_if = { - limit = { - has_game_rule = legend_cost_very_high - } - multiply = 4 - } - else_if = { - limit = { - has_game_rule = legend_cost_low - } - divide = 2 - } - else_if = { - limit = { - has_game_rule = legend_cost_very_low - } - divide = 4 - } -} - -### COURT POSITION TASKS ### - -monthly_court_position_task_cost_value = { - value = 0.05 -} - -monthly_court_position_task_cost = { - value = monthly_court_position_task_cost_value - scope:liege = { - #Scale by tier - multiply = { - value = primary_title.tier - subtract = 1 - min = 1 - } - # Performance-heavy, so we let the AI cheat very lightly here - if = { - limit = { - is_ai = no - } - #Scale by era - if = { - limit = { - scope:liege.culture ?= { has_cultural_era_or_later = culture_era_late_medieval } - } - multiply = { - value = 1.75 - desc = culture_era_late_medieval_salary_mod - format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE" - } - } - else_if = { - limit = { - scope:liege.culture ?= { has_cultural_era_or_later = culture_era_high_medieval } - } - multiply = { - value = 1.5 - desc = culture_era_high_medieval_salary_mod - format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE" - } - } - else_if = { - limit = { - scope:liege.culture ?= { has_cultural_era_or_later = culture_era_early_medieval } - } - multiply = { - value = 1.25 - desc = culture_era_early_medieval_salary_mod - format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE" - } - } - } - } - if = { - limit = { - OR = { - has_game_rule = hard_difficulty - has_game_rule = very_hard_difficulty - } - scope:liege = { - is_ai = yes - } - } - multiply = 0 - } -} - -monthly_court_position_task_cost_double = { - value = monthly_court_position_task_cost - multiply = 2 -} - -monthly_court_position_task_cost_triple = { - value = monthly_court_position_task_cost - multiply = 3 -} - -monthly_court_position_task_cost_quadruple = { - value = monthly_court_position_task_cost - multiply = 4 -} - -### DYNAMIC VALUES ### -legend_piety_gain = { - value = 0 - if = { - limit = { root = { legend_quality = famed } } - value = minor_piety_gain - } - else_if = { - limit = { root = { legend_quality = illustrious } } - value = medium_piety_gain - } - else = { #mythical - value = major_piety_gain - } -} - -legend_prestige_gain = { - value = 0 - if = { - limit = { root = { legend_quality = famed } } - value = minor_prestige_gain - } - else_if = { - limit = { root = { legend_quality = illustrious } } - value = medium_prestige_gain - } - else = { #mythical - value = major_prestige_gain - } -} - -legend_dynasty_prestige_gain = { - value = 0 - if = { - limit = { root = { legend_quality = famed } } - value = miniscule_dynasty_prestige_gain - } - else_if = { - limit = { root = { legend_quality = illustrious } } - value = minor_dynasty_prestige_gain - } - else = { #mythical - value = major_dynasty_prestige_gain - } -} - -major_legend_quality_increase = 50 -medium_legend_quality_increase = 20 -minor_legend_quality_increase = 10 -minor_legend_quality_decrease = { - value = 0 - subtract = minor_legend_quality_increase -} -medium_legend_quality_decrease = { - value = 0 - subtract = medium_legend_quality_increase -} -major_legend_quality_decrease = { - value = 0 - subtract = major_legend_quality_increase -} - -base_legend_create_ai = { - value = 10 - - add = { - value = ai_greed - multiply = -1 - } - - if = { - limit = { - highest_held_title_tier <= tier_duchy - } - add = -10 - } - - if = { - limit = { - monthly_character_income < mythical_legend_owner_cost - } - multiply = 0.2 - } - if = { - limit = { - monthly_character_income <= monthly_character_expenses - } - multiply = 0 - } - if = { - limit = { - has_trait = arrogant - } - multiply = 2 - } - if = { - limit = { - has_trait = ambitious - } - multiply = 2 - } - - #you need to be this rich to create legends - if = { - limit = { - OR = { - is_at_war = yes - monthly_character_income < illustrious_legend_owner_cost - } - } - value = 0 - } - if = { - limit = { - has_variable = conqueror - gold < 2500 - } - multiply = 0 - } - if = { - limit = { - ai_should_focus_on_building_in_their_capital = yes - } - multiply = 0 - } - if = { - limit = { - this != top_liege - } - multiply = 0 - } - if = { - limit = { - has_global_variable_list = active_legends_tally - global_variable_list_size = { - name = active_legends_tally - value >= 10 - } - } - multiply = 0 - add = -5000 - } -} - -heroic_legend_create_ai = { - value = base_legend_create_ai - add = ai_honor - if = { - limit = { - highest_held_title_tier <= tier_duchy - } - add = -150 - } - if = { - limit = { - ai_has_warlike_personality = yes - } - multiply = 2 - } - if = { - limit = { - ai_has_cautious_personality = yes - } - multiply = 0.1 - } - if = { - limit = { - ai_has_economical_boom_personality = yes - } - multiply = 0.75 - } - if = { - limit = { - has_variable = conqueror - gold < 2500 - } - multiply = 0 - } - if = { - limit = { - ai_should_focus_on_building_in_their_capital = yes - } - multiply = 0 - } -} - -holy_legend_create_ai = { - value = base_legend_create_ai - add = ai_zeal - if = { - limit = { - highest_held_title_tier <= tier_duchy - } - add = -150 - } - if = { - limit = { - ai_has_pious_builder_personality = yes - } - multiply = 1.3 - } - if = { - limit = { - ai_has_warlike_personality = yes - } - multiply = 1.1 - } - if = { - limit = { - ai_has_cautious_personality = yes - } - multiply = 0.9 - } - if = { - limit = { - ai_has_economical_boom_personality = yes - } - multiply = 0.75 - } - if = { - limit = { - has_variable = conqueror - gold < 2500 - } - multiply = 0 - } - if = { - limit = { - ai_should_focus_on_building_in_their_capital = yes - } - multiply = 0 - } -} - -legitimizing_legend_create_ai = { - value = base_legend_create_ai - add = ai_rationality - if = { - limit = { - highest_held_title_tier <= tier_duchy - } - add = -150 - } - if = { - limit = { - ai_has_warlike_personality = yes - } - multiply = 1.1 - } - if = { - limit = { - ai_has_cautious_personality = yes - } - multiply = 0.1 - } - if = { - limit = { - ai_has_economical_boom_personality = yes - } - multiply = 0.9 - } - if = { - limit = { - has_variable = conqueror - gold < 2500 - } - multiply = 0 - } - if = { - limit = { - ai_should_focus_on_building_in_their_capital = yes - } - multiply = 0 - } -} - -illustrious_legend_create_ai = { - add = 25 - if = { - limit = { - monthly_character_income < illustrious_legend_promoter_cost - } - value = 0 - } -} - -mythical_legend_create_ai = { - add = 50 - if = { - limit = { - monthly_character_income < mythical_legend_promoter_cost - } - value = 0 - } -} - - -base_legend_promote_ai = { - value = 0 - if = { - limit = { - has_any_best_good_relationship_with_character_trigger = { CHARACTER = scope:legend.legend_owner } - } - add = 20 - } - else_if = { - limit = { - has_any_moderate_good_relationship_with_character_trigger = { CHARACTER = scope:legend.legend_owner } - } - add = 8 - } - else_if = { - limit = { - likes_character_trigger = { CHARACTER = scope:legend.legend_owner } - } - add = 2 - } - if = { - limit = { - culture = { - OR = { - has_cultural_tradition = tradition_chanson_de_geste - has_cultural_tradition = tradition_fp1_northern_stories - has_cultural_tradition = tradition_storytellers - has_cultural_parameter = poet_trait_gives_bonuses - } - } - } - add = 2 - } - if = { # The protag is my relative - limit = { - is_close_or_extended_family_of = scope:legend.legend_owner - } - add = 2 - } - - if = { - limit = { - has_trait = arrogant # I want to create my own legend >:( - } - add = -4 - } - if = { - limit = { - has_trait = cynical - } - add = -4 - } - - if = { - limit = { - top_liege != this - } - add = -4 - } - - add = { - value = "opinion(scope:legend.legend_owner)" - multiply = 0.05 - } - - if = { - limit = { - any_character_to_title_neighboring_county = { - any_county_province = { - any_province_legend = { - this = scope:legend - } - } - } - } - add = 2 - } - else = { - add = -8 - } - - if = { #no free meals - limit = { - primary_title.tier = tier_hegemony - } - add = -32 - } - else_if = { - limit = { - primary_title.tier = tier_empire - } - add = -16 - } - else_if = { - limit = { - primary_title.tier = tier_kingdom - } - add = -8 - } - else_if = { #you need to be this tall to promote legends - limit = { - primary_title.tier < tier_duchy - } - value = 0 - } - - if = { - limit = { - scope:legend = { - legend_quality = illustrious - } - } - multiply = 1.2 - } - else_if = { - limit = { - scope:legend = { - legend_quality = mythical - } - } - multiply = 1.4 - } - - if = { - limit = { - OR = { - # War is no time for idle spending - is_at_war = yes - - # Opt out if we do not have enough income to promote this legend - # (only for legends we're not currently promoting - stopping the currently promoting legend is handled by code) - AND = { - NOT = { promoted_legend ?= scope:legend } - OR = { - AND = { - scope:legend = { - legend_quality = famed - } - monthly_character_income < ai_famed_legend_promoter_start_required_income - } - AND = { - scope:legend = { - legend_quality = illustrious - } - monthly_character_income < ai_illustrious_legend_promoter_start_required_income - } - AND = { - scope:legend = { - legend_quality = mythical - } - monthly_character_income < ai_mythical_legend_promoter_start_required_income - } - } - } - } - } - value = 0 - } - #to prevent AI switching promoters too often - if = { - limit = { - exists = promoted_legend - } - multiply = 0.4 - } - if = { - limit = { - has_variable = conqueror - gold < 2500 - } - multiply = 0 - } - if = { - limit = { - ai_should_focus_on_building_in_their_capital = yes - } - multiply = 0 - } -} - -base_legend_complete_ai = { - value = 0 - if = { # I cannot afford the current levels monthly cost anymore - limit = { - scope:can_afford_current_level = no - } - add = 100 - } - if = { # My legend is done - limit = { - scope:legend = { legend_quality = mythical } - } - add = 100 - } - if = { # This legend is going nowhere :( - limit = { - current_year >= { - value = scope:legend.legend_start_date - add = 100 - } - } - add = 10 - } - if = { - limit = { - current_year >= { - value = scope:legend.legend_start_date - add = 200 - } - } - add = 20 - } - if = { - limit = { - scope:legend = { - any_spread_province > { count = 350 } - } - } - add = 40 - } - if = { - limit = { - monthly_character_income <= monthly_character_expenses - debt_level = 2 #Is one year in debt. - } - add = 10 - } - else_if = { - limit = { - monthly_character_income <= monthly_character_expenses - debt_level > 2 # Is two years in debt. - } - add = 25 - } - if = { - limit = { - debt_level = 5 # Is four years in debt - } - add = 40 - } -} - -base_chronicler_promote_legend_realm_cost = { - value = 0 - if = { - limit = { - scope:liege ?= { - promoted_legend ?= { - legend_owner = scope:liege - } - } - } - add = scope:liege.famed_legend_owner_cost - } - else = { - add = scope:liege.famed_legend_promoter_cost - } - multiply = 0.8 -} diff --git a/common/script_values/99_court_chaplain_values.txt b/common/script_values/99_court_chaplain_values.txt index 4dd3b4259..c349c80e9 100644 --- a/common/script_values/99_court_chaplain_values.txt +++ b/common/script_values/99_court_chaplain_values.txt @@ -76,11 +76,7 @@ court_chaplain_religious_relations_consulted_house_bonus_modifier = { court_chaplain_religious_relations_cultural_tradition_bonus_modifier = { if = { limit = { - exists = scope:councillor_liege.culture - trigger_if = { - limit = { exists = scope:councillor_liege.culture } - scope:councillor_liege.culture ?= { has_cultural_parameter = religious_relations_is_empowered } - } + scope:councillor_liege.culture = { has_cultural_parameter = religious_relations_is_empowered } } add = court_chaplain_religious_relations_modifier multiply = 0.2 #When changing, adjust culture_parameter_religious_relations_is_empowered @@ -249,13 +245,13 @@ court_chaplain_religious_relations_no_hof_opinion_modifier = { add = 0 if = { limit = { - scope:councillor.faith ?= { + scope:councillor.faith = { OR = { has_doctrine_parameter = no_head_of_faith NOT = { exists = religious_head } } } - scope:councillor.rite ?= { rite_has_doctrine = doctrine_theocracy_lay_clergy } + scope:councillor.rite = { rite_has_doctrine = doctrine_theocracy_lay_clergy } } add = court_chaplain_religious_relations_opinion_modifier divide = court_chaplain_religious_relations_no_hof_balance @@ -629,7 +625,7 @@ court_chaplain_conversion_contextual_bonuses = { #Conversion modifiers from where the Faith is on the Pluralism spectrum. if = { limit = { - scope:councillor.rite ?= { + scope:councillor.rite = { rite_has_parameter = pluralism_fundamentalist_proselytization_bonus } } @@ -640,7 +636,7 @@ court_chaplain_conversion_contextual_bonuses = { } if = { limit = { - scope:councillor.rite ?= { + scope:councillor.rite = { rite_has_parameter = pluralism_pluralistic_proselytization_penalty } } @@ -655,13 +651,13 @@ court_chaplain_conversion_contextual_bonuses = { if = { limit = { exists = scope:county - scope:county.rite ?= { + scope:county.rite = { rite_has_parameter = sanctioned_false_conversion_county_resistance } } if = { limit = { - scope:county.rite ?= { rite_has_tenet = tenet_false_conversion_sanction } + scope:county.rite = { rite_has_tenet = tenet_false_conversion_sanction } } add = { value = scope:councillor.conversion_false_conversion_sanction_resistance @@ -670,7 +666,7 @@ court_chaplain_conversion_contextual_bonuses = { } else_if = { limit = { - scope:county.rite ?= { rite_has_tenet = tenet_pastoral_isolation } + scope:county.rite = { rite_has_tenet = tenet_pastoral_isolation } } add = { value = scope:councillor.conversion_pastoral_isolation_resistance @@ -688,13 +684,13 @@ court_chaplain_conversion_contextual_bonuses = { if = { limit = { exists = scope:county - scope:county.rite ?= { + scope:county.rite = { rite_has_parameter = reincarnation_resistance_to_conversion } } if = { limit = { - scope:county.rite ?= { rite_has_tenet = tenet_reincarnation } + scope:county.rite = { rite_has_tenet = tenet_reincarnation } } add = { value = scope:councillor.conversion_reincarnation_resistance @@ -712,7 +708,7 @@ court_chaplain_conversion_contextual_bonuses = { if = { limit = { exists = scope:county - scope:county.rite ?= { + scope:county.rite = { rite_has_parameter = tenet_adaptive_conversion_resistance } } @@ -723,7 +719,7 @@ court_chaplain_conversion_contextual_bonuses = { } if = { limit = { - scope:councillor.liege.rite ?= { rite_has_parameter = other_culture_conversion_penalty_active } + scope:councillor.liege.rite = { rite_has_parameter = other_culture_conversion_penalty_active } exists = scope:county scope:county.culture != scope:councillor.liege.culture } @@ -738,7 +734,7 @@ court_chaplain_conversion_contextual_bonuses = { ### Mendicant Preachers if = { limit = { - scope:councillor.rite ?= { + scope:councillor.rite = { rite_has_parameter = mendicant_preachers_conversion_active } } @@ -763,7 +759,7 @@ court_chaplain_conversion_contextual_bonuses = { if = { limit = { exists = scope:county - scope:councillor.rite ?= { + scope:councillor.rite = { rite_has_parameter = same_culture_conversion_bonus_active } scope:county.culture = scope:councillor.liege.culture @@ -777,7 +773,7 @@ court_chaplain_conversion_contextual_bonuses = { if = { limit = { exists = scope:county - scope:councillor.faith ?= { + scope:councillor.faith = { has_doctrine_parameter = ghw_no_hof_conversion_buffs_active OR = { has_doctrine_parameter = no_head_of_faith @@ -795,7 +791,7 @@ court_chaplain_conversion_contextual_bonuses = { if = { limit = { exists = scope:county - scope:councillor.rite ?= { rite_has_parameter = easier_to_convert_faith_in_mountains } + scope:councillor.rite = { rite_has_parameter = easier_to_convert_faith_in_mountains } scope:county = { # We check any province and not just title province, to be generous. county_has_province_with_terrain = { @@ -815,7 +811,7 @@ court_chaplain_conversion_contextual_bonuses = { limit = { exists = scope:county scope:county = { - rite ?= { rite_has_parameter = harder_to_convert_faith_away_in_mountains } + rite = { rite_has_parameter = harder_to_convert_faith_away_in_mountains } # We check any province and not just title province, to be generous. county_has_province_with_terrain = { terrain = mountains @@ -834,7 +830,7 @@ court_chaplain_conversion_contextual_bonuses = { limit = { exists = scope:county.faith scope:county.faith != scope:councillor.faith - scope:councillor.faith ?= { faith_is_syncretic_with = { FAITH = scope:county.faith } } + scope:councillor.faith = { faith_is_syncretic_with = { FAITH = scope:county.faith } } } add = { value = scope:councillor.conversion_syncretic_with_religion_malus @@ -892,7 +888,7 @@ court_chaplain_conversion_contextual_bonuses = { } religion = religion:germanic_religion } - scope:county.faith ?= { + scope:county.faith = { NOT = { has_doctrine_parameter = unreformed } } } @@ -948,7 +944,7 @@ court_chaplain_conversion_contextual_bonuses = { #Conversion bonuses from certain Holy Sites. if = { limit = { - scope:councillor.faith ?= { + scope:councillor.faith = { controls_holy_site_with_parameter = jerusalem_conversion_bonus } title:b_jerusalem = { @@ -962,7 +958,7 @@ court_chaplain_conversion_contextual_bonuses = { } if = { limit = { - scope:councillor.faith ?= { + scope:councillor.faith = { controls_holy_site_with_parameter = kerala_conversion_bonus } title:b_mahoyadapuram = { @@ -977,7 +973,7 @@ court_chaplain_conversion_contextual_bonuses = { if = { limit = { exists = scope:county - scope:councillor.faith ?= { + scope:councillor.faith = { controls_holy_site_with_parameter = iona_conversion_bonus } title:b_islay = { @@ -995,7 +991,7 @@ court_chaplain_conversion_contextual_bonuses = { if = { limit = { exists = scope:county - scope:county.faith ?= { + scope:county.faith = { controls_holy_site_with_parameter = wadi_el_milk_conversion_resistance_bonus } title:b_wadi_el-milk = { @@ -1009,7 +1005,7 @@ court_chaplain_conversion_contextual_bonuses = { } if = { limit = { - scope:councillor.faith ?= { + scope:councillor.faith = { controls_holy_site_with_parameter = cordoba_conversion_bonus } title:b_cordoba = { @@ -1038,7 +1034,7 @@ court_chaplain_conversion_contextual_bonuses = { if = { limit = { exists = scope:county - scope:county.faith ?= { + scope:county.faith = { controls_holy_site_with_parameter = visoki_conversion_resistance_bonus } title:b_visoki = { @@ -1055,7 +1051,7 @@ court_chaplain_conversion_contextual_bonuses = { if = { limit = { exists = scope:county - scope:county.culture ?= { + scope:county.culture = { has_cultural_parameter = more_easily_converted } } @@ -1067,7 +1063,7 @@ court_chaplain_conversion_contextual_bonuses = { if = { limit = { exists = scope:county - scope:county.culture ?= { + scope:county.culture = { has_cultural_parameter = harder_to_convert_county_faith } } @@ -1112,7 +1108,7 @@ court_chaplain_conversion_contextual_bonuses = { limit = { exists = global_var:fp3_struggle_ending global_var:fp3_struggle_ending = flag:fp3_struggle_shia_caliphate_ending - scope:councillor.rite ?= { + scope:councillor.rite = { rite_has_doctrine = muhammad_succession_shia_doctrine } } @@ -1125,7 +1121,7 @@ court_chaplain_conversion_contextual_bonuses = { limit = { exists = global_var:fp3_struggle_ending global_var:fp3_struggle_ending = flag:fp3_struggle_strengthen_caliphate_ending - scope:councillor.rite ?= { + scope:councillor.rite = { rite_has_doctrine = muhammad_succession_sunni_doctrine } } @@ -1236,7 +1232,7 @@ court_chaplain_conversion_contextual_bonuses = { # Faster conversion for certain special doctrines if = { limit = { - scope:councillor_liege.faith ?= { has_doctrine_parameter = adoptionists_attractively_intuitive_theology } + scope:councillor_liege.faith = { has_doctrine_parameter = adoptionists_attractively_intuitive_theology } exists = scope:county scope:county.faith.religion = religion:christianity_religion } @@ -1251,7 +1247,7 @@ court_chaplain_conversion_factors = { value = 1 if = { limit = { - scope:councillor.faith ?= { + scope:councillor.faith = { has_doctrine_parameter = unreformed } } @@ -1327,7 +1323,7 @@ court_chaplain_conversion_factors = { limit = { scope:councillor.liege = { has_character_modifier = fp2_council_conversion_modifier } scope:county.rite != rite:mozarabic_church - scope:county.faith ?= { + scope:county.faith = { religion = scope:councillor.liege.religion NOT = { exists = religious_head } } @@ -1345,7 +1341,7 @@ court_chaplain_conversion_factors = { has_character_modifier = fp3_promoted_persian_scripture_modifier is_ai = no #this is so that we don't get AI converting and homogenizing Persia too quickly } - scope:county.culture ?= { has_cultural_pillar = heritage_iranian } + scope:county.culture = { has_cultural_pillar = heritage_iranian } } multiply = { value = promote_persian_scripture_conversion_modifier_value @@ -1360,16 +1356,16 @@ court_chaplain_conversion_factors = { switch = { trigger = global_var:fp3_struggle_ending_assertion_school flag:sunni = { - scope:councillor.liege.rite ?= { rite_has_doctrine = muhammad_succession_sunni_doctrine } + scope:councillor.liege.rite = { rite_has_doctrine = muhammad_succession_sunni_doctrine } } flag:shia = { - scope:councillor.liege.rite ?= { rite_has_doctrine = muhammad_succession_shia_doctrine } + scope:councillor.liege.rite = { rite_has_doctrine = muhammad_succession_shia_doctrine } } flag:muhakkima = { - scope:councillor.liege.rite ?= { rite_has_doctrine = muhammad_succession_muhakkima_doctrine } + scope:councillor.liege.rite = { rite_has_doctrine = muhammad_succession_muhakkima_doctrine } } flag:zandaqa = { - scope:councillor.liege.rite ?= { rite_has_doctrine = muhammad_succession_zandaqa_doctrine } + scope:councillor.liege.rite = { rite_has_doctrine = muhammad_succession_zandaqa_doctrine } } } } @@ -1688,7 +1684,7 @@ court_chaplain_progress_percentage = { conversion_fundamentalist_faith_bonus = { if = { limit = { - scope:councillor.rite ?= { + scope:councillor.rite = { rite_has_parameter = pluralism_fundamentalist_proselytization_bonus } } @@ -1701,7 +1697,7 @@ conversion_pluralistic_faith_penalty = { value = 0 if = { limit = { - scope:councillor.rite ?= { + scope:councillor.rite = { rite_has_parameter = pluralism_pluralistic_proselytization_penalty } } @@ -1717,7 +1713,7 @@ conversion_false_conversion_sanction_resistance = { if = { limit = { exists = scope:county - scope:county.rite ?= { + scope:county.rite = { rite_has_parameter = sanctioned_false_conversion_county_resistance } } @@ -1731,7 +1727,7 @@ conversion_reincarnation_resistance = { if = { limit = { exists = scope:county - scope:county.rite ?= { + scope:county.rite = { rite_has_parameter = reincarnation_resistance_to_conversion } } @@ -1750,7 +1746,7 @@ conversion_adaptive_resistance = { if = { limit = { exists = scope:county - scope:county.rite ?= { + scope:county.rite = { rite_has_parameter = tenet_adaptive_conversion_resistance } } @@ -1764,7 +1760,7 @@ conversion_culture_harder_to_convert = { if = { limit = { exists = scope:county - scope:county.culture ?= { + scope:county.culture = { has_cultural_parameter = harder_to_convert_county_faith } } @@ -1778,7 +1774,7 @@ conversion_culture_more_easily_converted = { if = { limit = { exists = scope:county - scope:county.culture ?= { + scope:county.culture = { has_cultural_parameter = more_easily_converted } } @@ -1800,7 +1796,7 @@ conversion_communal_identity_resistance = { value = 0 if = { limit = { - scope:councillor.rite ?= { rite_has_parameter = other_culture_conversion_penalty_active } + scope:councillor.rite = { rite_has_parameter = other_culture_conversion_penalty_active } scope:county.culture != scope:councillor.liege.culture } subtract = court_chaplain_conversion_base_total @@ -1812,7 +1808,7 @@ conversion_mendicant_preachers_bonus = { value = 0 if = { limit = { - scope:councillor.rite ?= { + scope:councillor.rite = { rite_has_parameter = mendicant_preachers_conversion_active } } @@ -1839,7 +1835,7 @@ conversion_communal_identity_bonus = { if = { limit = { exists = scope:county - scope:councillor.rite ?= { + scope:councillor.rite = { rite_has_parameter = same_culture_conversion_bonus_active } scope:county.culture = scope:councillor.liege.culture @@ -1865,13 +1861,13 @@ conversion_ghw_tenet_no_hof_bonus = { #add = court_chaplain_conversion_base_total if = { limit = { - faith ?= { holy_sites_controlled = 1 } + faith = { holy_sites_controlled = 1 } } multiply = conversion_ghw_tenet_multiplier_control } else_if = { limit = { - faith ?= { holy_sites_controlled = 2 } + faith = { holy_sites_controlled = 2 } } multiply = { value = conversion_ghw_tenet_multiplier_control @@ -1880,7 +1876,7 @@ conversion_ghw_tenet_no_hof_bonus = { } else_if = { limit = { - faith ?= { holy_sites_controlled = 3 } + faith = { holy_sites_controlled = 3 } } multiply = { value = conversion_ghw_tenet_multiplier_control @@ -1889,7 +1885,7 @@ conversion_ghw_tenet_no_hof_bonus = { } else_if = { limit = { - faith ?= { holy_sites_controlled = 4 } + faith = { holy_sites_controlled = 4 } } multiply = { value = conversion_ghw_tenet_multiplier_control @@ -1898,7 +1894,7 @@ conversion_ghw_tenet_no_hof_bonus = { } else_if = { limit = { - faith ?= { holy_sites_controlled = 5 } + faith = { holy_sites_controlled = 5 } } multiply = { value = conversion_ghw_tenet_multiplier_control @@ -1907,7 +1903,7 @@ conversion_ghw_tenet_no_hof_bonus = { } else_if = { limit = { - faith ?= { holy_sites_controlled = 6 } + faith = { holy_sites_controlled = 6 } } multiply = { value = conversion_ghw_tenet_multiplier_control @@ -1916,7 +1912,7 @@ conversion_ghw_tenet_no_hof_bonus = { } else_if = { limit = { - faith ?= { holy_sites_controlled = 7 } + faith = { holy_sites_controlled = 7 } } multiply = { value = conversion_ghw_tenet_multiplier_control @@ -1925,7 +1921,7 @@ conversion_ghw_tenet_no_hof_bonus = { } else_if = { limit = { - faith ?= { holy_sites_controlled = 8 } + faith = { holy_sites_controlled = 8 } } multiply = { value = conversion_ghw_tenet_multiplier_control @@ -1934,7 +1930,7 @@ conversion_ghw_tenet_no_hof_bonus = { } else_if = { limit = { - faith ?= { holy_sites_controlled = 9 } + faith = { holy_sites_controlled = 9 } } multiply = { value = conversion_ghw_tenet_multiplier_control @@ -1943,7 +1939,7 @@ conversion_ghw_tenet_no_hof_bonus = { } else_if = { limit = { - faith ?= { holy_sites_controlled >= 10 } + faith = { holy_sites_controlled >= 10 } } multiply = { value = conversion_ghw_tenet_multiplier_control @@ -2014,7 +2010,7 @@ conversion_holy_site_jerusalem = { value = 0 if = { limit = { - scope:councillor.faith ?= { + scope:councillor.faith = { controls_holy_site_with_parameter = jerusalem_conversion_bonus } } @@ -2027,7 +2023,7 @@ conversion_holy_site_kerala = { value = 0 if = { limit = { - scope:councillor.faith ?= { + scope:councillor.faith = { controls_holy_site_with_parameter = kerala_conversion_bonus } } @@ -2040,7 +2036,7 @@ conversion_holy_site_iona = { value = 0 if = { limit = { - scope:councillor.faith ?= { + scope:councillor.faith = { controls_holy_site_with_parameter = iona_conversion_bonus } } @@ -2053,7 +2049,7 @@ conversion_holy_site_visoki = { value = 0 if = { limit = { - scope:councillor.faith ?= { + scope:councillor.faith = { controls_holy_site_with_parameter = visoki_conversion_resistance_bonus } } @@ -2066,7 +2062,7 @@ conversion_holy_site_wadi_el_milk = { value = 0 if = { limit = { - scope:councillor.faith ?= { + scope:councillor.faith = { controls_holy_site_with_parameter = wadi_el_milk_conversion_resistance_bonus } } @@ -2079,7 +2075,7 @@ conversion_holy_site_cordoba = { value = 0 if = { limit = { - scope:councillor.faith ?= { + scope:councillor.faith = { controls_holy_site_with_parameter = cordoba_conversion_bonus } } @@ -2228,7 +2224,7 @@ court_chaplain_sunni_promotion = { limit = { exists = global_var:fp3_struggle_ending global_var:fp3_struggle_ending = flag:fp3_struggle_strengthen_caliphate_ending - rite ?= { + rite = { rite_has_doctrine = muhammad_succession_sunni_doctrine } } @@ -2244,7 +2240,7 @@ court_chaplain_shia_promotion = { limit = { exists = global_var:fp3_struggle_ending global_var:fp3_struggle_ending = flag:fp3_struggle_shia_caliphate_ending - rite ?= { + rite = { rite_has_doctrine = muhammad_succession_shia_doctrine } } @@ -2256,7 +2252,7 @@ court_chaplain_shia_promotion = { } #Cardinal Order bonus -cardinal_order_convert_faith ?= { +cardinal_order_convert_faith = { if = { limit = { scope:county ?= { diff --git a/common/script_values/99_spouse_councillor_values.txt b/common/script_values/99_spouse_councillor_values.txt index ceae318fa..001b843cf 100644 --- a/common/script_values/99_spouse_councillor_values.txt +++ b/common/script_values/99_spouse_councillor_values.txt @@ -55,9 +55,14 @@ spouse_default_task_diplomacy_scale = { } if = { limit = { - faith = { - has_doctrine_parameter = neow_better_spouses - } + has_personal_tenet_flag = tenet_divine_marriage_spouse_contribution + } + multiply = 1.25 + save_temporary_value_as = has_been_modified + } + if = { + limit = { + rite = { rite_has_parameter = neow_better_spouses } } multiply = 1.25 save_temporary_value_as = has_been_modified @@ -106,9 +111,14 @@ spouse_default_task_martial_scale = { } if = { limit = { - faith = { - has_doctrine_parameter = neow_better_spouses - } + has_personal_tenet_flag = tenet_divine_marriage_spouse_contribution + } + multiply = 1.25 + save_temporary_value_as = has_been_modified + } + if = { + limit = { + rite = { rite_has_parameter = neow_better_spouses } } multiply = 1.25 save_temporary_value_as = has_been_modified @@ -158,8 +168,14 @@ spouse_default_task_intrigue_scale = { if = { limit = { faith = { - has_doctrine_parameter = neow_better_spouses - } + has_personal_tenet_flag = tenet_divine_marriage_spouse_contribution + } + multiply = 1.25 + save_temporary_value_as = has_been_modified + } + if = { + limit = { + rite = { rite_has_parameter = neow_better_spouses } } multiply = 1.25 save_temporary_value_as = has_been_modified @@ -208,9 +224,14 @@ spouse_default_task_learning_scale = { } if = { limit = { - faith = { - has_doctrine_parameter = neow_better_spouses - } + has_personal_tenet_flag = tenet_divine_marriage_spouse_contribution + } + multiply = 1.25 + save_temporary_value_as = has_been_modified + } + if = { + limit = { + rite = { rite_has_parameter = neow_better_spouses } } multiply = 1.25 save_temporary_value_as = has_been_modified @@ -259,9 +280,14 @@ spouse_default_task_stewardship_scale = { } if = { limit = { - faith = { - has_doctrine_parameter = neow_better_spouses - } + has_personal_tenet_flag = tenet_divine_marriage_spouse_contribution + } + multiply = 1.25 + save_temporary_value_as = has_been_modified + } + if = { + limit = { + rite = { rite_has_parameter = neow_better_spouses } } multiply = 1.25 save_temporary_value_as = has_been_modified @@ -310,9 +336,14 @@ spouse_task_court_politics_scale = { } if = { limit = { - faith = { - has_doctrine_parameter = neow_better_spouses - } + has_personal_tenet_flag = tenet_divine_marriage_spouse_contribution + } + multiply = 1.25 + save_temporary_value_as = has_been_modified + } + if = { + limit = { + rite = { rite_has_parameter = neow_better_spouses } } multiply = 1.25 save_temporary_value_as = has_been_modified @@ -361,9 +392,14 @@ spouse_task_chivalry_scale = { } if = { limit = { - faith = { - has_doctrine_parameter = neow_better_spouses - } + has_personal_tenet_flag = tenet_divine_marriage_spouse_contribution + } + multiply = 1.25 + save_temporary_value_as = has_been_modified + } + if = { + limit = { + rite = { rite_has_parameter = neow_better_spouses } } multiply = 1.25 save_temporary_value_as = has_been_modified @@ -412,9 +448,14 @@ spouse_task_court_intrigue_scale = { } if = { limit = { - faith = { - has_doctrine_parameter = neow_better_spouses - } + has_personal_tenet_flag = tenet_divine_marriage_spouse_contribution + } + multiply = 1.25 + save_temporary_value_as = has_been_modified + } + if = { + limit = { + rite = { rite_has_parameter = neow_better_spouses } } multiply = 1.25 save_temporary_value_as = has_been_modified @@ -463,9 +504,14 @@ spouse_task_manage_domain_scale = { } if = { limit = { - faith = { - has_doctrine_parameter = neow_better_spouses - } + has_personal_tenet_flag = tenet_divine_marriage_spouse_contribution + } + multiply = 1.25 + save_temporary_value_as = has_been_modified + } + if = { + limit = { + rite = { rite_has_parameter = neow_better_spouses } } multiply = 1.25 save_temporary_value_as = has_been_modified @@ -514,9 +560,14 @@ spouse_task_patronage_scale = { } if = { limit = { - faith = { - has_doctrine_parameter = neow_better_spouses - } + has_personal_tenet_flag = tenet_divine_marriage_spouse_contribution + } + multiply = 1.25 + save_temporary_value_as = has_been_modified + } + if = { + limit = { + rite = { rite_has_parameter = neow_better_spouses } } multiply = 1.25 save_temporary_value_as = has_been_modified diff --git a/common/script_values/99_steward_values.txt b/common/script_values/99_steward_values.txt deleted file mode 100644 index 694c1422b..000000000 --- a/common/script_values/99_steward_values.txt +++ /dev/null @@ -1,1310 +0,0 @@ -# Can't reference a named value that hasn't been defined yet, so this file is late in the load order -# Feel free to use other files as well, but be careful about load order -# Please remove the example formulas once there's a few real formulas - - -steward_learn_on_the_job_scale = { - value = 0 - if = { - limit = { - liege = { has_perk = learn_on_the_job_perk } - } - add = stewardship - multiply = { - add = learn_on_the_job_percentage - divide = 100 - } - floor = yes - min = 1 - } -} - -kurultai_steward_learn_on_the_job_scale = { - value = 0 - if = { - limit = { - liege = { has_perk = learn_on_the_job_perk } - highest_skill = stewardship - } - add = stewardship - multiply = { - add = learn_on_the_job_percentage - divide = 100 - } - floor = yes - min = 1 - } -} - -### Reliable House modifier -steward_reliable_house_scale = { - value = 0 - if = { - limit = { - exists = liege.dynasty - liege.dynasty = { has_dynasty_perk = fp2_coterie_legacy_2 } - house = liege.house - } - add = stewardship - multiply = { - add = council_reliable_house_percentage - divide = 100 - } - floor = yes - min = 1 - } -} - - -######################################### -########## COLLECT TAXES TASK ########### -######################################### - -steward_collect_taxes_scale_base = { - add = stewardship - divide = 2 -} - -steward_collect_taxes_perk_bonus_scale = { - add = steward_collect_taxes_scale_base - multiply = { - add = tax_man_perk_percentage - divide = 100 - } -} - -steward_collect_taxes_erudition_bonus_scale = { - add = steward_collect_taxes_scale_base - multiply = { - add = erudition_legacy_5_percentage - divide = 100 - } -} - -steward_collect_taxes_family_business_bonus_scale = { - add = steward_collect_taxes_scale_base - multiply = { - add = family_business_councillors_percentage - divide = 100 - } -} - -steward_collect_taxes_consulted_house_bonus_scale = { - add = steward_collect_taxes_scale_base - multiply = { - add = consulted_house_councillors_percentage - divide = 100 - } -} - -steward_collect_taxes_scale_tooltip_total = { - add = steward_collect_taxes_scale_base - if = { - limit = { - scope:councillor_liege = { has_perk = tax_man_perk } - } - add = steward_collect_taxes_perk_bonus_scale - } - if = { - limit = { - councillor_liege_has_erudition_legacy_5_perk = yes - } - add = steward_collect_taxes_erudition_bonus_scale - } - if = { - limit = { - councillor_liege_has_family_business_bonus = yes - } - add = steward_collect_taxes_family_business_bonus_scale # 0.1 - } - if = { - limit = { - councillor_liege_has_consulted_house_bonus = yes - } - add = steward_collect_taxes_consulted_house_bonus_scale # 0.1 - } - if = { - limit = { - scope:councillor_liege.culture ?= { has_cultural_parameter = bookkeeping_collect_taxes_bonus } - } - add = 10 - } -} - -steward_collect_taxes_total_scale = { - add = steward_collect_taxes_scale_tooltip_total - divide = 100 -} - -steward_collect_taxes_bonus_tax_income = { - add = medium_gold_value - multiply = stewardship - divide = 10 -} - -######################################### -######### DEVELOP COUNTY TASK ########### -######################################### - -steward_develop_county_full_progress = { - if = { - limit = { exists = scope:county } - add = scope:county.development_rate - } -} - -steward_develop_county_current_progress = { - value = 0 - if = { - limit = { exists = scope:county } - add = scope:county.development_towards_level_increase - } -} - -steward_develop_county_base = { - add = 0.1 -} - -steward_develop_county_monthly_increase = { - add = stewardship - multiply = 0.175 -} - -steward_develop_county_base_total = { - add = steward_develop_county_base - add = steward_develop_county_monthly_increase -} - -steward_develop_county_modifier_scale = { - add = steward_develop_county_base_total - divide = 100 -} - -# Relation impact -steward_develop_county_monthly_increase_friend_bonus = { - if = { - limit = { - scope:councillor_liege = { - has_relation_friend = scope:councillor - NOT = { has_relation_best_friend = scope:councillor } - } - } - value = steward_develop_county_base_total - multiply = { - add = council_friend_impact_percentage - divide = 100 - } - } -} -steward_develop_county_monthly_increase_best_friend_bonus = { - if = { - limit = { - scope:councillor_liege = { - has_relation_best_friend = scope:councillor - } - } - value = steward_develop_county_base_total - multiply = { - add = council_best_friend_impact_percentage - divide = 100 - } - } -} -steward_develop_county_monthly_increase_rival_bonus = { - if = { - limit = { - scope:councillor_liege = { - has_relation_rival = scope:councillor - NOT = { has_relation_nemesis = scope:councillor } - } - } - value = steward_develop_county_base_total - multiply = { - add = council_rival_impact_percentage - divide = 100 - } - } -} -steward_develop_county_monthly_increase_nemesis_bonus = { - if = { - limit = { - scope:councillor_liege = { - has_relation_nemesis = scope:councillor - } - } - value = steward_develop_county_base_total - multiply = { - add = council_nemesis_impact_percentage - divide = 100 - } - } -} - -steward_develop_county_perk_bonus_monthly_increase = { - value = 0 - if = { - limit = { - liege = { has_perk = planned_cultivation_perk } - } - add = steward_develop_county_base_total - multiply = { - add = planned_cultivation_percentage - divide = 100 - } - } -} - -steward_develop_county_erudition_bonus_monthly_increase = { - value = 0 - add = steward_develop_county_base_total - multiply = { - add = erudition_legacy_5_percentage - divide = 100 - } -} - -steward_develop_county_family_business_monthly_increase = { - value = 0 - add = steward_develop_county_base_total - multiply = { - add = family_business_councillors_percentage - divide = 100 - } -} - -steward_develop_county_consulted_house_monthly_increase = { - value = 0 - add = steward_develop_county_base_total - multiply = { - add = consulted_house_councillors_percentage - divide = 100 - } -} - -steward_develop_county_total = { - add = steward_develop_county_base - add = steward_develop_county_monthly_increase - add = steward_develop_county_monthly_increase_friend_bonus - add = steward_develop_county_monthly_increase_best_friend_bonus - add = steward_develop_county_monthly_increase_rival_bonus - add = steward_develop_county_monthly_increase_nemesis_bonus - add = steward_develop_county_perk_bonus_monthly_increase - if = { - limit = { - councillor_liege_has_erudition_legacy_5_perk = yes - } - add = steward_develop_county_erudition_bonus_monthly_increase - } - if = { - limit = { - councillor_liege_has_family_business_bonus = yes - } - add = steward_develop_county_family_business_monthly_increase - } -} - -steward_develop_county_tribal_penalty = { - value = 0 - if = { - limit = { - scope:councillor_liege = { - should_apply_tribal_development_penalty_trigger = yes - } - } - add = scope:councillor.steward_develop_county_total - add = scope:councillor.steward_develop_county_perk_bonus_monthly_increase - multiply = -0.5 - } -} - -steward_develop_county_perk_bonus_modifier_scale = { - value = 0 - if = { - limit = { - liege = { has_perk = planned_cultivation_perk } - } - add = steward_develop_county_modifier_scale - multiply = 0.2 - } -} - -current_development_penalty = { - value = 0 - if = { - limit = { - exists = scope:county - } - add = scope:councillor.steward_develop_county_base_total - add = scope:councillor.steward_develop_county_perk_bonus_monthly_increase - add = scope:councillor.steward_develop_county_tribal_penalty - multiply = { - subtract = scope:county.development_level - multiply = { - value = 9.13 # Due to the way the development penalty is calculated, this means you reach maximum penalty at Development Level 10. - # If you want really mathy-stuff, the formula is: Monthly Increase - (Monthly Increase(Development Level/100)*Above Number) - if = { - limit = { culture = { has_innovation = innovation_development_04 } } - multiply = 0.1111 # With Rennisance Thought, this is increased to Development Level 90. - } - else_if = { - limit = { culture = { has_innovation = innovation_development_03 } } - multiply = 0.1818 # With Urbanization, Development Level 55. - } - else_if = { - limit = { culture = { has_innovation = innovation_development_02 } } - multiply = 0.2856 # With Communal Government, Development Level 35. - } - else_if = { - limit = { culture = { has_innovation = innovation_development_01 } } - multiply = 0.5000 # With the Public Works innovation, Development Level 20. - } - } - divide = 100 - min = -0.875 # This is the maximum penalty. - } - } -} - -######################################### -######### PROMOTE CULTURE TASK ########## -######################################### - -steward_promote_culture_base = 0.25 - -steward_promote_culture_monthly_increase = { - add = stewardship - divide = 20 -} - -steward_promote_culture_contextual_bonuses = { - # Relation Bonuses/Penalties - if = { # Friend - limit = { - scope:councillor_liege = { - has_relation_friend = scope:councillor - NOT = { has_relation_best_friend = scope:councillor } - } - } - add = { - value = scope:councillor.steward_promote_culture_monthly_increase_friend_bonus - desc = COUNCILLOR_IS_YOUR_FRIEND - } - } - if = { # Best Friend - limit = { - scope:councillor_liege = { - has_relation_best_friend = scope:councillor - } - } - add = { - value = scope:councillor.steward_promote_culture_monthly_increase_best_friend_bonus - desc = COUNCILLOR_IS_YOUR_BEST_FRIEND - } - } - if = { # Rival - limit = { - scope:councillor_liege = { - has_relation_rival = scope:councillor - NOT = { has_relation_nemesis = scope:councillor } - } - } - add = { - value = scope:councillor.steward_promote_culture_monthly_increase_rival_bonus - desc = COUNCILLOR_IS_YOUR_RIVAL - } - } - if = { # Nemesis - limit = { - scope:councillor_liege = { - has_relation_nemesis = scope:councillor - } - } - add = { - value = scope:councillor.steward_promote_culture_monthly_increase_nemesis_bonus - desc = COUNCILLOR_IS_YOUR_NEMESIS - } - } - if = { - limit = { - councillor_liege_has_erudition_legacy_5_perk = yes - } - add = { - value = steward_promote_culture_erudition_bonus - desc = ERUDITION_DYNASTY_PERK_BONUS_VALUE - } - } - if = { - limit = { - councillor_liege_has_family_business_bonus = yes - } - add = { - value = scope:councillor.steward_promote_culture_family_business_bonus - desc = FAMILY_BUSINESS_BONUS_VALUE - } - } - if = { - limit = { - exists = scope:county - scope:councillor_liege.culture = { - is_hybrid_culture = yes - culture_age < culture_hybrid_cooldown - any_parent_culture = { - this = scope:county.culture - } - } - } - add = { - value = scope:councillor.promote_culture_hybrid_culture_vs_parents_bonus - desc = STEWARD_PROMOTE_CULTURE_HYBRID_VS_PARENTS_BONUS_MODIFIER - } - } - if = { - limit = { - exists = scope:county - scope:councillor_liege.culture = { - is_divergent_culture = yes - culture_age < culture_hybrid_cooldown # Intentional - any_parent_culture = { - this = scope:county.culture - } - } - } - add = { - value = scope:councillor.promote_culture_divergent_culture_vs_parents_bonus - desc = STEWARD_PROMOTE_CULTURE_DIVERGENT_VS_PARENTS_BONUS_MODIFIER - } - } - if = { - limit = { - exists = scope:county - scope:councillor_liege.rite = { - rite_has_parameter = same_faith_promote_culture_bonus_active - } - scope:county.faith = scope:councillor_liege.faith - } - add = { - value = scope:councillor.promote_culture_communal_identity_bonus - desc = STEWARD_PROMOTE_CULTURE_COMMUNAL_IDENTITY_BONUS_MODIFIER - } - } - if = { - limit = { - exists = scope:county - scope:councillor_liege.rite = { rite_has_parameter = easier_to_convert_culture_in_same_faith_mountains } - scope:county = { - faith = scope:councillor_liege.faith - county_has_province_with_terrain = { - terrain = mountains - terrain = desert_mountains - } - } - } - add = { - value = scope:councillor.promote_culture_easier_to_convert_culture_in_same_faith_mountains_bonus - desc = STEWARD_PROMOTE_CULTURE_EASIER_TO_CONVERT_CULTURE_IN_SAME_FAITH_MOUNTAINS_BONUS - } - } - if = { - limit = { - scope:councillor_liege.culture = { - has_innovation = innovation_east_settling - } - } - add = { - value = scope:councillor.promote_culture_east_settling_bonus - desc = STEWARD_PROMOTE_CULTURE_INNOVATION_BONUS_EAST_SETTLING - } - } - if = { - limit = { - exists = scope:county - scope:county = { has_county_modifier = 6210_architect_county_modifier } - } - add = { - value = scope:councillor.6210_architect_promote_culture_bonus - desc = COURT_CHAPLAIN_CONVERSION_LOCAL_COUNTY_MODIFIERS - } - } - if = { - limit = { - exists = scope:county - scope:county = { has_county_modifier = easier_to_culture_convert } - } - add = { - value = scope:councillor.easier_to_convert_bonus - desc = COURT_CHAPLAIN_CONVERSION_LOCAL_COUNTY_MODIFIERS - } - } - if = { - limit = { - scope:councillor_liege = { has_character_modifier = court_fashion_culture_modifier } - } - add = { - value = scope:councillor.steward_fashion_bonus - desc = COUNCILLOR_LIEGE_MODIFIERS_BONUS - } - } - #Reduce for various county modifiers. - # Cultural Traditions - ## Bonuses - if = { - limit = { - exists = scope:county - scope:county.culture = { has_cultural_parameter = easier_to_convert_county_culture_with_heritage } - scope:councillor_liege.culture = { has_same_culture_heritage = scope:county.culture } - } - add = { - value = conversion_culture_easier_to_culture_change_with_heritage_value - desc = TRADITION_EASIER_TO_CULTURE_CONVERT_WITH_HERITAGE_MODIFIER - } - } - if = { - limit = { - councillor_liege_has_erudition_legacy_5_perk = yes - } - add = { - value = steward_promote_culture_erudition_bonus_monthly_increase - desc = ERUDITION_DYNASTY_PERK_BONUS_VALUE - } - } - if = { - limit = { - councillor_liege_has_family_business_bonus = yes - } - add = { - value = steward_promote_culture_family_business_monthly_increase - desc = FAMILY_BUSINESS_BONUS_VALUE - } - } - if = { - limit = { - councillor_liege_has_consulted_house_bonus = yes - } - add = { - value = steward_promote_culture_consulted_house_monthly_increase - desc = CONSULTED_HOUSE_BONUS_VALUE - } - } - if = { - limit = { - scope:county = { - OR = { - has_county_modifier = 3020_own_culture_monument - has_county_modifier = 3020_multicultural_monument - } - } - } - add = { - value = hold_court_3020_culture_bonus - desc = 3020_MONUMENT_VALUE - } - } - if = { - limit = { - scope:councillor_liege.rite ?= { - rite_has_parameter = tenet_original_sin_county_conversion_bonus - this = scope:county.rite - } - } - add = { - value = original_sin_easier_to_convert_culture_modifier_value - desc = PAM_ORIGINAL_SIN_EASIER_TO_CONVERT_CULTURE_MODIFIER - } - } - ## Penalties - if = { - limit = { - exists = scope:county - scope:county.culture = { has_cultural_parameter = harder_to_convert_county_culture_without_heritage } - NOT = { - scope:councillor_liege.culture = { has_same_culture_heritage = scope:county.culture } - } - } - add = { - value = conversion_culture_resistant_to_culture_change_without_heritage_value - desc = TRADITION_HARDER_TO_CULTURE_CONVERT_WITHOUT_HERITAGE_MODIFIER - } - } - - if = { - limit = { - exists = scope:county - scope:county.culture = { has_cultural_parameter = harder_to_convert_county_culture } - } - add = { - value = conversion_culture_resistant_to_culture_change - desc = TRADITION_HARDER_TO_CULTURE_CONVERT - } - } - - # PAM ORIGINAL SIN TENET - - if = { - limit = { - exists = scope:county - scope:county.rite ?= { rite_has_parameter = tenet_original_sin_county_conversion_resistance } - scope:county.faith != scope:councillor_liege.faith - } - add = { - value = conversion_culture_resistant_to_culture_change - desc = PAM_ORIGINAL_SIN_HARDER_TO_CONVERT_CULTURE_MODIFIER - } - } - - # Struggles - ## Penalties - if = { - limit = { - exists = scope:county - scope:county = { - any_county_struggle = { has_struggle_phase_parameter = county_culture_conversion_in_region_proceeds_slower } - } - } - add = { - value = conversion_culture_resistant_to_culture_change_due_to_struggle_phase_value - desc = STRUGGLE_HARDER_TO_CULTURE_CONVERT_DUE_TO_STRUGGLE_PHASE_MODIFIER - } - } - ## Bonuses - if = { - limit = { - exists = scope:county - scope:county = { - any_county_struggle = { has_struggle_phase_parameter = county_culture_conversion_in_region_proceeds_faster } - } - } - add = { - value = conversion_culture_accepting_of_culture_change_due_to_struggle_phase_value - desc = STRUGGLE_EASIER_TO_CULTURE_CONVERT_DUE_TO_STRUGGLE_PHASE_MODIFIER - } - } - # Decisions - if = { - limit = { - OR = { - scope:councillor_liege.culture = { has_cultural_pillar = heritage_goidelic } - scope:councillor_liege.culture = { has_cultural_pillar = heritage_brythonic } - } - exists = scope:county - scope:county = { - has_county_modifier = reclaim_britannia_culture_modifier - NOR= { - culture = { has_cultural_pillar = heritage_goidelic } - culture = { has_cultural_pillar = heritage_brythonic } - } - } - } - add = { - value = promote_culture_reclaimed_brittania_bonus - desc = STEWARD_PROMOTE_CULTURE_RECLAIMING_BRITANNIA - } - } - - if = { - limit = { - scope:councillor_liege.culture = { has_cultural_pillar = heritage_syriac } - exists = scope:county - scope:county = { - has_county_modifier = promote_culture_beth_nahrain_modifier - NOT = { - culture = { has_cultural_pillar = heritage_syriac } - } - } - } - add = { - value = promote_culture_beth_nahrain_bonus - desc = steward_promote_culture_beth_nahrain - } - } - - if = { - limit = { - scope:county.culture ?= { has_cultural_pillar = heritage_iranian } - exists = global_var:fp3_struggle_ending - global_var:fp3_struggle_ending = flag:fp3_struggle_rekindle_iran_ending - - NOT = { - scope:councillor_liege.culture = { has_same_culture_heritage = scope:county.culture } - } - } - add = { - value = conversion_culture_resistant_to_culture_change - desc = struggle_persia_ending_rekindle_iran_harder_to_convert_culture_reason - } - } - - if = { - limit = { - scope:councillor_liege.culture = { has_cultural_pillar = heritage_iranian } - exists = global_var:fp3_struggle_ending - global_var:fp3_struggle_ending = flag:fp3_struggle_rekindle_iran_ending - - NOT = { - scope:councillor_liege.culture = { has_same_culture_heritage = scope:county.culture } - } - } - add = { - value = conversion_culture_easy - desc = struggle_persia_ending_rekindle_iran_harder_to_convert_culture_reason - } - } - - # Events - if = { - limit = { - exists = scope:county - scope:county = { - has_county_modifier = governance_1073_conversion_resistance_modifier - } - } - add = { - value = scope:councillor.promote_culture_local_traditions_respected_penalty - desc = STEWARD_PROMOTE_CULTURE_LOCAL_TRADITIONS_RESPECTED - } - } - if = { - limit = { - exists = scope:county - scope:county = { - has_county_modifier = county_shuubiyya_modifier - } - } - add = { - value = scope:councillor.promote_culture_shuubiyya_penalty - desc = STEWARD_PROMOTE_CULTURE_SHUUBIYYA - } - } - if = { - limit = { - exists = scope:county - scope:county = { - OR = { - has_county_modifier = enthusiastic_nomad_settlement_saharan_modifier - has_county_modifier = nomad_settlement_saharan_modifier - } - } - } - add = { - value = scope:councillor.promote_culture_allowed_nomad_settlement_penalty - desc = STEWARD_PROMOTE_CULTURE_ALLOWED_NOMAD_SETTLEMENT - } - } - if = { - limit = { - exists = scope:county - scope:county = { has_county_modifier = hold_court_8190_vassal_modifier } - } - add = { - value = scope:councillor.court_8190_vassal_modifier_value - desc = COURT_CHAPLAIN_CONVERSION_LOCAL_COUNTY_MODIFIERS - } - } -} - -steward_promote_culture_monthly_increase_friend_bonus = { - value = steward_promote_culture_monthly_increase - multiply = { - value = council_friend_impact_percentage - divide = 100 - } -} - -steward_promote_culture_base_total = { - add = steward_promote_culture_base - add = steward_promote_culture_monthly_increase -} - -steward_promote_culture_monthly_increase_best_friend_bonus = { - value = steward_promote_culture_base_total - multiply = { - value = council_best_friend_impact_percentage - divide = 100 - } -} -steward_promote_culture_monthly_increase_rival_bonus = { - value = steward_promote_culture_base_total - multiply = { - value = council_rival_impact_percentage - divide = 100 - } -} -steward_promote_culture_monthly_increase_nemesis_bonus = { - value = steward_promote_culture_base_total - multiply = { - value = council_nemesis_impact_percentage - divide = 100 - } -} - -steward_promote_culture_erudition_bonus = { - add = steward_promote_culture_base_total - multiply = { - add = erudition_legacy_5_percentage - divide = 100 - } -} - -steward_promote_culture_family_business_bonus = { - add = steward_promote_culture_base_total - multiply = { - add = family_business_councillors_percentage - divide = 100 - } -} - -promote_culture_communal_identity_bonus = { - value = 0 - add = steward_promote_culture_base_total - multiply = 0.50 -} - -promote_culture_easier_to_convert_culture_in_same_faith_mountains_bonus_root_value = 0.5 - -promote_culture_easier_to_convert_culture_in_same_faith_mountains_bonus_loc_control = { - value = promote_culture_easier_to_convert_culture_in_same_faith_mountains_bonus_root_value - multiply = 100 -} - -promote_culture_easier_to_convert_culture_in_same_faith_mountains_bonus = { - value = steward_promote_culture_base_total - multiply = promote_culture_easier_to_convert_culture_in_same_faith_mountains_bonus_root_value -} - -promote_culture_hybrid_culture_vs_parents_bonus = { - value = 0 - add = steward_promote_culture_base_total - multiply = 1.5 -} - -promote_culture_divergent_culture_vs_parents_bonus = { - value = 0 - add = steward_promote_culture_base_total - multiply = 1.3 -} - -promote_culture_east_settling_bonus = { - value = 0 - add = steward_promote_culture_base_total - multiply = 0.15 -} - -promote_culture_reclaimed_brittania_bonus = { - value = steward_promote_culture_base_total - multiply = 0.75 -} - -promote_culture_beth_nahrain_bonus = { - value = steward_promote_culture_base_total - multiply = 0.75 -} - -steward_promote_culture_erudition_bonus_monthly_increase = { - value = steward_promote_culture_base_total - multiply = { - add = erudition_legacy_5_percentage - divide = 100 - } -} - -steward_promote_culture_family_business_monthly_increase = { - value = steward_promote_culture_base_total - multiply = { - add = family_business_councillors_percentage - divide = 100 - } -} - -steward_promote_culture_consulted_house_monthly_increase = { - value = steward_promote_culture_base_total - multiply = { - add = consulted_house_councillors_percentage - divide = 100 - } -} - -hold_court_3020_culture_bonus = { - value = 0.1 -} - -promote_culture_local_traditions_respected_penalty = { - value = 0 - add = steward_promote_culture_base_total - multiply = -0.75 -} - -promote_culture_defiant_ambushers_penalty = { - value = 0 - add = steward_promote_culture_base_total - multiply = -0.5 -} - -promote_culture_shuubiyya_penalty = { - value = 0 - if = { - limit = { - exists = scope:county - scope:county = { - has_county_modifier = county_shuubiyya_modifier - } - } - add = steward_promote_culture_base_total - multiply = -0.75 - } -} - -promote_culture_allowed_nomad_settlement_penalty = { - value = 0 - add = steward_promote_culture_base_total - multiply = -0.8 -} - -promote_culture_development_penalty = { - value = 0 - if = { - limit = { exists = scope:county } - add = scope:councillor.steward_promote_culture_base_total - add = scope:councillor.steward_promote_culture_contextual_bonuses - multiply = { - subtract = scope:county.development_level - divide = 100 - min = -0.9 - } - } -} - -conversion_culture_easier_to_culture_change_with_heritage_value = { - value = 0 - add = steward_promote_culture_base - multiply = 0.3 -} - -conversion_culture_resistant_to_culture_change_without_heritage_value = { - value = 0 - subtract = steward_promote_culture_base_total - multiply = 0.5 -} - -conversion_culture_resistant_to_culture_change = { - value = 0 - subtract = steward_promote_culture_base_total - multiply = 0.5 -} - -conversion_culture_resistant_to_culture_change_due_to_struggle_phase_value = { - value = 0 - subtract = steward_promote_culture_base - multiply = 0.5 -} - -conversion_culture_accepting_of_culture_change_due_to_struggle_phase_value = { - value = 0 - subtract = steward_promote_culture_base - multiply = -0.5 -} - -conversion_culture_easy = { - value = 0 - add = steward_promote_culture_base_total - multiply = 0.5 -} - -original_sin_easier_to_convert_culture_modifier_value = { - value = 0 - add = steward_promote_culture_base_total - multiply = 0.25 -} - - - -######################################### -######## CONVINCE DE JURE TASK ########## -######################################### - -steward_convince_dejure_base = 0.1 - -steward_convince_dejure_monthly_increase = { - add = stewardship - divide = 20 -} - -steward_convince_dejure_monthly_increase_friend_bonus = { - value = steward_convince_dejure_monthly_increase - multiply = { - value = council_friend_impact_percentage - divide = 100 - } -} -steward_convince_dejure_base_total = { - add = steward_convince_dejure_monthly_increase - add = steward_convince_dejure_monthly_increase_friend_bonus -} -steward_convince_dejure_monthly_increase_best_friend_bonus = { - value = steward_convince_dejure_base_total - multiply = { - value = council_best_friend_impact_percentage - divide = 100 - } -} -steward_convince_dejure_monthly_increase_rival_bonus = { - value = steward_convince_dejure_base_total - multiply = { - value = council_rival_impact_percentage - divide = 100 - } -} -steward_convince_dejure_monthly_increase_nemesis_bonus = { - value = steward_convince_dejure_base_total - multiply = { - value = council_nemesis_impact_percentage - divide = 100 - } -} - -steward_convince_dejure_erudition_bonus = { - add = steward_convince_dejure_base_total - multiply = { - add = erudition_legacy_5_percentage - divide = 100 - } -} - -steward_convince_dejure_family_business_bonus = { - add = steward_convince_dejure_base_total - multiply = { - add = family_business_councillors_percentage - divide = 100 - } -} - -steward_convince_dejure_consulted_house_bonus = { - add = steward_convince_dejure_base_total - multiply = { - add = consulted_house_councillors_percentage - divide = 100 - } -} - -######################################### -######### ACCEPT CULTURE TASK ########### -######################################### - -task_accept_culture_base_progress = { - value = 0.01 - multiply = scope:councillor_liege.primary_title.tier -} - -steward_accept_culture_base_total = { - add = task_accept_culture_base_progress - add = steward_accept_culture_yearly_increase -} - -steward_accept_culture_yearly_increase = { - add = stewardship - multiply = 0.005 -} - -steward_accept_culture_erudition_bonus_yearly_increase = { - add = steward_accept_culture_base_total - multiply = { - add = erudition_legacy_5_percentage - divide = 100 - } -} - -steward_accept_culture_customs_bonus_yearly_increase = { - add = steward_accept_culture_base_total - multiply = { - add = customs_legacy_percentage - divide = 100 - } -} - -# Relation impact -steward_accept_culture_yearly_increase_friend_bonus = { - if = { - limit = { - scope:councillor_liege = { - has_relation_friend = scope:councillor - NOT = { has_relation_best_friend = scope:councillor } - } - } - value = steward_accept_culture_base_total - multiply = { - add = council_friend_impact_percentage - divide = 100 - } - } -} -steward_accept_culture_yearly_increase_best_friend_bonus = { - if = { - limit = { - scope:councillor_liege = { - has_relation_best_friend = scope:councillor - } - } - value = steward_accept_culture_base_total - multiply = { - add = council_best_friend_impact_percentage - divide = 100 - } - } -} -steward_accept_culture_yearly_increase_rival_bonus = { - if = { - limit = { - scope:councillor_liege = { - has_relation_rival = scope:councillor - NOT = { has_relation_nemesis = scope:councillor } - } - } - value = steward_accept_culture_base_total - multiply = { - add = council_rival_impact_percentage - divide = 100 - } - } -} -steward_accept_culture_yearly_increase_nemesis_bonus = { - if = { - limit = { - scope:councillor_liege = { - has_relation_nemesis = scope:councillor - } - } - value = steward_accept_culture_base_total - multiply = { - add = council_nemesis_impact_percentage - divide = 100 - } - } -} -steward_accept_culture_yearly_increase_independent_bonus = { - value = 0 - if = { - limit = { - scope:councillor_liege = { - top_liege = this - } - } - add = { - value = steward_accept_culture_base_total - multiply = 5 - } - } -} - -steward_accept_culture_court_type_bonus = { - value = 0 - if = { - limit = { - scope:councillor_liege = { - has_royal_court = yes - has_dlc_feature = royal_court - has_court_type = court_administrative - court_grandeur_current_level >= 4 - } - } - add = steward_accept_culture_base_total - multiply = { - value = court_administrative_steward_task_bonus - divide = 100 - } - } -} - -task_accept_culture_total_base_value = { - add = task_accept_culture_base_progress - add = steward_accept_culture_yearly_increase - if = { - limit = { - councillor_liege_has_customs_legacy_perk = yes - } - add = steward_accept_culture_customs_bonus_yearly_increase - } - if = { - limit = { - councillor_liege_has_erudition_legacy_5_perk = yes - } - add = steward_accept_culture_erudition_bonus_yearly_increase - } - add = steward_accept_culture_yearly_increase_friend_bonus - add = steward_accept_culture_yearly_increase_best_friend_bonus - add = steward_accept_culture_yearly_increase_rival_bonus - add = steward_accept_culture_yearly_increase_nemesis_bonus - if = { - limit = { - councillor_liege_has_family_business_bonus = yes - } - add = steward_accept_culture_family_business_bonus_yearly_increase - } - if = { - limit = { - exists = scope:county - scope:councillor.culture = scope:county.culture - } - add = steward_accept_culture_yearly_increase_same_culture_bonus - } -} - -task_accept_culture_progress = { - add = task_accept_culture_base_progress - add = steward_accept_culture_yearly_increase - if = { - limit = { - councillor_liege_has_customs_legacy_perk = yes - } - add = steward_accept_culture_customs_bonus_yearly_increase - } - if = { - limit = { - councillor_liege_has_erudition_legacy_5_perk = yes - } - add = steward_accept_culture_erudition_bonus_yearly_increase - } - if = { - limit = { - councillor_liege_has_family_business_bonus = yes - } - add = steward_accept_culture_family_business_bonus_yearly_increase - } - if = { - limit = { - councillor_liege_has_consulted_house_bonus = yes - } - add = steward_accept_culture_consulted_house_bonus_yearly_increase - } - add = steward_accept_culture_yearly_increase_friend_bonus - add = steward_accept_culture_yearly_increase_best_friend_bonus - add = steward_accept_culture_yearly_increase_rival_bonus - add = steward_accept_culture_yearly_increase_nemesis_bonus - add = steward_accept_culture_yearly_increase_independent_bonus - add = steward_accept_culture_court_type_bonus - if = { - limit = { - exists = scope:county - scope:councillor.culture = scope:county.culture - } - add = steward_accept_culture_yearly_increase_same_culture_bonus - } -} - -steward_accept_culture_family_business_bonus_yearly_increase = { - add = steward_accept_culture_base_total - multiply = { - add = family_business_councillors_percentage - divide = 100 - } -} - -steward_accept_culture_consulted_house_bonus_yearly_increase = { - add = steward_accept_culture_base_total - multiply = { - add = consulted_house_councillors_percentage - divide = 100 - } -} - -steward_accept_culture_yearly_increase_same_culture_bonus = { - value = steward_accept_culture_base_total - multiply = 0.25 -} diff --git a/common/script_values/tgp_values.txt b/common/script_values/tgp_values.txt deleted file mode 100644 index 34f53eb89..000000000 --- a/common/script_values/tgp_values.txt +++ /dev/null @@ -1,864 +0,0 @@ - -### HOUSE RELATIONS -house_relation_casus_belli_discount_value = 0.75 -house_relation_personal_scheme_bonus_value = 15 -house_relation_hostile_scheme_bonus_value = 15 -house_relation_increased_marriage_acceptance = 25 -house_relation_decreased_marriage_acceptance = -25 -house_relation_less_likely_war_target = -150 - -house_relation_actions_to_improve_level_threshold_value = 10 # How many actions before House level changes -house_relation_actions_to_damage_level_threshold_value = { # Same as above, but negative - value = house_relation_actions_to_improve_level_threshold_value - multiply = -1 -} - -house_relation_improve_minor_value = 0.1 -house_relation_improve_medium_value = 0.2 -house_relation_improve_major_value = 0.3 -house_relation_damage_minor_value = { # Same as above, but negative - value = house_relation_improve_minor_value - multiply = -1 -} -house_relation_damage_medium_value = { - value = house_relation_improve_medium_value - multiply = -1 -} -house_relation_damage_major_value = { - value = house_relation_improve_major_value - multiply = -1 -} -house_relation_damage_massive_value = { - value = house_relation_improve_major_value - multiply = -2 -} -house_relation_damage_monumental_value = { - value = house_relation_improve_major_value - multiply = -3 -} - -improve_house_relation_calculated_value = { - value = house_relation_improve_major_value - multiply = 4 #Since we know we are in Japan to use the interaction -} - -# Imperial Grace loss values depending on phase -imperial_grace_loss_situation_dynastic_cycle_phase_stability = -1 -imperial_grace_loss_situation_dynastic_cycle_phase_stability_expansion = -2 -imperial_grace_loss_situation_dynastic_cycle_phase_stability_advancement = -1 -imperial_grace_loss_situation_dynastic_cycle_phase_instability = -3 -imperial_grace_loss_situation_dynastic_cycle_phase_instability_conquest = -3 -imperial_grace_loss_situation_dynastic_cycle_phase_chaos = -5 - -# This value is used for the ai_expected_level param for mandate_legitimacy, but can also be used directly without a vassal scope -# It's set to max, unless Cycle is in Stability Era, then it is lower by 2 for the first 50 years and lower by 1 for another 50 years -dynastic_cycle_legitimacy_expectation = { - value = 7 #max - if = { - limit = { - situation:dynastic_cycle ?= { - OR = { - situation_current_phase = situation_dynastic_cycle_phase_stability_expansion - situation_current_phase = situation_dynastic_cycle_phase_stability_advancement - } - has_variable = stability_phase_start_date - } - } - if = { - limit = { - situation:dynastic_cycle = { - var:stability_phase_start_date <= { - value = current_date - subtract = 18250 - } - } - } - add = -2 - } - if = { - limit = { - situation:dynastic_cycle = { - var:stability_phase_start_date <= { - value = current_date - subtract = 36500 - } - } - } - add = -1 - } - } -} - -celestial_investiture_trade_bonus_max = 50 - -grand_guardian_aptitude_modifier_scaling_value = { - value = 1 - if = { - limit = { exists = root } - add = root.aptitude:grand_guardian_court_position - } - desc = MODIFIER_DEFINITION_MAIN_DESC_GRAND_GUARDIAN_APTITUDE -} - -## IE LOC VALUES -child_exam_min_age = { - value = 6 -} - -metropolitan_exam_final_entrants = { - value = 10 -} - -metropolitan_exam_final_entrants_loc = { - value = metropolitan_exam_final_entrants -} - -## LOCAL EXAMINATION VALUES -examination_success_learning_value = { - value = learning - multiply = 1.2 - ceiling = yes - max = 30 -} - -examination_success_stewardship_value = { - value = stewardship - multiply = 1.2 - ceiling = yes - max = 30 -} - -examination_success_martial_value = { - value = martial - multiply = 1.2 - ceiling = yes - max = 30 -} - -examination_success_increase_miniscule_value = 5 -examination_success_increase_minor_value = 10 -examination_success_increase_medium_value = 15 -examination_success_increase_major_value = 20 -examination_success_increase_massive_value = 25 - - -examination_merit_reward_base_value = medium_merit_value - -child_examination_success_chance_value = { - value = 0 - # EXAM TYPE - add = { - value = learning - multiply = 1.2 - ceiling = yes - max = 30 - desc = learning_modifier - } - # A Confucian Education will improve your chances - add = { - if = { - limit = { has_trait = confucian_education } - add = 5 - } - desc = confucian_education_modifier - } - # Having a Tutor will improve your chances - add = { - if = { - limit = { employs_court_position = court_tutor_court_position } - add = 15 - } - desc = tutor_modifier - } - # Having lost a parent will improve your chances - add = { - if = { - limit = { - any_parent = { - is_alive = no - count = all - } - } - add = 10 - } - desc = mourned_parent_modifier - } - # Let's also add the child's age - add = { - value = age - desc = age_modifier - } - add = { - if = { - limit = { - has_trait = curious - } - add = 5 - } - desc = curious_modifier - } - # VARIABLES - # Nr of safe bets at examination - add = { - if = { - limit = { var:safe_bets > 0 } - value = var:safe_bets - multiply = 5 - } - desc = played_it_safe_modifier - } - # MODIFIERS - if = { - limit = { - has_character_modifier = tgp_local_exam_initial_success - } - add = { - value = examination_success_increase_medium_value - desc = exam_success_chance.tgp_local_exam_initial_success - } - } - if = { - limit = { - has_character_modifier = tgp_local_exam_impressed_examiner - } - add = { - value = examination_success_increase_major_value - desc = exam_success_chance.tgp_local_exam_impressed_examiner - } - } - if = { - limit = { - has_character_modifier = tgp_local_exam_strong_finish - } - add = { - value = examination_success_increase_massive_value - desc = exam_success_chance.tgp_local_exam_strong_finish - } - } -} - -dynasty_legacy_influence_career_discount_value = -0.1 - -# Referenced to in code for the Merit tooltip (DO NOT REMOVE) -# displayed in MERIT_PROGRESSBAR_MARKER_TOOLTIP, if you change the value here be sure to update the loc key as well -movement_power_character_individual_merit_value = { - value = merit_level - multiply = 10 -} - -relevant_family_members_metropolitan_value = { - value = var:num_exam_family_passed_metropolitan -} - -relevant_family_members_palace_value = { - value = prev.var:num_exam_family_passed_palace - ceiling = yes - max = 3 -} - -meritocratic_province_military_max_value = 8 -meritocratic_province_protectorate_max_value = { - value = 5 -} - -meritocratic_province_industrial_max_value = 8 -meritocratic_province_metropolitan_max_value = { - value = 5 -} - -# dejure governorship value for sidegrade appointments -# this is the prominence value -# root - title considered for appointment -appointment_title_value = { - value = 0 - # We value titles differently depending on if it is a civilian or military appointment - if = { - limit = { - OR = { - holder ?= { vassal_contract_has_flag = meritocratic_civil_appointment } - holder ?= { vassal_contract_has_flag = celestial_civil_appointment } - } - } - # General gold income - if = { - limit = { - tier >= tier_duchy - } - add = { - every_de_jure_county = { - add = { - value = title_province.monthly_income - multiply = 24 - } - } - desc = appointment_title_value.county_income - } - } - else = { - add = { - value = title_province.monthly_income - multiply = 24 - desc = appointment_title_value.capital_income - } - } - - # Distance to capital - add = { - value = 500 - subtract = { - value = "title_province.squared_distance(root.holder.top_liege.capital_province)" - multiply = 0.0001 - } - min = 0 - desc = appointment_title_value.distance_to_capital - } - } - else_if = { - limit = { - holder ?= { - OR = { - vassal_contract_has_flag = meritocratic_military_appointment - vassal_contract_has_flag = celestial_military_appointment - vassal_contract_has_flag = celestial_grand_marshal_obligation - } - } - } - - # Army size - add = { - every_owned_title_maa_regiment = { - add = { - value = maa_size - } - } - desc = appointment_title_value.maa_size - } - - # Province size (to make larger provinces more attractive) - if = { - limit = { - tier >= tier_duchy - } - add = { - every_de_jure_county = { - add = 10 - } - desc = appointment_title_value.counties - } - } - add = { - every_title_to_title_neighboring_county = { - limit = { - holder.top_liege != prev.holder.top_liege - } - add = { - value = 10 - } - } - desc = appointment_title_value.neighboring_enemy_counties - } - # A protectorate is more attractive - if = { - limit = { - holder = { vassal_contract_has_flag = celestial_province_protectorate } - } - multiply = { - value = 2 - desc = appointment_title_value.protectorate - } - } - } - - # Minister titles - if = { - limit = { - holder ?= { - tgp_is_any_minister = yes - } - } - add = { - value = holder.top_liege.capital_province.monthly_income - multiply = 1000 - desc = appointment_title_value.capital_income - } - if = { - limit = { - title:h_china.holder = { - has_diarchy_type = grand_secretariat - OR = { - AND = { - has_realm_law = grand_chancellor_law - root = title:e_minister_chancellor - } - AND = { - has_realm_law = grand_marshal_law - root = title:e_minister_grand_marshal - } - AND = { - has_realm_law = grand_censor_law - root = title:e_minister_censor - } - } - } - } - add = { - value = 1000 - desc = appointment_title_value.diarch - } - } - if = { - limit = { - OR = { - this = title:e_minister_chancellor - this = title:e_minister_censor - this = title:e_minister_grand_marshal - } - } - add = { - value = 3500 - desc = appointment_title_value.minister - } - } - else_if = { - limit = { - OR = { - this = title:e_minister_of_personnel - this = title:e_minister_of_revenue - } - } - add = { - value = 3000 - desc = appointment_title_value.minister - } - } - else_if = { - limit = { - OR = { - this = title:e_minister_of_rites - this = title:e_minister_of_war - } - } - add = { - value = 2500 - desc = appointment_title_value.minister - } - } - else_if = { - limit = { - OR = { - this = title:e_minister_of_justice - this = title:e_minister_of_works - } - } - add = { - value = 2000 - desc = appointment_title_value.minister - } - } - } -} - -## Movement power -event_decrease_movement_power_minor_value = -5 -event_decrease_movement_power_medium_value = -10 -event_decrease_movement_power_major_value = -25 -event_increase_movement_power_major_value = 25 -event_increase_movement_power_medium_value = 10 -event_increase_movement_power_minor_value = 5 -event_increased_personal_movement_power_value = 15 - -# Events -subsidised_estate_value = { - value = 0 - - if = { - limit = { - has_variable = subsidised_estate_var - } - add = var:subsidised_estate_var - } - min = 1 - - desc = MODIFIER_DEFINITION_SUBSIDISED_ESTATE -} - -tgp_shared_bloc_cohesion_base_change_monthly_value = { - value = 0 - add = { - value = 0 - every_confederation_member_house = { add = -0.1 } - max = 0 - desc = "HOUSE_BLOC_COHESION_FROM_SIZE_HOUSE" - } - add = { - value = 0 - leading_house.house_head.top_liege ?= { - every_sub_realm_county = { - limit = { holder.house.house_confederation ?= root } - add = -0.05 - } - } - max = 0 - desc = "HOUSE_BLOC_COHESION_FROM_SIZE" - } - # TODO GAIN FROM FESTIVAL MODIFIERS GOES HERE -} - - -## Boost/Penalize bloc for having conforming/diverging members. -# -# Scopes -# ------ -# root: confederation/bloc -# house: Member house that we're checking -# -# -tgp_shared_bloc_cohesion_base_change_per_house_monthly_value = { - value = 0 - leading_house ?= { - if = { - limit = { - NOT = { this = scope:house } - } - if = { - limit = { - NOT = { has_same_house_aspiration_as = scope:house } - } - add = { - value = -0.25 - desc = "HOUSE_BLOC_COHESION_MISMATCHED_ASPIRATION" - } - } - else = { - add = { - value = 0.25 - if = { # Unlanded give less - limit = { - NOT = { - scope:house = { - any_house_member = { - is_landed = yes - top_liege = root.leading_house.house_head.top_liege - } - } - } - } - multiply = 0.5 - } - desc = "HOUSE_BLOC_COHESION_MATCHED_ASPIRATION" - } - } - } - } - scope:house.house_head = { - if = { - limit = { - NOT = { has_same_government = root.leading_house.house_head } - } - add = { - value = -1 - desc = "HOUSE_BLOC_COHESION_MISMATCHED_GOVERNMENT" - } - } - } - if = { - limit = { - leading_house.house_dynasty = { has_dynasty_perk = tgp_japan_legacy_1 } - leading_house.house_dynasty = scope:house.house_dynasty - scope:house != leading_house - } - add = { - value = tgp_dynasty_legacy_bloc_cohesion_value - desc = "HOUSE_BLOC_SAME_DYNASTY_LEGACY_PERK" - } - } -} - -tgp_shared_bloc_cohesion_contribution_value = { - value = scope:base_value - divide = scope:num_relations - divide = root.tgp_bloc_member_house_count_value -} - -tgp_shared_bloc_cohesion_soft_cap_value = { - value = 75 -} - -tgp_establish_soryo_administration_bloc_leader_count_value = { - value = 0 - every_in_list = { - list = bloc_leaders - add = 1 - } -} - -tgp_establish_soryo_administration_other_joiners_count_value = { - value = 0 - every_in_list = { - list = other_joiners - add = 1 - } -} - -#Aptitude Bonus for Dynasty Legacy -court_position_tgp_dynasty_legacy_aptitude_bonus = 10 - -#Bloc Joining Dynasty Legacy Bonus -tgp_legacy_japan_dynasty_bloc_bonus_value = 25 -#Bloc Joining Dynasty Lifestyle Perk -tgp_join_bloc_interaction_lifestyle_perk_value = 15 -#Bloc Cohesion Dynasty Legacy Bonus -tgp_dynasty_legacy_bloc_cohesion_value = 0.25 -#Hosting Festival Discount Legacy Perk -tgp_dynasty_legacy_perk_festival_discount_value = 0.2 - -# House Bloc Cohesion -cohesion_gain_minor = 0.25 -cohesion_gain_medium = 0.5 -cohesion_gain_major = 1 -cohesion_loss_minor = { - value = cohesion_gain_minor - multiply = -1 -} -cohesion_loss_medium = { - value = cohesion_gain_medium - multiply = -1 -} -cohesion_loss_major = { - value = cohesion_gain_major - multiply = -1 -} - -border_war_grace_period_days = { - value = 1095 -} - -border_war_grace_period_years = { - value = border_war_grace_period_days - divide = 365 - round = yes -} - -steppe_admin_target_counties_tributaries = { - value = 50 -} - -temp_num_qualifying_counties_count = { - value = 0 - every_sub_realm_county = { - limit = { - holder = { - is_governor_or_admin_count = yes - government_has_flag = government_has_merit - } - title_province = { - OR = { - has_holding_type = castle_holding - has_holding_type = church_holding - has_holding_type = city_holding - has_holding_type = temple_citadel_holding - } - } - } - add = 1 - } -} - -meritocratic_conversion_county_count = { - value = 30 -} - -return_to_steppe_county_requirement = { - value = 10 -} - -maitreya_devotee_army_value = { - value = 0 - if = { - limit = { - any_sub_realm_county = { - faith = root.faith - count <= 5 - } - } - add = 1000 - } - else_if = { - limit = { - any_sub_realm_county = { - faith = root.faith - count <= 10 - } - } - add = 500 - } - else_if = { - limit = { - any_sub_realm_county = { - faith = root.faith - count <= 20 - } - } - add = 400 - } - else_if = { - limit = { - any_sub_realm_county = { - faith = root.faith - count <= 30 - } - } - add = 300 - } - else_if = { - limit = { - any_sub_realm_county = { - faith = root.faith - count <= 50 - } - } - add = 200 - } - else = { - add = 100 - } - multiply = { - value = 0 - every_sub_realm_county = { - limit = { - faith = root.faith - } - add = 1 - } - } -} - -cranial_trophies_stolen_prestige_value = { - value = 0 - if = { - limit = { - scope:dead_character.prestige > 0 - } - add = scope:dead_character.prestige - } - multiply = 0.25 -} - -cranial_trophies_stolen_prestige_spiritual_fulfillment_value = { - value = 0 - if = { - limit = { - scope:dead_character.prestige > 0 - } - add = scope:dead_character.prestige - } - multiply = 0.01 - max = minor_spiritual_fulfillment_value -} - -tgp_ai_concubine_soft_cap = { - value = max_number_of_concubines - multiply = 0.5 -} - -silk_road_downstream_primary_value = 15 -silk_road_downstream_primary_negative_value = { - value = silk_road_downstream_primary_value - multiply = -1 -} -silk_road_downstream_secondary_value = 10 -silk_road_downstream_secondary_negative_value = { - value = silk_road_downstream_secondary_value - multiply = -1 -} -silk_road_downstream_tertiary_value = 5 -silk_road_downstream_tertiary_negative_value = { - value = silk_road_downstream_tertiary_value - multiply = -1 -} - -silk_road_steppe_market_built_value = 15 -silk_road_steppe_resettlement_value = 5 -silk_road_steppe_canal_built_primary_value = 30 -silk_road_steppe_canal_built_secondary_value = 20 -silk_road_steppe_canal_built_tertiary_value = 10 - -silk_road_stability_primary_value = 15 -silk_road_stability_secondary_value = 10 -silk_road_stability_tertiary_value = 5 - -silk_road_expand_steppe_value = 50 -silk_road_expand_steppe_negative_value = { - value = silk_road_expand_steppe_value - multiply = -1 -} -silk_road_raid_value = 10 -silk_road_raid_negative_value = { - value = silk_road_raid_value - multiply = -1 -} -silk_road_mongol_devastation_value = 15 -silk_road_mongol_devastation_negative_value = { - value = silk_road_mongol_devastation_value - multiply = -1 -} - -silk_road_byzantium_destroyed_value = 50 -silk_road_byzantium_destroyed_negative_value = { - value = silk_road_byzantium_destroyed_value - multiply = -1 -} -silk_road_steppe_iranian_intermezzo_ending_value = 15 -silk_road_steppe_iranian_intermezzo_unrest_value = 3 -silk_road_steppe_iranian_intermezzo_unrest_negative_value = { - value = silk_road_steppe_iranian_intermezzo_unrest_value - multiply = -1 -} - -silk_road_steppe_china_consolidation_value = 1000 -silk_road_steppe_china_consolidation_negative_value = { - value = silk_road_steppe_china_consolidation_value - multiply = -1 -} - -silk_road_steppe_china_stability_value = 5 - -innovation_cupellation_mine_tax_bonus_value = 0.15 - -innovation_champa_rice_tax_mult_value_1 = 0.02 -innovation_champa_rice_levy_size_value_1 = 0.02 -innovation_champa_rice_tax_mult_value_2 = 0.03 -innovation_champa_rice_levy_size_value_2 = 0.03 -innovation_champa_rice_development_growth_factor_value_2 = 0.05 -innovation_champa_rice_tax_mult_value_3 = 0.04 -innovation_champa_rice_levy_size_value_3 = 0.04 -innovation_champa_rice_development_growth_factor_value_3 = 0.05 -innovation_champa_rice_tax_mult_value_4 = 0.04 -innovation_champa_rice_levy_size_value_4 = 0.04 -innovation_champa_rice_development_growth_factor_value_4 = 0.05 - -innovation_block_printing_control_growth_value_1 = 0.02 -innovation_block_printing_development_growth_value_1 = 0.02 -innovation_block_printing_control_growth_value_2 = 0.03 -innovation_block_printing_development_growth_value_2 = 0.03 -innovation_block_printing_control_growth_value_3 = 0.04 -innovation_block_printing_development_growth_value_3 = 0.04 -innovation_block_printing_control_growth_value_4 = 0.05 -innovation_block_printing_development_growth_value_4 = 0.05 - -innovation_coking_development_growth_value_1 = 0.02 -innovation_coking_development_growth_value_2 = 0.03 -innovation_coking_development_growth_value_3 = 0.04 -innovation_coking_development_growth_value_4 = 0.05 - -tgp_chinese_decision_taoism_conversion_discount_value = 0.85 - -treasury_budget_law_change_legitimacy_loss_base = { - value = monumental_legitimacy_loss - if = { - limit = { highest_held_title_tier = tier_hegemony } - multiply = 1.5 - } -} - -governor_trait_counter_bonus_value = 0.05