Scripted effect · Legends of the Dead files
faction_war_end_defeat_legitimacy_effect
faction_war_end_defeat_legitimacy_effect = yesgame/common/scripted_effects/06_dlc_ce1_legitimacy_effects.txt, line 250 (66 lines). No parameters.
faction_war_end_defeat_legitimacy_effect is a scripted effect in Crusader Kings III, in the Legends of the Dead files, written at line 250 of its file. It takes no parameters: faction_war_end_defeat_legitimacy_effect = yes. The game's script calls it in 17 places, among them Ceremonial Claimant Faction (casus belli), Claimant Faction (casus belli) and Depose (casus belli). Patch 1.20.1.2, from game/common/scripted_effects/06_dlc_ce1_legitimacy_effects.txt.
The comment above it in the file
LEGITIMACY FOR LOSING A FACTION WAR
What it does
scope:attacker:scope:defender:If
is_valid_for_legitimacy_change = yesscope:attacker:Not all of these
is_leading_faction_type = claimant_factionjoined_faction.special_title = title:h_china
Then
If
scope:attacker:One of these
is_leading_faction_type = peasant_factionor
is_leading_faction_type = claimant_factionor
is_leading_faction_type = populist_faction
Then
- Loses 200 Legitimacy
Otherwise
Otherwise
- Loses 100 Legitimacy
• 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 (66 lines of game script)
faction_war_end_defeat_legitimacy_effect = {
scope:attacker = {
if = {
limit = { is_valid_for_legitimacy_change = yes }
send_interface_toast = {
type = msg_legitimacy_gain
title = legitimacy_gain_toast
left_icon = scope:attacker
right_icon = scope:defender
add_legitimacy = minor_legitimacy_gain
}
}
}
scope:defender = {
if = {
limit = {
is_valid_for_legitimacy_change = yes
#prevent China from falling into Chaos when the Hegemony is claimed by not removing the legitimacy
scope:attacker = {
NAND = {
is_leading_faction_type = claimant_faction
joined_faction.special_title = title:h_china
}
}
}
if = {
limit = {
scope:attacker = {
OR = {
is_leading_faction_type = peasant_faction
is_leading_faction_type = claimant_faction
is_leading_faction_type = populist_faction
}
}
}
send_interface_toast = {
type = event_toast_effect_bad
title = legitimacy_loss_toast
left_icon = scope:defender
right_icon = scope:attacker
add_legitimacy = major_legitimacy_loss
}
}
else = {
send_interface_toast = {
type = event_toast_effect_bad
title = legitimacy_loss_toast
left_icon = scope:defender
right_icon = scope:attacker
if = {
limit = {
has_nomadic_legitimacy = yes
}
add_legitimacy = {
value = medium_legitimacy_loss
multiply = 2
}
}
else = {
add_legitimacy = medium_legitimacy_loss
}
}
}
}
}
}As written in game/common/scripted_effects/06_dlc_ce1_legitimacy_effects.txt.
Where it is used
Every place in common/, events/ and history/ that calls faction_war_end_defeat_legitimacy_effect.
Casus belli (16)
Scripted effects (1)
Source: game/common/scripted_effects/06_dlc_ce1_legitimacy_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.