Scripted effect
mongol_war_target_evaluation_and_declaration_effect
mongol_war_target_evaluation_and_declaration_effect = yesgame/common/scripted_effects/00_mongol_invasion_effects.txt, line 1998 (162 lines). No parameters.
mongol_war_target_evaluation_and_declaration_effect is a scripted effect in Crusader Kings III, written at line 1998 of its file. It takes no parameters: mongol_war_target_evaluation_and_declaration_effect = yes. The game's script calls it in 1 place, among them story_mongol_invasion (story cycle). Patch 1.20.1.2, from game/common/scripted_effects/00_mongol_invasion_effects.txt.
The comment above it in the file
Mongol war target evaluation and declaration
What it does
If
a check the game hides
Then
If
scope:next_invasion_target:
Then
- scope:next_invasion_title_target › Their empire › Every in de jure hierarchy:
- Only some of them (the filter is in the script below)
continue = { … }
- Every in list:
- Where:
- Their holder:
top_liege != scope:mongol_emperorNOT = { is_at_war_with = scope:mongol_emperor }
None of these
- scope:mongol_emperor › Any truce target:
this = scope:truce_check
- scope:mongol_emperor › Any truce target:
- Their holder:
- Their holder:
- Where:
Else if
Then
scope:next_invasion_target:
Otherwise
start_war = { cb = mongol_realm_invasion_war target = scope:next_invasion_target target_title = scope:next_invasion_title_target.empire }
• the game's own tooltip text · ◦ our reading of the script line · code the script where neither exists
“They” is whatever it runs on (the scope it is called in). The scripted triggers and effects it calls link to their own pages; $PARAMETERS$ stay as written: each call fills them in.
The script as written (120 lines of game script)
mongol_war_target_evaluation_and_declaration_effect = {
# Set the Mongol Emperor as reference point
save_scope_as = mongol_emperor
add_character_flag = {
flag = free_mongol_cb
days = 14
}
# Select a new target
random_neighboring_top_liege_realm_owner = {
limit = {
NOT = { is_allied_to = scope:mongol_emperor }
this != scope:mongol_emperor
top_liege != scope:mongol_emperor
save_temporary_scope_as = truce_check
NOT = {
scope:mongol_emperor = {
any_truce_target = {
this = scope:truce_check
}
}
}
trigger_if = { # We don't want the Byzantine empire to get annihilated immediately
limit = {
OR = {
has_primary_title = title:e_byzantium
has_primary_title = title:e_latin_empire
}
}
OR = {
current_year >= 1279 # Roughly when the mongols should fracture historically
scope:mongol_emperor = {
completely_controls_region = special_mongol_empire_golden_horde_region # Controls all of Russia and the Steppe
}
any_realm_county = { # Byzantium is expansionist
count >= 50
title_province = {
OR = {
geographical_region = special_mongol_empire_conquest_region_prio_5
geographical_region = special_mongol_empire_conquest_region_prio_4
geographical_region = special_mongol_empire_conquest_region_prio_3
geographical_region = special_mongol_empire_conquest_region_prio_2
geographical_region = special_mongol_empire_conquest_region_prio_1
geographical_region = special_mongol_empire_conquest_region_prio_1_alpha
}
}
}
}
}
}
weight = {
base = 0
modifier = {
add = mongol_invasion_target_character_weight
always = yes
}
}
save_temporary_scope_as = next_invasion_target
primary_title = {
save_temporary_scope_as = next_invasion_title_target
}
}
if = {
limit = {
exists = scope:next_invasion_target
}
if = {
limit = { # Declare war on every same-tier count or duke in same empire
scope:next_invasion_target = {
OR = {
highest_held_title_tier = tier_county
highest_held_title_tier = tier_duchy
}
}
}
scope:next_invasion_title_target = {
add_to_temporary_list = all_titles_to_declare_on
empire = {
every_in_de_jure_hierarchy = { # Find all other same-tier titles in same de jure empire
continue = {
tier > tier_county
# Stop searching if you hit the Mongol Emperor's territory at any point
trigger_if = {
limit = { exists = holder }
holder != scope:mongol_emperor
holder.top_liege != scope:mongol_emperor
}
}
limit = {
exists = this
OR = {
tier = tier_county
tier = tier_duchy
}
holder ?= {
top_liege = this
this != scope:mongol_emperor
top_liege != scope:mongol_emperor
NOT = { is_at_war_with = scope:mongol_emperor }
NOT = { is_allied_to = scope:mongol_emperor }
save_temporary_scope_as = truce_check
NOT = {
scope:mongol_emperor = {
any_truce_target = {
this = scope:truce_check
}
}
}
}
}
add_to_temporary_list = all_titles_to_declare_on
}
}
}
every_in_list = {
list = all_titles_to_declare_on
limit = {
holder = {
# An extra check to make sure we haven't snuck any Mongol territory in
this != scope:mongol_emperor
top_liege != scope:mongol_emperorAs written in game/common/scripted_effects/00_mongol_invasion_effects.txt.
The first 120 of its 162 lines; the rest is in game/common/scripted_effects/00_mongol_invasion_effects.txt from line 1998.
Where it is used
Every place in common/, events/ and history/ that calls mongol_war_target_evaluation_and_declaration_effect.
Story cycles (1)
- story_mongol_invasion
Source: game/common/scripted_effects/00_mongol_invasion_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.