revert Alignment
This commit is contained in:
Vannifar 2026-04-25 10:02:11 +02:00
parent 15a5108e23
commit c4b6d9bdeb
250 changed files with 11067 additions and 16365 deletions

View file

@ -101,8 +101,34 @@ on_title_destroyed = {
}
}
}
# Because a change in liege isn't triggered when the title being destroyed
tgp_fire_china_realm_name_event_for_vassals_effect = yes
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
}
@ -635,7 +661,7 @@ on_title_gain = {
###########
if = {
limit = {
scope:title.title_province ?= {
scope:title.title_province = {
geographical_region = geographical_region:mpo_region_permafrost
}
}
@ -1116,7 +1142,7 @@ on_title_gain = {
}
every_held_title = {
limit = { exists = var:administrative_ui_special_title }
holder = { tgp_destroy_ceremonial_throne_effect = yes }
var:administrative_ui_special_title.holder = { tgp_destroy_ceremonial_throne_effect = yes }
}
if = {
limit = { has_trait = former_emperor }
@ -1148,16 +1174,12 @@ on_title_gain = {
limit = { has_trait = devoted }
remove_trait = devoted
}
if = {
limit = { government_has_flag = government_is_landless_adventurer }
destroy_laamp_effect = { ADVENTURER = this }
}
destroy_laamp_effect = { ADVENTURER = this }
}
# Reset raid remit
if = {
limit = {
this = top_liege
scope:title = primary_title
any_noble_family = { }
}
every_noble_family = {
@ -1420,10 +1442,7 @@ on_title_gain = {
# When conquering China - Change to conquest phase
if = {
limit = {
OR = {
root.dynasty != scope:previous_holder.dynasty
is_lowborn = yes # in the rare instance that a lowborn theocrat reunites China
}
root.dynasty != scope:previous_holder.dynasty
}
if = {
limit = {
@ -1508,7 +1527,6 @@ on_title_gain = {
set_family_accomplishment_effect = { ACCOMPLISHMENT = family_accomplishment_dynasty }
}
}
# left them in enum since we can not avoid touch here with encapsulated macro
else_if = {
limit = {
OR = {
@ -1655,8 +1673,16 @@ on_title_gain = {
}
}
# That isn't a part of the ministry
scope:title = {
tgp_is_minister_title = no
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 = {
@ -1773,10 +1799,7 @@ on_title_gain = {
limit = { has_trait = devoted }
remove_trait = devoted
}
if = {
limit = { government_has_flag = government_is_landless_adventurer }
destroy_laamp_effect = { ADVENTURER = this }
}
destroy_laamp_effect = { ADVENTURER = this }
trigger_event = {
id = tgp_japan_general.9100
days = 1
@ -2006,14 +2029,6 @@ on_title_gain = {
}
has_appointment_level_for_title = scope:title
}
# prevent penalty for giving non-feudal lands to nomad/tribals
OR = {
scope:title = {
has_title_law_flag = appointment_with_level_requirement
}
has_realm_law_flag = appointment_with_level_requirement
}
has_global_variable = game_has_started # Don't mess up for initialization
}
situation:dynastic_cycle ?= {
if = {
@ -2029,8 +2044,17 @@ on_title_gain = {
if = {
limit = {
scope:title = {
tgp_is_minister_title = yes
de_jure_liege = title:h_china
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 }
}
@ -2047,21 +2071,40 @@ on_title_gain = {
# Admin Stuff
if = {
limit = {
government_allows = noble_families
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
}
if = {
limit = {
government_allows = administrative
NOT = { has_variable = laamp_invasion_flag }
}
# EP3 - apply unique domicile building bonus if appropriate
# 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 = {
@ -2117,17 +2160,37 @@ on_title_gain = {
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
current_date_is_start_date_trigger = no
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 = {
scope:title = title:e_byzantium
global_var:byz_claimant_champion ?= {
exists = global_var:byz_claimant_champion
global_var:byz_claimant_champion = {
any_owned_story = {
type = frankokratia_story
var:byz_claimant ?= root
exists = var:byz_claimant
var:byz_claimant = {
this = root
}
}
}
}
@ -2138,24 +2201,27 @@ on_title_gain = {
trigger_event = ep3_frankokratia_events.0110
}
}
else_if = {
limit = {
exists = house
exists = scope:previous_holder
is_alive = yes
is_ruler = yes
is_imprisoned = no
top_liege = this
}
every_vassal_or_below = {
else = {
if = {
limit = {
is_playable_character = yes
OR = {
highest_held_title_tier >= main_administrative_tier # All governors
liege = root
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
}
}
trigger_event = ep3_governor_yearly.3060
}
}
}
@ -2625,7 +2691,6 @@ on_title_gain = {
limit = {
scope:title = {
tier = tier_county
is_landless_type_title = no
OR = {
has_county_modifier = major_coronation_approval_unsettled_modifier
has_county_modifier = medium_coronation_approval_unsettled_modifier
@ -3858,9 +3923,17 @@ on_title_lost = {
# Remove manually added Ministers if they're not ministers anymore
if = {
limit = {
is_landed = no
tgp_is_any_minister = no
any_character_situation = { this = situation:dynastic_cycle }
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
@ -4073,64 +4146,6 @@ on_rank_up = { # Will not fire during history execution or for dying characters
events = {
}
effect = {
# EP3 - Ensure Emperor keeps old realm capital in admin realms
if = {
limit = {
government_allows = administrative
NOT = { has_variable = laamp_invasion_flag }
top_liege = this
trigger_if = {
limit = { exists = scope:title }
highest_held_title_tier > scope:title.tier
}
}
# celestial emperor+ ruler keep their capital when they were kingdom
# but if they become emperor+ without ever being a king, follow normal de jure realm
if = {
limit = {
tgp_use_chinese_naming_trigger = yes
trigger_if = {
limit = {
NOT = { exists = title:h_china.holder }
capital_county.title_province ?= {
OR = {
geographical_region = tgp_county_chinese_naming_region
geographical_region = tgp_duchy_chinese_naming_region
}
}
}
highest_held_title_tier >= tier_duchy
}
trigger_else = {
highest_held_title_tier >= tier_empire
}
primary_title = {
is_de_jure_liege_or_above_target = prev.capital_county
}
}
primary_title = {
if = {
limit = {
title_capital_county != prev.capital_county
NOT = { previous_holder.house ?= prev.house }
}
set_capital_county = prev.capital_county
}
}
}
else_if = { # Ensure we keep the old realm capital
limit = {
highest_held_title_tier >= tier_empire
primary_title = {
title_capital_county != root.capital_county
# Constantinople must have been inherited
title_capital_county.holder = root
}
}
set_realm_capital = primary_title.title_capital_county
}
}
if = { # ACH call to coronation reminder
limit = {
coronation_trigger = yes
@ -4287,23 +4302,8 @@ on_rank_up = { # Will not fire during history execution or for dying characters
if = {
limit = {
is_independent_ruler = yes
OR = {
tgp_use_chinese_naming_trigger = yes
primary_title = {
recent_history = {
type = conquest_populist
days = 1
}
previous_holder = {
tgp_use_chinese_naming_trigger = yes
}
}
AND = {
exists = var:claimed_mandate_var
primary_title ?= title:h_china
}
}
tgp_chinese_naming_tier_trigger = yes
government_has_flag = government_is_celestial
highest_held_title_tier >= tier_kingdom
OR = {
primary_title ?= {
has_custom_title_name = no
@ -4312,12 +4312,56 @@ on_rank_up = { # Will not fire during history execution or for dying characters
}
trigger_if = {
limit = {
tgp_has_unique_chinese_naming = no
tgp_capital_not_in_chinese_naming_region = yes
}
primary_title ?= title:h_china
}
}
tgp_fire_china_realm_name_event_effect = yes
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
@ -4342,7 +4386,6 @@ on_rank_up = { # Will not fire during history execution or for dying characters
limit = {
is_house_head = yes
NOT = { house.house_confederation.leading_house = this.house }
house.house_confederation.leading_house.house_head.top_liege = this
}
house.house_confederation = {
tgp_set_house_bloc_leading_house_effect = { LEADER = root.house }
@ -4433,46 +4476,6 @@ on_rank_down = { # Will not fire during history execution or for dying character
}
ach_remove_oaths_on_king_minus_effect = yes
}
# Grand Wedding: no longer valid host
if = {
limit = {
highest_held_title_tier < tier_county
has_variable = promised_grand_wedding_marriage_countdown
scope:transfer_type = flag:abdication
}
scope:title.holder ?= {
if = {
limit = { NOT = { has_variable = promised_grand_wedding_marriage_countdown } }
save_scope_as = new_wedding_host
}
}
if = {
limit = {
exists = scope:new_wedding_host
has_variable = promised_grand_wedding_to
}
var:promised_grand_wedding_marriage_countdown = {
save_scope_as = spouse_1
betrothed = { save_scope_as = spouse_2 }
}
var:promised_grand_wedding_to = {
save_scope_as = promisee
}
clean_grand_wedding_betrothal_variables = yes
set_grand_wedding_betrothal_variables = {
HOST = scope:new_wedding_host
SPOUSE_1 = scope:spouse_1
SPOUSE_2 = scope:spouse_2
PROMISEE = scope:promisee
}
}
else = {
clean_grand_wedding_betrothal_variables = yes
}
}
}
}
@ -4548,37 +4551,6 @@ on_vassal_gained = {
# TGP end the ceremonial liege
tgp_destroy_ceremonial_throne_effect = yes
}
# TGP Put vassals in blocs
if = {
limit = {
top_liege != this # independent rulers are an exception
exists = house.house_confederation
scope:vassal = {
tgp_uses_house_blocs_trigger = yes
house.house_head = scope:vassal
}
trigger_if = {
limit = { exists = scope:vassal.house.house_confederation }
scope:vassal.house.house_confederation != house.house_confederation
}
}
if = {
limit = { exists = scope:vassal.house.house_confederation }
scope:vassal.house = {
tgp_leave_house_bloc_effect = {
OPINION = flag:no
TRUCE = flag:yes
}
}
}
scope:vassal.house = {
tgp_join_house_bloc_effect = {
INVITER = root.house
OPINION = flag:no
}
}
}
}
}
@ -4594,7 +4566,7 @@ on_vassal_change = {
government_allows = administrative
is_house_head = yes
trigger_if = {
# This trigger is intentionally different from the similar effect in on_title_gain up above. We want all direct vassals of the top liege to have a family title if they can
# 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
}
@ -4618,50 +4590,27 @@ on_vassal_change = {
### 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 = {
liege = root # I.e. root is independent
}
# 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 }
limit = {
administrative_tier_allows_independence = no
}
admin_change_government_effect = yes
}
# Byz admin landless NF should always be direct vassal of top liege
# If they can be independent, make sure they have a noble family title
else_if = {
limit = {
liege != top_liege
primary_title = {
is_noble_family_title = yes
NOT = {
any_held_title = {
is_noble_family_title = yes
}
}
is_landed = no
}
create_title_and_vassal_change = {
type = appointment
save_scope_as = change
}
change_liege = {
liege = top_liege
change = scope:change
}
resolve_title_and_vassal_change = scope:change
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.
@ -4674,12 +4623,6 @@ on_vassal_change = {
primary_title = {
any_title_maa_regiment = { count >= 1 }
}
liege = { #only if the liege didn't reach the limit yet
any_vassal = {
count < celestial_province_military_max_value
vassal_contract_has_flag = celestial_province_military
}
}
}
vassal_contract_set_obligation_level = { type = celestial_provinces level = 3 }
}
@ -4693,14 +4636,52 @@ on_vassal_change = {
this = top_liege
}
# has a ministry title that is not being swapped
tgp_has_minister_title = yes
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 = {
limit = {
tgp_is_minister_title = yes
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 }
}
}
root = { destroy_title = prev }
}
}
# Make sure independent rulers and their vassals leave movements if they are part of the Dynastic Cycle
@ -4730,24 +4711,42 @@ on_vassal_change = {
if = {
limit = {
# We have become independent!
scope:old_liege != root
NOT = {
scope:old_liege = root
}
liege = root
tgp_use_chinese_naming_trigger = yes
tgp_chinese_naming_tier_trigger = yes
government_has_flag = government_is_celestial
highest_held_title_tier >= tier_kingdom
primary_title = {
has_custom_title_name = no # sanity check
}
OR = {
tgp_has_unique_chinese_naming = yes
tgp_capital_not_in_chinese_naming_region = no
primary_title = title:h_china # failsafe, in case this somehow ends up here
}
}
tgp_fire_china_realm_name_event_effect = yes
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
liege != root
NOT = {
liege = root
}
primary_title ?= {
has_custom_title_name = yes
}
@ -4947,43 +4946,6 @@ on_realm_capital_change = {
}
}
}
# Move ministers to realm capital.
if = {
limit = {
tgp_has_access_to_ministry_trigger = yes
}
every_vassal = {
limit = {
tgp_has_minister_title = yes
}
every_held_title = {
limit = {
OR = {
is_noble_family_title = yes
tgp_is_minister_title = yes
}
}
set_capital_county = ROOT.county
}
if = {
limit = { is_ai = yes }
domicile ?= {
move_domicile = ROOT.title_province
}
}
# don't move them in such cases
if = {
limit = {
is_landed = no
is_in_army = no
is_travelling = no
NOT = { exists = involved_activity }
}
set_location_to_default = yes
}
}
}
}
}
}