From bbd44e2a61c72fcc01217a17235ba92ec66d1115 Mon Sep 17 00:00:00 2001 From: Fishedotjpg Date: Wed, 25 Feb 2026 04:40:35 +0000 Subject: [PATCH] Minority Community First Draft --- .../00_government_custom_loc.txt | 20 + .../tgp_custom_loc.txt | 2039 +++ .../buildings/00_estate_buildings.txt | 362 +- .../NEOW_minority_community_buildings.txt | 413 + .../domiciles/types/NEOW_domicile_types.txt | 1065 ++ common/dynasties/NEOW_dynasties.txt | 4 + common/flavorization/00_flavorization.txt | 6 + common/flavorization/00_title_holders.txt | 46 + common/flavorization/01_domicile.txt | 10 + common/game_concepts/neow_game_concepts.txt | 15 + common/governments/00_government_types.txt | 70 +- common/landed_titles/LAAMPs.txt | 14 + common/laws/00_succession_laws.txt | 2066 +++ common/on_action/title_on_actions.txt | 4602 ++++++ .../scripted_effects/00_building_effects.txt | 2978 ++++ .../07_dlc_ep3_scripted_effects.txt | 13465 ++++++++++++++++ .../00_available_for_events_triggers.txt | 934 ++ common/scripted_triggers/00_law_triggers.txt | 511 + .../scripted_triggers/00_legal_triggers.txt | 176 + .../minority_community_main.dds | 3 + gfx/interface/icons/flat_icons/minority.dds | 3 + .../landless_minority_government.dds | 3 + .../icons/map_icons/map_icon_minority.dds | 3 + gui/hud.gui | 8575 ++++++++++ gui/texticons.gui | 10 + history/characters/NEOW_e_britannia.txt | 13 + history/titles/NEOW_laamp_titles.txt | 13 + .../english/replace/buildings_l_english.yml | 45 +- .../zz_NEOW_dynasty_names_l_english.yml | 1 + 29 files changed, 37281 insertions(+), 184 deletions(-) create mode 100644 common/customizable_localization/tgp_custom_loc.txt create mode 100644 common/domiciles/buildings/NEOW_minority_community_buildings.txt create mode 100644 common/domiciles/types/NEOW_domicile_types.txt create mode 100644 common/laws/00_succession_laws.txt create mode 100644 common/on_action/title_on_actions.txt create mode 100644 common/scripted_effects/00_building_effects.txt create mode 100644 common/scripted_effects/07_dlc_ep3_scripted_effects.txt create mode 100644 common/scripted_triggers/00_available_for_events_triggers.txt create mode 100644 common/scripted_triggers/00_law_triggers.txt create mode 100644 common/scripted_triggers/00_legal_triggers.txt create mode 100644 gfx/interface/icons/domicile_building/minority_community_main.dds create mode 100644 gfx/interface/icons/flat_icons/minority.dds create mode 100644 gfx/interface/icons/government_types/landless_minority_government.dds create mode 100644 gfx/interface/icons/map_icons/map_icon_minority.dds create mode 100644 gui/hud.gui diff --git a/common/customizable_localization/00_government_custom_loc.txt b/common/customizable_localization/00_government_custom_loc.txt index 289d94e1..65c872db 100644 --- a/common/customizable_localization/00_government_custom_loc.txt +++ b/common/customizable_localization/00_government_custom_loc.txt @@ -888,6 +888,26 @@ GetGovernmentIcon = { } localization_key = adventurer_icon_concept } + text = { # Republic + trigger = { + trigger_if = { + limit = { + is_alive = no + } + has_government = landless_minority_government + } + trigger_else = { + trigger_if = { + limit = { is_ruler = yes } + government_has_flag = government_is_landless_minority + } + trigger_else = { + liege ?= { government_has_flag = government_is_landless_minority } + } + } + } + localization_key = minority_community_icon_concept + } text = { # Nomad trigger = { trigger_if = { diff --git a/common/customizable_localization/tgp_custom_loc.txt b/common/customizable_localization/tgp_custom_loc.txt new file mode 100644 index 00000000..b80ee605 --- /dev/null +++ b/common/customizable_localization/tgp_custom_loc.txt @@ -0,0 +1,2039 @@ +#Random Very Small Creature - so small it can reasonably fit inside a boot. +RandomVerySmallCreature = { + type = character + + random_valid = yes + + text = { + localization_key = a_toad + } + + text = { + localization_key = a_snake + } + + text = { + localization_key = a_grasshopper + } + + text = { + localization_key = a_mouse + } + + text = { + localization_key = a_rat + } + + text = { + localization_key = a_mole + } + + text = { + localization_key = a_hedgehog + } + + text = { + localization_key = a_spider + } +} + +#Should the very small creature be able to appear in more than just a boot? +RandomVerySmallCreatureDwelling = { + type = character + + random_valid = yes + + text = { + localization_key = a_boot + } + + text = { + localization_key = a_vase + } + + text = { + localization_key = a_stone_wall + } + + text = { + localization_key = a_crate + } + + text = { + localization_key = a_basket + } + + text = { + localization_key = a_tree_stump + } + + text = { + localization_key = a_plant_pot + } + + text = { + localization_key = a_helmet + } +} + +RandomPeasantGrievance = { + type = character + + random_valid = yes + + text = { + localization_key = pray_for_rain + } + + text = { + localization_key = pray_for_health + } + + text = { + localization_key = pray_for_gold + } + + text = { + localization_key = pray_for_love + } +} + +GetDomicileTypeConcept = { + type = character + + text = { + trigger = { + domicile ?= { is_domicile_type = japanese_manor } + } + localization_key = JAPANESE_MANOR + } + + text = { + trigger = { + domicile ?= { is_domicile_type = minority_community } + } + localization_key = MINORITY_COMMUNITY + } + text = { + trigger = { + NOT = { + domicile ?= { is_domicile_type = japanese_manor } + } + } + localization_key = ESTATE + fallback = yes + } +} + +GetDomicileType = { + type = character + + text = { + trigger = { + domicile ?= { is_domicile_type = japanese_manor } + } + localization_key = game_concept_manor + } + + text = { + trigger = { + domicile ?= { is_domicile_type = minority_community } + } + localization_key = game_concept_minority_community + } + text = { + trigger = { + NOT = { + domicile ?= { is_domicile_type = japanese_manor } + } + } + localization_key = game_concept_estate + fallback = yes + } +} + +GetRaidDomicileType = { + type = character + + text = { + trigger = { + domicile ?= { is_domicile_type = japanese_manor } + } + localization_key = raid_manor + } + + text = { + trigger = { + domicile ?= { is_domicile_type = minority_community } + } + localization_key = raid_minority_community + } + text = { + trigger = { + NOT = { + domicile ?= { is_domicile_type = japanese_manor } + } + } + localization_key = raid_estate + fallback = yes + } +} + +ActivityGetFaileesBothAll = { + type = character + + text = { + trigger = { var:num_exam_family_entrants_failed = 2 } + localization_key = FaileesBoth + } + + text = { + trigger = { var:num_exam_family_entrants_failed > 2 } + localization_key = FaileesAll + } +} + +ActivityGetSuccessfulBothAll = { + type = character + + text = { + trigger = { var:num_exam_family_entrants_passed = 2 } + localization_key = FaileesBoth + } + + text = { + trigger = { var:num_exam_family_entrants_passed > 2 } + localization_key = FaileesAll + } +} + +GetSinMisdeed = { + type = character + + text = { + trigger = { + root.religion = { is_in_family = rf_abrahamic } + } + localization_key = sin_concept + } + + text = { + trigger = { + NOT = { + root.religion = { is_in_family = rf_abrahamic } + } + } + localization_key = misdeed_concept + } +} + +GetSinMisdeedPlural = { + type = character + + parent = GetSinMisdeed + suffix = "_plural" +} + +GetSinfulShameful = { + type = character + + text = { + trigger = { + root.religion = { is_in_family = rf_abrahamic } + } + localization_key = sinful_concept + } + + text = { + trigger = { + NOT = { + root.religion = { is_in_family = rf_abrahamic } + } + } + localization_key = shameful_concept + } +} + +GetPiousBelievers = { + type = character + + text = { + trigger = { + root.religion = { is_in_family = rf_abrahamic } + } + localization_key = pious_concept + } + + text = { + trigger = { + NOT = { + root.religion = { is_in_family = rf_abrahamic } + } + } + localization_key = believers_concept + } +} + + +GetWickedDangerous = { + type = character + + text = { + trigger = { + root.religion = { is_in_family = rf_abrahamic } + } + localization_key = wicked_concept + } + + text = { + trigger = { + NOT = { + root.religion = { is_in_family = rf_abrahamic } + } + } + localization_key = dangerous_concept + } +} + +GetHeathenMiscreant = { + type = character + + text = { + trigger = { + root.religion = { is_in_family = rf_abrahamic } + } + localization_key = heathen_concept + } + + text = { + trigger = { + NOT = { + root.religion = { is_in_family = rf_abrahamic } + } + } + localization_key = miscreant_concept + } +} + +TeachingsAccordingToMovement = { + type = character + + text = { + trigger = { + top_participant_group:dynastic_cycle ?= { + OR = { + participant_group_type = hegemon_ruler + participant_group_type = pro_hegemon_movement + } + } + } + localization_key = TeachingsAccordingToMovementProHegemon_Teaching + } + text = { + trigger = { + top_participant_group:dynastic_cycle ?= { + participant_group_type = expansion_movement + } + } + localization_key = TeachingsAccordingToMovementExpansion_Teaching + } + text = { + trigger = { + top_participant_group:dynastic_cycle ?= { + participant_group_type = advancement_movement + } + } + localization_key = TeachingsAccordingToMovementAdvancement_Teaching + } + text = { + trigger = { + top_participant_group:dynastic_cycle ?= { + participant_group_type = conservative_movement + } + } + localization_key = TeachingsAccordingToMovementConservative_Teaching + } + text = { + trigger = { + top_participant_group:dynastic_cycle ?= { + participant_group_type = undecided_movement + } + } + localization_key = TeachingsAccordingToMovementUndecided_Teaching + } + text = { + fallback = yes + localization_key = TeachingsAccordingToMovementFallback_Teaching + } +} + +TeachingResponsesAccordingToMovement = { + type = character + + text = { + trigger = { + top_participant_group:dynastic_cycle ?= { + OR = { + participant_group_type = hegemon_ruler + participant_group_type = pro_hegemon_movement + } + } + } + localization_key = TeachingsAccordingToMovementProHegemon_Response + } + text = { + trigger = { + top_participant_group:dynastic_cycle ?= { + participant_group_type = expansion_movement + } + } + localization_key = TeachingsAccordingToMovementExpansion_Response + } + text = { + trigger = { + top_participant_group:dynastic_cycle ?= { + participant_group_type = advancement_movement + } + } + localization_key = TeachingsAccordingToMovementAdvancement_Response + } + text = { + trigger = { + top_participant_group:dynastic_cycle ?= { + participant_group_type = conservative_movement + } + } + localization_key = TeachingsAccordingToMovementConservative_Response + } + text = { + trigger = { + top_participant_group:dynastic_cycle ?= { + participant_group_type = undecided_movement + } + } + localization_key = TeachingsAccordingToMovementUndecided_Response + } + text = { + fallback = yes + localization_key = TeachingsAccordingToMovementFallback_Response + } +} + +GetRandomHistoryPassage = { + type = character + + random_valid = yes + + text = { + localization_key = five_sons_history + } + text = { + localization_key = hounds_history + } + text = { + localization_key = testamenary_history + } + text = { + localization_key = virtue_history + } + text = { + localization_key = oaths_history + } + text = { + localization_key = councels_history + } + text = { + localization_key = canon_history + } +} + +GetRandomPoetryPassage = { + type = character + + random_valid = yes + + text = { + localization_key = wei_poetry + } + text = { + localization_key = qi_poetry + } + text = { + localization_key = kuai_poetry + } + text = { + localization_key = decade_poetry + } + text = { + localization_key = sheng_poetry + } + text = { + localization_key = praise_poetry + } + text = { + localization_key = sacrificial_poetry + } +} + +GetRandomAncientChinesePoet = { + type = character + + random_valid = yes + + text = { + localization_key = wang_wei # Wang Wei + } + text = { + localization_key = tao_yuanming # Tao Yuanming + } + text = { + localization_key = li_bai # Li Bai + } + text = { + localization_key = du_fu # Du Fu + } + text = { + localization_key = meng_haoran # Meng Haoran + } + text = { + localization_key = liu_zongyuan # Liu Zongyuan + } + text = { + localization_key = bai_juyi # Bai Juyi + } +} + +GetRandomAnnalsPassage = { + type = character + + random_valid = yes + + text = { + localization_key = yin_annals + } + text = { + localization_key = huan_annals + } + text = { + localization_key = zhuang_annals + } + text = { + localization_key = min_annals + } + text = { + localization_key = xi_annals + } + text = { + localization_key = wen_annals + } + text = { + localization_key = xuan_annals + } + text = { + localization_key = cheng_annals + } +} + +GetRandomRitesPassage = { + type = character + + random_valid = yes + + text = { + localization_key = ai_rites + } + text = { + localization_key = implements_rites + } + text = { + localization_key = mourning_rites + } + text = { + localization_key = cap_rites + } + text = { + localization_key = scholar_rites + } + text = { + localization_key = banquet_rites + } + text = { + localization_key = doctrine_rites + } + text = { + localization_key = pattern_rites + } +} + +GetRegionalPoetryExam = { + type = character + + text = { + trigger = { + has_government = celestial_government + } + localization_key = four_part_poetry_china + } + text = { + trigger = { + has_government = meritocratic_government + } + localization_key = four_part_poetry_korea + } +} + +GetArtifactDecayDesc = { + type = artifact + + random_valid = yes + + text = { + trigger = { + OR = { + artifact_type = armor_mail + artifact_type = armor_plate + artifact_type = armor_lamellar + artifact_type = armor_laminar + artifact_type = armor_brigandine + artifact_type = miscellaneous + artifact_type = brooch + artifact_type = brooch_pedestal + artifact_type = necklace + artifact_type = regalia + artifact_type = spear + artifact_type = dagger + artifact_type = sword + artifact_type = mace + artifact_type = goblet + } + } + localization_key = artifact_decay_scratched + } + + text = { + trigger = { + OR = { + artifact_type = dagger + artifact_type = sword + artifact_type = mace + artifact_type = axe + artifact_type = hammer + } + } + localization_key = artifact_decay_dull + } + + text = { + trigger = { + OR = { + artifact_type = book + artifact_type = wall_big + artifact_type = wall_small + } + } + localization_key = artifact_decay_torn + } + + text = { + trigger = { + OR = { + artifact_type = sculpture + artifact_type = throne + artifact_type = miscellaneous + } + } + localization_key = artifact_decay_cracked + } + + text = { + trigger = { + OR = { + artifact_type = sculpture + artifact_type = throne + artifact_type = miscellaneous + artifact_type = brooch + artifact_type = brooch_pedestal + } + } + localization_key = artifact_decay_fracture + } + + text = { + fallback = yes + localization_key = artifact_decay_worn + } +} + +GetExamFocusSkill = { + type = activity + + #Capital Examination + text = { + trigger = { + has_activity_option = { + category = special_type + option = imperial_examination_focus_martial + } + } + localization_key = exam_focus_martial + } + text = { + trigger = { + has_activity_option = { + category = special_type + option = imperial_examination_focus_learning + } + } + localization_key = exam_focus_learning + } + text = { + trigger = { + has_activity_option = { + category = special_type + option = imperial_examination_focus_stewardship + } + } + localization_key = exam_focus_stewardship + } +} + +GetTurbanRebellionColor = { + type = all + text = { + trigger = { + has_global_variable = old_dynastic_color_is_red + } + localization_key = red + } + text = { + trigger = { + has_global_variable = old_dynastic_color_is_green + } + localization_key = green + } + text = { + trigger = { + has_global_variable = old_dynastic_color_is_white + } + localization_key = white + } + text = { + trigger = { + has_global_variable = old_dynastic_color_is_black + } + localization_key = black + } + text = { + trigger = { + has_global_variable = old_dynastic_color_is_yellow + } + localization_key = yellow + } +} + +GetCiPoemName = { + type = character + random_valid = yes + + #If Poem Tune is set we take that, otherwise it is random + #To accomplish this all entries must exist check scope:poem_tune in trigger_if + + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:riverside_city + } + } + localization_key = riverside_city + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:green_jade_bowl + } + } + localization_key = green_jade_bowl + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:scent_fills_the_hall + } + } + localization_key = scent_fills_the_hall + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:lady_yu + } + } + localization_key = lady_yu + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:butterflies_love_blossoms + } + } + localization_key = butterflies_love_blossoms + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:plucking_mulberry_leafs + } + } + localization_key = plucking_mulberry_leafs + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:rivertown_man + } + } + localization_key = rivertown_man + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:spring_in_the_han_palace + } + } + localization_key = spring_in_the_han_palace + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:winds_between_pine_trees + } + } + localization_key = winds_between_pine_trees + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:memories_of_the_past_at_red_cliff + } + } + localization_key = memories_of_the_past_at_red_cliff + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:my_wrath_bristles_through_my_helmet + } + } + localization_key = my_wrath_bristles_through_my_helmet + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:thinking_of_the_past_at_beigu_pavilion + } + } + localization_key = thinking_of_the_past_at_beigu_pavilion + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:dream_song + } + } + localization_key = dream_song + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:as_in_a_dream + } + } + localization_key = as_in_a_dream + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:immortal_by_the_river + } + } + localization_key = immortal_by_the_river + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:longing_for_qin_e + } + } + localization_key = longing_for_qin_e + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:new_chrysanthemum_flowers + } + } + localization_key = new_chrysanthemum_flowers + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:poluomen_son + } + } + localization_key = poluomen_son + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:pouring_out_deep_emotions + } + } + localization_key = pouring_out_deep_emotions + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:rain_hits_a_bell + } + } + localization_key = rain_hits_a_bell + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:spring_in_the_tower_of_jade + } + } + localization_key = spring_in_the_tower_of_jade + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:drunk_in_the_fairyland + } + } + localization_key = drunk_in_the_fairyland + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:anxiety_of_a_beauty + } + } + localization_key = anxiety_of_a_beauty + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:writing_of_my_sorrow + } + } + localization_key = writing_of_my_sorrow + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:sad_remembrance + } + } + localization_key = sad_remembrance + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:on_the_advent_of_spring + } + } + localization_key = on_the_advent_of_spring + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:silk_washing_stream + } + } + localization_key = silk_washing_stream + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:at_an_inn_in_xinshi + } + } + localization_key = at_an_inn_in_xinshi + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:on_red_lotus_petals + } + } + localization_key = on_red_lotus_petals + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:pusa_man + } + } + localization_key = pusa_man + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:a_quiet_night + } + } + localization_key = a_quiet_night + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:huanxi_sand + } + } + localization_key = huanxi_sand + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:overlapping_golden_light_of_small_hills + } + } + localization_key = overlapping_golden_light_of_small_hills + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:the_river_is_red + } + } + localization_key = the_river_is_red + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:the_road_is_difficult + } + } + localization_key = the_road_is_difficult + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:phoenix_hairpin + } + } + localization_key = phoenix_hairpin + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:boating_on_tai_lake + } + } + localization_key = boating_on_tai_lake + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:prelude_to_the_water_song + } + } + localization_key = prelude_to_the_water_song + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:rambling_young_man + } + } + localization_key = rambling_young_man + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:king_of_lanling + } + } + localization_key = king_of_lanling + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:washing_creek_sands + } + } + localization_key = washing_creek_sands + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:magnolia_blossoms + } + } + localization_key = magnolia_blossoms + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:petals_falling_in_the_river + } + } + localization_key = petals_falling_in_the_river + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:my_way_passed_ancient_tombs + } + } + localization_key = my_way_passed_ancient_tombs + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:dreaming_of_the_south_side_of_the_river + } + } + localization_key = dreaming_of_the_south_side_of_the_river + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:beautiful_barbarian + } + } + localization_key = beautiful_barbarian + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:missing_the_emperors_hometown + } + } + localization_key = missing_the_emperors_hometown + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:daoist_priestess + } + } + localization_key = daoist_priestess + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:a_bushel_of_pearls + } + } + localization_key = a_bushel_of_pearls + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:bodhisattva_barbarian + } + } + localization_key = bodhisattva_barbarian + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:clear_and_even_music + } + } + localization_key = clear_and_even_music + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:lost_battle + } + } + localization_key = lost_battle + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:beauty_yu + } + } + localization_key = beauty_yu + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:crows_cry_at_night + } + } + localization_key = crows_cry_at_night + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:phoenix_perched_on_the_parasol_tree + } + } + localization_key = phoenix_perched_on_the_parasol_tree + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:imperial_avenue_procession + } + } + localization_key = imperial_avenue_procession + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:rain_hits_a_bell + } + } + localization_key = rain_hits_a_bell + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:divination_song + } + } + localization_key = divination_song + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:attached_to_her_skirt + } + } + localization_key = attached_to_her_skirt + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:partridge_sky + } + } + localization_key = partridge_sky + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:mountain_hawthorn + } + } + localization_key = mountain_hawthorn + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:the_song_of_tangduo + } + } + localization_key = the_song_of_tangduo + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:the_song_of_tangduo + } + } + localization_key = the_song_of_tangduo + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:fragrance_filling_the_hall + } + } + localization_key = fragrance_filling_the_hall + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:the_water_clock_sings_at_night + } + } + localization_key = the_water_clock_sings_at_night + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:butterflies_kiss_flowers + } + } + localization_key = butterflies_kiss_flowers + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poem_tune + } + scope:poem_tune = flag:picking_mulberry + } + } + localization_key = picking_mulberry + } +} + +GetCiPoemTheme = { + type = character + random_valid = yes + + #If Poem Theme is set we take that, otherwise it is random + #To accomplish this all entries must exist check scope:poem_theme in trigger_if + + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poetry_theme + } + scope:poetry_theme = flag:love + } + } + localization_key = ci_poem_theme_love + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poetry_theme + } + scope:poetry_theme = flag:nature + } + } + localization_key = ci_poem_theme_nature + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poetry_theme + } + scope:poetry_theme = flag:longing + } + } + localization_key = ci_poem_theme_longing + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poetry_theme + } + scope:poetry_theme = flag:separation + } + } + localization_key = ci_poem_theme_separation + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poetry_theme + } + scope:poetry_theme = flag:sadness_and_pain + } + } + localization_key = ci_poem_theme_sadness_and_pain + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poetry_theme + } + scope:poetry_theme = flag:philosophy + } + } + localization_key = ci_poem_theme_philosophy + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poetry_theme + } + scope:poetry_theme = flag:mythological_events + } + } + localization_key = ci_poem_theme_mythological_events + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poetry_theme + } + scope:poetry_theme = flag:daily_chores + } + } + localization_key = ci_poem_theme_daily_chores + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:poetry_theme + } + scope:poetry_theme = flag:historical_events + } + } + localization_key = ci_poem_theme_historical_events + } +} + +GetCiPoemQuality = { + type = character + random_valid = yes + + #Poem Quality - Should always be set, but the key will work without it + + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:quality_of_artifact + } + scope:quality_of_artifact = flag:weak + } + } + localization_key = ci_poem_description_weak + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:quality_of_artifact + } + scope:quality_of_artifact = flag:mid + } + } + localization_key = ci_poem_description_mid + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:quality_of_artifact + } + scope:quality_of_artifact = flag:great + } + } + localization_key = ci_poem_description_great + } +} + +#Prose Description + +GetProseTheme = { + type = character + random_valid = yes + + #If Prose Theme is set we take that, otherwise it is random + #To accomplish this all entries must exist check scope:prose_theme in trigger_if + + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:prose_theme + } + scope:prose_theme = flag:commentary_on_the_four_books + } + } + localization_key = prose_theme_comentary + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:prose_theme + } + scope:prose_theme = flag:logic + } + } + localization_key = prose_theme_logic + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:prose_theme + } + scope:prose_theme = flag:critiquing_opponents + } + } + localization_key = prose_theme_critiquing_opponents + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:prose_theme + } + scope:prose_theme = flag:sentiments + } + } + localization_key = prose_theme_sentiments + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:prose_theme + } + scope:prose_theme = flag:betterment + } + } + localization_key = prose_theme_betterment + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:prose_theme + } + scope:prose_theme = flag:human_existance + } + } + localization_key = prose_theme_human_existance + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:prose_theme + } + scope:prose_theme = flag:prose_theme_lands_ideals + } + } + localization_key = prose_theme_lands_ideals + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:prose_theme + } + scope:prose_theme = flag:rewriting_history + } + } + localization_key = prose_theme_rewriting_history + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:prose_theme + } + scope:prose_theme = flag:bio + } + } + localization_key = prose_theme_bio + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:prose_theme + } + scope:prose_theme = flag:emperor + } + } + localization_key = prose_theme_emperor + } +} + +GetProseTopic = { + type = character + random_valid = yes + + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:topic + } + scope:topic = flag:prose_philosophy + } + } + localization_key = prose_theme_philosophy + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:topic + } + scope:topic = flag:prose_history + } + } + localization_key = prose_topic_history + } + +} + +GetProseQuality = { + type = character + random_valid = yes + + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:quality_of_artifact + } + scope:quality_of_artifact = flag:weak + } + } + localization_key = prose_quality_weak + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:quality_of_artifact + } + scope:quality_of_artifact = flag:mid + } + } + localization_key = prose_quality_mid + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:quality_of_artifact + } + scope:quality_of_artifact = flag:great + } + } + localization_key = prose_quality_great + } +} + +#Monograph Description + + +GetMonographTheme = { + type = character + random_valid = yes + + #If Poem Theme is set we take that, otherwise it is random + #To accomplish this all entries must exist check scope:poem_theme in trigger_if + + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:monograph_theme + } + scope:monograph_theme = flag:home_duchy + } + } + localization_key = monograph_theme_home_duchy + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:monograph_theme + } + scope:monograph_theme = flag:home_kingdom + } + } + localization_key = monograph_theme_home_kingdom + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:monograph_theme + } + scope:monograph_theme = flag:home_empire + } + } + localization_key = monograph_theme_home_empire + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:monograph_theme + } + scope:monograph_theme = flag:home_hegemony + } + } + localization_key = monograph_theme_home_hegemony + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:monograph_theme + } + scope:monograph_theme = flag:point_of_interest + } + } + localization_key = monograph_theme_point_of_interest + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:monograph_theme + } + scope:monograph_theme = flag:commentary_on_earlier_works + } + } + localization_key = monograph_theme_commentary_on_earlier_works + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:monograph_theme + } + scope:monograph_theme = flag:algebraic_geometry + } + } + localization_key = monograph_theme_algebraic_geometry + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:monograph_theme + } + scope:monograph_theme = flag:linear_algebra + } + } + localization_key = monograph_theme_linear_algebra + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:monograph_theme + } + scope:monograph_theme = flag:spherical_trigonometry + } + } + localization_key = monograph_theme_spherical_trigonometry + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:monograph_theme + } + scope:monograph_theme = flag:computational_studies + } + } + localization_key = monograph_theme_computational_studies + } + + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:monograph_theme + } + scope:monograph_theme = flag:method_of_solving_simultaneous_congruences + } + } + localization_key = monograph_theme_method_of_solving_simultaneous_congruences + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:monograph_theme + } + scope:monograph_theme = flag:magic_squares_magic_circles + } + } + localization_key = monograph_theme_magic_squares_magic_circles + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:monograph_theme + } + scope:monograph_theme = flag:teaching_overview_of_all_mathematical_methods + } + } + localization_key = monograph_theme_teaching_overview_of_all_mathematical_methods + } +} + +GetMonographTopic = { + type = character + random_valid = yes + + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:topic + } + scope:topic = flag:monograph_mathematics + } + } + localization_key = monograph_topic_mathematics + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:topic + } + scope:topic = flag:monograph_geography + } + } + localization_key = monograph_topic_geography + } +} + +GetMonographQuality = { + type = character + random_valid = yes + + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:quality_of_artifact + } + scope:quality_of_artifact = flag:weak + } + } + localization_key = monograph_description_quality_weak + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:quality_of_artifact + } + scope:quality_of_artifact = flag:mid + } + } + localization_key = monograph_description_quality_mid + } + text = { + trigger = { + trigger_if = { + limit = { + exists = scope:quality_of_artifact + } + scope:quality_of_artifact = flag:great + } + } + localization_key = monograph_description_quality_great + } +} diff --git a/common/domiciles/buildings/00_estate_buildings.txt b/common/domiciles/buildings/00_estate_buildings.txt index ce30cef1..fc517a2d 100644 --- a/common/domiciles/buildings/00_estate_buildings.txt +++ b/common/domiciles/buildings/00_estate_buildings.txt @@ -425,7 +425,7 @@ estate_main_05 = { ### Diplomacy Upgrade living_quarters_01 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = estate_main_01 @@ -462,7 +462,7 @@ living_quarters_01 = { } living_quarters_02 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = living_quarters_01 @@ -501,7 +501,7 @@ living_quarters_02 = { } living_quarters_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = living_quarters_02 @@ -543,7 +543,7 @@ living_quarters_03 = { } living_quarters_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = living_quarters_03 @@ -588,7 +588,7 @@ living_quarters_04 = { ### Martial Upgrade trophy_room_01 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = estate_main_01 @@ -620,7 +620,7 @@ trophy_room_01 = { } trophy_room_02 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = trophy_room_01 @@ -653,7 +653,7 @@ trophy_room_02 = { } trophy_room_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = trophy_room_02 @@ -694,7 +694,7 @@ trophy_room_03 = { } trophy_room_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = trophy_room_03 @@ -738,7 +738,7 @@ trophy_room_04 = { ### Stewardship Upgrade office_01 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = estate_main_01 @@ -775,7 +775,7 @@ office_01 = { } office_02 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = office_01 @@ -813,7 +813,7 @@ office_02 = { } office_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = office_02 @@ -856,7 +856,7 @@ office_03 = { } office_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = office_03 @@ -902,7 +902,7 @@ office_04 = { ### Intrigue Upgrade servants_quarters_01 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = estate_main_01 @@ -935,7 +935,7 @@ servants_quarters_01 = { } servants_quarters_02 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = servants_quarters_01 @@ -971,7 +971,7 @@ servants_quarters_02 = { } servants_quarters_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = servants_quarters_02 @@ -1012,7 +1012,7 @@ servants_quarters_03 = { } servants_quarters_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = servants_quarters_03 @@ -1057,7 +1057,7 @@ servants_quarters_04 = { ### Learning Upgrade library_01 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = estate_main_01 @@ -1089,7 +1089,7 @@ library_01 = { } library_02 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = library_01 @@ -1127,7 +1127,7 @@ library_02 = { # Observatory sub-branch library_observatory_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = library_02 @@ -1168,7 +1168,7 @@ library_observatory_03 = { } library_observatory_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = library_observatory_03 @@ -1211,7 +1211,7 @@ library_observatory_04 = { # Education sub-branch library_education_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = library_02 @@ -1252,7 +1252,7 @@ library_education_03 = { } library_education_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = library_education_03 @@ -1297,7 +1297,7 @@ library_education_04 = { ### Bath bath_01 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = estate_main_01 @@ -1334,7 +1334,7 @@ bath_01 = { } bath_02 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = bath_01 @@ -1372,7 +1372,7 @@ bath_02 = { } bath_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = bath_02 @@ -1414,7 +1414,7 @@ bath_03 = { } bath_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = bath_03 @@ -1458,7 +1458,7 @@ bath_04 = { ### Guest Room guest_room_01 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = estate_main_01 @@ -1499,7 +1499,7 @@ guest_room_01 = { } guest_room_02 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = guest_room_01 @@ -1543,7 +1543,7 @@ guest_room_02 = { } guest_room_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = guest_room_02 @@ -1592,7 +1592,7 @@ guest_room_03 = { } guest_room_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = guest_room_03 @@ -1640,7 +1640,7 @@ guest_room_04 = { } guest_room_05 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = guest_room_04 @@ -1689,7 +1689,7 @@ guest_room_05 = { } guest_room_06 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = guest_room_05 @@ -1739,7 +1739,7 @@ guest_room_06 = { ### Wine Cellar wine_cellar_01 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = estate_main_01 @@ -1781,7 +1781,7 @@ wine_cellar_01 = { } wine_cellar_02 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = wine_cellar_01 @@ -1823,7 +1823,7 @@ wine_cellar_02 = { } wine_cellar_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = wine_cellar_02 @@ -1867,7 +1867,7 @@ wine_cellar_03 = { ### Courtyard courtyard_01 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = estate_main_01 @@ -1903,7 +1903,7 @@ courtyard_01 = { } courtyard_02 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = courtyard_01 @@ -1940,7 +1940,7 @@ courtyard_02 = { } courtyard_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = courtyard_02 @@ -1981,7 +1981,7 @@ courtyard_03 = { } courtyard_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = courtyard_03 @@ -2024,7 +2024,7 @@ courtyard_04 = { ### Prison prison_01 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = estate_main_01 @@ -2069,7 +2069,7 @@ prison_01 = { } prison_02 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = prison_01 @@ -2118,7 +2118,7 @@ prison_02 = { } prison_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = prison_02 @@ -2172,7 +2172,7 @@ prison_03 = { } prison_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = prison_03 @@ -2228,7 +2228,7 @@ prison_04 = { ### Reception Hall reception_hall_01 = { construction_time = 1000 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = estate_main_01 @@ -2270,7 +2270,7 @@ reception_hall_01 = { reception_hall_02 = { construction_time = 1000 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = reception_hall_01 @@ -2313,7 +2313,7 @@ reception_hall_02 = { reception_hall_03 = { construction_time = 1000 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = reception_hall_02 @@ -2357,7 +2357,7 @@ reception_hall_03 = { reception_hall_04 = { construction_time = 1000 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = reception_hall_03 @@ -2401,7 +2401,7 @@ reception_hall_04 = { reception_hall_05 = { construction_time = 1000 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = reception_hall_04 @@ -2446,7 +2446,7 @@ reception_hall_05 = { ### Cabinet of Curiosities cabinet_of_curiosities_01 = { construction_time = 1000 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = estate_main_01 @@ -2490,7 +2490,7 @@ cabinet_of_curiosities_01 = { cabinet_of_curiosities_02 = { construction_time = 1000 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = cabinet_of_curiosities_01 @@ -2544,7 +2544,7 @@ cabinet_of_curiosities_02 = { cabinet_of_curiosities_03 = { construction_time = 1000 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = cabinet_of_curiosities_02 @@ -2601,7 +2601,7 @@ cabinet_of_curiosities_03 = { #Grand Solar grand_solar_01 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = estate_main_01 @@ -2642,7 +2642,7 @@ grand_solar_01 = { grand_solar_02 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = grand_solar_01 @@ -2683,7 +2683,7 @@ grand_solar_02 = { grand_solar_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = grand_solar_02 @@ -2726,7 +2726,7 @@ grand_solar_03 = { grand_solar_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } slot_type = internal previous_building = grand_solar_03 @@ -2778,7 +2778,7 @@ grand_solar_04 = { ### Temple Building temple_small_01 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } can_construct = { NOT = { @@ -2918,7 +2918,7 @@ temple_small_01 = { } temple_small_02 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = temple_small_01 cost = { @@ -3053,7 +3053,7 @@ temple_small_02 = { } temple_small_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = temple_small_02 can_construct = { @@ -3194,7 +3194,7 @@ temple_small_03 = { # Crypt sub-branch temple_crypt_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = temple_small_03 can_construct = { @@ -3348,7 +3348,7 @@ temple_crypt_04 = { } temple_crypt_05 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = temple_crypt_04 can_construct = { @@ -3502,7 +3502,7 @@ temple_crypt_05 = { } temple_crypt_06 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = temple_crypt_05 can_construct = { @@ -3659,7 +3659,7 @@ temple_crypt_06 = { # Temple sub-branch temple_large_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = temple_small_03 can_construct = { @@ -3801,7 +3801,7 @@ temple_large_04 = { } temple_large_05 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = temple_large_04 can_construct = { @@ -3943,7 +3943,7 @@ temple_large_05 = { } temple_large_06 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = temple_large_05 can_construct = { @@ -4089,7 +4089,7 @@ temple_large_06 = { # Monastery sub-branch temple_monastery_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = temple_small_03 can_construct = { @@ -4234,7 +4234,7 @@ temple_monastery_04 = { } temple_monastery_05 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = temple_monastery_04 can_construct = { @@ -4379,7 +4379,7 @@ temple_monastery_05 = { } temple_monastery_06 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = temple_monastery_05 can_construct = { @@ -4526,7 +4526,7 @@ temple_monastery_06 = { ### Barracks barracks_01 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } cost = { gold = { @@ -4609,7 +4609,7 @@ barracks_01 = { } barracks_02 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = barracks_01 cost = { @@ -4697,7 +4697,7 @@ barracks_02 = { } barracks_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = barracks_02 can_construct = { @@ -4789,7 +4789,7 @@ barracks_03 = { } barracks_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = barracks_03 can_construct = { @@ -4881,7 +4881,7 @@ barracks_04 = { } barracks_05 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = barracks_04 can_construct = { @@ -4973,7 +4973,7 @@ barracks_05 = { } barracks_06 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = barracks_05 can_construct = { @@ -5067,7 +5067,7 @@ barracks_06 = { ### Watchtower watchtower_01 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } cost = { gold = { @@ -5148,7 +5148,7 @@ watchtower_01 = { } watchtower_02 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = watchtower_01 cost = { @@ -5232,7 +5232,7 @@ watchtower_02 = { } watchtower_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = watchtower_02 can_construct = { @@ -5320,7 +5320,7 @@ watchtower_03 = { } watchtower_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = watchtower_03 can_construct = { @@ -5409,7 +5409,7 @@ watchtower_04 = { } watchtower_05 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = watchtower_04 can_construct = { @@ -5498,7 +5498,7 @@ watchtower_05 = { } watchtower_06 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = watchtower_05 can_construct = { @@ -5590,7 +5590,7 @@ watchtower_06 = { ### Guardhouse guardhouse_01 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } cost = { gold = { @@ -5671,7 +5671,7 @@ guardhouse_01 = { } guardhouse_02 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = guardhouse_01 cost = { @@ -5754,7 +5754,7 @@ guardhouse_02 = { } guardhouse_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = guardhouse_02 can_construct = { @@ -5843,7 +5843,7 @@ guardhouse_03 = { } guardhouse_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = guardhouse_03 can_construct = { @@ -5934,7 +5934,7 @@ guardhouse_04 = { ### Garden garden_01 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } cost = { gold = { @@ -6054,7 +6054,7 @@ garden_01 = { } garden_02 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = garden_01 cost = { @@ -6175,7 +6175,7 @@ garden_02 = { } garden_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = garden_02 cost = { @@ -6298,7 +6298,7 @@ garden_03 = { # Leisure Garden sub-branch garden_leisure_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = garden_03 can_construct = { @@ -6425,7 +6425,7 @@ garden_leisure_04 = { } garden_leisure_05 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = garden_leisure_04 can_construct = { @@ -6552,7 +6552,7 @@ garden_leisure_05 = { } garden_leisure_06 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = garden_leisure_05 can_construct = { @@ -6681,7 +6681,7 @@ garden_leisure_06 = { # Fruit Garden sub-branch garden_fruit_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = garden_03 can_construct = { @@ -6807,7 +6807,7 @@ garden_fruit_04 = { } garden_fruit_05 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = garden_fruit_04 can_construct = { @@ -6933,7 +6933,7 @@ garden_fruit_05 = { } garden_fruit_06 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = garden_fruit_05 can_construct = { @@ -7060,7 +7060,7 @@ garden_fruit_06 = { ### Stable stable_01 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } cost = { gold = { @@ -7142,7 +7142,7 @@ stable_01 = { } stable_02 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = stable_01 cost = { @@ -7229,7 +7229,7 @@ stable_02 = { } stable_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = stable_02 cost = { @@ -7318,7 +7318,7 @@ stable_03 = { # Grand Stable sub-branch stable_grand_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = stable_03 can_construct = { @@ -7403,7 +7403,7 @@ stable_grand_04 = { } stable_grand_05 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = stable_grand_04 can_construct = { @@ -7489,7 +7489,7 @@ stable_grand_05 = { } stable_grand_06 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = stable_grand_05 can_construct = { @@ -7577,7 +7577,7 @@ stable_grand_06 = { # Kennel sub-branch stable_kennel_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = stable_03 can_construct = { @@ -7671,7 +7671,7 @@ stable_kennel_04 = { } stable_kennel_05 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = stable_kennel_04 can_construct = { @@ -7766,7 +7766,7 @@ stable_kennel_05 = { } stable_kennel_06 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = stable_kennel_05 can_construct = { @@ -7864,7 +7864,7 @@ stable_kennel_06 = { # Charioteer sub-branch (Byzantine unique upgrade) stable_chariot_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = stable_03 can_construct_potential = { @@ -7948,7 +7948,7 @@ stable_chariot_04 = { } stable_chariot_05 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = stable_chariot_04 can_construct = { @@ -8033,7 +8033,7 @@ stable_chariot_05 = { } stable_chariot_06 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = stable_chariot_05 can_construct = { @@ -8120,7 +8120,7 @@ stable_chariot_06 = { ### Workshop workshop_01 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } cost = { gold = { @@ -8195,7 +8195,7 @@ workshop_01 = { } workshop_02 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = workshop_01 cost = { @@ -8273,7 +8273,7 @@ workshop_02 = { # Carpenter sub-branch workshop_carpenter_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = workshop_02 can_construct = { @@ -8357,7 +8357,7 @@ workshop_carpenter_03 = { } workshop_carpenter_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = workshop_carpenter_03 can_construct = { @@ -8441,7 +8441,7 @@ workshop_carpenter_04 = { } workshop_carpenter_05 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = workshop_carpenter_04 can_construct = { @@ -8526,7 +8526,7 @@ workshop_carpenter_05 = { } workshop_carpenter_06 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = workshop_carpenter_05 can_construct = { @@ -8613,7 +8613,7 @@ workshop_carpenter_06 = { # Mason sub-branch workshop_mason_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = workshop_02 can_construct = { @@ -8695,7 +8695,7 @@ workshop_mason_03 = { } workshop_mason_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = workshop_mason_03 can_construct = { @@ -8777,7 +8777,7 @@ workshop_mason_04 = { } workshop_mason_05 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = workshop_mason_04 can_construct = { @@ -8861,7 +8861,7 @@ workshop_mason_05 = { } workshop_mason_06 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = workshop_mason_05 can_construct = { @@ -8947,7 +8947,7 @@ workshop_mason_06 = { # Textile sub-branch workshop_textile_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = workshop_02 can_construct = { @@ -9031,7 +9031,7 @@ workshop_textile_03 = { } workshop_textile_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = workshop_textile_03 can_construct = { @@ -9115,7 +9115,7 @@ workshop_textile_04 = { } workshop_textile_05 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = workshop_textile_04 can_construct = { @@ -9199,7 +9199,7 @@ workshop_textile_05 = { } workshop_textile_06 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = workshop_textile_05 can_construct = { @@ -9285,7 +9285,7 @@ workshop_textile_06 = { ### Storage storage_01 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } cost = { gold = { @@ -9369,7 +9369,7 @@ storage_01 = { } storage_02 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = storage_01 cost = { @@ -9456,7 +9456,7 @@ storage_02 = { # Warehouse sub-branch storage_warehouse_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = storage_02 can_construct = { @@ -9540,7 +9540,7 @@ storage_warehouse_03 = { } storage_warehouse_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = storage_warehouse_03 can_construct = { @@ -9626,7 +9626,7 @@ storage_warehouse_04 = { # Granary sub-branch storage_granary_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = storage_02 can_construct = { @@ -9713,7 +9713,7 @@ storage_granary_03 = { } storage_granary_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = storage_granary_03 can_construct = { @@ -9806,7 +9806,7 @@ storage_granary_04 = { ### Market market_01 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } cost = { gold = { @@ -9894,7 +9894,7 @@ market_01 = { } market_02 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = market_01 cost = { @@ -9974,7 +9974,7 @@ market_02 = { } market_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = market_02 can_construct = { @@ -10059,7 +10059,7 @@ market_03 = { } market_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = market_03 can_construct = { @@ -10144,7 +10144,7 @@ market_04 = { } market_05 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = market_04 can_construct = { @@ -10229,7 +10229,7 @@ market_05 = { } market_06 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = market_05 can_construct = { @@ -10316,7 +10316,7 @@ market_06 = { ### Grazing Lands grazing_land_01 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } cost = { gold = { @@ -10436,7 +10436,7 @@ grazing_land_01 = { } grazing_land_02 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = grazing_land_01 cost = { @@ -10557,7 +10557,7 @@ grazing_land_02 = { } grazing_land_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = grazing_land_02 cost = { @@ -10678,7 +10678,7 @@ grazing_land_03 = { } grazing_land_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = grazing_land_03 can_construct = { @@ -10790,7 +10790,7 @@ grazing_land_04 = { } grazing_land_05 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = grazing_land_04 can_construct = { @@ -10902,7 +10902,7 @@ grazing_land_05 = { } grazing_land_06 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = grazing_land_05 can_construct = { @@ -11016,7 +11016,7 @@ grazing_land_06 = { # Horse Archer sub-branch horse_pasture_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = grazing_land_03 can_construct = { @@ -11122,7 +11122,7 @@ horse_pasture_04 = { } horse_pasture_05 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = horse_pasture_04 can_construct = { @@ -11228,7 +11228,7 @@ horse_pasture_05 = { } horse_pasture_06 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = horse_pasture_05 can_construct = { @@ -11336,7 +11336,7 @@ horse_pasture_06 = { # Camel sub-branch camel_pasture_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = grazing_land_03 can_construct = { @@ -11442,7 +11442,7 @@ camel_pasture_04 = { } camel_pasture_05 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = camel_pasture_04 can_construct = { @@ -11548,7 +11548,7 @@ camel_pasture_05 = { } camel_pasture_06 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = camel_pasture_05 can_construct = { @@ -11656,7 +11656,7 @@ camel_pasture_06 = { # Elephant sub-branch elephant_pasture_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = grazing_land_03 can_construct = { @@ -11738,7 +11738,7 @@ elephant_pasture_04 = { } elephant_pasture_05 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = elephant_pasture_04 can_construct = { @@ -11820,7 +11820,7 @@ elephant_pasture_05 = { } elephant_pasture_06 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = elephant_pasture_05 can_construct = { @@ -11904,7 +11904,7 @@ elephant_pasture_06 = { ### Grain Fields grain_field_01 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } cost = { gold = { @@ -12037,7 +12037,7 @@ grain_field_01 = { } grain_field_02 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = grain_field_01 cost = { @@ -12160,7 +12160,7 @@ grain_field_02 = { } grain_field_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = grain_field_02 can_construct = { @@ -12288,7 +12288,7 @@ grain_field_03 = { } grain_field_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = grain_field_03 can_construct = { @@ -12416,7 +12416,7 @@ grain_field_04 = { } grain_field_05 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = grain_field_04 can_construct = { @@ -12544,7 +12544,7 @@ grain_field_05 = { } grain_field_06 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = grain_field_05 can_construct = { @@ -12674,7 +12674,7 @@ grain_field_06 = { ### Rice Fields rice_field_01 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } can_construct_potential = { culture ?= { has_innovation = innovation_champa_rice } @@ -12750,7 +12750,7 @@ rice_field_01 = { rice_field_02 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = rice_field_01 cost = { @@ -12823,7 +12823,7 @@ rice_field_02 = { rice_field_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = rice_field_02 can_construct = { @@ -12900,7 +12900,7 @@ rice_field_03 = { rice_field_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = rice_field_03 can_construct = { @@ -12977,7 +12977,7 @@ rice_field_04 = { rice_field_05 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = rice_field_04 can_construct = { @@ -13054,7 +13054,7 @@ rice_field_05 = { rice_field_06 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = rice_field_05 can_construct = { @@ -13132,7 +13132,7 @@ rice_field_06 = { ### Vineyard vineyard_01 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } cost = { gold = { @@ -13244,7 +13244,7 @@ vineyard_01 = { } vineyard_02 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = vineyard_01 cost = { @@ -13347,7 +13347,7 @@ vineyard_02 = { } vineyard_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = vineyard_02 can_construct = { @@ -13453,7 +13453,7 @@ vineyard_03 = { } vineyard_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = vineyard_03 can_construct = { @@ -13559,7 +13559,7 @@ vineyard_04 = { } vineyard_05 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = vineyard_04 can_construct = { @@ -13665,7 +13665,7 @@ vineyard_05 = { } vineyard_06 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = vineyard_05 can_construct = { @@ -13773,7 +13773,7 @@ vineyard_06 = { ### Tea Plantation tea_01 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } can_construct_potential = { culture ?= { has_innovation = innovation_champa_rice } @@ -13855,7 +13855,7 @@ tea_01 = { } tea_02 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = tea_01 cost = { @@ -13931,7 +13931,7 @@ tea_02 = { } tea_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = tea_02 can_construct = { @@ -14010,7 +14010,7 @@ tea_03 = { } tea_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = tea_03 can_construct = { @@ -14085,7 +14085,7 @@ tea_04 = { } tea_05 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = tea_04 can_construct = { @@ -14160,7 +14160,7 @@ tea_05 = { } tea_06 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = tea_05 can_construct = { @@ -14237,7 +14237,7 @@ tea_06 = { ### Olive Plantation olive_01 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } cost = { gold = { @@ -14346,7 +14346,7 @@ olive_01 = { } olive_02 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = olive_01 cost = { @@ -14446,7 +14446,7 @@ olive_02 = { } olive_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = olive_02 can_construct = { @@ -14550,7 +14550,7 @@ olive_03 = { } olive_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = olive_03 can_construct = { @@ -14654,7 +14654,7 @@ olive_04 = { } olive_05 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = olive_04 can_construct = { @@ -14759,7 +14759,7 @@ olive_05 = { } olive_06 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = olive_05 can_construct = { @@ -14866,7 +14866,7 @@ olive_06 = { ### Silk Production - Byzantine exclusive silk_01 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } can_construct = { custom_tooltip = { @@ -14942,7 +14942,7 @@ silk_01 = { } silk_02 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = silk_01 can_construct = { @@ -15022,7 +15022,7 @@ silk_02 = { } silk_03 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = silk_02 can_construct = { @@ -15103,7 +15103,7 @@ silk_03 = { } silk_04 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = silk_03 can_construct = { @@ -15185,7 +15185,7 @@ silk_04 = { } silk_05 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = silk_04 can_construct = { @@ -15267,7 +15267,7 @@ silk_05 = { } silk_06 = { construction_time = 730 - allowed_domicile_types = { estate } + allowed_domicile_types = { estate minority_community } previous_building = silk_05 can_construct = { diff --git a/common/domiciles/buildings/NEOW_minority_community_buildings.txt b/common/domiciles/buildings/NEOW_minority_community_buildings.txt new file mode 100644 index 00000000..41ea9c88 --- /dev/null +++ b/common/domiciles/buildings/NEOW_minority_community_buildings.txt @@ -0,0 +1,413 @@ + +minority_community_main_01 = { + slot_type = main + internal_slots = 2 + construction_time = 730 + allowed_domicile_types = { minority_community } + + cost = { + gold = estate_external_building_high_cost_tier_2_value + } + + character_modifier = { + domicile_monthly_gold_add = 0.25 + domicile_monthly_influence_add = 1 + domicile_external_slots_capacity_add = 2 + } + + ai_value = { + value = 100 + } + + asset = { + trigger = { + domicile_location.culture = { + has_graphical_east_asia_culture_group_trigger = yes + } + } + icon = "gfx/interface/icons/domicile_building/minority_community_main.dds" + texture = "gfx/interface/window_domiciles/estate_building_villa_chinese.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_villa_chinese_mask.png" + soundeffect = "event:/DLC/EP4/SFX/UI/domicile_buildings/tgp_ui_domicile_building_chinese_main_building" + } + + asset = { + trigger = { + domicile_location.culture = { + OR = { + has_graphical_iranian_culture_group_trigger = yes + has_graphical_mena_culture_group_trigger = yes + has_graphical_steppe_culture_group_trigger = yes + has_graphical_african_culture_group_trigger = yes + has_graphical_india_culture_group_trigger = yes + has_graphical_iberian_culture_group_trigger = yes + } + } + } + icon = "gfx/interface/icons/domicile_building/minority_community_main.dds" + texture = "gfx/interface/window_domiciles/estate_building_villa_mena.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_villa_mena_mask.png" + soundeffect = "event:/DLC/EP3/SFX/UI/domicile_buildings/ep3_ui_domicile_buildings_estate_main_building" + } + + asset = { + trigger = { + domicile_location.culture = { + OR = { + has_graphical_western_culture_group_trigger = yes + has_graphical_norse_culture_group_trigger = yes + } + } + } + icon = "gfx/interface/icons/domicile_building/minority_community_main.dds" + texture = "gfx/interface/window_domiciles/estate_building_villa_western.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_villa_western_mask.png" + soundeffect = "event:/DLC/EP3/SFX/UI/domicile_buildings/ep3_ui_domicile_buildings_estate_main_building" + } + + asset = { + icon = "gfx/interface/icons/domicile_building/minority_community_main.dds" + texture = "gfx/interface/window_domiciles/estate_building_villa_byzantine.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_villa_byzantine_mask.png" + soundeffect = "event:/DLC/EP3/SFX/UI/domicile_buildings/ep3_ui_domicile_buildings_estate_main_building" + } +} + +minority_community_main_02 = { + slot_type = main + internal_slots = 4 + construction_time = 730 + allowed_domicile_types = { minority_community } + previous_building = minority_community_main_01 + + can_construct = { + culture ?= { has_innovation = innovation_city_planning } + } + + cost = { + gold = estate_external_building_high_cost_tier_3_value + } + + parameters = { + reduce_success_of_raid_estate = yes + estate_increase_house_member_investment_cap_1 = yes + } + + character_modifier = { + domicile_monthly_gold_add = 0.25 + domicile_monthly_influence_add = 0.5 + domicile_external_slots_capacity_add = 1 + } + + ai_value = { + value = 100 + } + + asset = { + trigger = { + domicile_location.culture = { + has_graphical_east_asia_culture_group_trigger = yes + } + } + icon = "gfx/interface/icons/domicile_building/minority_community_main.dds" + texture = "gfx/interface/window_domiciles/estate_building_manor_chinese.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_manor_chinese_mask.png" + soundeffect = "event:/DLC/EP4/SFX/UI/domicile_buildings/tgp_ui_domicile_building_chinese_main_building" + } + + asset = { + trigger = { + domicile_location.culture = { + OR = { + has_graphical_iranian_culture_group_trigger = yes + has_graphical_mena_culture_group_trigger = yes + has_graphical_steppe_culture_group_trigger = yes + has_graphical_african_culture_group_trigger = yes + has_graphical_india_culture_group_trigger = yes + has_graphical_iberian_culture_group_trigger = yes + } + } + } + icon = "gfx/interface/icons/domicile_building/minority_community_main.dds" + texture = "gfx/interface/window_domiciles/estate_building_manor_mena.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_manor_mena_mask.png" + soundeffect = "event:/DLC/EP3/SFX/UI/domicile_buildings/ep3_ui_domicile_buildings_estate_main_building" + } + + asset = { + trigger = { + domicile_location.culture = { + OR = { + has_graphical_western_culture_group_trigger = yes + has_graphical_norse_culture_group_trigger = yes + } + } + } + icon = "gfx/interface/icons/domicile_building/minority_community_main.dds" + texture = "gfx/interface/window_domiciles/estate_building_manor_western.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_manor_western_mask.png" + soundeffect = "event:/DLC/EP3/SFX/UI/domicile_buildings/ep3_ui_domicile_buildings_estate_main_building" + } + + asset = { + icon = "gfx/interface/icons/domicile_building/minority_community_main.dds" + texture = "gfx/interface/window_domiciles/estate_building_manor_byzantine.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_manor_byzantine_mask.png" + soundeffect = "event:/DLC/EP3/SFX/UI/domicile_buildings/ep3_ui_domicile_buildings_estate_main_building" + } +} + +minority_community_main_03 = { + slot_type = main + internal_slots = 6 + construction_time = 730 + allowed_domicile_types = { minority_community } + previous_building = minority_community_main_02 + + can_construct = { + culture ?= { has_innovation = innovation_manorialism } + } + + cost = { + gold = estate_external_building_high_cost_tier_4_value + } + + parameters = { + reduce_success_of_raid_estate = yes + estate_increase_house_member_investment_cap_2 = yes + } + + character_modifier = { + domicile_monthly_gold_add = 0.5 + domicile_monthly_gold_mult = 0.02 + domicile_monthly_influence_add = 0.5 + domicile_external_slots_capacity_add = 1 + } + + ai_value = { + value = 100 + } + + asset = { + trigger = { + domicile_location.culture = { + has_graphical_east_asia_culture_group_trigger = yes + } + } + icon = "gfx/interface/icons/domicile_building/minority_community_main.dds" + texture = "gfx/interface/window_domiciles/estate_building_mansion_chinese.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_mansion_chinese_mask.png" + soundeffect = "event:/DLC/EP4/SFX/UI/domicile_buildings/tgp_ui_domicile_building_chinese_main_building" + } + + asset = { + trigger = { + domicile_location.culture = { + OR = { + has_graphical_iranian_culture_group_trigger = yes + has_graphical_mena_culture_group_trigger = yes + has_graphical_steppe_culture_group_trigger = yes + has_graphical_african_culture_group_trigger = yes + has_graphical_india_culture_group_trigger = yes + has_graphical_iberian_culture_group_trigger = yes + } + } + } + icon = "gfx/interface/icons/domicile_building/minority_community_main.dds" + texture = "gfx/interface/window_domiciles/estate_building_mansion_mena.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_mansion_mena_mask.png" + soundeffect = "event:/DLC/EP3/SFX/UI/domicile_buildings/ep3_ui_domicile_buildings_estate_main_building" + } + + asset = { + trigger = { + domicile_location.culture = { + OR = { + has_graphical_western_culture_group_trigger = yes + has_graphical_norse_culture_group_trigger = yes + } + } + } + icon = "gfx/interface/icons/domicile_building/minority_community_main.dds" + texture = "gfx/interface/window_domiciles/estate_building_mansion_western.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_mansion_western_mask.png" + soundeffect = "event:/DLC/EP3/SFX/UI/domicile_buildings/ep3_ui_domicile_buildings_estate_main_building" + } + + asset = { + icon = "gfx/interface/icons/domicile_building/minority_community_main.dds" + texture = "gfx/interface/window_domiciles/estate_building_mansion_byzantine.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_mansion_byzantine_mask.png" + soundeffect = "event:/DLC/EP3/SFX/UI/domicile_buildings/ep3_ui_domicile_buildings_estate_main_building" + } +} + +minority_community_main_04 = { + slot_type = main + internal_slots = 8 + construction_time = 730 + allowed_domicile_types = { minority_community } + previous_building = minority_community_main_03 + + can_construct = { + culture ?= { has_innovation = innovation_development_03 } + } + + cost = { + gold = estate_external_building_high_cost_tier_5_value + } + + parameters = { + reduce_success_of_raid_estate = yes + estate_increase_house_member_investment_cap_3 = yes + } + + character_modifier = { + domicile_monthly_gold_add = 0.5 + domicile_monthly_gold_mult = 0.03 + domicile_monthly_influence_add = 0.5 + domicile_external_slots_capacity_add = 1 + } + + ai_value = { + value = 100 + } + + asset = { + trigger = { + domicile_location.culture = { + has_graphical_east_asia_culture_group_trigger = yes + } + } + icon = "gfx/interface/icons/domicile_building/minority_community_main.dds" + texture = "gfx/interface/window_domiciles/estate_building_estate_chinese.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_estate_chinese_mask.png" + soundeffect = "event:/DLC/EP4/SFX/UI/domicile_buildings/tgp_ui_domicile_building_chinese_main_building" + } + + asset = { + trigger = { + domicile_location.culture = { + OR = { + has_graphical_iranian_culture_group_trigger = yes + has_graphical_mena_culture_group_trigger = yes + has_graphical_steppe_culture_group_trigger = yes + has_graphical_african_culture_group_trigger = yes + has_graphical_india_culture_group_trigger = yes + has_graphical_iberian_culture_group_trigger = yes + } + } + } + icon = "gfx/interface/icons/domicile_building/minority_community_main.dds" + texture = "gfx/interface/window_domiciles/estate_building_estate_mena.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_estate_mena_mask.png" + soundeffect = "event:/DLC/EP3/SFX/UI/domicile_buildings/ep3_ui_domicile_buildings_estate_main_building" + } + + asset = { + trigger = { + domicile_location.culture = { + OR = { + has_graphical_western_culture_group_trigger = yes + has_graphical_norse_culture_group_trigger = yes + } + } + } + icon = "gfx/interface/icons/domicile_building/minority_community_main.dds" + texture = "gfx/interface/window_domiciles/estate_building_estate_western.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_estate_western_mask.png" + soundeffect = "event:/DLC/EP3/SFX/UI/domicile_buildings/ep3_ui_domicile_buildings_estate_main_building" + } + + asset = { + icon = "gfx/interface/icons/domicile_building/minority_community_main.dds" + texture = "gfx/interface/window_domiciles/estate_building_estate_byzantine.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_estate_byzantine_mask.png" + soundeffect = "event:/DLC/EP3/SFX/UI/domicile_buildings/ep3_ui_domicile_buildings_estate_main_building" + } +} + +minority_community_main_05 = { + slot_type = main + internal_slots = 10 + construction_time = 730 + allowed_domicile_types = { minority_community } + previous_building = minority_community_main_04 + + can_construct = { + culture ?= { has_innovation = innovation_cranes } + } + + cost = { + gold = estate_external_building_high_cost_tier_6_value + } + + parameters = { + reduce_success_of_raid_estate = yes + estate_increase_house_member_investment_cap_4 = yes + } + + character_modifier = { + domicile_monthly_gold_add = 0.75 + domicile_monthly_gold_mult = 0.05 + domicile_monthly_influence_add = 0.5 + domicile_external_slots_capacity_add = 1 + } + + ai_value = { + value = 100 + } + + asset = { + trigger = { + domicile_location.culture = { + has_graphical_east_asia_culture_group_trigger = yes + } + } + icon = "gfx/interface/icons/domicile_building/minority_community_main.dds" + texture = "gfx/interface/window_domiciles/estate_building_grand_estate_chinese.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_grand_estate_chinese_mask.png" + soundeffect = "event:/DLC/EP4/SFX/UI/domicile_buildings/tgp_ui_domicile_building_chinese_main_building" + } + + asset = { + trigger = { + domicile_location.culture = { + OR = { + has_graphical_iranian_culture_group_trigger = yes + has_graphical_mena_culture_group_trigger = yes + has_graphical_steppe_culture_group_trigger = yes + has_graphical_african_culture_group_trigger = yes + has_graphical_india_culture_group_trigger = yes + has_graphical_iberian_culture_group_trigger = yes + } + } + } + icon = "gfx/interface/icons/domicile_building/minority_community_main.dds" + texture = "gfx/interface/window_domiciles/estate_building_grand_estate_mena.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_grand_estate_mena_mask.png" + soundeffect = "event:/DLC/EP3/SFX/UI/domicile_buildings/ep3_ui_domicile_buildings_estate_main_building" + } + + asset = { + trigger = { + domicile_location.culture = { + OR = { + has_graphical_western_culture_group_trigger = yes + has_graphical_norse_culture_group_trigger = yes + } + } + } + icon = "gfx/interface/icons/domicile_building/minority_community_main.dds" + texture = "gfx/interface/window_domiciles/estate_building_grand_estate_western.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_grand_estate_western_mask.png" + soundeffect = "event:/DLC/EP3/SFX/UI/domicile_buildings/ep3_ui_domicile_buildings_estate_main_building" + } + + asset = { + icon = "gfx/interface/icons/domicile_building/minority_community_main.dds" + texture = "gfx/interface/window_domiciles/estate_building_grand_estate_byzantine.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_grand_estate_byzantine_mask.png" + soundeffect = "event:/DLC/EP3/SFX/UI/domicile_buildings/ep3_ui_domicile_buildings_estate_main_building" + } +} \ No newline at end of file diff --git a/common/domiciles/types/NEOW_domicile_types.txt b/common/domiciles/types/NEOW_domicile_types.txt new file mode 100644 index 00000000..b06a97b4 --- /dev/null +++ b/common/domiciles/types/NEOW_domicile_types.txt @@ -0,0 +1,1065 @@ + +minority_community = { + + rename_window = primary_title + + illustration = "gfx/interface/illustrations/event_scenes/ep3_medi_estate.dds" + icon = "gfx/interface/icons/flat_icons/minority.dds" + map_pin_texture = "gfx/interface/icons/map_icons/map_icon_minority.dds" + map_pin_anchor = up + map_pin_lobby = yes + + travel = yes + + can_move_manually = yes + culture_and_faith = yes + move_cooldown = { days = 9125 } + move_cost = { + gold = { + value = { + value = 20 + format = "BASE_VALUE_FORMAT" + desc = "BASE_VALUE" + } + if = { + limit = { + domicile ?= { has_domicile_building_or_higher = minority_community_05 } + } + add = 80 + } + else_if = { + limit = { + domicile ?= { has_domicile_building_or_higher = minority_community_04 } + } + add = 60 + } + else_if = { + limit = { + domicile ?= { has_domicile_building_or_higher = minority_community_03 } + } + add = 40 + } + else_if = { + limit = { + domicile ?= { has_domicile_building_or_higher = minority_community_02 } + } + add = 20 + } + } + } + + base_external_slots = 2 + + map_entity = { + trigger = { + owner ?= { is_alive = yes } + owner.culture = { + OR = { + has_graphical_iranian_culture_group_trigger = yes + has_graphical_mena_culture_group_trigger = yes + has_graphical_steppe_culture_group_trigger = yes + has_graphical_african_culture_group_trigger = yes + } + } + } + reference = "building_mena_city_01_entity" + } + map_entity = { + trigger = { + owner ?= { is_alive = yes } + owner.culture = { + has_graphical_india_culture_group_trigger = yes + } + } + reference = "building_india_city_01_entity" + } + map_entity = { + trigger = { + owner ?= { is_alive = yes } + } + reference = "western_city_01_a_entity" + } + + domicile_temperament_high_modifier = { + name = domicile_temperament_high + army_toughness_mult = 0.05 + owned_contract_scheme_success_chance_growth_add = 0.4 + scale = { + add = default_temperament_high_value_scale + min = 1 + } + } + + domicile_temperament_high_modifier = { + name = domicile_temperament_high + tolerance_advantage_mod = 1 + scale = { + add = default_temperament_high_value_scale + min = 1 + max = 10 + if = { + limit = { + NOT = { has_perk = faithful_perk } + } + multiply = 0 + } + } + } + + domicile_temperament_high_modifier = { + name = domicile_temperament_high + knight_effectiveness_mult = 0.1 + scale = { + add = default_temperament_high_value_scale + min = 1 + if = { + limit = { + NOT = { has_perk = absolute_control_perk } + } + multiply = 0 + } + } + } + + + domicile_temperament_high_modifier = { + name = domicile_temperament_high + personal_scheme_phase_duration_add = -25 + scale = { + add = default_temperament_high_value_scale + min = 1 + if = { + limit = { + NOT = { has_perk = writing_history_perk } + } + multiply = 0 + } + } + } + + domicile_temperament_high_modifier = { + name = domicile_temperament_high + monthly_piety = 0.4 + scale = { + add = { + every_courtier = { + limit = { + faith = root.faith + } + add = 1 + } + } + if = { + limit = { + NOT = { has_perk = religious_icon_perk } + } + multiply = 0 + } + } + } + + domicile_temperament_high_modifier = { + name = domicile_temperament_high + diplomacy = 0.34 + intrigue = 0.34 + martial = 0.34 + stewardship = 0.34 + learning = 0.34 + scale = { + add = { + every_courtier = { + limit = { + is_imprisoned = no + } + faith = { + if = { + limit = { + NOT = { is_in_list = unique_faiths } + add_to_temporary_list = unique_faiths + } + } + } + } + every_in_list = { + list = unique_faiths + add = 1 + } + max = 15 + } + if = { + limit = { + NOT = { has_perk = apostate_perk } + } + multiply = 0 + } + } + } + domicile_building_slots = { + external_slot_1 = { + position = { 19.7% 5.5% } + size = { 15% 30% } + + empty_slot_asset = { + trigger = { + owner.culture = { + OR = { + has_graphical_chinese_culture_group_trigger = yes + has_graphical_japanese_culture_group_trigger = yes + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/yurt_empty_slot_01.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/yurt_empty_slot_01_mask.png" + } + + empty_slot_asset = { + trigger = { + domicile_location = { + OR = { + terrain = jungle + terrain = wetlands + terrain = floodplains + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_jungle_empty_02.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_jungle_empty_02_mask.png" + } + + empty_slot_asset = { + trigger = { + domicile_location = { + OR = { + terrain = drylands + terrain = desert + terrain = desert_mountains + terrain = oasis + terrain = steppe + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_drylands_empty.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_drylands_empty_mask.png" + } + + empty_slot_asset = { + trigger = { + domicile_location = { + OR = { + terrain = mountains + terrain = hills + terrain = terraced_hills + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_rough_empty.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_rough_empty_mask.png" + } + + empty_slot_asset = { + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_grassland_empty_05.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_grassland_empty_05_mask.png" + } + + + # Under Construction + construction_slot_asset = { + trigger = { + owner.culture = { + OR = { + has_graphical_chinese_culture_group_trigger = yes + has_graphical_japanese_culture_group_trigger = yes + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_building_construction_chinese.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_construction_chinese_mask.png" + } + construction_slot_asset = { + trigger = { + domicile_location.culture = { + has_graphical_mena_culture_group_trigger = yes + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_building_construction_mena.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_construction_mena_mask.png" + } + construction_slot_asset = { + trigger = { + domicile_location.culture = { + has_graphical_western_culture_group_trigger = yes + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_building_construction_western.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_construction_western_mask.png" + } + construction_slot_asset = { + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_building_construction_byzantine.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_construction_byzantine_mask.png" + } + } + + external_slot_4 = { + position = { 49.0% 2.5% } + size = { 15% 30% } + + empty_slot_asset = { + trigger = { + owner.culture = { + OR = { + has_graphical_chinese_culture_group_trigger = yes + has_graphical_japanese_culture_group_trigger = yes + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/yurt_empty_slot_04.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/yurt_empty_slot_04_mask.png" + } + + empty_slot_asset = { + trigger = { + domicile_location = { + OR = { + terrain = jungle + terrain = wetlands + terrain = floodplains + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_jungle_empty_05.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_jungle_empty_05_mask.png" + } + + empty_slot_asset = { + trigger = { + domicile_location = { + OR = { + terrain = drylands + terrain = desert + terrain = desert_mountains + terrain = oasis + terrain = steppe + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_drylands_empty_03.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_drylands_empty_03_mask.png" + } + + empty_slot_asset = { + trigger = { + domicile_location = { + OR = { + terrain = mountains + terrain = hills + terrain = terraced_hills + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_rough_empty_03.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_rough_empty_03_mask.png" + } + + empty_slot_asset = { + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_grassland_empty_03.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_grassland_empty_03_mask.png" + } + + + # Under Construction + construction_slot_asset = { + trigger = { + owner.culture = { + OR = { + has_graphical_chinese_culture_group_trigger = yes + has_graphical_japanese_culture_group_trigger = yes + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_building_construction_chinese.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_construction_chinese_mask.png" + } + construction_slot_asset = { + trigger = { + domicile_location.culture = { + has_graphical_mena_culture_group_trigger = yes + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_building_construction_mena.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_construction_mena_mask.png" + } + construction_slot_asset = { + trigger = { + domicile_location.culture = { + has_graphical_western_culture_group_trigger = yes + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_building_construction_western.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_construction_western_mask.png" + } + construction_slot_asset = { + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_building_construction_byzantine.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_construction_byzantine_mask.png" + } + } + + main_slot = { + slot_type = main + position = { 28.2% 13.2% } + size = { 28% 34.5% } + + empty_slot_asset = { + trigger = { + owner.culture = { + OR = { + has_graphical_chinese_culture_group_trigger = yes + has_graphical_japanese_culture_group_trigger = yes + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/yurt_empty_slot_01.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/yurt_empty_slot_01_mask.png" + } + + empty_slot_asset = { + trigger = { + domicile_location = { + OR = { + terrain = jungle + terrain = wetlands + terrain = floodplains + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_grassland_empty.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_grain_fields_byzantine_mask.png" + } + + empty_slot_asset = { + trigger = { + domicile_location = { + OR = { + terrain = drylands + terrain = desert + terrain = desert_mountains + terrain = oasis + terrain = steppe + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_grassland_empty.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_grain_fields_byzantine_mask.png" + } + + empty_slot_asset = { + trigger = { + domicile_location = { + OR = { + terrain = hills + terrain = mountains + terrain = terraced_hills + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_grassland_empty.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_grain_fields_byzantine_mask.png" + } + + empty_slot_asset = { + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_grassland_empty.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_grain_fields_byzantine_mask.png" + } + + # Under Construction + construction_slot_asset = { + trigger = { + owner.culture = { + OR = { + has_graphical_chinese_culture_group_trigger = yes + has_graphical_japanese_culture_group_trigger = yes + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_building_construction_chinese.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_construction_chinese_mask.png" + } + construction_slot_asset = { + trigger = { + domicile_location.culture = { + has_graphical_mena_culture_group_trigger = yes + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_building_manor_construction_mena.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_manor_construction_mena_mask.png" + } + construction_slot_asset = { + trigger = { + domicile_location.culture = { + has_graphical_western_culture_group_trigger = yes + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_building_manor_construction_western.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_manor_construction_western_mask.png" + } + construction_slot_asset = { + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_building_manor_construction_byzantine.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_manor_construction_byzantine_mask.png" + } + } + + external_slot_2 = { + position = { 4% 20% } + size = { 15% 30% } + + empty_slot_asset = { + trigger = { + owner.culture = { + OR = { + has_graphical_chinese_culture_group_trigger = yes + has_graphical_japanese_culture_group_trigger = yes + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/yurt_empty_slot_02.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/yurt_empty_slot_02_mask.png" + } + + empty_slot_asset = { + trigger = { + domicile_location = { + OR = { + terrain = jungle + terrain = wetlands + terrain = floodplains + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_jungle_empty_06.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_jungle_empty_06_mask.png" + } + + empty_slot_asset = { + trigger = { + domicile_location = { + OR = { + terrain = drylands + terrain = desert + terrain = desert_mountains + terrain = oasis + terrain = steppe + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_drylands_empty_06.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_drylands_empty_06_mask.png" + } + + empty_slot_asset = { + trigger = { + domicile_location = { + OR = { + terrain = mountains + terrain = hills + terrain = terraced_hills + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_rough_empty_06.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_rough_empty_06_mask.png" + } + + empty_slot_asset = { + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_grassland_empty_06.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_grassland_empty_06_mask.png" + } + + + # Under Construction + construction_slot_asset = { + trigger = { + owner.culture = { + OR = { + has_graphical_chinese_culture_group_trigger = yes + has_graphical_japanese_culture_group_trigger = yes + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_building_construction_chinese.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_construction_chinese_mask.png" + } + construction_slot_asset = { + trigger = { + domicile_location.culture = { + has_graphical_mena_culture_group_trigger = yes + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_building_construction_mena.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_construction_mena_mask.png" + } + construction_slot_asset = { + trigger = { + domicile_location.culture = { + has_graphical_western_culture_group_trigger = yes + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_building_construction_western.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_construction_western_mask.png" + } + construction_slot_asset = { + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_building_construction_byzantine.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_construction_byzantine_mask.png" + } + } + + external_slot_3 = { + position = { 14% 46% } + size = { 15% 30% } + + empty_slot_asset = { + trigger = { + owner.culture = { + OR = { + has_graphical_chinese_culture_group_trigger = yes + has_graphical_japanese_culture_group_trigger = yes + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/yurt_empty_slot_03.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/yurt_empty_slot_03_mask.png" + } + + empty_slot_asset = { + trigger = { + domicile_location = { + OR = { + terrain = jungle + terrain = wetlands + terrain = floodplains + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_jungle_empty_04.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_jungle_empty_04_mask.png" + } + + empty_slot_asset = { + trigger = { + domicile_location = { + OR = { + terrain = drylands + terrain = desert + terrain = desert_mountains + terrain = oasis + terrain = steppe + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_drylands_empty_04.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_drylands_empty_04_mask.png" + } + + empty_slot_asset = { + trigger = { + domicile_location = { + OR = { + terrain = mountains + terrain = hills + terrain = terraced_hills + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_rough_empty_04.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_rough_empty_04_mask.png" + } + + empty_slot_asset = { + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_grassland_empty_04.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_grassland_empty_04_mask.png" + } + + + # Under Construction + construction_slot_asset = { + trigger = { + owner.culture = { + OR = { + has_graphical_chinese_culture_group_trigger = yes + has_graphical_japanese_culture_group_trigger = yes + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_building_construction_chinese.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_construction_chinese_mask.png" + } + construction_slot_asset = { + trigger = { + domicile_location.culture = { + has_graphical_mena_culture_group_trigger = yes + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_building_construction_mena.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_construction_mena_mask.png" + } + construction_slot_asset = { + trigger = { + domicile_location.culture = { + has_graphical_western_culture_group_trigger = yes + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_building_construction_western.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_construction_western_mask.png" + } + construction_slot_asset = { + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_building_construction_byzantine.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_construction_byzantine_mask.png" + } + } + + external_slot_5 = { + position = { 64% 29% } + size = { 15% 30% } + + empty_slot_asset = { + trigger = { + owner.culture = { + OR = { + has_graphical_chinese_culture_group_trigger = yes + has_graphical_japanese_culture_group_trigger = yes + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/yurt_empty_slot_05.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/yurt_empty_slot_05_mask.png" + } + + empty_slot_asset = { + trigger = { + domicile_location = { + OR = { + terrain = jungle + terrain = wetlands + terrain = floodplains + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_jungle_empty_03.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_jungle_empty_03_mask.png" + } + + empty_slot_asset = { + trigger = { + domicile_location = { + OR = { + terrain = drylands + terrain = desert + terrain = desert_mountains + terrain = oasis + terrain = steppe + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_drylands_empty_05.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_drylands_empty_05_mask.png" + } + + empty_slot_asset = { + trigger = { + domicile_location = { + OR = { + terrain = mountains + terrain = hills + terrain = terraced_hills + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_rough_empty_02.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_rough_empty_02_mask.png" + } + + empty_slot_asset = { + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_grassland_empty_02.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_grassland_empty_02_mask.png" + } + + + # Under Construction + construction_slot_asset = { + trigger = { + owner.culture = { + OR = { + has_graphical_chinese_culture_group_trigger = yes + has_graphical_japanese_culture_group_trigger = yes + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_building_construction_chinese.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_construction_chinese_mask.png" + } + construction_slot_asset = { + trigger = { + domicile_location.culture = { + has_graphical_mena_culture_group_trigger = yes + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_building_construction_mena.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_construction_mena_mask.png" + } + construction_slot_asset = { + trigger = { + domicile_location.culture = { + has_graphical_western_culture_group_trigger = yes + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_building_construction_western.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_construction_western_mask.png" + } + construction_slot_asset = { + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_building_construction_byzantine.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_construction_byzantine_mask.png" + } + } + + external_slot_6 = { + position = { 43% 52% } + size = { 15% 30% } + + empty_slot_asset = { + trigger = { + owner.culture = { + OR = { + has_graphical_chinese_culture_group_trigger = yes + has_graphical_japanese_culture_group_trigger = yes + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/yurt_empty_slot_06.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/yurt_empty_slot_06_mask.png" + } + + empty_slot_asset = { + trigger = { + domicile_location = { + OR = { + terrain = jungle + terrain = wetlands + terrain = floodplains + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_jungle_empty.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_jungle_empty_mask.png" + } + + empty_slot_asset = { + trigger = { + domicile_location = { + OR = { + terrain = drylands + terrain = desert + terrain = desert_mountains + terrain = oasis + terrain = steppe + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_drylands_empty_02.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_drylands_empty_02_mask.png" + } + + empty_slot_asset = { + trigger = { + domicile_location = { + OR = { + terrain = mountains + terrain = hills + terrain = terraced_hills + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_rough_empty_05.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_rough_empty_05_mask.png" + } + + empty_slot_asset = { + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_grassland_empty.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_grassland_empty_mask.png" + } + + + # Under Construction + construction_slot_asset = { + trigger = { + owner.culture = { + OR = { + has_graphical_chinese_culture_group_trigger = yes + has_graphical_japanese_culture_group_trigger = yes + } + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_building_construction_chinese.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_construction_chinese_mask.png" + } + construction_slot_asset = { + trigger = { + domicile_location.culture = { + has_graphical_mena_culture_group_trigger = yes + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_building_construction_mena.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_construction_mena_mask.png" + } + construction_slot_asset = { + trigger = { + domicile_location.culture = { + has_graphical_western_culture_group_trigger = yes + } + } + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_building_construction_western.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_construction_western_mask.png" + } + construction_slot_asset = { + icon = "gfx/interface/icons/flat_icons/plus.dds" + texture = "gfx/interface/window_domiciles/estate_building_construction_byzantine.dds" + intersectionmask_texture = "gfx/interface/window_domiciles/estate_building_construction_byzantine_mask.png" + } + } + } + + # Backgrounds + domicile_asset = { + trigger = { + domicile_location.culture = { + has_graphical_east_asia_culture_group_trigger = yes + } + } + background = "gfx/interface/window_domiciles/estate_background_steppe_terrain.dds" + foreground = "gfx/interface/window_domiciles/estate_background_steppe_terrain_foreground.dds" + ambience = "event:/DLC/CE2/Ambience/2D/Domicile/ce2_amb_2d_domicile_yurt" + } + + domicile_asset = { + trigger = { + domicile_location = { + this = root.owner.top_liege.capital_province + } + } + background = "gfx/interface/window_domiciles/estate_background_urban_terrain.dds" + foreground = "gfx/interface/window_domiciles/estate_background_urban_terrain_foreground.dds" + ambience = "event:/DLC/EP3/SFX/Ambience/2D/Domicile/ep3_amb_2d_domicile_byzantine_urban" + } + + domicile_asset = { + trigger = { + domicile_location = { + OR = { + terrain = jungle + terrain = wetlands + terrain = floodplains + } + } + } + background = "gfx/interface/window_domiciles/estate_background_jungle_terrain.dds" + foreground = "gfx/interface/window_domiciles/estate_background_jungle_terrain_foreground.dds" + ambience = "event:/DLC/EP3/SFX/Ambience/2D/Domicile/ep3_amb_2d_domicile_wetlands" + } + + domicile_asset = { + trigger = { + domicile_location = { + OR = { + terrain = drylands + terrain = desert + terrain = desert_mountains + terrain = oasis + terrain = steppe + } + } + } + background = "gfx/interface/window_domiciles/estate_background_dry_terrain.dds" + foreground = "gfx/interface/window_domiciles/estate_background_dry_terrain_foreground.dds" + ambience = "event:/DLC/EP3/SFX/Ambience/2D/Domicile/ep3_amb_2d_domicile_dry_lands" + } + + domicile_asset = { + trigger = { + domicile_location = { + OR = { + terrain = hills + terrain = mountains + terrain = terraced_hills + } + } + } + background = "gfx/interface/window_domiciles/estate_background_rough_terrain.dds" + foreground = "gfx/interface/window_domiciles/estate_background_rough_terrain_foreground.dds" + ambience = "event:/DLC/EP3/SFX/Ambience/2D/Domicile/ep3_amb_2d_domicile_rough_lands" + } + + domicile_asset = { + background = "gfx/interface/window_domiciles/estate_background_green_terrain.dds" + foreground = "gfx/interface/window_domiciles/estate_background_green_terrain_foreground.dds" + ambience = "event:/DLC/EP3/SFX/Ambience/2D/Domicile/ep3_amb_2d_domicile_green_lands" + } +} diff --git a/common/dynasties/NEOW_dynasties.txt b/common/dynasties/NEOW_dynasties.txt index ad19cf6b..4173e428 100644 --- a/common/dynasties/NEOW_dynasties.txt +++ b/common/dynasties/NEOW_dynasties.txt @@ -27,6 +27,10 @@ belpois_dynasty = { culture = bourguignon } +kohn_dynasty = { + name = dynn_britannia_kohn + culture = ashkenazi +} giry_dynasty = { name = dynn_giry culture = bourguignon diff --git a/common/flavorization/00_flavorization.txt b/common/flavorization/00_flavorization.txt index 6bef23ca..829cca81 100644 --- a/common/flavorization/00_flavorization.txt +++ b/common/flavorization/00_flavorization.txt @@ -504,6 +504,12 @@ duchy_landless_adventurer_camp = { governments = { landless_adventurer_government } } +duchy_landless_minority_community = { + type = title + tier = duchy + priority = 30 + governments = { landless_minority_government } +} ### Devaraja ### devaraja = { type = character diff --git a/common/flavorization/00_title_holders.txt b/common/flavorization/00_title_holders.txt index 5cf1d4b6..104462e2 100644 --- a/common/flavorization/00_title_holders.txt +++ b/common/flavorization/00_title_holders.txt @@ -10357,6 +10357,52 @@ hegemony_feudal_mongolic = { } ### LANDLESS ADVENTURERS +duke_landless_minority_community_male_minority_community = { + type = character + gender = male + special = holder + tier = duchy + domicile_type = minority_community + priority = 25 + governments = { landless_minority_government } + + flavourization_rules = { + spouse_takes_title = no + } +} + +duke_landless_minority_community_female_minority_community = { + type = character + gender = female + special = holder + tier = duchy + domicile_type = minority_community + priority = 25 + governments = { landless_minority_government } + + flavourization_rules = { + spouse_takes_title = no + } +} + +spouse_landless_minority_community_male = { + type = character + gender = male + special = domicile + domicile_type = minority_community + priority = 25 + governments = { landless_minority_government } +} + +spouse_landless_minority_community_holder_female = { + type = character + gender = female + special = domicile + domicile_type = minority_community + priority = 25 + governments = { landless_minority_government } +} + duke_landless_adventurer_male_camp = { type = character gender = male diff --git a/common/flavorization/01_domicile.txt b/common/flavorization/01_domicile.txt index 10e7e370..045ab51c 100644 --- a/common/flavorization/01_domicile.txt +++ b/common/flavorization/01_domicile.txt @@ -19,3 +19,13 @@ domicile_estate = { top_liege = no } } +domicile_minority_community = { + type = domicile + domicile_type = minority_community + priority = 26 + governments = { landless_minority_government } + + flavourization_rules = { + top_liege = no + } +} \ No newline at end of file diff --git a/common/game_concepts/neow_game_concepts.txt b/common/game_concepts/neow_game_concepts.txt index edc0baa6..d9082536 100644 --- a/common/game_concepts/neow_game_concepts.txt +++ b/common/game_concepts/neow_game_concepts.txt @@ -11,4 +11,19 @@ airship = { } chemical_weapons = { texture = "gfx/interface/icons/regimenttypes/chemical_weapons.dds" +} + +minority_community = { + parent = domicile +} + +minority_government = { + texture = "gfx/interface/icons/government_types/landless_minority_government.dds" + parent = government + alias = { minority_government minority_community_i } +} +minority_community_building = { + texture = "gfx/interface/icons/message_feed/building.dds" + alias = { minority_community_buildings minority_community_building } + parent = domicile_building } \ No newline at end of file diff --git a/common/governments/00_government_types.txt b/common/governments/00_government_types.txt index a9ae5722..bff952d3 100644 --- a/common/governments/00_government_types.txt +++ b/common/governments/00_government_types.txt @@ -6,7 +6,7 @@ feudal_government = { government_rules = { create_cadet_branches = yes rulers_should_have_dynasty = yes - dynasty_named_realms = yes + dynasty_named_realms = no legitimacy = yes } @@ -121,7 +121,7 @@ clan_government = { create_cadet_branches = yes rulers_should_have_dynasty = yes legitimacy = yes - dynasty_named_realms = yes + dynasty_named_realms = no always_use_patronym = yes } @@ -543,6 +543,72 @@ landless_adventurer_government = { realm_mask_scale = { 1 1 } } +landless_minority_government = { + government_rules = { + create_cadet_branches = yes + court_generate_spouses = yes + council = yes + always_use_patronym = yes + regiments_prestige_as_gold = yes + create_cadet_branches = yes + rulers_should_have_dynasty = yes + landless_playable = yes + use_title_tier_modifiers = no + mercenary = yes + allow_out_of_realm_inheritance = yes + use_as_base_on_landed = yes + use_maa_maintenance = no + } + + domicile_type = minority_community + court_generate_commanders = yes + + can_get_government = { + any_held_title = { + title_tier = duchy + is_landless_type_title = yes + } + } + primary_heritages = { + heritage_israelite + } + preferred_religions = { + judaism_religion + } + valid_holdings = { tribal_holding church_holding castle_holding city_holding temple_citadel_holding } + + character_modifier = { + active_accolades = -100 + knight_limit = 2 + character_travel_speed = 20 + siege_weapon_siege_value_mult = -0.5 + mercenary_hire_cost_mult = 1 + short_reign_duration_mult = -5 + long_reign_bonus_mult = -1 + domicile_travel_speed = -0.75 + monthly_wanderer_lifestyle_xp_gain_mult = 0.15 + } + + ai = { + use_goals = yes + use_scripted_guis = no + perform_religious_reformation = yes + use_legends = yes + } + + # Use flags instead of has_government for moddability if possible (i.e., wherever not visible to the player). + flags = { + cannot_be_vassal_or_liege + government_is_landless_minority + has_unique_government_perks + } + + mechanic_type = landless_adventurer + + color = hsv{ 0.00 0.00 0.90 } + realm_mask_offset = { 0.0 0.0 } + realm_mask_scale = { 1 1 } +} ### Brief: nomad_government # Default nomad government, used for the Steppe Region # diff --git a/common/landed_titles/LAAMPs.txt b/common/landed_titles/LAAMPs.txt index 398d6de6..c9da6012 100644 --- a/common/landed_titles/LAAMPs.txt +++ b/common/landed_titles/LAAMPs.txt @@ -15,6 +15,20 @@ d_laamp_zolt = { ai_primary_priority = { add = @never_primary_score } } +d_laamp_test_jewish = { + color = { 100 100 100 } + capital = c_london + + definite_form = yes + landless = yes + ruler_uses_title_name = no + always_follows_primary_heir = yes + no_automatic_claims = yes + noble_family = yes + destroy_if_invalid_heir = yes + + ai_primary_priority = { add = @never_primary_score } +} d_laamp_bookwyrm = { color = { 100 100 100 } capital = c_guines diff --git a/common/laws/00_succession_laws.txt b/common/laws/00_succession_laws.txt new file mode 100644 index 00000000..c91c100d --- /dev/null +++ b/common/laws/00_succession_laws.txt @@ -0,0 +1,2066 @@ +succession_order_laws = { + + flag = succession_order_laws + + can_change_law_group = { + custom_tooltip = { + text = CANT_CHANGE_LAW_TOOLTIP + NOR = { + has_realm_law = mandala_succession_law + government_has_flag = government_is_japan_administrative + } + } + } + + confederate_partition_succession_law = { + can_keep = { + trigger_if = { + limit = { + government_has_flag = government_is_japan_feudal + tgp_realm_has_ceremonial_liege_trigger = yes + } + is_independent_ruler = no + } + trigger_else = { always = yes } # for readability + } + can_pass = { + can_change_partition_succession_law_trigger = yes + trigger_if = { + limit = { + exists = primary_title + } + is_confederation_member = no + } + } + can_have = { + can_have_confederate_partition_succession_law_trigger = yes + trigger_if = { + limit = { + exists = primary_title + } + is_confederation_member = no + } + } + should_start_with = { + NOR = { + historical_succession_access_single_heir_succession_law_trigger = yes + historical_succession_access_single_heir_succession_law_youngest_trigger = yes + historical_succession_access_single_heir_dynasty_house_trigger = yes + } + OR = { + AND = { + government_has_flag = government_is_feudal + culture = { + NOR = { + has_innovation = innovation_hereditary_rule + has_innovation = innovation_heraldry + } + } + } + government_has_flag = government_is_tribal + government_has_flag = government_is_minority + } + } + succession = { + order_of_succession = inheritance + traversal_order = children + rank = oldest + title_division = partition + create_primary_tier_titles = yes + } + flag = partition_succession_law + modifier = { + glory_hound_opinion = 10 + parochial_opinion = 5 + belligerent_opinion = -10 + dynasty_house_opinion = 5 + eligible_child_opinion = 10 + } + pass_cost = { + prestige = change_succession_law_prestige_cost + } + + potential = { + NOR = { + government_has_flag = government_is_nomadic + government_has_flag = government_is_clan + government_has_flag = government_is_administrative + government_has_flag = government_is_mandala + government_has_flag = government_is_celestial + government_has_flag = government_is_meritocratic + government_has_flag = government_is_steppe_admin + } + } + } + + partition_succession_law = { + can_keep = { + OR = { + can_keep_partition_succession_law_trigger = yes + trigger_if = { + limit = { + exists = primary_title + } + is_confederation_member = yes + } + } + } + can_pass = { + OR = { + can_change_partition_succession_law_trigger = yes + trigger_if = { + limit = { + exists = primary_title + } + is_confederation_member = yes + } + } + } + can_have = { + OR = { + can_have_partition_succession_law_trigger = yes + trigger_if = { + limit = { + exists = primary_title + } + is_confederation_member = yes + } + } + } + should_start_with = { + NOR = { + historical_succession_access_single_heir_succession_law_trigger = yes + historical_succession_access_single_heir_succession_law_youngest_trigger = yes + historical_succession_access_single_heir_dynasty_house_trigger = yes + } + government_has_flag = government_is_feudal + culture = { + has_innovation = innovation_hereditary_rule + NOT = { + has_innovation = innovation_heraldry + } + } + NOT = { government_allows = administrative } + } + succession = { + order_of_succession = inheritance + traversal_order = children + rank = oldest + title_division = partition + } + flag = partition_succession_law + modifier = { + glory_hound_opinion = 10 + parochial_opinion = 5 + belligerent_opinion = -10 + player_heir_opinion = 10 + eligible_child_except_player_heir_opinion = 5 + } + pass_cost = { + prestige = change_succession_law_prestige_cost + } + + ai_will_do = { + if = { + limit = { has_realm_law = confederate_partition_succession_law } + value = 1 + } + } + + potential = { + NOR = { + government_has_flag = government_is_nomadic + government_has_flag = government_is_clan + government_has_flag = government_is_administrative + government_has_flag = government_is_mandala + government_has_flag = government_is_celestial + government_has_flag = government_is_meritocratic + government_has_flag = government_is_steppe_admin + } + } + } + + high_partition_succession_law = { + can_keep = { + can_keep_high_partition_succession_law_trigger = yes + } + can_pass = { + can_change_partition_succession_law_trigger = yes + } + can_have = { + NOT = { government_has_flag = government_is_nomadic } + can_have_high_partition_succession_law_trigger = yes + } + should_start_with = { + NOR = { + historical_succession_access_single_heir_succession_law_trigger = yes + historical_succession_access_single_heir_succession_law_youngest_trigger = yes + historical_succession_access_single_heir_dynasty_house_trigger = yes + } + government_has_flag = government_is_feudal + culture = { + has_innovation = innovation_heraldry + } + NOT = { government_allows = administrative } + } + succession = { + order_of_succession = inheritance + traversal_order = children + rank = oldest + title_division = partition + primary_heir_minimum_share = 0.5 + } + flag = partition_succession_law + modifier = { + glory_hound_opinion = 5 + belligerent_opinion = -10 + player_heir_opinion = 15 + } + pass_cost = { + prestige = change_succession_law_prestige_cost + } + + ai_will_do = { + if = { + limit = { + OR = { + has_realm_law = confederate_partition_succession_law + has_realm_law = partition_succession_law + } + } + value = 2 + } + } + + potential = { + NOR = { + government_has_flag = government_is_nomadic + government_has_flag = government_is_clan + government_has_flag = government_is_administrative + government_has_flag = government_is_mandala + government_has_flag = government_is_celestial + government_has_flag = government_is_meritocratic + government_has_flag = government_is_steppe_admin + } + } + } + + single_heir_succession_law = { + can_keep = { + can_keep_single_heir_succession_law_trigger = yes + # Vassal Contract allows it + custom_description = { + text = succession_laws_must_not_be_forced_partition + NAND = { + top_liege != this + vassal_contract_has_flag = locked_to_partition + } + } + } + can_title_have = { + # Ceremonial Regent + NOT = { exists = var:administrative_ui_special_title.holder } + } + can_have = { + NOT = { government_has_flag = government_is_nomadic } + can_have_single_heir_succession_law_trigger = yes + } + can_pass = { + can_change_succession_law_trigger = yes + trigger_if = { + limit = { + government_has_flag = government_is_clan + } + piety_level >= 3 + } + trigger_if = { + limit = { + government_allows = administrative + } + influence_level >= 4 + has_active_diarchy = no + primary_title = { title_held_years >= 10 } + } + } + should_start_with = { + historical_succession_access_single_heir_succession_law_trigger = yes + } + succession = { + order_of_succession = inheritance + traversal_order = children + rank = oldest + title_division = single_heir + } + flag = advanced_succession_law + modifier = { + glory_hound_opinion = -10 + parochial_opinion = -5 + player_heir_opinion = 20 + eligible_child_except_player_heir_opinion = -5 + } + pass_cost = { + prestige = change_succession_law_prestige_cost + piety = { + value = 0 + if = { + limit = { + government_has_flag = government_is_clan + } + add = { + desc = "clan_government_cost_tooltip" + value = 1500 + } + } + } + } + revoke_cost = { + prestige = change_succession_law_prestige_cost + } + + ai_will_do = { + value = 3 + } + + potential = { + NOR = { + government_has_flag = government_is_nomadic + government_has_flag = government_is_mandala + } + trigger_if = { + limit = { + government_allows = administrative + } + OR = { + is_independent_ruler = yes + tgp_is_ceremonial_liege_trigger = yes + } + } + } + } + + single_heir_succession_kurultai_law = { + can_keep = { + government_has_flag = government_is_nomadic + } + can_have = { + government_has_flag = government_is_nomadic + } + can_pass = { + government_has_flag = government_is_nomadic + } + should_start_with = { + government_has_flag = government_is_nomadic + } + succession = { + order_of_succession = inheritance + traversal_order = children + rank = oldest + title_division = single_heir + } + flag = advanced_succession_law + flag = can_designate_heirs + modifier = { + belligerent_opinion = 10 + glory_hound_opinion = 5 + player_heir_opinion = 20 + eligible_child_except_player_heir_opinion = -20 + } + pass_cost = { + } + revoke_cost = { + prestige = change_succession_law_prestige_cost + } + + ai_will_do = { + value = 3 + } + + potential = { + government_has_flag = government_is_nomadic + } + } + + single_heir_succession_law_youngest = { + can_keep = { + can_keep_single_heir_youngest_succession_law_trigger = yes + # Vassal Contract allows it + custom_description = { + text = succession_laws_must_not_be_forced_partition + NAND = { + top_liege != this + vassal_contract_has_flag = locked_to_partition + } + } + } + can_have = { + NOT = { government_has_flag = government_is_nomadic } + can_have_single_heir_youngest_succession_law_trigger = yes + } + can_pass = { + can_change_succession_law_trigger = yes + trigger_if = { + limit = { + government_has_flag = government_is_clan + } + piety_level >= 3 + } + trigger_if = { + limit = { + government_allows = administrative + } + influence_level >= 4 + has_active_diarchy = no + primary_title = { title_held_years >= 10 } + } + } + succession = { + order_of_succession = inheritance + traversal_order = children + rank = youngest + title_division = single_heir + } + + flag = advanced_succession_law + modifier = { + glory_hound_opinion = -10 + parochial_opinion = -5 + player_heir_opinion = 20 + eligible_child_except_player_heir_opinion = -5 + } + pass_cost = { + prestige = change_succession_law_prestige_cost + piety = { + value = 0 + if = { + limit = { + government_has_flag = government_is_clan + } + add = { + desc = "clan_government_cost_tooltip" + value = 1500 + } + } + } + } + revoke_cost = { + prestige = change_succession_law_prestige_cost + } + + potential = { + trigger_if = { + limit = { + government_has_flag = government_is_administrative + } + is_independent_ruler = yes + } + NOR = { + government_has_flag = government_is_nomadic + government_has_flag = government_is_mandala + } + } + } + + single_heir_dynasty_house = { # LAST CALL + can_keep = { + can_keep_single_heir_dynasty_house_trigger = yes + # Vassal Contract allows it + custom_description = { + text = succession_laws_must_not_be_forced_partition + NAND = { + top_liege != this + vassal_contract_has_flag = locked_to_partition + } + } + } + can_have = { + NOT = { government_has_flag = government_is_nomadic } + can_have_single_heir_dynasty_house_trigger = yes + } + can_pass = { + can_change_single_heir_dynasty_house_succession_law_trigger = yes + trigger_if = { + limit = { + government_has_flag = government_is_clan + } + piety_level >= 3 + } + } + should_start_with = { + historical_succession_access_single_heir_dynasty_house_trigger = yes + NOT = { government_allows = administrative } + } + succession = { + order_of_succession = inheritance + traversal_order = dynasty_house + rank = oldest + title_division = single_heir + } + + flag = advanced_succession_law + modifier = { + glory_hound_opinion = -5 + eligible_child_except_player_heir_opinion = -15 + dynasty_house_opinion = 5 + } + pass_cost = { + prestige = change_succession_law_prestige_cost + piety = { + value = 0 + if = { + limit = { + government_has_flag = government_is_clan + } + add = { + desc = "clan_government_cost_tooltip" + value = 1500 + } + } + } + } + revoke_cost = { + prestige = change_succession_law_prestige_cost + } + + ai_will_do = { + if = { + limit = { + exists = primary_title + primary_title.tier > tier_county + OR = { + #West Slavic + culture = { has_cultural_pillar = heritage_west_slavic } + } + } + value = 2 + } + } + + potential = { + NOR = { + government_has_flag = government_is_administrative + government_has_flag = government_is_nomadic + government_has_flag = government_is_mandala + } + } + } + + acclamation_succession_law = { + can_keep = { + can_keep_acclamation_succession_law_trigger = yes + } + can_pass = { + can_change_acclamation_succession_law_trigger = yes + } + can_have = { + NOT = { government_has_flag = government_is_nomadic } + can_have_acclamation_succession_law_trigger = yes + } + should_start_with = { + has_ep3_dlc_trigger = yes + has_title = title:e_byzantium + government_allows = administrative + } + succession = { + order_of_succession = appointment + appointment_type = admin_emperor + } + flag = advanced_succession_law + flag = can_designate_heirs + flag = appointment_type_succession + pass_cost = { + prestige = { + value = change_succession_law_prestige_cost + multiply = { + value = 0.5 # We reduce the cost to ensure that going back to acclamation is easy + desc = "[administrative_government|E]" + } + } + } + ai_will_do = { + if = { + limit = { has_realm_law = confederate_partition_succession_law } + value = 1 + } + } + potential = { + government_allows = administrative + is_independent_ruler = yes + NOR = { + government_has_flag = government_is_celestial + government_has_flag = government_is_japan_administrative + government_has_flag = government_is_meritocratic + government_has_flag = government_is_steppe_admin + } + } + } + + appointment_succession_law = { + can_keep = { + can_keep_appointment_succession_law_trigger = yes + # Vassal Contract allows it + custom_description = { + text = succession_laws_must_not_be_forced_partition + NAND = { + top_liege != this + vassal_contract_has_flag = locked_to_partition + } + } + } + can_have = { + NOT = { government_has_flag = government_is_nomadic } + can_have_appointment_succession_law_trigger = yes + } + can_pass = { + can_change_appointment_succession_law_trigger = yes + } + should_start_with = { + government_allows = administrative + NOR = { + government_has_flag = government_is_celestial + government_has_flag = government_is_japan_administrative + government_has_flag = government_is_meritocratic + government_has_flag = government_is_steppe_admin + } + is_independent_ruler = no + } + succession = { + order_of_succession = appointment + appointment_type = admin_governor + } + flag = advanced_succession_law + flag = appointment_type_succession + modifier = { + glory_hound_opinion = -10 + parochial_opinion = -5 + player_heir_opinion = 20 + eligible_child_except_player_heir_opinion = -5 + } + pass_cost = { + prestige = change_succession_law_prestige_cost + } + revoke_cost = { + prestige = change_succession_law_prestige_cost + } + + ai_will_do = { + if = { + limit = { + OR = { + has_realm_law = confederate_partition_succession_law + has_realm_law = partition_succession_law + has_realm_law = high_partition_succession_law + } + } + value = 3 + } + } + + potential = { + government_allows = administrative # Default succession law for all admin types... + NOR = { # ... Unless you have a unique succession available + government_has_flag = government_is_celestial + government_has_flag = government_is_japan_administrative + government_has_flag = government_is_meritocratic + } + is_independent_ruler = no + } + } + + #The prowess succession of LAAMPs is determined in code + landless_adventurer_succession_law = { + can_keep = { + government_has_flag = government_is_landless_adventurer + } + can_have = { + government_has_flag = government_is_landless_adventurer + } + can_pass = { + government_has_flag = government_is_landless_adventurer + } + should_start_with = { + government_has_flag = government_is_landless_adventurer + } + should_show_for_title = { # Never show this in the UI, just apply it through script + always = no + } + can_remove_from_title = { + always = no + } + succession = { + order_of_succession = inheritance + traversal_order = children + rank = oldest + title_division = single_heir + exclude_rulers = yes + limit_to_courtiers = yes + } + flag = can_designate_heirs + + potential = { + government_has_flag = government_is_landless_adventurer + } + } + + bishop_theocratic_succession_law = { + can_keep = { + can_have_bishop_theocratic_succession_law_trigger = yes # same as can_have + } + can_have = { + can_have_bishop_theocratic_succession_law_trigger = yes + } + should_start_with = { + always = yes + } + succession = { + order_of_succession = theocratic + faith = same_faith + pool_character_config = pool_theocratic_succession + } + + potential = { + can_have_bishop_theocratic_succession_law_trigger = yes + } + } + + holy_order_succession_law = { + can_keep = { + can_have_holy_order_succession_law_trigger = yes # same as can_have + } + can_have = { + can_have_holy_order_succession_law_trigger = yes + } + should_start_with = { + government_has_flag = government_is_holy_order + } + succession = { + order_of_succession = theocratic + faith = same_faith + pool_character_config = pool_holy_order_succession + } + + potential = { + can_have_holy_order_succession_law_trigger = yes + } + } + + mercenary_company_succession_law = { + can_keep = { + can_have_mercenary_succession_law_trigger = yes + } + can_have = { + can_have_mercenary_succession_law_trigger = yes + } + should_start_with = { + government_has_flag = government_is_mercenary + } + succession = { + order_of_succession = company + pool_character_config = pool_mercenary_succession + } + + potential = { + can_have_mercenary_succession_law_trigger = yes + } + } + + city_succession_law = { + can_keep = { + can_have_city_succession_law_trigger = yes + } + can_have = { + can_have_city_succession_law_trigger = yes + } + should_start_with = { + government_has_flag = government_is_republic + } + succession = { + order_of_succession = generate + pool_character_config = pool_city_succession + } + + potential = { + can_have_city_succession_law_trigger = yes + } + } + + clan_antagonistic_partition_succession_law = { + can_keep = { + government_has_flag = government_is_clan + house ?= { + has_house_unity_stage = antagonistic + } + } + can_pass = { + government_has_flag = government_is_clan + house ?= { + has_house_unity_stage = antagonistic + } + } + can_have = { + government_has_flag = government_is_clan + house ?= { + has_house_unity_stage = antagonistic + } + } + + should_start_with = { + government_has_flag = government_is_clan + house ?= { has_house_unity_stage = antagonistic } + } + + potential = { + government_has_flag = government_is_clan + } + + requires_approve = { + NOT = { + government_has_flag = government_is_clan + } + } + + succession = { + order_of_succession = inheritance + traversal_order = children + rank = oldest + title_division = partition + } + + flag = same_house_vassals_gain_claim_on_primary_title + flag = house_unity_stage_antagonistic + + modifier = { + dynasty_house_opinion = -10 + glory_hound_opinion = 15 + zealot_opinion = 10 + belligerent_opinion = -10 + player_heir_opinion = 10 + eligible_child_except_player_heir_opinion = 5 + } + + widget_name = "widget_clan_law" + } + + clan_competitive_partition_succession_law = { + can_keep = { + government_has_flag = government_is_clan + house ?= { + has_house_unity_stage = competitive + } + } + can_pass = { + government_has_flag = government_is_clan + house ?= { + has_house_unity_stage = competitive + } + } + can_have = { + government_has_flag = government_is_clan + house ?= { + has_house_unity_stage = competitive + } + } + should_start_with = { + government_has_flag = government_is_clan + house ?= { has_house_unity_stage = competitive } + } + + potential = { + government_has_flag = government_is_clan + } + + requires_approve = { + NOT = { + government_has_flag = government_is_clan + } + } + + succession = { + order_of_succession = inheritance + traversal_order = children + rank = oldest + title_division = partition + } + + flag = same_house_vassals_gain_claim_on_primary_title + flag = house_unity_stage_competitive + + modifier = { + glory_hound_opinion = 10 + zealot_opinion = 5 + belligerent_opinion = -5 + player_heir_opinion = 10 + eligible_child_except_player_heir_opinion = 5 + } + + widget_name = "widget_clan_law" + } + + clan_impassive_partition_succession_law = { + can_keep = { + government_has_flag = government_is_clan + house ?= { + OR = { + has_house_unity_stage = impassive + # In case the house is fully unlanded + has_house_unity = no + } + } + } + can_pass = { + government_has_flag = government_is_clan + house ?= { + has_house_unity_stage = impassive + } + } + can_have = { + government_has_flag = government_is_clan + house ?= { + has_house_unity_stage = impassive + } + } + should_start_with = { + government_has_flag = government_is_clan + house ?= { + OR = { + has_house_unity_stage = impassive + # In case the house is fully unlanded + has_house_unity = no + } + } + } + + potential = { + government_has_flag = government_is_clan + } + + requires_approve = { + NOT = { + government_has_flag = government_is_clan + } + } + + flag = house_unity_stage_impassive + + succession = { + order_of_succession = inheritance + traversal_order = children + rank = oldest + title_division = partition + primary_heir_minimum_share = 0.25 + } + modifier = { + glory_hound_opinion = 5 + parochial_opinion = 5 + player_heir_opinion = 15 + } + + widget_name = "widget_clan_law" + } + + clan_friendly_partition_succession_law = { + can_keep = { + government_has_flag = government_is_clan + house ?= { + has_house_unity_stage = friendly + } + } + can_pass = { + government_has_flag = government_is_clan + house ?= { + has_house_unity_stage = friendly + } + } + can_have = { + government_has_flag = government_is_clan + house ?= { + has_house_unity_stage = friendly + } + } + should_start_with = { + government_has_flag = government_is_clan + house ?= { has_house_unity_stage = friendly } + } + + potential = { + government_has_flag = government_is_clan + } + + requires_approve = { + NOT = { + government_has_flag = government_is_clan + } + } + + flag = house_unity_stage_friendly + + succession = { + order_of_succession = inheritance + traversal_order = children + rank = oldest + title_division = partition + primary_heir_minimum_share = 0.5 + } + modifier = { + parochial_opinion = 10 + courtly_opinion = 5 + player_heir_opinion = 25 + } + + widget_name = "widget_clan_law" + } + + clan_harmonious_partition_succession_law = { + can_keep = { + government_has_flag = government_is_clan + house ?= { + has_house_unity_stage = harmonious + } + } + can_pass = { + government_has_flag = government_is_clan + house ?= { + has_house_unity_stage = harmonious + } + } + can_have = { + government_has_flag = government_is_clan + house ?= { + has_house_unity_stage = harmonious + } + } + should_start_with = { + government_has_flag = government_is_clan + house ?= { + has_house_unity_stage = harmonious + } + } + potential = { + government_has_flag = government_is_clan + } + + requires_approve = { + NOT = { + government_has_flag = government_is_clan + } + } + + flag = house_unity_stage_harmonious + + succession = { + order_of_succession = inheritance + traversal_order = children + rank = oldest + title_division = partition + primary_heir_minimum_share = 0.75 + } + modifier = { + parochial_opinion = 15 + courtly_opinion = 10 + player_heir_opinion = 40 + } + + widget_name = "widget_clan_law" + } + + herder_succession_law = { + can_keep = { + can_have_herder_succession_law_trigger = yes + } + can_have = { + can_have_herder_succession_law_trigger = yes + } + should_start_with = { + government_has_flag = government_is_herder + } + can_remove_from_title = { + always = no + } + succession = { + order_of_succession = generate + pool_character_config = pool_herder_succession + } + + potential = { + can_have_herder_succession_law_trigger = yes + } + } + + celestial_appointment_succession_law = { + can_keep = { + government_allows = administrative + is_independent_ruler = no + custom_tooltip = { + text = celestial_appointment_allowed_desc + NOT = { vassal_contract_has_flag = celestial_military_appointment } + } + # Vassal Contract allows it + custom_description = { + text = succession_laws_must_not_be_forced_partition + NAND = { + is_independent_ruler = no + vassal_contract_has_flag = locked_to_partition + } + } + } + can_have = { + government_allows = administrative + is_independent_ruler = no + } + can_pass = { + government_allows = administrative + is_independent_ruler = no + } + should_start_with = { + government_has_flag = government_is_celestial + is_independent_ruler = no + custom_tooltip = { + text = celestial_appointment_allowed_desc + NOT = { vassal_contract_has_flag = celestial_military_appointment } + } + } + succession = { + order_of_succession = appointment + appointment_type = celestial_civic_governor + } + flag = advanced_succession_law + flag = appointment_type_succession + modifier = { + glory_hound_opinion = -10 + courtly_opinion = 5 + player_heir_opinion = 20 + eligible_child_except_player_heir_opinion = -5 + } + pass_cost = { + prestige = change_succession_law_prestige_cost + } + revoke_cost = { + prestige = change_succession_law_prestige_cost + } + + ai_will_do = { + if = { + limit = { + OR = { + has_realm_law = confederate_partition_succession_law + has_realm_law = partition_succession_law + has_realm_law = high_partition_succession_law + } + } + value = 3 + } + } + + potential = { + government_has_flag = government_is_celestial + is_independent_ruler = no + } + } + + celestial_military_appointment_succession_law = { + can_keep = { + government_allows = administrative + is_independent_ruler = no + custom_tooltip = { + text = celestial_military_appointment_allowed_desc + vassal_contract_has_flag = celestial_military_appointment + } + # Vassal Contract allows it + custom_description = { + NAND = { + is_independent_ruler = no + vassal_contract_has_flag = locked_to_partition + } + } + } + can_have = { + government_allows = administrative + is_independent_ruler = no + } + can_pass = { + can_change_succession_law_trigger = yes + government_allows = administrative + is_independent_ruler = no + } + should_start_with = { + government_has_flag = government_is_celestial + is_independent_ruler = no + custom_tooltip = { + text = celestial_military_appointment_allowed_desc + vassal_contract_has_flag = celestial_military_appointment + } + } + succession = { + order_of_succession = appointment + appointment_type = celestial_military_governor + } + flag = advanced_succession_law + flag = appointment_type_succession + modifier = { + glory_hound_opinion = 5 + courtly_opinion = -10 + player_heir_opinion = 20 + eligible_child_except_player_heir_opinion = -5 + } + pass_cost = { + prestige = change_succession_law_prestige_cost + } + revoke_cost = { + prestige = change_succession_law_prestige_cost + } + + ai_will_do = { + if = { + limit = { + OR = { + has_realm_law = confederate_partition_succession_law + has_realm_law = partition_succession_law + has_realm_law = high_partition_succession_law + } + } + value = 3 + } + } + + potential = { + government_has_flag = government_is_celestial + is_independent_ruler = no + } + } + + japanese_regency_succession_law = { + can_keep = { + can_have_japanese_regency_succession_law_trigger = yes + } + can_pass = { + can_have_japanese_regency_succession_law_trigger = yes + } + can_have = { + can_have_japanese_regency_succession_law_trigger = yes + } + can_title_have = { + exists = var:administrative_ui_special_title + } + should_show_for_title = { # Never show this in the UI, just apply it through script + always = no + } + can_remove_from_title = { + always = no + } + should_start_with = { + always = no + } + succession = { + order_of_succession = appointment + appointment_type = japanese_regent + } + flag = advanced_succession_law + flag = can_designate_heirs + flag = appointment_type_succession + pass_cost = { + prestige = change_succession_law_prestige_cost + } + ai_will_do = { + if = { + limit = { has_realm_law = confederate_partition_succession_law } + value = 1 + } + } + potential = { + government_has_flag = government_is_japan_administrative + } + } + + japanese_appointment_succession_law = { + can_keep = { + can_keep_japanese_appointment_succession_law_trigger = yes + } + can_pass = { + can_change_japanese_appointment_succession_law_trigger = yes + } + can_have = { + can_have_japanese_appointment_succession_law_trigger = yes + } + should_start_with = { + government_has_flag = government_is_japan_administrative + is_independent_ruler = no + NOT = { has_title = title:k_chrysanthemum_throne } + } + succession = { + order_of_succession = appointment + appointment_type = japanese_governor + } + flag = advanced_succession_law + flag = appointment_type_succession + modifier = { + glory_hound_opinion = -10 + parochial_opinion = -5 + player_heir_opinion = 20 + eligible_child_except_player_heir_opinion = -5 + } + pass_cost = { + prestige = change_succession_law_prestige_cost + } + revoke_cost = { + prestige = change_succession_law_prestige_cost + } + + ai_will_do = { + if = { + limit = { + OR = { + has_realm_law = confederate_partition_succession_law + has_realm_law = partition_succession_law + has_realm_law = high_partition_succession_law + } + } + value = 3 + } + } + + potential = { + government_has_flag = government_is_japan_administrative + is_independent_ruler = no + } + } + + japanese_military_appointment_succession_law = { + can_keep = { + government_allows = administrative + is_independent_ruler = no + custom_tooltip = { + text = celestial_military_appointment_allowed_desc + vassal_contract_has_flag = japan_administrative_military_appointment + } + # Vassal Contract allows it + custom_description = { + NAND = { + is_independent_ruler = no + vassal_contract_has_flag = locked_to_partition + } + } + } + can_have = { + government_allows = administrative + is_independent_ruler = no + } + can_pass = { + can_change_succession_law_trigger = yes + government_allows = administrative + is_independent_ruler = no + } + should_start_with = { + government_has_flag = government_is_japan_administrative + is_independent_ruler = no + custom_tooltip = { + text = celestial_military_appointment_allowed_desc + vassal_contract_has_flag = japan_administrative_military_appointment + } + } + succession = { + order_of_succession = appointment + appointment_type = japanese_military_governor + } + flag = advanced_succession_law + flag = appointment_type_succession + modifier = { + glory_hound_opinion = 5 + courtly_opinion = -10 + player_heir_opinion = 20 + eligible_child_except_player_heir_opinion = -5 + } + pass_cost = { + prestige = change_succession_law_prestige_cost + } + revoke_cost = { + prestige = change_succession_law_prestige_cost + } + + ai_will_do = { + if = { + limit = { + OR = { + has_realm_law = confederate_partition_succession_law + has_realm_law = partition_succession_law + has_realm_law = high_partition_succession_law + } + } + value = 3 + } + } + + potential = { + government_has_flag = government_is_japan_administrative + is_independent_ruler = no + } + } + + mandala_succession_law = { + can_keep = { + realm_law_is_mandala = yes + } + can_have = { + realm_law_is_mandala = yes + } + can_pass = { + realm_law_is_mandala = yes + } + should_start_with = { + realm_law_is_mandala = yes + } + should_show_for_title = { # Never show this in the UI, just apply it through script + always = no + } + can_remove_from_title = { + always = no + } + succession = { + order_of_succession = inheritance + traversal_order = children + rank = oldest + title_division = single_heir + } + flag = can_designate_heirs + + potential = { + realm_law_is_mandala = yes + } + } + + meritocratic_appointment_succession_law = { + can_keep = { + government_allows = administrative + is_independent_ruler = no + custom_tooltip = { + text = celestial_military_appointment_allowed_desc + NOT = { vassal_contract_has_flag = meritocratic_military_appointment } + } + # Vassal Contract allows it + custom_description = { + text = succession_laws_must_not_be_forced_partition + NAND = { + is_independent_ruler = no + vassal_contract_has_flag = locked_to_partition + } + } + } + can_have = { + government_allows = administrative + is_independent_ruler = no + } + can_pass = { + government_allows = administrative + is_independent_ruler = no + } + should_start_with = { + OR = { + government_has_flag = government_is_meritocratic + government_has_flag = government_is_steppe_admin + } + is_independent_ruler = no + custom_tooltip = { + text = celestial_military_appointment_allowed_desc + NOT = { vassal_contract_has_flag = meritocratic_military_appointment } + } + } + succession = { + order_of_succession = appointment + appointment_type = meritocratic_civic_governor + } + flag = advanced_succession_law + flag = appointment_type_succession + modifier = { + glory_hound_opinion = -10 + courtly_opinion = 5 + player_heir_opinion = 20 + eligible_child_except_player_heir_opinion = -5 + } + pass_cost = { + prestige = change_succession_law_prestige_cost + } + revoke_cost = { + prestige = change_succession_law_prestige_cost + } + + ai_will_do = { + if = { + limit = { + OR = { + has_realm_law = confederate_partition_succession_law + has_realm_law = partition_succession_law + has_realm_law = high_partition_succession_law + } + } + value = 3 + } + } + + potential = { + government_has_flag = government_is_meritocratic + is_independent_ruler = no + } + } + + meritocratic_military_appointment_succession_law = { + can_keep = { + government_allows = administrative + is_independent_ruler = no + custom_tooltip = { + text = celestial_military_appointment_allowed_desc + vassal_contract_has_flag = meritocratic_military_appointment + } + # Vassal Contract allows it + custom_description = { + text = succession_laws_must_not_be_forced_partition + NAND = { + is_independent_ruler = no + vassal_contract_has_flag = locked_to_partition + } + } + } + can_have = { + government_allows = administrative + is_independent_ruler = no + } + can_pass = { + government_allows = administrative + is_independent_ruler = no + } + should_start_with = { + OR = { + government_has_flag = government_is_meritocratic + government_has_flag = government_is_steppe_admin + } + is_independent_ruler = no + custom_tooltip = { + text = celestial_military_appointment_allowed_desc + vassal_contract_has_flag = meritocratic_military_appointment + } + } + succession = { + order_of_succession = appointment + appointment_type = meritocratic_military_governor + } + flag = advanced_succession_law + flag = appointment_type_succession + modifier = { + glory_hound_opinion = -10 + courtly_opinion = 5 + player_heir_opinion = 20 + eligible_child_except_player_heir_opinion = -5 + } + pass_cost = { + prestige = change_succession_law_prestige_cost + } + revoke_cost = { + prestige = change_succession_law_prestige_cost + } + + ai_will_do = { + if = { + limit = { + OR = { + has_realm_law = confederate_partition_succession_law + has_realm_law = partition_succession_law + has_realm_law = high_partition_succession_law + } + } + value = 3 + } + } + + potential = { + government_has_flag = government_is_meritocratic + is_independent_ruler = no + } + } + + meritocratic_regency_succession_law = { + can_keep = { + can_have_meritocratic_regency_succession_law_trigger = yes + } + can_pass = { + can_have_meritocratic_regency_succession_law_trigger = yes + } + can_have = { + can_have_meritocratic_regency_succession_law_trigger = yes + } + can_title_have = { + exists = var:administrative_ui_special_title + } + should_show_for_title = { # Never show this in the UI, just apply it through script + always = no + } + can_remove_from_title = { + always = no + } + should_start_with = { + always = no + } + succession = { + order_of_succession = appointment + appointment_type = meritocratic_regent + } + flag = advanced_succession_law + flag = can_designate_heirs + flag = appointment_type_succession + pass_cost = { + prestige = change_succession_law_prestige_cost + } + ai_will_do = { + if = { + limit = { has_realm_law = confederate_partition_succession_law } + value = 1 + } + } + potential = { + government_allows = administrative + government_allows = merit + tgp_realm_has_ceremonial_liege_trigger = yes + } + } +} + +succession_gender_laws = { + default = male_preference_law + flag = succession_gender_laws + + male_only_law = { + can_title_have = { + can_title_have_law_general_trigger = yes + } + should_show_for_title = { # Never show this in the UI, just apply it through script + always = no + } + can_keep = { + trigger_if = { + limit = { + top_liege != this + government_allows = administrative + } + top_liege = { has_realm_law = male_only_law } + } + trigger_else = { + custom_tooltip = { + text = culture_not_male_only_tt + OR = { + faith = { has_doctrine = doctrine_gender_male_dominated } + NOT = { + culture = { has_cultural_parameter = female_only_inheritance } + } + } + } + } + } + can_pass = { + can_change_succession_law_trigger = yes + } + should_start_with = { + trigger_if = { + limit = { + government_has_flag = government_has_merit + } + faith = { + has_doctrine = doctrine_gender_male_dominated + } + } + trigger_else_if = { + limit = { + top_liege != this + government_allows = administrative + } + top_liege = { has_realm_law = male_only_law } + } + trigger_else = { + faith = { + has_doctrine = doctrine_gender_male_dominated + religion_tag = islam_religion + } + } + } + succession = { + gender_law = male_only + } + flag = men_can_have_multiple_spouses + flag = men_can_have_consorts + flag = no_female_commanders + + pass_cost = { + prestige = change_succession_law_prestige_cost + } + revoke_cost = { + prestige = change_succession_law_prestige_cost + } + } + + male_preference_law = { + can_title_have = { + can_title_have_law_general_trigger = yes + } + should_show_for_title = { # Never show this in the UI, just apply it through script + always = no + } + can_keep = { + trigger_if = { + limit = { + top_liege != this + government_allows = administrative + } + top_liege = { has_realm_law = male_preference_law } + } + trigger_else = { + custom_description = { + text = change_law_male_preference_faith_requirement + faith = { + NOT = { has_doctrine = doctrine_gender_female_dominated } + } + } + custom_tooltip = { + text = culture_not_female_only_tt + OR = { + faith = { has_doctrine = doctrine_gender_male_dominated } + NOT = { + culture = { has_cultural_parameter = female_only_inheritance } + } + } + } + } + } + can_pass = { + can_change_succession_law_trigger = yes + } + should_start_with = { + trigger_if = { + limit = { + top_liege != this + government_allows = administrative + } + top_liege = { has_realm_law = male_preference_law } + } + trigger_else = { + NOT = { + culture = { has_cultural_parameter = female_preference_inheritance } + } + OR = { + faith = { + NOR = { + religion_tag = islam_religion + AND = { + root = { + government_has_flag = government_has_merit + } + has_doctrine = doctrine_gender_male_dominated + } + } + has_doctrine = doctrine_gender_male_dominated + } + AND = { + has_realm_law = male_only_law # For when male_only_law ceases to be a legal option + trigger_if = { + limit = { + is_independent_ruler = no + government_allows = administrative + } + NOT = { + top_liege = { has_realm_law = male_only_law } + } + } + trigger_else = { + custom_tooltip = { + text = culture_not_female_only_tt + NOR = { + faith = { has_doctrine = doctrine_gender_male_dominated } + NOT = { + culture = { has_cultural_parameter = female_only_inheritance } + } + } + } + } + } + } + } + } + succession = { + gender_law = male_preference + } + flag = men_can_have_multiple_spouses + flag = men_can_have_consorts + flag = no_female_commanders + + pass_cost = { + prestige = change_succession_law_prestige_cost + } + revoke_cost = { + prestige = change_succession_law_prestige_cost + } + } + + equal_law = { + can_title_have = { + can_title_have_law_general_trigger = yes + } + should_show_for_title = { # Never show this in the UI, just apply it through script + always = no + } + can_keep = { + trigger_if = { + limit = { + top_liege != this + government_allows = administrative + } + top_liege = { has_realm_law = equal_law } + } + trigger_else = { + custom_tooltip = { + text = equal_law_culture_faith_or_innovation_trigger + OR = { + culture = { has_cultural_parameter = gender_equal_inheritance } + #culture = { has_innovation = innovation_visigothic_codes } + faith = { has_doctrine = doctrine_gender_equal } + AND = { #Culture is female dominated but religion is male dominated + faith = { has_doctrine = doctrine_gender_male_dominated } + culture = { has_cultural_parameter = female_only_inheritance } + } + AND = { #Culture is male dominated but faith is female dominated + faith = { has_doctrine = doctrine_gender_female_dominated } + NOT = { culture = { has_cultural_parameter = female_only_inheritance } } + } + primary_title.var:can_keep_realm_law ?= flag:equal_law + } + } + } + } + can_pass = { + #can_change_to_equal_succession_law_trigger = yes + can_change_succession_law_trigger = yes + } + should_start_with = { + trigger_if = { + limit = { + top_liege != this + government_allows = administrative + } + top_liege = { has_realm_law = equal_law } + } + trigger_else = { + NOR = { + culture = { has_cultural_parameter = female_preference_inheritance } + culture = { has_cultural_tradition = tradition_nubian_warrior_queens } + } + faith = { + has_doctrine = doctrine_gender_equal + } + NOT = { has_realm_law = female_only_law } # For when female_only_law ceases to be valid + } + } + succession = { + gender_law = equal + } + flag = men_can_have_multiple_spouses + flag = men_can_have_consorts + flag = women_can_have_multiple_spouses + flag = women_can_have_consorts + + pass_cost = { + prestige = change_succession_law_prestige_cost + } + revoke_cost = { + prestige = change_succession_law_prestige_cost + } + + ai_will_do = { + if = { + limit = { + exists = primary_title + primary_title.tier > tier_county + faith = { + NOT = { + has_dominant_ruling_gender = prev + } + } + } + value = 2 + } + } + } + + female_preference_law = { + can_title_have = { + can_title_have_law_general_trigger = yes + } + should_show_for_title = { # Never show this in the UI, just apply it through script + always = no + } + can_keep = { + trigger_if = { + limit = { + top_liege != this + government_allows = administrative + } + top_liege = { has_realm_law = female_preference_law } + } + trigger_else_if = { + limit = { + culture = { has_cultural_parameter = female_preference_inheritance } + } + culture = { has_cultural_parameter = female_preference_inheritance } + } + trigger_else = { + custom_description = { + text = change_law_female_preference_faith_requirement + faith = { + NOT = { has_doctrine = doctrine_gender_male_dominated } + } + } + custom_tooltip = { + text = female_preference_law_faith_or_culture_trigger + OR = { + faith = { has_doctrine = doctrine_gender_female_dominated } + NOT = { + culture = { has_cultural_parameter = male_only_inheritance } + } + } + } + } + } + should_start_with = { + trigger_if = { + limit = { + top_liege != this + government_allows = administrative + } + top_liege = { has_realm_law = female_preference_law } + } + trigger_else = { + OR = { + culture = { has_cultural_parameter = female_preference_inheritance } + faith = { + has_doctrine = doctrine_gender_female_dominated + } + has_realm_law = female_only_law # For when male_only_law ceases to be a legal option + } + } + } + can_pass = { + can_change_succession_law_trigger = yes + } + succession = { + gender_law = female_preference + } + flag = women_can_have_multiple_spouses + flag = women_can_have_consorts + + pass_cost = { + prestige = change_succession_law_prestige_cost + } + revoke_cost = { + prestige = change_succession_law_prestige_cost + } + } + + female_only_law = { + can_title_have = { + can_title_have_law_general_trigger = yes + } + should_show_for_title = { # Never show this in the UI, just apply it through script + always = no + } + can_keep = { + trigger_if = { + limit = { + top_liege != this + government_allows = administrative + } + top_liege = { has_realm_law = female_only_law } + } + trigger_else_if = { + limit = { + culture = { has_cultural_parameter = female_only_inheritance } + } + culture = { has_cultural_parameter = female_only_inheritance } + } + trigger_else = { + custom_tooltip = { + text = culture_not_female_only_tt + faith = { has_doctrine = doctrine_gender_female_dominated } + NOT = { + culture = { has_cultural_parameter = male_only_inheritance } + } + } + } + } + can_pass = { + can_change_succession_law_trigger = yes + } + succession = { + gender_law = female_only + } + flag = women_can_have_multiple_spouses + flag = women_can_have_consorts + + pass_cost = { + prestige = change_succession_law_prestige_cost + } + revoke_cost = { + prestige = change_succession_law_prestige_cost + } + + should_start_with = { + trigger_if = { + limit = { + top_liege != this + government_allows = administrative + } + top_liege = { has_realm_law = female_only_law } + } + trigger_else = { + culture = { has_cultural_parameter = female_only_inheritance } + } + } + } +} + +succession_faith = { + same_faith_only_law = { + can_keep = { + should_have_same_faith_succession_trigger = yes + } + can_pass = { + should_have_same_faith_succession_trigger = yes + } + should_start_with = { + should_have_same_faith_succession_trigger = yes + } + succession = { + faith = same_faith + } + } +} + +succession_rel_head = { + same_faith_theocratic_succession_law = { + shown_in_encyclopedia = no + can_keep = { + faith = { + religious_head = root + has_doctrine = doctrine_spiritual_head + } + } + succession = { + order_of_succession = theocratic + faith = same_faith + pool_character_config = pool_theocratic_succession + } + } + same_faith_succession_law = { + shown_in_encyclopedia = no + can_keep = { + faith = { + religious_head = root + has_doctrine = doctrine_temporal_head + } + } + succession = { + faith = same_faith + } + } +} diff --git a/common/on_action/title_on_actions.txt b/common/on_action/title_on_actions.txt new file mode 100644 index 00000000..b78bab71 --- /dev/null +++ b/common/on_action/title_on_actions.txt @@ -0,0 +1,4602 @@ +#On actions about titles + +# All on-actions in this file provide scope:transfer_type unless otherwise noted +# scope:transfer_type has the following permutations: +# flag:conquest +# flag:conquest_holy_war +# flag:conquest_claim +# flag:conquest_populist +# flag:inheritance +# flag:abdication +# flag:destroyed +# flag:created +# flag:usurped +# flag:granted +# flag:revoked +# flag:election +# flag:independency +# flag:returned +# flag:leased_out +# flag:lease_revoked +# flag:faction_demand +# flag:swear_fealty +# flag:stepped_down + +# A title is destroyed +# root = the holder before destruction +# scope:landed_title = the title that is being destroyed +# Does *not* provide scope:transfer_type +on_title_destroyed = { + effect = { + # If the title of an independent admin ruler is destroyed, let's make sure we handle any stray admin vassals + if = { + limit = { + government_allows = administrative + top_liege = this + administrative_counts_can_be_independent = no + NOT = { + any_held_title = { + title_tier >= kingdom + + this != scope:landed_title + is_noble_family_title = no + } + } + } + admin_change_government_effect = yes + } + # Adjust the size of the laamps tally. + else_if = { + limit = { + # Pre-filter out anything higher or lower. + scope:landed_title = { tier = tier_duchy } + has_global_variable_list = laamps_tally + } + # We don't need to check the list twice, since if they're not in it then removing them from it won't do anything. + remove_list_global_variable = { + name = laamps_tally + target = scope:landed_title + } + } + #Notify folks the latin empire has fallen + else_if = { + limit = { scope:landed_title = title:e_latin_empire } + frankokratia_latin_emp_end_msg_effect = yes + } + #Create byz collapse variable that defines anarchy period + else_if = { + limit = { + scope:landed_title = { + this = title:e_byzantium + } + } + if = { + limit = { + exists = global_var:byz_collapse_counter + } + remove_global_variable = byz_collapse_counter + } + set_global_variable = { + name = byz_collapse_counter + value = { + value = current_year + add = 100 + } + } + # Silk Road prosperity gets hit if Byzantium dies + tgp_silk_road_byzantium_destroyed_effect = yes + } + else_if = { + limit = { + scope:landed_title = title:h_china + } + situation:dynastic_cycle ?= { + if = { + limit = { + situation_top_has_catalyst = catalyst_hegemon_lost_mandate_of_heaven + } + trigger_situation_catalyst = { + catalyst = catalyst_hegemon_lost_mandate_of_heaven + character = root + } + } + } + every_vassal = { + # Because a change in liege isn't triggered when the title being destroyed + if = { + limit = { + government_has_flag = government_is_celestial + highest_held_title_tier >= tier_kingdom + primary_title = { + has_custom_title_name = no + } + tgp_capital_not_in_chinese_naming_region = no + } + if = { + limit = { + is_ai = no + } + trigger_event = { + id = tgp_dynastic_cycle.9000 + days = 1 # so the player gets to choose first + } + } + else = { + trigger_event = { + id = tgp_dynastic_cycle.9000 + days = 2 + } + } + } + } + title:h_china = { + reset_title_name = yes + } + } + else_if = { # Danelaw-England partition calc. + limit = { + # Partition must be active. + exists = global_var:partition_active_danelaw + # And the destroyed title must be one of the two partitioned entities. + OR = { + scope:landed_title = title:k_england + scope:landed_title = title:k_danelaw + } + } + # If k_england has been destroyed, set k_danelaw as the de jure inheritor. + if = { + limit = { scope:landed_title = title:k_england } + title:k_danelaw = { save_scope_as = partition_winner } + # Try to grab the old holder for down the line. + if = { + limit = { + exists = this + is_alive = yes + } + save_scope_as = loser + } + } + # If k_danelaw has been destroyed, set k_england as the de jure inheritor. + if = { + limit = { scope:landed_title = title:k_danelaw } + title:k_england = { save_scope_as = partition_winner } + if = { + limit = { + exists = this + is_alive = yes + } + save_scope_as = loser + } + } + # Either way, trigger the maintenance event. + trigger_event = british_isles.1041 + } + # Safety against invalid house bloc members + else_if = { + limit = { + scope:landed_title = { is_noble_family_title = yes } + exists = house.house_confederation + } + house = { + tgp_leave_house_bloc_effect = { + OPINION = flag:no + TRUCE = flag:no + } + } + } + } +} + +# A title is transferred to a new character +# root = the new holder +# scope:title = the title that changes hands +# scope:previous_holder = previous holder. Might be dead +on_title_gain = { + effect = { + ###################### + # COUNTY-TIER TITLES # + ###################### + if = { + limit = { + scope:title.tier = tier_county + } + + ########### + # MPO - Nomad Title Handling + ########### + if = { + limit = { + scope:title = { + is_nomad_title = yes + exists = title_domicile + } + } + scope:title = { + if = { + limit = { + root = { + any_held_title = { + is_nomad_title = yes + exists = title_domicile + NOT = { this = scope:title } + } + } + } + if = { + limit = { + root = { + any_held_title = { + is_nomad_title = yes + exists = title_domicile + NOT = { this = scope:title } + exists = var:player_domicile_title + } + } + } + root = { + random_held_title = { + limit = { + is_nomad_title = yes + exists = title_domicile + NOT = { this = scope:title } + exists = var:player_domicile_title + } + title_domicile = { + if = { + limit = { + exists = root.dynasty + scope:previous_holder.dynasty ?= root.dynasty + } + change_herd = { + value = scope:title.title_domicile.herd + } + } + } + root = { + destroy_title = scope:title + } + } + } + } + else_if = { + limit = { + exists = var:player_domicile_title + } + root = { + random_held_title = { + limit = { + is_nomad_title = yes + exists = title_domicile + NOT = { this = scope:title } + } + save_scope_as = old_nomad_title_to_clean_up + } + } + title_domicile = { + if = { + limit = { + exists = root.dynasty + scope:previous_holder.dynasty ?= root.dynasty + } + change_herd = { + value = scope:old_nomad_title_to_clean_up.title_domicile.herd + } + } + } + root = { + destroy_title = scope:old_nomad_title_to_clean_up + } + } + else_if = { + limit = { + root = { + any_held_title = { + is_nomad_title = yes + exists = title_domicile + NOT = { this = scope:title } + title_domicile.herd > scope:title.title_domicile.herd + } + } + } + root = { + random_held_title = { + limit = { + is_nomad_title = yes + exists = title_domicile + NOT = { this = scope:title } + title_domicile.herd > scope:title.title_domicile.herd + } + title_domicile = { + if = { + limit = { + exists = root.dynasty + scope:previous_holder.dynasty ?= root.dynasty + } + change_herd = { + value = scope:title.title_domicile.herd + } + } + } + } + destroy_title = scope:title + } + } + else = { + root = { + random_held_title = { + limit = { + is_nomad_title = yes + exists = title_domicile + NOT = { this = scope:title } + } + save_scope_as = old_nomad_title_to_clean_up + } + } + title_domicile = { + if = { + limit = { + exists = root.dynasty + scope:previous_holder.dynasty ?= root.dynasty + } + change_herd = { + value = scope:old_nomad_title_to_clean_up.title_domicile.herd + } + } + } + root = { + destroy_title = scope:old_nomad_title_to_clean_up + } + } + } + if = { + limit = { + exists = global_var:game_has_started + NOT = { + exists = previous_holder + } + } + if = { + limit = { + root = { + OR = { + house.house_head ?= { + this != root + any_held_title = { + is_nomad_title = yes + } + } + dynasty.dynast ?= { + this != root + any_held_title = { + is_nomad_title = yes + } + } + any_close_family_member = { + this != root + any_held_title = { + is_nomad_title = yes + } + } + } + } + } + generate_coa = yes # To lessen confusion thinking titles are the same + } + if = { + limit = { + current_year >= 1300 + } + title_domicile = { + add_domicile_building = yurt_main_02 + add_domicile_building = yurt_main_03 + add_domicile_building = yurt_main_04 + add_random_yurt_external_building_effect = yes + add_random_yurt_external_building_effect = yes + add_random_yurt_external_building_effect = yes + add_random_yurt_external_building_effect = yes + upgrade_random_yurt_external_building_effect = yes + upgrade_random_yurt_external_building_effect = yes + upgrade_random_yurt_external_building_effect = yes + upgrade_random_yurt_external_building_effect = yes + } + } + else_if = { + limit = { + current_year >= 1200 + } + title_domicile = { + add_domicile_building = yurt_main_02 + add_domicile_building = yurt_main_03 + add_domicile_building = yurt_main_04 + add_random_yurt_external_building_effect = yes + add_random_yurt_external_building_effect = yes + add_random_yurt_external_building_effect = yes + upgrade_random_yurt_external_building_effect = yes + upgrade_random_yurt_external_building_effect = yes + upgrade_random_yurt_external_building_effect = yes + } + } + else_if = { + limit = { + current_year >= 1100 + } + title_domicile = { + add_domicile_building = yurt_main_02 + if = { + limit = { + has_domicile_building = yurt_main_02 + owner ?= { + OR = { + has_realm_law = nomadic_authority_2 + has_realm_law = nomadic_authority_3 + has_realm_law = nomadic_authority_4 + has_realm_law = nomadic_authority_5 + } + } + } + add_domicile_building = yurt_main_03 + } + add_random_yurt_external_building_effect = yes + add_random_yurt_external_building_effect = yes + upgrade_random_yurt_external_building_effect = yes + upgrade_random_yurt_external_building_effect = yes + } + } + else_if = { + limit = { + current_year >= 900 + } + title_domicile = { + add_domicile_building = yurt_main_02 + add_random_yurt_external_building_effect = yes + upgrade_random_yurt_external_building_effect = yes + } + } + } + } + + ########### + # MPO - Edge case Nomadic Philosophy handover + ########### + if = { + limit = { + government_has_flag = government_is_nomadic + NOT = { + has_trait = nomadic_philosophy + } + exists = situation:the_great_steppe + any_character_situation = { + this = situation:the_great_steppe + } + } + add_trait = nomadic_philosophy + every_heir = { + limit = { + top_liege ?= root + NOT = { + has_trait = nomadic_philosophy + } + } + add_trait = nomadic_philosophy + } + } + } + ########### + # Nomads switch faith/culture of conquered nomadic counties + ########### + else_if = { + limit = { + scope:title.title_province ?= { + OR = { + has_holding_type = nomad_holding + has_holding_type = herder_holding + } + } + government_has_flag = government_is_nomadic + exists = domicile + } + if = { + limit = { + has_character_flag = domicile_culture_and_faith_check + OR = { + domicile.domicile_culture != scope:title.culture + domicile.domicile_faith != scope:title.faith + } + } + domicile = { + set_domicile_culture = scope:title.culture + set_domicile_faith = scope:title.faith + } + remove_character_flag = domicile_culture_and_faith_check + } + else = { + if = { + limit = { domicile.domicile_culture != scope:title.culture } + scope:title ?= { + set_variable = { + name = migration_previous_culture + value = culture + } + set_county_culture = root.domicile.domicile_culture + } + } + if = { + limit = { domicile.domicile_faith != scope:title.faith } + scope:title = { set_county_faith = root.domicile.domicile_faith } + } + } + } + else = { + ########### + # Apply Law of the Land title succession law if appropriate + ########### + scope:title = { + add_law_of_the_land_title_succession_law_if_appropriate_effect = yes + } + } + + ########### + # MPO - Siberian permafrost modifier switcharoo + ########### + if = { + limit = { + scope:title.title_province = { + geographical_region = geographical_region:mpo_region_permafrost + } + } + if = { + limit = { + scope:title = { + has_county_modifier = mpo_siberian_permafrost_modifier_bad + } + culture ?= { has_cultural_parameter = permafrost_modifier_mechanic } + } + scope:title = { + remove_county_modifier = mpo_siberian_permafrost_modifier_bad + add_county_modifier = mpo_siberian_permafrost_modifier + } + } + else_if = { + limit = { + scope:title = { + has_county_modifier = mpo_siberian_permafrost_modifier + } + NOR = { + culture ?= { has_cultural_parameter = permafrost_modifier_mechanic } + } + } + scope:title = { + remove_county_modifier = mpo_siberian_permafrost_modifier + add_county_modifier = mpo_siberian_permafrost_modifier_bad + } + } + } + else_if = { + limit = { + OR = { + scope:title = title:c_antiocheia + scope:title = title:c_jerusalem + scope:title = title:c_alexandria + scope:title = title:c_roma + } + } + if = { + limit = { + OR = { + AND = { + is_roman_emperor_trigger = yes + faith = faith:orthodox + faith = { has_doctrine = special_doctrine_ecumenical_christian } + } + any_liege_or_above = { + is_roman_emperor_trigger = yes + faith = faith:orthodox + faith = { has_doctrine = special_doctrine_ecumenical_christian } + } + } + } + trigger_event = roman_restoration.0199 + } + ########### + # Transfer the Samaritan HoF to the realm that holds Jerusalem + ########### + if = { + limit = { + scope:title = title:c_jerusalem + title:d_samaritan.holder ?= { + # Samaritan HoF is not independent + # Samaritan liege is not Samaritan + top_liege.faith != faith:samaritan + top_liege != root + } + # root is at least a king, or their liege is, or their liege's liege is + OR = { + highest_held_title_tier >= tier_kingdom + any_liege_or_above = { + highest_held_title_tier >= tier_kingdom + } + } + } + create_title_and_vassal_change = { + type = created + save_scope_as = title_change + add_claim_on_loss = no + } + if = { + limit = { + highest_held_title_tier >= tier_kingdom + } + title:d_samaritan.holder = { + change_liege = { + liege = root + change = scope:title_change + } + } + } + else = { + title:d_samaritan.holder = { + change_liege = { + liege = root.top_liege + change = scope:title_change + } + } + } + resolve_title_and_vassal_change = scope:title_change + } + } + + ########### + # FP1 - New holder for a county with a stele. + ########### + if = { + limit = { + # Using a scripted effect here so we can look at the same trigger in the grant title interaction + fp1_remove_stele_new_holder_trigger = { + TITLE = scope:title + PREVIOUS_HOLDER = scope:previous_holder + NEW_HOLDER = root + } + has_fp1_dlc_trigger = yes + } + scope:title = { + remove_variable = stele_scope_type + remove_variable = stele_container + remove_variable = stele_carver + remove_variable = stele_commissioner + remove_variable = stele_slot_occupied + remove_county_modifier = fp1_stele_ancestors_strong + remove_county_modifier = fp1_stele_ancestors_weak + remove_county_modifier = fp1_stele_conquest_strong + remove_county_modifier = fp1_stele_conquest_weak + remove_county_modifier = fp1_stele_promotion_strong + remove_county_modifier = fp1_stele_promotion_weak + } + } + ########### + # Non-FP1 - New holder of the county with a runestone + ########### + else_if = { + limit = { + scope:title = { + exists = var:ancestor_to_bury + } + dynasty != scope:previous_holder.dynasty #We only have to change something if the new holder is of a different dynasty + scope:title = { + NOT = { var:ancestor_to_bury.dynasty = root.dynasty } + } + } + scope:title = { + remove_county_modifier = county_raised_runestone_modifier + remove_variable = ancestor_to_bury + } + } + + ########### + # EP3 ADVENTURERS BECOMING LANDED + ########### + if = { + limit = { + scope:title = { is_landless_type_title = no } + any_held_title = { + title_tier = duchy + has_variable = adventurer_creation_reason + } + } + save_scope_as = adventurer + if = { + limit = { + NOR = { + has_trait = adventurer + government_has_flag = government_is_nomadic + } + } + add_trait = adventurer + } + every_courtier = { + set_variable = { + name = former_camp_leader + value = scope:adventurer + } + add_trait = adventurer_follower + } + if = { + limit = { + house = { + has_house_modifier = legacy_adventurer_house_modifier + } + } + add_legitimacy = massive_legitimacy_gain + set_variable = { + name = legacy_adventurers_to_levies + value = 0 + } + every_courtier = { + root = { + change_variable = { name = legacy_adventurers_to_levies add = 25 } + } + } + every_held_title = { + limit = { has_variable = adventurer_creation_reason } + save_scope_as = prev_title + } + spawn_army = { + levies = var:legacy_adventurers_to_levies + location = capital_province + name = remnants_adventurer_army + } + remove_variable = legacy_adventurers_to_levies + } + destroy_laamp_effect = { ADVENTURER = scope:adventurer } + # EP3 - Ensure NF holders are Admin + if = { + limit = { + scope:title = { is_noble_family_title = yes } + NOT = { government_has_flag = government_is_administrative } + } + change_government = administrative_government + } + } + } + ##################### + # DUCHY-TIER TITLES # + ##################### + else_if = { + limit = { + scope:title.tier = tier_duchy + } + + # Special Legitimacy gain for being elected (This is present in two places in this on_action) + if = { + limit = { + scope:title = { + has_order_of_succession = election + } + has_legitimacy = yes + } + save_scope_value_as = { + name = title_tier_minus_2 + value = { + value = scope:title.tier + subtract = 2 + } + } + send_interface_toast = { + type = msg_legitimacy_gain + title = legitimacy_gain_toast + left_icon = root + right_icon = scope:title + add_legitimacy = { + value = { + value = major_legitimacy_gain + multiply = scope:title_tier_minus_2 + } + } + } + } + + # Transfer title-bound artifacts with the title it's associated with (This is present in two places in this on_action) + if = { + limit = { + scope:previous_holder ?= { + any_character_artifact = { + has_variable = artifact_succession_title #Is this an artifact that should follow a title? + var:artifact_succession_title = { is_title_created = yes } #Does the title the artifact should follow exist? + var:artifact_succession_title = scope:title #Scope title is the artifact title + } + } + } + scope:previous_holder = { + every_character_artifact = { + limit = { + has_variable = artifact_succession_title #Is this an artifact that should follow a title? + var:artifact_succession_title = { is_title_created = yes } #Does the title the artifact should follow exist? + var:artifact_succession_title = scope:title #Scope title is the artifact title + } + if = { + limit = { + OR = { + scope:transfer_type = flag:conquest + scope:transfer_type = flag:conquest_holy_war + scope:transfer_type = flag:conquest_claim + scope:transfer_type = flag:conquest_populist + scope:transfer_type = flag:abdication + scope:transfer_type = flag:usurped + scope:transfer_type = flag:revoked + scope:transfer_type = flag:faction_demand + } + } + set_owner = { + target = root + history = { + type = conquest + actor = scope:previous_holder + recipient = root + location = scope:previous_holder.location + } + } + } + else = { + set_owner = { + target = root + history = { + type = inherited + recipient = root + } + } + } + } + } + } + + if = { + limit = { + government_has_flag = government_is_landless_adventurer + } + # EP3 ADVENTURERS TELEPORT TO THEIR CAMP + trigger_event = { + id = title_event.9911 + days = 1 + } + } + + # EP3 ADVENTURER TITLE BEING INHERITED BY A LANDED RULER + if = { + limit = { + scope:title = { + has_variable = adventurer_creation_reason + } + any_held_title = { + NOT = { has_variable = adventurer_creation_reason } + } + } + every_held_title = { + limit = { has_variable = adventurer_creation_reason } + save_scope_as = landless_adventurer_title + root = { destroy_title = scope:landless_adventurer_title } + } + } + # Have we been given a fair shake as a laamp, but we're sucking? + else_if = { + limit = { + has_government = landless_adventurer_government + is_ai = yes + scope:previous_holder = { is_ai = yes } + primary_title = { + any_past_holder = { count >= 4 } + } + NOR = { + # If the heir is sufficiently impressive, then we'll keep 'em around. + prestige_level >= 2 + # Legitimists are always worthwhile. + has_realm_law = camp_purpose_legitimists + # Reserve successful mercenary outfits. + AND = { + max_military_strength >= 1500 + # Allow absolute decimations to destroy mercs from time to time. + current_military_strength <= 150 + } + # Or those currently fighting alongside/against players. + AND = { + is_at_war = yes + OR = { + any_war_ally = { is_ai = no } + any_war_enemy = { is_ai = no } + } + } + # Depending on camp purpose, we want various skills. + AND = { + has_realm_law = camp_purpose_wanderers + OR = { + highest_skill_value >= very_high_skill_rating + prowess >= very_high_skill_rating + } + } + AND = { + has_realm_law = camp_purpose_mercenaries + OR = { + martial >= high_skill_rating + prowess >= high_skill_rating + } + } + AND = { + has_realm_law = camp_purpose_scholars + OR = { + learning >= high_skill_rating + diplomacy >= high_skill_rating + } + } + AND = { + has_realm_law = camp_purpose_explorers + OR = { + diplomacy >= high_skill_rating + stewardship >= high_skill_rating + } + } + AND = { + has_realm_law = camp_purpose_brigands + OR = { + intrigue >= high_skill_rating + prowess >= high_skill_rating + } + } + # Finally, keep anyone who's important to the player. + any_player = { + OR = { + root.dynasty ?= dynasty + is_consort_of = root + has_important_relationship_with_character_trigger = { CHARACTER = root } + any_pinned_character = { this = root } + any_pinned_character = { this = scope:previous_holder } + } + } + } + } + destroy_laamp_effect = { ADVENTURER = root } + } + # Holy Order Trait + else_if = { + limit = { + scope:title = { is_holy_order = yes } + NOT = { has_trait = order_member } + government_has_flag = government_is_holy_order + } + add_trait = order_member + } + + # Apply Created Title opinion to Courtly Vassals (This is present in two places in this on_action) + if = { + limit = { + scope:transfer_type = flag:created + is_alive = yes + } + every_vassal = { + vassal_stance = courtly + if = { + limit = { + scope:title.tier = tier_duchy + } + add_opinion = { + target = root + modifier = courtly_title_creation_opinion + opinion = 10 + } + } + else = { + add_opinion = { + target = root + modifier = courtly_title_creation_opinion + opinion = 30 + } + } + } + } + # Lil Johnny Lackland changes his nickname. + if = { + limit = { + has_nickname = nick_lackland_young + } + give_nickname = nick_lackland_ironic + } + } + ##################### + # KING+ TIER TITLES # + ##################### + else = { + # Newly formed Hegemon of China should spruce up their council + if = { + limit = { + scope:title = title:h_china + exists = root.dynasty + exists = scope:previous_holder.house + scope:previous_holder.house != root.house + } + save_scope_as = councillor_liege + fill_the_ministry_effect = yes + } + # Ceremonial Liege invalidation + if = { + limit = { + exists = this + any_held_title = { exists = var:administrative_ui_special_title } + } + every_held_title = { + limit = { exists = var:administrative_ui_special_title } + var:administrative_ui_special_title.holder = { tgp_destroy_ceremonial_throne_effect = yes } + } + if = { + limit = { has_trait = former_emperor } + remove_trait = former_emperor + } + } + # Ceremonial Liege + if = { + limit = { + OR = { + exists = scope:title.var:ceremonial_title + top_liege.primary_title.var:administrative_ui_special_title ?= scope:title + } + } + if = { + limit = { + exists = house + exists = scope:previous_holder.house + scope:previous_holder.house != house + } + scope:title = { set_coa = root.house } + } + remove_character_flag = ceremonial_regent_flag + } + if = { + limit = { exists = scope:title.var:ceremonial_title } + add_character_flag = ceremonial_liege_flag + if = { + limit = { has_trait = devoted } + remove_trait = devoted + } + destroy_laamp_effect = { ADVENTURER = this } + } + # Reset raid remit + if = { + limit = { + this = top_liege + any_noble_family = { } + } + every_noble_family = { + holder = { remove_variable = raid_estate_permission } + } + } + # Special Legitimacy gain for being elected (This is present in two places in this on_action) + if = { + limit = { + scope:title = { + has_order_of_succession = election + } + has_legitimacy = yes + } + save_scope_value_as = { + name = title_tier_minus_2 + value = { + value = scope:title.tier + subtract = 2 + } + } + send_interface_toast = { + type = msg_legitimacy_gain + title = legitimacy_gain_toast + left_icon = root + right_icon = scope:title + add_legitimacy = { + value = { + value = major_legitimacy_gain + multiply = scope:title_tier_minus_2 + } + } + } + } + # Transfer title-bound artifacts with the title it's associated with (This is present in two places in this on_action) + if = { + limit = { + scope:previous_holder ?= { + any_character_artifact = { + has_variable = artifact_succession_title #Is this an artifact that should follow a title? + var:artifact_succession_title = { is_title_created = yes } #Does the title the artifact should follow exist? + var:artifact_succession_title = scope:title #Scope title is the artifact title + } + } + } + scope:previous_holder = { + every_character_artifact = { + limit = { + has_variable = artifact_succession_title #Is this an artifact that should follow a title? + var:artifact_succession_title = { is_title_created = yes } #Does the title the artifact should follow exist? + var:artifact_succession_title = scope:title #Scope title is the artifact title + } + if = { + limit = { + OR = { + scope:transfer_type = flag:conquest + scope:transfer_type = flag:conquest_holy_war + scope:transfer_type = flag:conquest_claim + scope:transfer_type = flag:conquest_populist + scope:transfer_type = flag:abdication + scope:transfer_type = flag:usurped + scope:transfer_type = flag:revoked + scope:transfer_type = flag:faction_demand + } + } + set_owner = { + target = root + history = { + type = conquest + actor = scope:previous_holder + recipient = root + location = scope:previous_holder.location + } + } + } + else = { + set_owner = { + target = root + history = { + type = inherited + recipient = root + } + } + } + } + } + } + # Grandeur in elective realms + if = { + limit = { + exists = var:previous_holder_grandeur_value + has_royal_court = yes + has_dlc_feature = royal_court + } + hidden_effect = { + change_current_court_grandeur = -100 # Reset to 0 + change_current_court_grandeur = var:previous_holder_grandeur_value + remove_variable = previous_holder_grandeur_value + } + } + # Apply Created Title opinion to Courtly Vassals (This is present in two places in this on_action) + if = { + limit = { + scope:transfer_type = flag:created + is_alive = yes + } + every_vassal = { + vassal_stance = courtly + if = { + limit = { + scope:title.tier = tier_duchy + } + add_opinion = { + target = root + modifier = courtly_title_creation_opinion + opinion = 10 + } + } + else = { + add_opinion = { + target = root + modifier = courtly_title_creation_opinion + opinion = 30 + } + } + } + } + # Empire and Hegemony stuff + if = { + limit = { + scope:title = { + tier >= tier_empire + } + } + # Byzantine-only: The Patriarch refuses to crown you as new emperor because you have a criminal trait (e.g. kinslayer) + if = { + limit = { + valid_for_byz_emperor_content_trigger = yes + has_ep3_dlc_trigger = yes + exists = root.faith.religious_head + this != faith.religious_head + faith.religious_head = { + opinion = { + target = root + value <= 0 + } + location = root.location + } + has_any_criminal_trait_in_faith_trigger = { + CHARACTER = root + FAITH = root.faith + } + NOT = { has_character_flag = has_had_ep3_2020 } + } + trigger_event = { + id = ep3_emperor_yearly.2020 + days = 1 + } + } + ### EP3 Admin Emperor Flavor ### + if = { + limit = { + # Not for meritocratic + NOT = { government_has_flag = government_has_merit } + # Admin only + government_allows = administrative + has_ep3_dlc_trigger = yes + # Independent rulers only + this = top_liege + # New title is higher or equal to your primary tier + highest_held_title_tier >= scope:title.tier + # You didn't just create the title + scope:title = { + any_past_holder = { } + # Your predecessor wasn't from your same house - not much to celebrate if you got the title from dad! + previous_holder ?= { + house != root.house + } + } + # Handled separately + tgp_realm_has_ceremonial_liege_trigger = no + } + trigger_event = { + id = ep3_emperor_yearly.2050 + days = 5 + } + } + #Byzantium is reborn! + if = { + limit = { + scope:title = { + this = title:e_byzantium + } + exists = global_var:byz_collapse_counter + } + save_scope_as = byz_emperor + title:e_byzantium = { + every_in_de_jure_hierarchy = { + limit = { + tier <= tier_kingdom + tier >= tier_county + is_title_created = yes + exists = holder + } + if = { + limit = { + holder ?= { + is_alive = yes + NOR = { + is_in_list = byz_return_notify + any_held_title = { + this = title:e_byzantium + } + } + } + } + holder = { + add_to_list = byz_return_notify + } + } + } + } + title:e_latin_empire = { + every_in_de_jure_hierarchy = { + limit = { + tier <= tier_kingdom + tier >= tier_county + is_title_created = yes + exists = holder + } + if = { + limit = { + holder = { + is_alive = yes + NOR = { + is_in_list = byz_return_notify + any_held_title = { + this = title:e_byzantium + } + } + } + } + holder = { + add_to_list = byz_return_notify + } + } + } + } + every_in_list = { + list = byz_return_notify + trigger_event = ep3_frankokratia_events.0130 + } + remove_global_variable = byz_collapse_counter + } + # TGP CHINA + else_if = { + limit = { + scope:title = title:h_china + } + # When conquering China - Change to conquest phase + if = { + limit = { + root.dynasty != scope:previous_holder.dynasty + } + if = { + limit = { + is_valid_celestial_dynasty = no + } + situation:dynastic_cycle = { + situation_top_sub_region = { + change_phase = { phase = situation_dynastic_cycle_phase_instability_conquest } + } + } + } + else_if = { + limit = { + situation:dynastic_cycle ?= { + situation_current_phase = situation_dynastic_cycle_phase_instability_conquest + } + } + situation:dynastic_cycle = { + situation_top_sub_region = { + change_phase = { phase = situation_dynastic_cycle_phase_instability } + } + } + } + } + # When inheriting China - Move towards instability/chaotic phase + if = { + limit = { + root.house != scope:previous_holder.house + current_date_is_start_date_trigger = no # We check this to avoid potentially triggering this immediately on game start + } + situation:dynastic_cycle = { + if = { + limit = { + situation_top_has_catalyst = catalyst_new_dynasty_inherits + } + trigger_situation_catalyst = catalyst_new_dynasty_inherits + } + } + } + # Clear the Strengthen Capital great project cooldown + situation:dynastic_cycle ?= { + if = { + limit = { has_variable = gp_strengthen_capital_cooldown } + remove_variable = gp_strengthen_capital_cooldown + } + } + #setup Grand Secretariat + if = { + limit = { + has_dlc_feature = all_under_heaven + NOT = { has_diarchy_type = grand_secretariat } + } + if = {# Clear out any old diarchy + limit = { has_active_diarchy = yes } + end_diarchy = yes + } + if = { + limit = { + has_realm_law = grand_chancellor_law + exists = title:h_china.holder.cp:councillor_chancellor + } + try_start_diarchy = grand_secretariat + set_diarch = title:h_china.holder.cp:councillor_chancellor + } + else_if = { + limit = { + has_realm_law = grand_marshal_law + exists = title:h_china.holder.cp:minister_grand_marshal + } + try_start_diarchy = grand_secretariat + set_diarch = title:h_china.holder.cp:minister_grand_marshal + } + else_if = { + limit = { + exists = title:h_china.holder.cp:councillor_spymaster + } + try_start_diarchy = grand_secretariat + set_diarch = title:h_china.holder.cp:councillor_spymaster + } + } + root.house.house_head.domicile ?= { + set_family_accomplishment_effect = { ACCOMPLISHMENT = family_accomplishment_dynasty } + } + } + else_if = { + limit = { + OR = { + scope:title = title:e_minister_chancellor + scope:title = title:e_minister_censor + scope:title = title:e_minister_grand_marshal + scope:title = title:e_minister_of_personnel + scope:title = title:e_minister_of_revenue + scope:title = title:e_minister_of_rites + scope:title = title:e_minister_of_war + scope:title = title:e_minister_of_justice + scope:title = title:e_minister_of_works + } + } + # set up the council holder as dejure liege of the ministry title, as this effect is not called with the same scope as council onactions + scope:title.de_jure_liege.holder = { + save_scope_as = councillor_liege + } + # If we get a minister title, make sure we set things up correctly + switch = { + trigger = scope:title + title:e_minister_chancellor = { + got_minister_position_effect = { MINISTER_TITLE = e_minister_chancellor MINISTER_POSITION = councillor_chancellor } + } + title:e_minister_censor = { + got_minister_position_effect = { MINISTER_TITLE = e_minister_censor MINISTER_POSITION = councillor_spymaster } + } + title:e_minister_grand_marshal = { + got_minister_position_effect = { MINISTER_TITLE = e_minister_grand_marshal MINISTER_POSITION = minister_grand_marshal } + } + title:e_minister_of_personnel = { + got_minister_position_effect = { MINISTER_TITLE = e_minister_of_personnel MINISTER_POSITION = minister_personnel } + } + title:e_minister_of_revenue = { + got_minister_position_effect = { MINISTER_TITLE = e_minister_of_revenue MINISTER_POSITION = councillor_steward } + } + title:e_minister_of_rites = { + got_minister_position_effect = { MINISTER_TITLE = e_minister_of_rites MINISTER_POSITION = councillor_court_chaplain } + } + title:e_minister_of_war = { + got_minister_position_effect = { MINISTER_TITLE = e_minister_of_war MINISTER_POSITION = councillor_marshal } + } + title:e_minister_of_justice = { + got_minister_position_effect = { MINISTER_TITLE = e_minister_of_justice MINISTER_POSITION = minister_justice } + } + title:e_minister_of_works = { + got_minister_position_effect = { MINISTER_TITLE = e_minister_of_works MINISTER_POSITION = minister_works } + } + } + } + # TGP JAPAN + else_if = { + limit = { scope:title = title:e_japan } + # TGP RETIRED EMPEROR + if = { + limit = { + exists = title:e_japan.var:administrative_ui_special_title + has_title = title:e_japan.var:administrative_ui_special_title + } + # Flavourization setup + title:e_japan = { remove_variable = shogun_flag } + remove_character_flag = shogun_flag + if = { # Flavourization setup + limit = { has_global_variable = tenno_restored } + title:e_japan = { set_variable = ceremonial_liege_flag } + add_character_flag = ceremonial_liege_flag + trigger_event = { + id = tgp_japan_general.9100 + days = 1 + } + } + else = { # Event to abdicate and become Joko + trigger_event = { + id = tgp_japan_general.9120 + days = 1 + } + } + } + # TGP SHOGUN + else_if = { + limit = { + has_government = japan_feudal_government + has_global_variable = shogunate_established + } + title:e_japan = { remove_variable = ceremonial_liege_flag } + remove_character_flag = ceremonial_liege_flag + title:e_japan = { set_variable = shogun_flag } + add_character_flag = shogun_flag + } + # TGP KAMPAKU + else = { + title:e_japan = { remove_variable = ceremonial_liege_flag } + remove_character_flag = ceremonial_liege_flag + title:e_japan = { remove_variable = shogun_flag } + remove_character_flag = shogun_flag + } + # Japanese regent laws + if = { + limit = { + tgp_realm_has_ceremonial_liege_trigger = yes + government_is_japanese_trigger = yes + NOR = { + has_global_variable = shogunate_established + has_global_variable = tenno_restored + } + } + if = { + limit = { + government_has_flag = government_is_japan_administrative + NOT = { has_realm_law = japanese_regency_succession_law } + } + add_realm_law_skip_effects = japanese_regency_succession_law + } + else_if = { + limit = { + government_has_flag = government_is_japan_feudal + has_realm_law = japanese_regency_succession_law + } + remove_realm_law = japanese_regency_succession_law + } + } + } + # ROME + else_if = { + limit = { + OR = { + scope:title = title:h_roman_empire + scope:title = title:h_eastern_roman_empire + } + NOT = { has_trait = augustus } + } + trigger_event = roman_restoration.0005 + } + #Mongol empire and GoK should lose other empires + if = { + limit = { + primary_title ?= { + OR = { + this = title:e_mongol_empire + AND = { + exists = global_var:greatest_of_khans_title + this = global_var:greatest_of_khans_title + } + } + } + scope:title = { + NOR = { + this = title:e_mongol_empire + AND = { + exists = global_var:greatest_of_khans_title + this = global_var:greatest_of_khans_title + } + } + } + is_ai = yes + } + destroy_title = scope:title + } + # You just inherited an Emperor title!! + if = { + limit = { + primary_title = scope:title + exists = scope:previous_holder + NOT = { #You don't already have an empire tier title + any_held_title = { + title_tier = empire + this != scope:title + } + } + # That isn't a part of the ministry + NOR = { + scope:title = title:e_minister_chancellor + scope:title = title:e_minister_censor + scope:title = title:e_minister_grand_marshal + scope:title = title:e_minister_of_personnel + scope:title = title:e_minister_of_revenue + scope:title = title:e_minister_of_rites + scope:title = title:e_minister_of_war + scope:title = title:e_minister_of_justice + scope:title = title:e_minister_of_works + } + } + trigger_event = { + id = realm_maintenance.2001 + days = 1 + } + } + # DEPRECATED + #if = { + # limit = { + # is_independent_ruler = yes + # tgp_realm_has_ceremonial_liege_trigger = no + # government_has_flag = government_is_meritocratic + # } + # trigger_event = { + # id = tgp_korea_decision.9203 + # days = 1 + # } + #} + # TGP CEREMONIAL FLAVOR + scope:previous_holder ?= { + if = { + limit = { is_alive = yes } + remove_character_flag = ceremonial_liege_flag + remove_character_flag = ceremonial_regent_flag + } + } + if = { + limit = { is_alive = yes } + remove_character_flag = ceremonial_liege_flag + remove_character_flag = ceremonial_regent_flag + } + top_liege.primary_title.var:administrative_ui_special_title.holder ?= { + remove_character_flag = ceremonial_liege_flag + remove_character_flag = ceremonial_regent_flag + } + if = { + limit = { tgp_is_ceremonial_regent_trigger = yes } # Not 'actual' ruler + add_character_flag = ceremonial_regent_flag + top_liege.primary_title.var:administrative_ui_special_title.holder ?= { add_character_flag = ceremonial_liege_flag } + } + } + # West Francia becomes France when no longer controlled by a Karling + else_if = { + limit = { + scope:title = { + this = title:k_france + } + NOR = { + dynasty = { this = dynasty:25061 } # Not held by a Karling + any_liege_or_above = { + dynasty = { this = dynasty:25061 } # And does not have a liege that is a Karling + } + has_global_variable = west_francia_renamed + } + } + trigger_event = { + id = title_event.0001 + days = 1 + } + } + # East Francia becomes Germany when no longer controlled by a Karling + else_if = { + limit = { + scope:title = { + this = title:k_east_francia + } + NOR = { + dynasty = { this = dynasty:25061 } # Not held by a Karling + any_liege_or_above = { + dynasty = { this = dynasty:25061 } # And does not have a liege that is a Karling + } + has_global_variable = east_francia_renamed + } + } + trigger_event = { + id = title_event.0002 + days = 1 + } + } + # Hidden management event to determine if we need to axe Asturias &, if we do, what notification events to send out afterwards. + else_if = { + limit = { + scope:title = title:k_castille + title:k_asturias = { + # Leon must be de jure part of Asturias, or else there's no reason to ever stop calling it Asturias. + any_in_de_jure_hierarchy = { this = title:d_leon } + } + } + trigger_event = { + id = title_event.0011 + days = 1 + } + } + # FP2 El Cid Achievement + else_if = { + limit = { + scope:title = title:k_valencia + has_character_flag = fp2_el_cid_blood_relation_legacy + } + set_global_variable = { # DO. NOT. USE. add_achievement_global_variable_effect. IT BREAKS THE ACHIEVEMENT. + name = fp2_el_cid_achievement_unlocked + value = yes + } + } + # TGP CEREMONIAL RULER + # IMPERIAL INHERITANCE + else_if = { + limit = { + exists = scope:title.var:ceremonial_title + } + add_character_flag = ceremonial_liege_flag + if = { + limit = { has_trait = devoted } + remove_trait = devoted + } + destroy_laamp_effect = { ADVENTURER = this } + trigger_event = { + id = tgp_japan_general.9100 + days = 1 + } + } + # Norway stuff + else_if = { + limit = { + # The title they've acquired is Norway. + scope:title = title:k_norway + } + # Tanglehair becomes Fairhair. + if = { + limit = { + # This character is Harald Fairhair. + exists = character:144000 + this = character:144000 + # Norway has been created by them. + scope:transfer_type = flag:created + # Norway has not been created previously. + NOT = { exists = global_var:norway_created } + } + trigger_event = { + id = fp1_major_decisions.1011 + days = 1 + } + } + # Check Norway's creation status. + if = { + limit = { + scope:transfer_type = flag:created + NOT = { exists = global_var:norway_created } + } + trigger_event = { + id = fp1_major_decisions.1012 + days = 1 + } + } + } + # English Partition Result - Gained Both + else_if = { + limit = { + # Partition must be active. + exists = global_var:partition_active_danelaw + # The gained title must be one of the two partitioned entities. + OR = { + scope:title = title:k_england + scope:title = title:k_danelaw + } + # And you must now hold both titles. + this = title:k_england.holder + this = title:k_danelaw.holder + } + trigger_event = { + id = british_isles.1032 + days = 1 + } + } + # Lil Johnny Lackland changes his nickname. + if = { + limit = { + has_nickname = nick_lackland_young + } + give_nickname = nick_lackland_ironic + } + } + + ############# + # STRUGGLES # + ############# + if = { + limit = { + exists = struggle:persian_struggle + } + #Struggle Catalysts + if = { + limit = { + scope:title.empire ?= title:e_persia + scope:title = { + tier >= tier_county + is_landless_type_title = no + } + NOR = { + scope:transfer_type = flag:created + scope:transfer_type = flag:inheritance + } + } + if = { + limit = { + fp3_character_uninvolved_in_struggle_trigger = yes + scope:previous_holder ?= { + fp3_character_involved_in_struggle_trigger = yes + any_character_struggle = { + phase_has_catalyst = catalyst_interloper_uninvolved_gain_struggle_titles + } + } + } + scope:previous_holder ?= { + every_character_struggle = { + limit = { phase_has_catalyst = catalyst_interloper_uninvolved_gain_struggle_titles } + activate_struggle_catalyst = { + catalyst = catalyst_interloper_uninvolved_gain_struggle_titles + character = root + } + log_debug_variable_for_persian_struggle_effect = { VAR = concession_catalyst_interloper_uninvolved_gain_struggle_titles } + } + } + } + if = { + limit = { + fp3_character_involved_in_struggle_trigger = yes + any_character_struggle = { + phase_has_catalyst = catalyst_gain_struggle_titles_from_interlopers_uninvolved + # Stop catalyst from affecting those who are only just now uninvolved due to losing this title + OR = { + NOT = { is_culture_involved_in_struggle = scope:previous_holder.culture } + NOT = { is_faith_involved_in_struggle = scope:previous_holder.faith } + } + } + scope:previous_holder ?= { + OR = { + fp3_character_uninvolved_in_struggle_trigger = yes + fp3_character_interloper_in_struggle_trigger = yes + } + } + } + every_character_struggle = { + limit = { phase_has_catalyst = catalyst_gain_struggle_titles_from_interlopers_uninvolved } + activate_struggle_catalyst = { + catalyst = catalyst_gain_struggle_titles_from_interlopers_uninvolved + character = root + } + log_debug_variable_for_persian_struggle_effect = { VAR = stabil_catalyst_gain_struggle_titles_from_interlopers_uninvolved } + } + } + } + # FP3 Struggle special cases + if = { + limit = { + scope:title = { + OR = { + this = title:d_sunni + this = title:e_arabia + } + } + } + ## Convert detractors to supporters if they inherit either of the titles they're detracting against. + if = { + limit = { + NOT = { has_trait = fp3_struggle_supporter } + } + if = { + limit = { has_trait = fp3_struggle_detractor } + remove_trait = fp3_struggle_detractor + } + add_trait = fp3_struggle_supporter + } + # FP3 Title Transfer Notification + struggle:persian_struggle = { # Wet script + every_involved_ruler = { + send_interface_toast = { + type = event_toast_effect_bad + title = persian_struggle_central_title_transfer.t + left_icon = scope:previous_holder + right_icon = scope:title.holder + + custom_tooltip = persian_struggle_central_title_transfer.desc + } + } + every_interloper_ruler = { + send_interface_toast = { + type = event_toast_effect_bad + title = persian_struggle_central_title_transfer.t + left_icon = scope:previous_holder + right_icon = scope:title.holder + + custom_tooltip = persian_struggle_central_title_transfer.desc + } + } + } + } + } + + ############### + # GOVERNMENTS # + ############### + + # TGP bloc joining + if = { + limit = { + government_is_japanese_trigger = yes + tgp_house_bloc_interaction_valid_trigger = yes + is_house_head = no + NOT = { exists = confederation } + exists = house.house_head.confederation + liege = house.house_head.liege + is_at_war = no + } + save_scope_as = bloc_joiner + house.house_head.confederation = { add_confederation_member = scope:bloc_joiner } + } + # Challenged as house head in Japan + if = { + limit = { + government_is_japanese_trigger = yes + is_house_head = yes + } + trigger_event = { + weeks = { 2 4 } + id = tgp_japan_yearly_events.1210 + } + } + # TGP Catalysts + if = { + limit = { + scope:previous_holder ?= { + has_title = title:h_china + } + OR = { + scope:transfer_type = flag:granted + scope:transfer_type = flag:appointment + } + NOR = { + any_held_title = { + is_landless_type_title = no + this != scope:title + } + has_appointment_level_for_title = scope:title + } + } + situation:dynastic_cycle ?= { + if = { + limit = { situation_top_has_catalyst = catalyst_hegemon_appointing_low_merit_governor } + trigger_situation_catalyst = { + catalyst = catalyst_hegemon_appointing_low_merit_governor + character = scope:previous_holder + } + } + } + } + # If the minister's merit rank is too low, it will affect the dynastic cycle + if = { + limit = { + scope:title = { + OR = { + this = title:e_minister_chancellor + this = title:e_minister_censor + this = title:e_minister_grand_marshal + this = title:e_minister_of_personnel + this = title:e_minister_of_revenue + this = title:e_minister_of_rites + this = title:e_minister_of_war + this = title:e_minister_of_justice + this = title:e_minister_of_works + } + } + NOT = { has_appointment_level_for_title = scope:title } + } + situation:dynastic_cycle ?= { + if = { + limit = { situation_top_has_catalyst = catalyst_hegemon_appointing_low_merit_councillor } + trigger_situation_catalyst = { + catalyst = catalyst_hegemon_appointing_low_merit_councillor + character = root + } + } + } + } + # Admin Stuff + if = { + limit = { + OR = { + government_allows = administrative + government_has_flag = government_is_japan_feudal + } + NOT = { has_variable = laamp_invasion_flag } + } + government_type = { save_scope_as = nf_gov_type } + # Note: anything that should be run after creation can go in on_noble_family_title_created + give_new_noble_family_title_effect = yes + # EP3 - Ensure Emperor keeps old realm capital in admin realms & apply unique domicile building bonus if appropriate + if = { + limit = { + top_liege = this + highest_held_title_tier >= tier_empire + NOT = { + any_held_title = { + OR = { + tier = tier_empire + tier = tier_hegemony + } + this != scope:title + } + } + } + if = { # Ensure we keep the old realm capital + limit = { + scope:title = { + tier >= tier_empire + title_capital_county != root.capital_county + # Constantinople must have been inherited + title_capital_county.holder = root + } + } + set_realm_capital = scope:title.title_capital_county + } + if = { # Get legitimacy from Reception Hall House Bonus + limit = { + house = { has_variable = ep3_legacy_legitimacy_counter } + primary_title = scope:title + } + trigger_event = { + id = ep3_admin_events.0010 + days = 1 + } + } + } + # EP3 - Fire a became governor event + else_if = { + limit = { + top_liege != this + trigger_if = { + limit = { government_allows = merit } + is_governor_or_admin_count = yes + } + trigger_else = { + is_governor = yes + } + any_held_title = { + count < 1 + this != scope:title + tier >= scope:title.tier + is_landless_type_title = no + is_noble_family_title = no + } + } + trigger_event = { + id = ep3_admin_events.0002 + delayed = yes + } + } + # Admin vassals get the Governor trait when they first become a governor + if = { + limit = { + is_governor = yes + NOT = { has_trait = governor } + scope:title = { + tier >= root.main_administrative_tier + } + } + add_trait = governor + } + #Admin imperial succession notification event (it's a big deal) + if = { + limit = { + top_liege = this + highest_held_title_tier >= tier_kingdom + scope:title = root.primary_title + has_ep3_dlc_trigger = yes + #Checks so this event doesn't fire after character creation, although it's not really a problem if it does + trigger_if = { + limit = { + game_start_date = 867.1.1 + } + current_date >= 867.1.4 + } + trigger_if = { + limit = { + game_start_date = 1066.9.15 + } + current_date >= 1066.9.18 + } + trigger_if = { + limit = { + game_start_date = 1178.10.1 + } + current_date >= 1178.10.4 + } + } + save_scope_as = emperor + #Should trigger special event during fourth crusade! + if = { + limit = { + exists = global_var:byz_claimant_champion + global_var:byz_claimant_champion = { + any_owned_story = { + type = frankokratia_story + exists = var:byz_claimant + var:byz_claimant = { + this = root + } + } + } + } + every_vassal_or_below = { + limit = { + is_playable_character = yes + } + trigger_event = ep3_frankokratia_events.0110 + } + } + else = { + if = { + limit = { + exists = root.house + } + #normal triggering + every_vassal_or_below = { + limit = { + is_playable_character = yes + exists = scope:previous_holder + has_government = administrative_government + OR = { + highest_held_title_tier >= main_administrative_tier # All governors + liege = root + } + } + trigger_event = { + id = ep3_governor_yearly.3060 + days = 1 + } + } + } + } + } + #Admin event about rewarding person who helped you get title + if = { + limit = { + has_succession_appointment_investors = scope:title + has_ep3_dlc_trigger = yes + scope:title = { + any_succession_appointment_investors = { + count >= 1 + candidate = root + value >= 20 + NOT = { + house ?= root.house + } + is_alive = yes + is_imprisoned = no + NOR = { + has_relation_rival = root + is_at_war_with = root + } + } + } + } + save_scope_as = new_landed_admin + trigger_event = { + id = ep3_interactions_events.0600 + days = { 5 10 } + } + } + #Notification for house members of title holder + if = { + limit = { + scope:title.tier > tier_barony + primary_title.tier <= scope:title.tier + NOT = { has_character_flag = admin_title_gain_notification_sent } + exists = house + any_player = { + house ?= root.house + top_liege = root.top_liege + government_allows = administrative + this != root + } + } + add_character_flag = { + flag = admin_title_gain_notification_sent + days = 10 + } + save_scope_as = title_gainer + every_player = { + limit = { + house ?= root.house + top_liege = root.top_liege + government_allows = administrative + this != scope:title_gainer + scope:title != title:k_chrysanthemum_throne + } + send_interface_message = { + type = msg_admin_title_gained + title = msg_admin_title_gained_house.tt + desc = msg_admin_title_gained.desc + left_icon = scope:title_gainer + right_icon = scope:title + } + } + } + #Notification for admin investors in new title holder + if = { + limit = { + NOT = { has_character_flag = admin_title_gain_notification_sent } + scope:title = { + tier > tier_barony + any_succession_appointment_investors = { + is_ai = no + candidate = root + trigger_if = { + limit = { exists = root.house } + NOT = { house ?= root.house } + } + } + } + } + add_character_flag = { + flag = admin_title_gain_notification_sent + days = 10 + } + save_scope_as = title_gainer + scope:title = { + every_succession_appointment_investors = { + candidate = root + value > 0 + limit = { + is_ai = no + trigger_if = { + limit = { exists = root.house } + NOT = { house ?= root.house } + } + } + send_interface_message = { + type = msg_admin_title_gained + title = msg_admin_title_gained_investor.tt + desc = msg_admin_title_gained.desc + left_icon = scope:title_gainer + right_icon = scope:title + } + } + every_succession_appointment_investors = { + candidate = root + value < 0 + limit = { + is_ai = no + trigger_if = { + limit = { exists = root.house } + NOT = { house ?= root.house } + } + } + send_interface_message = { + type = msg_admin_title_gained_foe + title = msg_admin_title_gained_foe.tt + desc = msg_admin_title_gained.desc + left_icon = scope:title_gainer + right_icon = scope:title + } + } + } + } + + # Merit based candidate score bonus is removed when successfully getting a new governorship + if = { + limit = { + OR = { + has_variable = merit_civilian_career_score_bonus + has_variable = merit_military_career_score_bonus + } + is_landed = yes + scope:title.tier >= primary_title.tier + } + if = { + limit = { has_variable = merit_civilian_career_score_bonus } + remove_variable = merit_civilian_career_score_bonus + } + else_if = { + limit = { has_variable = merit_military_career_score_bonus } + remove_variable = merit_military_career_score_bonus + } + } + } + + ######## + # MISC # + ######## + + # TGP, bow before liege mandated + if = { + limit = { + culture = { has_cultural_parameter = must_pledge_loyalty_to_liege } + } + if = { # if you are now the top liege, all your direct vassals with the same parameter who have not yet sworn fealty to you must swear fealty + limit = { + this = top_liege + primary_title.tier <= scope:title.tier + } + every_vassal = { + if = { + limit = { + culture = { has_cultural_parameter = must_pledge_loyalty_to_liege } + OR = { + government_has_flag = government_is_feudal + government_has_flag = government_is_clan + government_has_flag = government_is_japan_feudal + } + NOT = { var:pledge_loyalty_to_liege_grace ?= liege } + NOT = { owns_story_of_type = story_cycle_pledge_loyalty_to_liege_overdue } + } + create_story = story_cycle_pledge_loyalty_to_liege_overdue + random_owned_story = { + type = story_cycle_pledge_loyalty_to_liege_overdue + set_variable = new_liege_variant + } + } + } + } + else_if = { # if you now have a new liege, and they also follow a culture with the Pay Homage requirement, you must swear continued fealty + limit = { + liege.culture = { has_cultural_parameter = must_pledge_loyalty_to_liege } + OR = { + government_has_flag = government_is_feudal + government_has_flag = government_is_clan + government_has_flag = government_is_japan_feudal + } + NOT = { var:pledge_loyalty_to_liege_grace ?= liege } + NOT = { owns_story_of_type = story_cycle_pledge_loyalty_to_liege_overdue } + } + create_story = story_cycle_pledge_loyalty_to_liege_overdue + random_owned_story = { + type = story_cycle_pledge_loyalty_to_liege_overdue + set_variable = new_title_variant + } + } + } + + # Did I conquer a place with holy order leases not of my faith? + if = { + limit = { + scope:title = { + any_in_de_jure_hierarchy = { + tier = tier_barony + is_under_holy_order_lease = yes + county.holder = { + any_liege_or_above = { this = root } + } + lessee = { + NAND = { # Only for leases of people who are not of your faith or the holder's faith + faith = root.faith + faith = prev.county.holder.faith + } + } + } + } + } + scope:title = { + every_in_de_jure_hierarchy = { + limit = { + tier = tier_barony + is_under_holy_order_lease = yes + county.holder = { + any_liege_or_above = { this = root } + } + lessee = { + NAND = { # Only for leases of people who are not of your faith or the holder's faith + faith = root.faith + faith = prev.county.holder.faith + } + } + } + revoke_lease = yes + } + } + } + + # Everything that requires a previous_holder + if = { + limit = { + exists = scope:previous_holder + } + # If a player is on their way to pay homage, invalidate. + if = { + limit = { + any_player = { var:homage_liege_scope ?= scope:previous_holder } + } + every_player = { + limit = { + var:homage_liege_scope ?= scope:previous_holder + NOT = { has_character_flag = currently_invalidating_petition_liege_travel } + } + current_travel_plan = { + if = { + limit = { can_cancel = yes } + cancel_travel_plan = yes + } + } + trigger_event = pay_homage.0601 + add_character_flag = { + flag = currently_invalidating_petition_liege_travel + days = 1 + } + } + } + # If a player is on their way to bow before liege, invalidate. + else_if = { + limit = { + any_player = { var:pledge_loyalty_to_liege_scope ?= scope:previous_holder } + } + every_player = { + limit = { + var:pledge_loyalty_to_liege_scope ?= scope:previous_holder + NOT = { has_character_flag = currently_invalidating_petition_liege_travel } + } + current_travel_plan = { + if = { + limit = { can_cancel = yes } + cancel_travel_plan = yes + } + } + trigger_event = pledge_loyalty_to_liege.0601 + add_character_flag = { + flag = currently_invalidating_petition_liege_travel + days = 1 + } + } + } + + # Feud + if = { + limit = { + scope:previous_holder = { + house_has_feud_relation_with_trigger = { TARGET = root } + house = { + any_house_relation = { + any_relation_house = { + this = root.house + NOT = { this = scope:previous_holder.house } + } + var:house_feud_reason ?= flag:competing_claim + var:house_feud_attacker.house ?= scope:previous_holder.house + var:house_feud_victim.house ?= root.house + var:house_feud_title ?= scope:title + NOT = { exists = var:feud_avenged } + } + } + } + } + scope:previous_holder.house_head = { save_scope_as = house_feud_rival } + trigger_event = bp1_house_feud.7000 + } + } + + # EP3 LAAMP SUPPORTER INVALIDATION + if = { + limit = { + exists = var:adventurer_invasion_supporter + NOT = { government_has_flag = government_is_landless_adventurer } + } + ep3_laamp_supporter_invalidated_effect = yes + } + + # Natural Disaster Recovery project invalidation + great_projects_ensure_unique_disaster_recovery_projects_effect = yes + + ########### + # Nomads/Tribals leaving confederacies + ########### + if = { + limit = { + is_confederation_member = yes + scope:title.tier >= tier_kingdom + government_is_japanese_trigger = no + } + confederation = { + remove_confederation_member = root + } + } + + # Peasants dress like nobles if landed + if = { + limit = { + has_character_flag = peasant_outfit + NOT = { government_has_flag = government_is_herder } + } + remove_character_flag = peasant_outfit + } + + # Petition allowed again + if = { + limit = { has_variable = petition_title_cooldown } + remove_variable = petition_title_cooldown + } + + # Cancel Domicile travels + current_travel_plan ?= { + if = { + limit = { is_travel_with_domicile = yes } + abort_travel_plan = yes + } + } + + # BP3 - Inspector perks cleanup effect + landless_inspector_cleanup_modifier = yes + + # Update flavorful titles (Margrave, Tenno, etc.) + additional_flavor_check_effect = yes + + # Update CoAs + scope:title = { update_dynamic_coa = yes } + + ### MEMORIES - SHOULD STAY AT BOTTOM ### + # Ascended to the throne + if = { + limit = { + OR = { + is_ruler = no + highest_held_title_tier <= scope:title.tier + government_has_flag = government_is_landless_adventurer + government_allows = administrative + } + } + if = { + limit = { exists = scope:title.var:adventurer_flavor_char } + create_character_memory = { + type = became_landless_adventurer_memory + participants = { + flavor_character = scope:title.var:adventurer_flavor_char + } + } + #Only children should get childhood memories + if = { + limit = { is_adult = no } + scope:new_memory = { set_variable = childhood_memory } + } + scope:new_memory = { + save_scope_as = became_landless_adventurer_memory + set_variable = { + name = landless_title + value = scope:title + } + set_variable = { + name = reason + value = scope:transfer_type + } + set_variable = { + name = adventurer_creation_reason + value = scope:title.var:adventurer_creation_reason + } + if = { + limit = { exists = scope:lost_primary_title } + set_variable = { + name = old_primary_title + value = scope:lost_primary_title + } + } + if = { # Error suppression + limit = { exists = var:landless_title } + } + } + } + else = { + # Overwrite if there is a more specific Reason + root = { + add_to_variable_list = { + name = new_titles + target = scope:title + } + trigger_event = { + id = title_event.9900 + delayed = yes + } + } + } + } + + # If we weren't already in a diarchy but should be, put us in one. + if = { + limit = { + scope:title.tier >= tier_county + } + trigger_event = { + id = diarchy.0011 + days = 1 + } + } + #Confederation titles being re-created... get confederation law bb + if = { + limit = { + scope:transfer_type = flag:created + scope:title = { + has_variable = confederation_culture + NOT = { + has_title_law = confederation_elective_succession_law + } + } + } + scope:bloc = { add_confederation_member = scope:bloc_joiner } + } + #Coronation modifier is lost + if = { + limit = { + scope:title = { + tier = tier_county + OR = { + has_county_modifier = major_coronation_approval_unsettled_modifier + has_county_modifier = medium_coronation_approval_unsettled_modifier + has_county_modifier = minor_coronation_approval_unsettled_modifier + has_county_modifier = major_coronation_approval_modifier + has_county_modifier = medium_coronation_approval_modifier + has_county_modifier = minor_coronation_approval_modifier + } + } + NOR = { + scope:transfer_type = flag:inheritance + scope:transfer_type = flag:leased_out + scope:transfer_type = flag:abdication + scope:transfer_type = flag:granted + scope:transfer_type = flag:election + scope:transfer_type = flag:abdication + scope:transfer_type = flag:stepped_down + scope:transfer_type = flag:swear_fealty + scope:transfer_type = flag:created + } + } + #Add negative modifiers if stolen + scope:title = { + switch = { + trigger = has_county_modifier + major_coronation_approval_modifier = { + scope:title = { + remove_county_modifier = major_coronation_approval_modifier + add_county_modifier = { + modifier = major_coronation_approval_malus_modifier + years = 5 + } + } + } + major_coronation_approval_unsettled_modifier = { + scope:title = { + remove_county_modifier = major_coronation_approval_unsettled_modifier + add_county_modifier = { + modifier = major_coronation_approval_malus_unsettled_modifier + years = 5 + } + } + } + medium_coronation_approval_modifier = { + scope:title = { + remove_county_modifier = medium_coronation_approval_modifier + add_county_modifier = { + modifier = medium_coronation_approval_malus_modifier + years = 5 + } + } + } + medium_coronation_approval_unsettled_modifier = { + scope:title = { + remove_county_modifier = medium_coronation_approval_unsettled_modifier + add_county_modifier = { + modifier = medium_coronation_approval_malus_unsettled_modifier + years = 5 + } + } + } + minor_coronation_approval_modifier = { + scope:title = { + remove_county_modifier = minor_coronation_approval_modifier + add_county_modifier = { + modifier = minor_coronation_approval_malus_modifier + years = 5 + } + } + } + minor_coronation_approval_unsettled_modifier = { + scope:title = { + remove_county_modifier = minor_coronation_approval_unsettled_modifier + add_county_modifier = { + modifier = minor_coronation_approval_malus_unsettled_modifier + years = 5 + } + } + } + } + } + } + + # House head goes to independent ruler for Japanese AI + if = { + limit = { + is_house_head = no + is_ai = yes + government_is_japanese_trigger = yes + scope:previous_holder = { + is_ai = yes + trigger_if = { + limit = { exists = scope:player_heir } + player_heir = { is_ai = yes } + } + } + scope:new_holder = { + is_ai = yes + trigger_if = { + limit = { exists = scope:player_heir } + player_heir = { is_ai = yes } + } + } + house.house_head = { + is_ai = yes + trigger_if = { + limit = { exists = scope:player_heir } + player_heir = { is_ai = yes } + } + is_vassal_or_below_of = root + } + is_independent_ruler = yes + } + house = { set_house_head = root } + } + + if = { # If courtiers get lost between governorship assignments, move them home + limit = { + is_ai = no + government_allows = merit + } + if = { + limit = { + is_landed = yes + } + every_courtier = { + limit = { + location != root.capital_province + is_imprisoned = no + is_travelling = no + is_commanding_army = no + NOR = { + exists = involved_activity + exists = knight_army + } + } + set_location_to_default = yes + } + } + else_if = { + limit = { + exists = domicile.domicile_location + } + every_courtier = { + limit = { + location != root.domicile.domicile_location + is_imprisoned = no + is_travelling = no + is_commanding_army = no + NOR = { + exists = involved_activity + exists = knight_army + } + } + set_location_to_default = yes + } + } + } + # If you take another realm's dynasty-named title, reset its name + if = { + limit = { + is_independent_ruler = yes + government_has_flag = government_is_celestial + scope:title ?= { + tier >= tier_kingdom + has_custom_title_name = yes + this != root.primary_title + } + } + scope:title = { + reset_title_name = yes + } + } + } + events = { + roman_restoration.0005 #New Roman Emperor gets Augustus trait. (old holder, if still alive, loses it) + roman_restoration.0199 #Restoring the Pentarchy. + delay = { days = 1 } + realm_maintenance.2001 #Big notification about inheriting emperor tier title + british_isles.1032 # Danelaw-England partition calc. + title_event.0001 # Rename West Francia to France + title_event.0002 # Rename East Francia to Germany + title_event.0011 # Asturias becomes Leon upon emergence of Castille + # If we weren't already in a diarchy but should be, put us in one. + diarchy.0011 + ep3_emperor_yearly.2020 # EP3: The Patriarch refuses to crown you as new emperor because you have a criminal trait + } +} + +# A title is inherited by a character +# root = the new holder +# scope:title = the title that changes hands +# scope:previous_holder = previous holder. Should be dead +on_title_gain_inheritance = { + events = { + delay = { days = 1 } + # Try to end inherited entrenched regencies automatically — we need to launder this by a day to make sure the AI realises they've inherited a diarchy. + diarchy.0113 + } + effect = { + if = { + limit = { + scope:title = { + OR = { + this = title:e_mongol_empire + AND = { + exists = global_var:greatest_of_khans_title + this = global_var:greatest_of_khans_title + } + } + } + has_character_flag = gain_mongol_succession_dread + } + add_dread = 50 + } + else_if = { + limit = { + OR = { + scope:title = title:h_roman_empire + scope:title = title:h_eastern_roman_empire + } + } + set_variable = uses_custom_caesar_flavourization + } + } +} + +# A title is usurped by a character +# root = the new holder +# scope:title = the title that changes hands +# scope:previous_holder = previous holder. Shouldn't be dead +on_title_gain_usurpation = { + events = { + } + effect = { + # Struggle Catalysts + if = { + limit = { # FP2 + # We are only interested in the title within the Struggle Region + scope:title.empire ?= title:e_spain + # Only for usurpation + scope:transfer_type = flag:usurped + + root = { + any_character_struggle = { + involvement = involved + activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { + CATALYST = catalyst_usurp_title_fp2 + CHAR = root + } + } + } + } + root = { + every_character_struggle = { + involvement = involved + limit = { + activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { + CATALYST = catalyst_usurp_title_fp2 + CHAR = root + } + } + activate_struggle_catalyst = { + catalyst = catalyst_usurp_title_fp2 + character = root + } + } + } + } + else_if = { + limit = { # FP3 + scope:title.empire ?= title:e_persia + scope:transfer_type = flag:usurped + + root = { + any_character_struggle = { + involvement = involved + activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { + CATALYST = catalyst_usurp_title_fp3 + CHAR = root + } + } + } + } + root = { + every_character_struggle = { + involvement = involved + limit = { + activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { + CATALYST = catalyst_usurp_title_fp3 + CHAR = root + } + } + activate_struggle_catalyst = { + catalyst = catalyst_usurp_title_fp3 + character = root + } + log_debug_variable_for_persian_struggle_effect = { VAR = unrest_catalyst_usurp_title_fp3 } + } + } + } + } +} + +# A title is lost by a character +# root = the old holder +# scope:title = the title that changes hands +# scope:new_holder = new holder. +on_title_lost = { + events = { + british_isles.1033 # Danelaw-England partition calc. + } + + effect = { + #Make sure nobody ever has only the Kingdom of Fashion + if = { + limit = { + scope:title = { tier = tier_kingdom } + has_title = title:k_fashion + NOT = { + any_held_title = { # Only trigger if you don't have any kingdom titles other than Fashion and the kingdom you just lost. Double negative is confusing but it's the only way I could think to script it + title_tier = kingdom + NOT = { this = title:k_fashion } + this != scope:title + } + } + } + destroy_title = title:k_fashion + } + #Earmark landless Scandinavians for adventuring. + if = { + limit = { + #We only want to grab tribal cultures. + culture = { + NOT = { has_cultural_era_or_later = culture_era_early_medieval } + } + #Must have lost their last piece of land. + is_playable_character = no + #If they've ventured far outside Europe, they're unlikely to come back, so we don't #want them. + scope:title = { + tier = tier_county + title_province = { + OR = { + geographical_region = world_europe + geographical_region = world_asia_minor + } + } + } + } + #Norse, Norwegians, & Danes go into the western adventurer list. + if = { + limit = { + OR = { + has_culture = culture:norse + has_culture = culture:norwegian + has_culture = culture:danish + } + } + add_to_global_variable_list = { + name = western_scandinavian_adventurer_list + target = this + } + } + #Norse & Swedes go into the eastern adventurer list. + if = { + limit = { + OR = { + has_culture = culture:norse + has_culture = culture:swedish + } + } + add_to_global_variable_list = { + name = eastern_scandinavian_adventurer_list + target = this + } + } + } + + #To remove concubines if a character becomes unlanded + if = { + limit = { + is_playable_character = no + any_concubine = { } + } + every_concubine = { root = { remove_concubine = prev } } + } + + # Transfer co-monarchies. + if = { + limit = { + OR = { + scope:transfer_type = flag:inheritance + scope:transfer_type = flag:abdication + scope:transfer_type = flag:usurped + scope:transfer_type = flag:election + scope:transfer_type = flag:faction_demand + scope:transfer_type = flag:stepped_down + } + } + save_scope_as = old_holder + trigger_event = { + id = diarchy.0025 + days = 1 + } + } + + #Apply loss of stress to the Rivals + if = { + limit = { + scope:title.tier >= tier_county + scope:title = { is_landless_type_title = no } + OR = { + scope:transfer_type = flag:conquest + scope:transfer_type = flag:conquest_holy_war + scope:transfer_type = flag:conquest_claim + scope:transfer_type = flag:conquest_populist + scope:transfer_type = flag:abdication + scope:transfer_type = flag:usurped + scope:transfer_type = flag:revoked + scope:transfer_type = flag:faction_demand + } + } + root = { + save_scope_as = actor + } + every_relation ={ + type = rival + + send_interface_message = { + type = event_generic_neutral + title = msg_rival_dethroned + left_icon = scope:actor + right_icon = scope:title + + custom_tooltip = msg_rival_dethroned_desc + + stress_impact = { + base = medium_stress_loss + vengeful = medium_stress_loss + } + } + } + } + + # Struggle catalyst + if = { + limit = { + any_character_struggle = { + involvement = involved + phase_has_catalyst = catalyst_revoke_title + } + OR = { + scope:transfer_type = flag:revoked + scope:transfer_type = flag:lease_revoked + } + } + every_character_struggle = { + activate_struggle_catalyst = { + catalyst = catalyst_revoke_title + character = scope:new_holder + } + } + } + + # Memories + # Lost a significant title + if = { + limit = { + scope:title.tier >= highest_held_title_tier + exists = scope:new_holder + } + if = { + limit = { exists = root.var:lost_title_reason } + root.var:lost_title_reason = { save_scope_as = real_transfer_type } + root = { remove_variable = lost_title_reason } + } + else = { + scope:transfer_type = { save_scope_as = real_transfer_type } + } + root = { + add_to_variable_list = { + name = lost_titles + target = scope:title + } + trigger_event = { + id = title_event.9901 + delayed = yes + } + } + } + + # LEGITIMACY LOSS FROM USURPATION + if = { + limit = { + scope:transfer_type ?= flag:usurped + has_legitimacy = yes + NOT = { exists = scope:suppress_legitimacy_loss } + } + # Minus 2, since we want Duchy to be 1, and it's normally 3 + save_scope_value_as = { + name = title_tier_minus_2 + value = { + value = scope:title.tier + subtract = 2 + } + } + send_interface_toast = { + type = msg_legitimacy_loss + title = legitimacy_loss_toast + left_icon = root + right_icon = scope:title + custom_tooltip = legitimacy_loss_usurpation_tt + add_legitimacy = { + value = { + value = miniscule_legitimacy_loss + multiply = scope:title_tier_minus_2 + } + } + } + } + + # EP3 LAAMP SUPPORTER INVALIDATION + ep3_laamp_supporter_invalidated_effect = yes + + # EP3 - Handle admin estates when they end up outside the realm + if = { + limit = { + scope:new_holder = { + any_sub_realm_barony = { + title_province = { + any_province_domicile = { + is_domicile_type = estate + owner ?= { + top_liege != scope:new_holder.top_liege + } + } + } + } + } + } + scope:new_holder = { + every_sub_realm_barony = { + limit = { + title_province = { + any_province_domicile = { + is_domicile_type = estate + owner ?= { + top_liege != scope:new_holder.top_liege + } + } + } + } + title_province = { + every_province_domicile = { + limit = { + is_domicile_type = estate + owner ?= { + top_liege != scope:new_holder.top_liege + } + } + + # First, let's do some damage to the estate - We randomize the level of damage taken + random_list = { + 40 = { # Damage 1 + trigger = { + num_domicile_buildings <= 6 + } + set_variable = { + name = domicile_damage_count + value = 1 + } + } + 35 = { # Damage 2 + trigger = { + num_domicile_buildings > 2 + } + set_variable = { + name = domicile_damage_count + value = 2 + } + } + 30 = { # Damage 3 + trigger = { + num_domicile_buildings > 4 + } + set_variable = { + name = domicile_damage_count + value = 3 + } + } + 25 = { # Damage 4 + trigger = { + num_domicile_buildings > 6 + } + set_variable = { + name = domicile_damage_count + value = 4 + } + } + 20 = { # Damage 5 + trigger = { + num_domicile_buildings > 8 + } + set_variable = { + name = domicile_damage_count + value = 5 + } + } + 15 = { # Damage 6 + trigger = { + num_domicile_buildings > 10 + } + set_variable = { + name = domicile_damage_count + value = 6 + } + } + } + while = { + count = var:domicile_damage_count + destroy_random_estate_building_variable_effect = yes + destroy_random_estate_building_effect = yes + } + + # Clear the variable + if = { + limit = { has_variable = domicile_damage_count } + remove_variable = domicile_damage_count + } + + # Then we'll move the estate to keep it within the realm's borders + if = { # If you have a capital (i.e. you are a governor) let's move the estate there + limit = { + owner = { + is_landed = yes + exists = capital_province + } + } + move_domicile = owner.capital_province + } + else_if = { # If not, let's move it to a landed house member in the realm, if you have one + limit = { + owner = { + top_liege ?= { save_temporary_scope_as = owner_top_liege } + house ?= { + any_house_member = { + is_governor = yes + top_liege = scope:owner_top_liege + } + } + } + } + owner = { + house = { + random_house_member = { + limit = { + is_governor = yes + exists = capital_province + top_liege = scope:owner_top_liege + } + capital_province = { save_temporary_scope_as = house_member_location } + } + } + } + move_domicile = scope:house_member_location + } + else_if = { # Otherwise move it to the realm capital + limit = { + exists = owner.top_liege.capital_province + } + move_domicile = owner.top_liege.capital_province + } + + # Save the new estate location for msg + domicile_location.barony = { + save_scope_as = new_estate_location + } + + # Finally, let's make sure the owner moves to the new estate location + owner = { + if = { + limit = { + is_alive = yes + is_imprisoned = no + is_travelling = no + NOT = { + exists = involved_activity + } + is_commanding_army = no + } + set_location_to_default = yes + } + + # And notify the owner that all of this just happened + if = { + limit = { is_ai = no } + send_interface_message = { + type = msg_domicile_damaged + title = msg_estate_damaged.title + desc = msg_estate_damaged.desc + right_icon = scope:new_estate_location + } + } + } + } + } + } + } + } + + # Additional Flavor Title + additional_flavor_check_effect = yes + + if = { + limit = { + OR = { + scope:title = title:h_roman_empire + scope:title = title:h_eastern_roman_empire + } + } + remove_variable = uses_custom_caesar_flavourization + } + #Notification for house members of loser + if = { + limit = { + scope:title.tier > tier_barony + trigger_if = { # Prevent msg spam when rulers give away or lose lower tier titles + limit = { + is_landed = yes + } + primary_title.tier <= scope:title.tier + } + is_alive = yes + NOT = { has_character_flag = admin_title_loss_notification_sent } + government_allows = administrative + house ?= { + any_house_member = { + is_ai = no + trigger_if = { + limit = { exists = root.top_liege } + top_liege = root.top_liege + } + government_allows = administrative + this != root + } + } + } + add_character_flag = { + flag = admin_title_loss_notification_sent + days = 10 + } + save_scope_as = title_loser + house = { + every_house_member = { + limit = { + is_ai = no + trigger_if = { + limit = { exists = root.top_liege } + top_liege = root.top_liege + } + government_allows = administrative + this != scope:title_loser + } + send_interface_message = { + type = msg_admin_title_lost + title = msg_admin_title_lost_house.tt + desc = msg_admin_title_lost.desc + left_icon = scope:title_loser + right_icon = scope:title + } + } + } + } + #Notification for admin investors in loser + if = { + limit = { + is_alive = yes + NOT = { has_character_flag = admin_title_loss_notification_sent } + scope:title = { + tier > tier_barony + any_succession_appointment_investors = { + candidate = root + is_ai = no + trigger_if = { + limit = { exists = root.house } + NOT = { house ?= root.house } + } + } + } + } + add_character_flag = { + flag = admin_title_loss_notification_sent + days = 10 + } + save_scope_as = title_loser + scope:title = { + every_succession_appointment_investors = { + candidate = root + value > 0 + limit = { + is_ai = no + trigger_if = { + limit = { exists = root.house } + NOT = { house ?= root.house } + } + } + send_interface_message = { + type = msg_admin_title_lost + title = msg_admin_title_lost_investor.tt + desc = msg_admin_title_lost.desc + left_icon = scope:title_loser + right_icon = scope:title + } + } + every_succession_appointment_investors = { + candidate = root + value < 0 + limit = { + is_ai = no + trigger_if = { + limit = { exists = root.house } + NOT = { house ?= root.house } + } + } + send_interface_message = { + type = msg_admin_title_lost_foe + title = msg_admin_title_lost_foe.tt + desc = msg_admin_title_lost.desc + left_icon = scope:title_loser + right_icon = scope:title + } + } + } + } + + # Lil Johnny Lackland changes his nickname. + if = { + limit = { + has_nickname = nick_lackland_ironic + scope:title.tier >= tier_duchy + } + give_nickname = nick_lackland_old + } + + # BP3 - Inspector perks cleanup effect + landless_inspector_cleanup_modifier = yes + + #End Greatest of Khans story if title was lost + if = { + limit = { + any_owned_story = { + story_type = story_greatest_of_khans + } + global_var:greatest_of_khans_title ?= { + this = scope:title + } + OR = { + NOT = { + exists = scope:new_holder + } + scope:new_holder = { + NOR = { + AND = { + exists = dynasty + dynasty ?= root.dynasty + } + is_grandchild_of = root + is_child_of = root + } + } + } + } + if = { + limit = { + is_alive = yes + } + trigger_event = { + id = mpo_greatest_of_khans.0040 + days = 1 + } + } + else_if = { + limit = { + exists = root.player_heir + exists = root.dynasty + player_heir = { + dynasty ?= story_owner.dynasty + } + } + player_heir ?= { + trigger_event = { + id = mpo_greatest_of_khans.0040 + days = 1 + } + } + } + else = { + every_owned_story = { + limit = { story_type = story_greatest_of_khans } + end_story = yes + } + remove_character_modifier = the_great_khan_modifier + } + } + #Coronation loyalty modifier + if = { + limit = { + scope:title = { + has_variable = coronation_loyal_to_title + var:coronation_loyal_to_title = { + NOT = { + this = scope:new_holder.primary_title + } + } + } + } + scope:title = { + remove_county_modifier = coronation_loyal_to_the_crown_modifier + remove_variable = coronation_loyal_to_title + add_county_modifier = { + modifier = coronation_still_loyal_modifier + years = 5 + } + } + } + + if = { # If courtiers get lost between governorship assignments, move them home + limit = { + is_ai = no + government_allows = merit + } + if = { + limit = { + is_landed = yes + } + every_courtier = { + limit = { + location != root.capital_province + is_imprisoned = no + is_travelling = no + is_commanding_army = no + NOR = { + exists = involved_activity + exists = knight_army + } + } + set_location_to_default = yes + } + } + else_if = { + limit = { + is_landed = no + exists = domicile.domicile_location + } + every_courtier = { + limit = { + location != root.domicile.domicile_location + is_imprisoned = no + is_travelling = no + is_commanding_army = no + NOR = { + exists = involved_activity + exists = knight_army + } + } + set_location_to_default = yes + } + } + } + + # Remove manually added Ministers if they're not ministers anymore + if = { + limit = { + NOR = { + primary_title = title:e_minister_chancellor + primary_title = title:e_minister_censor + primary_title = title:e_minister_grand_marshal + primary_title = title:e_minister_of_personnel + primary_title = title:e_minister_of_revenue + primary_title = title:e_minister_of_rites + primary_title = title:e_minister_of_war + primary_title = title:e_minister_of_justice + primary_title = title:e_minister_of_works + } + } + situation:dynastic_cycle = { + remove_manual_participant = prev + } + } + + # Move or destroy estates without a liege + if = { + limit = { + # Has an NF title + any_held_title = { + NOT = { this = scope:title } + is_noble_family_title = yes + } + # Only remaining title is NF title + any_held_title = { + count = 0 + NOT = { this = scope:title } + is_noble_family_title = no + } + } + if = { + limit = { + OR = { + exists = scope:new_holder.var:laamp_invasion_flag + trigger_if = { + limit = { government_is_japanese_trigger = yes } + scope:new_holder.top_liege = { government_is_japanese_trigger = no } + } + trigger_else_if = { + limit = { + scope:new_holder.top_liege = { government_is_japanese_trigger = yes } + } + government_is_japanese_trigger = no + } + trigger_else = { + NOT = { has_same_government = scope:new_holder.top_liege } + } + } + } + # Find appropriate new realm if possible + scope:new_holder.top_liege = { + ordered_neighboring_and_across_water_realm_owner = { + limit = { + highest_held_title_tier >= main_administrative_tier + trigger_if = { + limit = { + root = { government_is_japanese_trigger = yes } + } + government_is_japanese_trigger = yes + } + trigger_else = { has_same_government = root } + } + order_by = highest_held_title_tier + save_scope_as = new_realm_owner + } + } + if = { # Change liege + limit = { exists = scope:new_realm_owner } + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + } + change_liege = { + liege = scope:new_realm_owner + change = scope:change + } + resolve_title_and_vassal_change = scope:change + } + else = { # Game over + random_held_title = { + limit = { is_noble_family_title = yes } + save_scope_as = title_to_destroy + scope:new_holder.top_liege = { destroy_title = scope:title_to_destroy } + } + } + } + } + else_if = { + limit = { + is_house_head = no + # Has an NF title + exists = house + house.house_head = { + any_held_title = { is_noble_family_title = yes } + } + # Only remaining title is NF title + any_held_title = { + count = 0 + NOT = { this = scope:title } + } + } + house.house_head = { + save_temporary_scope_as = house_head_court + } + every_courtier = { + if = { + limit = { + NOT = { is_courtier_of = scope:house_head_court } + } + save_temporary_scope_as = courtier + scope:house_head_court = { add_courtier = scope:courtier } + } + } + if = { + limit = { + NOT = { is_courtier_of = scope:house_head_court } + } + scope:house_head_court = { add_courtier = root } + } + } + } +} + +# A claim is gained by a character +# root = the claimant +# scope:title = the title that is claimed +# scope:transfer_type = flag:inheritance or none +on_explicit_claim_gain = { + effect = { + if = { + limit = { + title:k_england.holder = root + } + title:k_england = { + update_dynamic_coa = yes + } + } + # Struggle Catalyst + if = { # FP2 + limit = { + NOT = { scope:transfer_type = flag:inheritance } + + root = { + any_character_struggle = { + is_struggle_type = iberian_struggle + involvement = involved + } + } + title:e_spain = { any_in_de_jure_hierarchy = { this = scope:title } } + } + root = { + every_character_struggle = { + involvement = involved + limit = { + activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { + CATALYST = catalyst_gain_claim_on_title_fp2 + CHAR = root + } + } + activate_struggle_catalyst = { + catalyst = catalyst_gain_claim_on_title_fp2 + character = root + } + } + } + } + else_if = { # FP3 + limit = { + NOT = { scope:transfer_type = flag:inheritance } + + root = { + any_character_struggle = { + is_struggle_type = persian_struggle + involvement = involved + } + } + title:e_persia = { any_in_de_jure_hierarchy = { this = scope:title } } + } + root = { + every_character_struggle = { + involvement = involved + limit = { + activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { + CATALYST = catalyst_gain_claim_on_title_fp3 + CHAR = root + } + } + activate_struggle_catalyst = { + catalyst = catalyst_gain_claim_on_title_fp3 + character = root + } + log_debug_variable_for_persian_struggle_effect = { VAR = unrest_catalyst_gain_claim_on_title_fp3 } + } + } + } + } +} + +# A claim is lost by a character +# root = the claimant +# scope:title = the title that was claimed +on_explicit_claim_lost = { + effect = { + if = { + limit = { + title:k_england.holder = root + } + title:k_england = { + update_dynamic_coa = yes + } + } + } +} + +# A title change makes the character rank up in the landed tiers (eg Duke -> King) +# root = character ranking up +# scope:title = old primary title +on_rank_up = { # Will not fire during history execution or for dying characters + events = { + } + effect = { + if = { # ACH call to coronation reminder + limit = { + coronation_trigger = yes + NOT = { + has_game_rule = coronation_laws_off + } + is_ai = no + primary_title.tier >= tier_kingdom + has_realm_law = uncrowned + NOR = { + has_variable = crowned_king_var + has_variable = crowned_emperor_var + } + NOR = { + has_character_flag = had_coronation_reminder + any_sponsored_inspiration = { has_inspiration_type = smith_inspiration } + } + is_available_adult = yes + } + trigger_event = { + id = ach_yearly_events.1005 + months = 4 + } + } + #ACH new emperors losing their crowned status + else_if = { + limit = { + coronation_trigger = yes + NOR = { + has_game_rule = coronation_laws_no_imperial_uncrowned + has_game_rule = coronation_laws_off + has_character_flag = claimed_the_mandate_of_heaven + } + highest_held_title_tier >= tier_empire + exists = scope:title + scope:title = { + tier >= tier_kingdom + #Just double checking + tier < root.highest_held_title_tier + } + OR = { + has_realm_law = crowned_king + has_realm_law = crowned_emperor + has_variable = crowned_king_var + has_variable = crowned_emperor_var + } + } + if = { + limit = { + has_variable = crowned_emperor_var + } + remove_variable = crowned_emperor_var + } + if = { + limit = { + has_variable = crowned_king_var + } + remove_variable = crowned_king_var + } + add_realm_law_skip_effects = uncrowned + trigger_event = ach_yearly_events.1010 + } + if = { + limit = { is_landed = yes } + add_achievement_flag_effect = { FLAG = achievement_moving_up_in_the_world_flag } + } + if = { + limit = { + is_ai = no + is_landed = yes + highest_held_title_tier = tier_empire + } + add_achievement_global_variable_effect = { + VARIABLE = rags_to_riches_to_rags_to_riches_first_empire + VALUE = yes + } + } + if = { + limit = { + is_ai = no + is_landed = yes + highest_held_title_tier = tier_empire + exists = global_var:rags_to_riches_to_rags_to_riches_adventurer + } + add_achievement_global_variable_effect = { + VARIABLE = finished_rags_to_riches_to_rags_to_riches_achievement + VALUE = yes + } + } + update_embassies_effect = yes + every_ally = { + update_embassies_effect = yes + } + if = { + limit = { top_liege = this } + remove_variable = use_co_ruler_title + } + # Make a note of ranking up for stele purposes. + if = { + limit = { + # DLC check. + has_fp1_dlc_trigger = yes + # Is the culture eligible? + fp1_can_raise_stele_trigger = yes + # Aaaaand, for balance reasons, were they landed already? + exists = scope:title + } + set_variable = { + name = recent_rank_increase + value = root.primary_title + years = 5 + } + } + # Remove any rank-inappropriate modifiers (e.g., baron buffs). + remove_character_modifier = mandate_baronial_troops_trained_modifier + remove_character_modifier = mandate_baronial_troops_half_trained_modifier + + # Additional Flavor Title + additional_flavor_check_effect = yes + + #Admin kings becoming emperors need their MAA transferred to new primary title + if = { + limit = { + is_independent_ruler = yes + government_allows = administrative + scope:title ?= { + any_title_maa_regiment = { + count >= 1 + } + } + } + scope:title = { + transfer_title_maa_ownership = root.primary_title + } + } + + if = { + limit = { + is_independent_ruler = yes + government_has_flag = government_is_celestial + scope:title ?= { + tier >= tier_kingdom + has_custom_title_name = yes + } + primary_title = { + has_custom_title_name = no + } + } + scope:title = { + move_title_name_to = root.primary_title + reset_title_name = yes + } + } + if = { + limit = { + is_independent_ruler = yes + government_has_flag = government_is_celestial + highest_held_title_tier >= tier_kingdom + OR = { + primary_title ?= { + has_custom_title_name = no + } + primary_title.previous_holder.dynasty != root.dynasty + } + trigger_if = { + limit = { + tgp_capital_not_in_chinese_naming_region = yes + } + primary_title ?= title:h_china + } + } + if = { + limit = { + is_ai = no + } + trigger_event = { + id = tgp_dynastic_cycle.9000 + days = 1 # so the player gets to choose first + } + } + else = { + trigger_event = { + id = tgp_dynastic_cycle.9000 + days = 2 + } + } + } + else_if = { # Make sure non-Celestials get to rename/recolor china + limit = { + is_independent_ruler = yes + has_tgp_dlc_trigger = yes + NOT = { government_has_flag = government_is_celestial } + exists = var:claimed_mandate_var + primary_title ?= title:h_china + OR = { + primary_title ?= { + has_custom_title_name = no + } + primary_title.previous_holder.dynasty != root.dynasty + } + } + if = { + limit = { + is_ai = no + } + trigger_event = { + id = tgp_dynastic_cycle.9000 + days = 1 # so the player gets to choose first + } + } + else = { + trigger_event = { + id = tgp_dynastic_cycle.9000 + days = 2 + } + } + } + + # ACH - Remove Coronated laws when titles are passed onto a new character + coronation_reset_realm_law_effect = yes + + # TGP Japan handling for blocs + if = { + limit = { + this = top_liege + tgp_uses_house_blocs_trigger = yes + exists = house.house_confederation + } + if = { # Ensure top liege is house head, if not stealing from a player + limit = { + is_house_head = no + house.house_head = { is_ai = yes } + top_liege = house.house_head.top_liege + } + house = { set_house_head = prev } + } + if = { # Ensure independent rulers are in charge of their blocs + limit = { + is_house_head = yes + NOT = { house.house_confederation.leading_house = this.house } + } + house.house_confederation = { + tgp_set_house_bloc_leading_house_effect = { LEADER = root.house } + } + } + } + + # Ensure Ministers (or any landless rulers) do not have vassals + if = { + limit = { + is_landed = no + this != top_liege + } + save_scope_as = liege + create_title_and_vassal_change = { + type = appointment + save_scope_as = change + } + every_vassal = { + limit = { + is_landed = no + any_held_title = { is_noble_family_title = yes } + } + save_scope_as = vassal + change_liege = { + liege = scope:liege.top_liege + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change + } + } +} + +# A title change makes the character rank down in the landed tiers (eg King -> Duke) +# root = character ranking down +# scope:title = old primary title +on_rank_down = { # Will not fire during history execution or for dying characters + events = { + } + effect = { + if = { + limit = { + NOR = { + has_trait = humble + has_trait = content + has_trait = generous + } + } + add_character_flag = { + flag = make_suicide_available + years = 5 + } + set_variable = { + name = rank_demoted + value = yes + } + } + update_embassies_effect = yes + every_ally = { + update_embassies_effect = yes + } + # Inform hostage havers + if = { + limit = { + any_home_court_hostage = { } + } + save_scope_as = home_court + every_home_court_hostage = { + save_scope_as = hostage + warden = { + save_scope_as = warden + trigger_event = { id = bp2_hostage_system.0410 days = 5 } + } + } + } + + # Additional Flavor Title + additional_flavor_check_effect = yes + + # ACH - Remove variables if they are going below certain ranks + coronation_reset_realm_law_variable_effect = yes + + # ACH - if you are below king tier, remove all oaths + if = { + limit = { + highest_held_title_tier < tier_kingdom + } + ach_remove_oaths_on_king_minus_effect = yes + } + } +} + +# A character gains a vassal +# root = character gaining vassal +# scope:vassal = vassal being gained +# scope:old_liege = the previous liege of the vassal. Might be the null character (vassal used to be a non-ruler or independent), so make sure to use "exists" checks where relevant +on_vassal_gained = { + events = { + realm_maintenance.1000 # Notify vassals of new liege + } + effect = { + #Nomadic Confederation members must be independent + if = { + limit = { + scope:vassal = { + is_confederation_member = yes + scope:vassal.confederation = { has_leading_house = no } + } + } + scope:vassal.confederation = { + remove_confederation_member = scope:vassal + } + } + # EP3 LANDLESS CANNOT HAVE VASSALS + if = { + limit = { has_any_landed_title_trigger = no } + save_scope_as = new_liege + if = { + limit = { top_liege != this } + create_title_and_vassal_change = { + type = swear_fealty + save_scope_as = change + add_claim_on_loss = no + } + change_liege = { + liege = scope:new_liege.liege + change = scope:change + } + resolve_title_and_vassal_change = scope:change + } + else = { + create_title_and_vassal_change = { + type = independency + save_scope_as = change + add_claim_on_loss = no + } + scope:vassal = { + becomes_independent = { change = scope:change } + } + resolve_title_and_vassal_change = scope:change + } + } + + # Additional Flavor Title + scope:vassal = { + additional_flavor_check_effect = yes + } + + # Destroy ceremonial titles of vassalized realms + if = { + limit = { + # The necessary checks are baked into the effect below + scope:vassal = { + any_held_title = { + OR = { + exists = var:ceremonial_title + exists = var:administrative_ui_special_title + } + } + } + } + # TGP end the ceremonial liege + tgp_destroy_ceremonial_throne_effect = yes + } + } +} + +# A vassal changes their liege +# root = vassal changing their status +# scope:old_liege = the previous liege of the vassal +# It is also fired for rulers gaining independence, those can be identified by checking current liege +on_vassal_change = { + effect = { + ### If a admin duke-tier character becomes the top-liege's direct vassal, ensure that they have a noble family title + if = { + limit = { + government_allows = administrative + is_house_head = yes + trigger_if = { + # This trigger is intentionally different from the similar effecy in on_title_gain up above. We want all direct vassals of the top liege to have a family title if they can + limit = { government_has_flag = government_has_county_tier_noble_families } + highest_held_title_tier >= tier_county + } + trigger_else = { highest_held_title_tier >= tier_duchy } + liege = { + top_liege = this + government_allows = administrative + } + NOR = { + any_held_title = { is_noble_family_title = yes } + house = { + any_house_member = { + any_held_title = { is_noble_family_title = yes } + } + } + } + } + create_noble_family_effect = { GOVERNMENT_GIVER = this } + domicile ?= { set_up_domicile_estate_effect = yes } + } + ### If an admin ruler becomes independent... + if = { + limit = { + liege = root # I.e. root is independent + government_has_flag = government_is_administrative + } + # And is not of a high enough rank, change government + if = { + limit = { + administrative_tier_allows_independence = no + } + admin_change_government_effect = yes + } + # If they can be independent, make sure they have a noble family title + else_if = { + limit = { + NOT = { + any_held_title = { + is_noble_family_title = yes + } + } + } + create_noble_family_effect = { GOVERNMENT_GIVER = this } + domicile ?= { set_up_domicile_estate_effect = yes } + } + } + ### Independent Celestial rulers who become direct vassals of a top liege adopt Military obligations if they have title troops - Everyone else will default to Standard. + if = { + limit = { + government_has_flag = government_is_celestial + scope:old_liege = this # I.e. they were independent + liege != this + liege = top_liege + primary_title = { + any_title_maa_regiment = { count >= 1 } + } + } + vassal_contract_set_obligation_level = { type = celestial_provinces level = 3 } + } + + ### If a minister becomes independent we destroy the ministry title + if = { + limit = { + # independent title + OR = { + liege ?= { tgp_has_access_to_ministry_trigger = no } + this = top_liege + } + + any_held_title = { + # has a ministry title that is not being swapped + OR = { + this = title:e_minister_chancellor + this = title:e_minister_censor + this = title:e_minister_grand_marshal + this = title:e_minister_of_personnel + this = title:e_minister_of_revenue + this = title:e_minister_of_rites + this = title:e_minister_of_war + this = title:e_minister_of_justice + this = title:e_minister_of_works + } + } + } + every_held_title = { + switch = { + trigger = this + title:e_minister_chancellor = { + root = { destroy_title = title:e_minister_chancellor } + } + title:e_minister_censor = { + root = { destroy_title = title:e_minister_censor } + } + title:e_minister_grand_marshal = { + root = { destroy_title = title:e_minister_grand_marshal } + } + title:e_minister_of_personnel = { + root = { destroy_title = title:e_minister_of_personnel } + } + title:e_minister_of_revenue = { + root = { destroy_title = title:e_minister_of_revenue } + } + title:e_minister_of_rites = { + root = { destroy_title = title:e_minister_of_rites } + } + title:e_minister_of_war = { + root = { destroy_title = title:e_minister_of_war } + } + title:e_minister_of_justice = { + root = { destroy_title = title:e_minister_of_justice } + } + title:e_minister_of_works = { + root = { destroy_title = title:e_minister_of_works } + } + } + } + } + # Make sure independent rulers and their vassals leave movements if they are part of the Dynastic Cycle + if = { + limit = { + exists = top_participant_group:dynastic_cycle + NOT = { + has_title = title:h_china + } + OR = { + liege = root + liege.top_participant_group:dynastic_cycle ?= { + participant_group_type = other_rulers + } + } + } + remove_variable = movement_member + every_vassal_or_below = { + remove_variable = movement_member + } + recalculate_participant_group = situation:dynastic_cycle + } + + # Additional Flavor Title + additional_flavor_check_effect = yes + + if = { + limit = { + # We have become independent! + NOT = { + scope:old_liege = root + } + liege = root + government_has_flag = government_is_celestial + highest_held_title_tier >= tier_kingdom + primary_title = { + has_custom_title_name = no # sanity check + } + OR = { + tgp_capital_not_in_chinese_naming_region = no + primary_title = title:h_china # failsafe, in case this somehow ends up here + } + } + if = { + limit = { + is_ai = no + } + trigger_event = { + id = tgp_dynastic_cycle.9000 + days = 1 # so the player gets to choose first + } + } + else = { + trigger_event = { + id = tgp_dynastic_cycle.9000 + days = 2 + } + } + } + if = { + limit = { + scope:old_liege = root + NOT = { + liege = root + } + primary_title ?= { + has_custom_title_name = yes + } + } + primary_title = { + reset_title_name = yes + } + } + + # Destroy ceremonial titles of vassalized realms + if = { + limit = { + # The necessary checks are baked into the effect below + highest_held_title_tier >= tier_empire + any_held_title = { + OR = { + exists = var:ceremonial_title + exists = var:administrative_ui_special_title + } + } + } + # TGP end the ceremonial liege + tgp_destroy_ceremonial_throne_effect = yes + if = { + limit = { has_trait = former_emperor } + remove_trait = former_emperor + } + } + + # Bloc + if = { + # Let code trigger this if this is due to succession + limit = { + scope:old_liege ?= { + is_alive = yes + } + } + tgp_liege_change_bloc_management_effect = { VASSAL = root } + } + } +} + +# A baron is found or created for a title, E.G., due to the player using the "Give to Low Noble" action +# No transfer type here; it's always a grant +# root = the baron +# scope:liege = the person who wanted them created +# scope:title = the barony +on_baron_found_or_created_for_title = { + effect = { + add_opinion = { + target = scope:liege + modifier = received_title_barony + } + } +} + +# Called when realm capital changes. It can be manual move, loss in conquest, move after inheritance, +# move when granted a better title, becoming landed for the first time +# root: New realm capital barony +# scope:old_capital - previous capital barony. Can be empty, can be owned by someone else +on_realm_capital_change = { + effect = { + holder ?= { + # Do we need to refresh their vizier's modifiers? + if = { + limit = { has_diarchy_parameter = diarchy_is_vizierate } + diarch = { + # What we're doing here is regenerating loc on the diarchs that might refer to a specific place which they no longer have access to. + ## This is gonna get real gross, folks, so my apologies. + if = { + limit = { has_character_modifier = vizier_extravagance_t1_treasure_modifier } + remove_character_modifier = vizier_extravagance_t1_treasure_modifier + add_character_modifier = { + modifier = vizier_extravagance_t1_treasure_modifier + desc = vizier_extravagance_t1_treasure_modifier_custom_desc.on_action + } + } + if = { + limit = { has_character_modifier = vizier_extravagance_t1_activities_modifier } + remove_character_modifier = vizier_extravagance_t1_activities_modifier + add_character_modifier = { + modifier = vizier_extravagance_t1_activities_modifier + desc = vizier_extravagance_t1_activities_modifier_custom_desc.on_action + } + } + if = { + limit = { has_character_modifier = vizier_extravagance_t1_property_modifier } + remove_character_modifier = vizier_extravagance_t1_property_modifier + add_character_modifier = { + modifier = vizier_extravagance_t1_property_modifier + desc = vizier_extravagance_t1_property_modifier_custom_desc.on_action + } + } + if = { + limit = { has_character_modifier = vizier_extravagance_t1_charity_modifier } + remove_character_modifier = vizier_extravagance_t1_charity_modifier + add_character_modifier = { + modifier = vizier_extravagance_t1_charity_modifier + desc = vizier_extravagance_t1_charity_modifier_custom_desc.on_action + } + } + if = { + limit = { has_character_modifier = vizier_extravagance_t2_treasure_modifier } + remove_character_modifier = vizier_extravagance_t2_treasure_modifier + add_character_modifier = { + modifier = vizier_extravagance_t2_treasure_modifier + desc = vizier_extravagance_t2_treasure_modifier_custom_desc.on_action + } + } + if = { + limit = { has_character_modifier = vizier_extravagance_t2_activities_modifier } + remove_character_modifier = vizier_extravagance_t2_activities_modifier + add_character_modifier = { + modifier = vizier_extravagance_t2_activities_modifier + desc = vizier_extravagance_t2_activities_modifier_custom_desc.on_action + } + } + if = { + limit = { has_character_modifier = vizier_extravagance_t2_property_modifier } + remove_character_modifier = vizier_extravagance_t2_property_modifier + add_character_modifier = { + modifier = vizier_extravagance_t2_property_modifier + desc = vizier_extravagance_t2_property_modifier_custom_desc.on_action + } + } + if = { + limit = { has_character_modifier = vizier_extravagance_t2_charity_modifier } + remove_character_modifier = vizier_extravagance_t2_charity_modifier + add_character_modifier = { + modifier = vizier_extravagance_t2_charity_modifier + desc = vizier_extravagance_t2_charity_modifier_custom_desc.on_action + } + } + if = { + limit = { has_character_modifier = vizier_extravagance_t3_treasure_modifier } + remove_character_modifier = vizier_extravagance_t3_treasure_modifier + add_character_modifier = { + modifier = vizier_extravagance_t3_treasure_modifier + desc = vizier_extravagance_t3_treasure_modifier_custom_desc.on_action + } + } + if = { + limit = { has_character_modifier = vizier_extravagance_t3_activities_modifier } + remove_character_modifier = vizier_extravagance_t3_activities_modifier + add_character_modifier = { + modifier = vizier_extravagance_t3_activities_modifier + desc = vizier_extravagance_t3_activities_modifier_custom_desc.on_action + } + } + if = { + limit = { has_character_modifier = vizier_extravagance_t3_property_modifier } + remove_character_modifier = vizier_extravagance_t3_property_modifier + add_character_modifier = { + modifier = vizier_extravagance_t3_property_modifier + desc = vizier_extravagance_t3_property_modifier_custom_desc.on_action + } + } + if = { + limit = { has_character_modifier = vizier_extravagance_t3_charity_modifier } + remove_character_modifier = vizier_extravagance_t3_charity_modifier + add_character_modifier = { + modifier = vizier_extravagance_t3_charity_modifier + desc = vizier_extravagance_t3_charity_modifier_custom_desc.on_action + } + } + if = { + limit = { has_character_modifier = vizier_extravagance_t4_treasure_modifier } + remove_character_modifier = vizier_extravagance_t4_treasure_modifier + add_character_modifier = { + modifier = vizier_extravagance_t4_treasure_modifier + desc = vizier_extravagance_t4_treasure_modifier_custom_desc.on_action + } + } + if = { + limit = { has_character_modifier = vizier_extravagance_t4_activities_modifier } + remove_character_modifier = vizier_extravagance_t4_activities_modifier + add_character_modifier = { + modifier = vizier_extravagance_t4_activities_modifier + desc = vizier_extravagance_t4_activities_modifier_custom_desc.on_action + } + } + if = { + limit = { has_character_modifier = vizier_extravagance_t4_property_modifier } + remove_character_modifier = vizier_extravagance_t4_property_modifier + add_character_modifier = { + modifier = vizier_extravagance_t4_property_modifier + desc = vizier_extravagance_t4_property_modifier_custom_desc.on_action + } + } + if = { + limit = { has_character_modifier = vizier_extravagance_t4_charity_modifier } + remove_character_modifier = vizier_extravagance_t4_charity_modifier + add_character_modifier = { + modifier = vizier_extravagance_t4_charity_modifier + desc = vizier_extravagance_t4_charity_modifier_custom_desc.on_action + } + } + } + } + } + } +} + +# Primary Title has changed +# root = character +# scope:previous_title = previous primary title held by character +# Not called if new primary title is the same as the previous primary title +on_primary_title_change = { +} diff --git a/common/scripted_effects/00_building_effects.txt b/common/scripted_effects/00_building_effects.txt new file mode 100644 index 00000000..b83464e9 --- /dev/null +++ b/common/scripted_effects/00_building_effects.txt @@ -0,0 +1,2978 @@ +##################################################################### +# EFFECT LIST +##################################################################### +# !!! Remember to add all new effects with a short description here !!! + +#add_next_building_tier_effect +#add_random_building_effect +#add_random_building_variable_effect + +##################################################################### +# EFFECTS +##################################################################### + +# Builds or upgrades the specified building, e.g. outposts +add_next_building_tier_effect = { + if = { + limit = { + NOT = { has_building_or_higher = $BUILDING$_01 } + } + add_building = $BUILDING$_01 + } + else_if = { + limit = { has_building = $BUILDING$_01 } + add_building = $BUILDING$_02 + } + else_if = { + limit = { has_building = $BUILDING$_02 } + add_building = $BUILDING$_03 + } + else_if = { + limit = { has_building = $BUILDING$_03 } + add_building = $BUILDING$_04 + } + else_if = { + limit = { has_building = $BUILDING$_04 } + add_building = $BUILDING$_05 + } + else_if = { + limit = { has_building = $BUILDING$_05 } + add_building = $BUILDING$_06 + } + else_if = { + limit = { has_building = $BUILDING$_06 } + add_building = $BUILDING$_07 + } + else_if = { + limit = { has_building = $BUILDING$_07 } + add_building = $BUILDING$_08 + } +} + +#### Create Random Building - 2 Part Effect #### + +# creates a random building in a holding, limited by innovations and holding level, and weighted to cheapest/lowest level, excludes tribal holdings/buildings, only for use in castle/church/city baronies + +# ensure the event/script where this is used checks that a building can be built, based on innovations and holding level, as if noe can be built this effect will do absolutely nada + +# 1, sets variable based on fitness of possible buildings +add_random_building_variable_effect = { # Province scope + province_owner = { save_scope_as = build_owner } + province_owner = { save_scope_as = holder } #Since building requirements reference scope:holder. + random_list = { # Which building? + # Generic/Terrain + 10 = { # outposts : Cheap + trigger = { + add_random_building_trigger = { BUILDING = outposts } # Generic eligiblity + generic_recruitment_building_innovations_trigger = { BUILDING = outposts } + } + set_variable = { + name = random_building_variable + value = 0 + days = 365 + } + } + 10 = { # logging_camps : Cheap + trigger = { + add_random_building_trigger = { BUILDING = logging_camps } + generic_economic_building_innovation_trigger = { BUILDING = logging_camps } + } + set_variable = { + name = random_building_variable + value = 1 + days = 365 + } + } + 10 = { # peat_quarries : Cheap + trigger = { + add_random_building_trigger = { BUILDING = peat_quarries } + generic_economic_building_innovation_trigger = { BUILDING = peat_quarries } + } + set_variable = { + name = random_building_variable + value = 2 + days = 365 + } + } + 10 = { # hill_forts : Cheap + trigger = { + add_random_building_trigger = { BUILDING = hill_forts } + generic_fortification_building_innovations_trigger = { BUILDING = hill_forts } + } + set_variable = { + name = random_building_variable + value = 3 + days = 365 + } + } + 10 = { # plantations : Cheap + trigger = { + add_random_building_trigger = { BUILDING = plantations } + generic_economic_building_innovation_trigger = { BUILDING = plantations } + } + set_variable = { + name = random_building_variable + value = 4 + days = 365 + } + } + 10 = { # quarries : Cheap + trigger = { + add_random_building_trigger = { BUILDING = quarries } + generic_economic_building_innovation_trigger = { BUILDING = quarries } + } + set_variable = { + name = random_building_variable + value = 5 + days = 365 + } + } + 10 = { # hunting_grounds : Cheap + trigger = { + add_random_building_trigger = { BUILDING = hunting_grounds } + generic_economic_building_innovation_trigger = { BUILDING = hunting_grounds } + } + set_variable = { + name = random_building_variable + value = 6 + days = 365 + } + } + 10 = { # military_camps : Cheap + trigger = { + add_random_building_trigger = { BUILDING = military_camps } + generic_recruitment_building_innovations_trigger = { BUILDING = military_camps } + } + set_variable = { + name = random_building_variable + value = 7 + days = 365 + } + } + 10 = { # horse_pastures : Cheap + trigger = { + add_random_building_trigger = { BUILDING = horse_pastures } + generic_recruitment_building_innovations_trigger = { BUILDING = horse_pastures } + } + set_variable = { + name = random_building_variable + value = 8 + days = 365 + } + } + 10 = { # hillside_grazing : Cheap + trigger = { + add_random_building_trigger = { BUILDING = hillside_grazing } + generic_recruitment_building_innovations_trigger = { BUILDING = hillside_grazing } + } + set_variable = { + name = random_building_variable + value = 9 + days = 365 + } + } + 10 = { # warrior_lodges : Cheap + trigger = { + add_random_building_trigger = { BUILDING = warrior_lodges } + generic_recruitment_building_innovations_trigger = { BUILDING = warrior_lodges } + } + set_variable = { + name = random_building_variable + value = 10 + days = 365 + } + } + 2 = { # pastures : Normal + trigger = { + add_random_building_trigger = { BUILDING = pastures } + generic_economic_building_innovation_trigger = { BUILDING = pastures } + } + set_variable = { + name = random_building_variable + value = 11 + days = 365 + } + } + 2 = { # ramparts : Normal + trigger = { + add_random_building_trigger = { BUILDING = ramparts } + generic_fortification_building_innovations_trigger = { BUILDING = ramparts } + } + set_variable = { + name = random_building_variable + value = 12 + days = 365 + } + } + 2 = { # curtain_walls : Normal + trigger = { + add_random_building_trigger = { BUILDING = curtain_walls } + generic_fortification_building_innovations_trigger = { BUILDING = curtain_walls } + } + set_variable = { + name = random_building_variable + value = 13 + days = 365 + } + } + 2 = { # watchtowers : Normal + trigger = { + add_random_building_trigger = { BUILDING = watchtowers } + generic_fortification_building_innovations_trigger = { BUILDING = watchtowers } + } + set_variable = { + name = random_building_variable + value = 14 + days = 365 + } + } + 2 = { # cereal_fields : Normal + trigger = { + add_random_building_trigger = { BUILDING = cereal_fields } + generic_economic_building_innovation_trigger = { BUILDING = cereal_fields } + } + set_variable = { + name = random_building_variable + value = 15 + days = 365 + } + } + 2 = { # barracks : Normal + trigger = { + add_random_building_trigger = { BUILDING = barracks } + generic_recruitment_building_innovations_trigger = { BUILDING = barracks } + } + set_variable = { + name = random_building_variable + value = 16 + days = 365 + } + } + 2 = { # camel_farms : Normal + trigger = { + add_random_building_trigger = { BUILDING = camel_farms } + generic_recruitment_building_innovations_trigger = { BUILDING = camel_farms } + } + set_variable = { + name = random_building_variable + value = 17 + days = 365 + } + } + 2 = { # hill_farms : Normal + trigger = { + add_random_building_trigger = { BUILDING = hill_farms } + generic_economic_building_innovation_trigger = { BUILDING = hill_farms } + } + set_variable = { + name = random_building_variable + value = 18 + days = 365 + } + } + 2 = { # elephant_pens : Normal + trigger = { + add_random_building_trigger = { BUILDING = elephant_pens } + generic_economic_building_innovation_trigger = { BUILDING = elephant_pens } + } + set_variable = { + name = random_building_variable + value = 19 + days = 365 + } + } + 2 = { # common_tradeport : Normal + trigger = { + add_random_building_trigger = { BUILDING = common_tradeport } + # Innovation triggers + trigger_if = { + limit = { has_building_or_higher = common_tradeport_01 } + scope:build_owner.culture = { + OR = { + has_innovation = innovation_crop_rotation + has_cultural_parameter = next_level_trade_ports + } + } + } + trigger_if = { + limit = { has_building_or_higher = common_tradeport_02 } + building_requirement_castle_city_church = { LEVEL = 02 } + scope:build_owner.culture = { + OR = { + has_innovation = innovation_manorialism + AND = { + has_innovation = innovation_crop_rotation + has_cultural_parameter = next_level_trade_ports + } + } + } + } + trigger_if = { + limit = { has_building_or_higher = common_tradeport_04 } + building_requirement_castle_city_church = { LEVEL = 03 } + scope:build_owner.culture = { + OR = { + has_innovation = innovation_windmills + AND = { + has_innovation = innovation_manorialism + has_cultural_parameter = next_level_trade_ports + } + } + } + } + trigger_if = { + limit = { has_building_or_higher = common_tradeport_06 } + building_requirement_castle_city_church = { LEVEL = 04 } + scope:build_owner.culture = { + OR = { + has_innovation = innovation_cranes + AND = { + has_innovation = innovation_windmills + has_cultural_parameter = next_level_trade_ports + } + } + } + } + } + set_variable = { + name = random_building_variable + value = 20 + days = 365 + } + } + 2 = { # hospices : Normal + trigger = { + add_random_building_trigger = { BUILDING = hospices } + generic_economic_building_innovation_trigger = { BUILDING = hospices } + } + set_variable = { + name = random_building_variable + value = 21 + days = 365 + } + } + 2 = { # qanats : Normal + trigger = { + add_random_building_trigger = { BUILDING = qanats } + building_requirement_castle_city_church = { LEVEL = 01 } + trigger_if = { + limit = { + NOT = { + has_building_or_higher = qanats_01 + } + } + scope:build_owner.culture = { + has_cultural_parameter = unlocks_qanat_building + } + } + trigger_if = { + limit = { + has_building_or_higher = qanats_02 + } + building_requirement_castle_city_church = { LEVEL = 02 } + } + trigger_if = { + limit = { + has_building_or_higher = qanats_04 + } + building_requirement_castle_city_church = { LEVEL = 03 } + } + trigger_if = { + limit = { + has_building_or_higher = qanats_06 + } + building_requirement_castle_city_church = { LEVEL = 04 } + } + } + set_variable = { + name = random_building_variable + value = 22 + days = 365 + } + } + 2 = { # murex_farm : Normal + trigger = { + add_random_building_trigger = { BUILDING = murex_farm } + building_requirement_castle_city_church = { LEVEL = 01 } + county = { NOT = { has_county_modifier = backwater_county_modifier } } + trigger_if = { + limit = { + has_building_or_higher = murex_farm_02 + } + building_requirement_castle_city_church = { LEVEL = 02 } + } + trigger_if = { + limit = { + has_building_or_higher = murex_farm_04 + } + building_requirement_castle_city_church = { LEVEL = 03 } + } + trigger_if = { + limit = { + has_building_or_higher = murex_farm_06 + } + building_requirement_castle_city_church = { LEVEL = 03 } + } + } + set_variable = { + name = random_building_variable + value = 23 + days = 365 + } + } + 2 = { # wind_furnace : Normal + trigger = { + add_random_building_trigger = { BUILDING = wind_furnace } + building_requirement_castle_city_church = { LEVEL = 01 } + trigger_if = { + limit = { + has_building_or_higher = wind_furnace_01 + } + scope:build_owner.culture = { + has_innovation = innovation_barracks + } + } + trigger_if = { + limit = { + has_building_or_higher = wind_furnace_02 + } + building_requirement_castle_city_church = { LEVEL = 02 } + scope:build_owner.culture = { + has_innovation = innovation_burhs + } + } + trigger_if = { + limit = { + has_building_or_higher = wind_furnace_04 + } + building_requirement_castle_city_church = { LEVEL = 03 } + scope:build_owner.culture = { + has_innovation = innovation_castle_baileys + } + } + trigger_if = { + limit = { + has_building_or_higher = wind_furnace_05 + } + scope:build_owner.culture = { + has_innovation = innovation_royal_armory + } + } + trigger_if = { + limit = { + has_building_or_higher = wind_furnace_06 + } + building_requirement_castle_city_church = { LEVEL = 04 } + } + } + set_variable = { + name = random_building_variable + value = 24 + days = 365 + } + } + 2 = { # stables : Normal + trigger = { + add_random_building_trigger = { BUILDING = stables } + generic_recruitment_building_innovations_trigger = { BUILDING = stables } + } + set_variable = { + name = random_building_variable + value = 25 + days = 365 + } + } + 2 = { # smiths : Normal + trigger = { + add_random_building_trigger = { BUILDING = smiths } + generic_recruitment_building_innovations_trigger = { BUILDING = smiths } + } + set_variable = { + name = random_building_variable + value = 26 + days = 365 + } + } + 1 = { # orchards : Expensive + trigger = { + add_random_building_trigger = { BUILDING = orchards } + generic_economic_building_innovation_trigger = { BUILDING = orchards } + } + set_variable = { + name = random_building_variable + value = 27 + days = 365 + } + } + 1 = { # farm_estates : Expensive + trigger = { + add_random_building_trigger = { BUILDING = farm_estates } + generic_economic_building_innovation_trigger = { BUILDING = farm_estates } + } + set_variable = { + name = random_building_variable + value = 28 + days = 365 + } + } + 1 = { # regimental_grounds : Expensive + trigger = { + add_random_building_trigger = { BUILDING = regimental_grounds } + generic_recruitment_building_innovations_trigger = { BUILDING = regimental_grounds } + } + set_variable = { + name = random_building_variable + value = 29 + days = 365 + } + } + 1 = { # caravanserai : Expensive + trigger = { + is_county_capital = yes + building_caravanserai_requirement_terrain = yes + scope:build_owner.culture = { + has_innovation = innovation_guilds + } + building_requirement_castle_city_church = { LEVEL = 01 } + trigger_if = { # if all slots are full, this building type exists already + limit = { free_building_slots = 0 } + has_building_or_higher = caravanserai_01 + } + trigger_if = { + limit = { has_building_or_higher = caravanserai_01 } + NOT = { + has_lesser_building_trigger = { COMPARE = caravanserai } + } + } + # City level triggers + trigger_if = { + limit = { has_building_or_higher = caravanserai_02 } + building_requirement_castle_city_church = { LEVEL = 02 } + } + trigger_if = { + limit = { has_building_or_higher = caravanserai_04 } + building_requirement_castle_city_church = { LEVEL = 03 } + } + trigger_if = { + limit = { has_building_or_higher = caravanserai_05 } + scope:build_owner.culture = { has_innovation = innovation_cranes } + } + trigger_if = { + limit = { has_building_or_higher = caravanserai_06 } + building_requirement_castle_city_church = { LEVEL = 04 } + } + } + set_variable = { + name = random_building_variable + value = 30 + days = 365 + } + } + 1 = { # watermills : Expensive + trigger = { + is_county_capital = yes + building_watermills_requirement_terrain = yes + scope:build_owner.culture = { + has_innovation = innovation_windmills + } + building_requirement_castle_city_church = { LEVEL = 01 } + trigger_if = { # if all slots are full, this building type exists already + limit = { free_building_slots = 0 } + has_building_or_higher = watermills_01 + } + trigger_if = { + limit = { has_building_or_higher = watermills_01 } + NOT = { + has_lesser_building_trigger = { COMPARE = watermills } + } + } + # City level triggers + trigger_if = { + limit = { has_building_or_higher = watermills_02 } + building_requirement_castle_city_church = { LEVEL = 02 } + } + trigger_if = { + limit = { has_building_or_higher = watermills_04 } + building_requirement_castle_city_church = { LEVEL = 03 } + } + trigger_if = { + limit = { has_building_or_higher = watermills_05 } + scope:build_owner.culture = { has_innovation = innovation_cranes } + } + trigger_if = { + limit = { has_building_or_higher = watermills_06 } + building_requirement_castle_city_church = { LEVEL = 04 } + } + } + set_variable = { + name = random_building_variable + value = 31 + days = 365 + } + } + 1 = { # windmills : Expensive + trigger = { + is_county_capital = yes + building_windmills_requirement_terrain = yes + scope:build_owner.culture = { + has_innovation = innovation_windmills + } + building_requirement_castle_city_church = { LEVEL = 01 } + trigger_if = { # if all slots are full, this building type exists already + limit = { free_building_slots = 0 } + has_building_or_higher = windmills_01 + } + trigger_if = { + limit = { has_building_or_higher = windmills_01 } + NOT = { + has_lesser_building_trigger = { COMPARE = windmills } + } + } + # City level triggers + trigger_if = { + limit = { has_building_or_higher = windmills_02 } + building_requirement_castle_city_church = { LEVEL = 02 } + } + trigger_if = { + limit = { has_building_or_higher = windmills_04 } + building_requirement_castle_city_church = { LEVEL = 03 } + } + trigger_if = { + limit = { has_building_or_higher = windmills_05 } + scope:build_owner.culture = { has_innovation = innovation_cranes } + } + trigger_if = { + limit = { has_building_or_higher = windmills_06 } + building_requirement_castle_city_church = { LEVEL = 04 } + } + } + set_variable = { + name = random_building_variable + value = 32 + days = 365 + } + } + 1 = { # workshops : Expensive + trigger = { + add_random_building_trigger = { BUILDING = workshops } + building_requirement_castle_city_church = { LEVEL = 01 } + scope:build_owner.culture = { + has_innovation = innovation_advanced_bowmaking + } + trigger_if = { + limit = { + has_building_or_higher = workshops_02 + } + building_requirement_castle_city_church = { LEVEL = 02 } + } + trigger_if = { + limit = { + has_building_or_higher = workshops_04 + } + building_requirement_castle_city_church = { LEVEL = 03 } + } + trigger_if = { + limit = { + has_building_or_higher = workshops_05 + } + scope:build_owner.culture = { + has_innovation = innovation_royal_armory + } + } + trigger_if = { + limit = { + has_building_or_higher = workshops_06 + } + building_requirement_castle_city_church = { LEVEL = 04 } + } + } + set_variable = { + name = random_building_variable + value = 33 + days = 365 + } + } + # Holding Type Specific : Normal + 10 = { # monastic_schools : Normal + trigger = { + has_holding_type = church_holding + trigger_if = { # if all slots are full, this building type exists already + limit = { free_building_slots = 0 } + has_building_or_higher = monastic_schools_01 + } + trigger_if = { + limit = { has_building_or_higher = monastic_schools_01 } + NOT = { + has_lesser_building_trigger = { COMPARE = monastic_schools } + } + } + # Innovation triggers + trigger_if = { + limit = { has_building_or_higher = monastic_schools_01 } + scope:build_owner.culture = { has_innovation = innovation_city_planning } + } + trigger_if = { + limit = { has_building_or_higher = monastic_schools_02 } + building_requirement_castle_city_church = { LEVEL = 02 } + scope:build_owner.culture = { has_innovation = innovation_manorialism } + } + trigger_if = { + limit = { has_building_or_higher = monastic_schools_04 } + building_requirement_castle_city_church = { LEVEL = 03 } + scope:build_owner.culture = { has_innovation = innovation_windmills } + } + trigger_if = { + limit = { has_building_or_higher = monastic_schools_06 } + building_requirement_castle_city_church = { LEVEL = 04 } + scope:build_owner.culture = { has_innovation = innovation_cranes } + } + } + set_variable = { + name = random_building_variable + value = 34 + days = 365 + } + } + 10 = { # guild_halls : Normal + trigger = { + has_holding_type = city_holding + trigger_if = { # if all slots are full, this building type exists already + limit = { free_building_slots = 0 } + has_building_or_higher = guild_halls_01 + } + trigger_if = { + limit = { has_building_or_higher = guild_halls_01 } + NOT = { + has_lesser_building_trigger = { COMPARE = guild_halls } + } + } + # Innovation triggers + trigger_if = { + limit = { has_building_or_higher = guild_halls_01 } + scope:build_owner.culture = { + OR = { + has_innovation = innovation_crop_rotation + has_cultural_parameter = next_level_guild_halls + } + } + } + trigger_if = { + limit = { has_building_or_higher = guild_halls_02 } + OR = { + AND = { + building_requirement_castle_city_church = { LEVEL = 02 } + scope:build_owner.culture = { + has_innovation = innovation_manorialism + } + } + scope:build_owner.culture = { + has_cultural_parameter = next_level_guild_halls + has_innovation = innovation_crop_rotation + } + } + } + trigger_if = { + limit = { has_building_or_higher = guild_halls_04 } + OR = { + AND = { + building_requirement_castle_city_church = { LEVEL = 03 } + scope:build_owner.culture = { + has_innovation = innovation_guilds + } + } + AND = { + building_requirement_castle_city_church = { LEVEL = 02 } + scope:build_owner.culture = { + has_cultural_parameter = next_level_guild_halls + has_innovation = innovation_manorialism + } + } + } + } + trigger_if = { + limit = { has_building_or_higher = guild_halls_06 } + OR = { + AND = { + building_requirement_castle_city_church = { LEVEL = 04 } + scope:build_owner.culture = { + has_innovation = innovation_cranes + } + } + AND = { + building_requirement_castle_city_church = { LEVEL = 03 } + scope:build_owner.culture = { + has_cultural_parameter = next_level_guild_halls + has_innovation = innovation_guilds + } + } + } + } + } + set_variable = { + name = random_building_variable + value = 35 + days = 365 + } + } + 10 = { # scriptorium : Normal + trigger = { + has_holding_type = church_holding + scope:build_owner = { + has_dlc_feature = legends + } + trigger_if = { # if all slots are full, this building type exists already + limit = { free_building_slots = 0 } + has_building_or_higher = scriptorium_01 + } + trigger_if = { + limit = { has_building_or_higher = scriptorium_01 } + NOT = { + has_lesser_building_trigger = { COMPARE = scriptorium } + } + } + generic_economic_building_innovation_trigger = { BUILDING = scriptorium } + } + set_variable = { + name = random_building_variable + value = 36 + days = 365 + } + } + 10 = { # megalith : Normal + trigger = { + has_holding_type = church_holding + scope:build_owner.faith = { + has_doctrine_parameter = can_build_megaliths + } + trigger_if = { # if all slots are full, this building type exists already + limit = { free_building_slots = 0 } + has_building_or_higher = megalith_01 + } + trigger_if = { + limit = { has_building_or_higher = megalith_01 } + NOT = { + has_lesser_building_trigger = { COMPARE = megalith } + } + } + trigger_if = { + limit = { has_building_or_higher = megalith_02 } + scope:build_owner.culture = { + has_innovation = innovation_city_planning + } + } + trigger_if = { + limit = { has_building_or_higher = megalith_03 } + building_requirement_castle_city_church = { LEVEL = 02 } + } + } + set_variable = { + name = random_building_variable + value = 37 + days = 365 + } + } + 2 = { # waterworks : Normal + trigger = { + add_random_building_trigger = { BUILDING = waterworks } + building_requirement_castle_city_church = { LEVEL = 01 } + county = { NOT = { has_county_modifier = backwater_county_modifier } } + trigger_if = { + limit = { + has_building_or_higher = waterworks_02 + } + building_requirement_castle_city_church = { LEVEL = 02 } + } + trigger_if = { + limit = { + has_building_or_higher = waterworks_04 + } + building_requirement_castle_city_church = { LEVEL = 03 } + } + trigger_if = { + limit = { + has_building_or_higher = waterworks_06 + } + building_requirement_castle_city_church = { LEVEL = 03 } + } + } + set_variable = { + name = random_building_variable + value = 42 + days = 365 + } + } + 2 = { # paddy_fields : Normal + trigger = { + add_random_building_trigger = { BUILDING = paddy_fields } + generic_economic_building_innovation_trigger = { BUILDING = paddy_fields } + } + set_variable = { + name = random_building_variable + value = 43 + days = 365 + } + } + } +} + +# 2, builds based on variable +add_random_building_construct_effect = { # Province scope + if = { + limit = { has_variable = random_building_variable } + switch = { + trigger = var:random_building_variable + 0 = { + add_next_building_tier_effect = { BUILDING = outposts } + } + 1 = { + add_next_building_tier_effect = { BUILDING = logging_camps } + } + 2 = { + add_next_building_tier_effect = { BUILDING = peat_quarries } + } + 3 = { + add_next_building_tier_effect = { BUILDING = hill_forts } + } + 4 = { + add_next_building_tier_effect = { BUILDING = plantations } + } + 5 = { + add_next_building_tier_effect = { BUILDING = quarries } + } + 6 = { + add_next_building_tier_effect = { BUILDING = hunting_grounds } + } + 7 = { + add_next_building_tier_effect = { BUILDING = military_camps } + } + 8 = { + add_next_building_tier_effect = { BUILDING = horse_pastures } + } + 9 = { + add_next_building_tier_effect = { BUILDING = hillside_grazing } + } + 10 = { + add_next_building_tier_effect = { BUILDING = warrior_lodges } + } + 11 = { + add_next_building_tier_effect = { BUILDING = pastures } + } + 12 = { + add_next_building_tier_effect = { BUILDING = ramparts } + } + 13 = { + add_next_building_tier_effect = { BUILDING = curtain_walls } + } + 14 = { + add_next_building_tier_effect = { BUILDING = watchtowers } + } + 15 = { + add_next_building_tier_effect = { BUILDING = cereal_fields } + } + 16 = { + add_next_building_tier_effect = { BUILDING = barracks } + } + 17 = { + add_next_building_tier_effect = { BUILDING = camel_farms } + } + 18 = { + add_next_building_tier_effect = { BUILDING = hill_farms } + } + 19 = { + add_next_building_tier_effect = { BUILDING = elephant_pens } + } + 20 = { + add_next_building_tier_effect = { BUILDING = common_tradeport } + } + 21 = { + add_next_building_tier_effect = { BUILDING = hospices } + } + 22 = { + add_next_building_tier_effect = { BUILDING = qanats } + } + 23 = { + add_next_building_tier_effect = { BUILDING = murex_farm } + } + 24 = { + add_next_building_tier_effect = { BUILDING = wind_furnace } + } + 25 = { + add_next_building_tier_effect = { BUILDING = stables } + } + 26 = { + add_next_building_tier_effect = { BUILDING = smiths } + } + 27 = { + add_next_building_tier_effect = { BUILDING = orchards } + } + 28 = { + add_next_building_tier_effect = { BUILDING = farm_estates } + } + 29 = { + add_next_building_tier_effect = { BUILDING = regimental_grounds } + } + 30 = { + add_next_building_tier_effect = { BUILDING = caravanserai } + } + 31 = { + add_next_building_tier_effect = { BUILDING = windmills } + } + 32 = { + add_next_building_tier_effect = { BUILDING = watermills } + } + 33 = { + add_next_building_tier_effect = { BUILDING = workshops } + } + 34 = { + add_next_building_tier_effect = { BUILDING = monastic_schools } + } + 35 = { + add_next_building_tier_effect = { BUILDING = guild_halls } + } + 36 = { + add_next_building_tier_effect = { BUILDING = scriptorium } + } + 37 = { + add_next_building_tier_effect = { BUILDING = megalith } + } + 42 = { + add_next_building_tier_effect = { BUILDING = waterworks } + } + 43 = { + add_next_building_tier_effect = { BUILDING = paddy_fields } + } + } + remove_variable = random_building_variable + } +} + +# For stuff that has exactly _eight_ levels of upgrades. +destroy_or_downgrade_building_effect = { + if = { + limit = { has_building = $BUILDING$_08 } + remove_building = $BUILDING$_08 + hidden_effect = { add_building = $BUILDING$_07 } + } + else_if = { + limit = { has_building = $BUILDING$_07 } + remove_building = $BUILDING$_07 + hidden_effect = { add_building = $BUILDING$_06 } + } + else_if = { + limit = { has_building = $BUILDING$_06 } + remove_building = $BUILDING$_06 + hidden_effect = { add_building = $BUILDING$_05 } + } + else_if = { + limit = { has_building = $BUILDING$_05 } + remove_building = $BUILDING$_05 + hidden_effect = { add_building = $BUILDING$_04 } + } + else_if = { + limit = { has_building = $BUILDING$_04 } + remove_building = $BUILDING$_04 + hidden_effect = { add_building = $BUILDING$_03 } + } + else_if = { + limit = { has_building = $BUILDING$_03 } + remove_building = $BUILDING$_03 + hidden_effect = { add_building = $BUILDING$_02 } + } + else_if = { + limit = { has_building = $BUILDING$_02 } + remove_building = $BUILDING$_02 + hidden_effect = { add_building = $BUILDING$_01 } + } + else = { remove_building = $BUILDING$_01 } +} + +# For stuff that has exactly _three_ levels of upgrades. +destroy_or_downgrade_ducal_building_effect = { + if = { + limit = { has_building = $BUILDING$_03 } + remove_building = $BUILDING$_03 + hidden_effect = { add_building = $BUILDING$_02 } + } + else_if = { + limit = { has_building = $BUILDING$_02 } + remove_building = $BUILDING$_02 + hidden_effect = { add_building = $BUILDING$_01 } + } + else = { remove_building = $BUILDING$_01 } +} + +# For stuff that has exactly _two_ levels of upgrades. +destroy_or_downgrade_tribal_building_effect = { + if = { + limit = { has_building = $BUILDING$_02 } + remove_building = $BUILDING$_02 + hidden_effect = { add_building = $BUILDING$_01 } + } + else = { remove_building = $BUILDING$_01 } +} + +destroy_random_building_variable_effect = { # Province scope + save_scope_as = raid_province + if = { + limit = { has_variable = destroyed_building_variable } + remove_variable = destroyed_building_variable + } + random_list = { # Which building? + # Generic/Terrain + 10 = { # outposts : Cheap + trigger = { has_building_or_higher = outposts_01 } + set_variable = { + name = destroyed_building_variable + value = 0 + months = 1 + } + } + 10 = { # logging_camps : Cheap + trigger = { has_building_or_higher = logging_camps_01 } + set_variable = { + name = destroyed_building_variable + value = 1 + months = 1 + } + } + 10 = { # peat_quarries : Cheap + trigger = { has_building_or_higher = peat_quarries_01 } + set_variable = { + name = destroyed_building_variable + value = 2 + months = 1 + } + } + 10 = { # hill_forts : Cheap + trigger = { has_building_or_higher = hill_forts_01 } + set_variable = { + name = destroyed_building_variable + value = 3 + months = 1 + } + } + 10 = { # plantations : Cheap + trigger = { has_building_or_higher = plantations_01 } + set_variable = { + name = destroyed_building_variable + value = 4 + months = 1 + } + } + 10 = { # quarries : Cheap + trigger = { has_building_or_higher = quarries_01 } + set_variable = { + name = destroyed_building_variable + value = 5 + months = 1 + } + } + 10 = { # hunting_grounds : Cheap + trigger = { has_building_or_higher = hunting_grounds_01 } + set_variable = { + name = destroyed_building_variable + value = 6 + months = 1 + } + } + 10 = { # military_camps : Cheap + trigger = { has_building_or_higher = military_camps_01 } + set_variable = { + name = destroyed_building_variable + value = 7 + months = 1 + } + } + 10 = { # horse_pastures : Cheap + trigger = { has_building_or_higher = horse_pastures_01 } + set_variable = { + name = destroyed_building_variable + value = 8 + months = 1 + } + } + 10 = { # hillside_grazing : Cheap + trigger = { has_building_or_higher = hillside_grazing_01 } + set_variable = { + name = destroyed_building_variable + value = 9 + months = 1 + } + } + 10 = { # warrior_lodges : Cheap + trigger = { has_building_or_higher = warrior_lodges_01 } + set_variable = { + name = destroyed_building_variable + value = 10 + months = 1 + } + } + 2 = { # pastures : Normal + trigger = { has_building_or_higher = pastures_01 } + set_variable = { + name = destroyed_building_variable + value = 11 + months = 1 + } + } + 2 = { # ramparts : Normal + trigger = { has_building_or_higher = ramparts_01 } + set_variable = { + name = destroyed_building_variable + value = 12 + months = 1 + } + } + 2 = { # curtain_walls : Normal + trigger = { has_building_or_higher = curtain_walls_01 } + set_variable = { + name = destroyed_building_variable + value = 13 + months = 1 + } + } + 2 = { # watchtowers : Normal + trigger = { has_building_or_higher = watchtowers_01 } + set_variable = { + name = destroyed_building_variable + value = 14 + months = 1 + } + } + 2 = { # cereal_fields : Normal + trigger = { has_building_or_higher = cereal_fields_01 } + set_variable = { + name = destroyed_building_variable + value = 15 + months = 1 + } + } + 2 = { # barracks : Normal + trigger = { has_building_or_higher = barracks_01 } + set_variable = { + name = destroyed_building_variable + value = 16 + months = 1 + } + } + 2 = { # camel_farms : Normal + trigger = { has_building_or_higher = camel_farms_01 } + set_variable = { + name = destroyed_building_variable + value = 17 + months = 1 + } + } + 2 = { # hill_farms : Normal + trigger = { has_building_or_higher = hill_farms_01 } + set_variable = { + name = destroyed_building_variable + value = 18 + months = 1 + } + } + 2 = { # paddy_fields : Normal + trigger = { has_building_or_higher = hill_farms_01 } + set_variable = { + name = destroyed_building_variable + value = 43 + months = 1 + } + } + 2 = { # elephant_pens : Normal + trigger = { has_building_or_higher = elephant_pens_01 } + set_variable = { + name = destroyed_building_variable + value = 19 + months = 1 + } + } + 2 = { # common_tradeport : Normal + trigger = { has_building_or_higher = common_tradeport_01 } + set_variable = { + name = destroyed_building_variable + value = 20 + months = 1 + } + } + 2 = { # hospices : Normal + trigger = { has_building_or_higher = hospices_01 } + set_variable = { + name = destroyed_building_variable + value = 21 + months = 1 + } + } + 2 = { # qanats : Normal + trigger = { has_building_or_higher = qanats_01 } + set_variable = { + name = destroyed_building_variable + value = 22 + months = 1 + } + } + 2 = { # murex_farm : Normal + trigger = { has_building_or_higher = murex_farm_01 } + set_variable = { + name = destroyed_building_variable + value = 23 + months = 1 + } + } + 2 = { # waterworks : Normal + trigger = { has_building_or_higher = waterworks_01 } + set_variable = { + name = destroyed_building_variable + value = 42 + months = 1 + } + } + 2 = { # wind_furnace : Normal + trigger = { has_building_or_higher = wind_furnace_01 } + set_variable = { + name = destroyed_building_variable + value = 24 + months = 1 + } + } + 2 = { # stables : Normal + trigger = { has_building_or_higher = stables_01 } + set_variable = { + name = destroyed_building_variable + value = 25 + months = 1 + } + } + 2 = { # smiths : Normal + trigger = { has_building_or_higher = smiths_01 } + set_variable = { + name = destroyed_building_variable + value = 26 + months = 1 + } + } + 1 = { # orchards : Expensive + trigger = { has_building_or_higher = orchards_01 } + set_variable = { + name = destroyed_building_variable + value = 27 + months = 1 + } + } + 1 = { # farm_estates : Expensive + trigger = { has_building_or_higher = farm_estates_01 } + set_variable = { + name = destroyed_building_variable + value = 28 + months = 1 + } + } + 1 = { # regimental_grounds : Expensive + trigger = { has_building_or_higher = regimental_grounds_01 } + set_variable = { + name = destroyed_building_variable + value = 29 + months = 1 + } + } + 1 = { # caravanserai : Expensive + trigger = { has_building_or_higher = caravanserai_01 } + set_variable = { + name = destroyed_building_variable + value = 30 + months = 1 + } + } + 1 = { # watermills : Expensive + trigger = { has_building_or_higher = watermills_01 } + set_variable = { + name = destroyed_building_variable + value = 31 + months = 1 + } + } + 1 = { # windmills : Expensive + trigger = { has_building_or_higher = windmills_01 } + set_variable = { + name = destroyed_building_variable + value = 32 + months = 1 + } + } + 1 = { # workshops : Expensive + trigger = { has_building_or_higher = workshops_01 } + set_variable = { + name = destroyed_building_variable + value = 33 + months = 1 + } + } + # Holding Type Specific : Normal + 10 = { # monastic_schools : Normal + trigger = { has_building_or_higher = monastic_schools_01 } + set_variable = { + name = destroyed_building_variable + value = 21 + months = 1 + } + } + 10 = { # guild_halls : Normal + trigger = { has_building_or_higher = guild_halls_01 } + set_variable = { + name = destroyed_building_variable + value = 35 + months = 1 + } + } + 10 = { # scriptorium : Normal + trigger = { has_building_or_higher = scriptorium_01 } + set_variable = { + name = destroyed_building_variable + value = 36 + months = 1 + } + } + 10 = { # megalith : Normal + trigger = { has_building_or_higher = megalith_01 } + set_variable = { + name = destroyed_building_variable + value = 37 + months = 1 + } + } + 10 = { # Waterworks + trigger = { has_building_or_higher = waterworks_01 } + set_variable = { + name = destroyed_building_variable + value = 42 + months = 1 + } + } + 10 = { # Paddy Fields + trigger = { has_building_or_higher = paddy_fields_01 } + set_variable = { + name = destroyed_building_variable + value = 43 + months = 1 + } + } + # Tribal + 10 = { # Market Villages + trigger = { has_building_or_higher = market_villages_01 } + set_variable = { + name = destroyed_building_variable + value = 38 + months = 1 + } + } + 10 = { # Palisades + trigger = { has_building_or_higher = palisades_01 } + set_variable = { + name = destroyed_building_variable + value = 39 + months = 1 + } + } + 10 = { # War Camps + trigger = { has_building_or_higher = war_camps_01 } + set_variable = { + name = destroyed_building_variable + value = 40 + months = 1 + } + } + 10 = { # Longhouses + trigger = { has_building_or_higher = longhouses_01 } + set_variable = { + name = destroyed_building_variable + value = 41 + months = 1 + } + } + } +} + +destroy_random_building_effect = { + if = { + limit = { has_variable = destroyed_building_variable } + switch = { + trigger = var:destroyed_building_variable + 0 = { # outposts : Cheap + destroy_or_downgrade_building_effect = { BUILDING = outposts } + } + 1 = { # logging_camps : Cheap + destroy_or_downgrade_building_effect = { BUILDING = logging_camps } + } + 2 = { # peat_quarries : Cheap + destroy_or_downgrade_building_effect = { BUILDING = peat_quarries } + } + 3 = { # hill_forts : Cheap + destroy_or_downgrade_building_effect = { BUILDING = hill_forts } + } + 4 = { # plantations : Cheap + destroy_or_downgrade_building_effect = { BUILDING = plantations } + } + 5 = { # quarries : Cheap + destroy_or_downgrade_building_effect = { BUILDING = quarries } + } + 6 = { # hunting_grounds : Cheap + destroy_or_downgrade_building_effect = { BUILDING = hunting_grounds } + } + 7 = { # military_camps : Cheap + destroy_or_downgrade_building_effect = { BUILDING = military_camps } + } + 8 = { # horse_pastures : Cheap + destroy_or_downgrade_building_effect = { BUILDING = horse_pastures } + } + 9 = { # hillside_grazing : Cheap + destroy_or_downgrade_building_effect = { BUILDING = hillside_grazing } + } + 10 = { # warrior_lodges : Cheap + destroy_or_downgrade_building_effect = { BUILDING = warrior_lodges } + } + 11 = { # pastures : Normal + destroy_or_downgrade_building_effect = { BUILDING = pastures } + } + 12 = { # ramparts : Normal + destroy_or_downgrade_building_effect = { BUILDING = ramparts } + } + 13 = { # curtain_walls : Normal + destroy_or_downgrade_building_effect = { BUILDING = curtain_walls } + } + 14 = { # watchtowers : Normal + destroy_or_downgrade_building_effect = { BUILDING = watchtowers } + } + 15 = { # cereal_fields : Normal + destroy_or_downgrade_building_effect = { BUILDING = cereal_fields } + } + 16 = { # barracks : Normal + destroy_or_downgrade_building_effect = { BUILDING = barracks } + } + 17 = { # camel_farms : Normal + destroy_or_downgrade_building_effect = { BUILDING = camel_farms } + } + 18 = { # hill_farms : Normal + destroy_or_downgrade_building_effect = { BUILDING = hill_farms } + } + 19 = { # elephant_pens : Normal + destroy_or_downgrade_building_effect = { BUILDING = elephant_pens } + } + 20 = { # common_tradeport : Normal + destroy_or_downgrade_building_effect = { BUILDING = common_tradeport } + } + 21 = { # hospices : Normal + destroy_or_downgrade_building_effect = { BUILDING = hospices } + } + 22 = { # qanats : Normal + destroy_or_downgrade_building_effect = { BUILDING = qanats } + } + 23 = { # murex_farm : Normal + destroy_or_downgrade_building_effect = { BUILDING = murex_farm } + } + 24 = { # wind_furnace : Normal + destroy_or_downgrade_building_effect = { BUILDING = wind_furnace } + } + 25 = { # stables : Normal + destroy_or_downgrade_building_effect = { BUILDING = stables } + } + 26 = { # smiths : Normal + destroy_or_downgrade_building_effect = { BUILDING = smiths } + } + 27 = { # orchards : Expensive + destroy_or_downgrade_building_effect = { BUILDING = orchards } + } + 28 = { # farm_estates : Expensive + destroy_or_downgrade_building_effect = { BUILDING = farm_estates } + } + 29 = { # regimental_grounds : Expensive + destroy_or_downgrade_building_effect = { BUILDING = regimental_grounds } + } + 30 = { # caravanserai : Expensive + destroy_or_downgrade_building_effect = { BUILDING = caravanserai } + } + 31 = { # watermills : Expensive + destroy_or_downgrade_building_effect = { BUILDING = watermills } + } + 32 = { # windmills : Expensive + destroy_or_downgrade_building_effect = { BUILDING = windmills } + } + 33 = { # workshops : Expensive + destroy_or_downgrade_building_effect = { BUILDING = workshops } + } + # Holding Type Specific : Normal + 34 = { # monastic_schools : Normal + destroy_or_downgrade_building_effect = { BUILDING = monastic_schools } + } + 35 = { # guild_halls : Normal + destroy_or_downgrade_building_effect = { BUILDING = guild_halls } + } + 36 = { # scriptorium : Normal + destroy_or_downgrade_building_effect = { BUILDING = scriptorium } + } + 37 = { # megalith : Normal + destroy_or_downgrade_building_effect = { BUILDING = megalith } + } + 42 = { # waterworks : Normal + destroy_or_downgrade_building_effect = { BUILDING = waterworks } + } + 43 = { # paddy_fields : Normal + destroy_or_downgrade_building_effect = { BUILDING = paddy_fields } + } + # Tribal + 38 = { # megalith : Normal + destroy_or_downgrade_tribal_building_effect = { BUILDING = market_villages } + } + 39 = { # megalith : Normal + destroy_or_downgrade_tribal_building_effect = { BUILDING = palisades } + } + 40 = { # megalith : Normal + destroy_or_downgrade_tribal_building_effect = { BUILDING = war_camps } + } + 41 = { # megalith : Normal + destroy_or_downgrade_tribal_building_effect = { BUILDING = longhouses } + } + } + remove_variable = destroyed_building_variable + } +} + +destroy_or_downgrade_estate_building_2_effect = { + if = { + limit = { has_domicile_building = $BUILDING$_02 } + lower_domicile_building_no_refund = $BUILDING$_02 + } + else = { remove_domicile_building_no_refund = $BUILDING$_01 } +} + +destroy_or_downgrade_estate_building_3_effect = { + if = { + limit = { has_domicile_building = $BUILDING$_03 } + lower_domicile_building_no_refund = $BUILDING$_03 + } + else_if = { + limit = { has_domicile_building = $BUILDING$_02 } + lower_domicile_building_no_refund = $BUILDING$_02 + } + else = { remove_domicile_building_no_refund = $BUILDING$_01 } +} + +destroy_or_downgrade_estate_building_4_effect = { + if = { + limit = { has_domicile_building = $BUILDING$_04 } + lower_domicile_building_no_refund = $BUILDING$_04 + } + else_if = { + limit = { has_domicile_building = $BUILDING$_03 } + lower_domicile_building_no_refund = $BUILDING$_03 + } + else_if = { + limit = { has_domicile_building = $BUILDING$_02 } + lower_domicile_building_no_refund = $BUILDING$_02 + } + else = { remove_domicile_building_no_refund = $BUILDING$_01 } +} + +destroy_or_downgrade_estate_building_5_effect = { + if = { + limit = { has_domicile_building = $BUILDING$_05 } + lower_domicile_building_no_refund = $BUILDING$_05 + } + else_if = { + limit = { has_domicile_building = $BUILDING$_04 } + lower_domicile_building_no_refund = $BUILDING$_04 + } + else_if = { + limit = { has_domicile_building = $BUILDING$_03 } + lower_domicile_building_no_refund = $BUILDING$_03 + } + else_if = { + limit = { has_domicile_building = $BUILDING$_02 } + lower_domicile_building_no_refund = $BUILDING$_02 + } + else = { remove_domicile_building_no_refund = $BUILDING$_01 } +} + +destroy_or_downgrade_estate_building_6_effect = { + if = { + limit = { has_domicile_building = $BUILDING$_06 } + lower_domicile_building_no_refund = $BUILDING$_06 + } + if = { + limit = { has_domicile_building = $BUILDING$_05 } + lower_domicile_building_no_refund = $BUILDING$_05 + } + if = { + limit = { has_domicile_building = $BUILDING$_04 } + lower_domicile_building_no_refund = $BUILDING$_04 + } + if = { + limit = { has_domicile_building = $BUILDING$_03 } + lower_domicile_building_no_refund = $BUILDING$_03 + } + else_if = { + limit = { has_domicile_building = $BUILDING$_02 } + lower_domicile_building_no_refund = $BUILDING$_02 + } + else = { remove_domicile_building_no_refund = $BUILDING$_01 } +} + +destroy_or_downgrade_estate_building_2_4_replacement_effect = { + if = { + limit = { has_domicile_building = $BUILDING$_04 } + lower_domicile_building_no_refund = $BUILDING$_04 + } + else = { + lower_domicile_building_no_refund = $BUILDING$_03 + } +} + +destroy_or_downgrade_estate_building_2_6_replacement_effect = { + if = { + limit = { has_domicile_building = $BUILDING$_06 } + lower_domicile_building_no_refund = $BUILDING$_06 + } + else_if = { + limit = { has_domicile_building = $BUILDING$_05 } + lower_domicile_building_no_refund = $BUILDING$_05 + } + else_if = { + limit = { has_domicile_building = $BUILDING$_04 } + lower_domicile_building_no_refund = $BUILDING$_04 + } + else = { + lower_domicile_building_no_refund = $BUILDING$_03 + } +} + +destroy_or_downgrade_estate_building_3_6_replacement_effect = { + if = { + limit = { has_domicile_building = $BUILDING$_06 } + lower_domicile_building_no_refund = $BUILDING$_06 + } + else_if = { + limit = { has_domicile_building = $BUILDING$_05 } + lower_domicile_building_no_refund = $BUILDING$_05 + } + else = { + lower_domicile_building_no_refund = $BUILDING$_04 + } +} + +destroy_random_estate_building_variable_effect = { # Domicile scope + save_scope_as = raid_domicile + if = { + limit = { has_variable = destroyed_building_variable } + remove_variable = destroyed_building_variable + } + random_list = { # Which building? + # Generic/Terrain + 10 = { # barracks : Normal + trigger = { has_domicile_building_or_higher = barracks_01 } + set_variable = { + name = destroyed_building_variable + value = 0 + months = 1 + } + } + 10 = { # watchtower : Normal + trigger = { has_domicile_building_or_higher = watchtower_01 } + set_variable = { + name = destroyed_building_variable + value = 1 + months = 1 + } + } + 10 = { # guardhouse : Normal + trigger = { has_domicile_building_or_higher = guardhouse_01 } + set_variable = { + name = destroyed_building_variable + value = 2 + months = 1 + } + } + 10 = { # garden : Normal + trigger = { has_domicile_building_or_higher = garden_01 } + set_variable = { + name = destroyed_building_variable + value = 3 + months = 1 + } + } + 10 = { # stable : Normal + trigger = { has_domicile_building_or_higher = stable_01 } + set_variable = { + name = destroyed_building_variable + value = 4 + months = 1 + } + } + 10 = { # workshop : Normal + trigger = { has_domicile_building_or_higher = workshop_01 } + set_variable = { + name = destroyed_building_variable + value = 5 + months = 1 + } + } + 10 = { # storage : Normal + trigger = { has_domicile_building_or_higher = storage_01 } + set_variable = { + name = destroyed_building_variable + value = 6 + months = 1 + } + } + 10 = { # market : Normal + trigger = { has_domicile_building_or_higher = market_01 } + set_variable = { + name = destroyed_building_variable + value = 7 + months = 1 + } + } + 10 = { # grazing_land : Normal + trigger = { has_domicile_building_or_higher = grazing_land_01 } + set_variable = { + name = destroyed_building_variable + value = 8 + months = 1 + } + } + 10 = { # grain_field : Normal + trigger = { has_domicile_building_or_higher = grain_field_01 } + set_variable = { + name = destroyed_building_variable + value = 9 + months = 1 + } + } + 10 = { # living_quarters : Normal + trigger = { has_domicile_building_or_higher = living_quarters_01 } + set_variable = { + name = destroyed_building_variable + value = 10 + months = 1 + } + } + 10 = { # vineyard : Normal + trigger = { has_domicile_building_or_higher = vineyard_01 } + set_variable = { + name = destroyed_building_variable + value = 11 + months = 1 + } + } + 10 = { # olive : Normal + trigger = { has_domicile_building_or_higher = olive_01 } + set_variable = { + name = destroyed_building_variable + value = 12 + months = 1 + } + } + 10 = { # temple : Normal + trigger = { has_domicile_building_or_higher = temple_small_01 } + set_variable = { + name = destroyed_building_variable + value = 13 + months = 1 + } + } + 10 = { # grand_solar : Normal + trigger = { has_domicile_building_or_higher = grand_solar_01 } + set_variable = { + name = destroyed_building_variable + value = 14 + months = 1 + } + } + 10 = { # cabinet_of_curiosities : Normal + trigger = { has_domicile_building_or_higher = cabinet_of_curiosities_01 } + set_variable = { + name = destroyed_building_variable + value = 15 + months = 1 + } + } + 10 = { # reception_hall : Normal + trigger = { has_domicile_building_or_higher = reception_hall_01 } + set_variable = { + name = destroyed_building_variable + value = 16 + months = 1 + } + } + 10 = { # prison : Normal + trigger = { has_domicile_building_or_higher = prison_01 } + set_variable = { + name = destroyed_building_variable + value = 17 + months = 1 + } + } + 10 = { # courtyard : Normal + trigger = { has_domicile_building_or_higher = courtyard_01 } + set_variable = { + name = destroyed_building_variable + value = 18 + months = 1 + } + } + 10 = { # wine_cellar : Normal + trigger = { has_domicile_building_or_higher = wine_cellar_01 } + set_variable = { + name = destroyed_building_variable + value = 19 + months = 1 + } + } + 10 = { # guest_room : Normal + trigger = { has_domicile_building_or_higher = guest_room_01 } + set_variable = { + name = destroyed_building_variable + value = 20 + months = 1 + } + } + 10 = { # bath : Normal + trigger = { has_domicile_building_or_higher = bath_01 } + set_variable = { + name = destroyed_building_variable + value = 21 + months = 1 + } + } + 10 = { # library : Normal + trigger = { has_domicile_building_or_higher = library_01 } + set_variable = { + name = destroyed_building_variable + value = 22 + months = 1 + } + } + 10 = { # servants_quarters : Normal + trigger = { has_domicile_building_or_higher = servants_quarters_01 } + set_variable = { + name = destroyed_building_variable + value = 23 + months = 1 + } + } + 10 = { # office : Normal + trigger = { has_domicile_building_or_higher = office_01 } + set_variable = { + name = destroyed_building_variable + value = 24 + months = 1 + } + } + 10 = { # trophy_room : Normal + trigger = { has_domicile_building_or_higher = trophy_room_01 } + set_variable = { + name = destroyed_building_variable + value = 25 + months = 1 + } + } + 10 = { # silk : Normal + trigger = { has_domicile_building_or_higher = silk_01 } + set_variable = { + name = destroyed_building_variable + value = 26 + months = 1 + } + } + } +} + +destroy_random_estate_building_effect = { + if = { + limit = { has_variable = destroyed_building_variable } + switch = { + trigger = var:destroyed_building_variable + 0 = { # barracks : Cheap + destroy_or_downgrade_estate_building_6_effect = { BUILDING = barracks } + } + 1 = { # watchtower : Cheap + destroy_or_downgrade_estate_building_6_effect = { BUILDING = watchtower } + } + 2 = { # guardhouse : Cheap + destroy_or_downgrade_estate_building_4_effect = { BUILDING = guardhouse } + } + 3 = { # garden : Cheap + if = { + limit = { has_domicile_building_or_higher = garden_leisure_04 } + destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = garden_leisure } + } + else_if = { + limit = { has_domicile_building_or_higher = garden_fruit_04 } + destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = garden_fruit } + } + else = { + destroy_or_downgrade_estate_building_3_effect = { BUILDING = garden } + } + } + 4 = { # stable : Cheap + if = { + limit = { has_domicile_building_or_higher = stable_grand_04 } + destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = stable_grand } + } + else_if = { + limit = { has_domicile_building_or_higher = stable_kennel_04 } + destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = stable_kennel } + } + else_if = { + limit = { has_domicile_building_or_higher = stable_chariot_04 } + destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = stable_chariot } + } + else = { + destroy_or_downgrade_estate_building_3_effect = { BUILDING = stable } + } + } + 5 = { # workshop : Cheap + if = { + limit = { has_domicile_building_or_higher = workshop_carpenter_03 } + destroy_or_downgrade_estate_building_2_6_replacement_effect = { BUILDING = workshop_carpenter } + } + else_if = { + limit = { has_domicile_building_or_higher = workshop_mason_03 } + destroy_or_downgrade_estate_building_2_6_replacement_effect = { BUILDING = workshop_mason } + } + else_if = { + limit = { has_domicile_building_or_higher = workshop_textile_03 } + destroy_or_downgrade_estate_building_2_6_replacement_effect = { BUILDING = workshop_textile } + } + else = { + destroy_or_downgrade_estate_building_2_effect = { BUILDING = workshop } + } + } + 6 = { # storage : Cheap + if = { + limit = { has_domicile_building_or_higher = storage_warehouse_03 } + destroy_or_downgrade_estate_building_2_4_replacement_effect = { BUILDING = storage_warehouse } + } + else_if = { + limit = { has_domicile_building_or_higher = storage_granary_03 } + destroy_or_downgrade_estate_building_2_4_replacement_effect = { BUILDING = storage_granary } + } + else = { + destroy_or_downgrade_estate_building_2_effect = { BUILDING = storage } + } + } + 7 = { # market : Cheap + destroy_or_downgrade_estate_building_6_effect = { BUILDING = market } + } + 8 = { # grazing_land : Cheap + if = { + limit = { has_domicile_building_or_higher = horse_pasture_04 } + destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = horse_pasture } + } + else_if = { + limit = { has_domicile_building_or_higher = camel_pasture_04 } + destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = camel_pasture } + } + else_if = { + limit = { has_domicile_building_or_higher = elephant_pasture_04 } + destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = elephant_pasture } + } + else = { + destroy_or_downgrade_estate_building_6_effect = { BUILDING = grazing_land } + } + } + 9 = { # grain_field : Cheap + destroy_or_downgrade_estate_building_6_effect = { BUILDING = grain_field } + } + 10 = { # living_quarters : Cheap + destroy_or_downgrade_estate_building_4_effect = { BUILDING = living_quarters } + } + 11 = { # vineyard : Cheap + destroy_or_downgrade_estate_building_6_effect = { BUILDING = vineyard } + } + 12 = { # olive : Cheap + destroy_or_downgrade_estate_building_6_effect = { BUILDING = olive } + } + 13 = { # temple : Cheap + if = { + limit = { has_domicile_building_or_higher = temple_crypt_04 } + destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = temple_crypt } + } + else_if = { + limit = { has_domicile_building_or_higher = temple_large_04 } + destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = temple_large } + } + else_if = { + limit = { has_domicile_building_or_higher = temple_monastery_04 } + destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = temple_monastery } + } + else = { + destroy_or_downgrade_estate_building_3_effect = { BUILDING = temple_small } + } + } + 14 = { # grand_solar : Cheap + destroy_or_downgrade_estate_building_4_effect = { BUILDING = grand_solar } + } + 15 = { # cabinet_of_curiosities : Cheap + destroy_or_downgrade_estate_building_3_effect = { BUILDING = cabinet_of_curiosities } + } + 16 = { # reception_hall : Cheap + destroy_or_downgrade_estate_building_5_effect = { BUILDING = reception_hall } + } + 17 = { # prison : Cheap + destroy_or_downgrade_estate_building_4_effect = { BUILDING = prison } + } + 18 = { # courtyard : Cheap + destroy_or_downgrade_estate_building_4_effect = { BUILDING = courtyard } + } + 19 = { # wine_cellar : Cheap + destroy_or_downgrade_estate_building_3_effect = { BUILDING = wine_cellar } + } + 20 = { # guest_room : Cheap + destroy_or_downgrade_estate_building_6_effect = { BUILDING = guest_room } + } + 21 = { # bath : Cheap + destroy_or_downgrade_estate_building_4_effect = { BUILDING = bath } + } + 22 = { # library : Cheap + if = { + limit = { has_domicile_building_or_higher = library_observatory_03 } + destroy_or_downgrade_estate_building_2_4_replacement_effect = { BUILDING = library_observatory } + } + else_if = { + limit = { has_domicile_building_or_higher = library_education_03 } + destroy_or_downgrade_estate_building_2_4_replacement_effect = { BUILDING = library_education } + } + else = { + destroy_or_downgrade_estate_building_2_effect = { BUILDING = library } + } + } + 23 = { # servants_quarters : Cheap + destroy_or_downgrade_estate_building_4_effect = { BUILDING = servants_quarters } + } + 24 = { # office : Cheap + destroy_or_downgrade_estate_building_4_effect = { BUILDING = office } + } + 25 = { # trophy_room : Cheap + destroy_or_downgrade_estate_building_4_effect = { BUILDING = trophy_room } + } + 26 = { # silk : Cheap + destroy_or_downgrade_estate_building_6_effect = { BUILDING = silk } + } + } + remove_variable = destroyed_building_variable + } +} + +# Destroy building effects for chinese estates - In domicile scope +destroy_random_east_asian_estate_building_variable_effect = { + save_scope_as = raid_domicile + if = { + limit = { has_variable = destroyed_building_variable } + remove_variable = destroyed_building_variable + } + random_list = { # Which building? + # Upgrades/internal buildings + 10 = { # living_quarters + trigger = { has_domicile_building_or_higher = east_asian_estate_living_quarters_01 } + set_variable = { + name = destroyed_building_variable + value = 1 + months = 1 + } + } + 10 = { # commander's study + trigger = { has_domicile_building_or_higher = east_asian_estate_commander_study_01 } + set_variable = { + name = destroyed_building_variable + value = 2 + months = 1 + } + } + 10 = { # office + trigger = { has_domicile_building_or_higher = east_asian_estate_office_01 } + set_variable = { + name = destroyed_building_variable + value = 3 + months = 1 + } + } + 10 = { # servants_quarters + trigger = { has_domicile_building_or_higher = east_asian_estate_servants_quarters_01 } + set_variable = { + name = destroyed_building_variable + value = 4 + months = 1 + } + } + 10 = { # library + trigger = { has_domicile_building_or_higher = east_asian_estate_library_01 } + set_variable = { + name = destroyed_building_variable + value = 5 + months = 1 + } + } + 10 = { # bath + trigger = { has_domicile_building_or_higher = east_asian_estate_bath_01 } + set_variable = { + name = destroyed_building_variable + value = 6 + months = 1 + } + } + 10 = { # guest_room + trigger = { has_domicile_building_or_higher = east_asian_estate_guest_room_01 } + set_variable = { + name = destroyed_building_variable + value = 7 + months = 1 + } + } + 10 = { # wine_cellar + trigger = { has_domicile_building_or_higher = east_asian_estate_wine_cellar_01 } + set_variable = { + name = destroyed_building_variable + value = 8 + months = 1 + } + } + 10 = { # courtyard + trigger = { has_domicile_building_or_higher = east_asian_estate_courtyard_01 } + set_variable = { + name = destroyed_building_variable + value = 9 + months = 1 + } + } + 10 = { # prison + trigger = { has_domicile_building_or_higher = east_asian_estate_prison_01 } + set_variable = { + name = destroyed_building_variable + value = 10 + months = 1 + } + } + 10 = { # reception_hall + trigger = { has_domicile_building_or_higher = east_asian_estate_reception_hall_01 } + set_variable = { + name = destroyed_building_variable + value = 11 + months = 1 + } + } + 10 = { # cabinet_of_curiosities + trigger = { has_domicile_building_or_higher = east_asian_estate_cabinet_of_curiosities_01 } + set_variable = { + name = destroyed_building_variable + value = 12 + months = 1 + } + } + # External buildings + 10 = { # ancestral shrine + trigger = { has_domicile_building_or_higher = east_asian_estate_ancestral_shrine_01 } + set_variable = { + name = destroyed_building_variable + value = 13 + months = 1 + } + } + 10 = { # pagoda + trigger = { has_domicile_building_or_higher = east_asian_estate_temple_01 } + set_variable = { + name = destroyed_building_variable + value = 14 + months = 1 + } + } + 10 = { # barracks + trigger = { has_domicile_building_or_higher = east_asian_estate_barracks_01 } + set_variable = { + name = destroyed_building_variable + value = 15 + months = 1 + } + } + 10 = { # watchtower + trigger = { has_domicile_building_or_higher = east_asian_estate_watchtower_01 } + set_variable = { + name = destroyed_building_variable + value = 16 + months = 1 + } + } + 10 = { # garden + trigger = { has_domicile_building_or_higher = east_asian_estate_garden_01 } + set_variable = { + name = destroyed_building_variable + value = 18 + months = 1 + } + } + 10 = { # stable + trigger = { has_domicile_building_or_higher = east_asian_estate_stable_01 } + set_variable = { + name = destroyed_building_variable + value = 19 + months = 1 + } + } + 10 = { # workshop + trigger = { has_domicile_building_or_higher = east_asian_estate_workshop_01 } + set_variable = { + name = destroyed_building_variable + value = 20 + months = 1 + } + } + 10 = { # storage + trigger = { has_domicile_building_or_higher = east_asian_estate_storage_01 } + set_variable = { + name = destroyed_building_variable + value = 21 + months = 1 + } + } + 10 = { # market + trigger = { has_domicile_building_or_higher = east_asian_estate_market_01 } + set_variable = { + name = destroyed_building_variable + value = 22 + months = 1 + } + } + 10 = { # grazing_land + trigger = { has_domicile_building_or_higher = east_asian_estate_grazing_land_01 } + set_variable = { + name = destroyed_building_variable + value = 23 + months = 1 + } + } + 10 = { # rice_field + trigger = { has_domicile_building_or_higher = east_asian_estate_rice_field_01 } + set_variable = { + name = destroyed_building_variable + value = 25 + months = 1 + } + } + 10 = { # tea plantation + trigger = { has_domicile_building_or_higher = east_asian_estate_tea_01 } + set_variable = { + name = destroyed_building_variable + value = 27 + months = 1 + } + } + 10 = { # physician's office + trigger = { has_domicile_building_or_higher = east_asian_estate_health_01 } + set_variable = { + name = destroyed_building_variable + value = 28 + months = 1 + } + } + 10 = { # silk + trigger = { has_domicile_building_or_higher = east_asian_estate_silk_01 } + set_variable = { + name = destroyed_building_variable + value = 29 + months = 1 + } + } + 10 = { # study + trigger = { has_domicile_building_or_higher = east_asian_estate_study_01 } + set_variable = { + name = destroyed_building_variable + value = 30 + months = 1 + } + } + 10 = { # minister's office + trigger = { has_domicile_building_or_higher = east_asian_estate_minister_office_01 } + set_variable = { + name = destroyed_building_variable + value = 31 + months = 1 + } + } + 10 = { # dynastic pavilion/movement leader building + trigger = { has_domicile_building_or_higher = east_asian_estate_movement_study_01 } + set_variable = { + name = destroyed_building_variable + value = 32 + months = 1 + } + } + 10 = { # archive + trigger = { has_domicile_building_or_higher = east_asian_estate_archive_01 } + set_variable = { + name = destroyed_building_variable + value = 33 + months = 1 + } + } + 10 = { # gate + trigger = { has_domicile_building_or_higher = east_asian_estate_gate_01 } + set_variable = { + name = destroyed_building_variable + value = 34 + months = 1 + } + } + 10 = { # taxation office + trigger = { has_domicile_building_or_higher = east_asian_estate_taxation_01 } + set_variable = { + name = destroyed_building_variable + value = 35 + months = 1 + } + } + 10 = { # yamen office + trigger = { has_domicile_building_or_higher = east_asian_peasant_quarters_01 } + set_variable = { + name = destroyed_building_variable + value = 36 + months = 1 + } + } + } +} + +destroy_random_east_asian_estate_building_effect = { + if = { + limit = { has_variable = destroyed_building_variable } + switch = { + trigger = var:destroyed_building_variable + 1 = { # living_quarters + destroy_or_downgrade_estate_building_4_effect = { BUILDING = east_asian_estate_living_quarters } + } + 2 = { # commander's study + destroy_or_downgrade_estate_building_4_effect = { BUILDING = east_asian_estate_commander_study } + } + 3 = { # office + destroy_or_downgrade_estate_building_4_effect = { BUILDING = east_asian_estate_office } + } + 4 = { # servants_quarters + destroy_or_downgrade_estate_building_4_effect = { BUILDING = east_asian_estate_servants_quarters } + } + 5 = { # library + if = { + limit = { has_domicile_building_or_higher = east_asian_estate_library_education_03 } + destroy_or_downgrade_estate_building_2_4_replacement_effect = { BUILDING = east_asian_estate_library_education } + } + else = { + destroy_or_downgrade_estate_building_2_effect = { BUILDING = east_asian_estate_library } + } + } + 6 = { # bath + destroy_or_downgrade_estate_building_4_effect = { BUILDING = east_asian_estate_bath } + } + 7 = { # guest_room + destroy_or_downgrade_estate_building_4_effect = { BUILDING = east_asian_estate_guest_room } + } + 8 = { # wine_cellar + destroy_or_downgrade_estate_building_3_effect = { BUILDING = east_asian_estate_wine_cellar } + } + 9 = { # courtyard + destroy_or_downgrade_estate_building_4_effect = { BUILDING = east_asian_estate_courtyard } + } + 10 = { # prison + destroy_or_downgrade_estate_building_4_effect = { BUILDING = east_asian_estate_prison } + } + 11 = { # reception_hall + destroy_or_downgrade_estate_building_5_effect = { BUILDING = east_asian_estate_reception_hall } + } + 12 = { # cabinet_of_curiosities + destroy_or_downgrade_estate_building_3_effect = { BUILDING = east_asian_estate_cabinet_of_curiosities } + } + 13 = { # ancestral shrine + destroy_or_downgrade_estate_building_6_effect = { BUILDING = east_asian_estate_ancestral_shrine } + } + 14 = { # pagoda + destroy_or_downgrade_estate_building_6_effect = { BUILDING = east_asian_estate_temple } + } + 15 = { # barracks + destroy_or_downgrade_estate_building_6_effect = { BUILDING = east_asian_estate_barracks } + } + 16 = { # watchtower + destroy_or_downgrade_estate_building_6_effect = { BUILDING = east_asian_estate_watchtower } + } + 18 = { # garden + if = { + limit = { has_domicile_building_or_higher = east_asian_estate_garden_leisure_04 } + destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = east_asian_estate_garden_leisure } + } + else_if = { + limit = { has_domicile_building_or_higher = east_asian_estate_garden_fruit_04 } + destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = east_asian_estate_garden_fruit } + } + else = { + destroy_or_downgrade_estate_building_3_effect = { BUILDING = east_asian_estate_garden } + } + } + 19 = { # stable + if = { + limit = { has_domicile_building_or_higher = east_asian_estate_stable_grand_04 } + destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = east_asian_estate_stable_grand } + } + else_if = { + limit = { has_domicile_building_or_higher = east_asian_estate_stable_kennel_04 } + destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = east_asian_estate_stable_kennel } + } + else = { + destroy_or_downgrade_estate_building_3_effect = { BUILDING = east_asian_estate_stable } + } + } + 20 = { # workshop + if = { + limit = { has_domicile_building_or_higher = east_asian_estate_workshop_carpenter_03 } + destroy_or_downgrade_estate_building_2_6_replacement_effect = { BUILDING = east_asian_estate_workshop_carpenter } + } + else_if = { + limit = { has_domicile_building_or_higher = east_asian_estate_workshop_mason_03 } + destroy_or_downgrade_estate_building_2_6_replacement_effect = { BUILDING = east_asian_estate_workshop_mason } + } + else_if = { + limit = { has_domicile_building_or_higher = east_asian_estate_workshop_textile_03 } + destroy_or_downgrade_estate_building_2_6_replacement_effect = { BUILDING = east_asian_estate_workshop_textile } + } + else = { + destroy_or_downgrade_estate_building_2_effect = { BUILDING = east_asian_estate_workshop } + } + } + 21 = { # storage + if = { + limit = { has_domicile_building_or_higher = east_asian_estate_storage_warehouse_03 } + destroy_or_downgrade_estate_building_2_6_replacement_effect = { BUILDING = east_asian_estate_storage_warehouse } + } + else_if = { + limit = { has_domicile_building_or_higher = east_asian_estate_storage_granary_03 } + destroy_or_downgrade_estate_building_2_6_replacement_effect = { BUILDING = east_asian_estate_storage_granary } + } + else = { + destroy_or_downgrade_estate_building_2_effect = { BUILDING = east_asian_estate_storage } + } + } + 22 = { # market + destroy_or_downgrade_estate_building_6_effect = { BUILDING = east_asian_estate_market } + } + 23 = { # grazing_land + if = { + limit = { has_domicile_building_or_higher = east_asian_estate_horse_pasture_04 } + destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = east_asian_estate_horse_pasture } + } + else_if = { + limit = { has_domicile_building_or_higher = east_asian_estate_camel_pasture_04 } + destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = east_asian_estate_camel_pasture } + } + else_if = { + limit = { has_domicile_building_or_higher = east_asian_estate_elephant_pasture_04 } + destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = east_asian_estate_elephant_pasture } + } + else = { + destroy_or_downgrade_estate_building_6_effect = { BUILDING = east_asian_estate_grazing_land } + } + } + 25 = { # rice_field + destroy_or_downgrade_estate_building_6_effect = { BUILDING = east_asian_estate_rice_field } + } + 27 = { # tea + destroy_or_downgrade_estate_building_6_effect = { BUILDING = east_asian_estate_tea } + } + 28 = { # health + destroy_or_downgrade_estate_building_6_effect = { BUILDING = east_asian_estate_health } + } + 29 = { # silk + destroy_or_downgrade_estate_building_6_effect = { BUILDING = east_asian_estate_silk } + } + 30 = { # study + destroy_or_downgrade_estate_building_4_effect = { BUILDING = east_asian_estate_study } + } + 31 = { # minister's office + destroy_or_downgrade_estate_building_4_effect = { BUILDING = east_asian_estate_minister_office } + } + 32 = { # dynastic pavilion/movement leader building + destroy_or_downgrade_estate_building_4_effect = { BUILDING = east_asian_estate_movement_study } + } + 33 = { # archive + destroy_or_downgrade_estate_building_4_effect = { BUILDING = east_asian_estate_archive } + } + 34 = { # gate + destroy_or_downgrade_estate_building_6_effect = { BUILDING = east_asian_estate_gate } + } + 35 = { # tax office + destroy_or_downgrade_estate_building_4_effect = { BUILDING = east_asian_estate_taxation } + } + 36 = { # peasants quarters + destroy_or_downgrade_estate_building_4_effect = { BUILDING = east_asian_peasant_quarters } + } + } + remove_variable = destroyed_building_variable + } +} + +add_random_economic_building_effect = { + save_scope_as = building_scope + custom_tooltip = random_economic_building_tt + hidden_effect = { + random_list = { + 10 = { # Caravanserai + trigger = { + NOT = { has_building_or_higher = caravanserai_01 } + building_caravanserai_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + culture = { + has_innovation = innovation_guilds + } + } + add_building = caravanserai_01 + } + 10 = { # Watermills + trigger = { + NOT = { has_building_or_higher = watermills_01 } + building_watermills_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + culture = { + has_innovation = innovation_windmills + } + } + add_building = watermills_01 + } + 10 = { # Windmills + trigger = { + NOT = { has_building_or_higher = windmills_01 } + building_windmills_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + culture = { + has_innovation = innovation_windmills + } + } + add_building = windmills_01 + } + 10 = { # Trade Port + trigger = { + NOT = { has_building_or_higher = common_tradeport_01 } + building_common_tradeport_requirement_terrain = yes + OR = { + AND = { + culture = { + has_cultural_parameter = trade_ports_enabled_for_tribals + } + has_building_or_higher = tribe_01 + } + building_requirement_castle_city_church = { LEVEL = 01 } + } + } + add_building = common_tradeport_01 + } + 10 = { # Pastures + trigger = { + NOT = { has_building_or_higher = pastures_01 } + building_pastures_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + } + add_building = pastures_01 + } + 10 = { # Hunting Grounds + trigger = { + NOT = { has_building_or_higher = hunting_grounds_01 } + building_hunting_grounds_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + } + add_building = hunting_grounds_01 + } + 10 = { # Orchards + trigger = { + NOT = { has_building_or_higher = orchards_01 } + building_orchards_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + } + add_building = orchards_01 + } + 10 = { # Farm Estates + trigger = { + NOT = { has_building_or_higher = farm_estates_01 } + building_farm_estates_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + } + add_building = farm_estates_01 + } + 10 = { # Cereal Fields + trigger = { + NOT = { has_building_or_higher = cereal_fields_01 } + building_cereal_fields_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + } + add_building = cereal_fields_01 + } + 10 = { # Logging Camps + trigger = { + NOT = { has_building_or_higher = logging_camps_01 } + building_logging_camps_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + } + add_building = logging_camps_01 + } + 10 = { # Peat Quarries + trigger = { + NOT = { has_building_or_higher = peat_quarries_01 } + building_peat_quarries_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + } + add_building = peat_quarries_01 + } + 10 = { # Hill Farms + trigger = { + NOT = { has_building_or_higher = hill_farms_01 } + building_hill_farms_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + } + add_building = hill_farms_01 + } + 10 = { # Elephant Pens + trigger = { + NOT = { has_building_or_higher = elephant_pens_01 } + building_elephant_pens_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + } + add_building = elephant_pens_01 + } + 10 = { # Plantations + trigger = { + NOT = { has_building_or_higher = plantations_01 } + building_plantations_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + } + add_building = plantations_01 + } + 10 = { # Quarries + trigger = { + NOT = { has_building_or_higher = quarries_01 } + building_quarries_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + } + add_building = quarries_01 + } + 10 = { # Qanats + trigger = { + NOT = { has_building_or_higher = qanats_01 } + building_qanats_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + culture = { + has_cultural_parameter = unlocks_qanat_building + } + } + add_building = qanats_01 + } + 10 = { # Murex Farms + trigger = { + NOT = { has_building_or_higher = murex_farm_01 } + building_murex_farm_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + } + add_building = murex_farm_01 + } + 10 = { # Guild Halls - City Specific + trigger = { + NOT = { has_building_or_higher = guild_halls_01 } + has_building_or_higher = city_01 + } + add_building = guild_halls_01 + } + 10 = { # Monastic Schools - Temple Specific + trigger = { + NOT = { has_building_or_higher = monastic_schools_01 } + has_building_or_higher = temple_01 + } + add_building = monastic_schools_01 + } + } + } +} + +add_random_fortification_building_effect = { + save_scope_as = building_scope + custom_tooltip = random_fortification_building_tt + hidden_effect = { + random_list = { + 10 = { # Ramparts + trigger = { + NOT = { has_building_or_higher = ramparts_01 } + building_ramparts_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + } + add_building = ramparts_01 + } + 10 = { # Curtain Walls + trigger = { + NOT = { has_building_or_higher = curtain_walls_01 } + building_curtain_walls_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + } + add_building = curtain_walls_01 + } + 10 = { # Watchtowers + trigger = { + NOT = { has_building_or_higher = watchtowers_01 } + building_watchtowers_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + } + add_building = watchtowers_01 + } + 10 = { # Hill Forts + trigger = { + NOT = { has_building_or_higher = hill_forts_01 } + building_hill_forts_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + } + add_building = hill_forts_01 + } + } + } +} + +add_random_military_building_effect = { + save_scope_as = building_scope + custom_tooltip = random_military_building_tt + hidden_effect = { + random_list = { + 10 = { # Wind Furnace + trigger = { + NOT = { has_building_or_higher = wind_furnace_01 } + building_wind_furnace_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + } + add_building = wind_furnace_01 + } + 10 = { # Workshops + trigger = { + NOT = { has_building_or_higher = workshops_01 } + building_workshops_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + scope:building_scope.county.holder.culture = { + has_innovation = innovation_advanced_bowmaking + } + } + add_building = workshops_01 + } + 10 = { # Horse Pastures + trigger = { + NOT = { has_building_or_higher = windmills_01 } + building_horse_pastures_requirement_terrain = yes + } + add_building = windmills_01 + } + 10 = { # Hillside Grazing + trigger = { + NOT = { has_building_or_higher = hillside_grazing_01 } + building_hillside_grazing_requirement_terrain = yes + } + add_building = hillside_grazing_01 + } + 10 = { # Warrior Lodges + trigger = { + NOT = { has_building_or_higher = warrior_lodges_01 } + building_warrior_lodges_requirement_terrain = yes + } + add_building = warrior_lodges_01 + } + 10 = { # Military Camps + trigger = { + NOT = { has_building_or_higher = military_camps_01 } + building_military_camps_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + } + add_building = military_camps_01 + } + 10 = { # Regimental Grounds + trigger = { + NOT = { has_building_or_higher = regimental_grounds_01 } + building_regimental_grounds_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + } + add_building = regimental_grounds_01 + } + 10 = { # Outposts + trigger = { + NOT = { has_building_or_higher = outposts_01 } + building_outposts_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + } + add_building = outposts_01 + } + 10 = { # Barracks + trigger = { + NOT = { has_building_or_higher = barracks_01 } + building_barracks_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + } + add_building = barracks_01 + } + 10 = { # Camel Farms + trigger = { + NOT = { has_building_or_higher = camel_farms_01 } + building_camel_farms_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + } + add_building = camel_farms_01 + } + 10 = { # Stables + trigger = { + NOT = { has_building_or_higher = stables_01 } + building_stables_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + } + add_building = stables_01 + } + 10 = { # Smiths + trigger = { + NOT = { has_building_or_higher = smiths_01 } + building_smiths_requirement_terrain = yes + building_requirement_castle_city_church = { LEVEL = 01 } + } + add_building = smiths_01 + } + } + } +} + +destroy_or_downgrade_temple_effect = { + if = { + limit = { has_building = temple_04 } + remove_building = temple_04 + hidden_effect = { add_building = temple_03 } + } + else_if = { + limit = { has_building = temple_03 } + remove_building = temple_03 + hidden_effect = { add_building = temple_02 } + } + else_if = { + limit = { has_building = temple_02 } + remove_building = temple_02 + hidden_effect = { add_building = temple_01 } + } + else = { remove_building = temple_01 } +} + +add_next_temple_tier_effect = { + if = { + limit = { + NOT = { has_building_or_higher = temple_01 } + } + add_building = temple_01 + } + else_if = { + limit = { has_building = temple_01 } + add_building = temple_02 + } + else_if = { + limit = { has_building = temple_02 } + add_building = temple_03 + } + else_if = { + limit = { has_building = temple_03 } + add_building = temple_04 + } +} diff --git a/common/scripted_effects/07_dlc_ep3_scripted_effects.txt b/common/scripted_effects/07_dlc_ep3_scripted_effects.txt new file mode 100644 index 00000000..9148b844 --- /dev/null +++ b/common/scripted_effects/07_dlc_ep3_scripted_effects.txt @@ -0,0 +1,13465 @@ +################################################## +# Laamps +################################################## + +create_landless_adventurer_title_history_effect = { + holder ?= { + if = { + limit = { + NOT = { has_realm_law = landless_adventurer_succession_law } + } + add_realm_law = landless_adventurer_succession_law + } + } +} + +create_landless_minority_title_history_effect = { + holder ?= { + if = { + limit = { + NOT = { has_realm_law = confederate_partition_succession_law } + } + add_realm_law = confederate_partition_succession_law + } + } +} +create_landless_adventurer_title_effect = { + save_scope_as = new_landless_adventurer + if = { + limit = { + exists = house + } + house = { save_scope_as = new_landless_adventurer_house } + } + if = { + limit = { + exists = location + } + location = { save_scope_as = new_landless_adventurer_location } + } + save_scope_value_as = { + name = adventurer_creation_reason + value = $REASON$ + } + $FLAVOR_CHAR$ = { save_scope_as = adventurer_flavor_char } + hidden_effect = { + random_list = { + 1000 = { + trigger = { + scope:warrior_youth ?= scope:new_landless_adventurer + } + create_adventurer_title = { + name = adventurer_name_free_warriors + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 1000 = { + trigger = { + scope:warrior_youth ?= scope:new_landless_adventurer + age <= 20 + exists = scope:host.house + } + create_adventurer_title = { + name = adventurer_name_youths + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 10 = { + create_adventurer_title = { + name = adventurer_name_001 + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 10 = { + trigger = { + exists = scope:new_landless_adventurer_house + } + create_adventurer_title = { + name = adventurer_name_002 + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 10 = { + create_adventurer_title = { + name = adventurer_name_003 + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 10 = { + create_adventurer_title = { + name = adventurer_name_004 + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 10 = { + trigger = { + NOT = { + scope:new_landless_adventurer.culture = culture:kurdish + } + } + create_adventurer_title = { + name = adventurer_name_005 + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 10 = { + create_adventurer_title = { + name = adventurer_name_006 + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 10 = { + create_adventurer_title = { + name = adventurer_name_007 + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 10 = { + trigger = { + exists = scope:new_landless_adventurer_house + } + create_adventurer_title = { + name = adventurer_name_008 + holder = scope:new_landless_adventurer + save_scope_as = new_title + } + } + 10 = { + create_adventurer_title = { + name = adventurer_name_009 + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 7 = { + trigger = { + exists = scope:new_landless_adventurer_location + } + create_adventurer_title = { + name = adventurer_name_010 + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 7 = { + trigger = { + exists = scope:new_landless_adventurer_location + } + create_adventurer_title = { + name = adventurer_name_011 + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 7 = { + trigger = { + exists = scope:new_landless_adventurer_location + } + create_adventurer_title = { + name = adventurer_name_012 + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 7 = { + trigger = { + scope:new_landless_adventurer.ai_zeal > 0 + } + create_adventurer_title = { + name = adventurer_name_013 + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 7 = { + trigger = { + scope:new_landless_adventurer.ai_zeal > 0 + } + create_adventurer_title = { + name = adventurer_name_014 + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 7 = { + trigger = { + scope:new_landless_adventurer.ai_zeal > 0 + } + create_adventurer_title = { + name = adventurer_name_015 + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 7 = { + trigger = { + OR = { + has_martial_lifestyle_trait_trigger = yes + ai_boldness >= medium_positive_ai_value + has_trait = education_martial_prowess_1 + has_trait = education_martial_prowess_2 + has_trait = education_martial_prowess_3 + has_trait = education_martial_prowess_4 + has_education_martial_trigger = yes + } + } + create_adventurer_title = { + name = adventurer_name_016 + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 7 = { + trigger = { + OR = { + has_martial_lifestyle_trait_trigger = yes + has_trait = lifestyle_blademaster + has_trait = education_martial_prowess_1 + has_trait = education_martial_prowess_2 + has_trait = education_martial_prowess_3 + has_trait = education_martial_prowess_4 + has_education_martial_trigger = yes + } + } + create_adventurer_title = { + name = adventurer_name_017 + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 7 = { + trigger = { + scope:new_landless_adventurer.ai_zeal > medium_negative_ai_value + scope:new_landless_adventurer.ai_boldness >= 0 + NOT = { + scope:new_landless_adventurer = { + faith.religion = religion:west_african_bori_religion + } + } + } + create_adventurer_title = { + name = adventurer_name_018 + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 7 = { + trigger = { + scope:new_landless_adventurer.ai_zeal > medium_negative_ai_value + scope:new_landless_adventurer.ai_greed >= 0 + NOT = { + scope:new_landless_adventurer = { + faith.religion = religion:west_african_bori_religion + } + } + } + create_adventurer_title = { + name = adventurer_name_019 + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 7 = { + trigger = { + scope:new_landless_adventurer.ai_zeal > medium_negative_ai_value + scope:new_landless_adventurer.ai_compassion >= 0 + NOT = { + scope:new_landless_adventurer = { + faith.religion = religion:west_african_bori_religion + } + } + } + create_adventurer_title = { + name = adventurer_name_020 + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 7 = { + trigger = { + exists = scope:new_landless_adventurer_location.county + } + scope:new_landless_adventurer_location.county = { + save_scope_as = new_landless_adventurer_county + } + create_adventurer_title = { + name = adventurer_name_021 + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 7 = { + create_adventurer_title = { + name = adventurer_name_022 + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 10 = { + trigger = { + exists = scope:new_landless_adventurer_house + } + create_adventurer_title = { + name = adventurer_name_023 + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 10 = { + trigger = { + scope:new_landless_adventurer.ai_zeal > medium_negative_ai_value + scope:new_landless_adventurer.ai_rationality >= 0 + #Many names using Allah already + NOT = { + scope:new_landless_adventurer = { + faith.religion = religion:islam_religion + } + } + } + create_adventurer_title = { + name = adventurer_name_024 + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 7 = { + trigger = { + scope:new_landless_adventurer.ai_zeal < low_negative_ai_value + scope:new_landless_adventurer.ai_compassion < medium_negative_ai_value + } + create_adventurer_title = { + name = adventurer_name_025 + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 10 = { + create_adventurer_title = { + name = adventurer_name_0026 + holder = scope:new_landless_adventurer + save_scope_as = new_title + } + } + 5 = { + trigger = { + exists = scope:new_landless_adventurer.culture + OR = { + has_martial_lifestyle_trait_trigger = yes + ai_boldness >= medium_positive_ai_value + has_trait = education_martial_prowess_1 + has_trait = education_martial_prowess_2 + has_trait = education_martial_prowess_3 + has_trait = education_martial_prowess_4 + has_education_martial_trigger = yes + } + } + create_adventurer_title = { + name = adventurer_name_0027 + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + } + + scope:new_title ?= { + create_landless_adventurer_title_history_effect = yes + set_variable = { + name = adventurer_creation_reason + value = scope:adventurer_creation_reason + } + set_variable = { + name = adventurer_flavor_char + value = scope:adventurer_flavor_char + } + } + + scope:new_title = { save_scope_as = new_landless_adventurer_title } + scope:new_landless_adventurer = { + if = { + limit = { + NOT = { has_government = landless_adventurer_government } + } + change_government = landless_adventurer_government + } + if = { + limit = { + NOT = { has_realm_law = landless_adventurer_succession_law } + } + add_realm_law = landless_adventurer_succession_law + } + if = { + limit = { + has_realm_law = crown_authority_0 + } + remove_realm_law = crown_authority_0 + } + domicile = { change_provisions = starting_provisions_value } + } + every_player = { + limit = { + NOR = { + root ?= this + this = scope:new_landless_adventurer + } + OR = { + # Either they're important to us. + is_close_or_extended_family_of = scope:new_landless_adventurer + is_consort_of = scope:new_landless_adventurer + has_important_relationship_with_character_trigger = { CHARACTER = scope:new_landless_adventurer } + # Or they're just close enough. + AND = { + capital_province = { "squared_distance(scope:new_landless_adventurer.location)" <= squared_distance_medium } + OR = { + top_liege = root.top_liege + any_neighboring_and_across_water_top_liege_realm_owner = { this = root.top_liege } + } + } + } + } + send_interface_message = { + type = msg_landless_adventurer_nearby + title = nearby_landless_adventurer_created_message_title + left_icon = scope:new_landless_adventurer + right_icon = scope:adventurer_flavor_char + switch = { + trigger = scope:adventurer_creation_reason + flag:conquest = { custom_tooltip = nearby_landless_adventurer_created_message_conquest_tt } + flag:conquest_claim = { custom_tooltip = nearby_landless_adventurer_created_message_conquest_tt } + flag:deposition = { custom_tooltip = nearby_landless_adventurer_created_message_deposition_tt } + flag:succession = { custom_tooltip = nearby_landless_adventurer_created_message_succession_tt } + flag:exile = { custom_tooltip = nearby_landless_adventurer_created_message_exile_tt } + flag:voluntary = { custom_tooltip = nearby_landless_adventurer_created_message_voluntary_tt } + flag:revocation = { custom_tooltip = nearby_landless_adventurer_created_message_revocation_tt } + flag:runaway_allowed = { custom_tooltip = nearby_landless_adventurer_created_message_runaway_allowed_tt } + flag:runaway_forbidden = { custom_tooltip = nearby_landless_adventurer_created_message_runaway_forbidden_tt } + flag:wanderer = { custom_tooltip = nearby_landless_adventurer_created_message_wanderer_tt } + flag:eradicate = { custom_tooltip = nearby_landless_adventurer_created_message_eradicate_tt } + fallback = { custom_tooltip = nearby_landless_adventurer_created_message_fallback_tt } + } + } + } + } + custom_tooltip = laamp_become_adventurer_tt + if = { + limit = { + OR = { + scope:adventurer_creation_reason = flag:deposition + scope:adventurer_creation_reason = flag:conquest + scope:adventurer_creation_reason = flag:conquest_claim + scope:adventurer_creation_reason = flag:exile + } + NOT = { this = scope:adventurer_flavor_char } + } + add_opinion = { + target = scope:adventurer_flavor_char + modifier = demanded_eviction_opinion + } + remove_laamp_from_exiled_county_automatically_effect = { + PROVINCE = scope:new_landless_adventurer.location + LAAMP = scope:new_landless_adventurer + } + save_scope_value_as = { + name = expelled + value = yes + } + } + hidden_effect = { + if = { + limit = { + scope:new_landless_adventurer = { + is_ai = no + } + NOT = { exists = scope:expelled } + } + populate_location_with_contracts_effect = { + AREA_CHAR = scope:new_landless_adventurer + AMOUNT = 3 + } + } + scope:new_landless_adventurer = { + every_councillor = { + if = { + limit = { + NOR = { + has_council_position = councillor_court_chaplain + has_council_position = councillor_spouse + } + } + scope:new_landless_adventurer = { + fire_councillor = prev + } + remove_opinion = { + modifier = fired_from_council_opinion + target = scope:new_landless_adventurer + } + } + else_if = { + limit = { + NOR = { + is_close_or_extended_family_of = scope:new_landless_adventurer + has_relation_lover = scope:new_landless_adventurer + has_relation_friend = scope:new_landless_adventurer + is_consort_of = scope:new_landless_adventurer + has_council_position = councillor_spouse + } + } + death = { + death_reason = death_vanished + } + } + } + every_courtier = { + limit = { + NOR = { + is_close_or_extended_family_of = scope:new_landless_adventurer + has_relation_lover = scope:new_landless_adventurer + has_relation_friend = scope:new_landless_adventurer + is_consort_of = scope:new_landless_adventurer + } + } + move_to_pool = yes + } + # Give us a couple of starting chars if we're almost completely bereft. + if = { + limit = { + any_courtier = { count <= 2 } + } + trigger_event = { + id = ep3_laamps.1001 + weeks = { 2 6 } + } + } + } + trigger_event = { id = misc.0001 days = 1 } + local_arbitration_boon_change_purpose_effect = yes + } + add_to_global_variable_list = { + name = laamps_tally + target = scope:new_landless_adventurer.primary_title + } + set_variable = flavourise_camp_purpose_wanderers +} + +destroy_landless_title_no_dlc_effect = { + if = { + limit = { + NOT = { has_dlc_feature = roads_to_power } + game_start_date = $DATE$ + } + holder = { destroy_title = prev } + } +} + +set_landless_government_effect = { + if = { + limit = { + has_dlc_feature = roads_to_power + } + change_government = landless_adventurer_government + } +} + +disburse_knight_errant_decision_rewards_effect = { + add_trait = knight_errant + house = { + add_house_modifier = { + modifier = ep3_knight_of_the_swan_house_modifier + } + } + custom_tooltip = knight_errant_decision_armor_tt + if = { + limit = { has_dlc_feature = legends } + create_swan_knight_legend_seed_effect = yes + } + if = { + limit = { has_character_modifier = bandit_king_modifier } + remove_character_modifier = bandit_king_modifier + } +} + +laamp_game_over_option_effect = { + add_internal_flag = dangerous + custom_tooltip = laamp_game_over_tt + if = { + limit = { exists = scope:new_landless_adventurer_title } + hidden_effect = { + destroy_title = scope:new_landless_adventurer_title + add_character_flag = { flag = declined_become_laamp days = 1 } # The flag is temporary to make the player get a game over if they had no landed heir to take over their lands + # While also making it so that if they did have an heir to take over they can later play as the old character if they somehow inherit from the heir + } + } +} + +destroy_laamp_effect = { + $ADVENTURER$ = { + save_scope_as = the_adventurer + # If we weren't an adventurer before, make us one. + if = { + limit = { + NOT = { has_trait = adventurer } + } + add_trait = adventurer + } + hidden_effect = { + every_courtier = { + set_variable = { + name = former_camp_leader + value = scope:the_adventurer + } + add_trait = adventurer_follower + } + } + custom_tooltip = { + text = destroy_laamp_effect.tt.domicile_liquidated + laamp_clear_domicile_buildings_effect = yes + } + # Contacts have opinions™ about you. + ## Be they good. + every_contact = { + limit = { + opinion = { + target = scope:the_adventurer + value >= 1 + } + } + custom = custom.every_contact_with_positive_opinion + add_opinion = { + target = scope:the_adventurer + modifier = pleased_former_contact_opinion + opinion = 30 + } + hidden_effect = { + if = { + limit = { + can_set_relation_potential_friend_trigger = { CHARACTER = scope:the_adventurer } + } + set_relation_potential_friend = scope:the_adventurer + } + } + } + ## Or bad. + every_contact = { + limit = { + opinion = { + target = scope:the_adventurer + value < 1 + } + } + # And neutral but _eh_. + custom = custom.every_contact_with_negative_opinion + add_opinion = { + target = scope:the_adventurer + modifier = frustrated_former_contact_opinion + opinion = -30 + } + hidden_effect = { + if = { + limit = { + can_set_relation_potential_rival_trigger = { CHARACTER = scope:the_adventurer } + } + set_relation_potential_rival = scope:the_adventurer + } + } + } + # Destroy your main title. + every_held_title = { + limit = { has_variable = adventurer_creation_reason } + save_scope_as = landless_adventurer_title + scope:the_adventurer = { destroy_title = scope:landless_adventurer_title } + } + # Ironically, we only want to use this effect if you're _not_ admin — it'll reset you nicely to the best government for you, but if you're admin, you should stay admin. + if = { + limit = { + NOR = { + government_has_flag = government_is_administrative + government_has_flag = government_is_nomadic + government_has_flag = government_is_steppe_admin + government_has_flag = government_is_wanua + government_has_flag = government_is_mandala + government_has_flag = government_is_celestial + government_has_flag = government_is_meritocratic + government_has_flag = government_is_japan_feudal + } + } + admin_government_reset_effect = yes #this only contains Clan, Tribal, Nomadic and Feudal + } + # Clean up story no-movement flags. + remove_character_flag = laamp_stay_same_kingdom + } +} + +create_landless_adventurer_title_tooltip_effect = { + show_as_tooltip = { + custom_tooltip = laamp_become_adventurer_tt + if = { + limit = { exists = scope:new_landless_adventurer_title} + show_as_tooltip = { get_title = scope:new_landless_adventurer_title } + } + } +} + +find_playable_relatives_effect = { + if = { + limit = { + any_close_family_member = { playable_relative_trigger = yes } + } + ordered_close_family_member = { + limit = { playable_relative_trigger = yes } + order_by = highest_held_title_tier + max = 3 + check_range_bounds = no + if = { + limit = { exists = scope:alt_2 } + save_scope_as = alt_3 + } + else_if = { + limit = { exists = scope:alt_1 } + save_scope_as = alt_2 + } + else = { save_scope_as = alt_1 } + } + } +} + +laamp_switch_playable_character_effect = { + set_player_character = $NEW_CHARACTER$ + hidden_effect = { + if = { + limit = { exists = scope:new_landless_adventurer_title } + destroy_title = scope:new_landless_adventurer_title + } + } +} + +ep3_become_landed_save_liege_effect = { + $TITLE_GIVER$ = { save_scope_as = ruler } + save_scope_value_as = { + name = override_independence_logic + value = $ALWAYS_INDEPENDENT$ + } + if = { + limit = { scope:override_independence_logic = yes } + # Do nothing, we're just here to block subsequent checks. + } + else_if = { + limit = { + scope:ruler = { top_liege != this } + any_in_list = { + list = $TITLE_LIST$ + tier = scope:ruler.highest_held_title_tier + } + NOT = { + any_in_list = { + list = $TITLE_LIST$ + tier > scope:ruler.highest_held_title_tier + } + } + } + scope:ruler.liege = { save_scope_as = new_liege } + } + else_if = { + limit = { + NOT = { + any_in_list = { + list = $TITLE_LIST$ + tier >= scope:ruler.highest_held_title_tier + } + } + } + scope:ruler = { save_scope_as = new_liege } + } +} + +ep3_become_landed_transfer_effect = { + hidden_effect = { + # Liquidate camp + $TITLE_RECEIVER$ = { laamp_clear_domicile_buildings_liquidator_effect = yes } + } + $TITLE_RECEIVER$ = { + if = { + limit = { character:90028 ?= this } + custom_tooltip = ep3_story_cycle_harrying.3053.b.tt + add_character_flag = hereward_settled_flag + } + set_variable = { + name = ascended_throne_reason + value = $REASON$ + weeks = 1 + } + save_scope_value_as = { + name = ascended_throne_value + value = $REASON$ + } + set_variable = { # Used to prevent invalid NF creation + name = laamp_invasion_flag + value = scope:target + days = 1 + } + } + create_title_and_vassal_change = { + type = $TYPE$ + add_claim_on_loss = yes + save_scope_as = title_change + } + scope:target.holder ?= { save_scope_as = old_holder } + if = { + limit = { NOT = { exists = scope:old_holder } } + scope:target = { + ordered_de_jure_county = { + limit = { holder.top_liege = scope:defender.top_liege } + order_by = development_level + holder = { save_scope_as = old_holder } + } + } + } + scope:supporter ?= { save_scope_as = government_giver } + if = { + limit = { NOT = { exists = scope:government_giver } } + scope:old_holder = { save_scope_as = government_giver } + } + scope:government_giver ?= { + switch = { + trigger = government_has_flag + government_is_administrative = { + save_scope_value_as = { name = old_government value = flag:admin } + } + government_is_clan = { + save_scope_value_as = { name = old_government value = flag:clan } + } + government_is_tribal = { + save_scope_value_as = { name = old_government value = flag:tribal } + } + government_is_wanua = { + save_scope_value_as = { name = old_government value = flag:wanua } + } + government_is_nomadic = { + save_scope_value_as = { name = old_government value = flag:nomad } + } + government_is_herder = { + save_scope_value_as = { name = old_government value = flag:nomad } + } + government_is_celestial = { + save_scope_value_as = { name = old_government value = flag:celestial } + } + government_is_steppe_admin = { + save_scope_value_as = { name = old_government value = flag:steppe_admin } + } + government_is_meritocratic = { + save_scope_value_as = { name = old_government value = flag:meritocratic } + } + government_is_japan_administrative = { + save_scope_value_as = { name = old_government value = flag:japan_administrative } + } + government_is_japan_feudal = { + save_scope_value_as = { name = old_government value = flag:japan_feudal } + } + government_is_mandala = { + save_scope_value_as = { name = old_government value = flag:mandala } + } + } + } + if = { + limit = { + NOT = { exists = scope:new_capital } + } + ordered_in_list = { + list = $TITLE_LIST$ + limit = { tier = tier_county } + order_by = development_level + save_scope_as = new_capital + } + } + if = { + limit = { + NOT = { exists = scope:new_capital } + } + scope:new_primary_title ?= { + ordered_de_jure_county = { + limit = { + holder = scope:defender + } + alternative_limit = { + holder.top_liege = scope:defender.top_liege + } + order_by = development_level + save_scope_as = new_capital + } + } + } + ordered_in_list = { + list = $TITLE_LIST$ + order_by = tier + save_scope_as = new_primary_title + } + $TITLE_RECEIVER$ = { + if = { + limit = { + exists = scope:new_primary_title + highest_held_title_tier > scope:new_primary_title.tier + primary_title = { is_landless_type_title = no } + } + primary_title = { save_scope_as = new_primary_title } + } + else = { + scope:new_primary_title ?= { + change_title_holder_include_vassals = { + holder = $TITLE_RECEIVER$ + change = scope:title_change + take_baronies = no + } + } + } + } + scope:new_primary_title ?= { + every_de_jure_county = { + limit = { + NOT = { is_in_list = $TITLE_LIST$ } + trigger_if = { + limit = { exists = scope:defender } + holder.top_liege ?= scope:defender.top_liege + } + trigger_if = { + limit = { exists = scope:new_liege } + holder.top_liege ?= scope:new_liege.top_liege + } + } + change_title_holder_include_vassals = { + holder = $TITLE_RECEIVER$ + change = scope:title_change + take_baronies = no + } + } + } + every_in_list = { + list = $TITLE_LIST$ + limit = { + is_leased_out = no + trigger_if = { + limit = { + NOT = { exists = var:ceremonial_title } + } + is_landless_type_title = no + } + is_head_of_faith = no + tier >= tier_county + trigger_if = { + limit = { exists = scope:defender } + holder.top_liege ?= scope:defender.top_liege + } + trigger_if = { + limit = { exists = scope:new_liege } + holder.top_liege ?= scope:new_liege.top_liege + } + NOT = { scope:new_primary_title ?= this } + } + change_title_holder_include_vassals = { + holder = $TITLE_RECEIVER$ + change = scope:title_change + take_baronies = no + } + } + if = { + limit = { has_character_flag = special_laamp_char } + resolve_title_and_vassal_change = scope:title_change + # Then we resolve vassalage separately, so that we can lock in tiers. + create_title_and_vassal_change = { + type = $TYPE$ + add_claim_on_loss = yes + save_scope_as = title_change + } + } + if = { + limit = { + exists = scope:new_liege + trigger_if = { + limit = { exists = scope:ascended_throne_value } + NOR = { + scope:ascended_throne_value = flag:conquest + scope:ascended_throne_value = flag:conquest_claim + } + } + } + $TITLE_RECEIVER$ = { + change_liege = { + liege = scope:new_liege + change = scope:title_change + } + } + } + else_if = { + limit = { top_liege != this } + becomes_independent = { change = scope:title_change } + } + resolve_title_and_vassal_change = scope:title_change + # Because target may be either a title or a character, we check if a scope value has been set up in advance if this is being called from the Seize Realm scheme specifically + if = { + limit = { + exists = scope:old_government_type + } + scope:old_government_type = { + save_scope_as = old_government + } + } + # Set government type + if = { + limit = { + exists = scope:old_government + } + # We don't expect to actually trigger most of the below, as most are not valid targets to begin with, but all are included for completeness and mod support + switch = { + trigger = scope:old_government + flag:feudal = { + change_government = feudal_government + } + flag:republic = { + change_government = republic_government + } + flag:theocracy = { + change_government = theocracy_government + } + flag:clan = { + change_government = clan_government + } + flag:tribal = { + change_government = tribal_government + } + flag:wanua = { + change_government = wanua_government + } + flag:holy_order = { + change_government = holy_order_government + } + flag:administrative = { + change_government = administrative_government + } + flag:nomad = { + change_government = nomad_government + } + flag:herder = { + change_government = herder_government + } + flag:celestial = { + change_government = celestial_government + } + flag:mandala = { + if = { + limit = { + faith = { has_doctrine = doctrine_polytheist } + } + change_government = mandala_government + #Sort out the House shenanigans + if = { + limit = { is_house_head = no } + house = { + if = { + limit = { + house_head = { + is_landed = no + is_courtier_of = root + } + } + set_house_head = root + } + } + } + else = { + house ?= { + set_house_aspiration = { type = no_aspect } + } + } + } + else = { + if = { + limit = { ep3_is_clan_inclined_trigger = yes } + change_government = clan_government + } + else = { change_government = feudal_government } + } + } + flag:steppe_admin = { + change_government = steppe_admin_government + } + flag:meritocratic = { + change_government = meritocratic_government + } + flag:japan_feudal = { + change_government = japan_feudal_government + } + flag:japan_administrative = { + if = { + limit = { + scope:new_liege ?= { has_government = japan_administrative_government } + } + change_government = japan_administrative_government + } + else = { change_government = feudal_government } + } + } + } + # Otherwise we proceed as normal + else = { + $TITLE_RECEIVER$ = { + # Change our government according to the government of our liege. + ## Nomad. + if = { + limit = { + OR = { + government_has_flag = government_is_nomadic + scope:new_liege ?= { government_has_flag = government_is_nomadic } + scope:old_government ?= flag:nomad + scope:new_capital.title_province = { + OR = { + has_holding_type = nomad_holding + has_holding_type = herder_holding + } + } + } + } + hidden_effect = { + every_held_title = { + limit = { + tier = tier_county + title_province = { has_holding_type = herder_holding } + } + title_province = { set_holding_type = nomad_holding } + } + } + change_government = nomad_government + } + ## Soryo. + else_if = { + limit = { + OR = { + scope:new_liege ?= { government_has_flag = government_is_japan_feudal } + scope:old_government ?= flag:japan_feudal + } + } + change_government = japan_feudal_government + } + ## Administrative. + else_if = { + limit = { + OR = { + scope:old_government ?= flag:admin + scope:old_government ?= flag:celestial + scope:old_government ?= flag:steppe_admin + scope:old_government ?= flag:meritocratic + scope:old_government ?= flag:japan_administrative + scope:new_liege ?= { government_allows = administrative } + } + } + change_to_administrative_effect = yes + } + ## Clan. + else_if = { + limit = { + OR = { + scope:new_liege ?= { government_has_flag = government_is_clan } + scope:old_government ?= flag:clan + AND = { + ep3_is_clan_inclined_trigger = yes + top_liege = this + } + } + } + change_government = clan_government + } + ## Tribal. + else_if = { + limit = { + OR = { + scope:new_liege ?= { government_has_flag = government_is_tribal } + scope:old_government ?= flag:tribal + } + } + change_government = tribal_government + } + ## Wanua. + else_if = { + limit = { + OR = { + scope:new_liege ?= { government_has_flag = government_is_wanua } + scope:old_government ?= flag:wanua + } + } + change_government = wanua_government + } + ## Mandala. + else_if = { + limit = { + OR = { + scope:new_liege ?= { government_has_flag = government_is_mandala } + #scope:old_government ?= flag:mandala + scope:target.holder = { government_has_flag = government_is_mandala } + } + faith = { has_doctrine = doctrine_polytheist } + } + change_government = mandala_government + #Sort out the House shenanigans + hidden_effect = { + if = { + limit = { is_house_head = no } + house = { + if = { + limit = { + house_head = { + is_landed = no + is_courtier_of = $TITLE_RECEIVER$ + } + } + set_house_head = $TITLE_RECEIVER$ + } + } + } + else = { + house ?= { + set_house_aspiration = { type = no_aspect } + } + } + } + } + ## Else feudal. + else = { + change_government = feudal_government + } + } + # Ennobled adventurer penalties + if = { + limit = { $ENNOBLED_ADVENTURER$ = flag:yes } + if = { + limit = { + calc_true_if = { + amount = 3 + prestige_level <= 3 + scope:new_capital.culture ?= { + NOR = { + $TITLE_RECEIVER$.culture ?= this + $TITLE_RECEIVER$.primary_spouse.culture ?= this + $TITLE_RECEIVER$.primary_heir.culture ?= this + } + } + scope:new_capital.faith != faith + } + } + custom_tooltip = ep3_ennobled_adventurer_modifier_reason_3 + add_character_modifier = { + modifier = ep3_ennobled_adventurer_modifier_3 + years = 30 + } + custom_tooltip = ep3_ennobled_adventurer_modifier_rules + } + else_if = { + limit = { + calc_true_if = { + amount = 2 + prestige_level <= 3 + scope:new_capital.culture ?= { + NOR = { + $TITLE_RECEIVER$.culture ?= this + $TITLE_RECEIVER$.primary_spouse.culture ?= this + $TITLE_RECEIVER$.primary_heir.culture ?= this + } + } + scope:new_capital.faith != faith + } + } + custom_tooltip = ep3_ennobled_adventurer_modifier_reason_2 + add_character_modifier = { + modifier = ep3_ennobled_adventurer_modifier_2 + years = 20 + } + custom_tooltip = ep3_ennobled_adventurer_modifier_rules + } + else_if = { + limit = { + calc_true_if = { + amount = 1 + prestige_level <= 3 + scope:new_capital.culture ?= { + NOR = { + $TITLE_RECEIVER$.culture ?= this + $TITLE_RECEIVER$.primary_spouse.culture ?= this + $TITLE_RECEIVER$.primary_heir.culture ?= this + } + } + scope:new_capital.faith != faith + } + } + custom_tooltip = ep3_ennobled_adventurer_modifier_reason_1 + add_character_modifier = { + modifier = ep3_ennobled_adventurer_modifier_1 + years = 10 + } + custom_tooltip = ep3_ennobled_adventurer_modifier_rules + } + } + } + destroy_laamp_effect = { ADVENTURER = $TITLE_RECEIVER$ } + # Setup NF if valid + if = { + limit = { government_allows = administrative } + give_new_noble_family_title_effect = yes + } +} + +ep3_become_landed_cleanup_effect = { + if = { + limit = { + exists = scope:supporter + highest_held_title_tier < scope:supporter.highest_held_title_tier + } + create_title_and_vassal_change = { + type = swear_fealty + save_scope_as = change + add_claim_on_loss = no + } + change_liege = { + liege = scope:supporter + change = scope:change + } + resolve_title_and_vassal_change = scope:change + # Message for nearby rulers + create_landed_ruler_message_effect = { + LANDED = scope:attacker + FLAVOR_CHAR = scope:supporter + FLAVOR_TITLE = scope:attacker.primary_title + REASON = flag:conquest_support + } + } + else = { + if = { + limit = { + top_liege != this + NOT = { exists = scope:new_liege } + } + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + add_claim_on_loss = no + } + becomes_independent = { change = scope:change } + resolve_title_and_vassal_change = scope:change + } + # Message for nearby rulers + create_landed_ruler_message_effect = { + LANDED = scope:attacker + FLAVOR_CHAR = scope:defender + FLAVOR_TITLE = scope:attacker.primary_title + REASON = flag:conquest + } + } +} + +ep3_become_landed_warning_effect = { + $TITLE$ = { save_scope_as = title } + $TITLE_RECEIVER$ = { custom_tooltip = seize_realm_warning } +} + +purchase_land_interaction_effect = { + # scope:actor = adventurer + # scope:recipient = seller + # purchased_titles = titles + + hidden_effect = { + scope:actor = { + if = { + limit = { character:90028 ?= this } + add_character_flag = hereward_settled_flag + } + if = { + limit = { + NOT = { has_trait = adventurer } + } + add_trait = adventurer + } + every_courtier = { + set_variable = { + name = former_camp_leader + value = scope:actor + } + add_trait = adventurer_follower + } + } + } + + # Determine hierarchy + ep3_become_landed_save_liege_effect = { + TITLE_GIVER = scope:recipient + ALWAYS_INDEPENDENT = no + TITLE_LIST = purchased_titles + } + # Purchase land specific + scope:actor = { + show_as_tooltip = { + pay_short_term_gold = { + gold = scope:purchase_land_cost + target = scope:recipient + } + } + } + # Resolve title, liege, government changes + ep3_become_landed_transfer_effect = { + TITLE_RECEIVER = scope:actor + TITLE_LIST = purchased_titles + TYPE = granted + REASON = flag:purchased + ENNOBLED_ADVENTURER = flag:yes + } + # Extra purchase land specific + scope:actor = { + stress_impact = { + greedy = minor_stress_impact_gain + lazy = minor_stress_impact_loss + } + } + # Effects on land giver + scope:recipient = { add_legitimacy = scope:purchase_land_legitimacy_cost } + # Messages for nearby players + create_landed_ruler_message_effect = { + LANDED = scope:actor + FLAVOR_CHAR = scope:recipient + FLAVOR_TITLE = scope:target + REASON = flag:purchased + } + # Hook + if = { + limit = { scope:offer_hook = yes } + scope:recipient = { + add_hook = { + type = obligation_hook + target = scope:actor + } + } + } + #Handle the government types + if = { + limit = { + scope:recipient = { government_has_flag = government_is_mandala } + #... we're lenient + faith = { has_doctrine = doctrine_polytheist } + } + #Sort out the House shenanigans + if = { + limit = { is_house_head = no } + house = { + if = { + limit = { + house_head = { + is_landed = no + is_courtier_of = root + } + } + set_house_head = root + } + } + } + else = { + house ?= { + set_house_aspiration = { type = no_aspect } + } + } + } + #Otherwise go vanilla + else = { + if = { + limit = { ep3_is_clan_inclined_trigger = yes } + change_government = clan_government + } + else = { change_government = feudal_government } + } +} + +purchase_land_interaction_shortened_effect = { + scope:actor = { + if = { + limit = { character:90028 ?= this } + custom_tooltip = ep3_story_cycle_harrying.3053.b.tt + add_character_flag = hereward_settled_flag + } + show_as_tooltip = { + pay_short_term_gold = { + gold = scope:purchase_land_cost + target = scope:recipient + } + } + hidden_effect = { + scope:recipient = { add_gold = scope:purchase_land_cost } + } + } + scope:actor = { + stress_impact = { + humble = minor_stress_impact_gain + lazy = minor_stress_impact_loss + } + if = { + limit = { + scope:target.tier = tier_duchy + } + custom_tooltip = purchase_land_interaction_shortened_effect_duchy_desc + } + else = { + custom_tooltip = purchase_land_interaction_shortened_effect_county_desc + } + if = { + limit = { + scope:target.tier = tier_duchy + } + scope:target.title_capital_county = { + save_scope_as = new_primary_title + } + } + else = { + scope:target = { + save_scope_as = new_primary_title + } + } + if = { + limit = { + calc_true_if = { + amount = 3 + prestige_level <= 3 + OR = { + scope:new_primary_title.culture != culture + primary_spouse ?= { + culture != scope:new_primary_title.culture + } + primary_heir ?= { + culture != scope:new_primary_title.culture + } + } + scope:new_primary_title.faith != faith + } + } + custom_tooltip = ep3_ennobled_adventurer_modifier_reason_3 + add_character_modifier = { + modifier = ep3_ennobled_adventurer_modifier_3 + years = 30 + } + custom_tooltip = ep3_ennobled_adventurer_modifier_rules + } + else_if = { + limit = { + calc_true_if = { + amount = 2 + prestige_level <= 3 + OR = { + scope:new_primary_title.culture != culture + primary_spouse ?= { + culture != scope:new_primary_title.culture + } + primary_heir ?= { + culture != scope:new_primary_title.culture + } + } + scope:new_primary_title.faith != faith + + } + } + custom_tooltip = ep3_ennobled_adventurer_modifier_reason_2 + add_character_modifier = { + modifier = ep3_ennobled_adventurer_modifier_2 + years = 20 + } + custom_tooltip = ep3_ennobled_adventurer_modifier_rules + } + else_if = { + limit = { + calc_true_if = { + amount = 1 + prestige_level <= 3 + OR = { + scope:new_primary_title.culture != culture + primary_spouse ?= { + culture != scope:new_primary_title.culture + } + primary_heir ?= { + culture != scope:new_primary_title.culture + } + } + scope:new_primary_title.faith != faith + + } + } + custom_tooltip = ep3_ennobled_adventurer_modifier_reason_1 + add_character_modifier = { + modifier = ep3_ennobled_adventurer_modifier_1 + years = 10 + } + custom_tooltip = ep3_ennobled_adventurer_modifier_rules + } + + } +} + +procure_estate_interaction_effect = { + if = { + limit = { scope:piety_option = yes } + if = { + limit = { faith != scope:recipient.faith } + set_character_faith = scope:recipient.faith + add_character_flag = { + flag = procure_estate_conversion + months = 1 + } + } + scope:recipient = { + add_piety = { + value = procure_estate_interaction_cost_base_piety + multiply = 0.5 + } + } + } + else_if = { + limit = { scope:gold_option = yes } + show_as_tooltip = { + pay_short_term_gold = { + target = scope:recipient + gold = procure_estate_interaction_cost_base_gold + } + } + hidden_effect = { + scope:recipient = { add_gold = procure_estate_interaction_cost_base_gold } + } + } + else_if = { + limit = { scope:hook = yes } + scope:recipient = { + add_hook = { + target = scope:actor + type = favor_hook + } + } + } + else = { + scope:recipient = { + add_prestige = { + value = procure_estate_interaction_cost_base_prestige + multiply = 0.25 + } + } + } + scope:recipient = { change_influence = medium_influence_loss } + #Scope:actor becomes ladmin + scope:actor = { + hidden_effect = { + # Liquidate camp + laamp_clear_domicile_buildings_liquidator_effect = yes + } + if = { + limit = { + scope:actor.house ?= { + any_house_member = { + any_held_title = { is_noble_family_title = yes } + top_liege = scope:recipient.top_liege + } + } + } + found_cadet_house_decision_effect = { + CHARACTER = scope:actor + PRESTIGE = major_prestige_gain + } + } + # Note our courtiers so that they don't escape. + every_courtier = { add_to_list = courtiers_list } + # Change liege + destroy_laamp_effect = { ADVENTURER = scope:actor } + hidden_effect = { + scope:recipient.top_liege = { + add_courtier = scope:actor + return_to_court = yes + } + } + create_noble_family_effect = { GOVERNMENT_GIVER = scope:recipient } + hidden_effect = { + # Return any escaped courtiers. + every_in_list = { + list = courtiers_list + limit = { + NOT = { liege_or_court_owner = scope:actor } + } + scope:actor = { add_courtier = prev } + } + # And boot any new autogenned arrivals. + every_courtier = { + limit = { + is_lowborn = yes + NOR = { + is_in_list = courtiers_list + is_close_or_extended_family_of = scope:actor + is_consort_of = scope:actor + has_important_relationship_trigger = { CHARACTER = scope:actor } + } + } + silent_disappearance_effect = yes + } + } + create_title_and_vassal_change = { + type = swear_fealty + add_claim_on_loss = no + save_scope_as = title_change + } + change_liege = { + liege = scope:recipient.top_liege + change = scope:title_change + } + resolve_title_and_vassal_change = scope:title_change + hidden_effect = { + domicile ?= { + if = { + limit = { + NOT = { domicile_location = scope:recipient.capital_province } + } + move_domicile = scope:recipient.capital_province + } + } + } + add_character_modifier = { + modifier = ep3_administrative_outsider_modifier + years = 15 + } + } + scope:recipient.top_liege = { + if = { + limit = { + is_ai = no + } + send_interface_message = { + type = msg_landless_adventurer_nearby + title = procure_estate_message_title + left_icon = scope:actor + right_icon = scope:recipient + custom_tooltip = procure_estate_message_tt + } + } + every_vassal_or_below = { + limit = { + is_ai = no + NOT = { this = scope:actor } + } + send_interface_message = { + type = msg_landless_adventurer_nearby + title = procure_estate_message_title + left_icon = scope:actor + right_icon = scope:recipient + custom_tooltip = procure_estate_message_tt + } + } + } +} + +negotiate_settlement_interaction_effect = { + # scope:actor = offerer + # scope:recipient = adventurer + # offered_titles = titles + + hidden_effect = { + scope:recipient = { + if = { + limit = { + NOT = { has_trait = adventurer } + } + add_trait = adventurer + } + every_courtier = { + set_variable = { + name = former_camp_leader + value = scope:recipient + } + add_trait = adventurer_follower + } + } + } + + # Determine hierarchy + ep3_become_landed_save_liege_effect = { + TITLE_GIVER = scope:actor + ALWAYS_INDEPENDENT = no + TITLE_LIST = offered_titles + } + # Negotiate settlement specific + scope:recipient = { + # End relevant wars + every_character_war = { + limit = { + OR = { + primary_attacker = scope:recipient + primary_defender = scope:recipient + } + } + end_war = white_peace + } + # Remove from relevant wars + every_character_war = { + limit = { + NOR = { + primary_attacker = scope:recipient + primary_defender = scope:recipient + } + any_war_defender = { + OR = { + this = scope:actor + this.top_liege = scope:actor.top_liege + } + } + } + remove_participant = scope:recipient + } + } + # Resolve title, liege, government changes + ep3_become_landed_transfer_effect = { + TITLE_RECEIVER = scope:recipient + TITLE_LIST = offered_titles + TYPE = granted + REASON = flag:negotiated + ENNOBLED_ADVENTURER = flag:yes + } + # Effects on land giver + scope:actor = { + add_legitimacy = scope:negotiate_settlement_legitimacy_cost + stress_impact = { + greedy = minor_stress_impact_gain + vengeful = minor_stress_impact_gain + } + } + # Messages for nearby players + create_landed_ruler_message_effect = { + LANDED = scope:recipient + FLAVOR_CHAR = scope:actor + FLAVOR_TITLE = scope:new_primary_title + REASON = flag:negotiated + } + # And, just in case it's failed, make sure that we've vassalised our new friend. + hidden_effect = { + if = { + limit = { + scope:recipient = { + highest_held_title_tier < scope:actor.highest_held_title_tier + top_liege = this + } + } + create_title_and_vassal_change = { + type = swear_fealty + save_scope_as = change + } + scope:recipient = { + change_liege = { + liege = scope:actor + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change + } + } +} + +create_landed_ruler_message_effect = { + hidden_effect = { + $LANDED$ = { save_scope_as = landed } + $FLAVOR_CHAR$ = { save_scope_as = landed_flavor_char } + $FLAVOR_TITLE$ = { save_scope_as = landed_flavor_title } + save_scope_value_as = { + name = landed_creation_reason + value = $REASON$ + } + every_player = { + limit = { + NOR = { + this = scope:landed + this = scope:landed_flavor_char + } + top_liege = scope:landed.top_liege + } + send_interface_message = { + type = msg_landless_adventurer_nearby + title = nearby_landed_ruler_created_message_title + left_icon = scope:landed + right_icon = scope:landed_flavor_char + switch = { + trigger = scope:landed_creation_reason + flag:purchased = { custom_tooltip = nearby_landed_ruler_created_message_purchased_tt } + flag:negotiated = { custom_tooltip = nearby_landed_ruler_created_message_negotiated_tt } + flag:seized_pastureland = { custom_tooltip = nearby_landed_ruler_created_message_seized_pastureland_tt } + flag:conquest_supporter = { custom_tooltip = nearby_landed_ruler_created_message_conquest_support_tt } + flag:conquest = { custom_tooltip = nearby_landed_ruler_created_message_conquest_tt } + flag:seize_realm = { custom_tooltip = nearby_landed_ruler_created_message_seize_realm_tt } + flag:culture_champion = { custom_tooltip = nearby_landed_ruler_created_message_culture_champion_tt } + fallback = { custom_tooltip = nearby_landed_ruler_created_message_fallback_tt } + } + } + } + } +} + +conquest_supporter_memory_variable_effect = { + set_variable = { + name = ascended_throne_reason + value = flag:conquest_supporter + weeks = 1 + } + set_variable = { + name = ascended_throne_extra + value = scope:supporter + weeks = 1 + } +} + +ep3_laamp_supporter_invalidated_effect = { + if = { + limit = { exists = var:adventurer_invasion_supporter } + save_scope_as = adventurer + var:adventurer_invasion_supporter ?= { save_scope_as = supporter } + var:adventurer_invasion_target ?= { save_scope_as = war_target } + } + else_if = { + limit = { exists = var:adventurer_invasion_supportee } + var:adventurer_invasion_supportee ?= { save_scope_as = adventurer } + var:adventurer_invasion_target ?= { save_scope_as = target } + save_scope_as = supporter + } + if = { + limit = { + exists = scope:adventurer + exists = scope:supporter + exists = scope:war_target + } + scope:adventurer ?= { + send_interface_message = { + type = event_landless_adventurer_neutral + title = ep3_laamp_sponsor_invalidated_title + left_icon = scope:supporter + right_icon = scope:war_target + remove_variable = adventurer_invasion_supporter + remove_variable = adventurer_invasion_target + custom_tooltip = ep3_laamp_sponsor_invalidated_adventurer + } + } + scope:supporter ?= { + send_interface_message = { + type = event_landless_adventurer_neutral + title = ep3_laamp_sponsor_invalidated_title + left_icon = scope:attacker + right_icon = scope:war_target + remove_variable = adventurer_invasion_supportee + remove_variable = adventurer_invasion_target + custom_tooltip = ep3_laamp_sponsor_invalidated_supporter + if = { + limit = { exists = var:adventurer_invasion_join_war } + set_variable = { + name = adventurer_invasion_join_war + value = scope:actor + years = 5 + } + } + if = { + limit = { exists = var:adventurer_invasion_request_soldiers } + set_variable = { + name = adventurer_invasion_request_soldiers + value = scope:actor + years = 5 + } + } + } + } + } +} + +ep3_laamp_support_variable_cleanup_effect = { + if = { + limit = { exists = var:adventurer_invasion_supporter } + save_scope_as = adventurer + var:adventurer_invasion_supporter ?= { save_scope_as = supporter } + var:adventurer_invasion_target ?= { save_scope_as = war_target } + } + else_if = { + limit = { exists = var:adventurer_invasion_supportee } + var:adventurer_invasion_supportee ?= { save_scope_as = adventurer } + var:adventurer_invasion_target ?= { save_scope_as = war_target } + save_scope_as = supporter + } + scope:adventurer ?= { + remove_variable = adventurer_invasion_supporter + remove_variable = adventurer_invasion_target + } + scope:supporter ?= { + remove_variable = adventurer_invasion_supportee + remove_variable = adventurer_invasion_target + } +} + +seize_realm_scheme_success_effect = { + # scope:target = ruler + # scope:owner = adventurer + + hidden_effect = { + scope:owner = { + if = { + limit = { + NOT = { has_trait = adventurer } + } + add_trait = adventurer + } + every_courtier = { + set_variable = { + name = former_camp_leader + value = scope:owner + } + add_trait = adventurer_follower + } + } + } + + scope:target = { + save_scope_as = background_dungeon_scope + save_scope_as = background_courtyard_scope + save_scope_as = background_throne_room_scope + every_held_title = { + limit = { + is_leased_out = no + is_landless_type_title = no + is_head_of_faith = no + } + add_to_list = seized_titles + } + ordered_in_list = { + list = seized_titles + order_by = tier + save_scope_as = realm_title + } + } + # Determine independent vassals + adventurer_realm_destabilisation_list_effect = { + TITLE_GIVER = scope:target + TITLE_RECEIVER = scope:owner + TITLE = scope:target.primary_title + } + # Determine hierarchy + ep3_become_landed_save_liege_effect = { + TITLE_GIVER = scope:target + ALWAYS_INDEPENDENT = no + TITLE_LIST = seized_titles + } + # Resolve title, liege, government changes + ep3_become_landed_transfer_effect = { + TITLE_RECEIVER = scope:owner + TITLE_LIST = seized_titles + TYPE = usurped + REASON = flag:seize_realm + ENNOBLED_ADVENTURER = flag:yes + } + # Old ruler's fate + if = { + limit = { exists = scope:death } + scope:target = { + death = { death_reason = death_fight } + } + } + else_if = { + limit = { exists = scope:imprison } + scope:target = { add_character_flag = was_abducted_block_notification_event } + rightfully_imprison_character_less_verbose_effect = { + TARGET = scope:target + IMPRISONER = scope:owner + } + } + add_clan_unity_interaction_effect = { + CHARACTER = scope:owner + TARGET = scope:target + VALUE = medium_unity_loss + DESC = clan_unity_seize_realm_attempted.desc + REVERSE_NON_HOUSE_TARGET = no + } + successful_seize_realm_opinion_effect = { + VICTIM = scope:target + PLOTTER = scope:owner + } + # Vassals break away + adventurer_realm_destabilisation_transfer_effect = { + TITLE_RECEIVER = scope:owner + TITLE_GIVER = scope:target + TITLE = scope:realm_title + TITLE_LIST = seized_titles + } + # Messages for nearby players + create_landed_ruler_message_effect = { + LANDED = scope:owner + FLAVOR_CHAR = scope:target + FLAVOR_TITLE = scope:realm_title + REASON = flag:seize_realm + } + scope:owner = { + create_character_memory = { + type = seized_realm_memory + participants = { deposed = scope:target } + } + ordered_memory = { + memory_type = seized_realm_memory + order_by = memory_creation_date + if = { + limit = { + NOT = { exists = var:realm } + } + set_variable = { + name = realm + value = scope:realm_title + } + } + } + } + scope:target = { + create_character_memory = { + type = realm_seized_memory + participants = { deposer = scope:owner } + } + ordered_memory = { + memory_type = realm_seized_memory + order_by = memory_creation_date + if = { + limit = { + NOT = { exists = var:realm } + } + set_variable = { + name = realm + value = scope:realm_title + } + } + } + } +} + +seize_realm_scheme_failure_effect = { + scope:scheme = { end_scheme = yes } + #Add Watchful Modifier to the target + scope:target = { + save_scope_as = background_dungeon_scope + save_scope_as = background_courtyard_scope + save_scope_as = background_throne_room_scope + ordered_held_title = { + limit = { + is_leased_out = no + is_landless_type_title = no + is_head_of_faith = no + } + order_by = tier + save_scope_as = realm_title + } + show_as_tooltip = { + add_character_modifier = { + modifier = watchful_modifier + days = watchful_modifier_duration + } + } + } + # Old ruler's fate + if = { + limit = { exists = scope:death } + scope:owner = { + death = { death_reason = death_fight } + } + } + else = { + scope:owner = { + create_character_memory = { + type = seized_realm_failed_memory + participants = { deposed = scope:target } + } + ordered_memory = { + memory_type = seized_realm_failed_memory + order_by = memory_creation_date + if = { + limit = { + NOT = { exists = var:realm } + } + set_variable = { + name = realm + value = scope:realm_title + } + } + } + } + if = { + limit = { exists = scope:imprison } + scope:owner = { add_character_flag = was_abducted_block_notification_event } + rightfully_imprison_character_less_verbose_effect = { + TARGET = scope:owner + IMPRISONER = scope:target + } + hidden_effect = { change_prison_type = dungeon } + } + } + attempted_seize_realm_opinion_effect = { + VICTIM = scope:target + PLOTTER = scope:owner + } + # If we're a clan this affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:owner + TARGET = scope:target + VALUE = medium_unity_loss + DESC = clan_unity_seize_realm_attempted.desc + REVERSE_NON_HOUSE_TARGET = no + } + scope:target = { + create_character_memory = { + type = realm_seized_failed_memory + participants = { deposer = scope:owner } + } + ordered_memory = { + memory_type = realm_seized_failed_memory + order_by = memory_creation_date + if = { + limit = { + NOT = { exists = var:realm } + } + set_variable = { + name = realm + value = scope:realm_title + } + } + } + } +} + +successful_seize_realm_opinion_effect = { + $VICTIM$ = { + if = { + limit = { is_alive = yes } + add_opinion = { + target = $PLOTTER$ + modifier = seized_my_realm_crime + } + set_relation_rival = { + target = scope:owner + reason = rival_seized_realm_reason + } + } + every_spouse = { + limit = { + NOR = { + this = $PLOTTER$ + is_spouse_of = $PLOTTER$ + is_close_family_of = $PLOTTER$ + } + } + add_to_temporary_list = close_family_seize_realm_opinion_list + } + every_close_family_member = { + limit = { + NOR = { + this = $PLOTTER$ + is_spouse_of = $PLOTTER$ + is_close_family_of = $PLOTTER$ + } + } + add_to_temporary_list = close_family_seize_realm_opinion_list + } + every_in_list = { + list = close_family_seize_realm_opinion_list + custom = all_close_family_and_spouses + add_opinion = { + target = $PLOTTER$ + modifier = seized_close_family_realm_crime + } + } + } +} + +attempted_seize_realm_opinion_effect = { + $VICTIM$ = { + if = { + limit = { is_alive = yes } + add_opinion = { + target = $PLOTTER$ + modifier = attempted_to_seize_my_realm_crime + } + } + every_spouse = { + limit = { NOT = { this = $PLOTTER$ } } + add_to_temporary_list = close_family_seize_realm_opinion_list + } + every_close_family_member = { + limit = { NOT = { this = $PLOTTER$ } } + add_to_temporary_list = close_family_seize_realm_opinion_list + } + + if = { + limit = { + any_in_list = { list = close_family_seize_realm_opinion_list } + } + every_in_list = { + list = close_family_seize_realm_opinion_list + custom = all_close_family_and_spouses + add_opinion = { + target = $PLOTTER$ + modifier = attempted_to_seize_realm_close_family_crime + } + } + } + + } +} + +adventurer_realm_destabilisation_list_effect = { + $TITLE_RECEIVER$ = { save_scope_as = adventurer } + $TITLE$ = { save_scope_as = title } + $TITLE_GIVER$ = { + save_scope_as = ruler + # Determine vassal sentiment - calculated before ruler change + hidden_effect = { + every_vassal = { + limit = { + highest_held_title_tier >= tier_county + save_temporary_scope_as = vassal_temp + # Only vassals who will not *still* be de jure vassals of the title loser via other titles + trigger_if = { + limit = { + $TITLE_GIVER$ = { + any_held_title = { + tier >= scope:title.tier + this != scope:title + } + } + } + any_held_title = { + target_is_de_jure_liege_or_above = scope:title + } + } + trigger_if = { + limit = { + government_allows = administrative + } + scope:title = { + OR = { + AND = { + scope:ruler.primary_title.tier = tier_kingdom + tier < tier_kingdom + } + tier < tier_empire + } + } + } + } + # Calculate how likely are they to not become your vassal + random = { + chance = 0 + ### FAITH/CULTURE + modifier = { # Cultural acceptance differences + add = { + value = "culture.cultural_acceptance(scope:adventurer.culture)" + subtract = 100 + abs = yes + divide = 5 + } + culture = { + this != scope:adventurer.culture + cultural_acceptance = { + target = scope:adventurer.culture + value < 50 + } + OR = { + this = scope:ruler.culture + "cultural_acceptance(scope:ruler.culture)" > "cultural_acceptance(scope:adventurer.culture)" + } + } + } + modifier = { # Zealous of other faiths more likely + add = { + value = ai_zeal + multiply = 0.15 + multiply = "scope:vassal_temp.faith.faith_hostility_level(scope:adventurer.faith)" + max = 25 + } + ai_zeal > low_positive_zeal + faith = { + this != scope:adventurer.faith + "faith_hostility_level(scope:adventurer.faith)" > 0 + } + } + modifier = { # Theocatic Vassals of different faith more likely + factor = 2 + has_government = theocracy_government + faith != scope:adventurer.faith + } + ### DISTANCE + modifier = { # Distant vassals more likely + add = { + value = 0 + add = scope:distance + if = { + limit = { scope:distance >= squared_distance_medium } + add = scope:distance + multiply = 0.0001 + } + max = 25 + } + "capital_county.squared_distance(scope:ruler.capital_county)" >= squared_distance_medium + capital_county = { + save_temporary_scope_value_as = { + name = distance + value = "squared_distance(scope:ruler.capital_county)" + } + } + } + ### PERSONALITY + ai_value_modifier = { + ai_boldness = 0.15 + ai_energy = 0.15 + ai_greed = 0.15 + ai_honor = -0.15 + } + ### OPINION + opinion_modifier = { # More likely if dislikes adventurer + opinion_target = scope:adventurer + multiplier = -0.25 + } + opinion_modifier = { # More likely if liked old ruler + opinion_target = scope:ruler + multiplier = 0.1 + } + ### STRENGTH + modifier = { # Small vassals less likely + add = -15 + tier_difference = { + target = scope:ruler + value <= -2 + } + } + modifier = { + add = -25 + realm_size < tiny_realm_size + } + modifier = { # Powerful vassals more likely + factor = 1.25 + is_powerful_vassal = yes + } + modifier = { # Powerful vassals more likely + add = { + value = highest_held_title_tier + multiply = 5 + } + } + ### RELEVANCE + modifier = { # Fringe vassals more likely + factor = 1.25 + any_sub_realm_county = { + any_neighboring_county = { holder.top_liege != scope:ruler } + } + } + modifier = { # Core vassals less likely + factor = 0.75 + scope:ruler.capital_county.kingdom = { + any_de_jure_county = { this = scope:vassal_temp.capital_county } + } + } + ### FAMILY + modifier = { # Relatives of deposed more likely + factor = 1.1 + is_close_family_of = scope:ruler + NOT = { is_close_family_of = scope:adventurer } + } + modifier = { # Dynasts of deposed more likely + factor = 1.1 + dynasty ?= { + this = scope:ruler.dynasty + this != scope:adventurer.dynasty + } + } + modifier = { # Relatives of adventurer less likely + factor = 0.75 + is_close_family_of = scope:adventurer + NOT = { is_close_family_of = scope:ruler } + } + modifier = { # Dynasts of adventurer less likely + factor = 0.75 + dynasty ?= { + this = scope:adventurer.dynasty + this != scope:ruler.dynasty + } + } + ### HOOKS + modifier = { + factor = 0 + scope:adventurer = { has_hook = scope:vassal_temp } + } + modifier = { + factor = 2 + scope:ruler = { has_hook = scope:vassal_temp } + } + ### TIER + modifier = { + factor = 1.5 + scope:ruler.primary_title.tier = tier_empire + } + modifier = { + factor = 1.25 + scope:ruler.primary_title.tier = tier_kingdom + } + max = 95 + add_to_list = independent_vassals + } + } + # Save heirs for claimant wars + scope:title = { + every_title_heir = { + limit = { + save_temporary_scope_as = heir_temp + scope:title = { + place_in_line_of_succession = { + target = scope:heir_temp + value <= 5 + } + } + } + add_to_list = heirs + } + } + } + } +} + +adventurer_realm_destabilisation_civil_war_effect = { + $TITLE_GIVER$ = { save_scope_as = ruler } + $TITLE_RECEIVER$ = { save_scope_as = adventurer } + $TITLE$ = { save_scope_as = title } + if = { + limit = { + any_in_list = { list = independent_vassals } + } + scope:ruler = { + if = { + limit = { is_alive = yes } + save_scope_as = claimant + } + else_if = { + limit = { + any_in_list = { list = heirs } + } + random_in_list = { + list = heirs + limit = { has_strong_claim_on = scope:realm } + alternative_limit = { has_weak_claim_on = scope:realm } + weight = { + base = 1 + modifier = { add = age } + } + save_scope_as = claimant + } + } + else_if = { + limit = { + scope:title = { + any_claimant = { + this != scope:adventurer + } + } + } + scope:title = { + random_claimant = { + limit = { has_strong_claim_on = scope:realm } + alternative_limit = { has_weak_claim_on = scope:realm } + weight = { + base = 1 + modifier = { add = age } + } + save_scope_as = claimant + } + } + } + else = { + ordered_in_list = { + list = independent_vassals + order_by = max_military_strength + save_scope_as = claimant + } + } + } + # Vassals Breakaway + ordered_in_list = { + list = independent_vassals + limit = { + can_create_faction = { + type = claimant_faction + target = scope:adventurer + } + } + order_by = max_military_strength + save_scope_as = revolt_leader + create_faction = { + type = claimant_faction + target = scope:adventurer + } + joined_faction = { + save_scope_as = faction + set_special_character = scope:claimant + set_special_title = scope:realm + } + } + every_in_list = { + list = independent_vassals + limit = { + this != scope:revolt_leader + can_join_faction = scope:faction + } + join_faction = scope:faction + } + scope:faction = { + faction_start_war = { title = scope:realm } + } + } +} + +adventurer_realm_destabilisation_transfer_effect = { + $TITLE_RECEIVER$ = { save_scope_as = adventurer } + $TITLE_GIVER$ = { save_scope_as = ruler } + $TITLE$ = { save_scope_as = title } + if = { + limit = { + any_in_list = { list = independent_vassals } + } + # Vassals Breakaway + create_title_and_vassal_change = { + type = independency + add_claim_on_loss = yes + save_scope_as = change + } + hidden_effect = { + every_in_list = { + list = independent_vassals + save_temporary_scope_as = vassal_temp + if = { + limit = { + scope:adventurer = { top_liege = this } + scope:ruler = { + NOT = { + any_held_title = { + this != scope:title + any_in_de_jure_hierarchy = { this = scope:vassal_temp.primary_title } + } + } + } + } + becomes_independent = { change = scope:change } + } + else_if = { + limit = { + scope:ruler = { + NOT = { + any_held_title = { + this != scope:title + any_in_de_jure_hierarchy = { this = scope:vassal_temp.primary_title } + } + } + } + } + change_liege = { + liege = scope:adventurer.liege + change = scope:change + } + } + add_opinion = { + modifier = seized_lieges_realm_crime + target = scope:adventurer + } + } + } + resolve_title_and_vassal_change = scope:change + } + create_title_and_vassal_change = { + type = conquest + add_claim_on_loss = yes + save_scope_as = change + } + hidden_effect = { + every_in_list = { + list = $TITLE_LIST$ + limit = { tier >= tier_county } + custom_tooltip = CONQUEST_CB_TITLE + every_in_de_jure_hierarchy = { + continue = { tier >= tier_duchy } + limit = { + tier >= tier_county + holder ?= { + OR = { + this = scope:ruler + target_is_liege_or_above = scope:ruler + } + } + } + save_temporary_scope_as = title_temp + if = { + limit = { + holder != scope:adventurer + OR = { + holder = scope:ruler + holder.highest_held_title_tier >= scope:title.tier + scope:adventurer = { has_claim_on = scope:title_temp } + } + } + add_to_temporary_list = titles_taken + } + else = { + holder = { + if = { + limit = { + liege = scope:ruler + NOT = { is_in_list = independent_vassals } + } + add_to_temporary_list = vassals_taken + } + } + } + } + } + } + hidden_effect = { + every_in_list = { + list = vassals_taken + change_liege = { + liege = scope:adventurer + change = scope:change + } + } + } + resolve_title_and_vassal_change = scope:change +} + +player_adventurer_contract_generation_on_domicile_moved_effect = { + if = { + limit = { player_adventurer_sufficient_distance_for_contract_spawn_trigger = yes } + save_temporary_scope_as = char_temp + if = { # Explorers + limit = { has_realm_law = camp_purpose_explorers } + populate_task_contracts_for_area = { + location = scope:char_temp.location + amount = 1 + group = { laamp_contracts_transport_group } + } + } + else_if = { # Mercenaries + limit = { has_realm_law = camp_purpose_mercenaries } + populate_task_contracts_for_area = { + location = scope:char_temp.location + amount = 1 + group = { laamp_contracts_war_group } + } + ordered_independent_ruler = { + limit = { + in_diplomatic_range = scope:char_temp + scope:char_temp = { + can_create_task_contract = { + type_name = laamp_join_war_contract + employer = prev + } + } + } + order_by = { + value = 0 + subtract = "capital_county.squared_distance(scope:char_temp.domicile.domicile_location)" + } + ordered_character_war = { + limit = { + ep3_adventurer_mercenary_war_trigger = { + EMPLOYER = prev + LAAMP = scope:char_temp + } + } + order_by = war_total_participants_current_strength_value + primary_defender ?= { save_scope_as = defender } + primary_attacker ?= { save_scope_as = attacker } + save_scope_as = war + scope:char_temp = { + spawn_join_war_contracts_effect = { + WAR = scope:war + LAAMP = scope:char_temp + ATTACKER = scope:attacker + DEFENDER = scope:defender + } + } + } + } + debug_log = "WAR_1" + debug_log_scopes = yes + } + populate_location_with_contracts_effect = { + AREA_CHAR = scope:char_temp + AMOUNT = 3 + } + # Log that we visited this place. + add_to_variable_list = { + name = laamp_recently_visited_kingdoms + target = scope:kingdom_temp + years = 5 + } + } +} + +player_adventurer_contract_generation_on_wait_in_place_effect = { + if = { + limit = { player_adventurer_sufficient_distance_for_contract_spawn_trigger = yes } + # Track where we are. + set_variable = { + name = contract_passive_spawn_location + value = location.kingdom + } + # Reset the tally. + set_variable = { + name = contract_passive_spawn_tally + value = 0 + } + # Queue up an additional contract. + trigger_event = { + id = ep3_laamps.9981 + months = { 4 6 } + } + } +} + +contract_passive_spawn_effect = { + #count how many contracts you already have + every_character_task_contract = { + add_to_list = num_of_contracts_before + } + # G'is a contract. + populate_location_with_contracts_effect = { + AREA_CHAR = root + AMOUNT = $SPAWN_CONTRACTS$ + } + #count them again to see if the effect above spawned something + every_character_task_contract = { + add_to_list = num_of_contracts_after + } + set_local_variable = { + name = current_value + value = list_size:num_of_contracts_before + } + # Make sure we don't get too many of them just sitting in one place. + while = { + limit = { + local_var:current_value < list_size:num_of_contracts_after + } + increment_variable_effect = { + VAR = contract_passive_spawn_tally + VAL = 1 + } + change_local_variable = { + name = current_value + add = 1 + } + } +} + +#spawns a valid task contract for a landless adventurer +# root = landless adventurer +# TASK_CONTRACT_TYPE = type name of a task contract you want to spawn +# SPAWN_POINT = where you want the task contract to appear on the map +laamp_spawn_valid_task_contract = { + $SPAWN_POINT$ = { + save_scope_as = spawn_location + } + random_ruler = { + limit = { + root = { + can_create_task_contract = { + type_name = $TASK_CONTRACT_TYPE$ + employer = prev + } + } + } + save_scope_as = employer + } + create_task_contract = { + task_contract_type = $TASK_CONTRACT_TYPE$ + task_contract_tier = scope:employer.task_contract_tier_value + location = scope:spawn_location + task_contract_employer = scope:employer + } +} + +points_of_interest_tracker_effect = { + if = { + limit = { + government_has_flag = government_is_landless_adventurer + location = { + save_temporary_scope_as = province_temp + OR = { + # Building flags + has_any_point_of_interest_flag = yes + # Capitals + AND = { + province_owner.top_liege.capital_province ?= this + province_owner.top_liege ?= { highest_held_title_tier >= tier_kingdom } + } + # Grand Cities + this = province:4828 #Baghdad + this = province:2575 #Rome + this = province:496 #Constantinople + # Points of interest + this = province:747 # Halikarnassos + this = province:6053 # Alexandria + # Legend stuff + any_legend = { + legend_owner.capital_province ?= scope:province_temp + OR = { + legend_quality = illustrious + legend_quality = mythical + } + } + } + } + } + if = { + limit = { + NOT = { + has_variable = poi_visited + } + } + set_variable = { + name = poi_visited + value = 1 + } + } + else = { + change_variable = { + name = poi_visited + add = 1 + } + } + } +} + +zealous_missionary_conversion_effect = { + if = { + limit = { + exists = location.barony.holder + government_has_flag = government_is_landless_adventurer + has_character_flag = zealous_missionary_timer + location.county ?= { hasan_evangelize_province_trigger = yes } + } + trigger_event = ep3_laamp_decision_event.1103 + } +} + +war_contracts_completed_tracker_effect = { + if = { + limit = { + government_has_flag = government_is_landless_adventurer + has_variable = war_contract_tracker + } + change_variable = { + name = war_contract_tracker + add = 1 + } + } + else_if = { + limit = { + government_has_flag = government_is_landless_adventurer + } + set_variable = { + name = war_contract_tracker + value = 1 + } + } +} + +bandit_king_maa_spawn_effect = { + + save_scope_as = bandit_king + if = { + limit = { + has_character_modifier = bandit_king_modifier + } + set_variable = { + name = maa_number + value = 1 + } + if = { + limit = { + scope:extra_reward ?= flag:yes + } + change_variable = { + name = maa_number + add = 2 + } + } + if = { + limit = { + calc_true_if = { + amount >= 4 + has_trait_xp = { + trait = gallowsbait + track = bandit + value >= 60 + } + has_trait_xp = { + trait = gallowsbait + track = marauder + value >= 60 + } + has_trait_xp = { + trait = gallowsbait + track = poacher + value >= 60 + } + has_trait_xp = { + trait = gallowsbait + track = thief + value >= 60 + } + has_trait_xp = { + trait = gallowsbait + track = trickster + value >= 60 + } + } + } + change_variable = { + name = maa_number + add = 2 + } + } + else_if = { + limit = { + calc_true_if = { + amount >= 2 + has_trait_xp = { + trait = gallowsbait + track = bandit + value >= 60 + } + has_trait_xp = { + trait = gallowsbait + track = marauder + value >= 60 + } + has_trait_xp = { + trait = gallowsbait + track = poacher + value >= 60 + } + has_trait_xp = { + trait = gallowsbait + track = thief + value >= 60 + } + has_trait_xp = { + trait = gallowsbait + track = trickster + value >= 60 + } + } + } + change_variable = { + name = maa_number + add = 1 + } + } + else_if = { + limit = { + OR = { + has_trait_xp = { + trait = gallowsbait + track = bandit + value >= 60 + } + has_trait_xp = { + trait = gallowsbait + track = marauder + value >= 60 + } + has_trait_xp = { + trait = gallowsbait + track = poacher + value >= 60 + } + has_trait_xp = { + trait = gallowsbait + track = thief + value >= 60 + } + has_trait_xp = { + trait = gallowsbait + track = trickster + value >= 60 + } + } + } + change_variable = { + name = maa_number + add = 1 + } + } + custom_tooltip = bandit_king_maa_spawn_effect_desc #otherwise the tooltip looks crazy + hidden_effect = { + random_list = { + 1 = { + spawn_army = { + men_at_arms = { + type = maa_poachers + stacks = var:maa_number + } + inheritable = no + uses_supply = yes + location = scope:bandit_king.location + name = ep3_poachers_army + } + spawn_army = { + men_at_arms = { + type = maa_thieves + stacks = var:maa_number + } + inheritable = no + uses_supply = yes + location = scope:bandit_king.location + name = ep3_bandits_army + } + } + 1 = { + spawn_army = { + men_at_arms = { + type = maa_bandits + stacks = var:maa_number + } + inheritable = no + uses_supply = yes + location = scope:bandit_king.location + name = ep3_bandits_army + } + spawn_army = { + men_at_arms = { + type = maa_thieves + stacks = var:maa_number + } + inheritable = no + uses_supply = yes + location = scope:bandit_king.location + name = ep3_bandits_army + } + } + } + } + } +} + +absolve_crusaders_of_gallowsbait_effect = { + if = { + limit = { + has_trait_xp = { + trait = gallowsbait + track = bandit + value >= 1 + } + } + add_trait_xp = { + trait = gallowsbait + track = bandit + value = crusader_absolution_xp_removed_per_track_value + } + } + if = { + limit = { + has_trait_xp = { + trait = gallowsbait + track = trickster + value >= 1 + } + } + add_trait_xp = { + trait = gallowsbait + track = trickster + value = crusader_absolution_xp_removed_per_track_value + } + } + if = { + limit = { + has_trait_xp = { + trait = gallowsbait + track = thief + value >= 1 + } + } + add_trait_xp = { + trait = gallowsbait + track = thief + value = crusader_absolution_xp_removed_per_track_value + } + } + if = { + limit = { + has_trait_xp = { + trait = gallowsbait + track = poacher + value >= 1 + } + } + add_trait_xp = { + trait = gallowsbait + track = poacher + value = crusader_absolution_xp_removed_per_track_value + } + } + if = { + limit = { + has_trait_xp = { + trait = gallowsbait + track = marauder + value >= 1 + } + } + add_trait_xp = { + trait = gallowsbait + track = marauder + value = crusader_absolution_xp_removed_per_track_value + } + } + if = { + limit = { + has_trait_xp = { + trait = gallowsbait + track = bandit + value <= crusader_absolution_min_xp_to_remove_trait_value + } + has_trait_xp = { + trait = gallowsbait + track = trickster + value <= crusader_absolution_min_xp_to_remove_trait_value + } + has_trait_xp = { + trait = gallowsbait + track = thief + value <= crusader_absolution_min_xp_to_remove_trait_value + } + has_trait_xp = { + trait = gallowsbait + track = poacher + value <= crusader_absolution_min_xp_to_remove_trait_value + } + has_trait_xp = { + trait = gallowsbait + track = marauder + value <= crusader_absolution_min_xp_to_remove_trait_value + } + } + remove_trait = gallowsbait + } +} + +temporarily_lock_visit_settlement_effect = { + set_variable = { + name = ep3_laamp_decision_1000_is_visiting + days = visit_settlement_lock_days + } +} + +################################################## +# Admin Government +################################################## + +torture_grants_influence_effect = { + if = { + limit = { + domicile ?= { has_domicile_parameter = estate_torture_grants_influence } + } + change_influence = medium_influence_gain + } +} + +create_noble_family_effect = { + debug_log = create_noble_family_title + save_scope_as = new_noble_family_holder + $GOVERNMENT_GIVER$ = { save_scope_as = government_giver } + hidden_effect = { # NF can only be held by house heads + if = { # Start by checking that we are not the house head already + limit = { + exists = house.house_head + NOT = { house.house_head = scope:new_noble_family_holder } + } + if = { # If not, let's see if it would be reasonable to become house head... + limit = { + house.house_head ?= { + is_ai = yes # Don't steal house head from a player + OR = { + # Within same realm but less important + AND = { + top_liege = scope:new_noble_family_holder.top_liege + OR = { + is_ruler = no + highest_held_title_tier < scope:new_noble_family_holder.highest_held_title_tier + } + } + # Wanderer + NOT = { exists = liege } + } + } + } + house = { set_house_head = scope:new_noble_family_holder } + } + else = { # ... Otherwise, we create a cadet branch + create_cadet_branch = {} + } + } + } + scope:government_giver = { + if = { + limit = { + scope:new_noble_family_holder = { + NOT = { + any_held_title = { is_noble_family_title = yes } + } + } + } + switch = { + trigger = has_government + japan_administrative_government = { # Japan has count level NFs + scope:new_noble_family_holder = { + give_noble_family_title = { + name = noble_family_name + tier = county + article = DEFAULT_TITLE_NAME_ARTICLE + government = japan_administrative_government + save_scope_as = new_title + } + } + } + japan_feudal_government = { # Japan has count level NFs + scope:new_noble_family_holder = { + give_noble_family_title = { + name = noble_family_name + tier = county + article = DEFAULT_TITLE_NAME_ARTICLE + government = japan_feudal_government + save_scope_as = new_title + } + } + } + celestial_government = { # China has different government + scope:new_noble_family_holder = { + give_noble_family_title = { + name = noble_family_name + tier = county + article = DEFAULT_TITLE_NAME_ARTICLE + government = celestial_government + save_scope_as = new_title + } + trigger_event = { + id = tgp_china_career.0001 + days = { 2 5 } + } + } + } + meritocratic_government = { # Meritocratic has different government + scope:new_noble_family_holder = { + give_noble_family_title = { + name = noble_family_name + tier = county + article = DEFAULT_TITLE_NAME_ARTICLE + government = meritocratic_government + save_scope_as = new_title + } + } + } + steppe_admin_government = { # Steppe Admin has different government + scope:new_noble_family_holder = { + give_noble_family_title = { + name = noble_family_name + tier = county + article = DEFAULT_TITLE_NAME_ARTICLE + government = steppe_admin_government + save_scope_as = new_title + } + } + } + fallback = { + scope:new_noble_family_holder = { + give_noble_family_title = { + name = noble_family_name + tier = duchy + article = DEFAULT_TITLE_NAME_ARTICLE + government = administrative_government + save_scope_as = new_title + } + } + } + } + } + scope:new_title.holder ?= { + save_scope_as = noble_family_head + scope:new_title = { set_coa = scope:noble_family_head.house } + } + custom_description = { text = create_noble_family_tt } + + #Notifications + every_player = { + limit = { + top_liege = scope:new_noble_family_holder.top_liege + this != scope:new_noble_family_holder + # China has hundreds of Noble Families, it gets spammy + NOT = { government_allows = merit } + } + trigger_event = { + id = ep3_emperor_yearly.2410 + days = 1 + } + } + } + + debug_log_scopes = yes +} + +increase_governance_effect = { + # VALUE - The amount of XP added to the Governor trait/increased chance to gain the Governor trait + save_scope_value_as = { + name = governor_xp_gain + value = { + value = $VALUE$ + if = { + limit = { + exists = scope:task_contract + } + multiply = governance_task_contract_tier_value + + if = { + limit = { + $VALUE$ > 0 + domicile ?= { has_domicile_parameter = estate_governor_trait_xp_bonus_for_contracts } + } + multiply = { + value = 1 + add = estate_governance_contract_bonus_value + } + } + } + } + } + # Double-check if you have the governor trait - If not, let's make sure you get it + if = { + limit = { + NOT = { has_trait = governor } + is_governor = yes + } + add_trait = governor + } + # If you have the trait, let's increase your XP for it + else_if = { + limit = { + has_trait = governor + } + add_trait_xp = { + trait = governor + value = scope:governor_xp_gain + } + } +} + +spawn_governance_contract_effect = { + save_scope_as = governor + # Select the Contract Tier (somewhat randomized, based on your experience as a governor) + random_list = { + 30 = { + save_scope_value_as = { + name = governance_task_contract_tier + value = define:NTaskContract|LOW_TASK_CONTRACT_TIER + } + } + 20 = { + save_scope_value_as = { + name = governance_task_contract_tier + value = define:NTaskContract|MEDIUM_TASK_CONTRACT_TIER + } + + modifier = { + add = 10 + has_trait = governor + } + modifier = { + add = 10 + has_trait = governor + has_trait_xp = { + trait = governor + value >= 40 + } + } + } + 10 = { + save_scope_value_as = { + name = governance_task_contract_tier + value = define:NTaskContract|HIGH_TASK_CONTRACT_TIER + } + + modifier = { + add = 10 + has_trait = governor + } + modifier = { + add = 10 + has_trait = governor + has_trait_xp = { + trait = governor + value >= 40 + } + } + modifier = { + add = 20 + has_trait = governor + has_trait_xp = { + trait = governor + value >= 80 + } + } + } + } + + # Select which contract to create + trigger_event = { + on_action = spawn_admin_governance_contract_on_action + } + + play_sound_effect = "event:/DLC/EP3/SFX/Stingers/Byzantine_Flavor/ep3_mx_sting_byzantineflavor_become_governor" +} + +manage_new_governance_contract_effect = { + if = { + limit = { exists = scope:target_province } + if = { + limit = { + NOT = { has_character_flag = admin_governance_frequency_cooldown } + } + add_character_flag = { flag = admin_governance_frequency_cooldown years = 6 } + } + send_interface_message = { + type = msg_governance_contracts + title = msg_governance_contract_appear.t + desc = msg_governance_contract_appear.desc + right_icon = scope:target_province.county + } + } + if = { + limit = { + is_ai = yes + exists = scope:new_governance_issue + } + accept_task_contract = scope:new_governance_issue + } +} + +generate_governance_outcome_effect = { + # INFO: We use this effect to randomize the options you get when doing a governor contract. + # $OPTIONS$ is the number of options the event has - Never use less than four, and try to have six if possible. + + # Unlock a bonus option if you have enough exp in the Governor trait - We do this here (and not in the option) to avoid blocking the option due to exp decay (if game is unpaused). + if = { + limit = { + has_trait = governor + has_trait_xp = { + trait = governor + value >= 50 + } + } + save_scope_as = governance_option_a + } + + # Check if you have the Governor trait + if = { + limit = { # If you have the trait with at least rank 1, we generate an extra option. + has_trait = governor + has_trait_xp = { + trait = governor + value >= 25 + } + } + save_scope_value_as = { name = governance_number_of_options value = 3 } + } + else = { # Otherwise, you only get two base options. + save_scope_value_as = { name = governance_number_of_options value = 2 } + } + + # Generate the options + set_local_variable = { + name = current_value + value = 0 + } + while = { + limit = { + local_var:current_value < scope:governance_number_of_options + } + random_list = { + # There is no option A, as A should be unlocked for having the Governor trait at rank 2 (which is done in the corresponding event) + 20 = { + trigger = { + NOT = { exists = scope:governance_option_b } + } + save_scope_value_as = { + name = governance_option_b + value = yes + } + change_local_variable = { + name = current_value + add = 1 + } + } + 20 = { + trigger = { + NOT = { exists = scope:governance_option_c } + } + save_scope_value_as = { + name = governance_option_c + value = yes + } + change_local_variable = { + name = current_value + add = 1 + } + } + 20 = { + trigger = { + NOT = { exists = scope:governance_option_d } + } + save_scope_value_as = { + name = governance_option_d + value = yes + } + change_local_variable = { + name = current_value + add = 1 + } + } + 20 = { + trigger = { + NOT = { exists = scope:governance_option_e } + $OPTIONS$ >= 5 + } + save_scope_value_as = { + name = governance_option_e + value = yes + } + change_local_variable = { + name = current_value + add = 1 + } + } + 20 = { + trigger = { + NOT = { exists = scope:governance_option_f } + $OPTIONS$ >= 6 + } + save_scope_value_as = { + name = governance_option_f + value = yes + } + change_local_variable = { + name = current_value + add = 1 + } + } + } + } +} + +remove_other_eparch_modifiers_effect = { + hidden_effect = { # No need to show this + # Let's check for the county opinion modifier first + scope:liege ?= { + # We check and scope to all counties to make sure we remove any stray modifiers in case the capital is moved, etc. + if = { + limit = { + any_realm_county = { + any_county_province = { + has_province_modifier = ep3_eparch_county_opinion_modifier + } + } + } + every_realm_county = { + limit = { + any_county_province = { + has_province_modifier = ep3_eparch_county_opinion_modifier + } + } + every_county_province = { + limit = { + has_province_modifier = ep3_eparch_county_opinion_modifier + } + remove_province_modifier = ep3_eparch_county_opinion_modifier + } + } + } + } + + # Next is the troop modifier + scope:liege ?= { + # We check and scope to all counties to make sure we remove any stray modifiers in case the capital is moved, etc. + if = { + limit = { + any_realm_county = { + any_county_province = { + has_province_modifier = ep3_eparch_troops_modifier + } + } + } + every_realm_county = { + limit = { + any_county_province = { + has_province_modifier = ep3_eparch_troops_modifier + } + } + every_county_province = { + limit = { + has_province_modifier = ep3_eparch_troops_modifier + } + remove_province_modifier = ep3_eparch_troops_modifier + } + } + } + } + + # Next is the county control modifier + scope:liege ?= { + # We check and scope to all counties to make sure we remove any stray modifiers in case the capital is moved, etc. + if = { + limit = { + any_realm_county = { + any_county_province = { + has_province_modifier = ep3_eparch_control_modifier + } + } + } + every_realm_county = { + limit = { + any_county_province = { + has_province_modifier = ep3_eparch_control_modifier + } + } + every_county_province = { + limit = { + has_province_modifier = ep3_eparch_control_modifier + } + remove_province_modifier = ep3_eparch_control_modifier + } + } + } + } + + # And finally, the development modifier + scope:liege ?= { + # We check and scope to all counties to make sure we remove any stray modifiers in case the capital is moved, etc. + if = { + limit = { + any_realm_county = { + any_county_province = { + has_province_modifier = ep3_eparch_development_modifier + } + } + } + every_realm_county = { + limit = { + any_county_province = { + has_province_modifier = ep3_eparch_development_modifier + } + } + every_county_province = { + limit = { + has_province_modifier = ep3_eparch_development_modifier + } + remove_province_modifier = ep3_eparch_development_modifier + } + } + } + } + } +} + +eparch_neglecting_duty_effect = { + custom_tooltip = { + text = eparch_neglecting_duty_warning_tt + + # We check if you have neglected duties in the past + if = { + limit = { + exists = var:eparch_neglecting_duty + } + # If you have, let's first increase the variable + change_variable = { name = eparch_neglecting_duty add = 5 } + + # Then check if the liege notices and decide to take action + random = { + chance = { + # Base value - Increases with each neglecting action + value = var:eparch_neglecting_duty + + # Add the difference in intrigue skill + add = { + value = liege.intrigue + subtract = intrigue + } + + # Add the difference in influence level + add = { + value = liege.influence_level + subtract = influence_level + multiply = 5 + } + + # Lower the chance if you belong to a powerful or dominant family + if = { + limit = { + house ?= { is_powerful_family = yes } + } + subtract = 10 + } + if = { + limit = { + house ?= { is_dominant_family = yes } + } + subtract = 20 + } + + min = 5 + max = 90 + } + + # The liege have noticed - We reduce the variable slightly as a result (but never below 0) + if = { + limit = { + exists = var:eparch_neglecting_duty + var:eparch_neglecting_duty >= 20 + } + change_variable = { name = eparch_neglecting_duty subtract = 20 } + } + else = { + set_variable = { name = eparch_neglecting_duty value = 0 } + } + + liege = { + trigger_event = { id = ep3_eparch_event.9000 days = { 10 90 } } + } + } + } + else = { # If you haven't, we'll set the variable and give you a free pass (you only get it for your very first time though) + set_variable = { name = eparch_neglecting_duty value = 0 } + } + } +} + +add_influence_attacker_victory_effect = { + scope:attacker = { + if = { + limit = { government_has_flag = government_has_influence } + change_influence = major_influence_gain + } + } +} + +add_influence_attacker_defeat_effect = { + scope:defender = { + if = { + limit = { government_has_flag = government_has_influence } + change_influence = medium_influence_gain + } + } +} + +admin_change_government_effect = { + # Make sure you only use this effect on characters you are sure should change government! Since we don't do any extended triggers here. + # For a consistent behaviour, this effect is based on "convert_whole_realm_to_feudalism_effect" + + # First, let's see if the character only has their noble family title - then we don't bother changing their government + # We only destroy the family title to make sure it doesn't linger + if = { + limit = { + is_landed = no + any_held_title = { + is_noble_family_title = yes + } + NOT = { + any_held_title = { + is_noble_family_title = no + } + } + } + every_held_title = { + limit = { + is_noble_family_title = yes + } + save_temporary_scope_as = family_title + prev = { destroy_title = scope:family_title } + } + } + + # If not, let's change the government type + # If liege has clan - Become clan! + else_if = { + limit = { + top_liege != this + OR = { + liege = { government_has_flag = government_is_clan } + AND = { + liege = { government_has_flag = government_is_tribal } + religion = religion:islam_religion + } + } + } + change_government = clan_government + } + # If liege has japanese feudal - Become japanese feudal! + else_if = { + limit = { + is_independent_ruler = no + OR = { + liege = { government_has_flag = government_is_japan_feudal } + AND = { + liege = { government_has_flag = government_is_japan_feudal } + NOT = { religion = religion:islam_religion } + } + } + } + change_government = japan_feudal_government + } + # If liege has feudal - Become feudal! + else_if = { + limit = { + top_liege != this + OR = { + liege = { government_has_flag = government_is_feudal } + AND = { + liege = { government_has_flag = government_is_tribal } + NOT = { religion = religion:islam_religion } + } + } + } + change_government = feudal_government + } + # If you're an independent Muslim ruler - Become clan! + else_if = { + limit = { + top_liege = this + faith = { religion_tag = islam_religion } + } + change_government = clan_government + } + # If you're an independent ruler with anything else - Become feudal! + else = { change_government = feudal_government } + + # Finally, let's double-check and see if there are any remaining family titles we should destroy + if = { + limit = { + any_held_title = { + is_noble_family_title = yes + } + } + every_held_title = { + limit = { + is_noble_family_title = yes + } + save_temporary_scope_as = family_title + prev = { destroy_title = scope:family_title } + } + } +} + +################################################## +# Dynasty Legacy: Bureaucracy +################################################## + +ep3_dynasty_legacy_add_legitimacy_effect = { + scope:activity = { + if = { + limit = { + scope:host = { + government_allows = administrative + OR = { + dynasty = { has_dynasty_perk = ep3_administrative_legacy_3 } + top_participant_group:dynastic_cycle ?= { + participant_group_type = conservative_movement + } + } + } + # Does the activity location have a domicile owned by a house member + # Does that domicile have the Reception Hall building + activity_location = { + any_province_domicile = { + owner = { house ?= scope:host.house } + OR = { + has_domicile_building_or_higher = reception_hall_01 + has_domicile_building_or_higher = east_asian_estate_reception_hall_01 + } + } + } + } + activity_location = { + random_province_domicile = { + limit = { + owner = { house ?= scope:host.house } + OR = { + has_domicile_building_or_higher = reception_hall_01 + has_domicile_building_or_higher = east_asian_estate_reception_hall_01 + } + } + owner = { save_scope_as = reception_hall_owner } + } + } + scope:host = { + house = { + if = { + limit = { + NOT = { + has_variable = ep3_legacy_legitimacy_counter + } + } + # Set the initial value + set_variable = { + name = ep3_legacy_legitimacy_counter + value = 10 + } + } + else = { + change_variable = { + name = ep3_legacy_legitimacy_counter + add = 10 + } + } + } + if = { + limit = { + primary_title.tier = tier_empire + } + send_interface_toast = { + type = event_toast_effect_good + title = ep3_dynasty_legacy_gain_legitimacy_effect_title + left_icon = scope:host + right_icon = scope:host.primary_title + add_legitimacy = 10 + } + } + else = { + house = { + every_house_member = { + limit = { is_ai = no } + send_interface_message = { + type = event_generic_good_text + title = ep3_dynasty_legacy_add_legitimacy_effect_title + desc = ep3_dynasty_legacy_add_legitimacy_effect_desc + left_icon = scope:host + right_icon = house + } + } + } + } + } + } + } +} + +################################################## +# Byzantium +################################################## + +remove_a_criminal_trait_in_faith_effect = { + $CHARACTER$ = { + if = { + limit = { + has_trait = adulterer + trait_is_criminal_in_faith_trigger = { TRAIT = adulterer FAITH = $FAITH$ GENDER_CHARACTER = $CHARACTER$ } + } + remove_trait = adulterer + } + else_if = { + limit = { + has_trait = fornicator + trait_is_criminal_in_faith_trigger = { TRAIT = fornicator FAITH = $FAITH$ GENDER_CHARACTER = $CHARACTER$ } + } + remove_trait = fornicator + } + else_if = { + limit = { + has_trait = sodomite + trait_is_criminal_in_faith_trigger = { TRAIT = sodomite FAITH = $FAITH$ GENDER_CHARACTER = $CHARACTER$ } + } + remove_trait = sodomite + } + else_if = { + limit = { + has_trait = deviant + trait_is_criminal_in_faith_trigger = { TRAIT = deviant FAITH = $FAITH$ GENDER_CHARACTER = $CHARACTER$ } + } + remove_trait = deviant + } + else_if = { + limit = { + has_trait = kinslayer_3 + trait_is_criminal_in_faith_trigger = { TRAIT = kinslayer_3 FAITH = $FAITH$ GENDER_CHARACTER = $CHARACTER$ } + } + remove_trait = kinslayer_3 + } + else_if = { + limit = { + has_trait = kinslayer_2 + trait_is_criminal_in_faith_trigger = { TRAIT = kinslayer_2 FAITH = $FAITH$ GENDER_CHARACTER = $CHARACTER$ } + } + remove_trait = kinslayer_2 + } + else_if = { + limit = { + has_trait = kinslayer_1 + trait_is_criminal_in_faith_trigger = { TRAIT = kinslayer_1 FAITH = $FAITH$ GENDER_CHARACTER = $CHARACTER$ } + } + remove_trait = kinslayer_1 + } + else_if = { + limit = { + has_trait = witch + trait_is_criminal_in_faith_trigger = { TRAIT = witch FAITH = $FAITH$ GENDER_CHARACTER = $CHARACTER$ } + } + remove_trait = witch + } + else_if = { + limit = { + has_trait = cannibal + trait_is_criminal_in_faith_trigger = { TRAIT = cannibal FAITH = $FAITH$ GENDER_CHARACTER = $CHARACTER$ } + } + remove_trait = cannibal + } + else_if = { + limit = { + has_trait = incestuous + trait_is_criminal_in_faith_trigger = { TRAIT = incestuous FAITH = $FAITH$ GENDER_CHARACTER = $CHARACTER$ } + } + remove_trait = incestuous + } + } +} + +################################################## +# Chariot Races +################################################## + +gather_charioteers_effect = { + scope:activity = { + random_list = { + 50 = { + set_variable = { + name = num_blues + value = 2 + } + } + 50 = { + set_variable = { + name = num_blues + value = 3 + } + } + } + random_list = { + 50 = { + set_variable = { + name = num_greens + value = 2 + } + } + 50 = { + set_variable = { + name = num_greens + value = 3 + } + } + } + random_list = { + 50 = { + set_variable = { + name = num_whites + value = 2 + } + } + 50 = { + set_variable = { + name = num_whites + value = 3 + } + } + } + random_list = { + 50 = { + set_variable = { + name = num_reds + value = 2 + } + } + 50 = { + set_variable = { + name = num_reds + value = 3 + } + } + } + + ordered_attending_character = { + order_by = chariot_ordering_value + max = 12 + check_range_bounds = no + save_temporary_scope_as = temp_character + if = { + limit = { + OR = { + has_court_position = charioteer_court_position + trigger_if = { + limit = { + available_charioteers_spots_trigger = { TEAM = green } + } + has_trait = charioteer_green + } + trigger_if = { + limit = { + available_charioteers_spots_trigger = { TEAM = blue } + } + has_trait = charioteer_blue + } + trigger_if = { + limit = { + available_charioteers_spots_trigger = { TEAM = red } + } + has_trait = charioteer_red + } + trigger_if = { + limit = { + available_charioteers_spots_trigger = { TEAM = white } + } + has_trait = charioteer_white + } + } + } + scope:activity = { + add_to_guest_subset = { + name = charioteers + target = scope:temp_character + } + } + } + } + + # Finalize the list of charioteers + chariot_racers_setup_effect = { TEAM = green } + chariot_racers_setup_effect = { TEAM = blue } + chariot_racers_setup_effect = { TEAM = red } + chariot_racers_setup_effect = { TEAM = white } + # And filter everyone remaining to spectators. + every_attending_character = { + limit = { + NOT = { + is_in_guest_subset = { name = charioteers } + } + } + save_scope_as = temp_character + scope:activity = { + add_to_guest_subset = { + name = spectators + target = scope:temp_character + } + } + } + } +} + +chariot_racers_setup_effect = { # If you need to create additional racers + while = { + count = 5 + limit = { + available_charioteers_spots_trigger = { TEAM = $TEAM$ } + } + create_character = { + template = charioteer_template + employer = scope:activity.activity_host + save_scope_as = temp_charioteer + } + scope:temp_charioteer = { + add_trait = charioteer_$TEAM$ + add_trait_xp = { + trait = charioteer_$TEAM$ + value = { 5 50 } + } + add_to_activity = scope:activity + } + scope:activity = { + add_to_guest_subset = { + name = charioteers + target = scope:temp_charioteer + } + } + } +} + +# Each character is assigned Odds to Win, Odds to Place, and Odds to Show +# Win: come in first place +# Place: come in first or second place +# Show: come in first, second, or third place +calculate_chariot_race_odds_effect = { + calculate_chariot_odds_to_win_effect = yes + calculate_chariot_odds_to_place_effect = yes + calculate_chariot_odds_to_show_effect = yes +} + +# Odds are represented in the format A:B, where A is the number of ways/opportunities a character has to succeed, and B represents how many ways/opportunities they have to fail +# These same calculations are done for the teams overall +# Individual odds are saved on the individual character +# Team odds are saved on the activity scope +calculate_chariot_odds_to_win_effect = { + scope:activity = { + ### INDIVIDUAL ODDS + # Set odds to win + set_variable = { + name = total_chance_win + value = 0 + } + # Set odds_win_a (number of ways to win) + every_guest_subset = { + name = charioteers + set_variable = { + name = odds_win_a + value = charioteer_chance_to_win + } + scope:activity = { + change_variable = { + name = total_chance_win + add = { + value = prev.charioteer_chance_to_win + min = 1 + } + } + } + } + # set odds_win_b (number of ways to lose) + every_guest_subset = { + name = charioteers + set_variable = { + name = odds_win_b + value = { + value = scope:activity.var:total_chance_win + subtract = var:odds_win_a + min = 1 + } + } + } + + # Calc percent chance to win + every_guest_subset = { + name = charioteers + set_variable = { + name = percent_chance_to_win + value = { + add = var:odds_win_a + divide = { + value = 0 + add = var:odds_win_a + add = var:odds_win_b + } + multiply = 100 + min = 1 + max = 99 + } + } + } + ########## + + ### TEAM ODDS + # For each of the 4 teams, we calculate their odds to win/place/show. These variables are saved on the activity + # BLUES + # Initialize variables + set_variable = { + name = blue_odds_win_a + value = 0 + } + set_variable = { + name = blue_odds_win_b + value = 0 + } + + # Account for each team member + every_guest_subset = { + name = charioteers + limit = { has_trait = charioteer_blue } + scope:activity = { + change_variable = { + name = blue_odds_win_a + add = { + value = prev.var:odds_win_a + min = 1 + } + } + } + } + # Set the B variable based on the total amount of chance - the opporutnity for success + change_variable = { + name = blue_odds_win_b + add = { + value = var:total_chance_win + subtract = var:blue_odds_win_a + min = 1 + } + } + # Calculate the percentage chance of success for readability + set_variable = { + name = blue_percent_chance_to_win + value = { + add = var:blue_odds_win_a + divide = { + value = 0 + add = var:blue_odds_win_a + add = var:blue_odds_win_b + } + multiply = 100 + min = 1 + max = 99 + } + } + + # GREENS + # Initialize variables + set_variable = { + name = green_odds_win_a + value = 0 + } + set_variable = { + name = green_odds_win_b + value = 0 + } + + # Account for each team member + every_guest_subset = { + name = charioteers + limit = { has_trait = charioteer_green } + scope:activity = { + change_variable = { + name = green_odds_win_a + add = { + value = prev.var:odds_win_a + min = 1 + } + } + } + } + # Set the B variable based on the total amount of chance - the opporutnity for success + change_variable = { + name = green_odds_win_b + add = { + value = var:total_chance_win + subtract = var:green_odds_win_a + min = 1 + } + } + # Calculate the percentage chance of success for readability + set_variable = { + name = green_percent_chance_to_win + value = { + add = var:green_odds_win_a + divide = { + value = 0 + add = var:green_odds_win_a + add = var:green_odds_win_b + } + multiply = 100 + min = 1 + max = 99 + } + } + + # WHITES + # Initialize variables + set_variable = { + name = white_odds_win_a + value = 0 + } + set_variable = { + name = white_odds_win_b + value = 0 + } + + # Account for each team member + every_guest_subset = { + name = charioteers + limit = { has_trait = charioteer_white } + scope:activity = { + change_variable = { + name = white_odds_win_a + add = { + value = prev.var:odds_win_a + min = 1 + } + } + } + } + # Set the B variable based on the total amount of chance - the opporutnity for success + change_variable = { + name = white_odds_win_b + add = { + value = var:total_chance_win + subtract = var:white_odds_win_a + min = 1 + } + } + # Calculate the percentage chance of success for readability + set_variable = { + name = white_percent_chance_to_win + value = { + add = var:white_odds_win_a + divide = { + value = 0 + add = var:white_odds_win_a + add = var:white_odds_win_b + } + multiply = 100 + min = 1 + max = 99 + } + } + + # REDS + # Initialize variables + set_variable = { + name = red_odds_win_a + value = 0 + } + set_variable = { + name = red_odds_win_b + value = 0 + } + + # Account for each team member + every_guest_subset = { + name = charioteers + limit = { has_trait = charioteer_red } + scope:activity = { + change_variable = { + name = red_odds_win_a + add = { + value = prev.var:odds_win_a + min = 1 + } + } + } + } + # Set the B variable based on the total amount of chance - the opporutnity for success + change_variable = { + name = red_odds_win_b + add = { + value = var:total_chance_win + subtract = var:red_odds_win_a + min = 1 + } + } + # Calculate the percentage chance of success for readability + set_variable = { + name = red_percent_chance_to_win + value = { + add = var:red_odds_win_a + divide = { + value = 0 + add = var:red_odds_win_a + add = var:red_odds_win_b + } + multiply = 100 + min = 1 + max = 99 + } + } + } +} + +calculate_chariot_odds_to_place_effect = { + scope:activity = { + ### INDIVIDUAL ODDS + # Set odds to place + set_variable = { + name = total_chance_place + value = 0 + } + every_guest_subset = { + name = charioteers + set_variable = { + name = odds_place_a + value = { + value = charioteer_chance_to_win + multiply = 2 + } + } + scope:activity = { + change_variable = { + name = total_chance_place + add = { + value = prev.charioteer_chance_to_win + min = 1 + } + } + } + } + every_guest_subset = { + name = charioteers + set_variable = { + name = odds_place_b + value = { + value = scope:activity.var:total_chance_place + subtract = var:odds_place_a + min = 1 + } + } + } + + # Calc percent chance to win + every_guest_subset = { + name = charioteers + set_variable = { + name = percent_chance_to_place + value = { + add = var:odds_place_a + divide = { + value = 0 + add = var:odds_place_a + add = var:odds_place_b + } + multiply = 100 + min = 1 + max = 99 + } + } + } + ########## + + ### TEAM ODDS + # For each of the 4 teams, we calculate their odds to win/place/show. These variables are saved on the activity + # Initialize variables + set_variable = { + name = blue_odds_place_a + value = 0 + } + set_variable = { + name = blue_odds_place_b + value = 0 + } + + # Account for each team member + every_guest_subset = { + name = charioteers + limit = { has_trait = charioteer_blue } + scope:activity = { + change_variable = { + name = blue_odds_place_a + add = { + value = prev.var:odds_place_a + min = 1 + } + } + } + } + # Set the B variable based on the total amount of chance - the opporutnity for success + change_variable = { + name = blue_odds_place_b + add = { + value = var:total_chance_place + subtract = var:blue_odds_place_a + min = 1 + } + } + # Calculate the percentage chance of success for readability + set_variable = { + name = blue_percent_chance_to_place + value = { + add = var:blue_odds_place_a + divide = { + value = 0 + add = var:blue_odds_place_a + add = var:blue_odds_place_b + } + multiply = 100 + min = 1 + max = 99 + } + } + + # GREENS + # Initialize variables + set_variable = { + name = green_odds_place_a + value = 0 + } + set_variable = { + name = green_odds_place_b + value = 0 + } + + # Account for each team member + every_guest_subset = { + name = charioteers + limit = { has_trait = charioteer_green } + scope:activity = { + change_variable = { + name = green_odds_place_a + add = { + value = prev.var:odds_place_a + min = 1 + } + } + } + } + # Set the B variable based on the total amount of chance - the opporutnity for success + change_variable = { + name = green_odds_place_b + add = { + value = var:total_chance_place + subtract = var:green_odds_place_a + min = 1 + } + } + # Calculate the percentage chance of success for readability + set_variable = { + name = green_percent_chance_to_place + value = { + add = var:green_odds_place_a + divide = { + value = 0 + add = var:green_odds_place_a + add = var:green_odds_place_b + } + multiply = 100 + min = 1 + max = 99 + } + } + + # WHITES + # Initialize variables + set_variable = { + name = white_odds_place_a + value = 0 + } + set_variable = { + name = white_odds_place_b + value = 0 + } + + # Account for each team member + every_guest_subset = { + name = charioteers + limit = { has_trait = charioteer_white } + scope:activity = { + change_variable = { + name = white_odds_place_a + add = { + value = prev.var:odds_place_a + min = 1 + } + } + } + } + # Set the B variable based on the total amount of chance - the opporutnity for success + change_variable = { + name = white_odds_place_b + add = { + value = var:total_chance_place + subtract = var:white_odds_place_a + min = 1 + } + } + # Calculate the percentage chance of success for readability + set_variable = { + name = white_percent_chance_to_place + value = { + add = var:white_odds_place_a + divide = { + value = 0 + add = var:white_odds_place_a + add = var:white_odds_place_b + } + multiply = 100 + min = 1 + max = 99 + } + } + + + # REDS + # Initialize variables + set_variable = { + name = red_odds_place_a + value = 0 + } + set_variable = { + name = red_odds_place_b + value = 0 + } + + # Account for each team member + every_guest_subset = { + name = charioteers + limit = { has_trait = charioteer_red } + scope:activity = { + change_variable = { + name = red_odds_place_a + add = { + value = prev.var:odds_place_a + min = 1 + } + } + } + } + # Set the B variable based on the total amount of chance - the opporutnity for success + change_variable = { + name = red_odds_place_b + add = { + value = var:total_chance_place + subtract = var:red_odds_place_a + min = 1 + } + } + # Calculate the percentage chance of success for readability + set_variable = { + name = red_percent_chance_to_place + value = { + add = var:red_odds_place_a + divide = { + value = 0 + add = var:red_odds_place_a + add = var:red_odds_place_b + } + multiply = 100 + min = 1 + max = 99 + } + } + } +} + +calculate_chariot_odds_to_show_effect = { + scope:activity = { + ### INDIVIDUAL ODDS + # Set odds to show + set_variable = { + name = total_chance_show + value = 0 + } + every_guest_subset = { + name = charioteers + set_variable = { + name = odds_show_a + value = { + value = charioteer_chance_to_win + multiply = 3 + min = 1 + } + } + scope:activity = { + change_variable = { + name = total_chance_show + add = { + value = prev.charioteer_chance_to_win + min = 1 + } + } + } + } + every_guest_subset = { + name = charioteers + set_variable = { + name = odds_show_b + value = { + value = scope:activity.var:total_chance_show + subtract = var:odds_show_a + min = 1 + } + } + } + + # Calc percent chance to show + every_guest_subset = { + name = charioteers + set_variable = { + name = percent_chance_to_show + value = { + add = var:odds_show_a + divide = { + value = var:odds_show_a + add = scope:activity.var:total_chance_show + } + multiply = 100 + min = 1 + max = 99 + } + } + } + ########## + + ### TEAM ODDS + # For each of the 4 teams, we calculate their odds to win/place/show. These variables are saved on the activity + # BLUES + # Initialize variables + set_variable = { + name = blue_odds_show_a + value = 0 + } + set_variable = { + name = blue_odds_show_b + value = 0 + } + + # Account for each team member + every_guest_subset = { + name = charioteers + limit = { has_trait = charioteer_blue } + scope:activity = { + change_variable = { + name = blue_odds_show_a + add = { + value = prev.var:odds_show_a + min = 1 + } + } + } + } + # Set the B variable based on the total amount of chance - the opporutnity for success + change_variable = { + name = blue_odds_show_b + add = { + value = var:total_chance_show + subtract = var:blue_odds_show_a + min = 1 + } + } + # Calculate the percentage chance of success for readability + set_variable = { + name = blue_percent_chance_to_show + value = { + add = var:blue_odds_show_a + divide = { + value = 0 + add = var:blue_odds_show_a + add = var:blue_odds_show_b + } + multiply = 100 + min = 1 + max = 99 + } + } + + # GREENS + # Initialize variables + set_variable = { + name = green_odds_show_a + value = 0 + } + set_variable = { + name = green_odds_show_b + value = 0 + } + + # Account for each team member + every_guest_subset = { + name = charioteers + limit = { has_trait = charioteer_green } + scope:activity = { + change_variable = { + name = green_odds_show_a + add = { + value = prev.var:odds_show_a + min = 1 + } + } + } + } + # Set the B variable based on the total amount of chance - the opporutnity for success + change_variable = { + name = green_odds_show_b + add = { + value = var:total_chance_show + subtract = var:green_odds_show_a + min = 1 + } + } + # Calculate the percentage chance of success for readability + set_variable = { + name = green_percent_chance_to_show + value = { + add = var:green_odds_show_a + divide = { + value = 0 + add = var:green_odds_show_a + add = var:green_odds_show_b + } + multiply = 100 + min = 1 + max = 99 + } + } + + # WHITES + # Initialize variables + set_variable = { + name = white_odds_show_a + value = 0 + } + set_variable = { + name = white_odds_show_b + value = 0 + } + + # Account for each team member + every_guest_subset = { + name = charioteers + limit = { has_trait = charioteer_white } + scope:activity = { + change_variable = { + name = white_odds_show_a + add = { + value = prev.var:odds_show_a + min = 1 + } + } + } + } + # Set the B variable based on the total amount of chance - the opporutnity for success + change_variable = { + name = white_odds_show_b + add = { + value = var:total_chance_show + subtract = var:white_odds_show_a + min = 1 + } + } + # Calculate the percentage chance of success for readability + set_variable = { + name = white_percent_chance_to_show + value = { + add = var:white_odds_show_a + divide = { + value = 0 + add = var:white_odds_show_a + add = var:white_odds_show_b + } + multiply = 100 + min = 1 + max = 99 + } + } + + # REDS + # Initialize variables + set_variable = { + name = red_odds_show_a + value = 0 + } + set_variable = { + name = red_odds_show_b + value = 0 + } + + # Account for each team member + every_guest_subset = { + name = charioteers + limit = { has_trait = charioteer_red } + scope:activity = { + change_variable = { + name = red_odds_show_a + add = { + value = prev.var:odds_show_a + min = 1 + } + } + } + } + # Set the B variable based on the total amount of chance - the opporutnity for success + change_variable = { + name = red_odds_show_b + add = { + value = var:total_chance_show + subtract = var:red_odds_show_a + min = 1 + } + } + # Calculate the percentage chance of success for readability + set_variable = { + name = red_percent_chance_to_show + value = { + add = var:red_odds_show_a + divide = { + value = 0 + add = var:red_odds_show_a + add = var:red_odds_show_b + } + multiply = 100 + min = 1 + max = 99 + } + } + } +} + +calculate_chariot_payout_effect = { + scope:activity = { + every_guest_subset = { + name = charioteers + set_variable = { + name = win_payout + value = { + add = var:odds_win_b + subtract = { + value = var:odds_win_b + multiply = 0.3 + } + save_temporary_value_as = temp_val + subtract = { + value = scope:temp_val + multiply = bookkeeper_small_commission_value + round = yes + } + divide = var:odds_win_a + add = 1 + min = 1.1 + } + } + set_variable = { + name = place_payout + value = { + add = var:odds_place_b + subtract = { + value = var:odds_place_b + multiply = 0.3 + } + save_temporary_value_as = temp_val + subtract = { + value = scope:temp_val + multiply = bookkeeper_medium_commission_value + round = yes + } + divide = var:odds_place_a + add = 1 + min = 1.1 + } + } + set_variable = { + name = show_payout + value = { + add = var:odds_show_b + subtract = { + value = var:odds_show_b + multiply = 0.3 + } + save_temporary_value_as = temp_val + subtract = { + value = scope:temp_val + multiply = bookkeeper_large_commission_value + round = yes + } + divide = var:odds_show_a + add = 1 + min = 1.1 + } + } + } + set_variable = { + name = blue_win_payout + value = { + add = var:blue_odds_win_b + subtract = { + value = var:blue_odds_win_b + multiply = bookkeeper_small_commission_value + round = yes + } + divide = var:blue_odds_win_a + add = 1 + min = 1.1 + } + } + set_variable = { + name = blue_place_payout + value = { + add = var:blue_odds_place_b + subtract = { + value = var:blue_odds_place_b + multiply = bookkeeper_medium_commission_value + round = yes + } + divide = var:blue_odds_place_a + add = 1 + min = 1.1 + } + } + set_variable = { + name = blue_show_payout + value = { + add = var:blue_odds_show_b + subtract = { + value = var:blue_odds_show_b + multiply = bookkeeper_large_commission_value + round = yes + } + divide = var:blue_odds_show_a + add = 1 + min = 1.1 + } + } + + set_variable = { + name = green_win_payout + value = { + add = var:green_odds_win_b + subtract = { + value = var:green_odds_win_b + multiply = bookkeeper_small_commission_value + round = yes + } + divide = var:green_odds_win_a + add = 1 + min = 1.1 + } + } + set_variable = { + name = green_place_payout + value = { + add = var:green_odds_place_b + subtract = { + value = var:green_odds_place_b + multiply = bookkeeper_medium_commission_value + round = yes + } + divide = var:green_odds_place_a + add = 1 + min = 1.1 + } + } + set_variable = { + name = green_show_payout + value = { + add = var:green_odds_show_b + subtract = { + value = var:green_odds_show_b + multiply = bookkeeper_large_commission_value + round = yes + } + divide = var:green_odds_show_a + add = 1 + min = 1.1 + } + } + + set_variable = { + name = white_win_payout + value = { + add = var:white_odds_win_b + subtract = { + value = var:white_odds_win_b + multiply = bookkeeper_small_commission_value + round = yes + } + divide = var:white_odds_win_a + add = 1 + min = 1.1 + } + } + set_variable = { + name = white_place_payout + value = { + add = var:white_odds_place_b + subtract = { + value = var:white_odds_place_b + multiply = bookkeeper_medium_commission_value + round = yes + } + divide = var:white_odds_place_a + add = 1 + min = 1.1 + } + } + set_variable = { + name = white_show_payout + value = { + add = var:white_odds_show_b + subtract = { + value = var:white_odds_show_b + multiply = bookkeeper_large_commission_value + round = yes + } + divide = var:white_odds_show_a + add = 1 + min = 1.1 + } + } + + set_variable = { + name = red_win_payout + value = { + add = var:red_odds_win_b + subtract = { + value = var:red_odds_win_b + multiply = bookkeeper_small_commission_value + round = yes + } + divide = var:red_odds_win_a + add = 1 + min = 1.1 + } + } + set_variable = { + name = red_place_payout + value = { + add = var:red_odds_place_b + subtract = { + value = var:red_odds_place_b + multiply = bookkeeper_medium_commission_value + round = yes + } + divide = var:red_odds_place_a + add = 1 + min = 1.1 + } + } + set_variable = { + name = red_show_payout + value = { + add = var:red_odds_show_b + subtract = { + value = var:red_odds_show_b + multiply = bookkeeper_large_commission_value + round = yes + } + divide = var:red_odds_show_a + add = 1 + min = 1.1 + } + } + + } +} + +set_or_increment_lucky_better_variable = { + if = { + limit = { + NOT = { has_variable = lucky_bet_counter } + } + set_variable = { + name = lucky_bet_counter + value = 1 + } + } + else = { + change_variable = { + name = lucky_bet_counter + add = 1 + } + if = { + limit = { + var:lucky_bet_counter >= 5 + has_any_nickname = no + } + send_interface_toast = { + # works for our purposes "New Nickname" + title = sell_titles_nickname_gained + left_icon = this + give_nickname = nick_the_lucky + } + } + } +} + +disburse_chariot_race_activity_host_rewards = { + scope:activity = { + add_activity_log_entry = { + key = chariot_race_host_rewards + score = 100 + show_in_conclusion = yes + character = root + location = root.location + + root = { + # Some base influence + change_influence = medium_influence_gain + # Extra influence rewards for having a successful wager + if = { + limit = { + has_character_flag = successful_bet + has_variable = wager_type + } + switch = { + trigger = var:wager_type + flag:win = { + change_influence = medium_influence_gain + } + flag:place = { + change_influence = minor_influence_gain + } + flag:show = { + change_influence = miniscule_influence_gain + } + } + } + + # Rewards for employing a charioteer who wins/places/shows + if = { + limit = { employs_court_position = charioteer_court_position } + if = { + limit = { + any_court_position_holder = { + type = charioteer_court_position + scope:activity.var:first_place ?= this + } + } + change_influence = monumental_influence_gain + } + else_if = { + limit = { + any_court_position_holder = { + type = charioteer_court_position + scope:activity.var:second_place ?= this + } + } + change_influence = massive_influence_gain + } + else_if = { + limit = { + any_court_position_holder = { + type = charioteer_court_position + scope:activity.var:third_place ?= this + } + } + change_influence = major_influence_gain + } + } + + #Legitimacy and popular opinion for how fancy your chariot races were + if = { + limit = { + scope:activity = { + has_activity_option = { + category = chariot_option_entertainment + option = chariot_entertainment_bad + } + } + } + if = { + limit = { + scope:host.capital_county = { + county_opinion > 0 + } + } + add_legitimacy = miniscule_legitimacy_gain + if = { + limit = { has_activity_intent = reduce_stress_intent } + stress_impact = { + base = major_stress_loss + athletic = miniscule_stress_loss + gregarious = miniscule_stress_loss + } + } + custom_tooltip = chariot_race_reward_high_county_opinion_tt + } + else_if = { + limit = { + scope:host.capital_county = { + county_opinion <= -50 + } + } + add_legitimacy = 5 + if = { + limit = { has_activity_intent = reduce_stress_intent } + stress_impact = { + base = medium_stress_loss + athletic = miniscule_stress_loss + gregarious = miniscule_stress_loss + } + } + custom_tooltip = chariot_race_reward_low_county_opinion_tt + } + else = { + add_legitimacy = 10 + } + } + else_if = { + limit = { + scope:activity = { + has_activity_option = { + category = chariot_option_entertainment + option = chariot_entertainment_normal + } + } + } + if = { + limit = { + scope:host.capital_county = { + county_opinion > 0 + } + } + add_legitimacy = minor_legitimacy_gain + if = { + limit = { has_activity_intent = reduce_stress_intent } + stress_impact = { + base = massive_stress_loss + athletic = miniscule_stress_loss + gregarious = miniscule_stress_loss + } + } + capital_county = { + change_county_control = miniscule_county_control_gain + } + + custom_tooltip = chariot_race_reward_high_county_opinion_tt + } + else_if = { + limit = { + scope:host.capital_county = { + county_opinion <= -50 + } + } + add_legitimacy = 10 + if = { + limit = { has_activity_intent = reduce_stress_intent } + stress_impact = { + base = major_stress_loss + athletic = miniscule_stress_loss + gregarious = miniscule_stress_loss + } + } + custom_tooltip = chariot_race_reward_low_county_opinion_tt + } + else = { + add_legitimacy = miniscule_legitimacy_gain + } + scope:host.capital_county = { + add_county_modifier = { + modifier = ep3_chariot_race_weak_appeasement_modifier + years = 10 + } + } + } + else_if = { + limit = { + scope:activity = { + has_activity_option = { + category = chariot_option_entertainment + option = chariot_entertainment_good + } + } + } + if = { + limit = { + scope:host.capital_county = { + county_opinion > 0 + } + } + add_legitimacy = medium_legitimacy_gain + if = { + limit = { has_activity_intent = reduce_stress_intent } + stress_impact = { + base = monumental_stress_loss + athletic = miniscule_stress_loss + gregarious = miniscule_stress_loss + } + } + capital_county = { + change_county_control = minor_county_control_gain + } + custom_tooltip = chariot_race_reward_high_county_opinion_tt + } + else_if = { + limit = { + scope:host.capital_county = { + county_opinion <= -50 + } + } + add_legitimacy = miniscule_legitimacy_gain + if = { + limit = { has_activity_intent = reduce_stress_intent } + stress_impact = { + base = miniscule_stress_loss + athletic = massive_stress_loss + gregarious = miniscule_stress_loss + } + } + custom_tooltip = chariot_race_reward_low_county_opinion_tt + } + else = { + add_legitimacy = minor_legitimacy_gain + } + scope:host.capital_county = { + add_county_modifier = { + modifier = ep3_chariot_race_strong_appeasement_modifier + years = 10 + } + } + } + } + } + } +} + +disburse_chariot_race_activity_spectator_rewards = { + # Some smaller amounts of Influence rewards for having a successful wager + if = { + limit = { + has_character_flag = successful_bet + has_variable = wager_type + } + switch = { + trigger = var:wager_type + flag:win = { + change_influence = medium_influence_gain + } + flag:place = { + change_influence = minor_influence_gain + } + flag:show = { + change_influence = miniscule_influence_gain + } + } + } + + # Rewards for employing a charioteer who wins/places/shows + # You get more influence if your charioteer is successful + if = { + limit = { + any_court_position_holder = { + type = charioteer_court_position + scope:activity.var:first_place ?= this + } + } + change_influence = monumental_influence_gain + if = { + limit = { has_activity_intent = reduce_stress_intent } + stress_impact = { + base = monumental_stress_loss + athletic = miniscule_stress_loss + gregarious = miniscule_stress_loss + } + } + } + else_if = { + limit = { + any_court_position_holder = { + type = charioteer_court_position + scope:activity.var:second_place ?= this + } + } + change_influence = massive_influence_gain + if = { + limit = { has_activity_intent = reduce_stress_intent } + stress_impact = { + base = massive_stress_loss + athletic = miniscule_stress_loss + gregarious = miniscule_stress_loss + } + } + } + else_if = { + limit = { + any_court_position_holder = { + type = charioteer_court_position + scope:activity.var:third_place ?= this + } + } + change_influence = major_influence_gain + if = { + limit = { has_activity_intent = reduce_stress_intent } + stress_impact = { + base = massive_stress_loss + athletic = miniscule_stress_loss + gregarious = miniscule_stress_loss + } + } + } + else_if = { + limit = { has_activity_intent = reduce_stress_intent } + stress_impact = { + base = miniscule_stress_loss + athletic = major_stress_loss + gregarious = miniscule_stress_loss + } + } +} + +disburse_chariot_race_activity_charioteer_rewards = { + # Give them some xp based on place finished + if = { + limit = { this = scope:activity.var:first_place } + scope:activity = { + add_activity_log_entry = { + key = charioteer_gained_trait_xp_key + score = 110 + character = scope:activity.var:first_place + scope:activity.var:first_place = { + distribute_charioteer_trait_xp_effect = { VALUE = 15 } } + } + } + } + else_if = { + limit = { this = scope:activity.var:second_place } + scope:activity = { + add_activity_log_entry = { + key = charioteer_gained_trait_xp_key + score = 110 + character = scope:activity.var:second_place + scope:activity.var:second_place = { distribute_charioteer_trait_xp_effect = { VALUE = 12 } } + } + } + } + else_if = { + limit = { this = scope:activity.var:third_place } + scope:activity = { + add_activity_log_entry = { + key = charioteer_gained_trait_xp_key + score = 110 + character = scope:activity.var:third_place + scope:activity.var:third_place = { distribute_charioteer_trait_xp_effect = { VALUE = 8 } } + } + } + } + else = { + scope:activity = { + add_activity_log_entry = { + key = charioteer_gained_trait_xp_key + score = 110 + character = prev + prev = { distribute_charioteer_trait_xp_effect = { VALUE = 3 } } + } + } + } +} + +# Used to show how much a character gets from a successful wager in end of the race event chariot_race.0600 +individual_chariot_race_payout_effect = { + save_scope_as = current_gambler + if = { + limit = { + var:wager_type ?= flag:win + var:wager_target ?= scope:activity.var:first_place + } + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:first_place.var:win_payout + max = scope:current_gambler.monumental_gold_value + } + } + else_if = { + limit = { + var:wager_type ?= flag:place + OR = { + var:wager_target ?= scope:activity.var:first_place + var:wager_target ?= scope:activity.var:second_place + } + } + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:second_place.var:place_payout + max = scope:current_gambler.monumental_gold_value + } + } + else_if = { + limit = { + var:wager_type ?= flag:show + OR = { + var:wager_target ?= scope:activity.var:first_place + var:wager_target ?= scope:activity.var:second_place + var:wager_target ?= scope:activity.var:third_place + } + } + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:third_place.var:show_payout + max = scope:current_gambler.monumental_gold_value + } + } + # Handle team based bets + else_if = { + limit = { + var:wager_type ?= flag:win + var:wager_target ?= scope:current_gambler + } + switch = { + trigger = var:wager_team + flag:blues = { + if = { + limit = { scope:activity.var:first_place = { has_trait = charioteer_blue } } + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:blue_win_payout + max = scope:current_gambler.monumental_gold_value + } + } + } + flag:greens = { + if = { + limit = { scope:activity.var:first_place = { has_trait = charioteer_green } } + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:green_win_payout + max = scope:current_gambler.monumental_gold_value + } + } + } + flag:whites = { + if = { + limit = { scope:activity.var:first_place = { has_trait = charioteer_white } } + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:white_win_payout + max = scope:current_gambler.monumental_gold_value + } + } + } + flag:reds = { + if = { + limit = { scope:activity.var:first_place = { has_trait = charioteer_red } } + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:red_win_payout + max = scope:current_gambler.monumental_gold_value + } + } + } + } + } + else_if = { + limit = { + var:wager_type ?= flag:place + var:wager_target ?= scope:current_gambler + } + switch = { + trigger = var:wager_team + flag:blues = { + if = { + limit = { + OR = { + scope:activity.var:first_place = { has_trait = charioteer_blue } + scope:activity.var:second_place = { has_trait = charioteer_blue } + } + } + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:blue_place_payout + max = scope:current_gambler.monumental_gold_value + } + } + } + flag:greens = { + if = { + limit = { + OR = { + scope:activity.var:first_place = { has_trait = charioteer_green } + scope:activity.var:second_place = { has_trait = charioteer_green } + } + } + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:green_place_payout + max = scope:current_gambler.monumental_gold_value + } + } + } + flag:whites = { + if = { + limit = { + OR = { + scope:activity.var:first_place = { has_trait = charioteer_white } + scope:activity.var:second_place = { has_trait = charioteer_white } + } + } + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:white_place_payout + max = scope:current_gambler.monumental_gold_value + } + } + } + flag:reds = { + if = { + limit = { + OR = { + scope:activity.var:first_place = { has_trait = charioteer_red } + scope:activity.var:second_place = { has_trait = charioteer_red } + } + } + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:red_place_payout + max = scope:current_gambler.monumental_gold_value + } + } + } + } + } + else_if = { + limit = { + var:wager_type ?= flag:show + var:wager_target ?= scope:current_gambler + } + switch = { + trigger = var:wager_team + flag:blues = { + if = { + limit = { + OR = { + scope:activity.var:first_place = { has_trait = charioteer_blue } + scope:activity.var:second_place = { has_trait = charioteer_blue } + scope:activity.var:third_place = { has_trait = charioteer_blue } + } + } + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:blue_show_payout + max = scope:current_gambler.monumental_gold_value + } + } + } + flag:greens = { + if = { + limit = { + OR = { + scope:activity.var:first_place = { has_trait = charioteer_green } + scope:activity.var:second_place = { has_trait = charioteer_green } + scope:activity.var:third_place = { has_trait = charioteer_green } + } + } + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:green_show_payout + max = scope:current_gambler.monumental_gold_value + } + } + } + flag:whites = { + if = { + limit = { + OR = { + scope:activity.var:first_place = { has_trait = charioteer_white } + scope:activity.var:second_place = { has_trait = charioteer_white } + scope:activity.var:third_place = { has_trait = charioteer_white } + } + } + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:white_show_payout + max = scope:current_gambler.monumental_gold_value + } + } + } + flag:reds = { + if = { + limit = { + OR = { + scope:activity.var:first_place = { has_trait = charioteer_red } + scope:activity.var:second_place = { has_trait = charioteer_red } + scope:activity.var:third_place = { has_trait = charioteer_red } + } + } + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:red_show_payout + max = scope:current_gambler.monumental_gold_value + } + } + } + } + } + else_if = { + limit = { has_variable = wager_value } + custom_tooltip = chariot_race_lost_bet_tt + } +} + +chariot_race_payout_effect = { + scope:activity = { + every_guest_subset = { + name = spectators + save_scope_as = current_gambler + if = { + limit = { + var:wager_type ?= flag:win + var:wager_target ?= scope:activity.var:first_place + } + set_or_increment_lucky_better_variable = yes + add_character_flag = successful_bet + scope:activity = { + add_activity_log_entry = { + key = chariot_race_betting_char_outcome_key + score = 100 + show_in_conclusion = yes + character = scope:current_gambler + scope:current_gambler = { + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:first_place.var:win_payout + max = scope:current_gambler.monumental_gold_value + } + } + change_variable = { + name = chariot_race_pot + subtract = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:first_place.var:win_payout + } + } + } + } + } + else_if = { + limit = { + var:wager_type ?= flag:place + OR = { + var:wager_target ?= scope:activity.var:first_place + var:wager_target ?= scope:activity.var:second_place + } + } + set_or_increment_lucky_better_variable = yes + add_character_flag = successful_bet + scope:activity = { + add_activity_log_entry = { + key = chariot_race_betting_char_outcome_key + score = 100 + show_in_conclusion = yes + character = scope:current_gambler + scope:current_gambler = { + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:second_place.var:place_payout + max = scope:current_gambler.monumental_gold_value + } + } + change_variable = { + name = chariot_race_pot + subtract = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:second_place.var:place_payout + } + } + } + } + } + else_if = { + limit = { + var:wager_type ?= flag:show + OR = { + var:wager_target ?= scope:activity.var:first_place + var:wager_target ?= scope:activity.var:second_place + var:wager_target ?= scope:activity.var:third_place + } + } + set_or_increment_lucky_better_variable = yes + add_character_flag = successful_bet + scope:activity = { + add_activity_log_entry = { + key = chariot_race_betting_char_outcome_key + score = 100 + show_in_conclusion = yes + character = scope:current_gambler + scope:current_gambler = { + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:third_place.var:show_payout + max = scope:current_gambler.monumental_gold_value + } + } + change_variable = { + name = chariot_race_pot + subtract = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:third_place.var:show_payout + } + } + } + } + } + # Handle team based bets + else_if = { + limit = { + var:wager_type ?= flag:win + var:wager_target ?= this + } + switch = { + trigger = var:wager_team + flag:blues = { + if = { + limit = { scope:activity.var:first_place = { has_trait = charioteer_blue } } + set_or_increment_lucky_better_variable = yes + add_character_flag = successful_bet + scope:activity = { + add_activity_log_entry = { + key = chariot_race_betting_team_outcome_key + score = 100 + show_in_conclusion = yes + character = scope:current_gambler + scope:current_gambler = { + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:blue_win_payout + max = scope:current_gambler.monumental_gold_value + } + } + change_variable = { + name = chariot_race_pot + subtract = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:blue_win_payout + } + } + } + } + } + } + flag:greens = { + if = { + limit = { scope:activity.var:first_place = { has_trait = charioteer_green } } + set_or_increment_lucky_better_variable = yes + add_character_flag = successful_bet + scope:activity = { + add_activity_log_entry = { + key = chariot_race_betting_team_outcome_key + score = 100 + show_in_conclusion = yes + character = scope:current_gambler + scope:current_gambler = { + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:green_win_payout + max = scope:current_gambler.monumental_gold_value + } + } + change_variable = { + name = chariot_race_pot + subtract = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:green_win_payout + } + } + } + } + } + } + flag:whites = { + if = { + limit = { scope:activity.var:first_place = { has_trait = charioteer_white } } + set_or_increment_lucky_better_variable = yes + add_character_flag = successful_bet + scope:activity = { + add_activity_log_entry = { + key = chariot_race_betting_team_outcome_key + score = 100 + show_in_conclusion = yes + character = scope:current_gambler + scope:current_gambler = { + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:white_win_payout + max = scope:current_gambler.monumental_gold_value + } + } + change_variable = { + name = chariot_race_pot + subtract = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:white_win_payout + } + } + } + } + } + } + flag:reds = { + if = { + limit = { scope:activity.var:first_place = { has_trait = charioteer_red } } + set_or_increment_lucky_better_variable = yes + add_character_flag = successful_bet + scope:activity = { + add_activity_log_entry = { + key = chariot_race_betting_team_outcome_key + score = 100 + show_in_conclusion = yes + character = scope:current_gambler + scope:current_gambler = { + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:red_win_payout + max = scope:current_gambler.monumental_gold_value + } + } + change_variable = { + name = chariot_race_pot + subtract = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:red_win_payout + } + } + } + } + } + } + } + } + else_if = { + limit = { + var:wager_type ?= flag:place + var:wager_target ?= this + } + switch = { + trigger = var:wager_team + flag:blues = { + if = { + limit = { + OR = { + scope:activity.var:first_place = { has_trait = charioteer_blue } + scope:activity.var:second_place = { has_trait = charioteer_blue } + } + } + set_or_increment_lucky_better_variable = yes + add_character_flag = successful_bet + scope:activity = { + add_activity_log_entry = { + key = chariot_race_betting_team_outcome_key + score = 100 + show_in_conclusion = yes + character = scope:current_gambler + scope:current_gambler = { + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:blue_place_payout + max = scope:current_gambler.monumental_gold_value + } + } + change_variable = { + name = chariot_race_pot + subtract = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:blue_place_payout + } + } + } + } + } + } + flag:greens = { + if = { + limit = { + OR = { + scope:activity.var:first_place = { has_trait = charioteer_green } + scope:activity.var:second_place = { has_trait = charioteer_green } + } + } + set_or_increment_lucky_better_variable = yes + add_character_flag = successful_bet + scope:activity = { + add_activity_log_entry = { + key = chariot_race_betting_team_outcome_key + score = 100 + show_in_conclusion = yes + character = scope:current_gambler + scope:current_gambler = { + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:green_place_payout + max = scope:current_gambler.monumental_gold_value + } + } + change_variable = { + name = chariot_race_pot + subtract = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:green_place_payout + } + } + } + } + } + } + flag:whites = { + if = { + limit = { + OR = { + scope:activity.var:first_place = { has_trait = charioteer_white } + scope:activity.var:second_place = { has_trait = charioteer_white } + } + } + set_or_increment_lucky_better_variable = yes + add_character_flag = successful_bet + scope:activity = { + add_activity_log_entry = { + key = chariot_race_betting_team_outcome_key + score = 100 + show_in_conclusion = yes + character = scope:current_gambler + scope:current_gambler = { + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:white_place_payout + max = scope:current_gambler.monumental_gold_value + } + } + change_variable = { + name = chariot_race_pot + subtract = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:white_place_payout + } + } + } + } + } + } + flag:reds = { + if = { + limit = { + OR = { + scope:activity.var:first_place = { has_trait = charioteer_red } + scope:activity.var:second_place = { has_trait = charioteer_red } + } + } + set_or_increment_lucky_better_variable = yes + add_character_flag = successful_bet + scope:activity = { + add_activity_log_entry = { + key = chariot_race_betting_team_outcome_key + score = 100 + show_in_conclusion = yes + character = scope:current_gambler + scope:current_gambler = { + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:red_place_payout + max = scope:current_gambler.monumental_gold_value + } + } + change_variable = { + name = chariot_race_pot + subtract = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:red_place_payout + } + } + } + } + } + } + } + } + else_if = { + limit = { + var:wager_type ?= flag:show + var:wager_target ?= this + } + switch = { + trigger = var:wager_team + flag:blues = { + if = { + limit = { + OR = { + scope:activity.var:first_place = { has_trait = charioteer_blue } + scope:activity.var:second_place = { has_trait = charioteer_blue } + scope:activity.var:third_place = { has_trait = charioteer_blue } + } + } + set_or_increment_lucky_better_variable = yes + add_character_flag = successful_bet + scope:activity = { + add_activity_log_entry = { + key = chariot_race_betting_team_outcome_key + score = 100 + show_in_conclusion = yes + character = scope:current_gambler + scope:current_gambler = { + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:blue_show_payout + max = scope:current_gambler.monumental_gold_value + } + } + change_variable = { + name = chariot_race_pot + subtract = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:blue_show_payout + } + } + } + } + } + } + flag:greens = { + if = { + limit = { + OR = { + scope:activity.var:first_place = { has_trait = charioteer_green } + scope:activity.var:second_place = { has_trait = charioteer_green } + scope:activity.var:third_place = { has_trait = charioteer_green } + } + } + set_or_increment_lucky_better_variable = yes + add_character_flag = successful_bet + scope:activity = { + add_activity_log_entry = { + key = chariot_race_betting_team_outcome_key + score = 100 + show_in_conclusion = yes + character = scope:current_gambler + scope:current_gambler = { + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:green_show_payout + max = scope:current_gambler.monumental_gold_value + } + } + change_variable = { + name = chariot_race_pot + subtract = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:green_show_payout + } + } + } + } + } + } + flag:whites = { + if = { + limit = { + OR = { + scope:activity.var:first_place = { has_trait = charioteer_white } + scope:activity.var:second_place = { has_trait = charioteer_white } + scope:activity.var:third_place = { has_trait = charioteer_white } + } + } + set_or_increment_lucky_better_variable = yes + add_character_flag = successful_bet + scope:activity = { + add_activity_log_entry = { + key = chariot_race_betting_team_outcome_key + score = 100 + show_in_conclusion = yes + character = scope:current_gambler + scope:current_gambler = { + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:white_show_payout + max = scope:current_gambler.monumental_gold_value + } + } + change_variable = { + name = chariot_race_pot + subtract = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:white_show_payout + } + } + } + } + } + } + flag:reds = { + if = { + limit = { + OR = { + scope:activity.var:first_place = { has_trait = charioteer_red } + scope:activity.var:second_place = { has_trait = charioteer_red } + scope:activity.var:third_place = { has_trait = charioteer_red } + } + } + set_or_increment_lucky_better_variable = yes + add_character_flag = successful_bet + scope:activity = { + add_activity_log_entry = { + key = chariot_race_betting_team_outcome_key + score = 100 + show_in_conclusion = yes + character = scope:current_gambler + scope:current_gambler = { + add_gold = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:red_show_payout + max = scope:current_gambler.monumental_gold_value + } + } + change_variable = { + name = chariot_race_pot + subtract = { + value = scope:current_gambler.var:wager_value + multiply = scope:activity.var:red_show_payout + } + } + } + } + } + } + } + } + } + } +} + +clear_placement_variables_effect = { + switch = { + trigger = has_variable + first_place = { remove_variable = first_place } + second_place = { remove_variable = second_place } + third_place = { remove_variable = third_place } + fourth_place = { remove_variable = fourth_place } + fifth_place = { remove_variable = fifth_place } + sixth_place = { remove_variable = sixth_place } + seventh_place = { remove_variable = seventh_place } + eighth_place = { remove_variable = eighth_place } + ninth_place = { remove_variable = ninth_place } + tenth_place = { remove_variable = tenth_place } + eleventh_place = { remove_variable = eleventh_place } + twelfth_place = { remove_variable = twelfth_place } + } +} + +chariot_race_remove_variables_effect = { + scope:activity = { + # Clean up variables we used for calculations on both Charioteers and Spectators + every_guest_subset = { + name = charioteers + remove_variable = odds_win_a + remove_variable = odds_win_b + remove_variable = odds_place_a + remove_variable = odds_place_b + remove_variable = odds_show_a + remove_variable = odds_show_b + remove_variable = percent_chance_to_win + remove_variable = percent_chance_to_place + remove_variable = percent_chance_to_show + remove_variable = win_payout + remove_variable = place_payout + remove_variable = show_payout + remove_variable = current_place_in_race + } + every_guest_subset = { + name = spectators + remove_variable = wager_team + remove_variable = wager_type + remove_variable = wager_target + remove_variable = wager_value + if = { + limit = { has_character_flag = successful_bet } + remove_character_flag = successful_bet + } + } + # Really for error suppression only since variables saved on activities are destroyed when the activity is over + switch = { + trigger = has_variable + blue_percent_chance_to_win = { remove_variable = blue_percent_chance_to_win } + blue_percent_chance_to_show = { remove_variable = blue_percent_chance_to_show } + blue_percent_chance_to_place = { remove_variable = blue_percent_chance_to_place } + green_percent_chance_to_win = { remove_variable = green_percent_chance_to_win } + green_percent_chance_to_place = { remove_variable = green_percent_chance_to_place } + green_percent_chance_to_show = { remove_variable = green_percent_chance_to_show } + white_percent_chance_to_place = { remove_variable = white_percent_chance_to_place } + white_percent_chance_to_win = { remove_variable = white_percent_chance_to_win } + white_percent_chance_to_show = { remove_variable = white_percent_chance_to_show } + red_percent_chance_to_win = { remove_variable = red_percent_chance_to_win } + red_percent_chance_to_place = { remove_variable = red_percent_chance_to_place } + red_percent_chance_to_show = { remove_variable = red_percent_chance_to_show } + dead_charioteers = { remove_variable = dead_charioteers } + } + clear_placement_variables_effect = yes + } +} + +advance_place_in_ranking_effect = { + $NEW_LEADING_CHAR$ = { save_scope_as = char_advanced } + $NEW_TRAILING_CHAR$ = { save_scope_as = char_passed } + scope:char_advanced = { + change_variable = { + name = chariot_race_victory_score + add = { + value = scope:char_passed.var:chariot_race_victory_score + subtract = scope:char_advanced.var:chariot_race_victory_score + add = 1 + } + } + + } + scope:activity = { update_chariot_race_standings_effect = yes } +} + +# Use this effect to update the current standings of the race based on each charioteer's victory score +update_chariot_race_standings_effect = { + scope:activity = { + # Ensure we have dead characters saved for the gui + if = { + limit = { + has_variable = first_place + var:first_place = { is_alive = no } + } + add_to_variable_list = { + name = dead_charioteers + target = var:first_place + } + } + else_if = { + limit = { + has_variable = second_place + var:second_place = { is_alive = no } + } + add_to_variable_list = { + name = dead_charioteers + target = var:second_place + } + } + else_if = { + limit = { + has_variable = third_place + var:third_place = { is_alive = no } + } + add_to_variable_list = { + name = dead_charioteers + target = var:third_place + } + } + else_if = { + limit = { + has_variable = fourth_place + var:fourth_place = { is_alive = no } + } + add_to_variable_list = { + name = dead_charioteers + target = var:fourth_place + } + } + else_if = { + limit = { + has_variable = fifth_place + var:fifth_place = { is_alive = no } + } + add_to_variable_list = { + name = dead_charioteers + target = var:fifth_place + } + } + else_if = { + limit = { + has_variable = sixth_place + var:sixth_place = { is_alive = no } + } + add_to_variable_list = { + name = dead_charioteers + target = var:sixth_place + } + } + else_if = { + limit = { + has_variable = seventh_place + var:seventh_place = { is_alive = no } + } + add_to_variable_list = { + name = dead_charioteers + target = var:seventh_place + } + } + else_if = { + limit = { + has_variable = eighth_place + var:eighth_place = { is_alive = no } + } + add_to_variable_list = { + name = dead_charioteers + target = var:eighth_place + } + } + else_if = { + limit = { + has_variable = ninth_place + var:ninth_place = { is_alive = no } + } + add_to_variable_list = { + name = dead_charioteers + target = var:ninth_place + } + } + else_if = { + limit = { + has_variable = tenth_place + var:tenth_place = { is_alive = no } + } + add_to_variable_list = { + name = dead_charioteers + target = var:tenth_place + } + } + else_if = { + limit = { + has_variable = eleventh_place + var:eleventh_place = { is_alive = no } + } + add_to_variable_list = { + name = dead_charioteers + target = var:eleventh_place + } + } + else_if = { + limit = { + has_variable = twelfth_place + var:twelfth_place = { is_alive = no } + } + add_to_variable_list = { + name = dead_charioteers + target = var:twelfth_place + } + } + # Clear the variables so we get rid of any dead characters + clear_placement_variables_effect = yes + # Get a count of how many living charioteers we have + set_variable = { + name = num_charioteers + value = 0 + } + # Iterate over the list of charioteers and save each as a variable according to their place + ordered_guest_subset = { + name = charioteers + order_by = charioteer_victory_score_value + max = 12 + check_range_bounds = no + limit = { is_alive = yes } + save_temporary_scope_as = current_charioteer + # increment variable + scope:activity = { + change_variable = { + name = num_charioteers + add = 1 + } + } + if = { + limit = { has_variable = current_place_in_race } + remove_variable = current_place_in_race + } + # scripted effect to set variable based on current count (num_charioteers) + assign_charioteer_to_place_variable_effect = yes + } + } +} + +# Used in update_chariot_race_standings_effect to set variables on both the activity and the individual charioteers +assign_charioteer_to_place_variable_effect = { + scope:activity = { + switch = { + trigger = var:num_charioteers + 1 = { + set_variable = { + name = first_place + value = scope:current_charioteer + } + scope:current_charioteer = { + set_variable = { + name = current_place_in_race + value = 1 + } + } + } + 2 = { + set_variable = { + name = second_place + value = scope:current_charioteer + } + scope:current_charioteer = { + set_variable = { + name = current_place_in_race + value = 2 + } + } + } + 3 = { + set_variable = { + name = third_place + value = scope:current_charioteer + } + scope:current_charioteer = { + set_variable = { + name = current_place_in_race + value = 3 + } + } + } + 4 = { + set_variable = { + name = fourth_place + value = scope:current_charioteer + } + scope:current_charioteer = { + set_variable = { + name = current_place_in_race + value = 4 + } + } + } + 5 = { + set_variable = { + name = fifth_place + value = scope:current_charioteer + } + scope:current_charioteer = { + set_variable = { + name = current_place_in_race + value = 5 + } + } + } + 6 = { + set_variable = { + name = sixth_place + value = scope:current_charioteer + } + scope:current_charioteer = { + set_variable = { + name = current_place_in_race + value = 6 + } + } + } + 7 = { + set_variable = { + name = seventh_place + value = scope:current_charioteer + } + scope:current_charioteer = { + set_variable = { + name = current_place_in_race + value = 7 + } + } + } + 8 = { + set_variable = { + name = eighth_place + value = scope:current_charioteer + } + scope:current_charioteer = { + set_variable = { + name = current_place_in_race + value = 8 + } + } + } + 9 = { + set_variable = { + name = ninth_place + value = scope:current_charioteer + } + scope:current_charioteer = { + set_variable = { + name = current_place_in_race + value = 9 + } + } + } + 10 = { + set_variable = { + name = tenth_place + value = scope:current_charioteer + } + scope:current_charioteer = { + set_variable = { + name = current_place_in_race + value = 10 + } + } + } + 11 = { + set_variable = { + name = eleventh_place + value = scope:current_charioteer + } + scope:current_charioteer = { + set_variable = { + name = current_place_in_race + value = 11 + } + } + } + 12 = { + set_variable = { + name = twelfth_place + value = scope:current_charioteer + } + scope:current_charioteer = { + set_variable = { + name = current_place_in_race + value = 12 + } + } + } + } + } +} + +distribute_charioteer_trait_xp_effect = { + switch = { + trigger = has_trait + charioteer_blue = { + if = { + limit = { has_court_position = charioteer_court_position } + employer = { + send_interface_toast = { + title = charioteer_trait_xp_gain_message + left_icon = prev + prev = { + add_trait_xp = { + trait = charioteer_blue + value = $VALUE$ + } + } + } + } + } + else = { + add_trait_xp = { + trait = charioteer_blue + value = $VALUE$ + } + } + } + charioteer_green = { + if = { + limit = { has_court_position = charioteer_court_position } + employer = { + send_interface_toast = { + title = charioteer_trait_xp_gain_message + left_icon = prev + prev = { + add_trait_xp = { + trait = charioteer_green + value = $VALUE$ + } + } + } + } + } + else = { + add_trait_xp = { + trait = charioteer_green + value = $VALUE$ + } + } + } + charioteer_white = { + if = { + limit = { has_court_position = charioteer_court_position } + employer = { + send_interface_toast = { + title = charioteer_trait_xp_gain_message + left_icon = prev + prev = { + add_trait_xp = { + trait = charioteer_white + value = $VALUE$ + } + } + } + } + } + else = { + add_trait_xp = { + trait = charioteer_white + value = $VALUE$ + } + } + } + charioteer_red = { + if = { + limit = { has_court_position = charioteer_court_position } + employer = { + send_interface_toast = { + title = charioteer_trait_xp_gain_message + left_icon = prev + prev = { + add_trait_xp = { + trait = charioteer_red + value = $VALUE$ + } + } + } + } + } + else = { + add_trait_xp = { + trait = charioteer_red + value = $VALUE$ + } + } + } + } +} + +remove_dead_charioteer_from_race = { + scope:activity = { + add_to_variable_list = { + name = dead_charioteers + target = prev + } + } +} + +### END CHARIOT RACE + +ep3_send_akolouthos_message_loyal = { + send_interface_message = { + type = msg_akolouthos_steels_varangians + title = ep3_akolouthos_events.1000 + desc = ep3_akolouthos_events.1000_loyal_notification_tooltip + + left_icon = scope:trait_getter + scope:trait_getter = { + add_trait = loyal + add_opinion = { + target = root + modifier = loyalty_opinion + opinion = 40 + } + } + custom_tooltip = akolouthos_effect_tooltip + } +} + +ep3_send_akolouthos_message_varangian = { + send_interface_message = { + type = msg_akolouthos_steels_varangians + title = ep3_akolouthos_events.1000 + desc = ep3_akolouthos_events.1000_varangian_notification_tooltip + + left_icon = scope:trait_getter + scope:trait_getter = { + add_trait = varangian + add_opinion = { + target = root + modifier = loyalty_opinion + opinion = 40 + } + } + custom_tooltip = akolouthos_effect_tooltip + } +} + +ep3_palace_looting_random_malus_effect = { + if = { + limit = { + has_character_flag = malus_court_grandeur + var:varangian_regiments >= 7 + } + change_current_court_grandeur = massive_court_grandeur_loss + } + else_if = { + limit = { + has_character_flag = malus_court_grandeur + var:varangian_regiments >= 4 + } + change_current_court_grandeur = major_court_grandeur_loss + } + else_if = { + limit = { + has_character_flag = malus_court_grandeur + } + change_current_court_grandeur = medium_court_grandeur_loss + } + if = { + limit = { + has_character_flag = malus_broken_artifact + } + scope:broken_artifact = { + add_durability = -40 + } + } + if = { + limit = { + has_character_flag = malus_stolen_artifact + } + destroy_artifact = scope:stolen_artifact + } +} + +ep3_child_castration_effect = { + add_trait = beardless_eunuch + torture_memory_effect = { + VICTIM = scope:recipient + TORTURER = scope:actor + TYPE = castrated_beardless + } + #Eunuch bonus effects + custom_tooltip = castration_increased_aptitude + if = { + limit = { + scope:actor = { + is_landed_or_landless_administrative = yes + } + } + custom_tooltip = castration_governor_efficiency + } + #might get hurt + custom_tooltip = castration_wounded_chance + hidden_effect = { + random_list = { + 5 = { + add_character_modifier = { + modifier = brutal_castration_modifier + years = 5 + } + } + 5 = { + modifier = { + add = 5 + employs_court_position = court_physician_court_position + } + modifier = { + add = 5 + employs_court_position = court_physician_court_position + court_position:court_physician_court_position = { + aptitude = { + court_position = court_physician_court_position + value >= 1 + } + } + } + modifier = { + add = 10 + employs_court_position = court_physician_court_position + court_position:court_physician_court_position = { + aptitude = { + court_position = court_physician_court_position + value >= 2 + } + } + } + modifier = { + add = 10 + employs_court_position = court_physician_court_position + court_position:court_physician_court_position = { + aptitude = { + court_position = court_physician_court_position + value >= 3 + } + } + } + modifier = { + add = 10 + employs_court_position = court_physician_court_position + court_position:court_physician_court_position = { + aptitude = { + court_position = court_physician_court_position + value >= 4 + } + } + } + } + } + } +} + +ep3_youth_castration_effect = { + add_trait = eunuch_1 + torture_memory_effect = { + VICTIM = scope:recipient + TORTURER = scope:actor + TYPE = castrated + } + #eunuch bonus effects + custom_tooltip = castration_increased_aptitude + if = { + limit = { + scope:actor = { + is_landed_or_landless_administrative = yes + } + } + custom_tooltip = castration_governor_efficiency + } + #might get wounded + custom_tooltip = castration_wounded_chance + hidden_effect = { + random_list = { + 10 = { + add_character_modifier = { + modifier = brutal_castration_modifier + years = 5 + } + } + 5 = { + modifier = { + add = 5 + employs_court_position = court_physician_court_position + } + modifier = { + add = 5 + employs_court_position = court_physician_court_position + court_position:court_physician_court_position = { + aptitude = { + court_position = court_physician_court_position + value >= 1 + } + } + } + modifier = { + add = 10 + employs_court_position = court_physician_court_position + court_position:court_physician_court_position = { + aptitude = { + court_position = court_physician_court_position + value >= 2 + } + } + } + modifier = { + add = 10 + employs_court_position = court_physician_court_position + court_position:court_physician_court_position = { + aptitude = { + court_position = court_physician_court_position + value >= 3 + } + } + } + modifier = { + add = 10 + employs_court_position = court_physician_court_position + court_position:court_physician_court_position = { + aptitude = { + court_position = court_physician_court_position + value >= 4 + } + } + } + } + } + } +} + +ep3_greek_fire_success_effect = { + scope:invading_commander = { + add_character_modifier = { + modifier = ravaged_by_greek_fire_modifier + years = 1 + } + add_stress = major_stress_impact_gain + } + scope:army = { + deplete_army_by_percentage = 0.9 + } + scope:invading_commander = { + custom_tooltip = two_knights_killed_tooltip + hidden_effect = { + scope:knight_1 ?= { + death = { + death_reason = death_greek_fire + killer = scope:city_defender + } + } + scope:knight_2 ?= { + death = { + death_reason = death_greek_fire + killer = scope:city_defender + } + } + } + custom_tooltip = three_knights_killed_tooltip + hidden_effect = { + scope:knight_3 ?= { + increase_wounds_effect = { REASON = greek_fire } + } + scope:knight_4 ?= { + increase_wounds_effect = { REASON = greek_fire } + } + scope:knight_5 ?= { + increase_wounds_effect = { REASON = greek_fire } + } + } + } + +} + +ep3_greek_fire_fail_effect = { + scope:invading_commander = { + add_character_modifier = { + modifier = assaulted_by_greek_fire_modifier + years = 1 + } + add_stress = medium_stress_impact_gain + } + scope:knight_1 ?= { + death = { + death_reason = death_greek_fire + killer = scope:city_defender + } + } + scope:army = { + deplete_army_by_percentage = 0.4 + } + scope:invading_commander = { + custom_tooltip = two_knights_wounded_tooltip + hidden_effect = { + scope:knight_2 ?= { + increase_wounds_effect = { REASON = greek_fire } + } + scope:knight_3 ?= { + increase_wounds_effect = { REASON = greek_fire } + } + } + } +} + +ep3_greek_fire_crit_fail_effect = { + scope:invading_commander = { + add_character_modifier = { + modifier = assaulted_by_greek_fire_modifier + years = 1 + } + } + scope:army = { + deplete_army_by_percentage = 0.1 + } + scope:invading_commander = { + custom_tooltip = two_knights_wounded_tooltip + hidden_effect = { + scope:knight_1 ?= { + increase_wounds_effect = { REASON = greek_fire } + } + scope:knight_2 ?= { + increase_wounds_effect = { REASON = greek_fire } + } + } + } + + root.capital_county = { + add_county_modifier = { + modifier = defenders_immolated_modifier + years = 10 + } + } + #You lose the greek fire fleet modifier + title:c_byzantion = { + remove_county_modifier = defensive_fire_dromons_modifier + } +} + +save_traveler_culture_effect = { + random_culture_global = { + limit = { + exists = culture_head + this != root.culture + } + save_scope_as = traveler_culture + } + #save second culture + random_culture_global = { + limit = { + exists = culture_head + this != root.culture + OR = { + AND = { + culture_overlaps_geographical_region = world_europe + scope:traveler_culture = { culture_overlaps_geographical_region = world_europe } + } + AND = { + culture_overlaps_geographical_region = world_asia_minor + scope:traveler_culture = { culture_overlaps_geographical_region = world_europe } + } + AND = { + culture_overlaps_geographical_region = world_europe + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_minor } + } + AND = { + culture_overlaps_geographical_region = world_asia_minor + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_minor } + } + AND = { + culture_overlaps_geographical_region = world_asia_minor + scope:traveler_culture = { culture_overlaps_geographical_region = world_middle_east } + } + AND = { + culture_overlaps_geographical_region = world_middle_east + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_minor } + } + AND = { + culture_overlaps_geographical_region = world_middle_east + scope:traveler_culture = { culture_overlaps_geographical_region = world_middle_east } + } + AND = { + culture_overlaps_geographical_region = world_africa + scope:traveler_culture = { culture_overlaps_geographical_region = world_africa } + } + AND = { + culture_overlaps_geographical_region = world_steppe + scope:traveler_culture = { culture_overlaps_geographical_region = world_steppe } + } + AND = { + culture_overlaps_geographical_region = world_tibet + scope:traveler_culture = { culture_overlaps_geographical_region = world_tibet } + } + AND = { + culture_overlaps_geographical_region = world_tibet + scope:traveler_culture = { culture_overlaps_geographical_region = world_india} + } + AND = { + culture_overlaps_geographical_region = world_india + scope:traveler_culture = { culture_overlaps_geographical_region = world_tibet } + } + AND = { + culture_overlaps_geographical_region = world_india + scope:traveler_culture = { culture_overlaps_geographical_region = world_india } + } + AND = { + culture_overlaps_geographical_region = world_burma + scope:traveler_culture = { culture_overlaps_geographical_region = world_india } + } + AND = { + culture_overlaps_geographical_region = world_india + scope:traveler_culture = { culture_overlaps_geographical_region = world_burma } + } + AND = { + culture_overlaps_geographical_region = world_tibet + scope:traveler_culture = { culture_overlaps_geographical_region = world_burma } + } + AND = { + culture_overlaps_geographical_region = world_burma + scope:traveler_culture = { culture_overlaps_geographical_region = world_tibet } + } + AND = { + culture_overlaps_geographical_region = world_tibet + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_china } + } + AND = { + culture_overlaps_geographical_region = world_asia_china + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_china } + } + AND = { + culture_overlaps_geographical_region = world_asia_china + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_southeast } + } + AND = { + culture_overlaps_geographical_region = world_asia_china + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_korea } + } + AND = { + culture_overlaps_geographical_region = world_asia_china + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_japan } + } + AND = { + culture_overlaps_geographical_region = world_asia_korea + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_china } + } + AND = { + culture_overlaps_geographical_region = world_asia_korea + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_japan } + } + AND = { + culture_overlaps_geographical_region = world_asia_korea + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_korea } + } + AND = { + culture_overlaps_geographical_region = world_asia_japan + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_japan } + } + AND = { + culture_overlaps_geographical_region = world_asia_japan + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_china } + } + AND = { + culture_overlaps_geographical_region = world_asia_japan + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_korea } + } + } + cultural_acceptance = { + target = scope:traveler_culture + value >= 5 + } + } + alternative_limit = { + this = root.culture + } + save_scope_as = traveler_culture_2 + } +} +ep3_ai_castration_effect = { + random = { + chance = 50 + add_trait = beardless_eunuch + random_list = { + 5 = { + add_character_modifier = { + modifier = brutal_castration_modifier + years = 5 + } + } + 5 = {} + 5 = { + trigger = { + liege ?= { employs_court_position = court_physician_court_position } + } + modifier = { + add = 5 + liege.court_position:court_physician_court_position = { + aptitude = { + court_position = court_physician_court_position + value >= 1 + } + } + } + modifier = { + add = 10 + liege.court_position:court_physician_court_position = { + aptitude = { + court_position = court_physician_court_position + value >= 2 + } + } + } + modifier = { + add = 10 + liege.court_position:court_physician_court_position = { + aptitude = { + court_position = court_physician_court_position + value >= 3 + } + } + } + modifier = { + add = 10 + liege.court_position:court_physician_court_position = { + aptitude = { + court_position = court_physician_court_position + value >= 4 + } + } + } + } + } + } +} + +ep3_story_cycle_admin_eunuch_upgrade_modifier_effect = { + save_scope_value_as = { + name = modifier_type + value = flag:$TYPE$ + } + switch = { + trigger = has_character_modifier + admin_eunuch_$TYPE$_1_modifier = { + hidden_effect = { remove_character_modifier = admin_eunuch_$TYPE$_1_modifier } + add_character_modifier = admin_eunuch_$TYPE$_2_modifier + } + admin_eunuch_$TYPE$_2_modifier = { + hidden_effect = { remove_character_modifier = admin_eunuch_$TYPE$_2_modifier } + add_character_modifier = admin_eunuch_$TYPE$_3_modifier + } + admin_eunuch_$TYPE$_3_modifier = { + hidden_effect = { remove_character_modifier = admin_eunuch_$TYPE$_3_modifier } + add_character_modifier = admin_eunuch_$TYPE$_4_modifier + } + admin_eunuch_$TYPE$_4_modifier = { + hidden_effect = { remove_character_modifier = admin_eunuch_$TYPE$_4_modifier } + add_character_modifier = admin_eunuch_$TYPE$_5_modifier + } + admin_eunuch_$TYPE$_5_modifier = { + hidden_effect = { remove_character_modifier = admin_eunuch_$TYPE$_5_modifier } + add_character_modifier = admin_eunuch_$TYPE$_6_modifier + } + admin_eunuch_$TYPE$_6_modifier = { + hidden_effect = { remove_character_modifier = admin_eunuch_$TYPE$_6_modifier } + add_character_modifier = admin_eunuch_$TYPE$_7_modifier + } + admin_eunuch_$TYPE$_7_modifier = { + hidden_effect = { remove_character_modifier = admin_eunuch_$TYPE$_7_modifier } + add_character_modifier = admin_eunuch_$TYPE$_8_modifier + } + admin_eunuch_$TYPE$_8_modifier = { + if = { + limit = { + scope:modifier_type = flag:eunuch + NOT = { has_hook = top_liege } + } + add_hook = { + type = influence_hook + target = top_liege + } + } + else_if = { + limit = { + scope:modifier_type = flag:eunuch + NOT = { has_strong_hook = top_liege } + } + remove_hook = { target = top_liege } + add_hook = { + type = strong_influence_hook + target = top_liege + } + } + else = { change_influence = medium_influence_gain } + } + fallback = { add_character_modifier = admin_eunuch_$TYPE$_4_modifier } + } +} + +ep3_story_cycle_admin_eunuch_matching_modifier_effect = { + $FIRST$ = { + switch = { + trigger = has_character_modifier + admin_eunuch_$FIRST_TYPE$_1_modifier = { + $SECOND$ = { add_character_modifier = admin_eunuch_$SECOND_TYPE$_1_modifier } + } + admin_eunuch_$FIRST_TYPE$_2_modifier = { + $SECOND$ = { add_character_modifier = admin_eunuch_$SECOND_TYPE$_2_modifier } + } + admin_eunuch_$FIRST_TYPE$_3_modifier = { + $SECOND$ = { add_character_modifier = admin_eunuch_$SECOND_TYPE$_3_modifier } + } + admin_eunuch_$FIRST_TYPE$_4_modifier = { + $SECOND$ = { add_character_modifier = admin_eunuch_$SECOND_TYPE$_4_modifier } + } + admin_eunuch_$FIRST_TYPE$_5_modifier = { + $SECOND$ = { add_character_modifier = admin_eunuch_$SECOND_TYPE$_5_modifier } + } + admin_eunuch_$FIRST_TYPE$_6_modifier = { + $SECOND$ = { add_character_modifier = admin_eunuch_$SECOND_TYPE$_6_modifier } + } + admin_eunuch_$FIRST_TYPE$_7_modifier = { + $SECOND$ = { add_character_modifier = admin_eunuch_$SECOND_TYPE$_7_modifier } + } + admin_eunuch_$FIRST_TYPE$_8_modifier = { + $SECOND$ = { add_character_modifier = admin_eunuch_$SECOND_TYPE$_8_modifier } + } + } + } +} + +ep3_story_cycle_admin_eunuch_downgrade_modifier_effect = { + save_scope_value_as = { + name = modifier_type + value = flag:$TYPE$ + } + switch = { + trigger = has_character_modifier + admin_eunuch_$TYPE$_1_modifier = { + if = { + limit = { scope:modifier_type = flag:eunuch } + progress_towards_rival_effect = { + REASON = rival_admin_eunuch + CHARACTER = top_liege + OPINION = default_rival_opinion + } + } + else = { change_influence = medium_influence_loss } + } + admin_eunuch_$TYPE$_2_modifier = { + hidden_effect = { remove_character_modifier = admin_eunuch_$TYPE$_2_modifier } + add_character_modifier = admin_eunuch_$TYPE$_1_modifier + if = { # Harder to say no the further you go + limit = { scope:modifier_type = flag:liege } + change_influence = miniscule_influence_loss + } + } + admin_eunuch_$TYPE$_3_modifier = { + hidden_effect = { remove_character_modifier = admin_eunuch_$TYPE$_3_modifier } + add_character_modifier = admin_eunuch_$TYPE$_2_modifier + if = { # Harder to say no the further you go + limit = { scope:modifier_type = flag:liege } + change_influence = miniscule_influence_loss + } + } + admin_eunuch_$TYPE$_4_modifier = { + hidden_effect = { remove_character_modifier = admin_eunuch_$TYPE$_4_modifier } + add_character_modifier = admin_eunuch_$TYPE$_3_modifier + if = { # Harder to say no the further you go + limit = { scope:modifier_type = flag:liege } + change_influence = minor_influence_loss + } + } + admin_eunuch_$TYPE$_5_modifier = { + hidden_effect = { remove_character_modifier = admin_eunuch_$TYPE$_5_modifier } + add_character_modifier = admin_eunuch_$TYPE$_4_modifier + if = { # Harder to say no the further you go + limit = { scope:modifier_type = flag:liege } + change_influence = minor_influence_loss + } + } + admin_eunuch_$TYPE$_6_modifier = { + hidden_effect = { remove_character_modifier = admin_eunuch_$TYPE$_6_modifier } + add_character_modifier = admin_eunuch_$TYPE$_5_modifier + if = { # Harder to say no the further you go + limit = { scope:modifier_type = flag:liege } + change_influence = medium_influence_loss + } + } + admin_eunuch_$TYPE$_7_modifier = { + hidden_effect = { remove_character_modifier = admin_eunuch_$TYPE$_7_modifier } + add_character_modifier = admin_eunuch_$TYPE$_6_modifier + if = { # Harder to say no the further you go + limit = { scope:modifier_type = flag:liege } + change_influence = medium_influence_loss + } + } + admin_eunuch_$TYPE$_8_modifier = { + hidden_effect = { remove_character_modifier = admin_eunuch_$TYPE$_8_modifier } + add_character_modifier = admin_eunuch_$TYPE$_7_modifier + if = { # Harder to say no the further you go + limit = { scope:modifier_type = flag:liege } + change_influence = major_influence_loss + } + } + fallback = { add_character_modifier = admin_eunuch_$TYPE$_3_modifier } + } +} + +ep3_story_cycle_admin_eunuch_clear_modifier_effect = { + switch = { + trigger = has_character_modifier + admin_eunuch_$TYPE$_1_modifier = { remove_character_modifier = admin_eunuch_$TYPE$_1_modifier } + admin_eunuch_$TYPE$_2_modifier = { remove_character_modifier = admin_eunuch_$TYPE$_2_modifier } + admin_eunuch_$TYPE$_3_modifier = { remove_character_modifier = admin_eunuch_$TYPE$_3_modifier } + admin_eunuch_$TYPE$_4_modifier = { remove_character_modifier = admin_eunuch_$TYPE$_4_modifier } + admin_eunuch_$TYPE$_5_modifier = { remove_character_modifier = admin_eunuch_$TYPE$_5_modifier } + admin_eunuch_$TYPE$_6_modifier = { remove_character_modifier = admin_eunuch_$TYPE$_6_modifier } + admin_eunuch_$TYPE$_7_modifier = { remove_character_modifier = admin_eunuch_$TYPE$_7_modifier } + admin_eunuch_$TYPE$_8_modifier = { remove_character_modifier = admin_eunuch_$TYPE$_8_modifier } + } +} + +ep3_give_eunuch_effect = { + $TAKER$ = { + add_courtier = $EUNUCH$ + } + $GIVER$ = { + change_influence = { + value = 100 + add = $EUNUCH$.sum_of_all_skills_value + if = { + limit = { + $EUNUCH$ = { has_trait = beardless_eunuch } + } + multiply = 1.5 + } + } + } +} + +################################################## +# Misc +################################################## + +# Picks a random valid maa type for OWNER to create +ep3_pick_random_maa_regiment_effect = { + save_temporary_scope_value_as = { + name = include_basic_maa + value = $INCLUDE_BASIC_MAA$ + } + save_temporary_scope_value_as = { + name = include_siege_maa + value = $INCLUDE_SIEGE_MAA$ + } + $OWNER$ = { + random_list = { + 1 = { + trigger = { + scope:include_basic_maa = yes + } + save_scope_value_as = { + name = maa_to_create + value = flag:light_footmen + } + } + 1 = { + trigger = { + scope:include_basic_maa = yes + } + save_scope_value_as = { + name = maa_to_create + value = flag:bowmen + } + } + 1 = { + trigger = { + scope:include_basic_maa = yes + } + save_scope_value_as = { + name = maa_to_create + value = flag:light_horsemen + } + } + 1 = { + trigger = { + scope:include_basic_maa = yes + } + save_scope_value_as = { + name = maa_to_create + value = flag:pikemen_unit + } + } + # TRIBAL + 1 = { + trigger = { + culture = { has_innovation = innovation_elephantry } + } + save_scope_value_as = { + name = maa_to_create + value = flag:war_elephant + } + } + 1 = { + trigger = { + culture = { has_innovation = innovation_war_camels } + } + save_scope_value_as = { + name = maa_to_create + value = flag:camel_rider + } + } + 1 = { + trigger = { + culture = { has_innovation = innovation_arched_saddle } + } + save_scope_value_as = { + name = maa_to_create + value = flag:armored_horsemen + } + } + 1 = { + trigger = { + culture = { + has_innovation = innovation_catapult + NOR = { + has_cultural_pillar = heritage_chinese + has_cultural_pillar = heritage_korean + has_cultural_pillar = heritage_japonic + } + } + scope:include_siege_maa = yes + } + save_scope_value_as = { + name = maa_to_create + value = flag:onager + } + } + 1 = { + trigger = { + culture = { + has_innovation = innovation_catapult + OR = { + has_cultural_pillar = heritage_chinese + has_cultural_pillar = heritage_korean + has_cultural_pillar = heritage_japonic + } + } + scope:include_siege_maa = yes + } + save_scope_value_as = { + name = maa_to_create + value = flag:ballista + } + } + # EARLY + 1 = { + trigger = { + culture = { has_innovation = innovation_quilted_armor } + } + save_scope_value_as = { + name = maa_to_create + value = flag:armored_footmen + } + } + 1 = { + trigger = { + culture = { + has_innovation = innovation_mangonel + NOR = { + has_cultural_pillar = heritage_chinese + has_cultural_pillar = heritage_korean + has_cultural_pillar = heritage_japonic + } + } + scope:include_siege_maa = yes + } + save_scope_value_as = { + name = maa_to_create + value = flag:mangonel + } + } + 1 = { + trigger = { + culture = { + has_innovation = innovation_mangonel + OR = { + has_cultural_pillar = heritage_chinese + has_cultural_pillar = heritage_korean + has_cultural_pillar = heritage_japonic + } + } + scope:include_siege_maa = yes + } + save_scope_value_as = { + name = maa_to_create + value = flag:cloud_ladder + } + } + # HIGH + 1 = { + trigger = { + culture = { + has_innovation = innovation_trebuchet + NOR = { + has_cultural_pillar = heritage_chinese + has_cultural_pillar = heritage_korean + has_cultural_pillar = heritage_japonic + } + } + scope:include_siege_maa = yes + } + save_scope_value_as = { + name = maa_to_create + value = flag:trebuchet + } + } + 1 = { + trigger = { + culture = { + has_innovation = innovation_trebuchet + OR = { + has_cultural_pillar = heritage_chinese + has_cultural_pillar = heritage_korean + has_cultural_pillar = heritage_japonic + } + } + scope:include_siege_maa = yes + } + save_scope_value_as = { + name = maa_to_create + value = flag:siege_tower + } + } + 1 = { + trigger = { + culture = { has_innovation = innovation_advanced_bowmaking } + } + save_scope_value_as = { + name = maa_to_create + value = flag:crossbowmen + } + } + # LATE + 1 = { + trigger = { + culture = { + has_cultural_parameter = unlock_late_medieval_gunpowder_units + NOR = { + has_cultural_pillar = heritage_chinese + has_cultural_pillar = heritage_korean + has_cultural_pillar = heritage_japonic + } + } + scope:include_siege_maa = yes + } + save_scope_value_as = { + name = maa_to_create + value = flag:bombard + } + } + 1 = { + trigger = { + culture = { + has_cultural_parameter = unlock_late_medieval_gunpowder_units + OR = { + has_cultural_pillar = heritage_chinese + has_cultural_pillar = heritage_korean + has_cultural_pillar = heritage_japonic + } + } + scope:include_siege_maa = yes + } + save_scope_value_as = { + name = maa_to_create + value = flag:cannon + } + } + # CULTURAL INNOVATIONS + 1 = { + trigger = { + culture = { has_innovation = innovation_bamboo_bows } + } + save_scope_value_as = { + name = maa_to_create + value = flag:paiks + } + } + 1 = { + trigger = { + culture = { has_innovation = innovation_zweihanders } + } + save_scope_value_as = { + name = maa_to_create + value = flag:landsknecht + } + } + 1 = { + trigger = { + culture = { has_innovation = innovation_adaptive_militia } + } + save_scope_value_as = { + name = maa_to_create + value = flag:goedendag + } + } + 1 = { + trigger = { + culture = { has_innovation = innovation_valets } + } + save_scope_value_as = { + name = maa_to_create + value = flag:gendarme + } + } + 1 = { + trigger = { + culture = { has_innovation = innovation_rocket_cart } + } + save_scope_value_as = { + name = maa_to_create + value = flag:rocket_carts + } + } + 1 = { + trigger = { + culture = { has_innovation = innovation_pike_columns } + } + save_scope_value_as = { + name = maa_to_create + value = flag:picchieri + } + } + 1 = { + trigger = { + culture = { has_innovation = innovation_legionnaires } + } + save_scope_value_as = { + name = maa_to_create + value = flag:praetorian + } + } + 1 = { + trigger = { + culture = { has_innovation = innovation_desert_tactics } + } + save_scope_value_as = { + name = maa_to_create + value = flag:chasseur + } + } + 1 = { + trigger = { + culture = { has_innovation = innovation_caballeros } + } + save_scope_value_as = { + name = maa_to_create + value = flag:caballero + } + } + 1 = { + trigger = { + culture = { has_innovation = innovation_hobbies } + } + save_scope_value_as = { + name = maa_to_create + value = flag:hobelar + } + } + 1 = { + trigger = { + culture = { has_innovation = innovation_rectilinear_schiltron } + } + save_scope_value_as = { + name = maa_to_create + value = flag:schiltron + } + } + 1 = { + trigger = { + culture = { has_innovation = innovation_sahel_horsemen } + } + save_scope_value_as = { + name = maa_to_create + value = flag:sahel_horsemen + } + } + 1 = { + trigger = { + culture = { has_innovation = innovation_sarawit } + } + save_scope_value_as = { + name = maa_to_create + value = flag:sarawit + } + } + 1 = { + trigger = { + culture = { has_innovation = innovation_repeating_crossbow } + } + save_scope_value_as = { + name = maa_to_create + value = flag:shenbigong + } + } + 1 = { + trigger = { + culture = { has_innovation = innovation_pole_vault } + } + save_scope_value_as = { + name = maa_to_create + value = flag:guanch_vaulter + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_huscarls } + } + save_scope_value_as = { + name = maa_to_create + value = flag:huscarl + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_longbowmen } + } + save_scope_value_as = { + name = maa_to_create + value = flag:longbowmen + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_monaspa } + } + save_scope_value_as = { + name = maa_to_create + value = flag:monaspa + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_cataphract } + } + save_scope_value_as = { + name = maa_to_create + value = flag:cataphract + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_metsanvartija } + } + save_scope_value_as = { + name = maa_to_create + value = flag:metsanvartija + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_maturkan_warriors } + } + save_scope_value_as = { + name = maa_to_create + value = flag:maturkan_warriors + } + } + 1 = { + trigger = { + OR = { + culture = { has_cultural_parameter = unlock_maa_horse_archers } + mpo_can_recruit_nomad_maa_trigger = yes + } + } + save_scope_value_as = { + name = maa_to_create + value = flag:horse_archers + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_ayyar } + } + save_scope_value_as = { + name = maa_to_create + value = flag:ayyar + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_mubarizun } + } + save_scope_value_as = { + name = maa_to_create + value = flag:mubarizun + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_mulaththamun } + } + save_scope_value_as = { + name = maa_to_create + value = flag:mulaththamun + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_archers_of_the_nile } + } + save_scope_value_as = { + name = maa_to_create + value = flag:archers_of_the_nile + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_druzhina } + } + save_scope_value_as = { + name = maa_to_create + value = flag:druzhina + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_hussar } + } + save_scope_value_as = { + name = maa_to_create + value = flag:hussar + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_horn_warrior } + } + save_scope_value_as = { + name = maa_to_create + value = flag:horn_warrior + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_bush_hunter } + } + save_scope_value_as = { + name = maa_to_create + value = flag:bush_hunter + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_shomer } + } + save_scope_value_as = { + name = maa_to_create + value = flag:shomer + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_garudas } + } + save_scope_value_as = { + name = maa_to_create + value = flag:garudas + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_khandayat } + } + save_scope_value_as = { + name = maa_to_create + value = flag:khandayat + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_mountaineer } + } + save_scope_value_as = { + name = maa_to_create + value = flag:mountaineer + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_guinea_warrior } + } + save_scope_value_as = { + name = maa_to_create + value = flag:guinea_warrior + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_abudrar } + } + save_scope_value_as = { + name = maa_to_create + value = flag:abudrar + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_zbrojnosh } + } + save_scope_value_as = { + name = maa_to_create + value = flag:zbrojnosh + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_palace_guards } + } + save_scope_value_as = { + name = maa_to_create + value = flag:palace_guards + } + } + 1 = { + trigger = { + dynasty ?= { + has_dynasty_perk = fp3_khvarenah_legacy_4 + } + } + save_scope_value_as = { + name = maa_to_create + value = flag:asawira + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_tarkhan } + } + save_scope_value_as = { + name = maa_to_create + value = flag:tarkhan + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_zupin_warrior } + } + save_scope_value_as = { + name = maa_to_create + value = flag:zupin_warrior + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_tawashi } + } + save_scope_value_as = { + name = maa_to_create + value = flag:tawashi + } + } + 1 = { + trigger = { + dynasty ?= { + has_dynasty_perk = warfare_legacy_5 + } + } + save_scope_value_as = { + name = maa_to_create + value = flag:house_guard + } + } + 1 = { + trigger = { + any_active_accolade = { + primary_type = { + this = accolade_type:archer_attribute + } + accolade_rank >= 3 + } + } + save_scope_value_as = { + name = maa_to_create + value = flag:accolade_maa_archers + } + } + 1 = { + trigger = { + any_active_accolade = { + primary_type = { + this = accolade_type:skirmisher_attribute + } + accolade_rank >= 3 + } + } + save_scope_value_as = { + name = maa_to_create + value = flag:accolade_maa_skirmishers + } + } + 1 = { + trigger = { + any_active_accolade = { + primary_type = { + this = accolade_type:pike_attribute + } + accolade_rank >= 3 + } + } + save_scope_value_as = { + name = maa_to_create + value = flag:accolade_maa_pikes + } + } + 1 = { + trigger = { + any_active_accolade = { + primary_type = { + this = accolade_type:outrider_attribute + } + accolade_rank >= 3 + } + } + save_scope_value_as = { + name = maa_to_create + value = flag:accolade_maa_outriders + } + } + 1 = { + trigger = { + any_active_accolade = { + primary_type = { + this = accolade_type:vanguard_attribute + } + accolade_rank >= 3 + } + } + save_scope_value_as = { + name = maa_to_create + value = flag:accolade_maa_vanguards + } + } + 1 = { + trigger = { + any_active_accolade = { + primary_type = { + this = accolade_type:lancer_attribute + } + accolade_rank >= 3 + } + } + save_scope_value_as = { + name = maa_to_create + value = flag:accolade_maa_lancers + } + } + 1 = { + trigger = { + any_active_accolade = { + primary_type = { + this = accolade_type:crossbowmen_attribute + } + accolade_rank >= 3 + } + } + save_scope_value_as = { + name = maa_to_create + value = flag:accolade_maa_crossbowers + } + } + 1 = { + trigger = { + any_active_accolade = { + primary_type = { + this = accolade_type:camelry_attribute + } + accolade_rank >= 3 + } + } + save_scope_value_as = { + name = maa_to_create + value = flag:accolade_maa_cameliers + } + } + 1 = { + trigger = { + any_active_accolade = { + primary_type = { + this = accolade_type:elephantry_attribute + } + accolade_rank >= 3 + } + } + save_scope_value_as = { + name = maa_to_create + value = flag:accolade_maa_elephantiers + } + } + 1 = { + trigger = { + any_active_accolade = { + primary_type = { + this = accolade_type:horse_archer_attribute + } + accolade_rank >= 3 + } + } + save_scope_value_as = { + name = maa_to_create + value = flag:accolade_maa_horse_archers + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_vigmen } + } + save_scope_value_as = { + name = maa_to_create + value = flag:vigmen + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_bondi } + } + save_scope_value_as = { + name = maa_to_create + value = flag:bondi + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_varangian_veterans } + } + save_scope_value_as = { + name = maa_to_create + value = flag:varangian_veterans + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_ayrudzi } + } + save_scope_value_as = { + name = maa_to_create + value = flag:ayrudzi + } + } + 1 = { + trigger = { + mpo_can_recruit_nomad_maa_trigger = yes + } + save_scope_value_as = { + name = maa_to_create + value = flag:steppe_raiders + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_conrois } + } + save_scope_value_as = { + name = maa_to_create + value = flag:conrois + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_akritai } + } + save_scope_value_as = { + name = maa_to_create + value = flag:akritai + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_ballistrai } + } + save_scope_value_as = { + name = maa_to_create + value = flag:ballistrai + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_skoutatoi } + } + save_scope_value_as = { + name = maa_to_create + value = flag:skoutatoi + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_warrior_monk_units } + } + save_scope_value_as = { + name = maa_to_create + value = flag:warrior_monks + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_emishi_horse_archers_units } + } + save_scope_value_as = { + name = maa_to_create + value = flag:emishi_horse_archers + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_mounted_samurai_units } + } + save_scope_value_as = { + name = maa_to_create + value = flag:japanese_horse_archers + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_pesilat } + } + save_scope_value_as = { + name = maa_to_create + value = flag:pesilat_warriors + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_gakgung_archers } + } + save_scope_value_as = { + name = maa_to_create + value = flag:gakgung_archers + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_infantry_samurai_units } + } + save_scope_value_as = { + name = maa_to_create + value = flag:samurai + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_zhanmadao } + } + save_scope_value_as = { + name = maa_to_create + value = flag:zhanmadao_infantry + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_burenjia } + } + save_scope_value_as = { + name = maa_to_create + value = flag:burenjia + } + } + 1 = { + trigger = { + culture = { has_innovation = innovation_tiefutu } + } + save_scope_value_as = { + name = maa_to_create + value = flag:tiefutu + } + } + 1 = { + trigger = { + culture = { has_cultural_parameter = unlock_maa_black_armor_cavalry } + } + save_scope_value_as = { + name = maa_to_create + value = flag:black_armor_cavalry + } + } + 1 = { + trigger = { + exists = scope:title + scope:title = title:e_byzantium + } + save_scope_value_as = { + name = maa_to_create + value = flag:varangian_guards + } + } + 1 = { + trigger = { + domicile ?= { has_domicile_parameter = camp_unlocks_handpicked_faithful_maa_type } + } + save_scope_value_as = { + name = maa_to_create + value = flag:handpicked_faithful + } + } + } + } + #in case you don't fullfil any criteria just pick a random default maa + if = { + limit = { + NOT = { exists = scope:maa_to_create } + } + random_list = { + 1 = { + save_scope_value_as = { + name = maa_to_create + value = flag:light_footmen + } + } + 1 = { + save_scope_value_as = { + name = maa_to_create + value = flag:bowmen + } + } + 1 = { + save_scope_value_as = { + name = maa_to_create + value = flag:light_horsemen + } + } + 1 = { + save_scope_value_as = { + name = maa_to_create + value = flag:pikemen_unit + } + } + } + } +} + +# creates the maa type for OWNER of SIZE set by the above +ep3_create_random_maa_regiment_effect = { + $OWNER$ = { + switch = { + trigger = scope:maa_to_create + flag:light_footmen = { + create_maa_or_upgrade_regiment_effect = { + TYPE = light_footmen + SIZE = $SIZE$ + } + } + flag:bowmen = { + create_maa_or_upgrade_regiment_effect = { + TYPE = bowmen + SIZE = $SIZE$ + } + } + flag:light_horsemen = { + create_maa_or_upgrade_regiment_effect = { + TYPE = light_horsemen + SIZE = $SIZE$ + } + } + flag:pikemen_unit = { + create_maa_or_upgrade_regiment_effect = { + TYPE = pikemen_unit + SIZE = $SIZE$ + } + } + flag:war_elephant = { + create_maa_or_upgrade_regiment_effect = { + TYPE = war_elephant + SIZE = $SIZE$ + } + } + flag:camel_rider = { + create_maa_or_upgrade_regiment_effect = { + TYPE = camel_rider + SIZE = $SIZE$ + } + } + flag:armored_horsemen = { + create_maa_or_upgrade_regiment_effect = { + TYPE = armored_horsemen + SIZE = $SIZE$ + } + } + flag:onager = { + create_maa_or_upgrade_regiment_effect = { + TYPE = onager + SIZE = $SIZE$ + } + } + flag:armored_footmen = { + create_maa_or_upgrade_regiment_effect = { + TYPE = armored_footmen + SIZE = $SIZE$ + } + } + flag:mangonel = { + create_maa_or_upgrade_regiment_effect = { + TYPE = mangonel + SIZE = $SIZE$ + } + } + flag:trebuchet = { + create_maa_or_upgrade_regiment_effect = { + TYPE = trebuchet + SIZE = $SIZE$ + } + } + flag:crossbowmen = { + create_maa_or_upgrade_regiment_effect = { + TYPE = crossbowmen + SIZE = $SIZE$ + } + } + flag:bombard = { + create_maa_or_upgrade_regiment_effect = { + TYPE = bombard + SIZE = $SIZE$ + } + } + flag:paiks = { + create_maa_or_upgrade_regiment_effect = { + TYPE = paiks + SIZE = $SIZE$ + } + } + flag:landsknecht = { + create_maa_or_upgrade_regiment_effect = { + TYPE = landsknecht + SIZE = $SIZE$ + } + } + flag:goedendag = { + create_maa_or_upgrade_regiment_effect = { + TYPE = goedendag + SIZE = $SIZE$ + } + } + flag:gendarme = { + create_maa_or_upgrade_regiment_effect = { + TYPE = gendarme + SIZE = $SIZE$ + } + } + flag:picchieri = { + create_maa_or_upgrade_regiment_effect = { + TYPE = picchieri + SIZE = $SIZE$ + } + } + flag:praetorian = { + create_maa_or_upgrade_regiment_effect = { + TYPE = praetorian + SIZE = $SIZE$ + } + } + flag:chasseur = { + create_maa_or_upgrade_regiment_effect = { + TYPE = chasseur + SIZE = $SIZE$ + } + } + flag:caballero = { + create_maa_or_upgrade_regiment_effect = { + TYPE = caballero + SIZE = $SIZE$ + } + } + flag:hobelar = { + create_maa_or_upgrade_regiment_effect = { + TYPE = hobelar + SIZE = $SIZE$ + } + } + flag:schiltron = { + create_maa_or_upgrade_regiment_effect = { + TYPE = schiltron + SIZE = $SIZE$ + } + } + flag:sahel_horsemen = { + create_maa_or_upgrade_regiment_effect = { + TYPE = sahel_horsemen + SIZE = $SIZE$ + } + } + flag:sarawit = { + create_maa_or_upgrade_regiment_effect = { + TYPE = sarawit + SIZE = $SIZE$ + } + } + flag:shenbigong = { + create_maa_or_upgrade_regiment_effect = { + TYPE = shenbigong + SIZE = $SIZE$ + } + } + flag:guanch_vaulter = { + create_maa_or_upgrade_regiment_effect = { + TYPE = guanch_vaulter + SIZE = $SIZE$ + } + } + flag:huscarl = { + create_maa_or_upgrade_regiment_effect = { + TYPE = huscarl + SIZE = $SIZE$ + } + } + flag:longbowmen = { + create_maa_or_upgrade_regiment_effect = { + TYPE = longbowmen + SIZE = $SIZE$ + } + } + flag:monaspa = { + create_maa_or_upgrade_regiment_effect = { + TYPE = monaspa + SIZE = $SIZE$ + } + } + flag:cataphract = { + create_maa_or_upgrade_regiment_effect = { + TYPE = cataphract + SIZE = $SIZE$ + } + } + flag:metsanvartija = { + create_maa_or_upgrade_regiment_effect = { + TYPE = metsanvartija + SIZE = $SIZE$ + } + } + flag:maturkan_warriors = { + create_maa_or_upgrade_regiment_effect = { + TYPE = maturkan_warriors + SIZE = $SIZE$ + } + } + flag:horse_archers = { + create_maa_or_upgrade_regiment_effect = { + TYPE = horse_archers + SIZE = $SIZE$ + } + } + flag:ayyar = { + create_maa_or_upgrade_regiment_effect = { + TYPE = ayyar + SIZE = $SIZE$ + } + } + flag:mubarizun = { + create_maa_or_upgrade_regiment_effect = { + TYPE = mubarizun + SIZE = $SIZE$ + } + } + flag:mulaththamun = { + create_maa_or_upgrade_regiment_effect = { + TYPE = mulaththamun + SIZE = $SIZE$ + } + } + flag:archers_of_the_nile = { + create_maa_or_upgrade_regiment_effect = { + TYPE = archers_of_the_nile + SIZE = $SIZE$ + } + } + flag:druzhina = { + create_maa_or_upgrade_regiment_effect = { + TYPE = druzhina + SIZE = $SIZE$ + } + } + flag:hussar = { + create_maa_or_upgrade_regiment_effect = { + TYPE = hussar + SIZE = $SIZE$ + } + } + flag:horn_warrior = { + create_maa_or_upgrade_regiment_effect = { + TYPE = horn_warrior + SIZE = $SIZE$ + } + } + flag:bush_hunter = { + create_maa_or_upgrade_regiment_effect = { + TYPE = bush_hunter + SIZE = $SIZE$ + } + } + flag:shomer = { + create_maa_or_upgrade_regiment_effect = { + TYPE = shomer + SIZE = $SIZE$ + } + } + flag:garudas = { + create_maa_or_upgrade_regiment_effect = { + TYPE = garudas + SIZE = $SIZE$ + } + } + flag:khandayat = { + create_maa_or_upgrade_regiment_effect = { + TYPE = khandayat + SIZE = $SIZE$ + } + } + flag:mountaineer = { + create_maa_or_upgrade_regiment_effect = { + TYPE = mountaineer + SIZE = $SIZE$ + } + } + flag:guinea_warrior = { + create_maa_or_upgrade_regiment_effect = { + TYPE = guinea_warrior + SIZE = $SIZE$ + } + } + flag:abudrar = { + create_maa_or_upgrade_regiment_effect = { + TYPE = abudrar + SIZE = $SIZE$ + } + } + flag:zbrojnosh = { + create_maa_or_upgrade_regiment_effect = { + TYPE = zbrojnosh + SIZE = $SIZE$ + } + } + flag:palace_guards = { + create_maa_or_upgrade_regiment_effect = { + TYPE = palace_guards + SIZE = $SIZE$ + } + } + flag:asawira = { + create_maa_or_upgrade_regiment_effect = { + TYPE = asawira + SIZE = $SIZE$ + } + } + flag:tarkhan = { + create_maa_or_upgrade_regiment_effect = { + TYPE = tarkhan + SIZE = $SIZE$ + } + } + flag:zupin_warrior = { + create_maa_or_upgrade_regiment_effect = { + TYPE = zupin_warrior + SIZE = $SIZE$ + } + } + flag:tawashi = { + create_maa_or_upgrade_regiment_effect = { + TYPE = tawashi + SIZE = $SIZE$ + } + } + flag:house_guard = { + create_maa_or_upgrade_regiment_effect = { + TYPE = house_guard + SIZE = $SIZE$ + } + } + flag:accolade_maa_archers = { + create_maa_or_upgrade_regiment_effect = { + TYPE = accolade_maa_archers + SIZE = $SIZE$ + } + } + flag:accolade_maa_skirmishers = { + create_maa_or_upgrade_regiment_effect = { + TYPE = accolade_maa_skirmishers + SIZE = $SIZE$ + } + } + flag:accolade_maa_pikes = { + create_maa_or_upgrade_regiment_effect = { + TYPE = accolade_maa_pikes + SIZE = $SIZE$ + } + } + flag:accolade_maa_outriders = { + create_maa_or_upgrade_regiment_effect = { + TYPE = accolade_maa_outriders + SIZE = $SIZE$ + } + } + flag:accolade_maa_vanguards = { + create_maa_or_upgrade_regiment_effect = { + TYPE = accolade_maa_vanguards + SIZE = $SIZE$ + } + } + flag:accolade_maa_lancers = { + create_maa_or_upgrade_regiment_effect = { + TYPE = accolade_maa_lancers + SIZE = $SIZE$ + } + } + flag:accolade_maa_crossbowers = { + create_maa_or_upgrade_regiment_effect = { + TYPE = accolade_maa_crossbowers + SIZE = $SIZE$ + } + } + flag:accolade_maa_cameliers = { + create_maa_or_upgrade_regiment_effect = { + TYPE = accolade_maa_cameliers + SIZE = $SIZE$ + } + } + flag:accolade_maa_elephantiers = { + create_maa_or_upgrade_regiment_effect = { + TYPE = accolade_maa_elephantiers + SIZE = $SIZE$ + } + } + flag:accolade_maa_horse_archers = { + create_maa_or_upgrade_regiment_effect = { + TYPE = accolade_maa_horse_archers + SIZE = $SIZE$ + } + } + flag:vigmen = { + create_maa_or_upgrade_regiment_effect = { + TYPE = vigmen + SIZE = $SIZE$ + } + } + flag:bondi = { + create_maa_or_upgrade_regiment_effect = { + TYPE = bondi + SIZE = $SIZE$ + } + } + flag:varangian_veterans = { + create_maa_or_upgrade_regiment_effect = { + TYPE = varangian_veterans + SIZE = $SIZE$ + } + } + flag:ayrudzi = { + create_maa_or_upgrade_regiment_effect = { + TYPE = ayrudzi + SIZE = $SIZE$ + } + } + flag:steppe_raiders = { + create_maa_or_upgrade_regiment_effect = { + TYPE = steppe_raiders + SIZE = $SIZE$ + } + } + flag:conrois = { + create_maa_or_upgrade_regiment_effect = { + TYPE = conrois + SIZE = $SIZE$ + } + } + flag:akritai = { + create_maa_or_upgrade_regiment_effect = { + TYPE = akritai + SIZE = $SIZE$ + } + } + flag:ballistrai = { + create_maa_or_upgrade_regiment_effect = { + TYPE = ballistrai + SIZE = $SIZE$ + } + } + flag:skoutatoi = { + create_maa_or_upgrade_regiment_effect = { + TYPE = skoutatoi + SIZE = $SIZE$ + } + } + flag:varangian_guards = { + create_maa_or_upgrade_regiment_effect = { + TYPE = varangian_guards + SIZE = $SIZE$ + } + } + flag:handpicked_faithful = { + create_maa_or_upgrade_regiment_effect = { + TYPE = handpicked_faithful + SIZE = $SIZE$ + } + } + flag:emishi_horse_archers = { + create_maa_or_upgrade_regiment_effect = { + TYPE = emishi_horse_archers + SIZE = $SIZE$ + } + } + flag:japanese_horse_archers = { + create_maa_or_upgrade_regiment_effect = { + TYPE = japanese_horse_archers + SIZE = $SIZE$ + } + } + flag:warrior_monks = { + create_maa_or_upgrade_regiment_effect = { + TYPE = warrior_monks + SIZE = $SIZE$ + } + } + flag:gakgung_archers = { + create_maa_or_upgrade_regiment_effect = { + TYPE = gakgung_archers + SIZE = $SIZE$ + } + } + flag:pesilat_warriors = { + create_maa_or_upgrade_regiment_effect = { + TYPE = pesilat_warriors + SIZE = $SIZE$ + } + } + flag:samurai = { + create_maa_or_upgrade_regiment_effect = { + TYPE = samurai + SIZE = $SIZE$ + } + } + flag:zhanmadao_infantry = { + create_maa_or_upgrade_regiment_effect = { + TYPE = zhanmadao_infantry + SIZE = $SIZE$ + } + } + flag:burenjia = { + create_maa_or_upgrade_regiment_effect = { + TYPE = burenjia + SIZE = $SIZE$ + } + } + flag:tiefutu = { + create_maa_or_upgrade_regiment_effect = { + TYPE = tiefutu + SIZE = $SIZE$ + } + } + flag:black_armor_cavalry = { + create_maa_or_upgrade_regiment_effect = { + TYPE = black_armor_cavalry + SIZE = $SIZE$ + } + } + flag:rocket_carts = { + create_maa_or_upgrade_regiment_effect = { + TYPE = rocket_carts + SIZE = $SIZE$ + } + } + flag:ballista = { + create_maa_or_upgrade_regiment_effect = { + TYPE = ballista + SIZE = $SIZE$ + } + } + flag:cloud_ladder = { + create_maa_or_upgrade_regiment_effect = { + TYPE = cloud_ladder + SIZE = $SIZE$ + } + } + flag:siege_tower = { + create_maa_or_upgrade_regiment_effect = { + TYPE = siege_tower + SIZE = $SIZE$ + } + } + flag:cannon = { + create_maa_or_upgrade_regiment_effect = { + TYPE = cannon + SIZE = $SIZE$ + } + } + } + } +} + +create_maa_or_upgrade_regiment_effect = { + if = { + limit = { + any_maa_regiment = { + is_maa_type = $TYPE$ + can_upgrade_maa = yes + } + } + random_maa_regiment = { + limit = { + is_maa_type = $TYPE$ + can_upgrade_maa = yes + } + change_maa_regiment_size = $SIZE$ + } + } + else = { + create_maa_regiment = { + type = $TYPE$ + check_can_recruit = no + size = $SIZE$ + } + } +} + +ep3_missionary_effect = { + # Same religion or unreformed or Hasan, convert to the preacher's faith + if = { + limit = { + OR = { + $LOCATION$.religion = $PREACHER$.religion + $LOCATION$.faith = { has_doctrine_parameter = unreformed } + character:41702 ?= $PREACHER$ + } + } + $LOCATION$ = { + set_county_faith = $PREACHER$.faith + } + } + # Preacher is Gnostic, convert the locals to a regionally appropriate form of Gnosticism + else_if = { + limit = { + $PREACHER$.faith = { + OR = { + has_doctrine = tenet_gnosticism + has_doctrine = special_doctrine_is_gnostic_faith + } + } + $LOCATION$.religion = { + any_faith = { + has_doctrine = tenet_gnosticism + } + } + } + $LOCATION$ = { + religion = { + random_faith = { + limit = { + OR = { + has_doctrine = tenet_gnosticism + has_doctrine = special_doctrine_is_gnostic_faith + } + } + $LOCATION$ = { set_county_faith = prev } + } + } + } + } + # Otherwise, reduce popular opinion + else = { + $LOCATION$ = { + add_county_modifier = { + modifier = ep3_religious_doubts + years = 15 + } + } + } +} +ep3_hasan_missionary_effect = { + ep3_hasan_advance_radicalism = yes + ep3_missionary_effect = { + PREACHER = $PREACHER$ + LOCATION = $LOCATION$ + } +} +ep3_hasan_advance_radicalism = { + if = { + limit = { + any_owned_story = { + type = story_hasan + } + } + custom_tooltip = { + text = advance_to_the_assassins_tt + random_owned_story = { + type = story_hasan + if = { + limit = { + exists = var:radical_points + } + change_variable = { + name = radical_points + add = 1 + } + } + else = { + set_variable = { + name = radical_points + value = 1 + } + } + } + } + } +} +hasan_sabbah_ignite_decision_effect = { + if = { + limit = { + hasan_sabbah_event_troops_value <= 1000 + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 1 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 1 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = ayyar + stacks = 1 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = ayyar + stacks = 1 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = ayyar + stacks = 1 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + } + else_if = { + limit = { + hasan_sabbah_event_troops_value <= 2000 + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 1 + } + men_at_arms = { + type = ayyar + stacks = 1 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 1 + } + men_at_arms = { + type = ayyar + stacks = 1 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 1 + } + men_at_arms = { + type = ayyar + stacks = 1 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 1 + } + men_at_arms = { + type = ayyar + stacks = 1 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = ayyar + stacks = 2 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + } + else_if = { + limit = { + hasan_sabbah_event_troops_value <= 3000 + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 1 + } + men_at_arms = { + type = ayyar + stacks = 2 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 1 + } + men_at_arms = { + type = ayyar + stacks = 2 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 1 + } + men_at_arms = { + type = ayyar + stacks = 2 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 1 + } + men_at_arms = { + type = ayyar + stacks = 2 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 1 + } + men_at_arms = { + type = ayyar + stacks = 2 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + } + else_if = { + limit = { + hasan_sabbah_event_troops_value > 3000 + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 2 + } + men_at_arms = { + type = ayyar + stacks = 2 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 2 + } + men_at_arms = { + type = ayyar + stacks = 2 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 2 + } + men_at_arms = { + type = ayyar + stacks = 2 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 2 + } + men_at_arms = { + type = ayyar + stacks = 2 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + spawn_army = { + name = hasan_fanatics + men_at_arms = { + type = asawira + stacks = 2 + } + men_at_arms = { + type = ayyar + stacks = 2 + } + levies = hasan_sabbah_event_troops_value + inheritable = yes + location = root.domicile.domicile_location + war_keep_on_attacker_victory = yes + } + } + start_war = { + cb = ep3_hasan_assassin_war + target = root.location.county.holder.top_liege + target_title = root.location.county.holder.top_liege.primary_title + } +} +hasan_sabbah_end_war = { + # Offer Hasan the opportunity to become landed + hidden_effect = { + if = { + limit = { + $SELJUK$ = { + any_sub_realm_barony = { + title_province = { has_building_or_higher = alamut_castle_01 } + } + } + } + $SELJUK$ = { + random_sub_realm_barony = { + limit = { + title_province = { has_building_or_higher = alamut_castle_01 } + } + county = { + save_scope_as = hasan_home + } + } + } + } + else_if = { + limit = { + $SELJUK$ = { + any_sub_realm_county = { + faith = $HASAN$.faith + holder = { is_ai = yes } + } + } + } + $SELJUK$ = { + random_sub_realm_county = { + limit = { + faith = $HASAN$.faith + holder = { is_ai = yes } + } + save_scope_as = hasan_home + } + } + } + else = { + $SELJUK$ = { + random_sub_realm_county = { + limit = { + holder = { is_ai = yes } + } + save_scope_as = hasan_home + } + } + } + $HASAN$ = { + if = { + limit = { + any_owned_story = { + type = story_hasan + exists = var:preferred_caliph + } + } + random_owned_story = { + type = story_hasan + var:preferred_caliph = { save_scope_as = caliph } + } + } + trigger_event = { + id = hasan_sabbah.1050 + } + if = { + limit = { + is_ai = no + } + add_achievement_global_variable_effect = { + VARIABLE = finished_the_old_man_of_the_mountain_achievement + VALUE = yes + } + } + } + } + create_title_and_vassal_change = { + type = independency + save_scope_as = change + } + $HASAN$ = { + add_prestige = medium_prestige_value + } + $SELJUK$ = { + add_prestige = { + value = medium_prestige_value + multiply = -1 + } + + every_vassal = { + limit = { + highest_held_title_tier > tier_barony + } + change_liege_or_become_independent = { + CHANGE = scope:change + VASSAL = this + } + } + + every_vassal = { + limit = { is_ai = no } + send_interface_toast = { + type = msg_gained_independence + title = liege_primary_title_dissolution + desc = liege_primary_title_dissolution_desc + left_icon = $SELJUK$ + } + } + } + resolve_title_and_vassal_change = scope:change + $SELJUK$ = { + every_held_title = { + limit = { + tier >= tier_duchy + is_head_of_faith = no + NOT = { this = $SELJUK$.capital_county.duchy } + } + add_to_temporary_list = titles_to_destroy + } + } + every_in_list = { + list = titles_to_destroy + $HASAN$ = { + destroy_title = prev + } + } + $SELJUK$ = { + if = { + limit = { + government_has_flag = government_is_administrative + } + admin_government_reset_effect = yes + } + } + # LEGITIMACY FROM LOSING FACTION WAR + faction_war_end_defeat_legitimacy_effect = yes + # End Hasan's story cycle + hidden_effect = { + $HASAN$ = { + if = { + limit = { + any_owned_story = { + type = story_hasan + } + } + random_owned_story = { + type = story_hasan + end_story = yes + } + } + } + } +} + +reinforce_soldiers_regiment_effect = { + save_scope_as = laamp_temp + # For the value. + save_temporary_scope_as = actor + custom_tooltip = { + text = reinforce_soldiers_effect_tt + every_maa_regiment = { + limit = { maa_regiments_valid_for_cheap_reinforcement_trigger = yes } + change_maa_troops_count = reinforce_soldiers_regiment_soldiers_value + } + } +} + +refill_maa_with_provisions_effect = { + save_scope_as = laamp_temp + while = { + limit = { + scope:actor.domicile.provisions > 0 + any_maa_regiment = { + maa_regiments_valid_to_refill_trigger = yes + } + } + random_maa_regiment = { + limit = { + maa_regiments_valid_to_refill_trigger = yes + } + save_scope_as = maa_scope + save_scope_value_as = { + name = current_provisions_max_value_scope + value = scope:actor.domicile.provisions + } + scope:actor.domicile ?= { + change_provisions = { + value = { + add = scope:maa_scope.replenishable_troops_value + divide = provision_refill_value + max = scope:current_provisions_max_value_scope + multiply = -1 + } + } + } + change_maa_troops_count = replenishable_troops_with_provisions_value + } + } +} + +refill_maa_with_gold_effect = { + save_scope_as = laamp_temp + while = { + limit = { + scope:actor.gold > 0 + any_maa_regiment = { + maa_regiments_valid_to_refill_trigger = yes + } + } + random_maa_regiment = { + limit = { + maa_regiments_valid_to_refill_trigger = yes + } + save_scope_as = maa_scope + save_scope_value_as = { + name = current_gold_max_value_scope + value = scope:actor.gold + } + scope:actor = { + remove_short_term_gold = { + add = scope:maa_scope.replenishable_troops_value + divide = gold_refill_value + max = scope:current_gold_max_value_scope + } + } + change_maa_troops_count = replenishable_troops_with_gold_value + } + } +} + +admin_government_reset_effect = { + if = { + limit = { is_landed = yes } # error suppression + ### NOMADIC + if = { + limit = { + OR = { + government_has_flag = government_is_nomadic + capital_province = { + OR = { + has_holding_type = nomad_holding + has_holding_type = herder_holding + } + } + } + } + change_government = nomad_government + } + ### TRIBAL - are all of your holdings Tribal? + if = { + limit = { + NOT = { + any_held_title = { + trigger_if = { + limit = { tier <= tier_county } + title_province ?= { + NOT = { has_holding_type = tribal_holding } + } + } + trigger_else = { + title_capital_county.title_province ?= { + NOT = { has_holding_type = tribal_holding } + } + } + } + } + } + change_government = tribal_government + } + ### CLAN - are you a Muslim or from a Clan culture? + else_if = { + limit = { + OR = { + faith = { religion_tag = islam_religion } + culture = { + OR = { + has_cultural_pillar = heritage_arabic + has_cultural_pillar = heritage_iranian + has_cultural_pillar = heritage_turkic + } + } + } + } + change_government = clan_government + } + ### FEUDAL - fallback playable case + else = { change_government = feudal_government } + } +} + +create_basic_peasant_effect = { + create_character = { + template = peasant_character + location = root.location + dynasty = none + culture = root.location.culture + faith = root.location.faith + gender_female_chance = 50 + after_creation = { + set_to_lowborn = yes + } + save_scope_as = peasant + } +} + +fire_governor_long_war_response_events = { + if = { + limit = { + scope:defender = { + government_has_flag = government_is_administrative + top_liege = this + any_vassal = { + is_governor = yes + NOR = { + this = scope:attacker + is_allied_to = scope:attacker + } + } + } + } + scope:defender = { + random_vassal = { + limit = { + is_governor = yes + NOR = { + this = scope:attacker + is_allied_to = scope:attacker + } + } + save_scope_as = def_governor_1 + trigger_event = { + id = ep3_governor_yearly.3010 + months = 24 + } + } + } + scope:defender = { + random_vassal = { + limit = { + is_governor = yes + NOR = { + this = scope:attacker + is_allied_to = scope:attacker + this = scope:def_governor_1 + } + } + save_scope_as = def_governor_2 + trigger_event = { + id = ep3_governor_yearly.3010 + months = 28 + } + } + } + scope:defender = { + random_vassal = { + limit = { + is_governor = yes + NOR = { + this = scope:attacker + is_allied_to = scope:attacker + this = scope:def_governor_1 + this = scope:def_governor_2 + } + } + save_scope_as = def_governor_3 + trigger_event = { + id = ep3_governor_yearly.3010 + months = 32 + } + } + } + scope:defender = { + random_vassal = { + limit = { + is_governor = yes + NOR = { + this = scope:attacker + is_allied_to = scope:attacker + this = scope:def_governor_1 + this = scope:def_governor_2 + this = scope:def_governor_3 + } + } + save_scope_as = def_governor_4 + trigger_event = { + id = ep3_governor_yearly.3010 + months = 36 + } + } + } + scope:defender = { + random_vassal = { + limit = { + is_governor = yes + NOR = { + this = scope:attacker + is_allied_to = scope:attacker + this = scope:def_governor_1 + this = scope:def_governor_2 + this = scope:def_governor_3 + this = scope:def_governor_4 + } + } + save_scope_as = def_governor_5 + trigger_event = { + id = ep3_governor_yearly.3010 + months = 42 + } + } + } + scope:defender = { + random_vassal = { + limit = { + is_governor = yes + NOR = { + this = scope:attacker + is_allied_to = scope:attacker + this = scope:def_governor_1 + this = scope:def_governor_2 + this = scope:def_governor_3 + this = scope:def_governor_4 + this = scope:def_governor_5 + } + } + save_scope_as = def_governor_6 + trigger_event = { + id = ep3_governor_yearly.3010 + months = 54 + } + } + } + } + if = { + limit = { + scope:attacker = { + government_has_flag = government_is_administrative + top_liege = this + any_vassal = { + is_governor = yes + NOR = { + this = scope:defender + is_allied_to = scope:defender + } + } + } + } + scope:attacker = { + random_vassal = { + limit = { + is_governor = yes + NOR = { + this = scope:defender + is_allied_to = scope:defender + } + } + save_scope_as = att_governor_1 + trigger_event = { + id = ep3_governor_yearly.3010 + months = 24 + } + } + } + scope:attacker = { + random_vassal = { + limit = { + is_governor = yes + NOR = { + this = scope:defender + is_allied_to = scope:defender + this = scope:att_governor_1 + } + } + save_scope_as = att_governor_2 + trigger_event = { + id = ep3_governor_yearly.3010 + months = 28 + } + } + } + scope:attacker = { + random_vassal = { + limit = { + is_governor = yes + NOR = { + this = scope:defender + is_allied_to = scope:defender + this = scope:att_governor_1 + this = scope:att_governor_2 + } + } + save_scope_as = att_governor_3 + trigger_event = { + id = ep3_governor_yearly.3010 + months = 32 + } + } + } + scope:attacker = { + random_vassal = { + limit = { + is_governor = yes + NOR = { + this = scope:defender + is_allied_to = scope:defender + this = scope:att_governor_1 + this = scope:att_governor_2 + this = scope:att_governor_3 + } + } + save_scope_as = att_governor_4 + trigger_event = { + id = ep3_governor_yearly.3010 + months = 36 + } + } + } + scope:attacker = { + random_vassal = { + limit = { + is_governor = yes + NOR = { + this = scope:defender + is_allied_to = scope:defender + this = scope:att_governor_1 + this = scope:att_governor_2 + this = scope:att_governor_3 + this = scope:att_governor_4 + } + } + save_scope_as = att_governor_5 + trigger_event = { + id = ep3_governor_yearly.3010 + months = 42 + } + } + } + scope:attacker = { + random_vassal = { + limit = { + is_governor = yes + NOR = { + this = scope:defender + is_allied_to = scope:defender + this = scope:att_governor_1 + this = scope:att_governor_2 + this = scope:att_governor_3 + this = scope:att_governor_4 + this = scope:att_governor_5 + } + } + save_scope_as = att_governor_6 + trigger_event = { + id = ep3_governor_yearly.3010 + months = 54 + } + } + } + } +} + +ep3_governor_yearly_3010_war_aid_effect = { + if = { + limit = { + scope:emperor = { + is_defender_in_war = scope:war + } + } + scope:war = { + add_defender = scope:governor + } + } + else = { + scope:war = { + add_attacker = scope:governor + } + + } + if = { + limit = { + root = scope:emperor + } + hidden_effect = { + reverse_add_opinion = { + target = scope:emperor + opinion = 20 + modifier = grateful_opinion + } + } + } + else = { + reverse_add_opinion = { + target = scope:emperor + opinion = 20 + modifier = grateful_opinion + } + } + pay_short_term_gold = { + target = scope:emperor + gold = medium_gold_value + } + if = { + limit = { + can_add_hook = { + target = scope:emperor + type = favor_hook + } + } + add_hook = { + target = scope:emperor + type = favor_hook + } + } + else = { + change_influence = major_influence_gain + } +} +ep3_admin_war_aftermath_effect = { + scope:war = { + if = { + limit = { + any_war_participant = { + is_landed = yes + government_has_flag = government_is_administrative + } + } + every_war_participant = { + limit = { + is_landed = yes + government_has_flag = government_is_administrative + } + primary_title = { + set_variable = { + name = admin_war_aftermath_var + years = 5 + } + } + } + } + } +} + +state_faith_conversion_add_piety_effect = { + if = { + limit = { + scope:actor = { + top_liege = { government_allows = state_faith } + faith = top_liege.primary_title.state_faith + } + scope:recipient.top_liege = { government_allows = state_faith } + } + scope:actor = { + add_piety = medium_piety_gain + } + } +} + +state_faith_refuse_conversion_add_piety_effect = { + if = { + limit = { + scope:actor.top_liege = { government_allows = state_faith } + scope:recipient = { + top_liege = { government_allows = state_faith } + faith = top_liege.primary_title.state_faith + } + } + scope:recipient = { add_piety = medium_piety_gain } + } +} + +# EP3 Laamp possibility warning +ep3_war_loss_adventurer_tt_effect = { + save_scope_as = war_loser + if = { + limit = { + has_ep3_dlc_trigger = yes + NOT = { + any_held_title = { + OR = { + is_landless_type_title = yes + is_noble_family_title = yes + } + } + } + trigger_if = { + limit = { any_in_list = { list = target_titles } } + OR = { + # You are losing all your counties and have no vassals to steal from + AND = { + any_held_county = { + count = all + OR = { + is_in_list = target_titles + target_is_de_jure_liege_or_above = scope:war_loser.primary_title + } + } + any_vassal = { + count = 0 + highest_held_title_tier >= tier_county + } + } + # You are losing all your held titles + any_held_title = { + count = all + OR = { + is_in_list = target_titles + target_is_de_jure_liege_or_above = scope:war_loser.primary_title + } + } + } + } + } + custom_tooltip = laamp_may_become_adventurer_tt + } +} + +add_randomised_double_moon_modifier_effect = { + hidden_effect = { + scope:double_moon_book = { + random_list = { + 1 = { + add_artifact_modifier = artifact_prowess_2_modifier + set_artifact_description = double_moon_tome_desc_1 + } + 1 = { + add_artifact_modifier = artifact_knight_effectiveness_4_modifier + set_artifact_description = double_moon_tome_desc_2 + } + 1 = { + add_artifact_modifier = artifact_stewardship_1_modifier + set_artifact_description = double_moon_tome_desc_3 + } + 1 = { + add_artifact_modifier = artifact_diplomacy_1_modifier + set_artifact_description = double_moon_tome_desc_4 + } + 1 = { + add_artifact_modifier = artifact_health_gain_1_modifier + set_artifact_description = double_moon_tome_desc_5 + } + 1 = { + add_artifact_modifier = artifact_monthly_minor_prestige_3_modifier + set_artifact_description = double_moon_tome_desc_6 + } + 1 = { + add_artifact_modifier = artifact_monthly_prestige_3_modifier + set_artifact_description = double_moon_tome_desc_7 + } + 1 = { + add_artifact_modifier = artifact_dynasty_opinion_2_modifier + set_artifact_description = double_moon_tome_desc_8 + } + 1 = { + add_artifact_modifier = artifact_learn_language_scheme_phase_duration_add_2_modifier + set_artifact_description = double_moon_tome_desc_9 + } + 1 = { + add_artifact_modifier = artifact_diplomacy_per_prestige_level_modifier + set_artifact_description = double_moon_tome_desc_10 + } + 1 = { + add_artifact_modifier = artifact_mercenary_hire_cost_mult_2_modifier + set_artifact_description = double_moon_tome_desc_11 + } + 1 = { + add_artifact_modifier = artifact_general_opinion_1_modifier + set_artifact_description = double_moon_tome_desc_12 + } + 1 = { + add_artifact_modifier = artifact_independent_ruler_opinion_2_modifier + set_artifact_description = double_moon_tome_desc_13 + } + 1 = { + add_artifact_modifier = artifact_clergy_opinion_2_modifier + set_artifact_description = double_moon_tome_desc_14 + } + } + } + } +} + +random_rain_snow_chance_effect = { + random_list = { + 10 = { # Snow + trigger = { + location = { + OR = { + has_province_modifier = winter_mild_modifier + has_province_modifier = winter_normal_modifier + has_province_modifier = winter_harsh_modifier + } + } + } + save_scope_as = snow_day + } + 10 = { # Rain + trigger = { + location = { + NOR = { + has_province_modifier = winter_mild_modifier + has_province_modifier = winter_normal_modifier + has_province_modifier = winter_harsh_modifier + } + } + } + modifier = { + factor = 1.02 + location.county = { is_riverside_county = yes } + } + modifier = { + factor = 0.05 + location = { + OR = { + terrain = desert + terrain = drylands + terrain = desert_mountains + terrain = oasis + + } + } + } + save_scope_as = rain_day + } + 10 = {} # No rain + } +} + +governor_resignation_title_transfer_effect = { + save_scope_as = resigner + top_liege = { save_scope_as = emperor } + force_step_down_landed_titles = yes +} + +boost_governor_efficiency_success_effect = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_good + title = boost_efficiency_success_desc + left_icon = scope:recipient + + scope:recipient ?= { + send_interface_toast = { + type = event_toast_effect_good + title = boost_efficiency_success_desc + left_icon = scope:actor + if = { + limit = { has_character_modifier = ep3_damage_efficiency_modifier } + remove_character_modifier = ep3_damage_efficiency_modifier + if = { + limit = { var:ep3_governor_efficiency_stack = 1 } + remove_variable = ep3_governor_efficiency_stack + } + else = { + change_variable = { + name = ep3_governor_efficiency_stack + add = -1 + } + } + } + else = { + add_character_modifier = { + modifier = ep3_boost_efficiency_modifier + years = 10 + } + if = { + limit = { has_variable = ep3_governor_efficiency_stack } + set_variable = { + name = ep3_governor_efficiency_stack + value = { + value = scope:recipient.var:ep3_governor_efficiency_stack + add = 1 + max = 5 + } + years = 10 + } + } + else = { + set_variable = { + name = ep3_governor_efficiency_stack + value = 1 + years = 10 + } + } + } + if = { + limit = { + opinion = { + target = scope:actor + value >= 15 + } + } + scope:actor = { + progress_towards_friend_effect = { + REASON = friend_boosted_gov_efficiency + CHARACTER = scope:recipient + OPINION = default_friend_opinion + } + } + } + else_if = { + limit = { is_ai = yes } + add_opinion = { + target = scope:actor + modifier = boosted_efficiency_opinion + } + } + } + } + # Merit based realm gain some merit for improving others + if = { + limit = { + government_allows = merit + } + change_merit = medium_merit_gain + } + } + } +} + +boost_governor_efficiency_duel_effect = { + scope:actor = { + duel = { + skill = $SKILL$ + value = mediocre_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 1.5 + min = -49 + } + min = 2 + desc = boost_efficiency_success_desc + send_interface_toast = { + type = event_toast_effect_good + title = boost_efficiency_success_desc + left_icon = scope:recipient + boost_governor_efficiency_success_effect = yes + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -1.5 + min = -49 + } + min = 2 + desc = boost_efficiency_failure_desc + send_interface_toast = { + type = event_toast_text_bad + title = boost_efficiency_failure_desc + left_icon = scope:recipient + desc = NO_EFFECT + } + } + } + } +} + +damage_governor_efficiency_success_effect = { + scope:recipient ?= { + send_interface_toast = { + type = event_toast_effect_bad + title = damage_efficiency_success_desc + left_icon = scope:actor + if = { + limit = { has_character_modifier = ep3_boost_efficiency_modifier } + remove_character_modifier = ep3_boost_efficiency_modifier + if = { + limit = { var:ep3_governor_efficiency_stack = 1 } + remove_variable = ep3_governor_efficiency_stack + } + else = { + change_variable = { + name = ep3_governor_efficiency_stack + add = -1 + } + } + } + else = { + add_character_modifier = { + modifier = ep3_damage_efficiency_modifier + years = 10 + } + if = { + limit = { has_variable = ep3_governor_efficiency_stack } + set_variable = { + name = ep3_governor_efficiency_stack + value = { + value = scope:recipient.var:ep3_governor_efficiency_stack + add = 1 + max = 5 + } + years = 10 + } + } + else = { + set_variable = { + name = ep3_governor_efficiency_stack + value = 1 + years = 10 + } + } + } + if = { + limit = { is_ai = yes } + add_opinion = { + target = scope:actor + modifier = damaged_efficiency_opinion + } + } + } + } +} + +damage_governor_efficiency_duel_effect = { + scope:actor = { + duel = { + skill = $SKILL$ + value = mediocre_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 1.5 + min = -49 + } + min = 2 + desc = damage_efficiency_success_desc + send_interface_toast = { + type = event_toast_effect_good + title = damage_efficiency_success_desc + left_icon = scope:recipient + damage_governor_efficiency_success_effect = yes + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -1.5 + min = -49 + } + min = 2 + desc = damage_efficiency_failure_desc + send_interface_toast = { + type = event_toast_text_bad + title = damage_efficiency_success_desc + left_icon = scope:recipient + desc = NO_EFFECT + } + } + } + } +} + +# NF Adoption effect +noble_family_adoption_effect = { + $ADOPTEE$ = { + if = { + limit = { + exists = house.house_head + } + house.house_head = { #We do this first, otherwise house head will already mean someone else. + if = { + limit = { + $ADOPTER$.culture = { has_cultural_parameter = wider_adoption } + $ADOPTEE$ = { + culture = { has_cultural_parameter = wider_adoption } + NOT = { + any_parent = { + is_alive = yes + can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = liege } + } + } + } + } + add_opinion = { + modifier = adopted_my_house_member_opinion + opinion = 25 + target = $ADOPTER$ + } + } + else = { + add_opinion = { + modifier = adopted_my_house_member_opinion + opinion = -25 + target = $ADOPTER$ + } + } + if = { + limit = { + has_hook_of_type = { + type = house_head_hook + target = $ADOPTEE$ + } + } + remove_hook = { + type = house_head_hook + target = $ADOPTEE$ + } + } + } + } + } + $ADOPTER$ = { + if = { + limit = { scope:gold = yes } + pay_short_term_gold = { + target = $ADOPTEE$ + gold = $ADOPTER$.minor_gold_value + } + } + if = { + limit = { scope:hook = yes } + use_hook = $ADOPTEE$ + } + $ADOPTEE$ = { set_house = $ADOPTER$.house } + # Zealous vassals *hate* you adopting a heretic + house = { + every_house_member = { + custom = every_zealot_house_member_tt + limit = { + ai_zeal >= medium_positive_ai_value + faith = { faith_hostility_level = { target = $ADOPTEE$.faith value >= faith_astray_level } } + NOT = { this = $ADOPTER$ } + } + add_opinion = { + modifier = adopted_new_house_member_opinion + opinion = -20 + target = $ADOPTER$ + } + } + every_house_member = { + custom = every_close_family_house_member_tt + limit = { + NOT = { this = $ADOPTER$ } + is_close_family_of = $ADOPTER$ + NAND = { + ai_zeal >= medium_positive_ai_value + faith = { faith_hostility_level = { target = $ADOPTEE$.faith value >= faith_astray_level } } + } + NAND = { + $ADOPTER$.culture = { has_cultural_parameter = wider_adoption } + $ADOPTEE$ = { + culture = { has_cultural_parameter = wider_adoption } + NOT = { + any_parent = { + is_alive = yes + can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = liege } + } + } + } + } + } + add_opinion = { + modifier = adopted_new_house_member_opinion + opinion = -10 + target = $ADOPTER$ + } + } + } + } + $ADOPTEE$ = { + #adopted should travel + if = { + limit = { exists = $ADOPTER$.capital_province } + $ADOPTER$.capital_province = { save_scope_as = destination_province } + } + else_if = { + limit = { exists = $ADOPTER$.host.capital_province } + $ADOPTER$.host.capital_province = { save_scope_as = destination_province } + } + else_if = { + limit = { exists = $ADOPTER$.domicile.domicile_location } + $ADOPTER$.domicile.domicile_location = { save_scope_as = destination_province } + } + else = { + $ADOPTER$.location = { save_scope_as = destination_province } + } + save_scope_as = adoptee + $ADOPTER$ = { save_scope_as = adopter } + if = { + limit = { + any_relation = { + type = guardian + NOT = { this = $ADOPTER$ } + } + } + random_relation = { + type = guardian + limit = { NOT = { this = $ADOPTER$ } } + save_scope_as = old_guardian + } + remove_guardian_effect = { + GUARDIAN = scope:old_guardian + WARD = scope:adoptee + RETURN_WARD = no + HIDE_OPINION = no + } + } + if = { + limit = { NOT = { scope:destination_province = $ADOPTEE$.location } } + set_variable = { + name = adoptee_travelling_to_adopter + years = 2 + value = scope:adopter + } + start_travel_plan = { + destination = scope:destination_province + on_start_on_action = on_adoptee_depart_for_adopter + on_travel_planner_cancel_on_action = on_adoptee_depart_travel_planner_exit + on_arrival_on_action = on_adoptee_arrive_at_adopter + on_arrival_destinations = last + return_trip = no # One way + } + custom_tooltip = adoptee_leaves_for_adopter_tt + } + else_if = { + limit = { + $ADOPTER$ = { + NOT = { is_in_the_same_court_as = $ADOPTEE$ } + } + } + $ADOPTER$ = { add_courtier = $ADOPTEE$ } + } + #No final else, in this situation they are already in the right location and the right court. + } +} + +# Create icon artifacts +## Court Artifact - Large +create_artifact_court_icon_large_effect = { + # Get the character the artifact is being made for. + $OWNER$ = { save_scope_as = owner } + $PAINTER$ = { save_scope_as = painter } + + hidden_effect_new_object = { + # Get artifact quality, wealth, and materials + get_artifact_quality_effect = yes + get_artifact_wealth_effect = yes + # Create the artifact + scope:owner = { + if = { + limit = { + exists = scope:inspiration_owner + } + create_artifact = { + name = artifact_wall_court_icon_large_name + description = placeholder # Will be regenerated in the post-creation effects + creator = scope:painter + visuals = icon_court_large + type = wall_big + modifier = artifact_placeholder_modifier + save_scope_as = newly_created_artifact + wealth = scope:wealth + quality = scope:quality + } + } + else_if = { + limit = { + exists = scope:adventurer + } + create_artifact = { + name = artifact_wall_court_icon_large_name + description = placeholder # Will be regenerated in the post-creation effects + creator = scope:adventurer + visuals = icon_court_large + type = wall_big + modifier = artifact_placeholder_modifier + save_scope_as = newly_created_artifact + wealth = scope:wealth + quality = scope:quality + history = { + location = scope:location + actor = scope:adventurer + recipient = root + type = discovered + } + } + } + else = { + create_artifact = { + name = artifact_wall_court_icon_large_name + description = placeholder # Will be regenerated in the post-creation effects + creator = scope:painter + visuals = icon_court_large + type = wall_big + modifier = artifact_placeholder_modifier + save_scope_as = newly_created_artifact + wealth = scope:wealth + quality = scope:quality + } + } + } + scope:newly_created_artifact = { + set_artifact_description = artifact_wall_court_icon_large_description + # Set piety + add_2_scaled_artifact_modifier_devotion_effect = yes + + if = { + limit = { + OR = { + rarity = famed + rarity = illustrious + } + } + add_scaled_artifact_modifier_dynasty_prestige_effect = yes + } + remove_artifact_modifier = artifact_placeholder_modifier + } + } +} + +## Court Artifact - Small +create_artifact_court_icon_small_effect = { + # Get the character the artifact is being made for. + $OWNER$ = { save_scope_as = owner } + $PAINTER$ = { save_scope_as = painter } + + hidden_effect_new_object = { + # Get artifact quality, wealth, and materials + get_artifact_quality_effect = yes + get_artifact_wealth_effect = yes + # Create the artifact + scope:owner = { + if = { + limit = { + exists = scope:inspiration_owner + } + create_artifact = { + name = artifact_wall_court_icon_small_name + description = placeholder # Will be regenerated in the post-creation effects + creator = scope:painter + visuals = icon_court_small + type = wall_small + modifier = artifact_placeholder_modifier + save_scope_as = newly_created_artifact + wealth = scope:wealth + quality = scope:quality + } + } + else_if = { + limit = { + exists = scope:adventurer + } + create_artifact = { + name = artifact_wall_court_icon_small_name + description = placeholder # Will be regenerated in the post-creation effects + creator = scope:adventurer + visuals = icon_court_small + type = wall_small + modifier = artifact_placeholder_modifier + save_scope_as = newly_created_artifact + wealth = scope:wealth + quality = scope:quality + history = { + location = scope:location + actor = scope:adventurer + recipient = root + type = discovered + } + } + } + else = { + create_artifact = { + name = artifact_wall_court_icon_small_name + description = placeholder # Will be regenerated in the post-creation effects + creator = scope:painter + visuals = icon_court_small + type = wall_small + modifier = artifact_placeholder_modifier + save_scope_as = newly_created_artifact + wealth = scope:wealth + quality = scope:quality + } + } + } + scope:newly_created_artifact = { + set_artifact_description = artifact_wall_court_icon_small_description + # Set piety + add_2_scaled_artifact_modifier_devotion_effect = yes + + if = { + limit = { + OR = { + rarity = famed + rarity = illustrious + } + } + add_scaled_artifact_modifier_dynasty_prestige_effect = yes + } + remove_artifact_modifier = artifact_placeholder_modifier + } + } +} + +## Trinket Artifact +create_artifact_trinket_icon_effect = { + # Get the character the artifact is being made for. + $OWNER$ = { save_scope_as = owner } + $PAINTER$ = { save_scope_as = painter } + + hidden_effect_new_object = { + # Get artifact quality, wealth, and materials + get_artifact_quality_effect = yes + get_artifact_wealth_effect = yes + # Create the artifact + scope:owner = { + if = { + limit = { + exists = scope:inspiration_owner + } + create_artifact = { + name = artifact_trinket_icon_name + description = placeholder # Will be regenerated in the post-creation effects + creator = scope:painter + visuals = trinket_icon + type = miscellaneous + modifier = artifact_placeholder_modifier + save_scope_as = newly_created_artifact + wealth = scope:wealth + quality = scope:quality + } + } + else_if = { + limit = { + exists = scope:adventurer + } + create_artifact = { + name = artifact_trinket_icon_name + description = placeholder # Will be regenerated in the post-creation effects + creator = scope:adventurer + visuals = icon_court_small + type = miscellaneous + modifier = artifact_placeholder_modifier + save_scope_as = newly_created_artifact + wealth = scope:wealth + quality = scope:quality + history = { + location = scope:location + actor = scope:adventurer + recipient = root + type = discovered + } + } + } + else = { + create_artifact = { + name = artifact_trinket_icon_name + description = placeholder # Will be regenerated in the post-creation effects + creator = scope:painter + visuals = trinket_icon + type = miscellaneous + modifier = artifact_placeholder_modifier + save_scope_as = newly_created_artifact + wealth = scope:wealth + quality = scope:quality + } + } + } + scope:newly_created_artifact = { + set_artifact_description = artifact_trinket_icon_description + # Set piety + add_scaled_artifact_modifier_piety_effect = yes + + if = { + limit = { + OR = { + rarity = famed + rarity = illustrious + } + } + add_scaled_artifact_modifier_learning_lifestyle_xp_effect = yes + } + remove_artifact_modifier = artifact_placeholder_modifier + } + } +} + +## Trinket Artifact +create_artifact_trinket_icon_ancient_effect = { + # Get the character the artifact is being made for. + $OWNER$ = { save_scope_as = owner } + + hidden_effect_new_object = { + # Get artifact quality, wealth, and materials + get_artifact_quality_effect = yes + get_artifact_wealth_effect = yes + # Create the artifact + scope:owner = { + create_artifact = { + name = artifact_trinket_icon_name + description = placeholder # Will be regenerated in the post-creation effects + visuals = trinket_icon + type = miscellaneous + modifier = artifact_placeholder_modifier + save_scope_as = newly_created_artifact + wealth = scope:wealth + quality = scope:quality + history = { type = created_before_history } + } + } + scope:newly_created_artifact = { + set_artifact_description = artifact_trinket_icon_description + # Set piety + add_scaled_artifact_modifier_piety_effect = yes + + if = { + limit = { + OR = { + rarity = famed + rarity = illustrious + } + } + add_scaled_artifact_modifier_learning_lifestyle_xp_effect = yes + } + remove_artifact_modifier = artifact_placeholder_modifier + } + } +} +# Scheme bonuses from being the emperor, or member of a dominant/powerful family +ep3_actor_scheme_modifier_effect = { + scope:new_scheme ?= { + # Emperor enjoys a significant bonus to all admin related schemes + if = { + limit = { scope:actor = scope:actor.top_liege } + add_scheme_modifier = { type = admin_emperor_scheme_modifier } + } + # Dominant and Powerful Families enjoys a decent bonus to all admin related schemes + else_if = { + limit = { + scope:actor.house ?= { is_dominant_family = yes } + } + add_scheme_modifier = { type = admin_dominant_family_scheme_modifier } + } + else_if = { + limit = { + scope:actor.house ?= { is_powerful_family = yes } + } + add_scheme_modifier = { type = admin_powerful_family_scheme_modifier } + } + } +} + +#Complete war group task contracts, used in war_on_actions +war_task_contracts_completion_effect = { + #Join War Contract and Help Claimant Contract + scope:war = { + if = { + limit = { + any_war_participant = { + any_character_active_contract = { + OR = { + AND = { + has_task_contract_type = laamp_join_war_contract + var:task_contract_war ?= scope:war + } + AND = { + has_task_contract_type = laamp_help_claimant_contract + task_contract_employer = scope:war.primary_attacker + } + } + save_temporary_scope_as = relevant_contract + } + } + } + scope:relevant_contract = { + if = { + limit = { + scope:war = { + war_contribution = { + target = scope:relevant_contract.task_contract_taker + value > 0 + } + } + } + complete_task_contract = success_standard + } + else = { + complete_task_contract = failure_standard + } + } + } + if = { + limit = { + primary_attacker = { + has_variable = valuable_prisoners + } + } + primary_attacker = { + remove_variable = valuable_prisoners + } + } + if = { + limit = { + primary_defender = { + has_variable = valuable_prisoners + } + } + primary_defender = { + remove_variable = valuable_prisoners + } + } + if = { + limit = { + using_civil_war_cb_trigger = yes + any_war_participant = { + any_character_active_contract = { + task_contract_type = laamp_join_faction_contract + task_contract_employer = { + is_participant_in_war = scope:war + } + } + } + } + every_war_participant = { + every_character_active_contract = { + task_contract_type = laamp_join_faction_contract + limit = { + task_contract_employer = { + is_participant_in_war = scope:war + } + } + if = { + limit = { + task_contract_taker = scope:winner + } + complete_task_contract = success_standard + } + else = { + complete_task_contract = failure_standard + } + } + } + } + } +} + +#If a landless adventurer was hired as a mercenary and contributed in a war they get paid, used in war_on_actions, relevant flag set by hire_laamp_mercenaries_interaction or ep3_interactions_events.0112 +laamp_as_mercenary_payout_effect = { + scope:war = { + if = { + limit = { + any_war_participant = { + has_character_flag = joined_as_mercenary + is_attacker_in_war = scope:war + NOT = { is_leader_in_war = scope:war } + OR = { + has_raised_armies = yes + scope:war = { + war_contribution = { + target = prev + value > 0 + } + } + } + } + } + every_war_participant = { + limit = { + has_character_flag = joined_as_mercenary + is_attacker_in_war = scope:war + NOT = { is_leader_in_war = scope:war } + OR = { + has_raised_armies = yes + scope:war = { + war_contribution = { + target = prev + value > 0 + } + } + } + } + add_to_list = laamp_mercenaries + remove_character_flag = joined_as_mercenary + } + primary_attacker = { + save_scope_as = employer + trigger_event = { + id = ep3_interactions_events.0121 + days = { 3 7 } + } + } + every_in_list = { + list = laamp_mercenaries + scope:employer = { + remove_list_variable = { + name = hired_mercenaries + target = prev + } + } + } + } + if = { + limit = { + any_war_participant = { + has_character_flag = joined_as_mercenary + is_defender_in_war = scope:war + NOT = { is_leader_in_war = scope:war } + OR = { + has_raised_armies = yes + scope:war = { + war_contribution = { + target = prev + value > 0 + } + } + } + } + } + every_war_participant = { + limit = { + has_character_flag = joined_as_mercenary + is_defender_in_war = scope:war + NOT = { is_leader_in_war = scope:war } + OR = { + has_raised_armies = yes + scope:war = { + war_contribution = { + target = prev + value > 0 + } + } + } + } + add_to_list = laamp_mercenaries + remove_character_flag = joined_as_mercenary + } + primary_defender = { + save_scope_as = employer + trigger_event = { + id = ep3_interactions_events.0121 + days = { 3 7 } + } + } + every_in_list = { + list = laamp_mercenaries + scope:employer = { + remove_list_variable = { + name = hired_mercenaries + target = prev + } + } + } + } + } +} + +# root - casus_belli +# war - war provided by the casus_belli +# attacker - primary attacker from the casus_belli +# defender - primary defender from the casus_belli +laamp_as_mercenary_payout_tooltip_effect = { + show_as_tooltip = { + scope:defender = { + if = { + limit = { + exists = scope:war + any_war_ally = { + has_government = landless_adventurer_government + OR = { + any_character_active_contract = { + has_task_contract_type = laamp_join_war_contract + var:task_contract_war ?= scope:war + } + AND = { + has_variable = owed_contract_assistance_gold + var:owed_contract_assistance_war ?= scope:war + } + has_variable = joined_as_mercenary + } + } + } + every_war_ally = { + if = { + limit = { + has_government = landless_adventurer_government + } + save_scope_as = laamp_temp + save_scope_as = actor + save_scope_value_as = { + name = war_contribution_value + value = "scope:war.war_contribution(scope:laamp_temp)" + } + if = { + limit = { + any_character_active_contract = { + has_task_contract_type = laamp_join_war_contract + var:task_contract_war = scope:war + } + } + every_character_active_contract = { + limit = { + has_task_contract_type = laamp_join_war_contract + var:task_contract_war = scope:war + } + show_as_tooltip = { + task_contract_employer = { + save_scope_as = employer + custom_tooltip = ep3_join_war_payment_tt + pay_short_term_gold = { + target = scope:laamp_temp + gold = ep3_hire_laamp_mercs_payment_value + } + } + } + } + } + if = { + limit = { + has_variable = joined_as_mercenary + scope:defender = { + is_target_in_variable_list = { + name = hired_mercenaries + target = scope:laamp_temp + } + } + } + scope:defender = { + save_scope_as = employer + custom_tooltip = ep3_hire_laamp_mercs_payment_tt + pay_short_term_gold = { + target = scope:laamp_temp + gold = ep3_hire_laamp_mercs_payment_value + } + } + } + if = { + limit = { + has_variable = owed_contract_assistance_gold + var:owed_contract_assistance_war ?= scope:war + } + save_scope_as = contract_assistance_helper + scope:defender = { + save_scope_as = recipient + custom_tooltip = contract_assistance_interaction_condition_tt + pay_short_term_gold = { + target = scope:actor + gold = scope:actor.var:owed_contract_assistance_gold + } + } + } + } + } + } + } + scope:attacker = { + if = { + limit = { + exists = scope:war + any_war_ally = { + has_government = landless_adventurer_government + OR = { + any_character_active_contract = { + has_task_contract_type = laamp_join_war_contract + var:task_contract_war = scope:war + } + AND = { + has_variable = owed_contract_assistance_gold + var:owed_contract_assistance_war ?= scope:war + } + has_variable = joined_as_mercenary + } + } + } + every_war_ally = { + if = { + limit = { + has_government = landless_adventurer_government + } + save_scope_as = laamp_temp + save_scope_as = actor + save_scope_value_as = { + name = war_contribution_value + value = "scope:war.war_contribution(scope:laamp_temp)" + } + if = { + limit = { + any_character_active_contract = { + has_task_contract_type = laamp_join_war_contract + var:task_contract_war = scope:war + } + } + every_character_active_contract = { + limit = { + has_task_contract_type = laamp_join_war_contract + var:task_contract_war = scope:war + } + show_as_tooltip = { + task_contract_employer = { + save_scope_as = employer + custom_tooltip = ep3_hire_laamp_mercs_payment_tt + pay_short_term_gold = { + target = scope:laamp_temp + gold = ep3_hire_laamp_mercs_payment_value + } + } + } + } + } + if = { + limit = { + has_variable = joined_as_mercenary + scope:attacker = { + is_target_in_variable_list = { + name = hired_mercenaries + target = scope:laamp_temp + } + } + } + scope:attacker = { + save_scope_as = employer + custom_tooltip = ep3_hire_laamp_mercs_payment_tt + pay_short_term_gold = { + target = scope:laamp_temp + gold = ep3_hire_laamp_mercs_payment_value + } + } + } + if = { + limit = { + has_variable = owed_contract_assistance_gold + var:owed_contract_assistance_war ?= scope:war + } + save_scope_as = contract_assistance_helper + scope:attacker = { + custom_tooltip = contract_assistance_interaction_condition_tt + pay_short_term_gold = { + target = scope:actor + gold = scope:actor.var:owed_contract_assistance_gold + } + } + } + } + } + } + } + } +} + +chariot_race_sow_discord_strong_response_effect = { + if = { + limit = { + root = { + this = scope:host + } + } + scope:host = { + capital_county = { + change_county_control = { + value = -3 + multiply = scope:activity.var:counter_chant_count + } + } + custom_tooltip = counter_chants_strong_modifier_tooltip + hidden_effect = { + scope:activity = { + every_in_list = { + variable = counter_chanters + scope:host = { + capital_county = { + add_county_modifier = { + modifier = strong_sow_discord_modifier + years = 10 + } + } + } + } + } + } + } + } + else = { + scope:host = { + capital_county = { + add_county_modifier = { + modifier = strong_sow_discord_modifier + years = 10 + } + change_county_control = -3 + } + } + } +} +chariot_race_sow_discord_weak_response_effect = { + if = { + limit = { + root = { + this = scope:host + } + } + scope:host = { + custom_tooltip = counter_chants_weak_modifier_tooltip + hidden_effect = { + scope:activity = { + every_in_list = { + variable = counter_chanters + scope:host = { + capital_county = { + add_county_modifier = { + modifier = weak_sow_discord_modifier + years = 10 + } + } + } + } + } + } + } + } + else = { + scope:host = { + capital_county = { + add_county_modifier = { + modifier = weak_sow_discord_modifier + years = 10 + } + } + } + } +} +chariot_race_sow_discord_normal_response_effect = { + if = { + limit = { + root = { + this = scope:host + } + } + scope:host = { + capital_county = { + change_county_control = { + value = -1 + multiply = scope:activity.var:counter_chant_count + } + } + custom_tooltip = counter_chants_normal_modifier_tooltip + hidden_effect = { + scope:activity = { + every_in_list = { + variable = counter_chanters + scope:host = { + capital_county = { + add_county_modifier = { + modifier = normal_sow_discord_modifier + years = 10 + } + } + } + } + } + } + } + } + else = { + scope:host = { + capital_county = { + add_county_modifier = { + modifier = normal_sow_discord_modifier + years = 10 + } + custom_tooltip = modifier_stacking_chariot_tooltip + change_county_control = -1 + } + } + } +} + +############# +# Camp Party +############# + +camp_party_completed_log_entry_effect = { + involved_activity = { + add_activity_log_entry = { + key = camp_party_completed_log_entry_effect + tags = { completed } + score = 100 + show_in_conclusion = yes + character = root + #Effects + root = { + disburse_camp_party_reward_effect = yes + } + } + } +} + +disburse_camp_party_reward_effect = { + involved_activity ?= { + ###Non-progression linked + #Drinks + scope:host = { + #For highest level drinks + if = { + limit = { + involved_activity = { + has_activity_option = { + category = camp_party_option_drinks + option = camp_party_drinks_abundant + } + } + } + add_character_modifier = { + modifier = ep3_master_of_ceremonies + years = 3 + } + } + + #For any level of drinks + #Opinion + if = { + limit = { + involved_activity = { + OR = { + has_activity_option = { + category = camp_party_option_drinks + option = camp_party_drinks_abundant + } + has_activity_option = { + category = camp_party_option_drinks + option = camp_party_drinks_adequate + } + } + } + } + involved_activity = { + every_attending_character = { + limit = { + this != scope:host + } + custom = every_attending_guest + add_opinion = { + modifier = feast_life_of_the_party_opinion + target = scope:host + opinion = 35 + } + } + } + } + + # Reveler Trait + if = { + limit = { + involved_activity = { + OR = { + has_activity_option = { + category = camp_party_option_drinks + option = camp_party_drinks_abundant + } + has_activity_option = { + category = camp_party_option_drinks + option = camp_party_drinks_adequate + } + } + } + } + if = { + limit = { + NOT = { + has_trait = lifestyle_reveler + } + } + add_trait = lifestyle_reveler + } + add_trait_xp = { + trait = lifestyle_reveler + value = { + integer_range = { + min = small_lifestyle_random_xp_low + max = small_lifestyle_random_xp_high + } + } + } + } + } + + #100 Carousing + if = { + limit = { var:activity_special_type_progression >= 100 } + + #Stress Loss + every_attending_character = { + custom = every_attending_guest + add_stress = -150 + } + + #Host effects + scope:host = { + hidden_effect = { + domicile = { + random_list = { + 1 = { + trigger = { + has_domicile_building_or_higher = camp_main_01 + NOT = { has_domicile_building = camp_main_04 } + } + switch = { + trigger = has_domicile_building + camp_main_01 = { add_domicile_building = camp_main_02 } + camp_main_02 = { add_domicile_building = camp_main_03 } + camp_main_03 = { add_domicile_building = camp_main_04 } + } + } + 1 = { + trigger = { + has_domicile_building_or_higher = supply_tent_01 + NOT = { has_domicile_building = supply_tent_06 } + } + switch = { + trigger = has_domicile_building + supply_tent_01 = { add_domicile_building = supply_tent_02 } + supply_tent_02 = { add_domicile_building = supply_tent_03 } + supply_tent_03 = { add_domicile_building = supply_tent_04 } + supply_tent_04 = { add_domicile_building = supply_tent_05 } + supply_tent_05 = { add_domicile_building = supply_tent_06 } + } + } + 1 = { + trigger = { + has_domicile_building_or_higher = barber_tent_01 + NOT = { has_domicile_building = barber_tent_06 } + } + switch = { + trigger = has_domicile_building + barber_tent_01 = { add_domicile_building = barber_tent_02 } + barber_tent_02 = { add_domicile_building = barber_tent_03 } + barber_tent_03 = { add_domicile_building = barber_tent_04 } + barber_tent_04 = { add_domicile_building = barber_tent_05 } + barber_tent_05 = { add_domicile_building = barber_tent_06 } + } + } + 1 = { + trigger = { + has_domicile_building_or_higher = baggage_train_01 + NOT = { has_domicile_building = baggage_train_06 } + } + switch = { + trigger = has_domicile_building + baggage_train_01 = { add_domicile_building = baggage_train_02 } + baggage_train_02 = { add_domicile_building = baggage_train_03 } + baggage_train_03 = { add_domicile_building = baggage_train_04 } + baggage_train_04 = { add_domicile_building = baggage_train_05 } + baggage_train_05 = { add_domicile_building = baggage_train_06 } + } + } + 1 = { + trigger = { + has_domicile_building_or_higher = camp_fire_01 + NOT = { has_domicile_building = camp_fire_06 } + } + switch = { + trigger = has_domicile_building + camp_fire_01 = { add_domicile_building = camp_fire_02 } + camp_fire_02 = { add_domicile_building = camp_fire_03 } + camp_fire_03 = { add_domicile_building = camp_fire_04 } + camp_fire_04 = { add_domicile_building = camp_fire_05 } + camp_fire_05 = { add_domicile_building = camp_fire_06 } + } + } + 1 = { + trigger = { + has_domicile_building_or_higher = proving_grounds_01 + NOT = { has_domicile_building = proving_grounds_06 } + } + switch = { + trigger = has_domicile_building + proving_grounds_01 = { add_domicile_building = proving_grounds_02 } + proving_grounds_02 = { add_domicile_building = proving_grounds_03 } + proving_grounds_03 = { add_domicile_building = proving_grounds_04 } + proving_grounds_04 = { add_domicile_building = proving_grounds_05 } + proving_grounds_05 = { add_domicile_building = proving_grounds_06 } + } + } + 1 = { + trigger = { + has_domicile_building_or_higher = camp_perimeter_01 + NOT = { has_domicile_building = camp_perimeter_06 } + } + switch = { + trigger = has_domicile_building + camp_perimeter_01 = { add_domicile_building = camp_perimeter_02 } + camp_perimeter_02 = { add_domicile_building = camp_perimeter_03 } + camp_perimeter_03 = { add_domicile_building = camp_perimeter_04 } + camp_perimeter_04 = { add_domicile_building = camp_perimeter_05 } + camp_perimeter_05 = { add_domicile_building = camp_perimeter_06 } + } + } + } + } + } + + custom_tooltip = activity_camp_party_reward_upgrade_building + + custom_tooltip = camp_party_100_contracts_get + + hidden_effect = { + contract_passive_spawn_effect = { + SPAWN_CONTRACTS = 2 + } + } + + #Provisions + domicile = { + change_provisions = massive_provisions_gain + } + + #Lifestyle XP + bp2_lifestyle_xp_gain_per_type_effect = { VALUE = major } + + add_character_flag = { + flag = better_recruitment_visit_holding_flag + years = 1 + } + } + } + + #75+ Carousing + else_if = { + limit = { + var:activity_special_type_progression < 100 + var:activity_special_type_progression >= 75 + } + + #Stress Loss + every_attending_character = { + custom = every_attending_guest + add_stress = -100 + } + + #Contract spawn & flag assign + scope:host = { + custom_tooltip = camp_party_75_contracts_get + + hidden_effect = { + contract_passive_spawn_effect = { + SPAWN_CONTRACTS = 1 + } + } + + #Provisions + domicile = { + change_provisions = major_provisions_gain + } + + #Lifestyle XP + bp2_lifestyle_xp_gain_per_type_effect = { VALUE = medium } + + add_character_flag = { + flag = better_recruitment_visit_holding_flag + years = 1 + } + } + } + #50+ Carousing + else_if = { + limit = { + var:activity_special_type_progression < 75 + var:activity_special_type_progression >= 50 + } + + #Stress Loss + every_attending_character = { + custom = every_attending_guest + add_stress = -75 + } + + #Contract spawn and flag assign + scope:host = { + #Provisions + domicile = { + change_provisions = medium_provisions_gain + } + + #Lifestyle XP + bp2_lifestyle_xp_gain_per_type_effect = { VALUE = minor } + + add_character_flag = { + flag = better_recruitment_visit_holding_flag + years = 1 + } + } + } + #25+ Carousing + else = { + #Stress Loss + every_attending_character = { + custom = every_attending_guest + add_stress = -50 + } + + scope:host = { + add_character_flag = { + flag = cheaper_provisions_visit_holding_flag + years = 1 + } + } + } + + scope:host = { + if = { + limit = { + has_activity_intent = fireside_chat_intent + } + hidden_effect = { + remove_character_modifier = ep3_fireside_chat_modifier_3 + remove_character_modifier = ep3_fireside_chat_modifier_2 + remove_character_modifier = ep3_fireside_chat_modifier_1 + } + if = { + limit = { + involved_activity = { + any_attending_character = { + count >= 4 + OR = { + has_character_modifier = ep3_fireside_chat_diplomacy + has_character_modifier = ep3_fireside_chat_learning + has_character_modifier = ep3_fireside_chat_intrigue + has_character_modifier = ep3_fireside_chat_stewardship + has_character_modifier = ep3_fireside_chat_martial + } + } + } + } + add_character_modifier = { + modifier = ep3_fireside_chat_modifier_3 + years = 10 + } + } + else_if = { + limit = { + involved_activity = { + any_attending_character = { + count >= 2 + OR = { + has_character_modifier = ep3_fireside_chat_diplomacy + has_character_modifier = ep3_fireside_chat_learning + has_character_modifier = ep3_fireside_chat_intrigue + has_character_modifier = ep3_fireside_chat_stewardship + has_character_modifier = ep3_fireside_chat_martial + } + } + } + } + add_character_modifier = { + modifier = ep3_fireside_chat_modifier_2 + years = 10 + } + } + else = { + add_character_modifier = { + modifier = ep3_fireside_chat_modifier_1 + years = 10 + } + } + } + } + } +} + +ep3_camp_party_visit_holding_skills_boost = { + add_diplomacy_skill = { 1 3 } + add_martial_skill = { 1 3 } + add_stewardship_skill = { 1 3 } + add_intrigue_skill = { 1 3 } + add_learning_skill = { 1 3 } +} + +#Setting up the Fens as a pseudo-custom region +ep3_the_fens_list_effect = { + province:1525 = { add_to_list = the_fens } #b_lynn + province:1534 = { add_to_list = the_fens } #b_cambridgeshire + province:1535 = { add_to_list = the_fens } #b_radfield + province:1536 = { add_to_list = the_fens } #b_papworth + province:1537 = { add_to_list = the_fens } #b_ely + province:1541 = { add_to_list = the_fens } #b_hurstingstone + province:1542 = { add_to_list = the_fens } #b_norman_cross + province:1584 = { add_to_list = the_fens } #b_stamford + province:1585 = { add_to_list = the_fens } #b_boston + province:1601 = { add_to_list = the_fens } #b_peterborough +} + +#Used for setting up the Harrying of the North widget for events +#Requires use of ep3_harrying_widget_clear_effect in the 'after' as well +ep3_harrying_widget_setup_effect = { + global_var:harrying_of_the_north = { save_scope_as = story } + ## First, identify our widget character. + save_scope_as = scope_character + ## Then transfer over some suitable variables for the UI. + set_variable = { + name = pacification_gui + value = scope:story.var:pacification + } + set_variable = { + name = resistance_gui + value = scope:story.var:resistance + } +} + +#Increase pacification +ep3_increase_pacification_effect = { + save_scope_as = origin_char + scope:story = { + change_variable = { + name = pacification + add = $AMOUNT$ + } + } + set_variable = { + name = pacification_gui + value = scope:story.var:pacification + } + if = { #Display in red if Anglo-Saxon + limit = { + culture = culture:anglo_saxon + } + custom_tooltip = ep3_increase_pacification_effect_tt_negative + } + else = { #Otherwise in green + custom_tooltip = ep3_increase_pacification_effect_tt_positive + } + + if = { + limit = { + exists = scope:story.var:ruler_england + } + scope:story.var:ruler_england = { + send_interface_message = { + type = msg_pacification_rise + title = harrying.notification_pacification_rise + desc = harrying_pacification_rise + } + } + } + + if = { + limit = { + character:90028 = { + is_alive = yes + NOT = { + has_character_flag = hereward_settled_flag + } + } + } + character:90028 = { + send_interface_message = { + type = msg_pacification_rise + title = harrying.notification_pacification_rise + desc = harrying_pacification_rise + } + } + } + + if = { + limit = { + scope:story.var:ruler_england = { + any_vassal = { + culture = culture:anglo_saxon + } + } + } + scope:story.var:ruler_england = { + every_vassal = { + limit = { + culture = culture:anglo_saxon + } + send_interface_message = { + type = msg_pacification_rise + title = harrying.notification_pacification_rise + desc = harrying_pacification_rise + } + } + } + } +} + +#Increase pacification - large +ep3_increase_pacification_large_effect = { + save_scope_as = origin_char + scope:story = { + change_variable = { + name = pacification + add = 2 + } + } + set_variable = { + name = pacification_gui + value = scope:story.var:pacification + } + if = { #Display in red if Anglo-Saxon + limit = { + culture = culture:anglo_saxon + } + custom_tooltip = ep3_increase_pacification_effect_tt_negative_large + } + else = { #Otherwise in green + custom_tooltip = ep3_increase_pacification_effect_tt_positive_large + } + + if = { + limit = { + exists = scope:story.var:ruler_england + } + scope:story.var:ruler_england = { + send_interface_message = { + type = msg_pacification_rise + title = harrying.notification_pacification_rise + desc = harrying_pacification_rise + } + } + } + + if = { + limit = { + character:90028 = { + is_alive = yes + NOT = { + has_character_flag = hereward_settled_flag + } + } + } + character:90028 = { + send_interface_message = { + type = msg_pacification_rise + title = harrying.notification_pacification_rise + desc = harrying_pacification_rise + } + } + } + + if = { + limit = { + scope:story.var:ruler_england = { + any_vassal = { + culture = culture:anglo_saxon + } + } + } + scope:story.var:ruler_england = { + every_vassal = { + limit = { + culture = culture:anglo_saxon + } + send_interface_message = { + type = msg_pacification_rise + title = harrying.notification_pacification_rise + desc = harrying_pacification_rise + } + } + } + } +} + +#Increase resistance +ep3_increase_resistance_effect = { + save_scope_as = origin_char + scope:story = { + change_variable = { + name = resistance + add = $AMOUNT$ + } + } + set_variable = { + name = resistance_gui + value = scope:story.var:resistance + } + if = { #Display in green if Anglo-Saxon + limit = { + culture = culture:anglo_saxon + } + custom_tooltip = ep3_increase_resistance_effect_tt_positive + } + else = { #Otherwise in green + custom_tooltip = ep3_increase_resistance_effect_tt_negative + } + + if = { + limit = { + exists = scope:story.var:ruler_england + } + scope:story.var:ruler_england = { + send_interface_message = { + type = msg_resistance_rise + title = harrying.notification_resistance_rise + desc = harrying_resistance_rise + } + } + } + + if = { + limit = { + character:90028 = { + is_alive = yes + NOT = { + has_character_flag = hereward_settled_flag + } + } + } + character:90028 = { + send_interface_message = { + type = msg_resistance_rise + title = harrying.notification_resistance_rise + desc = harrying_resistance_rise + } + } + } + + if = { + limit = { + scope:story.var:ruler_england = { + any_vassal = { + culture = culture:anglo_saxon + } + } + } + scope:story.var:ruler_england = { + every_vassal = { + limit = { + culture = culture:anglo_saxon + } + send_interface_message = { + type = msg_resistance_rise + title = harrying.notification_resistance_rise + desc = harrying_resistance_rise + } + } + } + } +} + +#Increase resistance - large +ep3_increase_resistance_large_effect = { + save_scope_as = origin_char + scope:story = { + change_variable = { + name = resistance + add = 2 + } + } + set_variable = { + name = resistance_gui + value = scope:story.var:resistance + } + if = { #Display in green if Anglo-Saxon + limit = { + culture = culture:anglo_saxon + } + custom_tooltip = ep3_increase_resistance_effect_tt_positive_large + } + else = { #Otherwise in green + custom_tooltip = ep3_increase_resistance_effect_tt_negative_large + } + + if = { + limit = { + exists = scope:story.var:ruler_england + } + scope:story.var:ruler_england = { + send_interface_message = { + type = msg_resistance_rise + title = harrying.notification_resistance_rise + desc = harrying_resistance_rise + } + } + } + + if = { + limit = { + character:90028 = { + is_alive = yes + NOT = { + has_character_flag = hereward_settled_flag + } + } + } + character:90028 = { + send_interface_message = { + type = msg_resistance_rise + title = harrying.notification_resistance_rise + desc = harrying_resistance_rise + } + } + } + + if = { + limit = { + scope:story.var:ruler_england = { + any_vassal = { + culture = culture:anglo_saxon + } + } + } + scope:story.var:ruler_england = { + random_vassal = { + limit = { + culture = culture:anglo_saxon + } + send_interface_message = { + type = msg_resistance_rise + title = harrying.notification_resistance_rise + desc = harrying_resistance_rise + } + } + } + } +} + +#Decrease pacification +ep3_decrease_pacification_effect = { + save_scope_as = origin_char + if = { + limit = { scope:story.var:pacification != 0 } + scope:story = { + change_variable = { + name = pacification + add = -1 + } + } + set_variable = { + name = pacification_gui + value = scope:story.var:pacification + } + if = { #Display in green if Anglo-Saxon + limit = { + culture = culture:anglo_saxon + } + custom_tooltip = ep3_decrease_pacification_effect_tt_positive + } + else = { #Otherwise in green + custom_tooltip = ep3_decrease_pacification_effect_tt_negative + } + + if = { + limit = { + exists = scope:story.var:ruler_england + } + scope:story.var:ruler_england = { + send_interface_message = { + type = msg_pacification_falls + title = harrying.notification_pacification_fall + desc = harrying_pacification_fall + } + } + } + + if = { + limit = { + character:90028 = { + is_alive = yes + NOT = { + has_character_flag = hereward_settled_flag + } + } + } + character:90028 = { + send_interface_message = { + type = msg_pacification_falls + title = harrying.notification_pacification_fall + desc = harrying_pacification_fall + } + } + } + + if = { + limit = { + scope:story.var:ruler_england = { + any_vassal = { + culture = culture:anglo_saxon + } + } + } + scope:story.var:ruler_england = { + every_vassal = { + limit = { + culture = culture:anglo_saxon + } + send_interface_message = { + type = msg_pacification_falls + title = harrying.notification_pacification_fall + desc = harrying_pacification_fall + } + } + } + } + } +} + +#Decrease resistance +ep3_decrease_resistance_effect = { + save_scope_as = origin_char + if = { + limit = { scope:story.var:pacification != 0 } + scope:story = { + change_variable = { + name = resistance + add = -1 + } + } + set_variable = { + name = resistance_gui + value = scope:story.var:resistance + } + if = { #Display in red if Anglo-Saxon + limit = { + culture = culture:anglo_saxon + } + custom_tooltip = ep3_decrease_resistance_effect_tt_negative + } + else = { #Otherwise in green + custom_tooltip = ep3_decrease_resistance_effect_tt_positive + } + + if = { + limit = { + exists = scope:story.var:ruler_england + } + scope:story.var:ruler_england = { + send_interface_message = { + type = msg_resistance_falls + title = harrying.notification_resistance_fall + desc = harrying_resistance_fall + } + } + } + + if = { + limit = { + character:90028 = { + is_alive = yes + NOT = { + has_character_flag = hereward_settled_flag + } + } + } + character:90028 = { + send_interface_message = { + type = msg_resistance_falls + title = harrying.notification_resistance_fall + desc = harrying_resistance_fall + } + } + } + + if = { + limit = { + scope:story.var:ruler_england = { + any_vassal = { + culture = culture:anglo_saxon + } + } + } + scope:story.var:ruler_england = { + every_vassal = { + limit = { + culture = culture:anglo_saxon + } + send_interface_message = { + type = msg_resistance_falls + title = harrying.notification_resistance_fall + desc = harrying_resistance_fall + } + } + } + } + } +} + +#Used for clearing widget data from the participants +ep3_harrying_widget_clear_effect = { + remove_variable = pacification_gui + remove_variable = resistance_gui +} + +# Effect for handling players and AI continuing as landless if deposed +# Should be used over the standard effect in most cases (except barons/unlanded AI etc.) +# DEPOSER should be whoever has caused the deposal - faction leader, ultimatum giver, etc. +depose_effect = { + show_as_tooltip = { depose = yes } + save_scope_as = allow_imprisoned_landless + if = { + limit = { is_valid_for_laampdom = yes } + custom_tooltip = laamp_may_become_adventurer_tt + } + set_variable = { + name = deposed_primary_title + value = primary_title + months = 1 + } + # Maintenance scopes + save_scope_as = defender + $DEPOSER$ = { + save_scope_as = attacker + save_scope_as = winner + } + # ACH crown laws reset + if = { + limit = { + has_variable = crowned_king_var + } + remove_variable = crowned_king_var + if = { + limit = { + NOT = { has_game_rule = coronation_laws_off } + OR = { + has_realm_law = crowned_king + has_realm_law = crowned_emperor + } + } + add_realm_law_skip_effects = uncrowned + } + } + if = { + limit = { + has_variable = crowned_emperor_var + } + remove_variable = crowned_emperor_var + if = { + limit = { + NOT = { has_game_rule = coronation_laws_off } + OR = { + has_realm_law = crowned_king + has_realm_law = crowned_emperor + } + } + add_realm_law_skip_effects = uncrowned + } + } + every_held_title = { add_to_list = target_titles } + trigger_event = ep3_laamps.0002 +} + +# Effect for handling players and AI continuing as landless if banished +# Should be used over the standard effect in most cases (except barons/unlanded AI etc.) +# BANISHER should be whoever has caused the banishment - imprisoner, ultimatum giver, etc. +banish_effect = { + show_as_tooltip = { banish = yes } + save_scope_as = allow_imprisoned_landless + if = { + limit = { is_valid_for_laampdom = yes } + custom_tooltip = laamp_may_become_adventurer_tt + } + $BANISHER$ = { save_scope_as = banisher } + trigger_event = ep3_laamps.0021 +} + +#Used for setting up the Peasant Leader widget for events +#Requires use of ep3_peasant_leader_widget_clear_effect in the 'after' as well +ep3_peasant_leader_widget_setup_effect = { + set_variable = { + name = support_gui + value = scope:task_contract.var:support + } + set_variable = { + name = control_gui + value = scope:task_contract.var:control + } + set_variable = { + name = num_of_corrupt_counties_gui + value = scope:task_contract.var:num_of_corrupt_counties + } +} +#Increase support +ep3_increase_peasant_support_effect = { + scope:task_contract = { + change_variable = { + name = support + add = 1 + } + add_to_variable_list = { + name = supported_counties + target = scope:corrupt_province.county + } + } + custom_tooltip = ep3_support_peasants_effect_tt + scope:task_contract.var:task_contract_councillor_liege ?= { + send_interface_message = { + type = msg_peasant_supported + title = msg_peasant_supported.title + desc = msg_peasant_supported.desc + } + } + scope:task_contract.var:task_contract_councillor ?= { + send_interface_message = { + type = msg_peasant_supported + title = msg_peasant_supported.title + desc = msg_peasant_supported.desc + } + } +} +#Increase control +ep3_increase_peasant_control_effect = { + scope:task_contract = { + change_variable = { + name = control + add = 1 + } + } + custom_tooltip = ep3_control_peasants_effect_tt + scope:task_contract.var:task_contract_councillor_liege ?= { + send_interface_message = { + type = msg_peasant_controlled + title = msg_peasant_controlled.title + desc = msg_peasant_controlled.desc + } + } + scope:task_contract.var:task_contract_councillor ?= { + send_interface_message = { + type = msg_peasant_controlled + title = msg_peasant_controlled.title + desc = msg_peasant_controlled.desc + } + } +} +#Used for clearing widget data from the participants +ep3_peasant_leader_widget_clear_effect = { + remove_variable = support_gui + remove_variable = control_gui + remove_variable = num_of_corrupt_counties_gui +} + +ep3_join_faction_war_effect = { + # Use hook/pay gold + scope:actor = { + if = { + limit = { + scope:hook = yes + has_hook = scope:recipient + } + use_hook = scope:recipient + } + if = { + limit = { scope:gold = yes } + pay_short_term_gold = { + gold = scope:actor.medium_gold_value + target = scope:recipient + } + } + } + # Gain some influence + scope:recipient = { + change_influence = 75 + # Remove from existing faction if swapping + if = { + limit = { exists = joined_faction } + leave_faction = joined_faction + } + if = { + limit = { target_is_liege_or_above = scope:secondary_recipient } + add_faction_cooldown_effect = { YEARS = 5 } + } + remove_character_flag = under_offer_join_faction_war_flag + } + scope:actor.joined_faction.faction_war = { + if = { + limit = { is_defender = scope:actor } + add_defender = scope:recipient + } + else = { add_attacker = scope:recipient } + } +} + +ep3_switch_faction_war_sides_effect = { + scope:actor = { + if = { + limit = { + scope:hook = yes + has_hook = scope:recipient + } + use_hook = scope:recipient + } + if = { + limit = { scope:gold = yes } + pay_short_term_gold = { + gold = scope:actor.medium_gold_value + target = scope:recipient + } + } + } + scope:recipient = { + change_influence = 150 + # Remove from existing faction if swapping + if = { + limit = { exists = joined_faction } + leave_faction = joined_faction + } + if = { + limit = { target_is_liege_or_above = scope:secondary_recipient } + add_faction_cooldown_effect = { YEARS = 5 } + } + } + scope:actor = { + every_character_war = { + limit = { ep3_switch_faction_war_sides_war_trigger = yes } + hidden_effect = { remove_participant = scope:recipient } + if = { + limit = { is_defender = scope:actor } + add_defender = scope:recipient + hidden_effect = { + primary_attacker = { + add_opinion = { + target = scope:recipient + modifier = betrayed_me_opinion + opinion = -25 + } + } + } + } + else = { + add_attacker = scope:recipient + primary_defender = { + hidden_effect = { + add_opinion = { + target = scope:recipient + modifier = betrayed_me_opinion + opinion = -25 + } + } + } + } + } + } + scope:recipient = { custom_tooltip = ep3_switch_faction_war_sides_cooldown_effect_tt } +} + +ep3_raid_insight_effect = { + add_character_modifier = { + modifier = raid_insight_$TYPE$ + years = 5 + } +} + +# Set up titles in the new realm. +# Determine potential breakaways +ep3_landless_invasion_titles_taken_effect = { + # Determine independent vassals + adventurer_realm_destabilisation_list_effect = { + TITLE_RECEIVER = $TITLE_RECEIVER$ + TITLE_GIVER = $TITLE_GIVER$ + TITLE = $TITLE$ + } + # Determine hierarchy + ep3_become_landed_save_liege_effect = { + TITLE_GIVER = $TITLE_GIVER$ + ALWAYS_INDEPENDENT = yes + TITLE_LIST = $TITLE_LIST$ + } + # Resolve title, liege, government changes + if = { + limit = { exists = scope:claimant } + ep3_become_landed_transfer_effect = { + TITLE_RECEIVER = $TITLE_RECEIVER$ + TITLE_LIST = $TITLE_LIST$ + TYPE = conquest_claim + REASON = flag:conquest_claim + ENNOBLED_ADVENTURER = flag:yes + } + } + else = { + ep3_become_landed_transfer_effect = { + TITLE_RECEIVER = $TITLE_RECEIVER$ + TITLE_LIST = $TITLE_LIST$ + TYPE = conquest + REASON = flag:conquest + ENNOBLED_ADVENTURER = flag:yes + } + } + # Vassals break away + adventurer_realm_destabilisation_transfer_effect = { + TITLE = $TITLE$ + TITLE_RECEIVER = $TITLE_RECEIVER$ + TITLE_GIVER = $TITLE_GIVER$ + TITLE_LIST = $TITLE_LIST$ + } +} + +governor_contract_invalidated_message_effect = { + task_contract_taker ?= { + save_scope_as = task_contract_character + send_interface_message = { + type = event_generic_bad_with_text + title = admin_contract_invalidated_title + left_icon = scope:task_contract_character + desc = admin_contract_invalidated_desc + + current_travel_plan ?= { + if = { + limit = { can_cancel = yes } + cancel_travel_plan = yes + } + } + } + } +} + +assign_favourite_child_effect = { + $ACTOR$ = { + random_relation = { + type = favorite_child + save_scope_as = current_favorite + } + send_interface_toast = { + title = choose_favorite_interaction_notification + left_icon = $ACTOR$ + right_icon = $RECIPIENT$ + if = { + limit = { + exists = scope:current_favorite + } + remove_relation_favorite_child = scope:current_favorite + scope:current_favorite = { + add_opinion = { + target = $ACTOR$ + modifier = no_more_favorite_opinion + } + } + } + set_relation_favorite_child = { reason = favorite_child_chosen target = $RECIPIENT$ } + $RECIPIENT$ = { + add_opinion = { + target = $ACTOR$ + modifier = made_favorite_opinion + } + } + custom_tooltip = choose_favorite_interaction_notification.tt + } + hidden_effect = { + every_close_or_extended_family_member = { + limit = { + NOT = { this = $RECIPIENT$ } + OR = { + is_child_of = $ACTOR$ + is_grandchild_of = $ACTOR$ + is_great_grandchild_of = $ACTOR$ + } + } + add_opinion = { + target = $ACTOR$ + modifier = has_favorite_opinion + } + add_opinion = { + target = $RECIPIENT$ + modifier = is_favorite_opinion + } + } + } + } +} + +add_random_internal_estate_building = { + random_list = { + 10 = { + trigger = { + NOT = { has_domicile_building_or_higher = servants_quarters_01 } + } + add_domicile_building = servants_quarters_01 + if = { + limit = { has_domicile_building = estate_main_03 } + add_domicile_building = servants_quarters_02 + } + } + 10 = { + trigger = { + NOT = { has_domicile_building_or_higher = library_01 } + } + add_domicile_building = library_01 + if = { + limit = { has_domicile_building = estate_main_03 } + add_domicile_building = library_02 + } + } + 10 = { + trigger = { + NOT = { has_domicile_building_or_higher = bath_01 } + } + add_domicile_building = bath_01 + if = { + limit = { has_domicile_building = estate_main_03 } + add_domicile_building = bath_02 + } + } + 10 = { + trigger = { + NOT = { has_domicile_building_or_higher = courtyard_01 } + } + add_domicile_building = courtyard_01 + if = { + limit = { has_domicile_building = estate_main_03 } + add_domicile_building = courtyard_02 + } + } + 10 = { + trigger = { + NOT = { has_domicile_building_or_higher = prison_01 } + } + add_domicile_building = prison_01 + if = { + limit = { has_domicile_building = estate_main_03 } + add_domicile_building = prison_02 + } + } + 10 = { + trigger = { + NOT = { has_domicile_building_or_higher = living_quarters_01 } + } + add_domicile_building = living_quarters_01 + if = { + limit = { has_domicile_building = estate_main_03 } + add_domicile_building = living_quarters_02 + } + } + 10 = { + trigger = { + NOT = { has_domicile_building_or_higher = trophy_room_01 } + } + add_domicile_building = trophy_room_01 + if = { + limit = { has_domicile_building = estate_main_03 } + add_domicile_building = trophy_room_02 + } + } + 10 = { + trigger = { + NOT = { has_domicile_building_or_higher = office_01 } + } + add_domicile_building = office_01 + if = { + limit = { has_domicile_building = estate_main_03 } + add_domicile_building = office_02 + } + } + 10 = { + trigger = { + NOT = { has_domicile_building_or_higher = guest_room_01 } + } + add_domicile_building = guest_room_01 + if = { + limit = { has_domicile_building = estate_main_03 } + add_domicile_building = guest_room_02 + } + } + 10 = { + trigger = { + NOT = { has_domicile_building_or_higher = wine_cellar_01 } + } + add_domicile_building = wine_cellar_01 + if = { + limit = { has_domicile_building = estate_main_03 } + add_domicile_building = wine_cellar_02 + } + } + } +} + +fill_external_estate_building_effect = { + switch = { + trigger = has_domicile_building_or_higher + estate_main_05 = { + while = { + limit = { free_external_domicile_building_slots >= 1 } + add_random_external_estate_building = yes + } + } + estate_main_04 = { + while = { + limit = { free_external_domicile_building_slots >= 2 } + add_random_external_estate_building = yes + } + } + estate_main_03 = { + while = { + limit = { free_external_domicile_building_slots >= 3 } + add_random_external_estate_building = yes + } + } + estate_main_02 = { + while = { + limit = { free_external_domicile_building_slots >= 4 } + add_random_external_estate_building = yes + } + } + estate_main_01 = { + while = { + limit = { free_external_domicile_building_slots >= 5 } + add_random_external_estate_building = yes + } + } + } +} + +add_random_external_estate_building = { + if = { + limit = { + free_external_domicile_building_slots >= 1 + } + random_list = { + 10 = { + trigger = { + NOR = { + has_domicile_building_or_higher = temple_small_01 + owner = { + government_has_flag = government_is_celestial + } + } + } + add_domicile_building = temple_small_01 + if = { + limit = { has_domicile_building = estate_main_03 } + add_domicile_building = temple_small_02 + } + } + 10 = { + trigger = { + NOT = { has_domicile_building_or_higher = barracks_01 } + } + add_domicile_building = barracks_01 + if = { + limit = { has_domicile_building = estate_main_03 } + add_domicile_building = barracks_02 + } + } + 10 = { + trigger = { + NOT = { has_domicile_building_or_higher = watchtower_01 } + } + add_domicile_building = watchtower_01 + if = { + limit = { has_domicile_building = estate_main_03 } + add_domicile_building = watchtower_02 + } + } + 10 = { + trigger = { + NOR = { + has_domicile_building_or_higher = vineyard_01 + owner.culture ?= { + has_innovation = innovation_champa_rice + } + } + } + add_domicile_building = vineyard_01 + if = { + limit = { has_domicile_building = estate_main_03 } + add_domicile_building = vineyard_02 + } + } + 10 = { + trigger = { + NOT = { has_domicile_building_or_higher = guardhouse_01 } + } + add_domicile_building = guardhouse_01 + if = { + limit = { has_domicile_building = estate_main_03 } + add_domicile_building = guardhouse_02 + } + } + 10 = { + trigger = { + NOT = { has_domicile_building_or_higher = garden_01 } + } + add_domicile_building = garden_01 + if = { + limit = { has_domicile_building = estate_main_03 } + add_domicile_building = garden_02 + } + } + 10 = { + trigger = { + NOT = { has_domicile_building_or_higher = storage_01 } + } + add_domicile_building = storage_01 + if = { + limit = { has_domicile_building = estate_main_03 } + add_domicile_building = storage_02 + } + } + 10 = { + trigger = { + NOR = { + has_domicile_building_or_higher = grain_field_01 + owner.culture ?= { + has_innovation = innovation_champa_rice + } + } + } + add_domicile_building = grain_field_01 + if = { + limit = { has_domicile_building = estate_main_03 } + add_domicile_building = grain_field_02 + } + } + 10 = { + trigger = { + NOT = { + has_domicile_building_or_higher = rice_field_01 + } + owner.culture ?= { + has_innovation = innovation_champa_rice + } + } + add_domicile_building = rice_field_01 + if = { + limit = { has_domicile_building = estate_main_03 } + add_domicile_building = rice_field_02 + } + } + 10 = { + trigger = { + NOT = { has_domicile_building_or_higher = stable_01 } + } + add_domicile_building = stable_01 + if = { + limit = { has_domicile_building = estate_main_03 } + add_domicile_building = stable_02 + } + } + 10 = { + trigger = { + NOT = { has_domicile_building_or_higher = workshop_01 } + } + add_domicile_building = workshop_01 + if = { + limit = { has_domicile_building = estate_main_03 } + add_domicile_building = workshop_02 + } + } + 10 = { + trigger = { + NOT = { has_domicile_building_or_higher = market_01 } + } + add_domicile_building = market_01 + if = { + limit = { has_domicile_building = estate_main_03 } + add_domicile_building = market_02 + } + } + 10 = { + trigger = { + NOT = { has_domicile_building_or_higher = grazing_land_01 } + } + add_domicile_building = grazing_land_01 + if = { + limit = { has_domicile_building = estate_main_03 } + add_domicile_building = grazing_land_02 + } + } + 10 = { + trigger = { + NOR = { + has_domicile_building_or_higher = olive_01 + owner.culture ?= { + has_innovation = innovation_champa_rice + } + } + } + add_domicile_building = olive_01 + if = { + limit = { has_domicile_building = estate_main_03 } + add_domicile_building = olive_02 + } + } + } + } +} + +estate_newly_built_grain_field_effect = { + scope:owner = { + if = { + limit = { + is_alive = yes + years_from_game_start >= 1 + } + random = { + chance = 75 + add_character_flag = { + flag = domicile_new_built_grain_field + months = 1 + } + trigger_event = { + id = ep3_governor_yearly.3001 + days = 5 + } + } + } + } +} + +demand_pastureland_adventurer_interaction_effect = { + # scope:actor = adventurer + # scope:recipient = herder + # seized_pastureland = titles + scope:target = { add_to_list = seized_pastureland } + scope:recipient = { save_scope_as = defender } + + hidden_effect = { + scope:actor = { + if = { + limit = { character:90028 ?= this } + add_character_flag = hereward_settled_flag + } + if = { + limit = { + NOT = { has_trait = adventurer } + } + add_trait = adventurer + } + every_courtier = { + set_variable = { + name = former_camp_leader + value = scope:actor + } + add_trait = adventurer_follower + } + } + } + + # Determine hierarchy + ep3_become_landed_save_liege_effect = { + TITLE_GIVER = scope:recipient + ALWAYS_INDEPENDENT = no + TITLE_LIST = seized_pastureland + } + # Resolve title, liege, government changes + ep3_become_landed_transfer_effect = { + TITLE_RECEIVER = scope:actor + TITLE_LIST = seized_pastureland + TYPE = granted + REASON = flag:seized_pastureland + ENNOBLED_ADVENTURER = flag:yes + } + # Messages for nearby players + create_landed_ruler_message_effect = { + LANDED = scope:actor + FLAVOR_CHAR = scope:recipient + FLAVOR_TITLE = scope:target + REASON = flag:seized_pastureland + } +} diff --git a/common/scripted_triggers/00_available_for_events_triggers.txt b/common/scripted_triggers/00_available_for_events_triggers.txt new file mode 100644 index 00000000..e9f774eb --- /dev/null +++ b/common/scripted_triggers/00_available_for_events_triggers.txt @@ -0,0 +1,934 @@ +###TRIGGER LIST +#has_contagious_deadly_disease_trigger +#is_healthy +#is_available +#is_available_ai +#is_available_adult +#is_available_healthy_adult +#is_available_ai_adult +#is_available_healthy_ai_adult +#is_capable_adult +#is_capable_adult_ai +#liege_is_boss_trigger +#can_select_lifestyle_focus +#can_marry +#can_become_concubine + +has_contagious_deadly_disease_trigger = { + has_trait_with_flag = contagious_deadly_disease +} + +is_healthy = { + custom_tooltip = { + text = not_poor_health_tt + health >= fine_health + } + NOT = { + has_trait_with_flag = is_healthy_trigger_flag + } + has_contagious_deadly_disease_trigger = no +} + +basic_is_available_ai = { + is_available_quick = { + ai = yes + alive = yes + imprisoned = no + incapable = no + } + has_contagious_deadly_disease_trigger = no +} + +is_available_allow_travelling = { + is_available_quick = { + alive = yes + imprisoned = no + incapable = no + in_army = no + } + has_contagious_deadly_disease_trigger = no + custom_description = { + text = ALREADY_IN_ACTIVITY + NOR = { + exists = involved_activity + has_variable = { + name = homage_liege_scope + name = meditation_character_flag + name = local_shrine_rite + name = petition_liege_character_flag + name = holding_court_character_flag + } + is_being_visited_on_tour_strict = yes + } + } + custom_description = { + text = ALREADY_PLANNING_ACTIVITY + NOT = { has_character_flag = planning_an_activity } + } + # Variable set within the adventure inspiration events + NOT = { has_variable = gone_adventuring } + # Variable set on Mandala succession + custom_tooltip = { + text = busy_in_mandala_succession + NOT = { has_variable = busy_in_mandala_succession } + } +} + +# If you update one of the available triggers, update all of them. It's a lot better for performance to not have scripted triggers within scripted triggers when they're checked as often as these ones are. +is_available = { + is_available_quick = { + alive = yes + travel = no + in_army = no + imprisoned = no + incapable = no + } + has_contagious_deadly_disease_trigger = no + custom_description = { + text = ALREADY_IN_ACTIVITY + NOR = { + exists = involved_activity + has_variable = { + name = homage_liege_scope + name = meditation_character_flag + name = local_shrine_rite + name = petition_liege_character_flag + name = holding_court_character_flag + } + is_being_visited_on_tour_strict = yes + } + } + custom_description = { + text = ALREADY_PLANNING_ACTIVITY + NOT = { has_character_flag = planning_an_activity } + } + # Variable set within the adventure inspiration events + NOT = { has_variable = gone_adventuring } + # Variable set on Mandala succession + custom_tooltip = { + text = busy_in_mandala_succession + NOT = { has_variable = busy_in_mandala_succession } + } +} + +# If you update one of the available triggers, update all of them. It's a lot better for performance to not have scripted triggers within scripted triggers when they're checked as often as these ones are. +is_available_travelling = { + is_available_quick = { + alive = yes + in_army = no + imprisoned = no + incapable = no + travel = yes + } + has_contagious_deadly_disease_trigger = no + NOR = { + has_character_flag = is_in_task_contract_event_chain + has_variable = gone_adventuring + } +} + +# If you update one of the available triggers, update all of them. It's a lot better for performance to not have scripted triggers within scripted triggers when they're checked as often as these ones are. +is_available_travelling_adult = { + is_available_quick = { + travel = yes + adult = yes + alive = yes + in_army = no + imprisoned = no + incapable = no + } + has_contagious_deadly_disease_trigger = no + NOR = { + has_character_flag = is_in_task_contract_event_chain + has_variable = gone_adventuring + } +} + +# If you update one of the available triggers, update all of them. It's a lot better for performance to not have scripted triggers within scripted triggers when they're checked as often as these ones are. +is_available_travelling_ai_adult = { + is_available_quick = { + travel = yes + adult = yes + ai = yes + alive = yes + in_army = no + imprisoned = no + incapable = no + } + has_contagious_deadly_disease_trigger = no + NOR = { + has_character_flag = is_in_task_contract_event_chain + has_variable = gone_adventuring + } +} + +# If you update one of the available triggers, update all of them. It's a lot better for performance to not have scripted triggers within scripted triggers when they're checked as often as these ones are. +is_physically_able = { + is_available_quick = { + alive = yes + imprisoned = no + incapable = no + } +} + +# If you update one of the available triggers, update all of them. It's a lot better for performance to not have scripted triggers within scripted triggers when they're checked as often as these ones are. +is_physically_able_ai = { + is_available_quick = { + ai = yes + alive = yes + imprisoned = no + incapable = no + } +} + +# If you update one of the available triggers, update all of them. It's a lot better for performance to not have scripted triggers within scripted triggers when they're checked as often as these ones are. +is_physically_able_adult = { + is_available_quick = { + adult = yes + alive = yes + imprisoned = no + incapable = no + } +} + +# If you update one of the available triggers, update all of them. It's a lot better for performance to not have scripted triggers within scripted triggers when they're checked as often as these ones are. +is_physically_able_ai_adult = { + is_available_quick = { + ai = yes + adult = yes + alive = yes + imprisoned = no + incapable = no + } +} + +# If you update one of the available triggers, update all of them. It's a lot better for performance to not have scripted triggers within scripted triggers when they're checked as often as these ones are. +is_available_ai = { + is_available_quick = { + ai = yes + alive = yes + travel = no + in_army = no + imprisoned = no + incapable = no + } + has_contagious_deadly_disease_trigger = no + custom_description = { + text = ALREADY_IN_ACTIVITY + NOR = { + exists = involved_activity + has_variable = { + name = homage_liege_scope + name = meditation_character_flag + name = local_shrine_rite + name = petition_liege_character_flag + name = holding_court_character_flag + } + is_being_visited_on_tour_strict = yes + } + } + custom_description = { + text = ALREADY_PLANNING_ACTIVITY + NOT = { has_character_flag = planning_an_activity } + } + # Variable set within the adventure inspiration events + NOT = { has_variable = gone_adventuring } +} + +# If you update one of the available triggers, update all of them. It's a lot better for performance to not have scripted triggers within scripted triggers when they're checked as often as these ones are. +is_available_child = { + is_available_quick = { + adult = no + alive = yes + travel = no + in_army = no + imprisoned = no + incapable = no + } + + has_contagious_deadly_disease_trigger = no + custom_description = { + text = ALREADY_IN_ACTIVITY + NOR = { + exists = involved_activity + has_variable = { + name = homage_liege_scope + name = meditation_character_flag + name = local_shrine_rite + name = petition_liege_character_flag + name = holding_court_character_flag + } + is_being_visited_on_tour_strict = yes + } + } + custom_description = { + text = ALREADY_PLANNING_ACTIVITY + NOT = { has_character_flag = planning_an_activity } + } + # Variable set within the adventure inspiration events + NOT = { has_variable = gone_adventuring } +} + +# If you update one of the available triggers, update all of them. It's a lot better for performance to not have scripted triggers within scripted triggers when they're checked as often as these ones are. +is_available_child_allow_travel = { + is_available_quick = { + adult = no + alive = yes + in_army = no + imprisoned = no + incapable = no + } + + has_contagious_deadly_disease_trigger = no + custom_description = { + text = ALREADY_IN_ACTIVITY + NOR = { + exists = involved_activity + has_variable = { + name = homage_liege_scope + name = meditation_character_flag + name = local_shrine_rite + name = petition_liege_character_flag + name = holding_court_character_flag + } + is_being_visited_on_tour_strict = yes + } + } + custom_description = { + text = ALREADY_PLANNING_ACTIVITY + NOT = { has_character_flag = planning_an_activity } + } + # Variable set within the adventure inspiration events + NOT = { has_variable = gone_adventuring } +} + +# If you update one of the available triggers, update all of them. It's a lot better for performance to not have scripted triggers within scripted triggers when they're checked as often as these ones are. +is_available_ai_child = { + is_available_quick = { + adult = no + ai = yes + alive = yes + travel = no + in_army = no + imprisoned = no + incapable = no + } + has_contagious_deadly_disease_trigger = no + custom_description = { + text = ALREADY_IN_ACTIVITY + NOR = { + exists = involved_activity + has_variable = { + name = homage_liege_scope + name = meditation_character_flag + name = local_shrine_rite + name = petition_liege_character_flag + name = holding_court_character_flag + } + is_being_visited_on_tour_strict = yes + } + } + custom_description = { + text = ALREADY_PLANNING_ACTIVITY + NOT = { has_character_flag = planning_an_activity } + } + # Variable set within the adventure inspiration events + NOT = { has_variable = gone_adventuring } +} + +# If you update one of the available triggers, update all of them. It's a lot better for performance to not have scripted triggers within scripted triggers when they're checked as often as these ones are. +is_available_healthy_child = { + is_available_quick = { + adult = no + alive = yes + travel = no + in_army = no + imprisoned = no + incapable = no + } + is_healthy = yes + custom_description = { + text = ALREADY_IN_ACTIVITY + NOR = { + exists = involved_activity + has_variable = { + name = homage_liege_scope + name = meditation_character_flag + name = local_shrine_rite + name = petition_liege_character_flag + name = holding_court_character_flag + } + is_being_visited_on_tour_strict = yes + } + } + custom_description = { + text = ALREADY_PLANNING_ACTIVITY + NOT = { has_character_flag = planning_an_activity } + } + # Variable set within the adventure inspiration events + NOT = { has_variable = gone_adventuring } +} + +# If you update one of the available triggers, update all of them. It's a lot better for performance to not have scripted triggers within scripted triggers when they're checked as often as these ones are. +is_available_healthy_ai_child = { + is_available_quick = { + ai = yes + adult = no + alive = yes + travel = no + in_army = no + imprisoned = no + incapable = no + } + is_healthy = yes + custom_description = { + text = ALREADY_IN_ACTIVITY + NOR = { + exists = involved_activity + has_variable = { + name = homage_liege_scope + name = meditation_character_flag + name = local_shrine_rite + name = petition_liege_character_flag + name = holding_court_character_flag + } + is_being_visited_on_tour_strict = yes + } + } + custom_description = { + text = ALREADY_PLANNING_ACTIVITY + NOT = { has_character_flag = planning_an_activity } + } + # Variable set within the adventure inspiration events + NOT = { has_variable = gone_adventuring } +} + +# If you update one of the available triggers, update all of them. It's a lot better for performance to not have scripted triggers within scripted triggers when they're checked as often as these ones are. +is_available_adult = { + is_available_quick = { + adult = yes + alive = yes + travel = no + in_army = no + imprisoned = no + incapable = no + } + has_contagious_deadly_disease_trigger = no + custom_description = { + text = ALREADY_IN_ACTIVITY + NOR = { + exists = involved_activity + has_variable = { + name = homage_liege_scope + name = meditation_character_flag + name = local_shrine_rite + name = petition_liege_character_flag + name = holding_court_character_flag + } + is_being_visited_on_tour_strict = yes + } + } + custom_description = { + text = ALREADY_PLANNING_ACTIVITY + NOT = { has_character_flag = planning_an_activity } + } + # Variable set within the adventure inspiration events + NOT = { has_variable = gone_adventuring } +} + +# If you update one of the available triggers, update all of them. It's a lot better for performance to not have scripted triggers within scripted triggers when they're checked as often as these ones are. +is_available_ai_adult = { + is_available_quick = { + ai = yes + adult = yes + alive = yes + travel = no + in_army = no + imprisoned = no + incapable = no + } + has_contagious_deadly_disease_trigger = no + custom_description = { + text = ALREADY_IN_ACTIVITY + NOR = { + exists = involved_activity + has_variable = { + name = homage_liege_scope + name = meditation_character_flag + name = local_shrine_rite + name = petition_liege_character_flag + name = holding_court_character_flag + } + is_being_visited_on_tour_strict = yes + } + } + custom_description = { + text = ALREADY_PLANNING_ACTIVITY + NOT = { has_character_flag = planning_an_activity } + } + # Variable set within the adventure inspiration events + NOT = { has_variable = gone_adventuring } +} + +# If you update one of the available triggers, update all of them. It's a lot better for performance to not have scripted triggers within scripted triggers when they're checked as often as these ones are. +is_available_healthy_adult = { + is_available_quick = { + adult = yes + alive = yes + travel = no + in_army = no + imprisoned = no + incapable = no + } + is_healthy = yes + custom_description = { + text = ALREADY_IN_ACTIVITY + NOR = { + exists = involved_activity + has_variable = { + name = homage_liege_scope + name = meditation_character_flag + name = local_shrine_rite + name = petition_liege_character_flag + name = holding_court_character_flag + } + is_being_visited_on_tour_strict = yes + } + } + custom_description = { + text = ALREADY_PLANNING_ACTIVITY + NOT = { has_character_flag = planning_an_activity } + } + # Variable set within the adventure inspiration events + NOT = { has_variable = gone_adventuring } +} + +# If you update one of the available triggers, update all of them. It's a lot better for performance to not have scripted triggers within scripted triggers when they're checked as often as these ones are. +is_available_healthy_ai_adult = { + is_available_quick = { + ai = yes + adult = yes + alive = yes + travel = no + in_army = no + imprisoned = no + incapable = no + } + is_healthy = yes + custom_description = { + text = ALREADY_IN_ACTIVITY + NOR = { + exists = involved_activity + has_variable = { + name = homage_liege_scope + name = meditation_character_flag + name = local_shrine_rite + name = petition_liege_character_flag + name = holding_court_character_flag + } + is_being_visited_on_tour_strict = yes + } + } + custom_description = { + text = ALREADY_PLANNING_ACTIVITY + NOT = { has_character_flag = planning_an_activity } + } + # Variable set within the adventure inspiration events + NOT = { has_variable = gone_adventuring } +} + +is_available_adult_or_is_commanding = { + OR = { + is_commanding_army = yes + is_available_adult = yes + } +} + +# If you update one of the available triggers, update all of them. It's a lot better for performance to not have scripted triggers within scripted triggers when they're checked as often as these ones are. +is_available_at_peace = { + is_available_quick = { + at_war = no + alive = yes + travel = no + in_army = no + imprisoned = no + incapable = no + } + has_contagious_deadly_disease_trigger = no + custom_description = { + text = ALREADY_IN_ACTIVITY + NOR = { + exists = involved_activity + has_variable = { + name = homage_liege_scope + name = meditation_character_flag + name = local_shrine_rite + name = petition_liege_character_flag + name = holding_court_character_flag + } + is_being_visited_on_tour_strict = yes + } + } + custom_description = { + text = ALREADY_PLANNING_ACTIVITY + NOT = { has_character_flag = planning_an_activity } + } + # Variable set within the adventure inspiration events + NOT = { has_variable = gone_adventuring } +} + +# If you update one of the available triggers, update all of them. It's a lot better for performance to not have scripted triggers within scripted triggers when they're checked as often as these ones are. +is_available_at_peace_adult = { + is_available_quick = { + at_war = no + adult = yes + alive = yes + travel = no + in_army = no + imprisoned = no + incapable = no + } + has_contagious_deadly_disease_trigger = no + custom_description = { + text = ALREADY_IN_ACTIVITY + NOR = { + exists = involved_activity + has_variable = { + name = homage_liege_scope + name = meditation_character_flag + name = local_shrine_rite + name = petition_liege_character_flag + name = holding_court_character_flag + } + is_being_visited_on_tour_strict = yes + } + } + custom_description = { + text = ALREADY_PLANNING_ACTIVITY + NOT = { has_character_flag = planning_an_activity } + } + # Variable set within the adventure inspiration events + NOT = { has_variable = gone_adventuring } +} + +# If you update one of the available triggers, update all of them. It's a lot better for performance to not have scripted triggers within scripted triggers when they're checked as often as these ones are. +is_available_at_peace_ai_adult = { + is_available_quick = { + ai = yes + adult = yes + alive = yes + imprisoned = no + incapable = no + travel = no + in_army = no + at_war = no + } + + has_contagious_deadly_disease_trigger = no + custom_description = { + text = ALREADY_IN_ACTIVITY + NOR = { + exists = involved_activity + has_variable = { + name = homage_liege_scope + name = meditation_character_flag + name = local_shrine_rite + name = petition_liege_character_flag + name = holding_court_character_flag + } + is_being_visited_on_tour_strict = yes + } + } + custom_description = { + text = ALREADY_PLANNING_ACTIVITY + NOT = { has_character_flag = planning_an_activity } + } + # Variable set within the adventure inspiration events + NOT = { has_variable = gone_adventuring } +} + +# If you update one of the available triggers, update all of them. It's a lot better for performance to not have scripted triggers within scripted triggers when they're checked as often as these ones are. +is_available_at_peace_adult_lenient = { + is_available_quick = { + adult = yes + alive = yes + travel = no + in_army = no + imprisoned = no + incapable = no + at_war = no + } + + has_contagious_deadly_disease_trigger = no + custom_description = { + text = ALREADY_IN_ACTIVITY + NOR = { + exists = involved_activity + has_variable = { + name = homage_liege_scope + name = meditation_character_flag + name = local_shrine_rite + name = petition_liege_character_flag + name = holding_court_character_flag + } + is_being_visited_on_tour_strict = yes + } + } + custom_description = { + text = ALREADY_PLANNING_ACTIVITY + NOT = { has_character_flag = planning_an_activity } + } + # Variable set within the adventure inspiration events + NOT = { has_variable = gone_adventuring } +} + +# If you update one of the available triggers, update all of them. It's a lot better for performance to not have scripted triggers within scripted triggers when they're checked as often as these ones are. +# Meaning you may be at war, but you're still located in your capital. +is_available_even_at_war_adult = { + is_available_quick = { + adult = yes + alive = yes + travel = no + in_army = no + imprisoned = no + incapable = no + } + + has_contagious_deadly_disease_trigger = no + custom_description = { + text = ALREADY_IN_ACTIVITY + NOR = { + exists = involved_activity + has_variable = { + name = homage_liege_scope + name = meditation_character_flag + name = local_shrine_rite + name = petition_liege_character_flag + name = holding_court_character_flag + } + is_being_visited_on_tour_strict = yes + } + } + custom_description = { + text = ALREADY_PLANNING_ACTIVITY + NOT = { has_character_flag = planning_an_activity } + } + # Variable set within the adventure inspiration events + NOT = { has_variable = gone_adventuring } +} + +is_capable_adult = { + is_available_quick = { + adult = yes + incapable = no + } +} + +is_capable_adult_ai = { + is_available_quick = { + ai = yes + adult = yes + incapable = no + } +} + +can_select_lifestyle_focus = { + is_capable_adult = yes + is_playable_character = yes +} + +is_not_hostile_towards_root = { + NOR = { + is_a_faction_member = yes + any_scheme = { + hostile_scheme_trigger = yes + scheme_target_character = root + } + is_at_war_with = root + } +} + +player_target_available_for_personal_scheme_ongoing_events_trigger = { + $TARGET$ = { + trigger_if = { + limit = { + is_ai = no + $OWNER$ = { is_ruler = no } + } + is_at_war = no + } + trigger_else = { + always = yes + } + } +} + + +basic_is_valid_for_yearly_events_trigger = { + is_playable_character = yes + is_available_quick = { + imprisoned = no + incapable = no + } + OR = { + is_travelling = no + has_government = landless_adventurer_government + } + NOR = { + has_character_flag = is_in_task_contract_event_chain + exists = involved_activity + } +} + +# If you update one of the available triggers, update all of them. It's a lot better for performance to not have scripted triggers within scripted triggers when they're checked as often as these ones are. +is_valid_for_narrow_yearly_events = { + is_available_quick = { + at_war = no + imprisoned = no + incapable = no + } + is_commanding_army = no + is_playable_character = yes + OR = { + is_travelling = no + has_government = landless_adventurer_government + } + NOR = { + has_character_flag = is_in_task_contract_event_chain + exists = involved_activity + } +} + +# If you update one of the available triggers, update all of them. It's a lot better for performance to not have scripted triggers within scripted triggers when they're checked as often as these ones are. +is_valid_for_narrow_yearly_events_adult = { + is_available_quick = { + adult = yes + at_war = no + imprisoned = no + incapable = no + } + is_commanding_army = no + is_playable_character = yes + OR = { + is_travelling = no + has_government = landless_adventurer_government + } + NOR = { + has_character_flag = is_in_task_contract_event_chain + exists = involved_activity + } +} + +is_within_diplo_range = { + capital_province ?= { + save_temporary_scope_as = my_capital + $CHARACTER$.capital_province ?= { + squared_distance = { + target = scope:my_capital + value < 200000 + } + } + } +} + +# This trigger checks if a character is a Nomad +is_nomad = { + government_has_flag = government_is_nomadic + is_ruler = yes +} + +# This trigger checks if a character is a landed Nomad +is_landed_nomad = { + government_has_flag = government_is_nomadic + is_available_quick = { + ruler = yes + landed = yes + } +} + +# Checks if a character is a landless nomad with a domicile +is_landless_nomad = { + government_has_flag = government_is_nomadic + is_landed = no + has_domicile = yes +} + +# This trigger checks if a character is a landless adventurer +is_landless_adventurer = { + OR = { + government_has_flag = government_is_landless_adventurer + government_has_flag = government_is_landless_minority + } +} + +# This trigger checks if a character is a governor in an admin realm (implying they are landed) +is_governor = { + government_allows = administrative + is_landed = yes + top_liege != this + OR = { + highest_held_title_tier >= main_administrative_tier + highest_held_title_tier >= min_title_maa_tier + } + tgp_is_ceremonial_liege_trigger = no +} +is_governor_or_admin_count = { + government_allows = administrative + is_landed = yes + top_liege != this + highest_held_title_tier >= tier_county + tgp_is_ceremonial_liege_trigger = no +} + +# Checks if a character is a landless house_head within an admin realm +is_landless_administrative = { + government_allows = administrative + is_landed = no + is_house_head = yes + has_domicile = yes +} + +# Checks if a character is a landless house_head within a feudal realm +is_landless_soryo = { + government_has_flag = government_is_japan_feudal + is_landed = no + is_house_head = yes + has_domicile = yes +} + +# Checks if a character is either landed or an unlanded house head within an admin realm +is_landed_or_landless_administrative = { + OR = { + is_landed = yes + is_landless_administrative = yes + } +} + +# Checks if a character is either landed, a landless house head within an admin realm, a landless nomad, a landless adventurer, a landless soryo, or a minister +is_playable_character = { + OR = { + is_landed = yes + is_landless_administrative = yes + is_landless_adventurer = yes + is_landless_nomad = yes + is_landless_soryo = yes + tgp_is_any_minister = yes # To keep ministers playable, regardless of having a nobel family title or not + } +} + +roman_restoration_is_valid_roman_empire_trigger = { + is_ai = no + is_roman_emperor_trigger = yes + OR = { + religion = religion:christianity_religion #Either Christian + religion = religion:hellenism_religion #Or Hellenic + } + NOT = { has_ep3_dlc_trigger = yes } +} + +is_eunuch_trigger = { + OR = { + has_trait = eunuch_1 + has_trait = beardless_eunuch + } +} diff --git a/common/scripted_triggers/00_law_triggers.txt b/common/scripted_triggers/00_law_triggers.txt new file mode 100644 index 00000000..3d981d9b --- /dev/null +++ b/common/scripted_triggers/00_law_triggers.txt @@ -0,0 +1,511 @@ + +character_gender_can_rule_title_trigger = { + trigger_if = { + limit = { + $GENDER$ = { is_male = yes } + exists = $TITLE$ + $TITLE$ = { + NOT = { + has_title_law = female_only_law + } + } + } + always = yes + } + trigger_else_if = { + limit = { + $GENDER$ = { is_female = yes } + exists = $TITLE$ + $TITLE$ = { + NOT = { + has_title_law = male_only_law + } + } + } + always = yes + } + trigger_else = { + always = no + } +} + +character_gender_can_inherit_from_trigger = { + save_temporary_scope_as = heir + + trigger_if = { + limit = { + $CHARACTER$ = { exists = primary_title } + } + $CHARACTER$ = { + character_gender_can_rule_title_trigger = { + GENDER = scope:heir + TITLE = primary_title + } + } + } + trigger_else = { + always = no + } +} + +has_partition_succession_realm_law_trigger = { + OR = { + has_realm_law = confederate_partition_succession_law + has_realm_law = partition_succession_law + has_realm_law = high_partition_succession_law + has_realm_law = clan_antagonistic_partition_succession_law + has_realm_law = clan_competitive_partition_succession_law + has_realm_law = clan_impassive_partition_succession_law + has_realm_law = clan_friendly_partition_succession_law + has_realm_law = clan_harmonious_partition_succession_law + } +} + +realm_law_use_crown_authority = { + government_has_flag = government_uses_crown_authority +} + +realm_law_use_tribal_authority = { + government_has_flag = government_is_tribal +} + +realm_law_use_camp_purpose = { + government_has_flag = government_is_landless_adventurer +} + +realm_law_use_imperial_bureaucracy = { + government_allows = administrative + NOR = { + government_has_flag = government_is_celestial + government_has_flag = government_is_meritocratic + government_has_flag = government_is_steppe_admin + government_has_flag = government_is_japan_administrative + } +} + +realm_law_use_nomadic_authority = { + government_has_flag = government_is_nomadic +} + +realm_law_use_celestial_bureaucracy = { + government_has_flag = government_is_celestial +} + +realm_law_is_mandala = { + government_has_flag = government_is_mandala +} + +realm_law_use_meritocratic_bureaucracy = { + OR = { + government_has_flag = government_is_meritocratic + government_has_flag = government_is_steppe_admin + } +} + +realm_uses_treasury_laws_trigger = { + government_allows = treasury +} + +realm_law_use_japanese_bureaucracy = { + government_is_japanese_trigger = yes +} + +can_have_confederate_partition_succession_law_trigger = { + OR = { + government_has_flag = government_is_feudal + government_has_flag = government_is_tribal + government_has_flag = government_is_minority + # TGP + AND = { + government_has_flag = government_is_japan_feudal + tgp_realm_has_ceremonial_liege_trigger = yes + is_independent_ruler = no + } + } +} + +can_keep_partition_succession_law_trigger = { + # The 'can_keep' triggers are dependent on actually having the law. If they aren't, the trigger breakdown for the player breaks and shows incomplete information. + trigger_if = { + limit = { + has_realm_law = partition_succession_law + } + OR = { + can_have_partition_succession_law_trigger = yes + + # Mongol Empires + has_title = title:e_mongol_empire + has_title = title:e_ilkhanate + has_title = title:e_golden_horde + has_title = title:e_chagatai + has_title = title:e_red_horde + has_title = title:e_white_horde + has_title = title:e_aarlud_khanate + has_title = title:e_togskol_khanate + has_title = title:e_baruun_khanate + has_title = title:e_great_yuan + has_title = title:e_blue_horde + has_title = title:e_omnod_dalai_khanate + } + } + NOT = { government_has_flag = government_is_clan } +} + +can_have_partition_succession_law_trigger = { + culture = { + has_innovation = innovation_hereditary_rule + } + custom_description = { + text = succession_laws_must_have_organised_government_tooltip + OR = { + government_has_flag = government_is_feudal + government_has_flag = government_is_clan + government_has_flag = government_is_japan_feudal + } + } +} + +can_keep_high_partition_succession_law_trigger = { + # The 'can_keep' triggers are dependent on actually having the law. If they aren't, the trigger breakdown for the player breaks and shows incomplete information. + trigger_if = { + limit = { + has_realm_law = high_partition_succession_law + } + OR = { + can_have_high_partition_succession_law_trigger = yes + + # Mongol Empires + has_title = title:e_mongol_empire + has_title = title:e_ilkhanate + has_title = title:e_golden_horde + has_title = title:e_chagatai + has_title = title:e_red_horde + has_title = title:e_white_horde + has_title = title:e_aarlud_khanate + has_title = title:e_togskol_khanate + has_title = title:e_baruun_khanate + has_title = title:e_great_yuan + has_title = title:e_blue_horde + has_title = title:e_omnod_dalai_khanate + } + } + NOT = { government_has_flag = government_is_clan} +} + +can_have_high_partition_succession_law_trigger = { + trigger_if = { + limit = { + NOT = { + culture = { has_cultural_parameter = can_enact_high_partition_succession_law } + } + } + culture = { has_innovation = innovation_heraldry } + } + custom_description = { + text = succession_laws_must_have_organised_government_tooltip + OR = { + government_has_flag = government_is_feudal + government_has_flag = government_is_clan + government_has_flag = government_is_japan_feudal + } + } +} + +can_keep_single_heir_succession_law_trigger = { + # The 'can_keep' triggers are dependent on actually having the law. If they aren't, the trigger breakdown for the player breaks and shows incomplete information. + trigger_if = { + limit = { + has_realm_law = single_heir_succession_law + } + OR = { + can_have_single_heir_succession_law_trigger = yes + # Byzantine Empire / Ceremonial Liege + historical_succession_access_single_heir_succession_law_trigger = yes + has_variable = purge_oath_previous_law # ACH Purge Pretenders Oath + } + } +} + +can_have_single_heir_succession_law_trigger = { + trigger_if = { # Celestial/Meritocratic/Soryo + limit = { + OR = { + government_allows = merit + government_has_flag = government_is_japan_feudal + } + } + custom_tooltip = { # You are independent, have the innovation or are Ceremonial Monarch + text = can_have_single_heir_succession_law_trigger_merit_or_japan_tt + OR = { + is_independent_ruler = yes + culture = { + has_innovation = innovation_primogeniture + } + tgp_has_ceremonial_liege_title_trigger = yes + } + } + } + trigger_else_if = { + limit = { tgp_realm_has_ceremonial_liege_trigger = yes } + tgp_has_ceremonial_liege_title_trigger = yes + } + trigger_else = { + culture = { + has_innovation = innovation_primogeniture + } + } + # Non-tribals only + trigger_if = { # We split the tooltip into two, to make sure we don't show admin unless you actually have it + limit = { + has_ep3_dlc_trigger = yes + } + custom_tooltip = { + text = must_be_feudal_clan_or_admin + OR = { + government_has_flag = government_is_feudal + government_has_flag = government_is_clan + government_allows = administrative + government_has_flag = government_is_japan_feudal + tgp_has_ceremonial_liege_title_trigger = yes + } + } + } + trigger_else = { + custom_description = { + text = succession_laws_must_have_organised_government_tooltip + OR = { + government_has_flag = government_is_feudal + government_has_flag = government_is_clan + government_allows = merit + government_has_flag = government_is_japan_feudal + tgp_has_ceremonial_liege_title_trigger = yes + } + } + } + # Admin rules + trigger_if = { + limit = { government_allows = administrative } + trigger_if = { + limit = { tgp_realm_has_ceremonial_liege_trigger = yes } + tgp_has_ceremonial_liege_title_trigger = yes + } + trigger_else = { is_independent_ruler = yes } + } +} + +can_keep_single_heir_youngest_succession_law_trigger = { + # The 'can_keep' triggers are dependent on actually having the law. If they aren't, the trigger breakdown for the player breaks and shows incomplete information. + trigger_if = { + limit = { + has_realm_law = single_heir_succession_law_youngest + } + OR = { + can_have_single_heir_youngest_succession_law_trigger = yes + historical_succession_access_single_heir_succession_law_youngest_trigger = yes + } + } +} + +can_have_single_heir_youngest_succession_law_trigger = { + culture = { + has_innovation = innovation_primogeniture + } + # Non-tribals only + trigger_if = { # We split the tooltip into two, to make sure we don't show admin unless you actually have it + limit = { + has_ep3_dlc_trigger = yes + } + custom_tooltip = { + text = must_be_feudal_clan_or_admin + OR = { + government_has_flag = government_is_feudal + government_has_flag = government_is_clan + government_allows = administrative + government_has_flag = government_is_japan_feudal + } + } + } + trigger_else = { + custom_description = { + text = succession_laws_must_have_organised_government_tooltip + OR = { + government_has_flag = government_is_feudal + government_has_flag = government_is_clan + government_has_flag = government_is_japan_feudal + } + } + } + trigger_if = { + limit = { + government_allows = administrative + } + is_independent_ruler = yes + } +} + +can_keep_single_heir_dynasty_house_trigger = { + # The 'can_keep' triggers are dependent on actually having the law. If they aren't, the trigger breakdown for the player breaks and shows incomplete information. + trigger_if = { + limit = { + has_realm_law = single_heir_dynasty_house + } + OR = { + can_have_single_heir_dynasty_house_trigger = yes + historical_succession_access_single_heir_dynasty_house_trigger = yes + } + } +} + +can_have_single_heir_dynasty_house_trigger = { + exists = house + trigger_if = { + limit = { + culture = { + OR = { + this = culture:czech + this = culture:slovien + any_parent_culture_or_above = { + this = culture:czech + } + any_parent_culture_or_above = { + this = culture:slovien + } + NOT = { has_innovation = innovation_heraldry } + } + } + } + culture = { + has_innovation = innovation_table_of_princes + } + } + trigger_else = { + culture = { + has_innovation = innovation_heraldry + } + } + custom_description = { + text = succession_laws_must_have_organised_government_tooltip + OR = { + government_has_flag = government_is_feudal + government_has_flag = government_is_clan + government_has_flag = government_is_japan_feudal + } + } + NOT = { government_allows = administrative } +} + +can_have_bishop_theocratic_succession_law_trigger = { + OR = { + is_theocratic_lessee = yes + government_has_flag = government_is_theocracy + } +} + +is_temporal_head_of_faith_trigger = { + is_head_of_faith = yes + holder.faith = { has_doctrine = doctrine_temporal_head } +} + +can_title_have_law_general_trigger = { + tier >= tier_duchy + is_temporal_head_of_faith_trigger = no +} + +can_have_holy_order_succession_law_trigger = { + government_has_flag = government_is_holy_order +} + +can_have_mercenary_succession_law_trigger = { + government_has_flag = government_is_mercenary +} + +can_have_city_succession_law_trigger = { + government_has_flag = government_is_republic +} + +can_have_herder_succession_law_trigger = { + government_has_flag = government_is_herder +} + +title_can_reduce_partition_law_trigger = { + holder ?= { + OR = { + has_realm_law = single_heir_succession_law + can_have_high_partition_succession_law_trigger = yes + } + OR = { + has_realm_law = high_partition_succession_law + can_have_high_partition_succession_law_trigger = yes + } + OR = { + has_realm_law = partition_succession_law + can_have_confederate_partition_succession_law_trigger = yes + } + } +} + +can_pass_law_ca1_trigger = { + culture = { has_innovation = innovation_plenary_assemblies } +} + +can_pass_law_ca2_trigger = { + culture = { has_innovation = innovation_royal_prerogative } +} + +can_pass_law_ca3_trigger = { + culture = { has_innovation = innovation_royal_prerogative } +} + +can_have_acclamation_succession_law_trigger = { + has_ep3_dlc_trigger = yes + top_liege = this + government_allows = administrative + NOR = { + government_has_flag = government_is_celestial + government_has_flag = government_is_japan_administrative + government_has_flag = government_is_meritocratic + government_has_flag = government_is_steppe_admin + } +} + +can_keep_acclamation_succession_law_trigger = { + has_ep3_dlc_trigger = yes + trigger_if = { + limit = { + has_realm_law = acclamation_succession_law + } + OR = { + can_have_acclamation_succession_law_trigger = yes + has_title = title:e_byzantium + } + } +} + +can_change_acclamation_succession_law_trigger = { + has_ep3_dlc_trigger = yes +} + +can_have_appointment_succession_law_trigger = { + has_ep3_dlc_trigger = yes + government_allows = administrative + NOR = { + government_has_flag = government_is_celestial + government_has_flag = government_is_japan_administrative + government_has_flag = government_is_meritocratic + } + is_independent_ruler = no +} + +can_keep_appointment_succession_law_trigger = { + has_ep3_dlc_trigger = yes + trigger_if = { + limit = { + has_realm_law = appointment_succession_law + } + can_have_appointment_succession_law_trigger = yes + } +} + +can_change_appointment_succession_law_trigger = { + has_ep3_dlc_trigger = yes +} diff --git a/common/scripted_triggers/00_legal_triggers.txt b/common/scripted_triggers/00_legal_triggers.txt new file mode 100644 index 00000000..364cae07 --- /dev/null +++ b/common/scripted_triggers/00_legal_triggers.txt @@ -0,0 +1,176 @@ + +### Legal trigger list + +opposes_succession_law_change_trigger = { + is_imprisoned = no + opinion = { + target = liege + value < 0 + } + custom_description = { + text = law_change_approval_is_cowed + has_dread_level_towards = { + target = liege + level < 2 + } + } +} + +can_change_succession_laws_realm_flag_trigger = { + trigger_if = { + limit = { realm_law_use_tribal_authority = yes } + custom_description = { + text = "has_tribal_law_allowing_succession_law_change" + has_realm_law_flag = can_change_succession_laws + } + } + trigger_else_if = { + limit = { realm_law_use_imperial_bureaucracy = yes } + custom_description = { + text = has_imperial_bureaucracy_law_allowing_succession_law_change + has_realm_law_flag = can_change_succession_laws + } + } + trigger_else = { + custom_description = { + text = "has_crown_law_allowing_succession_law_change" + has_realm_law_flag = can_change_succession_laws + } + } +} + +can_change_succession_law_trigger = { + can_change_succession_laws_realm_flag_trigger = yes + custom_description = { + text = "no_powerful_vassal_with_negative_opinion" + NOT = { + any_vassal = { + is_powerful_vassal = yes + opposes_succession_law_change_trigger = yes + } + } + } +} + +can_change_single_heir_dynasty_house_succession_law_trigger = { + trigger_if = { + limit = { + culture = { + OR = { + this = culture:czech + this = culture:slovien + any_parent_culture_or_above = { + this = culture:czech + } + any_parent_culture_or_above = { + this = culture:slovien + } + } + } + NOT = { + has_realm_law_flag = can_change_succession_laws + } + } + culture = { + has_innovation = innovation_table_of_princes + } + } + trigger_else = { + can_change_succession_laws_realm_flag_trigger = yes + } + custom_description = { + text = "no_powerful_vassal_with_negative_opinion" + NOT = { + any_vassal = { + is_powerful_vassal = yes + opposes_succession_law_change_trigger = yes + } + } + } +} + +can_change_to_equal_succession_law_trigger = { + trigger_if = { + limit = { + NOT = { has_realm_law_flag = can_change_succession_laws } + } + OR = { + culture = { has_cultural_parameter = gender_equal_inheritance } + faith = { has_doctrine = doctrine_gender_equal } + } + } + trigger_else = { + can_change_succession_laws_realm_flag_trigger = yes + } + custom_description = { + text = "no_powerful_vassal_with_negative_opinion" + NOT = { + any_vassal = { + is_powerful_vassal = yes + opposes_succession_law_change_trigger = yes + } + } + } +} + +can_change_partition_succession_law_trigger = { + custom_description = { + text = "has_law_allowing_partition_succession_law_change" + OR = { + has_realm_law_flag = can_change_partition_succession_laws + has_realm_law_flag = can_change_succession_laws + } + } + custom_description = { + text = "no_powerful_vassal_with_negative_opinion" + NOT = { + any_vassal = { + is_powerful_vassal = yes + opposes_succession_law_change_trigger = yes + } + } + } +} + + +## Can this character assign a dedicated heir? +# +# Check if a character can assign some designated heir, +# but not if the heir is a valid candidate. +# +# root: Character that will assign an heir +# +can_designate_heir_trigger = { + trigger_if = { + # Admin always has access to this + limit = { government_allows = administrative } + + custom_description = { + text = "has_admin_allowing_designate_heir" + any_held_title = { + is_noble_family_title = yes + } + } + } + trigger_else_if = { + # Feudal and clan can get this by increasing crown authority + limit = { has_realm_law_in_group = crown_authority } + + custom_description = { + text = "has_crown_authority_designate_heir" + has_realm_law_flag = can_designate_heirs + } + } + trigger_else = { + # Everyone else also needs a law to gain access to this interaction + custom_description = { + text = "has_law_allowing_designate_heir" + has_realm_law_flag = can_designate_heirs + } + } +} + + +can_change_title_law_trigger = { + is_at_war = no +} diff --git a/gfx/interface/icons/domicile_building/minority_community_main.dds b/gfx/interface/icons/domicile_building/minority_community_main.dds new file mode 100644 index 00000000..8e1ca182 --- /dev/null +++ b/gfx/interface/icons/domicile_building/minority_community_main.dds @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3e9485fabf99120e751d1608499fb642e3a0f925ec3ababbf221c56b1f11a22b +size 21472 diff --git a/gfx/interface/icons/flat_icons/minority.dds b/gfx/interface/icons/flat_icons/minority.dds new file mode 100644 index 00000000..e94f4cb7 --- /dev/null +++ b/gfx/interface/icons/flat_icons/minority.dds @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c85a144c2385d5d32a7697622148121d669b840e088a9ea424dd4b2334764b2 +size 5104 diff --git a/gfx/interface/icons/government_types/landless_minority_government.dds b/gfx/interface/icons/government_types/landless_minority_government.dds new file mode 100644 index 00000000..63025fd3 --- /dev/null +++ b/gfx/interface/icons/government_types/landless_minority_government.dds @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:78307caf5d9fd34a0ba51de7dec51edddc7856a27c868fa98652b6518ced5956 +size 7120 diff --git a/gfx/interface/icons/map_icons/map_icon_minority.dds b/gfx/interface/icons/map_icons/map_icon_minority.dds new file mode 100644 index 00000000..cd354687 --- /dev/null +++ b/gfx/interface/icons/map_icons/map_icon_minority.dds @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8bad940c2b67c06f970ee07678c636fab158f513e1647730cc7bf1d46324da16 +size 8768 diff --git a/gui/hud.gui b/gui/hud.gui new file mode 100644 index 00000000..7a69c74e --- /dev/null +++ b/gui/hud.gui @@ -0,0 +1,8575 @@ +###################################################### +#################### META INFO ####################### +###################################################### + +widget = { + size = { 100% 100% } + name = "meta_info" + visible = "[IsDefaultGUIMode]" + layer = bottom + + using = Animation_ShowHide_Standard + + flowcontainer = { + name = "observer_status" + visible = "[And( Not(IsGameViewOpen('succession_event')), IsObserver )]" + visible_at_creation = no + parentanchor = bottom|left + position = { 180 -110 } + ignoreinvisible = yes + margin_top = 2 + margin_left = 80 + margin_right = 2 + + background = { + using = Background_Area_Dark + } + + text_single = { + name = "global_observer_indication" + visible = "[Not(GetPlayer.IsValid)]" + text = "GLOBAL_OBSERVER" + } + + text_single = { + name = "player_observer_indication" + visible = "[GetPlayer.IsValid]" + text = "PLAYER_OBSERVER" + } + + button_cancel = { + name = "cancel_button" + visible = "[GetPlayer.IsValid]" + + size = { 30 30 } + onclick = "[ClearObserver]" + tooltip = "OBSERVER_MODE_ON" + } + + icon_observer = { + size = { 30 30 } + visible = "[Not(GetPlayer.IsValid)]" + } + } + + ## Build version & Beta warning + text_single = { + name = "build_version_text" + visible = "[And( Not(IsGameViewOpen('barbershop')), Not(LiveMode))]" + position = { 5 5 } + + tooltip = "[GetBuildVersionDescription]" + + text = "VERSION_SHORT" + default_format = "#low" + max_width = 300 + } + text_single = { + name = "beta_warning_text" + visible = "[And( Not(IsGameViewOpen('barbershop')), Not(LiveMode))]" + position = { 5 22 } + tooltip = "[GetBuildVersionDescription]" + + text = "BETA_BUILD" + default_format = "#low" + max_width = 300 + } + + error_horse = { + parentanchor = bottom|left + position = { 850 -10 } + visible = "[And( Not(IsGameViewOpen('barbershop')), And( Not( IsPauseMenuShown ), Not(ReleaseMode) ) )]" + } + loaded_mods_icon = { + parentanchor = bottom|left + visible = "[And( Not( IsPauseMenuShown ), And( HasLoadedMods, Not(ReleaseMode) ) )]" + tooltip = "[GetLoadedMods]" + position = { 670 -5 } + } +} + +###################################################### +#################### TOP RIGHT ####################### +###################################################### + +#Top right: resources and alerts, outliner, and panel tabs +widget = { + name = "ingame_topbar" + visible = "[InGameTopbar.ShouldBeVisible]" + size = { 100% 100% } + layer = hud_layer + using = Animation_ShowHide_Quick + + ### Ruler Objectives + container = { + visible = "[And( GetPlayersRulerObjectiveDecision.IsValid, Not( IsGameViewOpen( 'hud_ruler_objective' )) )]" + datacontext = "[GetPlayersRulerObjectiveDecision]" + parentanchor = top|left + position = { 8 16 } + + using = Animation_ShowHide_Quick + + button_round = { + name = "ruler_objective_button" + size = { 84 84 } + alpha = 0.7 + + onclick = "[ToggleGameView( 'hud_ruler_objective' )]" + tooltip = "SHOW_RULER_OBJECTIVE" + + state = { + name = _mouse_enter + alpha = 1 + duration = 0.2 + using = Animation_Curve_Default + } + + state = { + name = _mouse_leave + alpha = 0.7 + duration = 0.7 + using = Animation_Curve_Default + } + + button_ruler_objective = { + parentanchor = center + alwaystransparent = yes + size = { 64 64 } + } + } + } + + ### Outliner Button + container = { + visible = "[And(Not( GreaterThan_CFixedPoint( GetPlayer.MakeScope.Var('hide_ui_outliner').GetValue, '(CFixedPoint)0' ) ), And( Not( IsGameViewOpen('barbershop') ), And( Not( IsPauseMenuShown ), And(Not(IsRightWindowOpen), IsDefaultGUIMode))))]" + parentanchor = top|right + position = { -3 55 } + + using = Animation_ShowHide_Quick + + button_round = { + name = "outliner_button" + size = { 35 35 } + alpha = 0.7 + + onclick = "[ToggleGameView('outliner')]" + tooltip = "TOGGLE_OUTLINER" + + state = { + name = _mouse_enter + alpha = 1 + duration = 0.2 + using = Animation_Curve_Default + } + + state = { + name = _mouse_leave + alpha = 0.7 + duration = 0.7 + using = Animation_Curve_Default + } + + button_outliner = { + parentanchor = center + alwaystransparent = yes + size = { 25 25 } + } + } + } + + widget = { + layer = hud_layer + size = { 100% 88 } + position = { 0 -24 } + + allow_outside = yes + + hbox = { + ### Alerts + expand = {} + notifications_alerts = { + visible = "[And( Not(IsGameViewOpen('barbershop')), Not( IsPauseMenuShown ) )]" + using = Animation_ShowHide_Quick + } + ### Suggestions / Current Situation + widget = { + size = { 80 80 } + widgetid = "suggestions_placer" + visible = "[Not( IsPauseMenuShown )]" + } + + spacer = { + size = { 16 1 } + } + #### Top Right Bar + resources_top_right_bar = { + name = "top_bar" + visible = "[And(Not( IsPauseMenuShown ), Not( GreaterThan_CFixedPoint( GetPlayer.MakeScope.Var('hide_ui_top_bar').GetValue, '(CFixedPoint)0' ) ))]" + } + } + } + + ### Main Tabs + widget = { + name = "main_tabs" + visible = "[And(And(And( Not( IsPauseMenuShown ), And(Or(Not(IsObserver), GetPlayer.IsValid), IsDefaultGUIMode)), Not(IsGameViewOpen('struggle'))), Not( GreaterThan_CFixedPoint( GetPlayer.MakeScope.Var('hide_ui_main_tabs').GetValue, '(CFixedPoint)0' ) ))]" + parentanchor = top|right + position = { 0 105 } + size = { 50 0 } + allow_outside = yes + + using = Animation_ShowHide_Quick + + vbox = { + alwaystransparent = no + filter_mouse = all + visible = "[Not(IsGameViewOpen('barbershop'))]" + margin = { 5 10 } + + Background = { + visible = "[And(Not(IsRightWindowOpen) , Not(IsGameViewOpen('barbershop')) )]" + texture = "gfx/interface/skinned/hud_maintab_bg_middle.dds" + spriteType = CorneredTiled + texture_density = 2 + margin = { 0 -50 } + } + + Background = { + visible = "[And(Not(IsRightWindowOpen) , Not(IsGameViewOpen('barbershop')) )]" + spriteType = CorneredStretched + spriteborder_top = 100 + parentanchor = top|right + texture_density = 2 + size = { 50 100 } + texture = "gfx/interface/skinned/hud_maintab_bg_top.dds" + } + + Background = { + visible = "[And(Not(IsRightWindowOpen) , Not(IsGameViewOpen('barbershop')) )]" + spriteType = CorneredStretched + spriteborder_bottom = 100 + parentanchor = top|right + texture_density = 2 + size = { 50 100 } + texture = "gfx/interface/skinned/hud_maintab_bg_bottom.dds" + } + + vbox = { + state = { + name = _show + alpha = 1 + duration = 0.1 + using = Animation_Curve_Default + } + + state = { + name = _hide + duration = 0.6 + alpha = 0 + using = Animation_Curve_Default + } + + hbox = { + name = "tab_government_administration" #tutorial uses this + + widget_hud_main_tab = { + + datacontext = "[GetPlayer.GetTopLiege]" + visible = "[And(Character.GetGovernment.HasRule( 'noble_families' ),Not(Or(GetPlayer.GetGovernment.IsType( 'celestial_government' ),Or(GetPlayer.GetGovernment.IsType( 'japan_administrative_government' ),GetPlayer.GetGovernment.IsType( 'japan_feudal_government' )))))]" + + blockoverride "maintab_button" + { + texture = "gfx/interface/skinned/hud_maintab/maintab_administrative.dds" + + onclick = "[ToggleGameView( 'government_administration' )]" + down = "[IsGameViewOpen( 'government_administration' )]" + + tooltip = "ADMINISTRATIVE_BUTTON" + } + } + + widget_hud_main_tab = { + datacontext = "[GetPlayer.GetTopLiege]" + visible = "[GetPlayer.GetGovernment.IsType( 'japan_feudal_government' )]" + + blockoverride "maintab_button" + { + texture = "gfx/interface/skinned/hud_maintab/maintab_soryo_japan.dds" + + onclick = "[ToggleGameView( 'government_administration' )]" + down = "[IsGameViewOpen( 'government_administration' )]" + + tooltip = "ADMINISTRATIVE_BUTTON" + } + } + + widget_hud_main_tab = { + datacontext = "[GetPlayer.GetTopLiege]" + visible = "[GetPlayer.GetGovernment.IsType( 'japan_administrative_government' )]" + + blockoverride "maintab_button" + { + texture = "gfx/interface/skinned/hud_maintab/maintab_ritsuryo_japan.dds" + + onclick = "[ToggleGameView( 'government_administration' )]" + down = "[IsGameViewOpen( 'government_administration' )]" + + tooltip = "ADMINISTRATIVE_BUTTON" + } + } + + widget_hud_main_tab = { + + datacontext = "[GetPlayer.GetTopLiege]" + visible = "[GetPlayer.GetGovernment.IsType( 'celestial_government' )]" + + blockoverride "maintab_button" + { + texture = "gfx/interface/skinned/hud_maintab/maintab_administrative_china.dds" + + onclick = "[ToggleGameView( 'government_administration' )]" + down = "[IsGameViewOpen( 'government_administration' )]" + + tooltip = "ADMINISTRATIVE_BUTTON" + } + } + } + + widget = { + size = { 0 15 } + layoutpolicy_horizontal = expanding + + icon = { + datacontext = "[GetPlayer.GetTopLiege]" + visible = "[And(Or( Character.GetGovernment.HasRule( 'noble_families' ), Character.GetGovernment.HasRule( 'administrative' ) ), And( Not( IsPauseMenuShown ), And(Or(Not(IsObserver), GetPlayer.IsValid), IsDefaultGUIMode)))]" + size = { 25 15 } + parentanchor = right|vcenter + + texture = "gfx/interface/skinned/hud_spike_big.dds" + using = Animation_ShowHide_Standard + } + } + + widget_hud_main_tab = { + name = "tab_my_realm_tutorial_uses_this" + + blockoverride "maintab_button" + { + texture = "gfx/interface/skinned/hud_maintab/maintab_my_realm.dds" + onclick = "[ToggleGameView('my_realm')]" + shortcut = "my_realm_window" + tooltip = "MY_REALM_BUTTON" + down = "[IsGameViewOpen('my_realm')]" + } + } + + widget_hud_main_tab = { + name = "tab_military_tutorial_uses_this" + + blockoverride "maintab_button" + { + texture = "gfx/interface/skinned/hud_maintab/maintab_military.dds" + + onclick = "[ToggleGameViewData('military', GetPlayer.GetID)]" + shortcut = "military_window" + tooltip = "MILITARY_BUTTON" + down = "[IsGameViewOpen('military')]" + } + } + + widget_hud_main_tab = { + name = "tab_council" + visible = "[Not( IsLandlessAdventurer( GetPlayer ) )]" + + blockoverride "maintab_button" + { + texture = "gfx/interface/skinned/hud_maintab/maintab_council.dds" + + onclick = "[ToggleGameViewData('council_window', GetPlayer.GetID)]" + shortcut = "council_window" + tooltip = "COUNCIL_BUTTON" + down = "[IsGameViewOpen('council_window')]" + } + } + } + + widget = { + layoutpolicy_horizontal = expanding + size = { 0 15 } + + icon = { + visible = "[And( Not( IsPauseMenuShown ), And(Or(Not(IsObserver), GetPlayer.IsValid), IsDefaultGUIMode))]" + parentanchor = right|vcenter + texture = "gfx/interface/skinned/hud_spike_big.dds" + size = { 25 15 } + + using = Animation_ShowHide_Standard + } + } + + vbox = { + widget_hud_main_tab = { + name = "tab_court_tutorial_uses_this" + + blockoverride "maintab_button" + { + texture = "gfx/interface/skinned/hud_maintab/maintab_court.dds" + + onclick = "[ToggleGameViewData( 'court_window', GetPlayer.GetID )]" + shortcut = "court_window" + tooltip = "COURT_BUTTON" + down = "[IsGameViewOpen( 'court_window' )]" + } + } + + widget_hud_main_tab = { + name = "tab_intrigue" #tutorial uses this + + blockoverride "maintab_button" + { + texture = "gfx/interface/skinned/hud_maintab/maintab_intrigue.dds" + + onclick = "[ToggleGameViewData('intrigue_window', GetPlayer.GetID)]" + shortcut = "intrigue_window" + tooltip = "INTRIGUE_BUTTON" + down = "[IsGameViewOpen('intrigue_window')]" + } + + } + + widget_hud_main_tab = { + name = "tab_factions" #tutorial uses this + visible = "[Or( Or( GetPlayer.IsInAFaction, GetPlayer.IsLandedRuler ), GetPlayer.HasLiege)]" + + blockoverride "maintab_button" + { + texture = "gfx/interface/skinned/hud_maintab/maintab_factions.dds" + + onclick = "[ToggleGameView('factions_window')]" + shortcut = "factions_window" + tooltip = "FACTION_BUTTON" + down = "[IsGameViewOpen('factions_window')]" + } + } + } + + widget = { + layoutpolicy_horizontal = expanding + size = { 0 15 } + + icon = { + visible = "[And( Not( IsPauseMenuShown ), And(Or(Not(IsObserver), GetPlayer.IsValid), IsDefaultGUIMode))]" + parentanchor = right|vcenter + texture = "gfx/interface/skinned/hud_spike_big.dds" + size = { 25 15 } + + using = Animation_ShowHide_Standard + } + } + + vbox = { + widget_hud_main_tab = { + name = "tab_decisions" #tutorial uses this + visible = "[Not(GetPlayer.GetGovernment.IsType( 'landless_adventurer_government' ))]" + + blockoverride "maintab_button" + { + texture = "gfx/interface/skinned/hud_maintab/maintab_decisions.dds" + + onclick = "[ToggleGameView('decisions')]" + shortcut = "decision_window" + tooltip = "DECISIONS_BUTTON" + down = "[IsGameViewOpen('decisions')]" + } + } + + widget_hud_main_tab = { + name = "tab_contracts" + visible = "[GetPlayer.GetGovernment.IsType( 'landless_adventurer_government' )]" + + blockoverride "maintab_button" + { + texture = "gfx/interface/skinned/hud_maintab/maintab_contracts.dds" + + onclick = "[ToggleGameView('decisions')]" + shortcut = "decision_window" + tooltip = "DECISIONS_BUTTON" + down = "[IsGameViewOpen('decisions')]" + } + } + + widget_hud_main_tab = { + name = "tab_activities" #tutorial uses this + + blockoverride "maintab_button" + { + texture = "gfx/interface/skinned/hud_maintab/maintab_activities.dds" + + onclick = "[ToggleGameView('activity_list_window')]" + shortcut = "activity_list_window" + tooltip = "ACTIVITY_LIST_BUTTON" + down = "[IsGameViewOpen('activity_list_window')]" + } + } + + widget_hud_main_tab = { + name = "tab_situation" + + blockoverride "maintab_button" + { + texture = "gfx/interface/skinned/hud_maintab/maintab_situations.dds" + + onclick = "[ToggleGameView( 'situations' )]" + tooltip = "SITUATIONS_BUTTON" + shortcut = "situations" + down = "[IsGameViewOpen( 'situations' )]" + } + } + + widget_hud_main_tab = { + datacontext = "[GetPlayer]" + datacontext = "[AccessLocalPlayerCachedData]" + datacontext = "[LocalPlayerCachedData.AccessNewArtifacts]" + datacontext = "[LocalPlayerCachedData.AccessCourtEvents]" + datacontext = "[Character.GetCourtGrandeurData]" + visible = "[And(Character.HasRoyalCourt ,And(And( And( Not( IsPauseMenuShown ), And(Or(Not(IsObserver), GetPlayer.IsValid), IsDefaultGUIMode)), HasDlcFeature( 'court_room_view' )), Not( IsLandlessAdventurer( GetPlayer ) )))]" + allow_outside = yes + name = "royal_court_button_tutorial_uses_this" + + tooltipwidget = { + container_royal_court_tooltip = {} + } + + blockoverride "maintab_button" + { + texture = "gfx/interface/skinned/hud_maintab/maintab_courtview.dds" + onclick = "[Character.OpenRoyalCourtView( 'throne' )]" + + # Looping glow when you have unhandled court events or first get your royal court + using = Animation_Glow_Pulse + + glow = { + glow_radius = 8 + using = Glow_Standard + using = Color_Bright_Yellow + visible = "[Or( And( Character.HasRoyalCourt, Not( LocalPlayerCachedData.HasEverOpenedRoyalCourt ) ), GreaterThan_int32( LocalPlayerCourtEvents.GetNumberCourtEvents, '(int32)0' ) )]" + } + + # Pulse when you get a new pending court event + state = { + name = "pending_court_event_start" + next = "pending_court_event_a" + position_x = 0 + duration = 0.2 + size = { 45 45 } + using = Animation_Curve_Default + trigger_when = "[GreaterThan_int32( Character.GetNumPendingCourtEvents, '(int32)0' )]" + + start_sound = { + soundeffect = "event:/DLC/EP1/SFX/UI/Notifications/royal_court_event_available" + } + } + + state = { + name = "pending_court_event_a" + next = "pending_court_event_b" + position_x = -30 + duration = 0.45 + size = { 85 85 } + using = Animation_Curve_Default + } + + state = { + name = "pending_court_event_b" + position_x = 0 + duration = 0.25 + size = { 45 45 } + bezier = { 0.43 0 0.2 2.2 } + } + + flowcontainer = { + position = { -5 0 } + direction = vertical + ignoreinvisible = yes + visible = "[Character.HasRoyalCourt]" + datacontext = "[GetPlayer]" + + widget_royal_court_notification = { + visible = "[And( GreaterThanOrEqualTo_int32( CourtGrandeurData.GetCurrentLevel, CourtGrandeurData.GetMinimumExpectedLevel ), Or( GreaterThan_int32( LocalPlayerNewArtifacts.GetNumNewArtifactsOfCategory( 'court' ), '(int32)0' ), Or( GreaterThan_int32( LocalPlayerCourtEvents.GetNumberCourtEvents, '(int32)0' ), GreaterThan_int32( Character.GetNumPendingCourtEvents, '(int32)0' ) ) ) )]" + } + + widget_below_cgv_expectations = { + visible = "[LessThan_int32( CourtGrandeurData.GetCurrentLevel, CourtGrandeurData.GetMinimumExpectedLevel )]" + } + } + } + } + + widget_hud_main_tab = { + name = "tab_tax_jurisdiction" + datacontext = "[GetPlayer]" + enabled = "[Character.HasTaxSlots]" + visible = "[Or( GetPlayer.GetGovernment.IsType( 'clan_government' ), Character.HasTaxSlots )]" + + blockoverride "maintab_button" + { + texture = "gfx/interface/skinned/hud_maintab/maintab_tax_jurisdictions.dds" + + onclick = "[ToggleGameViewData('manage_tax_slots', GetPlayer.GetID)]" + down = "[IsGameViewOpen('manage_tax_slots')]" + + using = tooltip_ws + + tooltipwidget = { + tax_jurisdictions_button_tooltip = {} + } + + icon = { + size = { 100% 100% } + visible = "[GreaterThan_int32( GetPlayer.GetUnassignedVassalsCount, '(int32)0' )]" + texture = "gfx/interface/skinned/hud_maintab/maintab_tax_jurisdictions.dds" + + glow = { + glow_radius = 8 + using = Glow_Standard + using = Color_Red + } + state = { + name = a + next = b + alpha = 0.3 + trigger_on_create = yes + duration = 1.2 + using = Animation_Curve_Default + } + + state = { + name = b + next = a + alpha = 0.5 + duration = 0.6 + using = Animation_Curve_Default + } + } + + icon = { + visible = "[Or( Or( GreaterThan_int32( Character.GetUnassignedVassalsCount, '(int32)0' ), Not( Character.HasTaxSlots ) ), GreaterThan_int32( Character.GetUntaxedJurisdictionCount, '(int32)0' ) )]" + size = { 25 25 } + position = { -5 5} + texture = "gfx/interface/icons/symbols/icon_warning.dds" + + icon = { + size = { 100% 100% } + alwaystransparent = yes + texture = "gfx/interface/icons/symbols/icon_warning.dds" + + modify_texture = { + texture = "gfx/interface/icons/focuses/hud_icon_mask.dds" + blend_mode = alphamultiply + } + + modify_texture = { + texture = "gfx/interface/colors/red.dds" + blend_mode = colordodge + } + + state = { + name = a + next = b + alpha = 0 + trigger_on_create = yes + duration = 1.2 + using = Animation_Curve_Default + } + + state = { + name = b + next = a + alpha = 0.8 + duration = 0.6 + using = Animation_Curve_Default + } + } + } + } + } + } + } + + # Invisible button to ensure that these shortcuts don't get hidden + button = { + size = { 0 0 } + onclick = "[ToggleGameViewData( 'character', GetPlayer.GetID )]" + shortcut = "character_window" + } + + # widget = { + # datacontext = "[GetPlayer]" + # datacontext = "[AccessLocalPlayerCachedData]" + # datacontext = "[LocalPlayerCachedData.AccessNewArtifacts]" + # datacontext = "[LocalPlayerCachedData.AccessCourtEvents]" + # datacontext = "[Character.GetCourtGrandeurData]" + # visible = "[And( And( Not( IsPauseMenuShown ), And(Or(Not(IsObserver), GetPlayer.IsValid), IsDefaultGUIMode)), HasDlcFeature( 'royal_court' ))]" + # enabled = "[Character.HasRoyalCourt]" + + # parentanchor = bottom + # position = { 4 50 } + # size = { 45 45 } + + # icon = { + # name = "royal_court_button_background" + # visible = "[Not(IsRightWindowOpen)]" + # size = { 45 45 } + # texture = "gfx/interface/buttons/maintab_courtview_bg.dds" + + # allow_outside = yes + + # state = { + # name = _show + # alpha = 1 + # duration = 0.1 + # using = Animation_Curve_Default + # } + + # state = { + # name = _hide + # duration = 0.6 + # alpha = 0 + # using = Animation_Curve_Default + # } + + # state = { + # name = "hud_tab_glow_courtview_enter" + # duration = 0.03 + # using = Animation_Curve_Default + + # modify_texture = { + # name = "glow_courtview" + # alpha = 1 + # } + # } + + # state = { + # name = "hud_tab_glow_courtview_leave" + # duration = 0.1 + # using = Animation_Curve_Default + + # modify_texture = { + # name = "glow_courtview" + # alpha = 0 + # } + # } + + # modify_texture = { + # name = "glow_courtview" + # texture = "gfx/interface/buttons/maintab_courtview_bg_glow.dds" + # alpha = 0 + # } + # } + + # widget_hud_main_tab = { + # allow_outside = yes + # name = "royal_court_button_tutorial_uses_this" + + # tooltipwidget = { + # container_royal_court_tooltip = {} + # } + + # state = { + # name = _mouse_hierarchy_enter + # on_start = "[PdxGuiInterruptThenTriggerAllAnimations('hud_tab_glow_courtview_leave','hud_tab_glow_courtview_enter')]" + # alpha = 1 + # } + + # state = { + # name = _mouse_hierarchy_leave + # on_start = "[PdxGuiInterruptThenTriggerAllAnimations('hud_tab_glow_courtview_enter','hud_tab_glow_courtview_leave')]" + # alpha = 1 + # } + + # blockoverride "maintab_button" + # { + # texture = "gfx/interface/buttons/maintab_courtview.dds" + # onclick = "[Character.OpenRoyalCourtView( 'throne' )]" + + # # Looping glow when you have unhandled court events or first get your royal court + # using = Animation_Glow_Pulse + + # glow = { + # glow_radius = 8 + # using = Glow_Standard + # using = Color_Bright_Yellow + # visible = "[Or( And( Character.HasRoyalCourt, Not( LocalPlayerCachedData.HasEverOpenedRoyalCourt ) ), GreaterThan_int32( LocalPlayerCourtEvents.GetNumberCourtEvents, '(int32)0' ) )]" + # } + + # # Pulse when you get a new pending court event + # state = { + # name = "pending_court_event_start" + # next = "pending_court_event_a" + # position_x = 0 + # duration = 0.2 + # size = { 45 45 } + # using = Animation_Curve_Default + # trigger_when = "[GreaterThan_int32( Character.GetNumPendingCourtEvents, '(int32)0' )]" + + # start_sound = { + # soundeffect = "event:/DLC/EP1/SFX/UI/Notifications/royal_court_event_available" + # } + # } + + # state = { + # name = "pending_court_event_a" + # next = "pending_court_event_b" + # position_x = -30 + # duration = 0.45 + # size = { 85 85 } + # using = Animation_Curve_Default + # } + + # state = { + # name = "pending_court_event_b" + # position_x = 0 + # duration = 0.25 + # size = { 45 45 } + # bezier = { 0.43 0 0.2 2.2 } + # } + + # flowcontainer = { + # position = { 0 6 } + # parentanchor = bottom|hcenter + # widgetanchor = center + # direction = vertical + # ignoreinvisible = yes + # visible = "[Character.HasRoyalCourt]" + # datacontext = "[GetPlayer]" + + # widget_royal_court_notification = { + # visible = "[And( GreaterThanOrEqualTo_int32( CourtGrandeurData.GetCurrentLevel, CourtGrandeurData.GetMinimumExpectedLevel ), Or( GreaterThan_int32( LocalPlayerNewArtifacts.GetNumNewArtifactsOfCategory( 'court' ), '(int32)0' ), Or( GreaterThan_int32( LocalPlayerCourtEvents.GetNumberCourtEvents, '(int32)0' ), GreaterThan_int32( Character.GetNumPendingCourtEvents, '(int32)0' ) ) ) )]" + # } + + # widget_below_cgv_expectations = { + # visible = "[LessThan_int32( CourtGrandeurData.GetCurrentLevel, CourtGrandeurData.GetMinimumExpectedLevel )]" + # } + # } + # } + # } + # } + } + + widget_stress_sounds = {} +} + +### Time Controls +icon = { + name = "timeline_widget" + visible = "[And(And( Not(IsGameViewOpen('barbershop')), And( And( Not( IsPauseMenuShown ), TimelineWidget.ShouldBeVisible ), Not(GetVariableSystem.Exists('royal_court_screenshot_window')))), Not( GreaterThan_CFixedPoint( GetPlayer.MakeScope.Var('hide_ui_timeline').GetValue, '(CFixedPoint)0' ) ))]" + size = { 649 65 } + parentanchor = bottom|right + filter_mouse = all + alwaystransparent = yes + layer = top + allow_outside = yes + texture = "gfx/interface/skinned/hud_bg_gamespeed.dds" + + using = Animation_ShowHide_Quick + + widget = { + parentanchor = bottom|right + size = { 629 45 } + allow_outside = yes + + icon = { + parentanchor = top|right + position = { 7 -15} + texture = "gfx/interface/skinned/component_decoration/decoration_arch.dds" + size = { 30 30 } + } + + icon = { + visible = "[IsManuallyPaused]" + size = { 100% 100% } + texture = "gfx/interface/skinned/hud_pause_indicator.dds" + color = { 0.4 0.25 0.25 0.7 } + + state = { + name = _show + using = Animation_FadeIn_Quick + } + + state = { + name = _hide + using = Animation_FadeOut_Standard + } + } + + icon = { + visible = "[IsPausedByEvent]" + size = { 100% 100% } + texture = "gfx/interface/skinned/hud_pause_indicator.dds" + color = { 0.3 0.3 0.3 0.7 } + + state = { + name = _show + using = Animation_FadeIn_Quick + } + + state = { + name = _hide + using = Animation_FadeOut_Standard + } + } + + hotkeys_HUD = {} + + ### Extra Buttons + flowcontainer = { + name = "extra_buttons_menu" + visible = "[And( Not( IsPauseMenuShown ), GetVariableSystem.Exists( 'extra_buttons_expand' ))]" + visible_at_creation = no + parentanchor = bottom|right + widgetanchor = bottom|hcenter + position = { -570 -20 } + alwaystransparent = no + margin = { 40 40 } + direction = vertical + spacing = 3 + ignoreinvisible = yes + allow_outside = yes + + background = { + using = Background_Area_Dark + margin = { -25 -25 } + } + + state = { + name = _show + using = Animation_FadeIn_Quick + + position_y = -20 + } + + state = { + name = _hide + + using = Animation_FadeOut_Quick + position_y = 60 + } + + state = { + name = _mouse_hierarchy_leave + on_finish = "[GetVariableSystem.Clear( 'extra_buttons_expand' )]" + } + + button_standard = { + name = "find_character_button" + text = "FIND_CHARACTER" + onclick = "[ToggleGameView( 'character_finder' )]" + onclick = "[GetVariableSystem.Toggle( 'extra_buttons_expand' )]" + tooltip = "IM_TT_FIND_CHARACTER" + shortcut = "character_finder" + } + + button_standard = { + name = "find_title_button" + + onclick = "[ToggleGameView( 'find_title' )]" + onclick = "[GetVariableSystem.Toggle( 'extra_buttons_expand' )]" + + down = "[IsGameViewOpen('find_title')]" + shortcut = "find_title_shortcut" + + text = "FIND_TITLE" + tooltip = "IM_TT_FIND_TITLE" + } + + button_standard = { + name = "plagues_button" + + onclick = "[ToggleGameView( 'epidemics' )]" + onclick = "[GetVariableSystem.Toggle( 'extra_buttons_expand' )]" + + down = "[IsGameViewOpen('epidemics')]" + shortcut = "explore_plagues" + + text = "EXPLORE_PLAGUES" + tooltip = "EXPLORE_PLAGUES_TT" + } + + button_standard = { + name = "legacy_button" + text = "SHOW_LEGACY" + onclick = "[ToggleGameViewData( 'lineage_view', GetPlayer.GetID )]" + down = "[IsGameViewOpen('succession_event')]" + onclick = "[GetVariableSystem.Toggle( 'extra_buttons_expand' )]" + tooltip = "IM_TT_SHOW_LEGACY" + } + + button_standard = { + name = "go_to_capital_button" + text = "GO_TO_CAPITAL" + onclick = "[OnGoToPlayerCapital]" + onclick = "[GetVariableSystem.Toggle( 'extra_buttons_expand' )]" + shortcut = "go_to_capital" + tooltip = "IM_TT_GO_TO_CAPITAL" + visible = "[GetPlayer.IsValid]" + } + + button_standard = { + name = "toggle_message_settings_button" + text = "MESSAGE_SETTINGS_WINDOW_NAME" + onclick = "[ToggleMessageSettings]" + onclick = "[GetVariableSystem.Toggle( 'extra_buttons_expand' )]" + tooltip = "MESSAGE_SETTINGS_WINDOW_TT" + } + + button_standard = { + name = "toggle_music_player_button" + text = "MUSIC_PLAYER_NAME" + onclick = "[ToggleMusicPlayer]" + tooltip = "MUSIC_PLAYER_OPEN_PLAYER_TT" + } + } + + hbox = { + margin_left = 35 + allow_outside = yes + + hbox = { + margin_top = 12 + spacing = 3 + + button_dots = { + name = "button_hud_extra_buttons" + onclick = "[GetVariableSystem.Toggle( 'extra_buttons_expand' )]" + tooltip = MORE_POPOUT_TT + using = tooltip_ne + } + + button_menu = { + name = "pause_menu_button" + onclick = "[OnPauseMenu]" + tooltip = INGAME_MENU_TT + using = tooltip_ne + + tooltipwidget = { + using = TooltipWithFakeShortcut + blockoverride "shortcut_text" + { + text = FAKE_ESCAPE + } + } + } + + button_encyclopedia_small = { + name = "encyclopedia_button_extended_menu" + tooltip = "OPEN_ENCYCLOPEDIA" + onclick = "[ToggleEncyclopedia]" + shortcut = "encyclopedia" + using = tooltip_ne + } + } + + hbox = { + name = "tutorial_highlight_bottom_right_bar" + layoutpolicy_horizontal = expanding + layoutpolicy_vertical = expanding + margin_right = 5 + margin_left = 15 + margin_top = 12 + allow_outside = yes + + ## Date + button_standard_hover = { + name = "play_pause_button_tutorial_uses_this" + + layoutpolicy_horizontal = expanding + layoutpolicy_vertical = expanding + + onclick = "[OnPause]" + + tooltip = "CURRENT_DATE_TOOLTIP" + using = tooltip_nw + tooltip_offset = { 0 10 } + + margin_widget = { + visible = "[Not(Or(IsPausedByEvent, IsManuallyPaused))]" + size = { 100% 100% } + + state = { + name = _show + using = Animation_FadeIn_Quick + } + + state = { + name = _hide + using = Animation_FadeOut_Standard + } + + Animation_HUD_daily_tick = { + visible = "[EqualTo_int32(GetCurrentGameSpeed, '(int32)1')]" + size = { 100% 100% } + + blockoverride "duration" + { + duration = 30 + } + + blockoverride "alpha" + { + alpha = 0.3 + } + } + + Animation_HUD_daily_tick = { + visible = "[EqualTo_int32(GetCurrentGameSpeed, '(int32)2')]" + size = { 100% 100% } + + blockoverride "duration" + { + duration = 15 + } + + blockoverride "alpha" + { + alpha = 0.25 + } + } + + Animation_HUD_daily_tick = { + visible = "[EqualTo_int32(GetCurrentGameSpeed, '(int32)3')]" + size = { 100% 100% } + + blockoverride "duration" + { + duration = 7.5 + } + + blockoverride "alpha" + { + alpha = 0.2 + } + } + + Animation_HUD_daily_tick = { + visible = "[EqualTo_int32(GetCurrentGameSpeed, '(int32)4')]" + size = { 100% 100% } + + blockoverride "duration" + { + duration = 3.75 + } + + blockoverride "alpha" + { + alpha = 0.15 + } + } + + Animation_HUD_daily_tick = { + visible = "[EqualTo_int32(GetCurrentGameSpeed, '(int32)5')]" + size = { 100% 100% } + + blockoverride "duration" + { + duration = 1.9 + } + + blockoverride "alpha" + { + alpha = 0.15 + } + } + } + + hbox = { + margin = { 5 0 } + margin_bottom = 2 + + hbox = { + layoutpolicy_horizontal = expanding + margin_top = 2 + margin_right = 2 + + expand = {} + + text_single = { + name = "date_text_sp" + visible = "[Not(GameHasMultiplePlayers)]" + layoutpolicy_horizontal = expanding + + text = "CURRENT_DATE" + default_format = "#date" + autoresize = no + align = right|nobaseline + using = Font_Size_Medium + } + + text_single = { + name = "date_text_mp" + visible = "[GameHasMultiplePlayers]" + layoutpolicy_horizontal = expanding + + text = "CURRENT_DATE" + default_format = "#medium;glow_color:{0.1,0.1,0.1,1}" + autoresize = no + align = right|nobaseline + using = Font_Size_Medium + } + } + + container = { + name = "pause_play_icons" + + button_pause = { + visible = "[Not(Or(IsPausedByEvent, IsManuallyPaused))]" + alwaystransparent = yes + parentanchor = center + } + + button_play = { + visible = "[Or(IsPausedByEvent, IsManuallyPaused)]" + alwaystransparent = yes + parentanchor = center + } + } + } + } + + button_normal = { + shortcut = "decrease_speed" + shortcut = "decrease_speed_2" + shortcut = "decrease_speed_3" + onclick = "[OnDecreaseGameSpeed]" + } + + button_normal = { + shortcut = "increase_speed" + shortcut = "increase_speed_2" + shortcut = "increase_speed_3" + onclick = "[OnIncreaseGameSpeed]" + } + + hbox = { + layoutpolicy_vertical = expanding + margin = { 0 -4 } + allow_outside = yes + + icon = { + name = "speed_indicator" + layoutpolicy_vertical = expanding + size = { 170 0 } + framesize = { 200 28 } + texture = "gfx/interface/hud/speed_indicator.dds" + frame = "[GetCurrentGameSpeed]" + tooltip = "CURRENT_SPEED_TOOLTIP" + tooltip_offset = { 0 -170 } + alpha = 0.8 + + modify_texture = { + visible = "[IsPausedByEvent]" + texture = "gfx/interface/hud/speed_indicator_auto_pause.dds" + spritetype = corneredtiled + blend_mode = darken + texture_density = 2 + } + + modify_texture = { + visible = "[And(IsManuallyPaused, Not(IsPausedByEvent))]" + texture = "gfx/interface/hud/speed_indicator_pause.dds" + spritetype = corneredtiled + blend_mode = darken + texture_density = 2 + } + + modify_texture = { + visible = "[Not(Or(IsPausedByEvent, IsManuallyPaused))]" + texture = "gfx/interface/hud/speed_indicator_play.dds" + spritetype = corneredtiled + blend_mode = darken + texture_density = 2 + } + + button = { + visible = "[Not( GameHasMultiplePlayers )]" + onclick = "[OnPause]" + shortcut = "pause" + } + + icon = { + parentanchor = right|vcenter + position = { 10 0 } + size = { 15 90%} + texture = "gfx/interface/skinned/overlay_stone.dds" + color = { 0.32 0.32 0.32 1 } + } + + icon = { + size = { 100% 100% } + texture = "gfx/interface/skinned/speed_indicator_frame.dds" + } + + hbox = { + margin_left = 6 + margin_right = 6 + + button = { + name = "speed_1" + shortcut = "speed_1" + layoutpolicy_horizontal = shrinking + layoutpolicy_vertical = expanding + size = { 34 18 } + + alwaystransparent = "[EqualTo_int32(GetCurrentGameSpeed, '(int32)1')]" + onclick = "[SetGameSpeed('(int32)0')]" + tooltip = "CHANGE_SPEED_TOOLTIP_1" + using = tooltip_ne + + alpha = 0 + + state = { + name = _mouse_enter + alpha = 1 + duration = 0.1 + using = Animation_Curve_Default + } + + state = { + name = _mouse_leave + alpha = 0 + duration = 0.1 + using = Animation_Curve_Default + } + + margin_widget = { + size = { 100% 100% } + margin = { 0 8 } + + icon = { + size = { 100% 100% } + texture = "gfx/interface/hud/speed_indicator_mouseover.dds" + } + } + } + + button = { + name = "speed_2" + shortcut = "speed_2" + layoutpolicy_horizontal = shrinking + layoutpolicy_vertical = expanding + size = { 34 18 } + + alwaystransparent = "[EqualTo_int32(GetCurrentGameSpeed, '(int32)2')]" + onclick = "[SetGameSpeed('(int32)1')]" + tooltip = "CHANGE_SPEED_TOOLTIP_2" + using = tooltip_ne + + alpha = 0 + + state = { + name = _mouse_enter + alpha = 1 + duration = 0.1 + using = Animation_Curve_Default + } + + state = { + name = _mouse_leave + alpha = 0 + duration = 0.1 + using = Animation_Curve_Default + } + + margin_widget = { + size = { 100% 100% } + margin = { 0 8 } + + icon = { + size = { 100% 100% } + texture = "gfx/interface/hud/speed_indicator_mouseover.dds" + } + } + } + + button = { + name = "speed_3" + shortcut = "speed_3" + layoutpolicy_horizontal = shrinking + layoutpolicy_vertical = expanding + size = { 34 18 } + + alwaystransparent = "[EqualTo_int32(GetCurrentGameSpeed, '(int32)3')]" + onclick = "[SetGameSpeed('(int32)2')]" + tooltip = "CHANGE_SPEED_TOOLTIP_3" + using = tooltip_ne + + alpha = 0 + + state = { + name = _mouse_enter + alpha = 1 + duration = 0.1 + using = Animation_Curve_Default + } + + state = { + name = _mouse_leave + alpha = 0 + duration = 0.1 + using = Animation_Curve_Default + } + + margin_widget = { + size = { 100% 100% } + margin = { 0 8 } + + icon = { + size = { 100% 100% } + texture = "gfx/interface/hud/speed_indicator_mouseover.dds" + } + } + } + + button = { + name = "speed_4" + shortcut = "speed_4" + layoutpolicy_horizontal = shrinking + layoutpolicy_vertical = expanding + size = { 34 18 } + + alwaystransparent = "[EqualTo_int32(GetCurrentGameSpeed, '(int32)4')]" + onclick = "[SetGameSpeed('(int32)3')]" + tooltip = "CHANGE_SPEED_TOOLTIP_4" + using = tooltip_ne + + alpha = 0 + + state = { + name = _mouse_enter + alpha = 1 + duration = 0.1 + using = Animation_Curve_Default + } + + state = { + name = _mouse_leave + alpha = 0 + duration = 0.1 + using = Animation_Curve_Default + } + + margin_widget = { + size = { 100% 100% } + margin = { 0 8 } + + icon = { + size = { 100% 100% } + texture = "gfx/interface/hud/speed_indicator_mouseover.dds" + } + } + } + + button = { + name = "speed_5" + shortcut = "speed_5" + layoutpolicy_horizontal = shrinking + layoutpolicy_vertical = expanding + size = { 34 18 } + + alwaystransparent = "[EqualTo_int32(GetCurrentGameSpeed, '(int32)5')]" + onclick = "[SetGameSpeed('(int32)4')]" + tooltip = "CHANGE_SPEED_TOOLTIP_5" + using = tooltip_ne + + alpha = 0 + + state = { + name = _mouse_enter + alpha = 1 + duration = 0.1 + using = Animation_Curve_Default + } + + state = { + name = _mouse_leave + alpha = 0 + duration = 0.1 + using = Animation_Curve_Default + } + + margin_widget = { + size = { 100% 100% } + margin = { 0 8 } + + icon = { + size = { 100% 100% } + texture = "gfx/interface/hud/speed_indicator_mouseover.dds" + } + } + } + } + } + } + } + + # Just the hotkeys for increase/decrease speed + container = { + name = "speed_hotkeys" + + button = { + name = "increase_speed" + size = { 0 0 } + + shortcut = "increase_speed" + shortcut = "increase_speed_2" + shortcut = "increase_speed_3" + onclick = "[OnIncreaseGameSpeed]" + oversound = "event:/SFX/UI/Generic/sfx_ui_generic_pointer_over" + clicksound = "event:/SFX/UI/Generic/sfx_ui_generic_increment" + } + + button = { + name = "decrease_speed" + size = { 0 0 } + + shortcut = "decrease_speed" + shortcut = "decrease_speed_2" + shortcut = "decrease_speed_3" + onclick = "[OnDecreaseGameSpeed]" + oversound = "event:/SFX/UI/Generic/sfx_ui_generic_pointer_over" + clicksound = "event:/SFX/UI/Generic/sfx_ui_generic_decrement" + } + } + + widget_gamespeed_sounds = {} + } + } +} + +### Bottom edge +widget = { + name = "bottom_bar" + visible = "[And( Not( IsPauseMenuShown ), IsDefaultGUIMode )]" + size = { 100% 100% } + layer = bottom + datacontext = "[GetPlayer]" + + using = Animation_ShowHide_Quick + + #### DYNAMIC BACKGROUND BEHIND THE CHARACTER PORTRAIT + widget = { + parentanchor = bottom|left + position = { -100 -100} + + hbox = { + visible = "[And(And(And( Not( IsGameViewOpen( 'barbershop' ) ), And( GetPlayer.IsValid, Not( GetVariableSystem.Exists( 'hide_bottom_left_HUD' ) ) ) ), Not( GreaterThan_CFixedPoint( GetPlayer.MakeScope.Var('hide_ui_character').GetValue, '(CFixedPoint)0' ) )), IsNomad( GetPlayer ))]" + layoutpolicy_horizontal = expanding + + spacer = { + visible = "[LessThanOrEqualTo_int32( InGameBottomBar.GetHudOptionalItemsCount, '(int32)1' )]" + size = { 364 1 } + } + + spacer = { + visible = "[EqualTo_int32( InGameBottomBar.GetHudOptionalItemsCount, '(int32)2' )]" + size = { 424 1 } + } + + spacer = { + visible = "[EqualTo_int32( InGameBottomBar.GetHudOptionalItemsCount, '(int32)3' )]" + size = { 484 1 } + } + + spacer = { + visible = "[EqualTo_int32( InGameBottomBar.GetHudOptionalItemsCount, '(int32)4' )]" + size = { 544 1 } + } + + spacer = { + visible = "[EqualTo_int32( InGameBottomBar.GetHudOptionalItemsCount, '(int32)5' )]" + size = { 604 1 } + } + + spacer = { + visible = "[GreaterThanOrEqualTo_int32( InGameBottomBar.GetHudOptionalItemsCount, '(int32)6' )]" + size = { 664 1 } + } + + icon = { + size = { 340 105 } + texture = "gfx/interface/hud/nomad_widget.dds" + } + } + } + + ### TGP WIDGET BACKGROUND + widget = { + visible = "[And(And( Not( IsGameViewOpen( 'barbershop' ) ), And( GetPlayer.IsValid, Not( GetVariableSystem.Exists( 'hide_bottom_left_HUD' ) ) ) ), Not( GreaterThan_CFixedPoint( GetPlayer.MakeScope.Var('hide_ui_bottom_left_bar').GetValue, '(CFixedPoint)0' ) ))]" + parentanchor = bottom|left + widgetanchor = bottom|left + position = { -6 0 } + size = { 548 116 } + + # BACKGROUND MERIT + DYNASTIC CYCLE + MOVEMENTS + icon = { + visible = "[And(InGameBottomBar.ShouldShowDynasticCycle, Character.ShouldShowMerit)]" + size = { 548 116 } + texture = "gfx/interface/hud/tgp_widget_background_big.dds" + } + + # BACKGROUND MERIT + DYNASTIC CYCLE + icon = { + visible = "[And(GetSituation('dynastic_cycle').GetTopParticipantGroupByKey('other_rulers').IsCharacterParticipant( Character.Self ), Character.ShouldShowMerit)]" + parentanchor = left + size = { 474 116 } + texture = "gfx/interface/hud/tgp_widget_background_medium.dds" + } + + # BACKGROUND ONLY MERIT WIDGET + icon = { + visible = "[And(Not( InGameBottomBar.ShouldShowDynasticCycle ), Character.ShouldShowMerit )]" + parentanchor = left + size = { 430 116 } + texture = "gfx/interface/hud/tgp_widget_background_small.dds" + } + + # BACKGROUND ONLY MOVEMENT + icon = { + visible = "[And(InGameBottomBar.ShouldShowDynasticCycle, Not(Character.ShouldShowMerit))]" + parentanchor = left + position = { -10 25 } + size = { 430 116 } + texture = "gfx/interface/hud/tgp_widget_background_small.dds" + } + } + + icon_hud_background_container = { + visible = "[And(And( Not( IsGameViewOpen( 'barbershop' ) ), And( GetPlayer.IsValid, Not( GetVariableSystem.Exists( 'hide_bottom_left_HUD' ) ) ) ), Not( GreaterThan_CFixedPoint( GetPlayer.MakeScope.Var('hide_ui_bottom_left_bar').GetValue, '(CFixedPoint)0' ) ))]" + parentanchor = bottom|left + ignoreinvisible = yes + } + ##### END OF BACKGROUND + + ### BOTTOM LEFT CHARACTER PORTRAIT + bottom_left_portrait = { + parentanchor = bottom|left + } + + ### TGP WIDGET + flowcontainer = { + visible = "[And(And( Not( IsGameViewOpen( 'barbershop' ) ), And( GetPlayer.IsValid, Not( GetVariableSystem.Exists( 'hide_bottom_left_HUD' ) ) ) ), Not( GreaterThan_CFixedPoint( GetPlayer.MakeScope.Var('hide_ui_bottom_left_bar').GetValue, '(CFixedPoint)0' ) ))]" + direction = horizontal + widgetanchor = bottom|left + parentanchor = bottom|left + position = { 269 -58 } + + allow_outside = yes + ignoreinvisible = yes + + widget_merit_hud = { + name = "merit_button_tutorial_uses_this" + datacontext = "[InGameBottomBar.GetMeritItem]" + parentanchor = vcenter + alwaystransparent = no + filter_mouse = all + size = { 74 94 } + + allow_outside = yes + } + + spacer = { + visible = "[Not(Character.ShouldShowMerit)]" + size = { 7 0 } + } + + widget = { + size = { 120 60 } + parentanchor = bottom + + allow_outside = yes + + flowcontainer = { + parentanchor = left|vcenter + position = { -5 0 } + spacing = 5 + + allow_outside = yes + ignoreinvisible = yes + + button_merit_pool_item = { + datacontext = "[InGameBottomBar.GetTopAdminMeritPool]" + visible = "[Character.ShouldShowMerit]" + allow_outside = yes + + blockoverride "button_onclick" + { + onclick = "[OpenGameViewData( 'government_administration', Character.Self)]" + } + + blockoverride "default_format" {} + } + + button_situation_group_banner = { + datacontext = "[InGameBottomBar.GetDynasticCycle]" + datacontext = "[InGameBottomBar.GetDynasticCycleGroup]" + datacontext = "[SituationParticipantGroup.GetType]" + visible = "[InGameBottomBar.ShouldShowDynasticCycle]" + + allow_outside = yes + } + } + } + } + + ## Bottom left tabs + left_edge_tabs = { + parentanchor = bottom|left + position = { -3 -100 } + } + + ## Bottom left CoA + coa_realm_medium_crown = { + visible = "[And(And(Not(IsGameViewOpen('barbershop')), And(And(IsDefaultGUIMode, GetPlayer.IsRuler), Not(GetVariableSystem.Exists( 'hide_ui_coa_bottom_left')))), Not( GreaterThan_CFixedPoint( GetPlayer.MakeScope.Var('hide_ui_character_model').GetValue, '(CFixedPoint)0' ) ))]" + visible_at_creation = no + parentanchor = bottom|left + + state = { + name = _show + using = Animation_Curve_Default + duration = 0.25 + + position = { 0 0 } + alpha = 1 + } + + state = { + name = _hide + using = Animation_Curve_Default + duration = 0.25 + + position = { 0 50 } + alpha = 0 + } + + blockoverride "coa_button" + { + tooltip = "[GetPlayer.GetDefaultRealmFlagTooltipPrimaryTitleClickInfo]" + onclick = "[DefaultOnCoatOfArmsClick(GetPlayer.GetPrimaryTitle.GetID)]" + } + } + + ### Legitimacy, Lifestyle, etc + bottom_left_button_row = { + parentanchor = bottom|left + position = { 66 0 } + } + + ### Regular position + bottom_left_temporary_statuses = { + visible = "[Not( Or( InGameBottomBar.ShouldShowDynasticCycle, Character.ShouldShowMerit ) )]" + parentanchor = bottom|left + position = { 270 -62 } + } + + ### Positioned higher when you have the celestial widget + bottom_left_temporary_statuses = { + visible = "[Or( InGameBottomBar.ShouldShowDynasticCycle, Character.ShouldShowMerit )]" + parentanchor = bottom|left + position = { 277 -160 } + } + + ###################################################### + ######### MAPMODES AND WARS AND INSPIRATIONS ######### + ###################################################### + + map_modes_debug = { + visible = "[And( InDebugMode, And( Not( GetVariableSystem.Exists( 'mapmodes_expand' ) ), And(IsDefaultGUIMode, Not(IsRightWindowOpen))))]" + visible_at_creation = no + parentanchor = bottom|right + position = { 0 -230 } + + filter_mouse = all + alwaystransparent = no + scale = 0.9 + } + + widget = { # Inspiration Details + visible = "[And( InGameBottomBar.HasSelectedInspiration, And( IsDefaultGUIMode, Not( IsRightWindowOpen ) ) )]" + visible_at_creation = no + datacontext = "[InGameBottomBar.GetSelectedInspiration]" + datacontext = "[Inspiration.GetOwner]" + + parentanchor = bottom|right + position = { -200 -150 } + using = Window_Background_Subwindow + + alwaystransparent = no + filter_mouse = all + + state = { + name = _show + using = Animation_FadeIn_Quick + using = Sound_WindowShow_Standard + } + + state = { + name = _hide + using = Animation_FadeOut_Quick + using = Sound_WindowHide_Standard + } + + vbox = { + name = "selected_inspiration" + set_parent_size_to_minimum = yes + margin = { 4 4 } + margin_bottom = 20 + spacing = 5 + + vbox = { + layoutpolicy_horizontal = expanding + + header_pattern = { + layoutpolicy_horizontal = expanding + + blockoverride "header_text" + { + text = "SELECTED_INSPIRATION_HEADER" + } + + blockoverride "button_close" + { + onclick = "[InGameBottomBar.ClearSelectedInspiration]" + } + + blockoverride "button_back" + { + visible = no + } + } + } + + hbox = { + name = "selected_inspiration_data" + layoutpolicy_horizontal = expanding + layoutpolicy_vertical = expanding + margin_left = 20 + + + background = { + using = Background_Area + layoutpolicy_horizontal = expanding + margin_top = 14 + } + + portrait_shoulders = { + name = "inspiration_owner_portrait" + + blockoverride "inspiration_status_icons" + { + } + } + + vbox = { + name = "text" + layoutpolicy_horizontal = expanding + margin_left = 10 + margin_bottom = 10 + margin_top = -14 + + text_multi = { + name = "inspiration_text" + min_width = 300 + max_width = 300 + autoresize = yes + text = "SELECTED_INSPIRATION_TEXT" + margin_right = 10 + margin_top = 4 + } + + spacer = { + size = { 0 6 } + } + + hbox = { + name = "recuirt_owner" + layoutpolicy_horizontal = expanding + spacing = 5 + + text_single = { + text = "[Character.GetRelationToString( GetPlayer )]" + tooltip = "EXTENDED_RELATIONS_TOOLTIP" + } + + button_recruit_character = {} + + warning_icon = { + name = "wants_to_leave" + visible = "[And( Character.CourtierWantsToLeaveCourt, Not( Character.IsImprisoned))]" + size = { 20 20 } + tooltip = "[Character.GetCourtierLeaveDescription]" + } + + expand = {} + } + + text_single = { + name = "gold_invested" + text = INSPIRATION_INVESTED_GOLD + layoutpolicy_horizontal = expanding + visible = "[Inspiration.GetSponsor.IsLocalPlayer]" + } + } + } + + + hbox = { + layoutpolicy_horizontal = expanding + margin_top = 4 + + button_primary = { + name = "sponsor_inspiration" + text = START_SPONSOR_INSPIRATION + visible = "[Not( Inspiration.GetSponsor.IsValid )]" + + enabled = "[Character.IsPlayerInteractionValid( 'fund_inspiration_interaction' )]" + onclick = "[Character.OpenPlayerInteraction( 'fund_inspiration_interaction' )]" + tooltip = "[Character.GetPlayerInteractionTooltip( 'fund_inspiration_interaction' )]" + } + } + + vbox = { + name = "inspiration_progress" + layoutpolicy_horizontal = expanding + layoutpolicy_vertical = expanding + margin_bottom = -8 + margin_top = -10 + spacing = 5 + + visible = "[Inspiration.GetSponsor.IsValid]" + + text_single = { + text = INSPIRATION_IN_PROGRESS + } + + progressbar_segmented_chance = { + name = "progress_bar" + tooltip = "INSPIRATION_ITEM_PROGRESS_TOOLTIP" + datamodel = "[GetSegmentedProgressChanceBar( GetDefine( 'NInspiration', 'MAX_PROGRESS' ), GetDefine( 'NInspiration', 'PROGRESS_FRAMES' ), Inspiration.GetProgress, Inspiration.GetProgressChance )]" + } + + text_single = { + text = INSPIRATION_ESTIMATED_REMAINING + tooltip = INSPIRATION_ESTIMATED_TIME_TOOLTIP + } + + expand = { + layoutpolicy_vertical = expanding + } + } + } + } + + ### Ongoing longer term objects and map modes + # eg: Wars, Schemes, Inspirations + flowcontainer = { + visible = "[And(And(IsDefaultGUIMode, Not(IsRightWindowOpen)), Not( GreaterThan_CFixedPoint( GetPlayer.MakeScope.Var('hide_ui_bottom_right_temporary_statuses').GetValue, '(CFixedPoint)0' ) ))]" + + parentanchor = bottom|right + widgetanchor = top|right + position = { 0 -175 } + alwaystransparent = yes + ignoreinvisible = yes + filter_mouse = all + allow_outside = yes + spacing = 30 + + state = { + name = _show + using = Animation_FadeIn_Quick + } + + state = { + name = _hide + using = Animation_FadeOut_Quick + } + + # In progress systems + flowcontainer = { + name = "in_progress_systems" + ignoreinvisible = yes + margin_top = 15 + visible = "[Not(IsGameViewOpen('barbershop'))]" + + + ### Raise/Disband armies ### + + container = { + visible = "[Not(GetPlayer.HasActiveCompanionAISetting('raise_armies'))]" + ignoreinvisible = yes + parentanchor = vcenter + + button_raise_disband_armies = { + name = "tutorial_highlight_raise_troops" + visible = "[And( Character.IsAtWar, Not(Character.HasRaisedRegiments))]" + visible_at_creation = no + + enabled = "[PlayerCanRaiseAnyRallyPoint]" + onclick = "[PlayerRaiseAllRegiments]" + onrightclick = "[PlayerRaiseAllRegimentsAtLocation]" + button_ignore = none + + clicksound = "event:/SFX/UI/Unit/Army/sfx_ui_raise_army" + + onclick = "[PdxGuiTriggerAllAnimations('button_army')]" + + tooltip = "[GetPlayerRaiseAllTooltip]" + + animation_aggressive = {} + } + + button_raise_disband_armies = { + visible = "[PlayerShouldDisbandAll]" + visible_at_creation = no + + onclick = "[PlayerDisbandAll]" + enabled = "[PlayerCanDisbandAll]" + clicksound = "event:/SFX/UI/Unit/Army/sfx_ui_unit_army_disband" + + blockoverride "text" { + text = "DISBAND_ALL" + } + + tooltip = "[GetDisbandAllTooltip]" + } + } + + + ### Inspirations ### + flowcontainer = { + name = "player_inspirations" + parentanchor = vcenter + spacing = 5 + margin = { 5 0 } + allow_outside = yes + + datamodel = "[GetPlayer.GetSponsoredInspirations]" + + item = { + button_normal = { + datacontext = "[Inspiration.GetOwner]" + size = { 60 60 } + tooltip = "TT_INSPIRATION_WIDGET" + using = tooltip_above + onclick = "[InGameBottomBar.ToggleSelectedInspiration( Inspiration.Self )]" + + icon_round_button_base = {} + + icon = { + visible = "[ObjectsEqual( InGameBottomBar.GetSelectedInspiration, Inspiration.Self )]" + texture = "gfx/interface/buttons/button_lifestyles_active_frame.dds" + size = { 100% 100% } + } + + icon = { + name = "progress_frame" + texture = "gfx/interface/progressbars/action_progress_frame.dds" + size = { 100% 100% } + parentanchor = center + alpha = 0.5 + } + + progresspie = { + name = "progress" + visible = "[And( Inspiration.GetSponsor.IsValid, Not( Inspiration.IsComplete ) )]" + + size = { 52 52 } + texture = "gfx/interface/progressbars/action_progress_thin.dds" + framesize = { 128 128 } + frame = 2 + + widgetanchor = center + parentanchor = center + + min = 0 + max = 100 + + value = "[Select_float( GreaterThan_int32( Inspiration.GetProgress, '(int32)0' ), CurrentAndMaxToProgressbarValueInt32( Inspiration.GetProgress, GetDefine( 'NInspiration', 'MAX_PROGRESS' ) ), '(float)2' )]" + } + + highlight_icon = { + texture = "[Inspiration.GetType.GetIcon]" + alwaystransparent = yes + size = { 40 40 } + position = { 1 1 } + parentanchor = center + } + } + } + } + + ### Schemes ### + flowcontainer = { + name = "player_schemes" + datamodel = "[InGameBottomBar.GetSchemes]" + parentanchor = vcenter + spacing = 10 + margin = { 5 0 } + allow_outside = yes + + item = { + button_normal = { + name = "tutorial_highlight_lifestyle_HUD_button" + onclick = "[BottomBarSchemeItem.OnClick]" + onrightclick = "[BottomBarSchemeItem.OnClick]" + onrightclick = "[PostCommand( BottomBarSchemeItem.TriggerSchemeHudClick )]" + button_ignore = none + datacontext = "[BottomBarSchemeItem.GetScheme]" + tooltip = "BOTTOMBAR_SCHEME_TOOLTIP" + size = { 90 112 } + + ### Scheme exposed animation + icon = { + visible = "[Scheme.IsExposed]" + parentanchor = center + position = { 0 0 } + size = { 120 135 } + texture = "gfx/interface/colors/white.dds" + using = Color_Red + + shaderfile = "gfx/FX/pdxgui_repeat_texture.shader" + + modify_texture = { + name = "clouds" + texture = "gfx/interface/component_masks/mask_clouds.dds" + blend_mode = alphamultiply + spriteType = corneredtiled + texture_density = 3 + } + + modify_texture = { + texture = "gfx/interface/component_masks/mask_glow.dds" + mirror = vertical + blend_mode = alphamultiply + } + + state = { + name = mask_a + next = mask_b + trigger_on_create = yes + + modify_texture = { + name = "clouds" + translate_uv = { 0 -1 } + } + } + + state = { + name = mask_b + next = mask_a + duration = 8 + + modify_texture = { + name = "clouds" + translate_uv = { 0 1 } + } + } + } + + # Glow pulse animation when you have an opportunity + icon = { + visible = "[GreaterThan_int32( Scheme.GetAgentCharges, '(int32)0' )]" + parentanchor = center + position = { 0 4 } + size = { 100 114 } + texture = "gfx/interface/window_scheme/scheme_hud_bg_glow.dds" + using = Color_Bright_Yellow + alpha = 0 + + modify_texture = { + texture = "gfx/interface/component_masks/mask_clouds.dds" + blend_mode = alphamultiply + alpha = 0.8 + } + + state = { + name = a + next = b + trigger_on_create = yes + + alpha = 0 + duration = 0 + scale = 1 + + using = Animation_Curve_Default + } + + state = { + name = b + next = c + + alpha = 1 + duration = 0.3 + scale = 1.07 + + using = Animation_Curve_Default + } + + state = { + name = c + next = d + alpha = 0 + duration = 0.5 + scale = 1.1 + + using = Animation_Curve_Default + } + + state = { + name = d + next = a + + alpha = 0 + duration = 0 + delay = 3 + scale = 1 + } + } + + highlight_icon = { + texture = "gfx/interface/window_scheme/scheme_hud_bg.dds" + size = { 100% 100% } + } + + # Pogressbar & frame + highlight_icon = { + name = "progress_frame" + texture = "gfx/interface/window_scheme/scheme_hud_bg_progress_frame.dds" + size = { 100% 100% } + parentanchor = center + alpha = 0.5 + } + + progresspie = { + name = "progress" + position = { 0.3 -2.5 } + size = { 76 76 } + texture = "gfx/interface/progressbars/action_progress_thin.dds" + framesize = { 128 128 } + frame = 2 + widgetanchor = center + parentanchor = center + value = "[Scheme.GetProgressBar]" + min = 0 + max = 1 + mirror = vertical|horizontal + } + + # Target + container = { + parentanchor = center + + # Character Target + container = { + datacontext = "[Scheme.GetTargetCharacter]" + visible = "[Character.IsValid]" + parentanchor = center + position = { 0 9 } + + portrait_scheme_hud = {} + } + + # Title Target + container = { + datacontext = "[Scheme.GetTargetTitle]" + visible = "[Title.IsValid]" + parentanchor = center + position = { 0 -12 } + + coa_title_tiny = { + tooltip_visible = no + alwaystransparent = yes + } + } + + # Faith Target + container = { + datacontext = "[Scheme.GetTargetFaith]" + visible = "[Faith.IsValid]" + parentanchor = center + position = { 0 -12 } + + icon = { + name = "faith_icon" + texture = "[Faith.GetIcon]" + size = { 40 40 } + } + } + + # Culture Target + container = { + datacontext = "[Scheme.GetTargetCulture]" + visible = "[Culture.IsValid]" + parentanchor = center + position = { 0 -12 } + + text_single = { + text = "HUD_GETCULTURE" + } + } + } + + # Scheme type icon & bg + widget = { + parentanchor = bottom|hcenter + position = { 0 -16 } + + highlight_icon = { + parentanchor = center + size = { 32 32 } + texture = "gfx/interface/window_scheme/scheme_hud_icon_bg.dds" + alwaystransparent = yes + } + + highlight_icon = { + texture = "[Scheme.GetSchemeType.GetIcon]" + size = { 30 30 } + alwaystransparent = yes + parentanchor = center + } + } + + # Scheme success chance + hbox = { + parentanchor = center + position = { 0 14 } + maximumsize = { 30 20 } + spacing = 2 + + background = { + using = Background_Area_Dark + } + + icon = { + name = success_icon + size = { 20 20 } + texture = "gfx/interface/icons/schemes/icon_scheme_success.dds" + } + + text_single = { + name = "success" + text = "SCHEME_WIDGET_SUCCESS_CHANCE" + align = nobaseline + fontsize = 13 # Smallest allowed fontsize + } + + icon = { + visible = "[Scheme.IsExposed]" + size = { 20 20 } + alwaystransparent = yes + texture = "gfx/interface/icons/schemes/icon_discovered_scheme.dds" + + tooltip = "INTRIGUE_WINDOW_AGENT_DISCOVERED_TT" + } + } + + # Opportunities + widget = { + visible = "[GreaterThan_int32( Scheme.GetAgentCharges, '(int32)0' )]" + parentanchor = top|right + position = { 5 8 } + size = { 45 22 } + alwaystransparent = yes + + background = { + using = Background_Area_Dark + margin_right = 10 + + modify_texture = { + texture = "gfx/interface/component_masks/mask_fade_horizontal_middle.dds" + blend_mode = alphamultiply + } + } + + flowcontainer = { + parentanchor = center + + icon = { + parentanchor = vcenter + size = { 20 20 } + texture = "gfx/interface/icons/schemes/icon_scheme_opportunity.dds" + } + + text_single = { + text = "[Scheme.GetAgentCharges]" + default_format = "#high" + max_width = 25 + align = nobaseline + } + } + } + + ### Countermeasure icon + widget = { + visible = "[And(Scheme.GetSchemeCountermeasureProtectingTarget.IsValid, Scheme.GetSchemeType.IsHostile)]" + datacontext = "[Scheme.GetSchemeCountermeasureProtectingTarget]" + parentanchor = top|left + position = { 0 2 } + size = { 30 30 } + + tooltip = "SCHEME_COUNTERMEASURE_PROTECTING_TARGET" + + background = { + using = Background_Area_ExtraDark + margin = { 2 2 } + + modify_texture = { + texture = "gfx/interface/component_masks/mask_circle.dds" + blend_mode = alphamultiply + } + } + + # The frame + icon = { + parentanchor = center + size = { 30 30 } + alwaystransparent = yes + + texture = "gfx/interface/icons/scheme_countermeasure_types/frame_purple.dds" + } + + icon = { + visible = "[SchemeCountermeasureType.IsValid]" + parentanchor = center + size = { 30 30 } + alwaystransparent = yes + + texture = "[SchemeCountermeasureType.GetIcon]" + } + } + } + } + } + + ### Task Contacts ### + flowcontainer = { + name = "task_contracts" + datamodel = "[GetPlayer.GetAcceptedTaskContracts]" + parentanchor = vcenter + ignoreinvisible = yes + + item = { + button_task_contract_banner = {} + } + } + + ### Epidemics in/near your realm ### + button_epidemics = { + name = "epidemics_hud" + parentanchor = vcenter + visible_at_creation = no + visible = "[Or( InGameBottomBar.HasGlobalNotificationEpidemic, Or( DataModelHasItems( InGameBottomBar.GetEpidemicsInRealm ), DataModelHasItems( InGameBottomBar.GetEpidemicsBorderingRealm ) ) )]" + } + + ### Wars ### + flowcontainer = { + name = "wars" + parentanchor = vcenter + ignoreinvisible = yes + + flowcontainer = { + name = "great_holy_wars" + parentanchor = vcenter + ignoreinvisible = yes + + flowcontainer = { + ignoreinvisible = yes + parentanchor = vcenter + + datamodel = "[GetPlayer.GetFaith.GetDefensiveGreatHolyWars]" + + item = { + button_ghw_banner = { + name = "defensive_ghw" + parentanchor = vcenter + + blockoverride "ghw_tooltip" + { + tooltip = "GHW_OPEN_TOOLTIP_DEFENDER" + using = tooltip_ne + } + } + } + } + + button_ghw_banner = { + name = "player_faith_ghw" + datacontext = "[GetPlayer.GetFaith.GetGreatHolyWar]" + visible = "[GetPlayer.GetFaith.HasOffensiveGreatHolyWar]" + visible_at_creation = no + parentanchor = vcenter + + blockoverride "ghw_tooltip" + { + tooltip = "GHW_OPEN_TOOLTIP_ATTACKER" + using = tooltip_ne + } + } + } + + flowcontainer = { + name = "raids_on_me" + datamodel = "[GetPlayer.GetHostileRaiders]" + parentanchor = vcenter + + item = { + button_raid_banner = { + parentanchor = vcenter + tooltip = "RAID_ON_ME_TOOLTIP" + } + } + } + + flowcontainer = { + name = "raids_by_me" + datamodel = "[GetPlayer.GetRaidTargets]" + parentanchor = vcenter + + item = { + button_raid_banner = { + parentanchor = vcenter + tooltip = "RAID_BY_ME_TOOLTIP" + } + } + } + + flowcontainer = { + name = "regular_wars" + datamodel = "[InGameBottomBar.GetWarItems]" + ignoreinvisible = yes + + item = { + button_war_banner = {} + } + } + } + + ### Situations & Struggles ### + flowcontainer = { + name = "hud_situations_tutorial_uses_this" + parentanchor = vcenter + ignoreinvisible = yes + + flowcontainer = { + name = "visible_situations" + parentanchor = vcenter + ignoreinvisible = yes + + datamodel = "[InGameBottomBar.GetVisibleSituations]" + + item = { + button_situation_banner = { + parentanchor = bottom + } + } + } + + flowcontainer = { + name = "visible_struggles" + parentanchor = vcenter + ignoreinvisible = yes + + datamodel = "[InGameBottomBar.GetVisibleStruggles]" + + item = { + button_struggle_banner = {} + } + } + + button_situation_banner = { + visible = "[InGameBottomBar.ShouldShowDynasticCycle]" + datacontext = "[InGameBottomBar.GetDynasticCycle]" + size = { 100 100 } + name = "dynastic_cycle_highlight" + + onclick = "[OpenGuiTab( 'dynastic_cycle_tabs', 'dynastic_cycle' )]" + + blockoverride "tooltipwidget" + { + tooltip = "DYNASTIC_CYCLE_OPEN_CYCLE_TT" + using = tooltip_ne + } + + blockoverride "glow_visible" + { + visible = no + } + + blockoverride "background_texture" + { + texture = "gfx/interface/hud/situation_background_dynastic_cycle.dds" + } + + blockoverride "icon_size" + { + size = { 56 56 } + position = { 0 1 } + } + + blockoverride "progress_pie_visibility" + { + visible = yes + } + + blockoverride "progresspie_size" + { + size = { 66 66 } + position = { 0 1 } + } + } + } + } + + ## Map Modes + map_modes = { + visible = "[Not(IsGameViewOpen('barbershop'))]" + filter_mouse = all + using = Animation_ShowHide_Quick + alwaystransparent = no + parentanchor = vcenter + + blockoverride "map_mode_tutorial" + { + widgetid = "map_mode_duchies_button" + } + } + } +} + +###################################################### +############# MESSAGES AND NOTIFICATIONS ############# +###################################################### + +### Message Feed +notifications_message_feed = { + position = { -10 -135 } + layer = bottom +} + +### Toasts +notifications_toasts = { + parentanchor = top|hcenter + layer = middle +} + +### Suggestions / Current Situation +notifications_suggestions = { + layer = hud_layer + + attachto = { + widgetid = "suggestions_placer" + } +} + +###################################################### +################ TYPES AND TEMPLATES ################# +###################################################### + + +types HUD +{ + + type icon_hud_background_container = container { + icon_hud_background = { + visible = "[LessThanOrEqualTo_int32( InGameBottomBar.GetHudOptionalItemsCount, '(int32)1' )]" + size = { 400 64 } + } + + icon_hud_background = { + visible = "[EqualTo_int32( InGameBottomBar.GetHudOptionalItemsCount, '(int32)2' )]" + size = { 460 64 } + } + + icon_hud_background = { + visible = "[EqualTo_int32( InGameBottomBar.GetHudOptionalItemsCount, '(int32)3' )]" + size = { 520 64 } + } + + icon_hud_background = { + visible = "[EqualTo_int32( InGameBottomBar.GetHudOptionalItemsCount, '(int32)4' )]" + size = { 580 64 } + } + + icon_hud_background = { + visible = "[EqualTo_int32( InGameBottomBar.GetHudOptionalItemsCount, '(int32)5' )]" + size = { 640 64 } + } + + icon_hud_background = { + visible = "[GreaterThanOrEqualTo_int32( InGameBottomBar.GetHudOptionalItemsCount, '(int32)6' )]" + size = { 700 64 } + } + + } + type bottom_left_temporary_statuses = flowcontainer { + name = "bottom_left_bar_temporary_statuses" + + datacontext = "[GetPlayer]" + datacontext = "[Character.GetInvolvedActivity]" + + visible = "[And( Not( IsPauseMenuShown ), And( And( IsDefaultGUIMode, Character.IsValid ), Not( GetVariableSystem.Exists( 'hide_bottom_left_HUD') ) ) )]" + visible_at_creation = no + + ignoreinvisible = yes + alwaystransparent = no + + flowcontainer = { + name = "involved_activity" + + visible = "[And( Activity.IsValid, Not( Activity.IsComplete ) )]" + visible_at_creation = no + + spacing = 8 + + activity_hud_button = { + name = "activity_button" + } + + button_hud_travel = { + name = "activity_travel_button" + datacontext = "[Character.GetTravelPlan]" + visible = "[Character.IsTraveling]" + parentanchor = "vcenter" + + text = "ACTIVITY_VIEW_TRAVEL" + tooltip = "[SelectLocalization(Character.GetTravelPlan.GetData.IsTravelWithDomicile, 'TT_TRAVELING_WITH_DOMICILE_WIDGET', 'TT_TRAVELING_GENERIC_WIDGET')]" + max_width = 160 + + onclick = "[ToggleGameViewData('travel_planner', TravelPlan.GetID)]" + onclick = "[Character.ZoomCameraTo]" + } + } + + button_normal = { + name = "traveling" + datacontext = "[Character.GetTravelPlan]" + + visible_at_creation = no + visible = "[And( Character.IsTraveling, Or( Not( Activity.IsValid ), Activity.IsComplete ) )]" + + size = { 60 60 } + + onclick = "[ToggleGameViewData('travel_planner', TravelPlan.GetID)]" + onclick = "[Character.ZoomCameraTo]" + + tooltip = "[SelectLocalization(Character.GetTravelPlan.GetData.IsTravelWithDomicile, 'TT_TRAVELING_WITH_DOMICILE_WIDGET', 'TT_TRAVELING_GENERIC_WIDGET')]" + using = tooltip_above + + icon_round_button_base = {} + + icon = { + name = "progress_frame" + texture = "gfx/interface/progressbars/action_progress_frame.dds" + size = { 100% 100% } + parentanchor = center + alpha = 0.5 + } + + progresspie = { + name = "progress" + size = { 50 50 } + texture = "gfx/interface/progressbars/action_progress_thin.dds" + framesize = { 128 128 } + frame = 2 + widgetanchor = center + parentanchor = center + value = "[TravelPlan.GetData.GetNextDestinationProgress]" + min = 0 + max = 1 + } + + highlight_icon = { + texture = "gfx/interface/icons/travel/icon_travel_hud_placeholder.dds" + alwaystransparent = yes + size = { 45 45 } + parentanchor = center + } + } + + button_normal = { + name = "away_from_capital" + + visible_at_creation = no + visible = "[And( Not( Character.IsTraveling ), And( Character.IsAwayFromHome, Or( Not( Activity.IsValid ), Activity.IsComplete ) ) )]" + + size = { 60 60 } + + onclick = "[Character.ZoomCameraTo]" + + tooltip = "TT_AWAY_FROM_HOME_WIDGET" + using = tooltip_above + + icon = { + texture = "gfx/interface/icons/activity_phases/button_activity_base.dds" + size = { 100% 100% } + } + + icon = { + texture = "gfx/interface/icons/character_interactions/request_camp_follower_interaction.dds" + alwaystransparent = yes + size = { 35 35 } + parentanchor = center + } + } + } + + + #### + # + # NOTE: If you add a button in here, you must update InGameBottomBar.GetHudOptionalItemsCount and use a code defined function for visibility + # Otherwise, the background (which is placed behind the player portrait) will not extend properly + # + #### + + + type bottom_left_button_row = flowcontainer { + name = "bottom_left_bar" + visible = "[And(And( Not(IsGameViewOpen('barbershop')), And( Not( IsPauseMenuShown ), And(And(IsDefaultGUIMode, GetPlayer.IsValid), Not(GetVariableSystem.Exists( 'hide_bottom_left_HUD'))))), Not( GreaterThan_CFixedPoint( GetPlayer.MakeScope.Var('hide_ui_bottom_left_bar').GetValue, '(CFixedPoint)0' ) ))]" + ignoreinvisible = yes + alwaystransparent = no + allow_outside = yes + spacing = 4 + + state = { + name = _show + using = Animation_Curve_Default + duration = 0.21 + + position = { 66 0 } + alpha = 1 + } + + state = { + name = _hide + using = Animation_Curve_Default + duration = 0.21 + + position = { 30 50 } + alpha = 0 + } + + button_normal = { + name = "legitimacy_button" + datacontext = "[Character.GetLegitimacyType]" + datacontext = "[Character.GetLegitimacyLevel]" + visible = "[InGameBottomBar.ShouldShowLegitimacyInHUD]" + parentanchor = vcenter + + using = tooltip_ne + + tooltipwidget = { + legitimacy_hud_tooltip = { + datacontext = "[InGameBottomBar.GetLegitimacyBar]" + } + } + + size = { 48 48 } + + icon = { + texture = "gfx/interface/icons/activity_phases/button_activity_base.dds" + size = { 100% 100% } + } + + icon = { + name = "progress_frame" + texture = "gfx/interface/progressbars/action_progress_frame.dds" + size = { 100% 100% } + #alpha = 0.5 + } + + icon = { + parentanchor = vcenter + position = { 6 0 } + size = { 36 36 } + + texture = "[Character.GetLegitimacyType.GetLevelsIcon]" + framesize = { 70 70 } + frame = "[IntToFrameIndex( LegitimacyLevel.GetIndex )]" + + modify_texture = { + name = "lvl_increase" + texture = "gfx/interface/colors/gold.dds" + blend_mode = colordodge + alpha = 0 + } + + modify_texture = { + name = "lvl_decrease" + texture = "gfx/interface/colors/red.dds" + blend_mode = colordodge + alpha = 0 + } + + state = { + name = "legitimacy_level_increase" + next = "legitimacy_level_increase_2" + + modify_texture = { + name = "lvl_increase" + alpha = 0 + } + } + + state = { + name = "legitimacy_level_increase_2" + next = "legitimacy_level_increase_3" + duration = 0.4 + bezier = { 0.5 0 1 0.5 } + + modify_texture = { + name = "lvl_increase" + alpha = 0.7 + } + } + + state = { + name = "legitimacy_level_increase_3" + duration = 0.5 + bezier = { 0 0.5 0.5 1 } + + modify_texture = { + name = "lvl_increase" + alpha = 0 + } + } + + state = { + name = "legitimacy_level_decrease" + next = "legitimacy_level_decrease_2" + + modify_texture = { + name = "lvl_decrease" + alpha = 0 + } + } + + state = { + name = "legitimacy_level_decrease_2" + next = "legitimacy_level_decrease_3" + duration = 0.4 + bezier = { 0.5 0 1 0.5 } + + modify_texture = { + name = "lvl_decrease" + alpha = 0.7 + } + } + + state = { + name = "legitimacy_level_decrease_3" + duration = 0.5 + bezier = { 0 0.5 0.5 1 } + + modify_texture = { + name = "lvl_decrease" + alpha = 0 + } + } + } + + progresspie = { + name = "progress" + size = { 42 42 } + + texture = "gfx/interface/progressbars/action_progress_thin_blue.dds" + framesize = { 128 128 } + frame = 2 + value = "[InGameBottomBar.GetLegitimacyProgress]" + parentanchor = center + + modify_texture = { + texture = "gfx/interface/colors/blue.dds" + blend_mode = normal + } + } + } + + widget = { + name = "stress_widget" + size = { 110 55 } + alwaystransparent = no + filter_mouse = all + + widget = { + parentanchor = center + size = { 180 108 } + + tooltip = "PLAYER_STRESS_TOOLTIP" + using = tooltip_ne + + widget = { + name = "progressbar" + parentanchor = center + widgetanchor = left|vcenter + position = { -13 0 } + size = { 60 20 } + + background = { + texture = "gfx/interface/colors/white.dds" + color = { 0.1 0.1 0.1 0.8 } + } + + icon = { + visible = "[EqualTo_int32(GetPlayer.GetStressLevel, '(int32)2')]" + size = { 100% 100% } + texture = "gfx/interface/colors/white.dds" + color = { 1 0.1 0.1 0.2 } + + using = Animation_ShowHide_Standard + + state = { + name = a + next = b + trigger_on_create = yes + + using = Animation_Curve_Default + duration = 0.8 + alpha = 0 + } + + state = { + name = b + next = a + + using = Animation_Curve_Default + duration = 1.5 + alpha = 1 + } + } + + hbox = { + widget = { + layoutpolicy_horizontal = expanding + layoutpolicy_vertical = expanding + layoutstretchfactor_horizontal = "[GetProgressBarValueMaxScaled( GetPlayer.GetStressProgress, '(float)100', '(int32)60' )]" + + progressbar_hud_stress = { + visible = "[GreaterThanOrEqualTo_int32(GetPlayer.GetStressLevel, '(int32)3')]" + visible_at_creation = no + size = { 100% 100% } + + using = Animation_ShowHide_Standard + + blockoverride "bar_color" + { + texture = "gfx/interface/colors/red.dds" + } + + blockoverride "bar_color_flow" + { + texture = "gfx/interface/colors/gold.dds" + alpha = 0.7 + } + } + + progressbar_hud_stress = { + visible = "[EqualTo_int32(GetPlayer.GetStressLevel, '(int32)2')]" + visible_at_creation = no + size = { 100% 100% } + + using = Animation_ShowHide_Standard + + blockoverride "bar_color" + { + texture = "gfx/interface/colors/orange.dds" + } + + blockoverride "bar_color_flow" + { + texture = "gfx/interface/colors/white.dds" + alpha = 0.3 + } + } + + progressbar_hud_stress = { + visible = "[EqualTo_int32(GetPlayer.GetStressLevel, '(int32)1')]" + visible_at_creation = no + size = { 100% 100% } + + using = Animation_ShowHide_Standard + + blockoverride "bar_color" + { + texture = "gfx/interface/colors/gold_darker.dds" + } + + blockoverride "bar_color_flow" + { + texture = "gfx/interface/colors/white.dds" + alpha = 0.3 + } + } + + progressbar_hud_stress = { + visible = "[EqualTo_int32(GetPlayer.GetStressLevel, '(int32)0')]" + size = { 100% 100% } + + using = Animation_ShowHide_Standard + + blockoverride "bar_color" + { + texture = "gfx/interface/colors/blue.dds" + } + + blockoverride "bar_color_flow" + { + texture = "gfx/interface/colors/white.dds" + alpha = 0.3 + } + } + } + + widget = { + layoutpolicy_horizontal = expanding + layoutpolicy_vertical = expanding + layoutstretchfactor_horizontal = "[GetProgressBarValueMaxOtherScaled( GetPlayer.GetStressProgress, '(float)100', '(int32)60' )]" + } + } + } + + widget = { + size = { 100% 100% } + + progressbar_hud_stress_glow = { + texture = "gfx/interface/hud/hud_stress_glow_red.dds" + + blockoverride "animation_trigger_1" + { + name = "stress_level_increase" + } + + blockoverride "animation_trigger_2" + { + name = "stress_increase" + } + } + + progressbar_hud_stress_glow = { + texture = "gfx/interface/hud/hud_stress_glow_blue.dds" + + blockoverride "animation_trigger_1" { + name = "stress_level_decrease" + } + + blockoverride "animation_trigger_2" + { + name = "stress_decrease" + } + } + + progressbar_hud_stress_glow = { + visible = "[EqualTo_int32(GetPlayer.GetStressLevel, '(int32)3')]" + texture = "gfx/interface/hud/hud_stress_glow_red.dds" + + blockoverride "animation_trigger_1" { + name = "lvl3_fire" + trigger_on_create = yes + } + + blockoverride "animation_trigger_2" {} + blockoverride "lvl_3" {} + } + + icon = { + parentanchor = center + position = { -30 0 } + size = { 30 30 } + texture = "gfx/interface/colors/white.dds" + using = Color_Red + + + modify_texture = { + name = "mask_1" + texture = "gfx/interface/component_masks/mask_glow.dds" + blend_mode = alphamultiply + rotate_uv = 1 + } + + modify_texture = { + name = "mask_2" + texture = "gfx/interface/component_masks/mask_glow.dds" + blend_mode = alphamultiply + rotate_uv = -1 + } + + modify_texture = { + name = "mask_3" + texture = "gfx/interface/component_masks/mask_clouds.dds" + blend_mode = alphamultiply + alpha = 0.1 + } + + modify_texture = { + name = "mask_4" + texture = "gfx/interface/component_masks/mask_circle.dds" + blend_mode = mask + } + + modify_texture = { + name = "mask_3" + texture = "gfx/interface/colors/gold.dds" + blend_mode = add + } + + state = { + name = "stress_level_increase" + next = b + + using = Animation_Curve_Default + scale = 1 + alpha = 0 + } + + state = { + name = b + next = c + + duration = 0.6 + bezier = { 0.5 0 1 0.5 } + + scale = 5 + alpha = 0.7 + } + + state = { + name = c + duration = 0.3 + alpha = 0 + scale = 6 + } + + state = { + name = rotate_a + next = rotate_b + trigger_on_create = yes + + modify_texture = { + name = "mask_1" + rotate_uv = 1 + } + } + + state = { + name = rotate_a + next = rotate_b + + duration = 1 + + modify_texture = { + name = "mask_1" + rotate_uv = 180 + } + } + + state = { + name = rotate_a_2 + next = rotate_b_2 + trigger_on_create = yes + + modify_texture = { + name = "mask_2" + rotate_uv = -1 + } + } + + state = { + name = rotate_a_2 + next = rotate_b_2 + + duration = 1 + + modify_texture = { + name = "mask_2" + rotate_uv = -180 + } + } + + state = { + name = rotate_a_3 + next = rotate_b_3 + trigger_on_create = yes + + modify_texture = { + name = "mask_3" + rotate_uv = 0 + alpha = 0.1 + } + } + + state = { + name = rotate_a_3 + next = rotate_b_3 + + duration = 1 + + modify_texture = { + name = "mask_3" + rotate_uv = 40 + alpha = 0.8 + } + } + } + + icon = { + size = { 100% 100% } + texture = "gfx/interface/skinned/hud_stress_bg.dds" + + icon = { + parentanchor = vcenter + position = { 41 0 } + size = { 35 35 } + + texture = "gfx/interface/icons/stress/icon_stress_level.dds" + framesize = { 70 70 } + frame = "[IntToFrameIndex( GetPlayer.GetStressLevel )]" + + modify_texture = { + visible = "[GreaterThanOrEqualTo_int32(GetPlayer.GetStressLevel, '(int32)2')]" + name = "lvl3_glow" + texture = "gfx/interface/colors/gold.dds" + blend_mode = colordodge + alpha = 0 + } + + modify_texture = { + name = "lvl_increase" + texture = "gfx/interface/colors/gold.dds" + blend_mode = colordodge + alpha = 0 + } + + state = { + name = a + next = b + duration = 0.6 + trigger_on_create = yes + using = Animation_Curve_Default + + modify_texture = { + name = "lvl3_glow" + alpha = 0.3 + } + } + + state = { + name = b + next = a + duration = 1.5 + using = Animation_Curve_Default + + modify_texture = { + name = "lvl3_glow" + alpha = 0 + } + } + + state = { + name = "stress_level_increase" + next = "stress_level_increase_2" + + modify_texture = { + name = "lvl_increase" + alpha = 0 + } + } + + state = { + name = "stress_level_increase_2" + next = "stress_level_increase_3" + duration = 0.4 + bezier = { 0.5 0 1 0.5 } + + modify_texture = { + name = "lvl_increase" + alpha = 0.7 + } + } + + state = { + name = "stress_level_increase_3" + duration = 0.5 + bezier = { 0 0.5 0.5 1 } + + modify_texture = { + name = "lvl_increase" + alpha = 0 + } + } + } + } + } + } + } + + spacer = { + size = { 5 0 } + } + + flowcontainer = { + ignoreinvisible = yes + margin_bottom = 5 + spacing = 4 + + button_normal = { + name = "lifestyle_button" + visible = "[GetPlayer.IsAdult]" + + tooltip = "PLAYER_LIFESTYLE_TOOLTIP" + using = tooltip_ne + + onclick = "[OpenGameViewData( 'lifestyle', GetPlayer.GetID )]" + size = { 56 56 } + + icon_round_button_base = {} + + icon = { + name = "progress_frame" + texture = "gfx/interface/progressbars/action_progress_frame.dds" + size = { 100% 100% } + alpha = 0.5 + } + + highlight_icon_lifestyle_focus = { + name = "tutorial_highlight_lifestyle_HUD_button" + texture = "[GetPlayer.GetFocus.GetIcon]" + alwaystransparent = yes + size = { 100% 100% } + + modify_texture = { + texture = "gfx/interface/icons/focuses/hud_icon_mask.dds" + blend_mode = alphamultiply + } + } + + icon = { + visible = "[And(Not( GreaterThan_CFixedPoint( GetPlayer.MakeScope.Var('hide_ui_pulsating_lifestyle').GetValue, '(CFixedPoint)0' ) ),Or(GetPlayer.CanPlayerChangeMyFocus, Not( GetPlayer.GetLifestyle.IsValid )))]" + size = { 100% 100% } + alwaystransparent = yes + texture = "[GetPlayer.GetFocus.GetIcon]" + + modify_texture = { + texture = "gfx/interface/icons/focuses/hud_icon_mask.dds" + blend_mode = alphamultiply + } + + modify_texture = { + texture = "gfx/interface/colors/gold.dds" + blend_mode = add + + } + + modify_texture = { + texture = "gfx/interface/colors/red.dds" + blend_mode = colordodge + } + + state = { + name = a + next = b + alpha = 0 + trigger_on_create = yes + duration = 1.2 + using = Animation_Curve_Default + } + + state = { + name = b + next = a + alpha = 0.8 + duration = 0.6 + using = Animation_Curve_Default + } + } + + progresspie = { + name = "progress" + size = { 48 48 } + texture = "gfx/interface/progressbars/action_progress_thin.dds" + framesize = { 128 128 } + frame = 2 + value = "[GetPlayer.GetLifestyleExperienceProgress( GetPlayer.GetLifestyle.Self )]" + widgetanchor = center + parentanchor = center + position = { 0 0 } + min = 0 + max = 1 + } + + button_round = { + datacontext = "[GetPlayer]" + visible = "[And(GreaterThan_int32( Character.GetTotalPerkPoints, '(int32)0' ), Character.IsLocalPlayer)]" + parentanchor = bottom|right + position = { 7 3 } + size = { 28 28 } + framesize = { 82 82 } + upframe = 1 + uphoverframe = 1 + uppressedframe = 1 + alwaystransparent = yes + + text_single = { + parentanchor = center + datacontext = "[GetPlayer]" + text = "[Character.GetTotalPerkPoints]" + default_format = "#high" + max_width = 180 + align = nobaseline + + # animation_attention = { + # visible = "[GreaterThan_int32( GetPlayer.GetTotalPerkPoints, '(int32)0' )]" + # } + } + } + + animation_sonar = { + texture = "gfx/interface/component_effects/effect_sonar_ring.dds" + visible = "[GreaterThan_int32( GetPlayer.GetTotalPerkPoints, '(int32)0' )]" + } + } + + button_normal = { + name = "education_button" + visible = "[Not(GetPlayer.IsAdult)]" + + tooltip = "PLAYER_EDUCATION_FOCUS_TOOLTIP" + using = tooltip_ne + + onclick = "[ToggleGameViewData( 'character_focus', GetPlayer.GetID )]" + size = { 56 56 } + + icon_round_button_base = {} + + highlight_icon_lifestyle_focus = { + texture = "[GetPlayer.GetFocus.GetIcon]" + onclick = "[ToggleGameViewData( 'character_focus', GetPlayer.GetID )]" + size = { 100% 100% } + gfxtype = togglepushbuttongfx + effectname = "NoHighlight" + framesize = { 140 140 } + + modify_texture = { + texture = "gfx/interface/icons/focuses/hud_icon_mask.dds" + blend_mode = alphamultiply + } + } + } + + + widget = { + size = { 56 56 } + + button_open_inventory = { + name = "open_inventory_tutorial_uses_this" + using = tooltip_ne + + size = { 55 55 } + datacontext = "[GetPlayer]" + blockoverride "highlight_icon_size" + { + size = { 40 40 } + } + } + + widget_new_artifacts = { + position = { 6 2 } + parentanchor = bottom|right + visible = "[Or( GreaterThan_int32( LocalPlayerNewArtifacts.GetNumNewArtifactsOfCategory( 'inventory' ), '(int32)0' ), And( Not( GetPlayer.HasRoyalCourt ), GreaterThan_int32( LocalPlayerNewArtifacts.GetNumNewArtifactsOfCategory( 'court' ), '(int32)0' ) ) )]" + } + } + + button_round = { + name = "open_diarchy_tutorial_uses_this" + parentanchor = left + onclick = "[ToggleGameViewData( 'diarchy', Character.GetID )]" + visible = "[InGameBottomBar.ShouldShowDiarchyInHUD]" + + tooltip = "DIARCHY_WINDOW_OPEN_TOOLTIP" + using = tooltip_ne + size = { 56 56 } + + icon_round_button_base = {} + + button = { + size = { 40 40 } + alwaystransparent = yes + parentanchor = center + texture = "gfx/interface/icons/scale_of_power.dds" + } + + icon_power_sharing_level = { + name = "your_power_sharing_level" + + datacontext = "[GetPlayer.GetDiarchy]" + visible = "[Diarchy.IsValid]" + + parentanchor = bottom|right + position = { 3 3 } + + } + + icon_power_sharing_level = { + name = "liege_power_sharing_level" + + datacontext = "[GetPlayer.GetLiege.GetDiarchy]" + visible = "[And(GetPlayer.HasLiege, Diarchy.IsValid)]" + + parentanchor = bottom|right + position = { 3 3 } + } + + } + + # Radiance (enabled) + button_normal = { + datacontext = "[Character.GetRadianceBreakdown]" + visible = "[InGameBottomBar.ShouldShowRadianceInHUD]" + size = { 56 56 } + + using = tooltip_ne + + tooltip_visible = "[ValueBreakdown.HasTooltip]" + tooltipwidget = { + visible = "[ValueBreakdown.HasTooltip]" + widget_value_breakdown_tooltip = { + blockoverride "input_info_text" { + text = "SELECT_MANDALA_MAPMODE" + default_format = "#I" + } + } + } + + onclick = "[ToggleMapMode( 'mandala' )]" + + icon_round_button_base = { + parentanchor = center + size = { 100% 100% } + } + + button_icon = { + alwaystransparent = yes + texture = "gfx/interface/icons/flat_icons/mandala_radiance.dds" + size = { 60% 60% } + parentanchor = center + } + + } + + button_round = { + name = "hud_camp_button" #tutorial uses this + widgetid = "hud_camp_button" + datacontext = "[Character.GetDomicile]" + visible = "[InGameBottomBar.ShouldShowDomicileInHUD]" + parentanchor = left + size = { 56 56 } + using = tooltip_ne + + onclick = "[ToggleGameViewData( 'domicile', Domicile.Self )]" + tooltip = "[Domicile.GetMapPinTooltip( Character.Self )]" + + icon_round_button_base = {} + + progresspie = { + name = "progress" + visible = "[Domicile.IsConstructing]" + + size = { 48 48 } + texture = "gfx/interface/progressbars/action_progress_thin.dds" + framesize = { 128 128 } + frame = 2 + value = "[Domicile.GetConstructionProgress]" + widgetanchor = center + parentanchor = center + position = { 0 0 } + min = 0 + max = 1 + } + + button_icon = { + size = { 40 40 } + position = { 0 -1 } + parentanchor = center + alwaystransparent = yes + texture = "[Domicile.GetType.GetIcon]" + } + } + + # Bloc + button_normal = { + name = "confederation_button" #tutorial uses this + datacontext = "[GetPlayer.GetConfederation]" + visible = "[InGameBottomBar.ShouldShowBlocInHUD]" + parentanchor = left + size = { 56 56 } + + onclick = "[OpenGameViewData( 'confederation_window', Confederation.GetID )]" + + using = tooltip_ne + tooltip_offset = { 20 0 } + + tooltipwidget = { + using = confederation_tooltip + } + + icon_round_button_base = { + alwaystransparent = yes + parentanchor = center + size = { 100% 100% } + + button_icon = { + alwaystransparent = yes + texture = "gfx/interface/icons/flat_icons/confederations.dds" + size = { 60% 60% } + parentanchor = center + } + } + } + + button_normal = { + name = "house_power_hud_button" #tutorial uses this + datacontext = "[Character.GetHouse]" + datacontext = "[DynastyHouse.GetHouseAspiration]" + + visible = "[And(InGameBottomBar.ShouldShowHousePowerInHUD, Not( IsLandlessAdventurer( GetPlayer ) ) )]" + + size = { 56 56 } + + onclick = "[ToggleGameViewData( 'house_aspiration_window', DynastyHouse.Self )]" + tooltip = "OPEN_HOUSE_ASPIRATION_TT_SELECT" + using = tooltip_ne + + icon_round_button_base = { + parentanchor = center + size = { 100% 100% } + } + + powerful_family_bonus_icon = { + parentanchor = center + size = { 46 46 } + } + + animation_sonar = { + texture = "gfx/interface/component_effects/effect_sonar_ring.dds" + visible = "[ObjectsEqual( GetHouseAspiration('no_aspect'), HouseAspiration.Self)]" + } + } + } + + spacer = { + size = { 24 1 } + } + + nomad_widget = { + visible = "[IsNomad( GetPlayer )]" + datacontext = "[InGameBottomBar.GetDomainFertilityProgressBar]" + } + + widget_stress_sounds = {} + } + + + type left_edge_tabs = flowcontainer { + name = "side_bottom_left_tabs" + visible = "[And(And( Not( IsPauseMenuShown ), And(And(IsDefaultGUIMode, Character.IsValid), Not(GetVariableSystem.Exists( 'hide_bottom_left_HUD')))), Not( GreaterThan_CFixedPoint( GetPlayer.MakeScope.Var('hide_ui_bottom_left_bar').GetValue, '(CFixedPoint)0' ) ))]" + visible_at_creation = no + + ignoreinvisible = yes + alwaystransparent = no + + using = Animation_ShowHide_Standard + + widget = { + parentanchor = left|top + size = { 100% 150% } + + widget = { + size = { 100% 100% } + position = { -24 -20} + + Background = { + texture = "gfx/interface/skinned/hud_maintab_bg_middle.dds" + mirror = horizontal + spriteType = CorneredTiled + texture_density = 2 + margin = { 0 -50 } + } + + Background = { + spriteType = CorneredStretched + spriteborder_top = 100 + parentanchor = top|right + texture_density = 2 + size = { 50 100 } + texture = "gfx/interface/skinned/hud_maintab_bg_top.dds" + mirror = horizontal + } + + Background = { + spriteType = CorneredStretched + spriteborder_bottom = 100 + parentanchor = top|right + texture_density = 2 + size = { 50 100 } + texture = "gfx/interface/skinned/hud_maintab_bg_bottom.dds" + mirror = horizontal + } + + Background = { + size = { 100% 100% } + margin_bottom = 100 + using = Background_Area_Dark + + modify_texture = { + texture = "gfx/interface/component_masks/mask_fade_vertical_up.dds" + blend_mode = alphaMultiply + } + + } + } + } + + flowcontainer = { + parentanchor = bottom + ignoreinvisible = yes + direction = vertical + + button_hud_character_bar = { + name = "legend_tab" + visible = "[HasDlcFeature( 'legends' )]" + + onclick = "[ToggleGameView( 'legends' )]" + + tooltipwidget = { + legends_hud_tooltip = {} + } + + using = tooltip_es + tooltip_offset = { 20 0 } + + highlight_icon = { + parentanchor = center + position = { 0 1 } + size = { 40 40 } + texture = "gfx/interface/icons/legend_hud.dds" + scale = 0.9 + + glow = { + color = { 0 0 0 0.8 } + glow_radius = 3 + using = Glow_Standard + } + } + } + + button_hud_character_bar = { + name = "player_culture_button_tutorial_uses_this" + datacontext = "[GetPlayer.GetCulture]" + onclick = "[OpenGameViewData( 'culture_window', Culture.GetID )]" + + using = tooltip_es + tooltip_offset = { 20 0 } + + tooltipwidget = { + culture_tooltip_click = {} + } + + highlight_icon = { + parentanchor = center + position = { 0 1 } + size = { 40 40 } + texture = "gfx/interface/icons/icon_culture.dds" + + glow = { + color = { 0 0 0 0.8 } + glow_radius = 3 + using = Glow_Standard + } + } + } + + # Faith + button_hud_character_bar = { + name = "faith_button" + datacontext = "[GetPlayer.GetFaith]" + parentanchor = left + + onclick = "[OpenGameViewData( 'faith', GetPlayer.GetFaith.GetID )]" + + using = tooltip_es + tooltip_offset = { 20 0 } + + tooltipwidget = { + faith_tooltip_click = {} + } + + highlight_icon = { + texture = "[Faith.GetIcon]" + size = { 40 40 } + position = { 0 1 } + parentanchor = center + + glow = { + color = { 0 0 0 0.8 } + glow_radius = 3 + using = Glow_Standard + } + } + } + + # Confederation + button_hud_character_bar = { + name = "confederation_button" #tutorial uses this + datacontext = "[GetPlayer.GetConfederation]" + visible = "[And(Confederation.IsValid, Not(Confederation.GetType.IsHouseBasedConfederation))]" + parentanchor = left + + onclick = "[OpenGameViewData( 'confederation_window', Confederation.GetID )]" + + using = tooltip_es + tooltip_offset = { 20 0 } + + tooltipwidget = { + using = confederation_tooltip + } + + button = { + visible = "[Not(Confederation.GetType.IsHouseBasedConfederation)]" + parentanchor = top|hcenter + alwaystransparent = yes + position = { 0 -10 } + size = { 42 42 } + texture = "gfx/interface/icons/diplomatic_icons.dds" + frame = "5" + framesize = { 120 120 } + tooltip_visible = no + } + + coat_of_arms_icon = { + visible = "[Not(Confederation.GetType.IsHouseBasedConfederation)]" + parentanchor = center + position = { 0 1 } + size = { 28 28 } + coat_of_arms = "[Confederation.GetConfederationCoA.GetTexture('(int32)56','(int32)56')]" + coat_of_arms_slot = "[Confederation.GetConfederationCoA.GetSlot('(int32)56','(int32)56')]" + coat_of_arms_mask = "gfx/interface/coat_of_arms/title_mask.dds" + coat_of_arms_offset = "[DefaultCoATitleMaskOffset]" + coat_of_arms_scale = "[DefaultCoATitleMaskScale]" + + modify_texture = { + texture = "gfx/interface/coat_of_arms/coa_overlay.dds" + blend_mode = overlay + alpha = 0.4 + } + + coa_confederation_frame = { + parentanchor = center + texture = "gfx/interface/coat_of_arms/title_28.dds" + size = { 36 36 } + } + } + } + + # Dynasty House + button_hud_character_bar = { + name = "house_button" + datacontext = "[GetPlayer.GetHouse]" + onclick = "[DefaultOnHouseCoatOfArmsClick(DynastyHouse.GetID)]" + parentanchor = left + + using = tooltip_es + tooltip_offset = { 20 0 } + + tooltipwidget = { + using = dynasty_house_tooltip + } + + coa_house_tiny = { + parentanchor = center + position = { 0 1 } + scale = 0.92 + + blockoverride "coa_button" + { + alwaystransparent = yes + } + + blockoverride "coa_tooltip" + {} + } + } + } + } + + + type bottom_left_portrait = container { + datacontext = "[GetPlayer]" + visible = "[And(And( Not(IsGameViewOpen('barbershop')) , And(GetPlayer.IsValid, Not(GetVariableSystem.Exists( 'hide_bottom_left_HUD')))), Not( GreaterThan_CFixedPoint( GetPlayer.MakeScope.Var('hide_ui_character_model').GetValue, '(CFixedPoint)0' ) ))]" + visible_at_creation = no + + + state = { + name = _show + using = Animation_Curve_Default + duration = 0.15 + + position = { 0 0 } + alpha = 1 + } + + state = { + name = _hide + using = Animation_Curve_Default + duration = 0.15 + + position = { 0 50 } + alpha = 0 + } + + portrait_hud = { + scale = 1.3 + parentanchor = center + position = { -20 -40 } + } + + icon = { + texture = "gfx/interface/hud/bottom_left_portrait_fade.dds" + parentanchor = bottom|left + color = { 0.12 0.12 0.12 1 } + } + + icon = { + texture = "gfx/interface/hud/bottom_left_portrait_fade.dds" + parentanchor = bottom|left + color = { 0.15 0.15 0.15 0.3 } + } + } + + + + + type Animation_HUD_daily_tick = widget { + using = Animation_ShowHide_Quick + + icon = { + size = { 100% 100% } + texture = "gfx/interface/colors/white.dds" + shaderfile = "gfx/FX/pdxgui_repeat_texture.shader" + color = { 0.63 0.59 0.68 1 } + + block "alpha" + { + alpha = 0.5 + } + + modify_texture = { + name = "pattern" + texture = "gfx/interface/component_masks/mask_clouds.dds" + spriteType = corneredtiled + blend_mode = alphamultiply + } + + modify_texture = { + texture = "gfx/interface/component_masks/mask_fade_horizontal_middle_thick.dds" + blend_mode = alphamultiply + } + + state = { + name = a + next = b + duration = 0 + trigger_on_create = yes + + modify_texture = { + name = "pattern" + translate_uv = { 0 0 } + } + } + + state = { + name = b + next = a + block "duration" + { + duration = 2 + } + + modify_texture = { + name = "pattern" + translate_uv = { -1 0 } + } + } + } + } + + type progressbar_hud_stress_glow = icon { + size = { 100% 100% } + + block "lvl_3" + { + alpha = 0 + } + + shaderfile = "gfx/FX/pdxgui_repeat_texture.shader" + + modify_texture = { + name = "clouds" + texture = "gfx/interface/component_masks/mask_clouds.dds" + blend_mode = alphamultiply + spriteType = corneredtiled + texture_density = 3 + } + + state = { + name = mask_a + next = mask_b + trigger_on_create = yes + + modify_texture = { + name = "clouds" + translate_uv = { 0 -1 } + } + } + + state = { + name = mask_b + next = mask_a + duration = 8 + + modify_texture = { + name = "clouds" + translate_uv = { 0 1 } + } + } + + state = { + block "animation_trigger_1" + { + name = "stress_level_increase" + } + next = "fade_out" + + duration = 0.2 + delay = 0.3 + bezier = { 0.5 0 1 0.5 } + alpha = 1 + } + + block "lvl_3" { + state = { + block "animation_trigger_2" + { + name = "stress_increase" + } + next = "fade_out" + + duration = 0.2 + delay = 0.3 + bezier = { 0.5 0 1 0.5 } + alpha = 1 + } + + state = { + name = "fade_out" + + duration = 1.5 + bezier = { 0 0.5 0.5 1 } + alpha = 0 + } + } + } + + type progressbar_hud_stress = icon { + shaderfile = "gfx/FX/pdxgui_repeat_texture.shader" + alpha = 0.8 + + block "bar_color" + { + # texture = "gfx/interface/colors/red.dds" + } + + modify_texture = { + texture = "gfx/interface/component_masks/mask_rough_edges.dds" + spriteType = Corneredtiled + spriteborder = { 20 20 } + blend_mode = alphamultiply + texture_density = 5 + } + + modify_texture = { + texture = "gfx/interface/component_masks/mask_fade_horizontal.dds" + blend_mode = alphamultiply + alpha = 0.3 + } + + modify_texture = { + texture = "gfx/interface/component_masks/mask_scratches.dds" + blend_mode = alphamultiply + spriteType = corneredtiled + alpha = 0.3 + texture_density = 3 + } + + modify_texture = { + name = "flash" + texture = "gfx/interface/colors/white.dds" + blend_mode = colordodge + alpha = 0 + } + + modify_texture = { + visible = "[GreaterThanOrEqualTo_int32(GetPlayer.GetStressLevel, '(int32)2')]" + name = "lvl3_glow" + texture = "gfx/interface/colors/gold.dds" + blend_mode = colordodge + alpha = 0 + } + + modify_texture = { + name = "clouds" + texture = "gfx/interface/component_masks/mask_clouds_solid.dds" + blend_mode = mask + spriteType = corneredtiled + texture_density = 1 + } + + modify_texture = { + block "bar_color_flow" + { + # texture = "gfx/interface/colors/yellow.dds" + alpha = 0.3 + } + blend_mode = colordodge + } + + state = { + name = "lvl3_glow_a" + next = "lvl3_glow_b" + duration = 0.6 + trigger_on_create = yes + using = Animation_Curve_Default + + modify_texture = { + name = "lvl3_glow" + alpha = 0.5 + } + } + + state = { + name = "lvl3_glow_b" + next = "lvl3_glow_a" + duration = 1.5 + using = Animation_Curve_Default + + modify_texture = { + name = "lvl3_glow" + alpha = 0 + } + } + + state = { + name = "stress_level_increase" + next = "fade_out" + + duration = 0.1 + bezier = { 0.5 0 1 0.5 } + + modify_texture = { + name = "flash" + alpha = 0.6 + } + } + + state = { + name = "stress_increase" + next = "fade_out" + + duration = 0.1 + bezier = { 0.5 0 1 0.5 } + + modify_texture = { + name = "flash" + alpha = 0.6 + } + } + + state = { + name = "fade_out" + + duration = 0.8 + bezier = { 0 0.5 0.5 1 } + + + modify_texture = { + name = "flash" + alpha = 0 + } + } + + state = { + name = a + next = b + trigger_on_create = yes + + modify_texture = { + name = "clouds" + translate_uv = { 1 0 } + } + } + + state = { + name = b + next = a + duration = 15 + + modify_texture = { + name = "clouds" + translate_uv = { -1 0 } + } + } + } + + type button_raise_disband_armies = button_standard { + size = { 200 64 } + datacontext = "[GetPlayer]" + parentanchor = vcenter + + background = { + using = Background_Area_Dark_Border + } + + background = { + using = Background_Area_Dark + } + + margin_left = 45 + + + block "text" { + text = "RAISE_ALL" + } + + using = tooltip_ne + + icon = { + texture = "gfx/interface/icons/icon_banner.dds" + size = { 40 40 } + alwaystransparent = yes + parentanchor = left|vcenter + position = { 10 0 } + } + + state = { + name = _show + using = Animation_FadeIn_Quick + position_y = 0 + } + + state = { + name = _hide + using = Animation_FadeOut_Quick + position_y = 20 + } + } + + type button_hud_travel = button_standard { + size = { 170 36 } + datacontext = "[GetPlayer]" + parentanchor = vcenter + + background = { + using = Background_Area_Dark_Border + } + + margin_left = 34 + + using = tooltip_ne + + icon = { + texture = "gfx/interface/icons/travel/icon_travel_hud_placeholder.dds" + size = { 30 30 } + alwaystransparent = yes + parentanchor = left|vcenter + position = { 8 0 } + } + + state = { + name = _show + using = Animation_FadeIn_Quick + position_y = 0 + } + + state = { + name = _hide + using = Animation_FadeOut_Quick + position_y = 20 + } + } + + type button_war_banner = button_normal { + visible = "[Not(IsGameViewOpen('barbershop'))]" + size = { 78 82 } + onclick = "[WarItem.OnClick]" + tooltip = "[WarItem.GetTooltip]" + using = tooltip_ne + + animation_sonar = { + visible = "[WarItem.CanEnforceVictory]" + texture = "gfx/interface/component_masks/mask_glow.dds" + using = Color_Orange + } + + ##Show animation + state = { + name = _show + next = banner_default + using = Animation_FadeIn_Quick + bezier = { 1 0 0.5 0.5 } + size = { 86 88 } + alpha = 1 + trigger_on_create = yes + } + + state = { + name = banner_default + using = Animation_FadeIn_Standard + size = { 78 82 } + } + + state = { + name = _hide + using = Animation_FadeOut_Standard + bezier = { 1 0 0.5 0.5 } + size = { 66 70 } + alpha = 0 + } + + icon = { + name = "enforce_victory_glow" + visible = "[WarItem.CanEnforceVictory]" + parentanchor = center + size = { 100% 100% } + scale = 1.2 + texture = "gfx/interface/icons/war_status/war_won_glow.dds" + + state = { + trigger_on_create = yes + name = a + next = b + + using = Animation_Curve_Default + duration = 1 + alpha = 1 + } + + state = { + name = b + next = a + + using = Animation_Curve_Default + duration = 1.6 + alpha = 0.2 + } + } + + button = { + name = "enforce_victory_icon" + visible = "[WarItem.CanEnforceVictory]" + parentanchor = hcenter + position = { 0 -27 } + texture = "gfx/interface/icons/war_status/war_won_icon.dds" + + modify_texture = { + name = "shimmer_war_banner" + texture = "gfx/interface/component_effects/effect_shimmer.dds" + blend_mode = colordodge + translate_uv = { 1 1 } + alpha = 0.8 + } + + state = { + name = shimmer + next = pause + trigger_when = "[WarItem.CanEnforceVictory]" + delay = 0.5 + bezier = { 0 0.9 1 0.4 } + + modify_texture = { + name = "shimmer_war_banner" + translate_uv = { 1 0.8 } + alpha = 0.5 + } + } + + state = { + name = pause + duration = 0.8 + + modify_texture = { + name = "shimmer_war_banner" + translate_uv = { -1 -1 } + alpha = 0.5 + } + } + } + + highlight_icon = { + name = "war_icon" + visible = "[WarItem.IsPlayerParticipant]" + parentanchor = center + size = { 100% 100% } + texture = "gfx/interface/icons/war_status/war_icon.dds" + + modify_texture = { + name = "shimmer_war_banner" + texture = "gfx/interface/component_effects/effect_shimmer.dds" + blend_mode = colordodge + translate_uv = { 1 1 } + } + + state = { + name = shimmer + next = pause + trigger_when = "[WarItem.CanEnforceVictory]" + delay = 0.5 + bezier = { 0 0.9 1 0.4 } + + modify_texture = { + name = "shimmer_war_banner" + translate_uv = { 1 0.5 } + alpha = 0.5 + } + } + + state = { + name = pause + duration = 0.8 + + modify_texture = { + name = "shimmer_war_banner" + translate_uv = { -1 -1 } + alpha = 0.5 + } + } + } + + highlight_icon = { + name = "war_icon_liege" + visible = "[Not(WarItem.IsPlayerParticipant)]" + parentanchor = center + size = { 100% 100% } + texture = "gfx/interface/icons/war_status/war_icon_liege.dds" + } + + coa_realm_small = { + name = "enemy_realm" + datacontext = "[WarItem.GetWar.GetPrimaryPlayerEnemy]" + parentanchor = hcenter + scale = 0.9 + position = { 0 25 } + tooltip_visible = no + alwaystransparent = yes + } + + text_single = { + name = "warscore" + parentanchor = bottom|hcenter + position = { 0 -7 } + size = { 50 10 } + align = center + text = "[WarItem.GetWarScoreFraction|0%=+]" + + background = { + using = Background_Area_Dark + } + } + + widget = { + visible = "[WarItem.CanEnforceVictory]" + + state = { + name = _show + + start_sound = { + soundeffect = "event:/SFX/UI/War/sfx_ui_war_enforce_demand" + soundparam = { + name = StateChange + value = 1.5 + } + } + } + } + } + + type button_task_contract_banner = button_normal { + size = { 100 100 } + + icon = { + visible = "[And( TaskContract.IsEasy, Not(TaskContract.IsCriminal) )]" + size = { 100% 100% } + texture = "gfx/interface/window_contract/pin_contract_1.dds" + } + icon = { + visible = "[And( TaskContract.IsEasy, TaskContract.IsCriminal )]" + size = { 100% 100% } + texture = "gfx/interface/window_contract/pin_contract_1_crime.dds" + } + + icon = { + visible = "[And( TaskContract.IsMedium, Not(TaskContract.IsCriminal) )]" + size = { 100% 100% } + texture = "gfx/interface/window_contract/pin_contract_2.dds" + } + icon = { + visible = "[And( TaskContract.IsMedium, TaskContract.IsCriminal )]" + size = { 100% 100% } + texture = "gfx/interface/window_contract/pin_contract_2_crime.dds" + } + + icon = { + visible = "[And( TaskContract.IsHard, Not(TaskContract.IsCriminal) )]" + size = { 100% 100% } + texture = "gfx/interface/window_contract/pin_contract_3.dds" + } + icon = { + visible = "[And( TaskContract.IsHard, TaskContract.IsCriminal )]" + size = { 100% 100% } + texture = "gfx/interface/window_contract/pin_contract_3_crime.dds" + } + + highlight_icon = { + parentanchor = center + alwaystransparent = yes + texture = "[TaskContract.GetType.GetIcon]" + size = { 40% 40% } + position = { 0 -2 } + } + + onclick = "[ToggleGameViewData('task_contract', TaskContract.Self )]" + tooltip = "[TaskContract.GetName]" + using = tooltip_ne + } + + type button_situation_banner = button_normal { + name = "situation_banner_item" + size = { 90 90 } + + onclick = "[ToggleGameViewData(Situation.GetWindowName, Situation.GetID)]" + + block "tooltipwidget" + { + tooltipwidget = situation_tooltip + using = tooltip_nw + } + + widget = { + name = "natural_disaster_highlight" + size = { 100% 100% } + visible = "[Or(EqualTo_string( 'impact' , Situation.GetTopCurrentPhase.GetType.GetKey ), EqualTo_string( 'warning' , Situation.GetTopCurrentPhase.GetType.GetKey ))]" + } + + icon = { + name = "below_glow" + block "glow_visible" + { + visible = "[GreaterThan_CFixedPoint( Situation.GetTopCurrentPhase.GetRelativeProgress, '(CFixedPoint)0.8' )]" + } + size = { 100% 100% } + texture = "gfx/interface/icons/character_interactions/icon_bg.dds" + + using = Animation_Glow_Pulse + + glow = { + glow_radius = 5 + using = Glow_Standard + using = Color_Bright_Yellow + } + } + + # Current phase + widget = { + size = { 100% 100% } + datacontext = "[Situation.GetTopCurrentPhase]" + parentanchor = center + + button = { + size = { 88% 88% } + parentanchor = center + + block "background_texture" + { + texture = "gfx/interface/window_situations/hud_situation_widget.dds" + } + alwaystransparent = yes + } + + icon = { + parentanchor = center + block "icon_size" + { + size = { 60% 60% } + } + + block "button_icon" + { + texture = "[Situation.GetIcon]" + } + } + } + + progresspie = { + block "progress_pie_visibility" {} + block "progresspie_size" + { + size = { 70% 70% } + } + parentanchor = center + value = "[Situation.GetTopCurrentPhase.GetRelativeProgress]" + max = 1 + texture = "gfx/interface/progressbars/action_progress_thin.dds" + framesize = { 128 128 } + frame = 2 + } + } + + type button_situation_group_banner = button_normal { + name = "situation_group_banner_item" + size = { 56 56 } + + onclick = "[ToggleGameViewData(Situation.GetWindowName, Situation.GetID)]" + onclick = "[OpenGuiTab( 'dynastic_cycle_tabs', 'movements' )]" + tooltip = "[SelectLocalization( And(SituationParticipantGroup.IsValid, InGameBottomBar.ShouldShowDynasticCycleOwnedLand), 'DYNASTIC_CYCLE_HUD_GROUP_OWNED_LAND_TOOLTIP', 'DYNASTIC_CYCLE_HUD_GROUP_POWER_TOOLTIP' )]" + using = tooltip_ne + + # Current phase + widget = { + size = { 100% 100% } + parentanchor = center + + button = { + size = { 56 56 } + parentanchor = center + texture = "gfx/interface/buttons/button_lifestyles_base.dds" + alwaystransparent = yes + } + + button_icon = { + visible = "[InGameBottomBar.ShouldShowMovementPower]" + parentanchor = center + position = { 0 -5 } + size = { 27 27 } + texture = "[SituationParticipantGroup.GetType.GetIcon]" + alwaystransparent = yes + } + + # Bigger icon that is centered in background when you don't have the banner with movement power + button_icon = { + visible = "[Not(InGameBottomBar.ShouldShowMovementPower)]" + parentanchor = center + size = { 35 35 } + texture = "[SituationParticipantGroup.GetType.GetIcon]" + alwaystransparent = yes + } + } + + icon = { + visible = "[InGameBottomBar.ShouldShowMovementPower]" + parentanchor = bottom|hcenter + position = { 0 -3 } + size = { 60 24 } + texture = "gfx/interface/hud/tgp_widget_button_banner.dds" + datacontext = "[SituationParticipantGroup]" + + using = tooltip_ne + tooltip_offset = { 3 38 } + + flowcontainer = { + parentanchor = center + spacing = 3 + + tooltip = "DYNASTIC_CYCLE_HUD_PERSONAL_MOVEMENT_POWER_TT" + using = tooltip_ne + tooltip_offset = { 0 -5 } + + widget = { + parentanchor = vcenter + size = { 12 24 } + + icon_flat_standard_gold = { + parentanchor = vcenter + position = { 0 2 } + size = { 12 12 } + texture = "gfx/interface/icons/flat_icons/group_power.dds" + alwaystransparent = yes + } + } + + text_single = { + parentanchor = vcenter + text = "[InGameBottomBar.GetDynasticCycleMovementPower]" + using = Font_Size_Tiny + max_width = 40 + } + } + } + + icon = { + size = { 25 25 } + position = { -5 10 } + + texture = "gfx/interface/icons/dynastic_cycle/favored_by_hegemon.dds" + visible = "[InGameBottomBar.IsDynasticCycleMovementFavored]" + widgetanchor = center + parentanchor = top|right + + tooltip = "DYNASTIC_CYCLE_WINDOW_FAVORED_MOVEMENT_TOOLTIP" + } + } + + type button_situations_scroll = button_normal { + size = { 80 110 } + + onclick = "[ToggleGameViewData(Situation.GetWindowName, Situation.GetID)]" + + widget = { + parentanchor = bottom|hcenter + size = { 74 78 } + + highlight_icon = { + size = { 74 78 } + texture = "gfx/interface/window_situations/silk_road_hud_widget_bg.dds" + } + + widget = { + size = { 50 50 } + parentanchor = center + + highlight_icon = { + size = { 46 46 } + parentanchor = center + texture = "gfx/interface/icons/struggle_banners/icon_background_02.dds" + } + + highlight_icon = { + parentanchor = center + size = { 34 34 } + texture = "[Situation.GetIcon]" + } + } + + tooltip = "SITUATION_LIST_HUD_BUTTON" + } + } + + type button_struggle_banner = button_normal { + name = "struggle_banner_tutorial_uses_this" + + size = { 110 110 } + + onclick = "[ToggleGameViewData('struggle', Struggle.GetID)]" + + onmousehierarchyenter = "[HighlightStruggle( Struggle.Self )]" + onmousehierarchyleave = "[ClearHighlightedStruggleBorder]" + + state = { + name = _show + next = banner_default + using = Animation_FadeIn_Quick + bezier = { 1 0 0.5 0.5 } + size = { 80 80 } + alpha = 1 + trigger_on_create = yes + } + + state = { + name = banner_default + using = Animation_FadeIn_Standard + size = { 110 110 } + } + + state = { + name = _hide + using = Animation_FadeOut_Standard + bezier = { 1 0 0.5 0.5 } + size = { 80 80 } + alpha = 0 + } + + # Animations + struggle_phase_based_widget = { + datacontext = "[Struggle.GetCurrentPhase]" + visible = "[Struggle.HasPossibleEndingDecision]" + parentanchor = center + + animation_sonar = { + texture = "gfx/interface/component_masks/mask_glow.dds" + using = Color_Orange + } + + blockoverride "point_based_widget_content" { + icon = { + size = { 100% 100% } + position = { 0 -12 } + texture = "gfx/interface/icons/struggle_banners/upper_point_glow.dds" + + state = { + trigger_on_create = yes + name = a + next = b + + using = Animation_Curve_Default + duration = 1 + alpha = 1 + } + + state = { + name = b + next = a + + using = Animation_Curve_Default + duration = 1.6 + alpha = 0.2 + } + } + } + + blockoverride "time_based_widget_content" { + icon = { + position = { 0 -12 } + size = { 100% 100% } + texture = "gfx/interface/icons/struggle_banners/upper_time_glow.dds" + + state = { + trigger_on_create = yes + name = a + next = b + + using = Animation_Curve_Default + duration = 1 + alpha = 1 + } + + state = { + name = b + next = a + + using = Animation_Curve_Default + duration = 1.6 + alpha = 0.2 + } + } + } + } + + # Leading phase + struggle_phase_based_widget = { + datacontext = "[Struggle.GetCurrentLeadingPhase]" + + blockoverride "point_based_widget_content" { + icon = { + size = { 100% 100% } + texture = "gfx/interface/icons/struggle_banners/lower_point_banner.dds" + } + } + + blockoverride "time_based_widget_content" { + icon = { + size = { 100% 100% } + texture = "gfx/interface/icons/struggle_banners/lower_time_banner.dds" + } + } + + blockoverride "ending_widget_content" { + icon = { + size = { 100% 100% } + texture = "gfx/interface/icons/struggle_banners/lower_ending_banner.dds" + } + + icon = { + size = { 100% 100% } + texture = "gfx/interface/component_effects/ending_banner_fire_01.dds" + alpha = 0.25 + + state = { + trigger_on_create = yes + name = a + next = b + + using = Animation_Curve_Default + duration = 1 + alpha = 0.25 + } + + state = { + name = b + next = a + + using = Animation_Curve_Default + duration = 1 + alpha = 0 + } + } + + icon = { + size = { 100% 100% } + texture = "gfx/interface/component_effects/ending_banner_fire_02.dds" + alpha = 0 + + state = { + trigger_on_create = yes + name = a + next = b + + using = Animation_Curve_Default + duration = 1 + alpha = 0 + } + + state = { + name = b + next = a + + using = Animation_Curve_Default + duration = 1 + alpha = 0.25 + } + } + + icon = { + name = "ending_phase_glow" + visible = "[Struggle.HasPossibleEndingDecision]" + parentanchor = center + size = { 100% 100% } + texture = "gfx/interface/icons/struggle_banners/lower_ending_glow.dds" + + state = { + trigger_on_create = yes + name = a + next = b + + using = Animation_Curve_Default + duration = 1 + alpha = 0.5 + } + + state = { + name = b + next = a + + using = Animation_Curve_Default + duration = 1.6 + alpha = 0.2 + } + } + } + + widget = { + visible = "[Struggle.GetCurrentLeadingPhase.IsValid]" + parentanchor = bottom|left + size = { 25 25 } + position = { 20 -14 } + } + } + + # Tie + icon = { + visible = "[Not(Struggle.GetCurrentLeadingPhase.IsValid)]" + size = { 100% 100% } + texture = "gfx/interface/icons/struggle_banners/lower_tied_banner.dds" + } + + # Current phase + struggle_phase_based_widget = { + datacontext = "[Struggle.GetCurrentPhase]" + blockoverride "point_based_widget_content" { + struggle_highlight_icon = { + visible = "[Struggle.IsInvolvedCharacter(Character.Self)]" + blockoverride "texture" { + texture = "gfx/interface/icons/struggle_banners/upper_point_involved_banner.dds" + } + } + + struggle_highlight_icon = { + visible = "[Not(Struggle.IsInvolvedCharacter(Character.Self))]" + blockoverride "texture" { + texture = "gfx/interface/icons/struggle_banners/upper_point_interloper_banner.dds" + } + } + + widget = { + size = { 52 52 } + position = { 0 15 } + parentanchor = top|hcenter + + icon = { + size = { 52 52 } + parentanchor = center + texture = "gfx/interface/icons/struggle_banners/icon_background_02.dds" + } + + icon = { + parentanchor = center + size = { 40 40 } + texture = "[Struggle.GetCurrentPhase.GetIcon]" + } + } + + progressbar_standard = { + size = { 60 12 } + parentanchor = bottom|hcenter + position = { 0 -20 } + value = "[Struggle.GetProgress]" + progresstexture = "gfx/interface/progressbars/progress_orange.dds" + } + + widget_struggle_hourglass = { } + } + + blockoverride "time_based_widget_content" { + struggle_highlight_icon = { + visible = "[Struggle.IsInvolvedCharacter(Character.Self)]" + blockoverride "texture" { + texture = "gfx/interface/icons/struggle_banners/upper_time_involved_banner.dds" + } + } + + struggle_highlight_icon = { + size = { 100% 100% } + visible = "[Struggle.IsInterloperCharacter(Character.Self)]" + blockoverride "texture" { + texture = "gfx/interface/icons/struggle_banners/upper_time_interloper_banner.dds" + } + } + + widget = { + size = { 52 52 } + parentanchor = top|hcenter + position = { 1 18 } + + icon = { + parentanchor = center + texture = "gfx/interface/icons/struggle_banners/icon_background_02.dds" + size = { 60 60 } + } + + progresspie = { + name = "progress" + parentanchor = center + size = { 52 52 } + position = { 0 -1} + texture = "gfx/interface/progressbars/action_progress_thin.dds" + framesize = { 124 124 } + frame = 2 + value = "[Struggle.GetProgress]" + } + + icon = { + parentanchor = center + size = { 40 40 } + texture = "[Struggle.GetCurrentPhase.GetIcon]" + } + } + + widget_struggle_hourglass = { } + + text_single = { + text = "[Struggle.GetPhaseValue(Struggle.GetCurrentLeadingPhase)]" + default_format = "#high" + parentanchor = bottom|hcenter + position = { 0 -14 } + } + } + } + + widget = { + size = { 80 110 } + tooltipwidget = struggle_tooltip + parentanchor = center + } + } + + type struggle_highlight_icon = highlight_icon { + size = { 100% 100% } + block "texture" {} + + ##Pulse glow + glow = { + name = "glow_defined" + glow_radius = 3 + using = Glow_Standard + using = Color_Orange + glow_alpha = 0 + } + + state = { + name = struggle_pulse_glow + next = struggle_pulse_glow_stop + using = Animation_FadeIn_Quick + bezier = { 1 0 0.5 0.5 } + glow_alpha = 1 + } + + state = { + name = struggle_pulse_glow_stop + bezier = { 1 0 0.5 0.5 } + duration = 0.3 + glow_alpha = 0 + } + + #white fill + state = { + name = struggle_pulse_icon + next = struggle_pulse_icon_stop + using = Animation_FadeIn_Quick + bezier = { 1 0 0.5 0.5 } + + modify_texture = { + name = "white_icon" + alpha = 1 + } + } + + state = { + name = struggle_pulse_icon_stop + bezier = { 1 0 0.5 0.5 } + duration = 0.3 + + modify_texture = { + name = "white_icon" + alpha = 0 + } + } + + modify_texture = { + name = "white_icon" + texture = "gfx/interface/component_masks/mask_rough_edges.dds" + blend_mode = colordodge + alpha = 0 + } + } + + type widget_struggle_hourglass = widget { + visible = "[Struggle.IsInTransitionPhase]" + position = { 0 0 } + size = { 32 32 } + + icon = { + parentanchor = center + size = { 32 32 } + texture = "gfx/interface/icons/struggle_banners/icon_background_dark.dds" + + #white fill + state = { + name = struggle_pulse_icon + next = struggle_pulse_icon_stop + using = Animation_FadeIn_Quick + bezier = { 1 0 0.5 0.5 } + + modify_texture = { + name = "white_icon" + alpha = 1 + } + } + + state = { + name = struggle_pulse_icon_stop + bezier = { 1 0 0.5 0.5 } + duration = 0.3 + + modify_texture = { + name = "white_icon" + alpha = 0 + } + } + + modify_texture = { + name = "white_icon" + texture = "gfx/interface/component_masks/mask_rough_edges.dds" + blend_mode = colordodge + alpha = 0 + } + } + + icon = { + parentanchor = center + size = { 30 30 } + texture = "gfx/interface/icons/icon_time.dds" + + #white fill + state = { + name = struggle_pulse_icon + next = struggle_pulse_icon_stop + using = Animation_FadeIn_Quick + bezier = { 1 0 0.5 0.5 } + + modify_texture = { + name = "white_icon" + alpha = 1 + } + } + + state = { + name = struggle_pulse_icon_stop + bezier = { 1 0 0.5 0.5 } + duration = 0.3 + + modify_texture = { + name = "white_icon" + alpha = 0 + } + } + + modify_texture = { + name = "white_icon" + texture = "gfx/interface/component_masks/mask_rough_edges.dds" + blend_mode = colordodge + alpha = 0 + } + } + } + + type button_ghw_banner = button_normal { + size = { 78 82 } + onclick = "[OpenGameViewData( 'great_holy_war', GreatHolyWar.GetID )]" + + block "ghw_tooltip" + { + raw_tooltip = "#D no tooltip :(#!" + } + + ##Show animation + state = { + name = _show + next = banner_default + using = Animation_FadeIn_Quick + bezier = { 1 0 0.5 0.5 } + size = { 86 88 } + alpha = 1 + trigger_on_create = yes + } + + state = { + name = banner_default + using = Animation_FadeIn_Standard + size = { 78 82 } + } + + state = { + name = _hide + using = Animation_FadeOut_Standard + bezier = { 1 0 0.5 0.5 } + size = { 66 70 } + alpha = 0 + } + + button = { + name = "holy_war_icon_started" + visible = "[GreatHolyWar.HasWarStarted]" + onclick = "[OpenGameViewData( 'great_holy_war', GreatHolyWar.GetID )]" + parentanchor = center + size = { 100% 100% } + texture = "gfx/interface/icons/war_status/holy_war_icon_started.dds" + } + + button = { + name = "holy_war_icon_prep" + visible = "[Not(GreatHolyWar.HasWarStarted)]" + onclick = "[OpenGameViewData( 'great_holy_war', GreatHolyWar.GetID )]" + parentanchor = center + size = { 100% 100% } + texture = "gfx/interface/icons/war_status/holy_war_icon_prep.dds" + } + + button = { + name = "faith_icon" + datacontext = "[GreatHolyWar.GetFaith]" + onclick = "[OpenGameViewData( 'great_holy_war', GreatHolyWar.GetID )]" + parentanchor = center + position = { 1 -3 } + size = { 35 35 } + texture = "[Faith.GetIcon]" + } + } + + type button_raid_banner = button_normal { + size = { 78 82 } + onclick = "[DefaultOnCharacterClick(Character.GetID)]" + using = tooltip_ne + + ##Show animation + state = { + name = _show + next = banner_default + using = Animation_FadeIn_Quick + bezier = { 1 0 0.5 0.5 } + size = { 86 88 } + alpha = 1 + trigger_on_create = yes + } + + state = { + name = banner_default + using = Animation_FadeIn_Standard + size = { 78 82 } + } + + state = { + name = _hide + using = Animation_FadeOut_Standard + bezier = { 1 0 0.5 0.5 } + size = { 66 70 } + alpha = 0 + } + + highlight_icon = { + texture = "gfx/interface/icons/war_status/raid_icon.dds" + size = { 100% 100% } + parentanchor = center + } + + coa_realm_small = { + name = "enemy_realm" + parentanchor = hcenter + scale = 0.9 + position = { 0 12 } + tooltip_visible = no + alwaystransparent = yes + } + + text_single = { + name = "time_left" + parentanchor = bottom|hcenter + position = { 0 -7 } + size = { 50 10 } + align = center + text = "[GetPlayer.GetRaidHostilityEnd( Character.Self ).GetTimeDiffFromNow]" + + } + } + + type button_hud_character_bar = button_normal { + effectname = "NoHighlight" + + framesize = { 103 102} + size = { 52 52 } + texture = "gfx/interface/skinned/button_hud_character_sidebar.dds" + using = tooltip_ne + + state = { + name = _show + frame = 1 + position_x = 0 + + using = Animation_Curve_Default + duration = 0.25 + } + + state = { + name = _mouse_hierarchy_enter + frame = 2 + position_x = 3 + + using = Animation_Curve_Default + duration = 0.1 + } + + state = { + name = _mouse_leave + frame = 1 + position_x = 0 + + using = Animation_Curve_Default + duration = 0.25 + } + + state = { + name = _mouse_press + frame = 3 + position_x = 3 + } + + state = { + name = _mouse_release + frame = 2 + position_x = 0 + + using = Animation_Curve_Default + duration = 0.25 + } + } + + type widget_hud_main_tab = widget { + size = { 45 45 } + using = tooltip_ws + tooltip_offset = { 35 0 } + + button_normal = { + parentanchor = center + size = { 45 45 } + + scale = 1 + + block "maintab_button" {} + + modify_texture = { + name = "glow" + texture = "gfx/interface/component_effects/effect_shimmer.dds" + blend_mode = colordodge + translate_uv = { 1 0 } + alpha = 0 + } + + state = { + name = _mouse_enter + duration = 0.03 + scale = 1.2 + position_x = -3 + + using = Animation_Curve_Default + + modify_texture = { + name = "glow" + translate_uv = { 0 0 } + alpha = 0.4 + } + } + + state = { + name = _mouse_leave + duration = 0.1 + scale = 1 + position_x = 0 + + using = Animation_Curve_Default + + modify_texture = { + name = "glow" + translate_uv = { 1 0 } + alpha = 0 + } + } + } + } + + type hotkeys_HUD = widget { + # Mapmodes + button_normal = { + onclick = "[SetMapMode('players')]" + shortcut = "map_mode_8" + enabled = "[Or(GameHasMultiplePlayers, InDebugMode)]" + } + + button_normal = { + onclick = "[SetMapMode('dejure_duchies')]" + shortcut = "map_mode_9" + shortcut = "mapmode_duchies_secondary" + } + + button_normal = { + onclick = "[SetMapMode('dejure_kingdoms')]" + shortcut = "map_mode_10" + shortcut = "mapmode_kingdoms_secondary" + + } + + button_normal = { + onclick = "[SetMapMode('dejure_empires')]" + shortcut = "map_mode_11" + shortcut = "mapmode_empires_secondary" + } + + button_normal = { + onclick = "[SetMapMode('religions')]" + shortcut = "map_mode_3" + shortcut = "mapmode_faith_secondary" + } + + button_normal = { + onclick = "[SetMapMode('cultures')]" + shortcut = "map_mode_2" + shortcut = "mapmode_culture_secondary" + } + + button_normal = { + onclick = "[SetMapMode('houses')]" + onclick = "[ClearExploringHouses]" + shortcut = "map_mode_4" + shortcut = "mapmode_house_secondary" + } + + button_normal = { + onclick = "[SetMapMode('realms')]" + onclick = "[ClearExploringRealms]" + shortcut = "map_mode_1" + } + + button_normal = { + onclick = "[SetMapMode('government')]" + shortcut = "map_mode_5" + } + + button_normal = { + onclick = "[SetMapMode('epidemics')]" + shortcut = "map_mode_16" + } + + button_normal = { + onclick = "[SetMapMode('legends')]" + shortcut = "map_mode_17" + } + + button_normal = { + onclick = "[SetMapMode('landless_rulers')]" + shortcut = "map_mode_18" + } + + button_normal = { + onclick = "[SetMapMode('migration_counties')]" + shortcut = "map_mode_19" + } + + button_normal = { + onclick = "[SetMapMode('dejure_counties')]" + shortcut = "map_mode_6" + } + + button_normal = { + onclick = "[SetMapMode('dejure_hegemonies')]" + shortcut = "map_mode_20" + } + + button_normal = { + onclick = "[SetMapMode('court_languages')]" + shortcut = "map_mode_7" + } + + button_normal = { + onclick = "[SetMapMode('terrain')]" + shortcut = "map_mode_terrain" + } + + button_normal = { + onclick = "[SetMapMode('simple_terrain')]" + shortcut = "map_mode_12" + } + + button_normal = { + onclick = "[SetMapMode('county_development')]" + shortcut = "map_mode_13" + } + + button_normal = { + onclick = "[SetMapMode( 'economy_buildings' )]" + shortcut = "map_mode_14" + } + + button_normal = { + onclick = "[SetMapMode( 'county_control' )]" + shortcut = "map_mode_15" + } + + button_normal = { + onclick = "[SetMapMode( 'diplomatic_relations' )]" + shortcut = "map_mode_diplomatic_relations" + } + + button_normal = { + onclick = "[SetMapMode( 'confederations' )]" + shortcut = "map_mode_confederations" + } + + button_normal = { + name = "find_title_shortcut" + onclick = "[ToggleGameView( 'find_title' )]" + onclick = "[GetVariableSystem.Clear( 'extra_buttons_expand' )]" + shortcut = "find_title_shortcut" + } + + button_normal = { + name = "plagues_shortcut" + onclick = "[ToggleGameView( 'epidemics' )]" + onclick = "[GetVariableSystem.Clear( 'extra_buttons_expand' )]" + shortcut = "explore_plagues" + } + + button_normal = { + name = "legends_shortcut" + onclick = "[ToggleGameView( 'legends' )]" + onclick = "[GetVariableSystem.Clear( 'extra_buttons_expand' )]" + shortcut = "explore_legends" + } + + # 0 size button for shortcut to work + button_normal = { + name = "find_character_shortcut" + onclick = "[ToggleGameView( 'character_finder' )]" + onclick = "[GetVariableSystem.Clear( 'extra_buttons_expand' )]" + shortcut = "character_finder" + } + + # 0 size button for shortcut to work + button_normal = { + name = "encyclopedia_shortcut" + onclick = "[ToggleEncyclopedia]" + onclick = "[GetVariableSystem.Clear( 'extra_buttons_expand' )]" + shortcut = "encyclopedia" + } + button_normal = { + onclick = "[SetMapMode( 'mandala' )]" + shortcut = "map_mode_mandala" + } + } + + type button_pause_hud = button_round { + size = { 33 33 } + + enabled = "[Not(IsGameOver)]" + onclick = "[OnPause]" + oversound = "event:/SFX/UI/Generic/sfx_ui_generic_pointer_over" + clicksound = "event:/SFX/UI/Generic/sfx_ui_generic_select" + + button_play = { + visible = "[IsGamePaused]" + size = { 35 35 } + + tooltip = "[SelectLocalization( IsGameOver, 'UNPAUSE_GAME_OVER', 'UNPAUSE_GAME')]" + using = tooltip_ne + alwaystransparent = yes + parentanchor = center + } + + button_pause = { + visible = "[Not(IsGamePaused)]" + size = { 35 35 } + + tooltip = "PAUSE_GAME" + using = tooltip_ne + alwaystransparent = yes + parentanchor = center + } + } + + type container_resource_balance = container { + text_single = { + name = "balance_pos" + visible = "[GreaterThanOrEqualTo_CFixedPoint(PlayerValueItem.GetBalance, '(CFixedPoint)0')]" + text = "[PlayerValueItem.GetBalance|1=]" + max_width = 110 + + default_format = "#low" + } + + text_single = { + name = "balance_neg" + visible = "[LessThan_CFixedPoint(PlayerValueItem.GetBalance, '(CFixedPoint)0')]" + text = "[PlayerValueItem.GetBalance|1=]" + max_width = 110 + + default_format = "#N" + } + } + + type container_saving_indicator = container { + visible = yes + + background = { + name = "bg" + texture = "gfx/interface/tooltips/tooltip_bg.dds" + spriteType = Corneredtiled + gfxtype = icongfx + spriteborder = { 2 2 } + shaderfile = "gfx/FX/pdxgui_default.shader" + + } + + background = { + name = "frame" + texture = "gfx/interface/tooltips/tooltip_frame.dds" + gfxtype = icongfx + spriteType = Corneredtiled + spriteborder = { 20 20 } + shaderfile = "gfx/FX/pdxgui_default.shader" + + + modify_texture = { + name = "overlay" + texture = "gfx/interface/component_overlay/overlay_window.dds" + spriteType = Corneredstretched + spriteborder = { 0 0 } + blend_mode = overlay + } + } + + flowcontainer = { + spacing = 15 + margin = { 20 15 } + + progressbar = { + size = { 44 44 } + gfxtype = framedprogressbargfx + texture = "gfx/interface/frontend/loading_progress.dds" + framesize = { 88 88 } + loopinterval = 2.0 + max = 0 + } + + text_single = { + parentanchor = vcenter + align = nobaseline + using = Font_Size_Medium + + block "csi_text" + { + text = "AUTOSAVE_IN_PROGRESS" + } + } + } + } + + type resources_top_right_bar = hbox + { + layer = top + + using = Animation_ShowHide_Quick + + ## Resources + hbox = { + name = "resources" + visible = "[Not( IsGameViewOpen('barbershop') )]" + + hbox = { + name = "spendables" + layoutpolicy_horizontal = expanding + layoutpolicy_vertical = expanding + + hbox = { + name = "tutorial_highlight_resources_bar" + layoutpolicy_horizontal = expanding + layoutpolicy_vertical = expanding + + widget = { + name = "gold" + size = { 144 70 } + + state = { + name = _mouse_enter + on_start = "[InGameTopbar.ResetLastUpdateFrame]" + } + + widget = { + size = { 144 45 } + + tooltipwidget = { + widget_gold_breakdown_tooltip = { + blockoverride "income" + { + datacontext = "[InGameTopbar.GetGoldIncomeBreakdown]" + } + + blockoverride "expenses" + { + datacontext = "[InGameTopbar.GetGoldExpensesBreakdown]" + } + } + } + using = tooltip_ne + } + + background = { + texture = "gfx/interface/skinned/resource_panel_start.dds" + } + + vbox = { + margin_top = -2 + + hbox = { + layoutpolicy_horizontal = expanding + expand = {} + + hbox = { + spacing = 7 + + icon = { + name = "gold_icon" + size = { 30 30 } + texture = "gfx/interface/icons/icon_gold.dds" + } + + flowcontainer = { + margin_bottom = 7 + spacing = -6 + direction = vertical + ignoreinvisible = yes + + text_single = { + name = "gold_value_positive" + visible = "[GreaterThanOrEqualTo_CFixedPoint(GetPlayer.GetGold, '(CFixedPoint)0')]" + text = "[GetPlayer.GetGold|0]" + max_width = 50 + default_format = "#high" + using = Font_Size_Medium + } + + text_single = { + name = "gold_value_negative" + visible = "[LessThan_CFixedPoint(GetPlayer.GetGold, '(CFixedPoint)0')]" + text = "[GetPlayer.GetGold|0]" + max_width = 50 + default_format = "#N" + using = Font_Size_Medium + } + + container = { + text_single = { + name = "balance_positive" + visible = "[GreaterThanOrEqualTo_CFixedPoint(InGameTopbar.GetGoldBalance, '(CFixedPoint)0')]" + text = "[InGameTopbar.GetGoldBalance|=1]" + max_width = 50 + default_format = "#low" + } + + text_single = { + name = "balance_negative" + visible = "[LessThan_CFixedPoint(InGameTopbar.GetGoldBalance, '(CFixedPoint)0')]" + text = "[InGameTopbar.GetGoldBalance|=1]" + max_width = 50 + default_format = "#N" + } + } + } + } + spacer = { + size = { 10 1} + } + divider_light = { + layoutpolicy_vertical = expanding + alpha = 0.8 + } + } + expand = {} + } + } + + widget = { + name = "treasury" + visible = "[GetPlayer.HasTreasury]" + size = { 112 70 } + allow_outside = yes + + state = { + name = _mouse_enter + on_start = "[InGameTopbar.ResetLastUpdateFrame]" + } + + button = { + size = { 112 45 } + + onclick = "[ToggleGameViewData( 'treasury_budget_change', GetPlayer.GetTopLiege.Self )]" + enabled = "[GetPlayer.IsIndependentRuler]" + + tooltipwidget = { + widget_gold_breakdown_tooltip = { + blockoverride "my_gold" + { + text_single = { + layoutpolicy_horizontal = expanding + + text = "[treasury_i] [GetPlayer.GetPrimaryTitle.GetNameNoTierNoTooltip] [treasury|E]" + default_format = "#T" + } + } + + blockoverride "income" + { + datacontext = "[InGameTopbar.GetTreasuryIncomeBreakdown]" + } + + blockoverride "expenses" + { + datacontext = "[InGameTopbar.GetTreasuryExpensesBreakdown]" + } + + blockoverride "extra_info" + { + text_single = { + visible = "[And( GetPlayer.IsIndependentRuler, IsAdministrativeRuler( GetPlayer ) )]" + layoutpolicy_horizontal = expanding + text = "CLICK_TO_OPEN_TREASURY_BUDGETING" + default_format = "#I" + } + } + } + } + using = tooltip_ne + } + + background = { + texture = "gfx/interface/skinned/resource_panel_piece.dds" + } + + vbox = { + margin_top = -2 + allow_outside = yes + + hbox = { + layoutpolicy_horizontal = expanding + allow_outside = yes + + widget = { + size = { 20 40 } + allow_outside = yes + + vbox = { + position = { -10 0 } + parentanchor = center + + button_round = { + size = { 20 20 } + + datacontext = "[GetPlayer]" + datacontext = "[GetDecisionWithKey( 'extract_gold_from_treasury' )]" + + visible = "[Decision.IsShownForPlayer]" + onclick = "[OpenGameViewData( 'decision_detail', Decision.Self)]" + + tooltip = "TRANSFER_TREASURY_TO_GOLD_DECISION_TOOLTIP" + using = tooltip_se + + button_icon = { + size = { 100% 100% } + alwaystransparent = yes + texture = "gfx/interface/icons/flat_icons/transfer_left.dds" + enabled = "[Decision.IsPossibleForPlayer]" + } + } + + button_round = { + size = { 20 20 } + + name = "transfer_gold_to_treasury_button_tutorial_uses_this" + datacontext = "[GetPlayer]" + enabled = "[Character.CanSendPlayerInteraction('transfer_small_gold_amount_to_treasury_interaction')]" + onclick = "[Character.SendPlayerInteraction( Select_CString( IsCtrlDown, 'transfer_huge_gold_amount_to_treasury_interaction', 'transfer_small_gold_amount_to_treasury_interaction' ) )]" + onrightclick = "[Character.SendPlayerInteraction( 'transfer_large_gold_amount_to_treasury_interaction' )]" + button_ignore = none + tooltip = "TRANSFER_GOLD_TO_TREASURY_INTERACTION_TOOLTIP" + using = tooltip_se + + button_icon = { + size = { 100% 100% } + alwaystransparent = yes + texture = "gfx/interface/icons/flat_icons/transfer_right.dds" + } + + tooltip_offset = { 0 10 } + } + } + } + + expand = {} + + hbox = { + spacing = 7 + + name = "treasury_tutorial_uses_this" + + icon = { + name = "treasury_icon" + size = { 30 30 } + texture = "gfx/interface/icons/icon_imperial_treasury.dds" + } + + flowcontainer = { + margin_bottom = 7 + spacing = -6 + direction = vertical + ignoreinvisible = yes + + text_single = { + name = "treasury_value_positive" + visible = "[GreaterThanOrEqualTo_CFixedPoint(GetPlayer.GetTreasury, '(CFixedPoint)0')]" + text = "[GetPlayer.GetTreasury|0]" + max_width = 50 + default_format = "#high" + using = Font_Size_Medium + } + + text_single = { + name = "treasury_value_negative" + visible = "[LessThan_CFixedPoint(GetPlayer.GetTreasury, '(CFixedPoint)0')]" + text = "[GetPlayer.GetTreasury|0]" + max_width = 50 + default_format = "#N" + using = Font_Size_Medium + } + + container = { + text_single = { + name = "treasury_balance_positive" + visible = "[GreaterThanOrEqualTo_CFixedPoint(InGameTopbar.GetTreasuryBalance, '(CFixedPoint)0')]" + text = "[InGameTopbar.GetTreasuryBalance|=1]" + max_width = 50 + default_format = "#low" + } + + text_single = { + name = "treasury_balance_negative" + visible = "[LessThan_CFixedPoint(InGameTopbar.GetTreasuryBalance, '(CFixedPoint)0')]" + text = "[InGameTopbar.GetTreasuryBalance|=1]" + max_width = 50 + default_format = "#N" + } + } + } + } + + spacer = { + size = { 10 1} + } + + divider_light = { + layoutpolicy_vertical = expanding + alpha = 0.8 + } + } + expand = {} + } + } + + widget = { + name = "barter_goods" + datacontext = "[GetPlayer]" + visible = "[GetPlayer.HasBarterGoods]" + size = { 112 70 } + + state = { + name = _mouse_enter + on_start = "[InGameTopbar.ResetLastUpdateFrame]" + } + + widget = { + size = { 112 45 } + using = tooltip_ne + + tooltipwidget = { + widget_gold_breakdown_tooltip = { + blockoverride "income" + { + datacontext = "[InGameTopbar.GetBarterGoodsIncomeBreakdown]" + } + + blockoverride "expenses" + { + datacontext = "[InGameTopbar.GetBarterGoodsExpensesBreakdown]" + } + } + } + } + + background = { + texture = "gfx/interface/skinned/resource_panel_piece.dds" + } + + vbox = { + margin_top = -2 + + hbox = { + layoutpolicy_horizontal = expanding + expand = {} + + hbox = { + spacing = 7 + + icon = { + name = "barter_goods_icon" + size = { 30 30 } + texture = "gfx/interface/icons/icon_barter.dds" + } + + flowcontainer = { + margin_bottom = 7 + spacing = -6 + direction = vertical + ignoreinvisible = yes + + text_single = { + name = "barter_goods_value_positive" + + text = "[GetPlayer.GetCurrency('barter_goods')|0]" + max_width = 50 + default_format = "#high" + using = Font_Size_Medium + } + + container = { + text_single = { + name = "barter_goods_balance_positive" + visible = "[GreaterThanOrEqualTo_CFixedPoint(InGameTopbar.GetBarterGoodsBalance, '(CFixedPoint)0')]" + text = "[InGameTopbar.GetBarterGoodsBalance|=1]" + max_width = 50 + default_format = "#low" + } + + text_single = { + name = "barter_goods_balance_negative" + visible = "[LessThan_CFixedPoint(InGameTopbar.GetBarterGoodsBalance, '(CFixedPoint)0')]" + text = "[InGameTopbar.GetBarterGoodsBalance|=1]" + max_width = 50 + default_format = "#N" + } + } + } + } + expand = {} + + divider_light = { + layoutpolicy_vertical = expanding + alpha = 0.8 + } + } + expand = {} + } + } + + widget = { + name = "prestige" + datacontext = "[InGameTopbar.GetPrestigeItem]" + size = { 112 70 } + + widget = { + size = { 112 45 } + + tooltipwidget = { + widget_resource_value_tooltip = {} + } + using = tooltip_ne + } + + background = { + texture = "gfx/interface/skinned/resource_panel_piece.dds" + } + + vbox = { + margin_top = -2 + + hbox = { + layoutpolicy_horizontal = expanding + expand = {} + + hbox = { + spacing = 7 + + icon = { + name = "prestige_icon" + size = { 30 30 } + texture = "[GetPlayer.GetPrestigeLevelTexture]" + } + + flowcontainer = { + margin_bottom = 7 + spacing = -6 + direction = vertical + + text_single = { + name = "prestige_value" + text = "[GetPlayer.GetPrestige|0]" + max_width = 50 + default_format = "#high" + using = Font_Size_Medium + } + + container_resource_balance = {} + } + } + + expand = {} + + divider_light = { + layoutpolicy_vertical = expanding + alpha = 0.8 + } + } + expand = {} + } + } + + + + widget = { + name = "piety" + datacontext = "[InGameTopbar.GetPietyItem]" + size = { 112 70 } + + button = { + size = { 112 45 } + onclick = "[OpenGameViewData( 'faith', GetPlayer.GetFaith.GetID )]" + + using = tooltip_ne + tooltipwidget = { + widget_resource_value_tooltip = {} + } + } + + background = { + texture = "gfx/interface/skinned/resource_panel_piece.dds" + } + + vbox = { + margin_top = -2 + + hbox = { + layoutpolicy_horizontal = expanding + expand = {} + + hbox = { + spacing = 6 + + icon = { + name = "piety_icon" + size = { 30 30 } + texture = "[GetPlayer.GetPietyLevelTexture]" + } + + flowcontainer = { + margin_bottom = 7 + spacing = -6 + direction = vertical + + text_single = { + name = "piety_value" + text = "[GetPlayer.GetPiety|0]" + + max_width = 50 + default_format = "#high" + using = Font_Size_Medium + } + + container_resource_balance = {} + } + } + + expand = {} + + divider_light = { + layoutpolicy_vertical = expanding + alpha = 0.8 + } + } + expand = {} + } + } + + + widget = { + name = "provisions" + visible = "[IsLandlessAdventurer( GetPlayer )]" + size = { 112 70 } + + widget = { + datacontext = "[GetPlayer.GetDomicile]" + size = { 112 45 } + + tooltip = "[Domicile.GetProvisionsBreakdown]" + using = tooltip_ne + } + + background = { + texture = "gfx/interface/skinned/resource_panel_piece.dds" + } + + vbox = { + datacontext = "[GetPlayer.GetDomicile]" + margin_top = -2 + + hbox = { + layoutpolicy_horizontal = expanding + expand = {} + + hbox = { + spacing = 7 + + icon = { + name = "provisions_icon" + size = { 30 30 } + + framesize = { 60 60 } + frame = 0 + texture = "gfx/interface/icons/icon_camp_supply.dds" + } + + flowcontainer = { + margin_bottom = 7 + spacing = -6 + direction = vertical + ignoreinvisible = yes + + text_single = { + name = "provisions_value_positive" + visible = "[Not( Or( Domicile.IsProvisionsLow, Domicile.IsProvisionsCritical ) )]" + + text = "[Domicile.GetProvisions|0]" + max_width = 50 + default_format = "#high" + using = Font_Size_Medium + } + + text_single = { + name = "provisions_value_low" + visible = "[Domicile.IsProvisionsLow]" + + text = "[Domicile.GetProvisions|0]" + max_width = 50 + default_format = "#color_yellow" + using = Font_Size_Medium + } + + text_single = { + name = "provisions_value_critical" + visible = "[Domicile.IsProvisionsCritical]" + + text = "[Domicile.GetProvisions|0]" + max_width = 50 + default_format = "#N" + using = Font_Size_Medium + } + + container = { + text_single = { + name = "provisions_max" + text = "[Domicile.GetProvisionsMax]" + max_width = 50 + default_format = "#low" + } + } + } + } + expand = {} + divider_light = { + layoutpolicy_vertical = expanding + alpha = 0.8 + } + } + expand = {} + + hbox = { + layoutpolicy_horizontal = expanding + spacing = 6 + + + vbox = { + margin_top = -2 + layoutpolicy_vertical = expanding + + expand = {} + } + } + expand = {} + } + } + + widget = { + name = "influence" + datacontext = "[InGameTopbar.GetInfluenceItem]" + visible = "[GetPlayer.GetGovernment.HasRule( 'administrative' )]" + size = { 112 70 } + + widget = { + size = { 112 45 } + + tooltipwidget = { + widget_resource_value_tooltip = {} + } + using = tooltip_ne + } + + background = { + texture = "gfx/interface/skinned/resource_panel_piece.dds" + } + + vbox = { + margin_top = -2 + + hbox = { + layoutpolicy_horizontal = expanding + expand = {} + + hbox = { + spacing = 7 + + icon = { + name = "influence_icon" + size = { 30 30 } + texture = "[GetPlayer.GetInfluenceLevelTexture]" + } + + flowcontainer = { + margin_bottom = 7 + spacing = -6 + direction = vertical + + text_single = { + name = "influence_value" + text = "[GetPlayer.GetInfluence|0]" + max_width = 50 + default_format = "#high" + using = Font_Size_Medium + } + + container_resource_balance = {} + } + } + + expand = {} + + divider_light = { + layoutpolicy_vertical = expanding + alpha = 0.8 + } + } + expand = {} + } + } + + widget = { + name = "renown" + datacontext = "[InGameTopbar.GetDynastyPrestigeItem]" + size = { 112 70 } + layoutpolicy_vertical = expanding + + button = { + size = { 112 45 } + onclick = "[DefaultOnHouseCoatOfArmsClick(GetPlayer.GetHouse.GetID)]" + + using = tooltip_ne + tooltipwidget = { + widget_resource_value_tooltip = {} + } + } + + background = { + texture = "gfx/interface/skinned/resource_panel_piece.dds" + } + + vbox = { + margin_top = -2 + + hbox = { + layoutpolicy_horizontal = expanding + expand = {} + + hbox = { + spacing = 6 + + icon = { + visible = "[GetPlayer.IsDynast]" + texture = "[GetPlayer.GetDynasty.GetDynastyPrestigeLevelTexture]" + size = { 30 30 } + } + + icon = { + visible = "[Not(GetPlayer.IsDynast)]" + texture = "[GetPlayer.GetDynasty.GetDynastyPrestigeLevelTexture]" + size = { 30 30 } + alpha = 0.3 + } + + flowcontainer = { + visible = "[GetPlayer.IsDynast]" + margin_bottom = 7 + spacing = -6 + direction = vertical + + text_single = { + name = "prestige_value" + text = "[GetPlayer.GetDynasty.GetPrestige|0]" + + max_width = 50 + default_format = "#high" + using = Font_Size_Medium + } + + container_resource_balance = {} + } + + flowcontainer = { + visible = "[Not(GetPlayer.IsDynast)]" + margin_bottom = 7 + spacing = -6 + direction = vertical + + text_single = { + name = "prestige_value_nodynast" + text = "[GetPlayer.GetDynasty.GetPrestige|0]" + + max_width = 50 + default_format = "#low" + using = Font_Size_Medium + } + + container_resource_balance = {} + } + } + + expand = {} + + divider_light = { + layoutpolicy_vertical = expanding + alpha = 0.8 + } + } + expand = {} + } + } + + widget = { + name = "herd" + datacontext = "[GetPlayer]" + datacontext = "[Character.GetDomicile]" + visible = "[IsNomad( GetPlayer )]" + size = { 112 70 } + + state = { + name = _mouse_enter + on_start = "[InGameTopbar.ResetLastUpdateFrame]" + } + + widget = { + size = { 112 45 } + using = tooltip_ne + + tooltipwidget = { + herd_breakdown_hud_toolip = {} + } + } + + background = { + texture = "gfx/interface/skinned/resource_panel_piece.dds" + } + + vbox = { + margin_top = -2 + + hbox = { + layoutpolicy_horizontal = expanding + expand = {} + + hbox = { + spacing = 7 + + icon = { + name = "herd_icon" + size = { 30 30 } + + texture = "gfx/interface/icons/icon_herd.dds" + } + + flowcontainer = { + margin_bottom = 7 + spacing = -6 + direction = vertical + ignoreinvisible = yes + + text_single = { + name = "herd_value_positive" + visible = "[Not( Domicile.IsAboveHerdLimit )]" + + text = "[Domicile.GetHerd|0]" + max_width = 50 + default_format = "#high" + using = Font_Size_Medium + } + + text_single = { + name = "above_herd_limit" + visible = "[Domicile.IsAboveHerdLimit]" + + text = "[Domicile.GetHerd|0]" + max_width = 50 + default_format = "#color_yellow" + using = Font_Size_Medium + } + + container = { + text_single = { + name = "army_from_herd" + text = "[InGameTopbar.GetHerdChangeValue|=1]" + max_width = 50 + default_format = "#low" + } + } + } + } + expand = {} + + divider_light = { + layoutpolicy_vertical = expanding + alpha = 0.8 + } + } + expand = {} + } + } + } + + hbox = { + name = "military" + datacontext = "[GetPlayer]" + + widget = { + button = { + size = { 112 45 } + onclick = "[ToggleGameViewData('military', GetPlayer.GetID)]" + + tooltip = "[InGameTopbar.GetMilitaryTooltip]" + using = tooltip_ne + } + + size = { 112 70 } + + background = { + texture = "gfx/interface/skinned/resource_panel_piece_light.dds" + } + + ### Stiches for the Nomadic UI skin placed as a separate texture to be able to place it perfectly aligned with texture change and tiling. + ### Placed on top of the divider that is there normally. + widget = { + name = "nomadic_stiches_divider" + visible = "[IsNomad( GetPlayer )]" + parentanchor = vcenter + size = { 10 42 } + position = { -6 -17 } + + icon = { + parentanchor = center + position = { 0 0 } + size = { 10 42 } + texture = "gfx/interface/hud/nomadic_resource_panel_stiches.dds" + } + } + + vbox = { + margin_top = 4 + + hbox = { + layoutpolicy_horizontal = expanding + expand = {} + + hbox = { + spacing = 5 + icon = { + name = "icon_soldier" + texture = "gfx/interface/icons/icon_soldier.dds" + size = { 25 25 } + } + + flowcontainer = { + direction = vertical + datacontext = "[GetPlayerArmyComposition]" + + flowcontainer = { + spacing = 2 + + text_single = { + name = "strength" + text = "[InGameTopbar.GetCurrentTroopsCount]" + default_format = "#high" + align = nobaseline + } + + army_quality_icon = {} + } + + progressbar_standard = { + name = "soldiers_max" + size = { 40 8 } + visible = "[NotEqualTo_int32(ArmyComposition.GetMaxNumberOfSoldiers, '(int32)0')]" + + min = 0 + max = "[IntToFloat(ArmyComposition.GetMaxNumberOfSoldiers)]" + value = "[IntToFloat(ArmyComposition.GetCurrentNumberOfSoldiers)]" + } + } + } + + expand = {} + } + + expand = {} + } + } + + widget = { + name = "domain_limit" + visible = "[Not( IsLandlessAdventurer( GetPlayer ) )]" + + layoutpolicy_vertical = expanding + + button = { + size = { 112 45 } + onclick = "[ToggleGameViewData( 'my_realm', 'bookmark_domain' )]" + + tooltip = "[Character.GetDomainLimitTooltip]" + using = tooltip_ne + } + + size = { 112 70 } + + background = { + texture = "gfx/interface/skinned/resource_panel_end.dds" + } + + vbox = { + margin_top = 4 + + hbox = { + margin_bottom = 16 + + expand = {} + hbox = { + margin = { 5 5 } + spacing = 5 + + background = { + visible = "[GreaterThan_int32( Character.GetDomainSize, Character.GetDomainLimit )]" + using = Status_Bad + margin_bottom = -3 + } + + icon = { + texture = "gfx/interface/icons/icon_domain.dds" + size = { 25 25 } + } + + text_single = { + name = "value" + text = "[Character.GetDomainSize]/[Character.GetDomainLimit]" + align = nobaseline + margin_bottom = 1 + max_width = 110 + } + } + expand = {} + } + expand = {} + } + } + } + } + } + } + + type container_royal_court_tooltip = container + { + using = GeneralTooltipSetup + alwaystransparent = no + + object_tooltip_pop_out = { + blockoverride "title_text" + { + margin = { 0 8 } + text = "ROYAL_COURT" + default_format = "#T" + } + + blockoverride "concept_link" + { + visible = no + } + + blockoverride "main_description" + { + vbox = { + layoutpolicy_horizontal = expanding + + cooltip_paragraph = { + visible = "[Not( Character.HasRoyalCourt )]" + text = "[Character.GetRoyalCourtBlockers]" + } + + cooltip_paragraph = { + visible = "[GreaterThan_int32( Character.GetNumPendingCourtEvents, '(int32)0' )]" + text = "ROYAL_COURT_STATUS_PENDING_EVENTS_BULLET" + } + cooltip_paragraph = { + visible = "[GreaterThan_int32( LocalPlayerNewArtifacts.GetNumNewArtifactsOfCategory( 'court' ), '(int32)0' )]" + text = "ROYAL_COURT_STATUS_NEW_COURT_ARTIFACTS_BULLET" + } + cooltip_paragraph = { + visible = "[And(LessThan_int32( CourtGrandeurData.GetCurrentLevel, CourtGrandeurData.GetMinimumExpectedLevel ),HasDlcFeature( 'royal_court' ))]" + text = "ROYAL_COURT_STATUS_CGV_EXPECTATIONS_BULLET" + } + cooltip_paragraph = { + visible = "[GreaterThan_int32( LocalPlayerCourtEvents.GetNumberCourtEvents, '(int32)0' )]" + text = "ROYAL_COURT_STATUS_CURRENT_EVENTS_BULLET" + } + } + } + } + } + + type activity_hud_button = button_normal + { + size = { 58 58 } + + tooltip = "TT_ACTIVITY_WIDGET" + using = tooltip_above + onclick = "[Activity.OpenActivityView]" + + icon_round_button_base = {} + + icon = { + name = "progress_frame" + texture = "gfx/interface/progressbars/action_progress_frame.dds" + size = { 100% 100% } + parentanchor = center + alpha = 0.5 + } + + progresspie = { + name = "progress" + visible = "[Character.HasActivityState( 'travel' )]" + size = { 50 50 } + + texture = "gfx/interface/progressbars/action_progress_thin.dds" + + framesize = { 128 128 } + frame = 2 + + widgetanchor = center + parentanchor = center + + min = 0 + max = 1 + value = "[Character.GetTravelPlan.GetData.GetNextDestinationProgress]" + } + + highlight_icon = { + texture = "[Activity.GetType.GetIcon]" + alwaystransparent = yes + size = { 45 45 } + parentanchor = center + } + } + + type icon_hud_background = icon { + size = { 200 64 } + texture = "gfx/interface/skinned/hud_bg_character_bar.dds" + spritetype = corneredtiled + spriteborder_left = 70 + spriteborder_right = 240 + texture_density = 2 + + state = { + name = _show + using = Animation_Curve_Default + duration = 0.21 + + position = { 0 0 } + alpha = 1 + } + + state = { + name = _hide + using = Animation_Curve_Default + duration = 0.21 + + position = { -36 50 } + alpha = 0 + } + } + + type tax_jurisdictions_button_tooltip = widget { + alwaystransparent = no + datacontext = "[GetPlayer]" + + vbox = { + using = Background_Tooltip + spacing = 10 + margin = { 20 10 } + parentanchor = right|vcenter + text_single = { + text = "TAX_JURISDICTIONS_BUTTON" + layoutpolicy_horizontal = expanding + } + + hbox = { + layoutpolicy_horizontal = expanding + visible = "[Or( Or( GreaterThan_int32( Character.GetUnassignedVassalsCount, '(int32)0' ), Not( Character.HasTaxSlots ) ), GreaterThan_int32( Character.GetUntaxedJurisdictionCount, '(int32)0' ) )]" + + icon = { + size = { 25 25 } + texture = "gfx/interface/icons/symbols/icon_warning.dds" + } + + vbox = { + layoutpolicy_horizontal = expanding + margin_left = 5 + + text_single = { + visible = "[GreaterThan_int32( Character.GetUntaxedJurisdictionCount, '(int32)0' )]" + layoutpolicy_horizontal = expanding + text = "TAX_SLOT_OVERVIEW_WINDOW_TAX_SLOTS_WARNING" + default_format = "#N" + max_width = 320 + } + + text_single = { + visible = "[GreaterThan_int32( Character.GetUnassignedVassalsCount, '(int32)0' )]" + layoutpolicy_horizontal = expanding + text = "TAX_SLOT_OVERVIEW_WINDOW_UNASSIGNED_VASSALS_WARNING" + default_format = "#N" + max_width = 320 + } + + text_single = { + visible = "[Not( Character.HasTaxSlots )]" + layoutpolicy_horizontal = expanding + text = "NO_TAX_SLOT_AVAILABLE" + default_format = "#N" + max_width = 320 + } + } + } + expand = {} + } + } + + type administrative_button_tooltip = widget { + alwaystransparent = no + datacontext = "[GetPlayer]" + + vbox = { + using = DefaultTooltipBackground + spacing = 10 + margin = { 20 10 } + parentanchor = right|vcenter + + text_single = { + text = "ADMINISTRATIVE_BUTTON" + layoutpolicy_horizontal = expanding + } + expand = {} + } + } + + type epidemic_hud_tooltip_list = vbox + { + layoutpolicy_horizontal = expanding + spacing = 10 + + background = { + using = Background_Area_With_Header + margin = { 10 7 } + using = Mask_Rough_Edges + } + + cooltip_paragraph = { + block "heading_text" + { + raw_text = "#D Fill me#!" + } + default_format = "#S" + } + + vbox = { + layoutpolicy_horizontal = expanding + spacing = 10 + + block "epidemic_datamodel" + { + } + + item = { + hbox = { + layoutpolicy_horizontal = expanding + spacing = 10 + visible = "[Epidemic.IsValidCheck]" + + background = { + using = Background_Area + using = Mask_Rough_Edges + using = Background_Alternate_Datamodel + margin = { 10 7 } + } + + icon_epidemic = { + tooltipwidget = epidemic_tooltip + } + + vbox = { + layoutpolicy_horizontal = expanding + + cooltip_paragraph = { + text = "[Epidemic.GetName]" + default_format = "#S" + } + + cooltip_paragraph = { + text = "EPIDEMIC_TOTAL_DEATH_TOLL" + } + + block "item_extra_data" + { + } + } + + expand = {} + } + } + } + } + + type epidemic_hud_tooltip = object_tooltip_pop_out + { + blockoverride "title_text" + { + text = "EPIDEMICS_TITLE" + default_format = "#T" + } + + blockoverride "concept_link" + { + visible = no + } + + blockoverride "main_description" + { + vbox = { + layoutpolicy_horizontal = expanding + spacing = 16 + + epidemic_hud_tooltip_list = { + name = "realm_epidemics" + visible = "[DataModelHasItems( InGameBottomBar.GetEpidemicsInRealm )]" + + blockoverride "heading_text" + { + text = "HUD_EPIDEMICS_IN_REALM" + } + blockoverride "epidemic_datamodel" + { + datamodel = "[InGameBottomBar.GetEpidemicsInRealm]" + } + blockoverride "item_extra_data" + { + cooltip_paragraph = { + text = "EPIDMIC_TOOLTIP_DOMAIN_INFECTIONS" + } + } + } + + epidemic_hud_tooltip_list = { + name = "nearby_epidemics" + visible = "[DataModelHasItems( InGameBottomBar.GetEpidemicsBorderingRealm )]" + + blockoverride "heading_text" + { + text = "HUD_EPIDEMICS_BORDERING_REALM" + } + blockoverride "epidemic_datamodel" + { + datamodel = "[InGameBottomBar.GetEpidemicsBorderingRealm]" + } + } + + epidemic_hud_tooltip_list = { + name = "global_epidemics" + visible = "[DataModelHasItems( InGameBottomBar.GetGlobalNotificationEpidemics )]" + + blockoverride "heading_text" + { + text = "HUD_EPIDEMICS_GLOBAL_NOTIFICATIONS" + } + blockoverride "epidemic_datamodel" + { + datamodel = "[InGameBottomBar.GetGlobalNotificationEpidemics]" + } + blockoverride "item_extra_data" + { + cooltip_paragraph = { + text = "HUD_EPIDEMIC_GLOBAL_NOTIFICATION" + default_format = "#flavor" + } + } + } + } + } + } + + type button_epidemics = button + { + size = { 80 80 } + using = tooltip_ne + + onclick = "[ToggleGameView( 'epidemics' )]" + + tooltipwidget = { + epidemic_hud_tooltip = {} + } + + video_icon = { + name = "epidemic_particules" + size = { 80 80 } + + visible = "[InGameBottomBar.HasGlobalNotificationEpidemic]" + + gfxtype = videogfx + shaderfile = "" + video = "gfx/particles/fly.bk2" + loop = yes + + modify_texture = { + texture = "gfx/interface/component_masks/mask_fade_horizontal_right.dds" + blend_mode = alphamultiply + spriteType = corneredTiled + alpha = 0.8 + } + modify_texture = { + texture = "gfx/interface/component_masks/mask_fade_horizontal_right.dds" + blend_mode = alphamultiply + spriteType = corneredTiled + mirror = horizontal + alpha = 0.8 + } + } + + button = { + name = "epidemic_icon_global_notify" + visible = "[InGameBottomBar.HasGlobalNotificationEpidemic]" + texture = "gfx/interface/hud/button_epidemics_black_plague.dds" + size = { 100% 100% } + alwaystransparent = yes + } + + button = { + name = "epidemic_icon" + visible = "[Not( InGameBottomBar.HasGlobalNotificationEpidemic )]" + texture = "gfx/interface/hud/button_epidemics.dds" + size = { 100% 100% } + alwaystransparent = yes + } + } + + type legends_hud_tooltip = object_tooltip_pop_out + { + blockoverride "title_text" + { + text = "LEGENDS_TITLE" + default_format = "#T" + margin = { 0 5 } + } + + blockoverride "concept_link" + { + visible = no + } + + blockoverride "main_description" + { + vbox = { + layoutpolicy_horizontal = expanding + spacing = 15 + + datacontext = "[GetPlayer]" + datacontext = "[Character.GetPromotedLegend]" + datacontext = "[AccessLocalPlayerCachedData]" + + vbox = { + name = "promoted_legend" + layoutpolicy_horizontal = expanding + spacing = 15 + + visible = "[And( Legend.IsValid, Not( Legend.IsCompleted ) )]" + + background = { + using = Background_Area_With_Header + margin = { 10 7 } + using = Mask_Rough_Edges + } + + cooltip_paragraph = { + datacontext = "[Character.GetPromotedLegend]" + + text = "PROMOTED_LEGEND" + default_format = "#S" + } + + hbox = { + layoutpolicy_horizontal = expanding + spacing = 10 + + background = { + using = Background_Area + using = Mask_Rough_Edges + using = Background_Alternate_Datamodel + margin = { 10 7 } + } + + icon_legend = { + datacontext = "[Legend.GetType]" + tooltipwidget = legend_tooltip + } + + vbox = { + layoutpolicy_horizontal = expanding + + cooltip_paragraph = { + text = "[Legend.GetName]" + default_format = "#S" + } + + legend_summary_vbox = {} + } + + expand = {} + } + } + + vbox = { + name = "legend_seeds" + layoutpolicy_horizontal = expanding + + cooltip_paragraph = { + text = "LEGEND_SEEDS" + default_format = "#S" + } + + cooltip_paragraph = { + text = "HUD_LEGEND_SEEDS" + visible = "[Or( DataModelHasItems( Character.GetLegendSeeds ), DataModelHasItems( LocalPlayerCachedData.GetTriggeredLegendSeeds ) )]" + } + + cooltip_paragraph = { + text = "LEGEND_SEEDS_EMPTY" + visible = "[And( IsDataModelEmpty( Character.GetLegendSeeds ), IsDataModelEmpty( LocalPlayerCachedData.GetTriggeredLegendSeeds ) )]" + } + } + } + } + } + + type icon_power_sharing_level = highlight_icon { + size = { 28 28 } + + texture = "gfx/interface/window_regency/regency_level_button_badge.dds" + + text_single = { + align = nobaseline + parentanchor = center + raw_text = "[Diarchy.GetPowerLevel]" + } + } + + + type legitimacy_hud_tooltip = object_tooltip_pop_out + { + visible = "[And(LegitimacyType.IsValid, Character.GetGovernment.HasRule( 'legitimacy' ))]" + + blockoverride "title_text" + { + margin = { 0 8 } + text = "legitimacy_hud_tt" + default_format = "#T" + } + + blockoverride "concept_link" + { + text = "[legitimacy|E]" + } + + blockoverride "subheading" + { + text_single = { + layoutpolicy_horizontal = expanding + autoresize = yes + fontsize_min = 14 + using = Font_Size_Small + text = "legitimacy_hud_tt_subheading" + default_format = "#weak" + fonttintcolor = "[TooltipInfo.GetTintColor]" + max_width = 400 + + margin_top = -4 + } + } + + blockoverride "header_additions" + { + widget = { + size = { 120 74 } + + widget = { + size = { 240 74 } + position = { -16 0 } + visible = "[And( Not( IsNomad( GetPlayer ) ), Not( GetPlayer.GetGovernment.IsType( 'celestial_government' ) ) )]" + + proportional_icon = { + size = { 100% 100% } + visible = "[GreaterThanOrEqualTo_int32( LegitimacyLevel.GetIndex, Character.GetAveragePowerfulVassalLegitimacyExpectation.GetIndex )]" + texture = "gfx/interface/window_legend_chronicle/expected_legitimacy_decoration.dds" + + using = Mask_Rough_Edges + + modify_texture = { + texture = "gfx/interface/component_masks/mask_fade_horizontal_right.dds" + blend_mode = alphaMultiply + } + } + + proportional_icon = { + size = { 100% 100% } + visible = "[LessThan_int32( LegitimacyLevel.GetIndex, Character.GetAveragePowerfulVassalLegitimacyExpectation.GetIndex )]" + texture = "gfx/interface/window_legend_chronicle/under_expected_legitimacy_decoration.dds" + + using = Mask_Rough_Edges + + modify_texture = { + texture = "gfx/interface/component_masks/mask_fade_horizontal_right.dds" + blend_mode = alphaMultiply + } + } + } + + widget = { + size = { 240 74 } + position = { -16 0 } + visible = "[IsNomad( GetPlayer )]" + + proportional_icon = { + size = { 100% 100% } + visible = "[GreaterThanOrEqualTo_int32( LegitimacyLevel.GetIndex, Character.GetAveragePowerfulVassalLegitimacyExpectation.GetIndex )]" + texture = "gfx/interface/illustrations/decisions/mpo_decision_great_khan.dds" + mirror = horizontal + + using = Mask_Rough_Edges + + modify_texture = { + texture = "gfx/interface/component_masks/mask_fade_horizontal.dds" + blend_mode = alphaMultiply + } + } + + proportional_icon = { + size = { 100% 100% } + visible = "[LessThan_int32( LegitimacyLevel.GetIndex, Character.GetAveragePowerfulVassalLegitimacyExpectation.GetIndex )]" + texture = "gfx/interface/illustrations/event_scenes/mpo_raid_burning_asian.dds" + mirror = horizontal + + using = Mask_Rough_Edges + + modify_texture = { + texture = "gfx/interface/component_masks/mask_fade_horizontal.dds" + blend_mode = alphaMultiply + } + } + } + + widget = { + size = { 240 74 } + position = { -16 0 } + visible = "[GetPlayer.GetGovernment.IsType( 'celestial_government' )]" + + proportional_icon = { + size = { 100% 100% } + visible = "[GreaterThanOrEqualTo_int32( LegitimacyLevel.GetIndex, Character.GetAveragePowerfulVassalLegitimacyExpectation.GetIndex )]" + texture = "gfx/interface/illustrations/event_story/tgp_dynastic_cycle_stability.dds" + mirror = horizontal + + using = Mask_Rough_Edges + + modify_texture = { + texture = "gfx/interface/component_masks/mask_fade_horizontal.dds" + blend_mode = alphaMultiply + } + } + + proportional_icon = { + size = { 100% 100% } + visible = "[LessThan_int32( LegitimacyLevel.GetIndex, Character.GetAveragePowerfulVassalLegitimacyExpectation.GetIndex )]" + texture = "gfx/interface/illustrations/event_story/tgp_dynastic_cycle_consolidation.dds" + mirror = horizontal + + using = Mask_Rough_Edges + + modify_texture = { + texture = "gfx/interface/component_masks/mask_fade_horizontal.dds" + blend_mode = alphaMultiply + } + } + } + } + } + + + blockoverride "main_description" + { + vbox = { + layoutpolicy_horizontal = expanding + margin_right = 10 + + hbox = { + layoutpolicy_horizontal = expanding + + cooltip_paragraph = { + text = "LEGITIMACY_EFFECTS" + max_width = 500 + } + expand = { + layoutpolicy_horizontal = expanding + } + } + spacer = { + size = { 0 15 } + } + + ### LEGITIMACY BREAKDOWN + hbox = { + datacontext = "[Character.GetMonthlyLegitimacyTooltip]" + visible = "[Not( EqualTo_CFixedPoint( Character.GetLegitimacy, '(CFixedPoint)0' ))]" + layoutpolicy_horizontal = expanding + using = tooltip_se + + text_single = { + + layoutpolicy_horizontal = expanding + + text = "[Character.GetMonthlyLegitimacy]" + align = nobaseline + } + + tooltip_visible = "[ValueBreakdown.HasTooltip]" + tooltipwidget = { + visible = "[ValueBreakdown.HasTooltip]" + widget_value_breakdown_tooltip = {} + } + expand = {} + } + + spacer = { + size = { 0 15 } + } + + hbox = { + name = "track_header" + layoutpolicy_horizontal = expanding + spacing = 5 + margin_left = -10 + min_height = 45 + + background = { + using = Background_Area + margin = { -5 -5 } + + modify_texture = { + texture = "gfx/interface/component_masks/mask_fade_horizontal_right.dds" + blend_mode = alphaMultiply + } + } + + icon_legitimacy_flat = {} + + text_single = { + text = "LEGITIMACY_TRACK_TITLE" + layoutpolicy_horizontal = expanding + align = nobaseline + } + } + + margin_widget = { + size = { 500 50 } + margin = { 10 0 } + + datacontext = "[Character.GetLegitimacyType]" + datacontext = "[Character.GetLegitimacyLevel]" + + hbox_complex_bar_progress = { + layoutpolicy_horizontal = expanding + margin_top = 30 + } + + hbox_complex_bar_levels = { + layoutpolicy_horizontal = expanding + position = { 0 -10 } + blockoverride "marker" + { + widget_level_marker = { + scale = 0.75 + + # Hide last one, it is the maximum not an actual level + visible = "[LessThan_int32( PdxGuiWidget.GetIndexInDataModel, GetDataModelSize( LegitimacyType.GetLevels ) )]" + + blockoverride "marker_addon" { + icon = { + texture = "gfx/interface/colors/white.dds" + using = Mask_Rough_Edges + position = { -4 28 } + size = { 8 40 } + alpha = 0.4 + + visible = "[GreaterThan_int32( PdxGuiWidget.GetIndexInDataModel, '(int32)0' )]" + } + + widget = { + size = { 52 52 } + position = { -26 24 } + visible = "[And( EqualTo_int32( Character.GetAveragePowerfulVassalLegitimacyExpectation.GetIndex, PdxGuiWidget.GetIndexInDataModel ), Not( Character.GetGovernment.HasRule( 'deny_powerful_vassal' ) ) ) ]" + + icon = { + size = { 100% 100% } + visible = "[Not(LessThan_int32( LegitimacyLevel.GetIndex, Character.GetAveragePowerfulVassalLegitimacyExpectation.GetIndex ))]" + texture = "gfx/interface/window_legend_chronicle/pin_expected_legitimacy.dds" + } + + icon = { + size = { 100% 100% } + visible = "[LessThan_int32( LegitimacyLevel.GetIndex, Character.GetAveragePowerfulVassalLegitimacyExpectation.GetIndex )]" + texture = "gfx/interface/window_legend_chronicle/pin_under_expected_legitimacy.dds" + } + + widget = { + parentanchor = center + size = { 28 28 } + + icon_flat_standard_red = { + size = { 100% 100% } + visible = "[LessThan_int32( LegitimacyLevel.GetIndex, Character.GetAveragePowerfulVassalLegitimacyExpectation.GetIndex )]" + texture = "[LegitimacyType.GetFlatIcon]" + } + + icon_flat_standard = { + size = { 100% 100% } + visible = "[Not(LessThan_int32( LegitimacyLevel.GetIndex, Character.GetAveragePowerfulVassalLegitimacyExpectation.GetIndex ))]" + texture = "[LegitimacyType.GetFlatIcon]" + } + } + } + widget = { + size = { 52 52 } + position = { -26 24 } + visible = "[And( EqualTo_int32( Character.GetAverageVassalLegitimacyExpectation.GetIndex, PdxGuiWidget.GetIndexInDataModel ), Character.GetGovernment.HasRule( 'deny_powerful_vassal' ) ) ]" + + icon = { + size = { 100% 100% } + visible = "[Not(LessThan_int32( LegitimacyLevel.GetIndex, Character.GetAverageVassalLegitimacyExpectation.GetIndex ))]" + texture = "gfx/interface/window_legend_chronicle/pin_expected_legitimacy.dds" + } + + icon = { + size = { 100% 100% } + visible = "[LessThan_int32( LegitimacyLevel.GetIndex, Character.GetAverageVassalLegitimacyExpectation.GetIndex )]" + texture = "gfx/interface/window_legend_chronicle/pin_under_expected_legitimacy.dds" + } + + widget = { + parentanchor = center + size = { 28 28 } + + icon_flat_standard_red = { + size = { 100% 100% } + visible = "[LessThan_int32( LegitimacyLevel.GetIndex, Character.GetAverageVassalLegitimacyExpectation.GetIndex )]" + texture = "[LegitimacyType.GetFlatIcon]" + } + + icon_flat_standard = { + size = { 100% 100% } + visible = "[Not(LessThan_int32( LegitimacyLevel.GetIndex, Character.GetAverageVassalLegitimacyExpectation.GetIndex ))]" + texture = "[LegitimacyType.GetFlatIcon]" + } + } + } + } + + blockoverride "visible_active" + { + visible = "[EqualTo_int32( LegitimacyLevel.GetIndex, PdxGuiWidget.GetIndexInDataModel )]" + } + + blockoverride "visible_inactive" + { + visible = "[NotEqualTo_int32( LegitimacyLevel.GetIndex, PdxGuiWidget.GetIndexInDataModel )]" + } + + blockoverride "marker_tooltip" + { + datacontext_from_model = { + datamodel = "[LegitimacyType.GetLevels]" + index = "[PdxGuiWidget.GetIndexInDataModel]" + } + tooltip = "LEGITIMACY_TRACK_TOOLTIP" + using = tooltip_se + } + + blockoverride "marker_text" + { + text = "[PdxGuiWidget.GetIndexInDataModel|V]" + } + } + } + } + } + + spacer = { + size = { 0 15 } + } + hbox = { + layoutpolicy_horizontal = expanding + + vbox = { + visible = "[Character.HasVassals]" + spacing = 10 + layoutpolicy_horizontal = expanding + + cooltip_paragraph = { + text = "LEGITIMACY_AVERAGE_EXPECTATIONS" + visible = "[Not(Character.GetGovernment.HasRule( 'deny_powerful_vassal' ))]" + } + cooltip_paragraph = { + text = "LEGITIMACY_AVERAGE_EXPECTATIONS_NO_POWERFUL_VASSALS" + visible = "[Character.GetGovernment.HasRule( 'deny_powerful_vassal' )]" + } + + cooltip_paragraph = { + visible = "[And( LessThan_int32( LegitimacyLevel.GetIndex, Character.GetAveragePowerfulVassalLegitimacyExpectation.GetIndex ), Not( Character.GetGovernment.HasRule( 'deny_powerful_vassal' ) ) ) ]" + text = "LEGITIMACY_BELOW_AVERAGE_EXPECTATIONS" + } + cooltip_paragraph = { + visible = "[And( LessThan_int32( LegitimacyLevel.GetIndex, Character.GetAverageVassalLegitimacyExpectation.GetIndex ), Character.GetGovernment.HasRule( 'deny_powerful_vassal' ) ) ]" + text = "LEGITIMACY_BELOW_AVERAGE_EXPECTATIONS" + } + } + expand = { + layoutpolicy_horizontal = expanding + } + } + } + } + } + + type hbox_merit_with_label = hbox { + visible = "[Character.ShouldShowMerit]" + spacing = 4 + margin = { 4 0 } + + block "hbox_merit_with_label_background" + { + background = { + using = Background_Area + margin = { 4 4 } + } + } + + widget_merit = { + blockoverride "merit_widget_tooltip" + { + # use our own hitbox for the tooltip + } + } + + text_single = { + name = "rank_number" + visible = "[GreaterThanOrEqualTo_int32( Character.GetMeritLevel, '(int32)1' )]" + text = "[GetMeritLevelShortNameNoTooltip( MeritItem.GetCurrentLevel )|V]" + + align = nobaseline + } + + text_single = { + name = "no_rank" + visible = "[LessThanOrEqualTo_int32( Character.GetMeritLevel, '(int32)0' )]" + text = "[GetMeritLevelShortNameNoTooltip( MeritItem.GetCurrentLevel )]" + default_format = "#weak" + max_width = 50 + + align = nobaseline + } + + tooltipwidget = { + merit_hud_tooltip = { + block "merit_tooltip" {} + } + } + } + + type widget_merit = widget { + visible = "[Character.ShouldShowMerit]" + + block "icon_size" + { + size = { 32 32 } + } + + using = tooltip_ne + + block "merit_widget_tooltip" + { + tooltipwidget = { + merit_hud_tooltip = { + block "merit_tooltip" {} + } + } + } + + block "background_texture" + { + icon = { + texture = "gfx/interface/icons/activity_phases/button_activity_base.dds" + size = { 100% 100% } + } + } + + icon = { + name = "progress_frame" + texture = "gfx/interface/progressbars/action_progress_frame.dds" + size = { 100% 100% } + } + + icon = { + parentanchor = center + size = { 66% 66% } + + texture = "[Character.GetMeritLevelTexture]" + frame = "[IntToFrameIndex( Character.GetMeritLevel )]" + + modify_texture = { + name = "lvl_increase" + texture = "gfx/interface/colors/gold.dds" + blend_mode = colordodge + alpha = 0 + } + + modify_texture = { + name = "lvl_decrease" + texture = "gfx/interface/colors/red.dds" + blend_mode = colordodge + alpha = 0 + } + + state = { + name = "merit_level_increase" + next = "merit_level_increase_2" + + modify_texture = { + name = "lvl_increase" + alpha = 0 + } + } + + state = { + name = "merit_level_increase_2" + next = "merit_level_increase_3" + duration = 0.4 + bezier = { 0.5 0 1 0.5 } + + modify_texture = { + name = "lvl_increase" + alpha = 0.7 + } + } + + state = { + name = "merit_level_increase_3" + duration = 0.5 + bezier = { 0 0.5 0.5 1 } + + modify_texture = { + name = "lvl_increase" + alpha = 0 + } + } + + state = { + name = "merit_level_decrease" + next = "merit_level_decrease_2" + + modify_texture = { + name = "lvl_decrease" + alpha = 0 + } + } + + state = { + name = "merit_level_decrease_2" + next = "merit_level_decrease_3" + duration = 0.4 + bezier = { 0.5 0 1 0.5 } + + modify_texture = { + name = "lvl_decrease" + alpha = 0.7 + } + } + + state = { + name = "merit_level_decrease_3" + duration = 0.5 + bezier = { 0 0.5 0.5 1 } + + modify_texture = { + name = "lvl_decrease" + alpha = 0 + } + } + } + + widget = { + size = { 87% 87% } + parentanchor = center + + progresspie = { + name = "progress" + + size = { 100% 100% } + texture = "gfx/interface/progressbars/action_progress_thin_blue.dds" + framesize = { 128 128 } + frame = 2 + min = 0 + max = 100 + value = "[MeritItem.GetProgress]" + } + + icon = { + name = "progress_capped" + visible = "[And(Character.IsMeritCapped, Not( EqualTo_int32( Character.GetMeritLevel, '(int32)9' ) ) )]" + + + size = { 100% 100% } + texture = "gfx/interface/progressbars/action_progress_thin_red.dds" + framesize = { 128 128 } + frame = 2 + } + } + } + + type widget_merit_hud = widget { + visible = "[And(Character.ShouldShowMerit, Character.IsAlive)]" + size = { 74 94 } + + using = tooltip_ne + + block "merit_widget_tooltip" + { + tooltipwidget = { + merit_hud_tooltip = { + block "merit_tooltip" {} + } + } + } + + # WIDGET BACKGROUND TEXTURE + icon = { + texture = "gfx/interface/hud/tgp_widget_merit_background.dds" + size = { 100% 100% } + } + + # MERIT ICON + icon = { + parentanchor = top|hcenter + position = { 0 17 } + size = { 40 40 } + + texture = "[Character.GetMeritLevelTexture]" + frame = "[IntToFrameIndex( Character.GetMeritLevel )]" + + modify_texture = { + name = "lvl_increase" + texture = "gfx/interface/colors/gold.dds" + blend_mode = colordodge + alpha = 0 + } + + modify_texture = { + name = "lvl_decrease" + texture = "gfx/interface/colors/red.dds" + blend_mode = colordodge + alpha = 0 + } + + state = { + name = "merit_level_increase" + next = "merit_level_increase_2" + + modify_texture = { + name = "lvl_increase" + alpha = 0 + } + } + + state = { + name = "merit_level_increase_2" + next = "merit_level_increase_3" + duration = 0.4 + bezier = { 0.5 0 1 0.5 } + + modify_texture = { + name = "lvl_increase" + alpha = 0.7 + } + } + + state = { + name = "merit_level_increase_3" + duration = 0.5 + bezier = { 0 0.5 0.5 1 } + + modify_texture = { + name = "lvl_increase" + alpha = 0 + } + } + + state = { + name = "merit_level_decrease" + next = "merit_level_decrease_2" + + modify_texture = { + name = "lvl_decrease" + alpha = 0 + } + } + + state = { + name = "merit_level_decrease_2" + next = "merit_level_decrease_3" + duration = 0.4 + bezier = { 0.5 0 1 0.5 } + + modify_texture = { + name = "lvl_decrease" + alpha = 0.7 + } + } + + state = { + name = "merit_level_decrease_3" + duration = 0.5 + bezier = { 0 0.5 0.5 1 } + + modify_texture = { + name = "lvl_decrease" + alpha = 0 + } + } + } + + # PROGRESS BAR + widget = { + parentanchor = top|hcenter + position = { 0 9 } + size = { 56 56 } + + + progresspie = { + name = "progress" + + size = { 100% 100% } + texture = "gfx/interface/progressbars/action_progress_thin_blue.dds" + framesize = { 128 128 } + frame = 2 + min = 0 + max = 100 + value = "[MeritItem.GetProgress]" + } + + + icon = { + name = "progress_capped" + visible = "[And(Character.IsMeritCapped, Not( EqualTo_int32( Character.GetMeritLevel, '(int32)9' ) ) )]" + + size = { 100% 100% } + framesize = { 128 128 } + texture = "gfx/interface/progressbars/action_progress_thin_red.dds" + frame = 2 + } + } + + # RANK + text_single = { + visible = "[GreaterThan_int32( Character.GetMeritLevel, '(int32)0' )]" + parentanchor = bottom|hcenter + position = { 0 -6 } + + text = "[GetMeritLevelShortNameNoTooltip( MeritItem.GetCurrentLevel )|V]" + align = nobaseline + using = Font_Size_Small + } + + # IF YOU HAVE NO RANK + text_single = { + visible = "[EqualTo_int32( Character.GetMeritLevel, '(int32)0' )]" + parentanchor = bottom|hcenter + position = { 0 -5 } + + raw_text = "-" + align = nobaseline + using = Font_Size_Small + } + } + + type hbox_merit_complex_bar_progress = hbox { + allow_outside = yes + + hbox = { + layoutpolicy_horizontal = expanding + layoutpolicy_vertical = expanding + layoutstretchfactor_horizontal = "[MeritItem.GetMeritStretchFactor]" + allow_outside = yes + + block "filled" { + background = { + spriteType = Corneredstretched + spriteborder = { 3 3 } + + block "texture_merit" { + texture = "gfx/interface/progressbars/progress_standard.dds" + } + } + } + } + + hbox = { + layoutpolicy_horizontal = expanding + layoutpolicy_vertical = expanding + layoutstretchfactor_horizontal = "[MeritItem.GetOverflowMeritStretchFactor]" + visible = "[GreaterThan_int32( MeritItem.GetOverflowMeritStretchFactor, '(int32)0' )]" + allow_outside = yes + + tooltip = "MERIT_RANK_CAP_TT" + + block "next" { + background = { + spriteType = Corneredstretched + spriteborder = { 3 3 } + + block "texture_overflow_merit" { + texture = "gfx/interface/progressbars/progress_red.dds" + } + } + } + } + + hbox = { + layoutpolicy_horizontal = expanding + layoutpolicy_vertical = expanding + layoutstretchfactor_horizontal = "[MeritItem.GetLeftoverSpaceStretchFactor]" + allow_outside = yes + + block "empty" { + background = { + spriteType = Corneredstretched + spriteborder = { 3 3 } + + block "texture_empty" { + texture = "gfx/interface/progressbars/progress_black.dds" + } + } + } + } + } + + type merit_hud_tooltip = object_tooltip_pop_out { + datacontext = "[MeritItem.GetValueItem]" + datacontext = "[MeritItem.GetComplexBar]" + visible = "[Character.HasMerit]" + + blockoverride "title_text" + { + text = "[GetMeritModifierByLevel( Character.GetMeritLevel ).GetName]" + default_format = "#T" + } + + blockoverride "concept_link" + { + text = "[merit_level|E]" + } + + blockoverride "subheading" + { + text_single = { + max_width = 400 + layoutpolicy_horizontal = expanding + + text = "[Character.GetCareerPathDesc]" + fonttintcolor = "[TooltipInfo.GetTintColor]" + using = Font_Size_Small + fontsize_min = 14 + autoresize = yes + default_format = "#weak_glow" + } + } + + blockoverride "header_additions" + { + widget = { + size = { 60 74 } + + icon = { + size = { 64 64 } + parentanchor = center + position = { -8 0 } + + texture = "[Character.GetMeritLevelTexture]" + frame = "[IntToFrameIndex( Character.GetMeritLevel )]" + } + } + } + + blockoverride "main_description" + { + vbox = { + layoutpolicy_horizontal = expanding + margin_right = 5 + spacing = 16 + + ### MERIT EFFECTS + vbox = { + layoutpolicy_horizontal = expanding + + ### modifier effects + cooltip_paragraph = { + visible = "[Not( StringIsEmpty( GetMeritLevelEffects( Character.GetMeritLevel ) ) )]" + max_width = 500 + text = "[GetMeritLevelEffects( Character.GetMeritLevel )]" + } + + ### Merit affecting Movement Power + cooltip_paragraph = { + visible = "[Character.ShouldShowMovementPower]" + max_width = 500 + text = "MERIT_MOVEMENT_POWER" + } + + ### Merit enabling appointment + cooltip_paragraph = { + max_width = 500 + name = "merit_appointment" + layoutpolicy_horizontal = expanding + + text = "[GetMaxAppointmentRankDescription( 'merit', Character.GetMeritLevel )]" + } + } + + text_label_left = { + layoutpolicy_horizontal = expanding + + text = "MERIT_PROGRESS_HEADING" + } + + ### MERIT COMPLEX PROGRESS BAR + widget = { + layoutpolicy_horizontal = expanding + size = { 500 50 } + + hbox_merit_complex_bar_progress = { + layoutpolicy_horizontal = expanding + margin_top = 30 + margin_right = 16 + margin_left = 5 + } + + hbox_complex_bar_levels = { + layoutpolicy_horizontal = expanding + position = { 0 -10 } + + margin_right = 16 + + blockoverride "marker" + { + widget_level_marker = { + visible = "[And( GreaterThan_int32( ComplexBarItem.GetIndex, '(int32)0' ), LessThan_int32( PdxGuiWidget.GetIndexInDataModel, GetDataModelSize( ComplexBar.GetItems ) ) )]" + scale = 0.75 + + blockoverride "marker_size" + { + size = { 55 55 } + } + + blockoverride "marker_size_inactive" + { + size = { 45 45 } + } + + blockoverride "marker_addon" { + icon = { + texture = "gfx/interface/colors/white.dds" + using = Mask_Rough_Edges + position = { -4 42 } + size = { 8 23 } + alpha = 0.3 + + visible = "[GreaterThan_int32( PdxGuiWidget.GetIndexInDataModel, '(int32)0' )]" + } + + widget = { + size = { 52 52 } + position = { -26 24 } + visible = "[EqualTo_int32( Add_int32( Character.GetMaxMeritLevelForCharacter, '(int32)1' ), PdxGuiWidget.GetIndexInDataModel )]" + tooltip = "MERIT_RANK_CAP_TT" + + icon = { + size = { 100% 100% } + texture = "gfx/interface/window_legend_chronicle/pin_under_expected_legitimacy.dds" + } + + icon_flat_standard_red = { + parentanchor = center + size = { 26 26 } + texture = "gfx/interface/icons/domicile_building/domicile_lock_wagons.dds" + } + } + } + + blockoverride "visible_active" + { + visible = "[EqualTo_int32( MeritItem.GetCurrentLevel, ComplexBarItem.GetIndex )]" + } + + blockoverride "level_inactive_style" + { + datacontext = "[ComplexBarItem]" + allow_outside = yes + + datacontext_from_model = { + datamodel = "[MeritItem.GetLevels]" + index = "[PdxGuiWidget.GetIndexInDataModel]" + } + + modify_texture = { + visible = "[GreaterThan_int32( ComplexBarItem.GetIndex, PlayerValueItem.GetMaxLevelIndex( Character.Self ) )]" + texture = "gfx/interface/colors/black.dds" + blend_mode = multiply + alpha = 0.1 + } + } + + blockoverride "visible_inactive" + { + visible = "[NotEqualTo_int32( MeritItem.GetCurrentLevel, ComplexBarItem.GetIndex )]" + } + + blockoverride "marker_tooltip" + { + datacontext = "[ComplexBarItem]" + + datacontext_from_model = { + datamodel = "[MeritItem.GetLevels]" + index = "[PdxGuiWidget.GetIndexInDataModel]" + } + + tooltip = "MERIT_PROGRESSBAR_MARKER_TOOLTIP" + using = tooltip_se + } + + blockoverride "marker_text" + { + text = "[GetMeritLevelShortNameNoTooltip( ComplexBarItem.GetIndex )]" + } + } + } + } + } + + vbox = { + layoutpolicy_horizontal = expanding + + hbox = { + layoutpolicy_horizontal = expanding + + ### MERIT TOTAL + text_single = { + layoutpolicy_horizontal = expanding + + text = "[Character.GetTotalMerit]" + align = nobaseline + } + + ### MERIT CAP + text_single = { + visible = "[PlayerValueItem.HasNonStandardLevel( Character.Self )]" + layoutpolicy_horizontal = expanding + + text = "[PlayerValueItem.GetMaxLevel( Character.Self )]" + align = right|nobaseline + default_format = "#underline" + + tooltip = "MAX_MERIT_RANK_BREAKDOWN_TOOLTIP" + } + } + + hbox = { + layoutpolicy_horizontal = expanding + + ### MERIT BREAKDOWN WITH TOOLTIP + text_single = { + datacontext = "[PlayerValueItem.GetBalanceGained]" + + text = "[Character.GetMeritBalanceBreakdown]" + align = nobaseline + + tooltip_visible = "[ValueBreakdown.HasTooltip]" + + tooltipwidget = { + widget_value_breakdown_tooltip = { } + } + } + + expand = {} + } + } + + ### MERIT EXAMINATIONS + vbox = { + layoutpolicy_horizontal = expanding + spacing = 5 + + text_label_left = { + layoutpolicy_horizontal = expanding + + text = "MERIT_TOOLTIP_COMPLETED_EXAMINATIONS" + } + + hbox = { + datacontext = "[Character.MakeScope]" + spacing = 50 + + widget_childrens_exam_status = {} + + widget_provincial_exam_status = {} + + widget_metropolitan_exam_status = {} + + widget_palace_exam_status = {} + } + + text_single = { + layoutpolicy_horizontal = expanding + + text = "MERIT_TOOLTIP_EXAMINATION_DISCLAIMER" + default_format = "#weak" + } + } + } + } + } + + type passed_examination_icon = icon_flat_standard_green + { + size = { 30 30 } + texture = "gfx/interface/icons/flat_icons/passed_examination_icon.dds" + + background = { + using = Background_Area_Solid + + block "background_margins" + { + margin = { -1 -1 } + } + } + } + + type failed_examination_icon = icon_flat_standard_red + { + size = { 30 30 } + texture = "gfx/interface/icons/flat_icons/failed_examination_icon.dds" + + background = { + using = Background_Area_Solid + + margin = { -1 -1 } + } + } + + type herd_breakdown_hud_toolip = container + { + using = GeneralTooltipSetup + alwaystransparent = no + + object_tooltip_pop_out = { + blockoverride "title_text" + { + margin = { 0 8 } + text = "DOMICILE_HERD_TITLE" + default_format = "#T" + + block "herd_limit_breakdown" + { + datacontext = "[InGameTopbar.GetHerdLimitBreakdown( Domicile.Self )]" + } + tooltipwidget = { + widget_value_breakdown_tooltip = {} + } + } + + blockoverride "concept_link" + { + visible = no + } + + blockoverride "main_description" + { + vbox = { + layoutpolicy_horizontal = expanding + + cooltip_paragraph = { + visible = "[Domicile.IsAboveHerdLimit]" + text = "[Domicile.GetAboveHerdLimitEffects]" + } + + spacer = { + visible = "[Domicile.IsAboveHerdLimit]" + size = { 0 15 } + } + + cooltip_paragraph = { + block "herd_change_breakdown" + { + datacontext = "[InGameTopbar.GetHerdChangeBreakdown]" + } + + text = "VALUE_BREAKDOWN_TEXT_LINK" + + tooltip_visible = "[ValueBreakdown.HasTooltip]" + + tooltipwidget = { + widget_value_breakdown_tooltip = {} + } + } + + cooltip_paragraph = { + block "herd_conversion_breakdown" + { + datacontext = "[InGameTopbar.GetHerdConversionBreakdown( Domicile.Self )]" + } + + text = "VALUE_BREAKDOWN_TEXT_LINK" + + tooltip_visible = "[ValueBreakdown.HasTooltip]" + + tooltipwidget = { + widget_value_breakdown_tooltip = {} + } + } + + spacer = { + size = { 0 15 } + } + + cooltip_paragraph = { + visible = "[Character.HasRaisedHorde]" + text = "DOMICILE_HERD_ALREADY_RAISED" + } + + cooltip_paragraph = { + visible = "[Not( Character.HasRaisedHorde )]" + text = "DOMICILE_HERD_HERD_TO_RAISE" + } + } + } + } + } +} diff --git a/gui/texticons.gui b/gui/texticons.gui index b9144e41..5082094a 100644 --- a/gui/texticons.gui +++ b/gui/texticons.gui @@ -4624,6 +4624,16 @@ texticon = { } } +texticon = { + icon = government_type_landless_minority + iconsize = { + texture = "gfx/interface/icons/government_types/landless_minority_government.dds" + size = { 28 28 } + offset = { 0 6 } + fontsize = 16 + } +} + texticon = { icon = government_type_celestial iconsize = { diff --git a/history/characters/NEOW_e_britannia.txt b/history/characters/NEOW_e_britannia.txt index a63ddd6e..c511672b 100644 --- a/history/characters/NEOW_e_britannia.txt +++ b/history/characters/NEOW_e_britannia.txt @@ -1192,6 +1192,19 @@ britannia_tabb_ian = { } } +brit_test_jewish = { + name = "Aaron" + dynasty = kohn_dynasty + religion = "congregationist" + culture = ashkenazi + trait = education_diplomacy_4 + 2514.8.11 = { + birth = yes + } + 2600.1.1 = { + death = yes + } +} britannia_aurelian_ambrose = { name = "Ambrose" dynasty = dynn_britannia_aurelian diff --git a/history/titles/NEOW_laamp_titles.txt b/history/titles/NEOW_laamp_titles.txt index 8807e0ac..ac1ce3a8 100644 --- a/history/titles/NEOW_laamp_titles.txt +++ b/history/titles/NEOW_laamp_titles.txt @@ -12,6 +12,19 @@ # } #} +d_laamp_test_jewish = { # Saltpites + 2555.1.1 = { + liege = 0 + holder = brit_test_jewish + government = landless_minority_government + succession_laws = { confederate_partition_succession_law } + effect = { + create_landless_minority_title_history_effect = yes + set_variable = { name = adventurer_creation_reason value = flag:historical } + destroy_landless_title_no_dlc_effect = { DATE = 2555.1.1 } + } + } +} d_laamp_zolt = { # Saltpites 2555.1.1 = { liege = 0 diff --git a/localization/english/replace/buildings_l_english.yml b/localization/english/replace/buildings_l_english.yml index 23da8232..40402469 100644 --- a/localization/english/replace/buildings_l_english.yml +++ b/localization/english/replace/buildings_l_english.yml @@ -2746,4 +2746,47 @@ building_mount_baekdu_01: "$building_type_mount_baekdu_01$" building_mount_baekdu_01_desc: "$building_type_mount_baekdu_01_desc$" - + landless_minority_government: "Minority Community Leader" + landless_minority_government_with_icon: "@government_type_landless_minority! $landless_minority_government$" + landless_minority_government_adjective: "Minority Community" + landless_minority_government_realm: "Minority Community" + landless_minority_government_desc: "\n$game_concept_minority_government_desc$" + conditional_maa_refill_rule: "only [reinforce_soldiers|E] troops" + mercenary_rule: "be hired to serve as [mercenaries|E] by [landed|E] [rulers|E]" + adult_rulers_only: "#N May only be ruled by [adults|E]#!" + game_concept_minority_government: "Minority Community Leader" + game_concept_minority_government_desc: "A $Minority Community Leader$ is an [unlanded|E] [character|E] who leads a [minority_community_i|E]$Minority Community$." + game_concept_minority_community: "Minority Community" + game_concept_minority_community_desc: "A Minority Community is a small culturally distinct portion of the population typically with a local community leader" + minority_community_main_01_domicile_building: "Minority Community" + minority_community_main_01_domicile_building_desc: "A Minority Community is a small culturally distinct portion of the population typically with a local community leader" + minority_community_main_02_domicile_building: "Minority Community" + minority_community_main_02_domicile_building_desc: "A Minority Community is a small culturally distinct portion of the population typically with a local community leader" + minority_community_main_03_domicile_building: "Minority Community" + minority_community_main_03_domicile_building_desc: "A Minority Community is a small culturally distinct portion of the population typically with a local community leader" + minority_community_main_04_domicile_building: "Minority Community" + minority_community_main_04_domicile_building_desc: "A Minority Community is a small culturally distinct portion of the population typically with a local community leader" + minority_community_main_05_domicile_building: "Minority Community" + minority_community_main_05_domicile_building_desc: "A Minority Community is a small culturally distinct portion of the population typically with a local community leader" + government_is_landless_minority: "Has access to a [minority_community_i|E]$Minority Community$" + minority_community_icon_concept: "[minority_community_i|E]" + game_concept_minority_community_i: "@government_type_landless_minority!" + duchy_landless_minority_community: "Community" + duke_landless_minority_community_male_minority_community: "Master" + duke_landless_minority_community_female_minority_community: "Mistress" + spouse_landless_minority_community_male: "Master" + spouse_landless_minority_community_holder_female: "Mistress" + d_laamp_test_jewish:0 "$congregationist$ Community" + d_laamp_test_jewish_adj:0 "Jewish" + d_laamp_test_jewish_article:0 "The " + minority_community_domicile_title: "[CHARACTER.GetFirstNamePossessiveNoTooltip] $game_concept_minority_community$" + minority_community_type: "$game_concept_minority_community$" + minority_community_type_tooltip: "$MINORITY_COMMUNITY$" + minority_community_domicile_type: "$game_concept_minority_community$" + minority_community_domicile_type_possessive: "Community's" + minority_community_domicile_type_tooltip: "$MINORITY_COMMUNITY$" + MINORITY_COMMUNITY: "[game_concept_minority_community|E]" + MINORITY_COMMUNITY_BUILDINGS: "[manor_buildings|E]" + minority_community_move_desc: "#T Move $minority_community_type$#!\nMove your [game_concept_minority_community|E] to another [barony|E] within the [realm|E].\n@alert_icon! #alert_trial You will be unable to move it again for [EmptyScope.ScriptValue('estate_move_cooldown_value')|V0] days#!\n\n#S Cost:\n#![GetCostString( DOMICILE_TYPE.GetMoveCost( Character.Self ) )]\n\n#P Click to move your $minority_community_type$#!" + MINORITY_COMMUNITY_CONCEPT: "[game_concept_minority_community|E]" + domicile_minority_community: "the [CHARACTER.GetFaith.GetNameNoTooltip] $minority_community_type$" diff --git a/localization/english/replace/dynasties/zz_NEOW_dynasty_names_l_english.yml b/localization/english/replace/dynasties/zz_NEOW_dynasty_names_l_english.yml index 50f98f07..4e127336 100644 --- a/localization/english/replace/dynasties/zz_NEOW_dynasty_names_l_english.yml +++ b/localization/english/replace/dynasties/zz_NEOW_dynasty_names_l_english.yml @@ -25,6 +25,7 @@ dynn_leroux:0 "Leroux" dynn_belpois:0 "Belpois" dynn_giry:0 "Giry" + dynn_britannia_kohn:0 "Kohn" dynn_eiffel:0 "Eiffel" dynn_spatstony:0 "Spatstony" dynn_millardet:0 "Millardet"