CK3 DatabaseCrusader Kings III · 1.20.1.2 “Crozier” · unofficial
Silk & Silverout Tue, Nov 17What's free, what needs the DLC, price →

Scripted effect

on_declared_war

on_declared_war = yes

game/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

• 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)

100 more

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.

Spotted a mistake on this page?