Scripted effect
on_declared_war
on_declared_war = yesgame/common/scripted_effects/00_war_effects.txt, line 143 (472 lines). No parameters.
on_declared_war is a scripted effect in Crusader Kings III, written at line 143 of its file. It takes no parameters: on_declared_war = yes. The game's script calls it in 106 places, among them … China's Grand Campaign (casus belli), …-… Bloc Supremacy War (casus belli) and …… Ancestral Claim on … (casus belli). Its body carries 2 texts of the game's own for the player. Patch 1.20.1.2, from game/common/scripted_effects/00_war_effects.txt.
What it does
on_declared_war_play_music = yesIf
scope:attacker:One of these
- Government is Feudal
or
Government is Clanor
Government is a Tribal-type Government
- Their liege: they has administrative government mechanic
scope:defender:- they has administrative government mechanic
liege ?= scope:attacker.liege
Then
- Because you declared a War inside an Administrative Government:
- scope:attacker.liege: Opinion: Declared War on My Administrative Vassal
If
scope:attacker:has_truce = scope:defender
Then
scope:attacker:If
- Their rite: The rite has Breaking a Truce within the Faith brings immediate Excommunication
- scope:defender: Their faith is the same as that of attacker
- Does not have the Trait: Excommunicated
- Their faith:
One of these
or
Has a Doctrine or Tenet with Has Clerical Regionor
Any faith ruler:- Highest held Title is at least Duchy Rank
- Government is a Theocratic-type Government
faith_has_sacraments_central_trigger = yesNOT = { religious_head ?= scope:attacker }
Then
- If does not have the Flexible Truces Perk:
- Gain -250 Prestige
- Level of Fame -1
If
- Government uses the Mandala Capital Temple Complex Great Project and Great Building
- scope:defender: Recent mandala suzerain is scope:attacker
Then
add_legitimacy = { value = medium_legitimacy_loss multiply = primary_title.tier }- Gain -500 Devotion Piety
- Gains the modifier “Backhanded Mandala” for 5 years
- Tributary Opinion -50
Otherwise
add_legitimacy = { value = medium_legitimacy_loss multiply = primary_title.tier }
- Gains the modifier “Broke Truce” for 3 years
- General Opinion -50
If
- Any character struggle:
involvement = involvedactivate_struggle_catalyst_secondary_character_involvement_involved_trigger = { CATALYST = catalyst_broke_truce_against_important_character CHAR = scope:defender }
Then
- Every character struggle:
- Where:
activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { CATALYST = catalyst_broke_truce_against_important_character CHAR = scope:defender }
involvement = involvedactivate_struggle_catalyst = { catalyst = catalyst_broke_truce_against_important_character character = scope:attacker }
- Where:
- Any character struggle:
If
scope:attacker:is_allied_to = scope:defender- Any close family member:
court_owner = scope:attacker- Is betrothed
- Their betrothed:
court_owner = scope:defenderis_close_family_of = scope:defender
Then
scope:attacker:add_prestige = { value = break_truce_prestige_loss multiply = break_betrothal_prestige_cost }If
- Has “promised grand wedding marriage countdown” (a variable the game's script sets)
- Any close family member:
court_owner = scope:attacker- Is betrothed
has_been_promised_grand_wedding = yes- Their betrothed:
court_owner = scope:defenderis_close_family_of = scope:defenderhas_been_promised_grand_wedding = yes
Then
- Every close family member:
- Where:
court_owner = scope:attacker- Is betrothed
- Their betrothed:
court_owner = scope:defenderis_close_family_of = scope:defender
break_betrothal = betrothed
- Where:
Else if
scope:attacker:is_allied_to = scope:defender
Then
scope:attacker:break_alliance_due_to_attack_effect = { TARGET = scope:defender }
If
One of these
scope:attacker:is_tributary_of = scope:defender
or
scope:defender:is_tributary_of = scope:attacker
Then
scope:attacker:break_tributary_contract_due_to_attack_effect = { DEFENDER = scope:defender }
If
- scope:attacker › Any home court hostage: … (more in the script below)
- … (more in the script below)
• 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)
on_declared_war = {
on_declared_war_play_music = yes
###############################
##### Effects
###############################
#There is no fighting in the admin room!
if = {
limit = {
scope:attacker = {
OR = {
government_has_flag = government_is_feudal
government_has_flag = government_is_clan
government_has_flag = government_is_tribal
}
liege ?= {
government_has_mechanic = administrative
}
}
scope:defender = {
government_has_mechanic = administrative
liege ?= scope:attacker.liege
}
}
custom_description_no_bullet = {
text = on_declared_war_in_admin
}
scope:attacker.liege = {
add_opinion = {
target = scope:attacker
modifier = declared_war_in_admin
}
}
}
# Breaking Truce
if = {
limit = {
scope:attacker = {
has_truce = scope:defender
NOT = { has_character_flag = allowed_war_declaration_sans_truce_penalties }
}
}
scope:attacker = {
custom_description_no_bullet = {
text = attack_breaking_truce_text
}
# PAM Peace of God: breaking a truce with a co-religionist draws the ban
if = {
limit = {
rite = {
rite_has_parameter = tenet_peace_of_god_excommunication_truce
}
scope:defender = { faith = scope:attacker.faith }
NOT = { has_trait = excommunicated }
faith = {
OR = {
AND = {
exists = religious_head
has_doctrine = doctrine_spiritual_head
}
has_doctrine_parameter = has_clerical_regions
any_faith_ruler = {
highest_held_title_tier >= tier_duchy
government_has_flag = government_is_theocracy
}
}
faith_has_sacraments_central_trigger = yes
NOT = { religious_head ?= scope:attacker }
}
}
add_excommunication_actual_effect = yes
}
# Remove the war target from the bought_truce_list if they're in it
if = {
limit = {
has_purchased_truce_with_char = { TARGET = scope:defender }
}
remove_list_variable = {
name = bought_truce_list
target = scope:defender
}
}
if = {
limit = {
NOT = { has_perk = flexible_truces_perk }
}
add_prestige = break_truce_prestige_loss
add_prestige_level = break_truce_prestige_level_loss
}
if = {
limit = {
government_has_flag = government_is_mandala
scope:defender = { var:recent_mandala_suzerain ?= scope:attacker }
}
add_legitimacy = {
value = medium_legitimacy_loss
multiply = primary_title.tier
}
add_piety_experience = massive_piety_loss
add_character_modifier = {
modifier = mandala_broke_truce_modifier
years = 5
}
}
else = {
add_legitimacy = {
value = medium_legitimacy_loss
multiply = primary_title.tier
}
}
add_character_modifier = {
modifier = broke_truce
years = 3
}
# Struggle Catalysts.As written in game/common/scripted_effects/00_war_effects.txt.
The first 120 of its 472 lines; the rest is in game/common/scripted_effects/00_war_effects.txt from line 143.
Where it is used
Every place in common/, events/ and history/ that calls on_declared_war.
Casus belli (106)
- … China's Grand Campaign
- …-… Bloc Supremacy War
- …… Ancestral Claim on …
- ……-… Vassalization War (Dynastic Cycle)
- Adventurer Invasion
- Adventurer Invasion
100 more
- Adventurer Invasion
- Adventurer Invasion
- Artifact
- Assassin Dissolution
- Azariqa Rebellion
- Bloc Expansion
- Border Raid
- Border Raid against the Roman Empire
- Bring Under Tribute
- Challenge Head of Faith
- Chinese Consolidation War
- Chinese Consolidation War
- Claim
- Clan Invasion
- County Conquest
- County Expansion
- Crusader War for Imperial Claim
- De Jure
- Demand Fealty
- Depose Challenger Head of Faith
- Diarch Seizure
- Dismantle Pretender
- Dismantle Pretender
- Dissolution Faction
- Dissolve Empire
- Domination War
- Ducal Conquest
- Duchy Conquest
- Duchy Expansion
- Enforce Administrative Integration
- Eradicate Rival House
- Excommunication
- Expand Dominance
- Great Holy War
- Great Holy War
- Great War of Defiance
- Greatest of Khans' Onslaught
- Holy
- Holy Relic Reclamation
- Humiliation War
- Humiliation War
- Iberian Reclamation
- Imperial County Pacification
- Imperial Expedition
- Imperial Reconquest
- Imperial Reconquest of Japan (De Jure)
- Independence
- Independence War
- Individual De Jure County
- Individual De Jure Duchy
- Invasion
- Invasion
- Invasion
- Invasion
- Investiture Conflict
- Laudabiliter Conquest
- Legendary Adventure
- Major Holy
- Mediterranean Conquest
- Migrate to Pannonia
- Migration War
- Minor Holy
- Mongol Invasion
- Mongol Realm Invasion
- Naval County Expansion
- Naval Duchy Expansion
- Nomadic County Quarrel
- Nomadic Duchy Quarrel
- Overrun Kingdom
- Overrun Kingdom
- Pax Romana
- Pillaging Foray
- Plunder for Contribution
- Raid for Captives
- Raid for Captives Contract
- Raiktor's "Claim"
- Raiktor's Claim
- Raze Capital Temple Complex
- Remove Regent
- Resist Capture
- Retaliation War
- Seize Hegemonic County
- Seize Hegemonic County
- Seize Hegemonic Duchy
- Seize Hegemonic Duchy
- Seize Imperial Duchy
- Seize Peripheral Duchy
- Seize the Mandate of Heaven
- Sōryō Conquest
- Sōryō Conquest
- Sovereignty War
- Sponsored Administrative War
- Struggle Clash
- Subjugation
- Varangian Adventurer
- Vassalization
- Viking Adventurer
- Zanj Rebellion
- debug_artifact_war
- debug_war
Source: game/common/scripted_effects/00_war_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.