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

Scripted effect

pregnancy_maintainance_effect

pregnancy_maintainance_effect = yes

game/common/scripted_effects/00_pregnancy_effects.txt, line 111 (153 lines). No parameters.

pregnancy_maintainance_effect is a scripted effect in Crusader Kings III, written at line 111 of its file. It takes no parameters: pregnancy_maintainance_effect = yes. The game's script calls it in 2 places, among them birth.0001 (event) and Cradled by Death (event birth.3011). Patch 1.20.1.2, from game/common/scripted_effects/00_pregnancy_effects.txt.

The comment above it in the file

This effect is used to handle all the tings that should ALWAYS be done at birth.

What it does

Every line of it is script with no tooltip text: the script is below.

The script as written (120 lines of game script)
pregnancy_maintainance_effect = {
	hidden_effect = {
		historical_pregnancy_effect = yes # Handle specific scripted historical births

		remove_trait = pregnant

		#Save twin as child_2
		scope:child = {
			if = {
				limit = { has_trait = twin }
				random_sibling = {
					limit = { is_twin_of = scope:child }
					save_scope_as = child_2
				}
				
				#Identical twins
				if = {
					limit = { sex_same_as = scope:child_2 }
					random = {
						chance = 50
						copy_inheritable_appearance_from = scope:child_2
					}
				}
			}
		}

		#BASTARD OR NOT? TO HANDLE NON-COMPLICATED BIRTH EVENTS
		#It is a bastard!
		if = {
			limit = {
				has_variable = {
					name = unmarried_bastard_pregnancy
					name = bastard_pregnancy
				}
			}

			#To see if the assumed father has died while pregnant with unknown bastard
			if = {
				limit = {
					scope:mother = {
						NOT = { has_character_flag = pregnancy_real_father_of_bastard_is_known_flag }
						exists = var:dead_spouse
					}
				}
				var:dead_spouse = {
					save_scope_as = father
				}
				scope:child = {
					set_father = scope:father
				}
				scope:mother = {
					remove_variable = dead_spouse
				}
			}

			#To fire the right event for the mother if the child secretly is a bastard
			if = {
				limit = {
					NOT = { has_character_flag = pregnancy_real_father_of_bastard_is_known_flag }
					has_character_flag = bastard_pregnancy
					secret_disputed_heritage_is_valid_trigger = {
						TARGET = scope:child
					}
				}
				add_secret = { #Set up a new secret about the child
					type = secret_disputed_heritage
					target = scope:child
				}
				random_secret = { #Find the secret
					type = secret_disputed_heritage
					limit = {
						secret_target = scope:child
					}
					save_scope_as = new_secret
				}

				#If the real_father knows they're the father they will get an event about the bastard being born
				if = {
					limit = {
						has_character_flag = pregnancy_real_father_knows
					}
					scope:child.real_father = {
						add_to_list = illegitimacy_secret_knowers
					}
				}
				#If the spouse knows they're NOT the father they will get an event about the bastard being born
				if = {
					limit = {
						has_character_flag = pregnancy_spouse_knows_of_bastardy
					}
					scope:child.father = {
						add_to_list = illegitimacy_secret_knowers
					}
				}
				every_in_list = {
					list = illegitimacy_secret_knowers
					#A secret bastard is born - Share the news with everyone who knew that it was a bastard
					trigger_event = secret_bastard.0001
				}
			}
			
			#Check for unmarried mother bastardy flag
			else_if = {
				limit = {
					NOT = { has_character_flag = pregnancy_real_father_of_bastard_is_known_flag }
					has_character_flag = unmarried_bastard_pregnancy

					# Must be able to have the illegitimate child secret.
					secret_unmarried_illegitimate_child_is_valid_trigger = {
						TARGET = scope:child
					}
				}
				add_secret = { #Set up a new secret about the child
					type = secret_unmarried_illegitimate_child
					target = scope:child
				}
				random_secret = { #Find the secret
					type = secret_unmarried_illegitimate_child
					limit = {
						secret_target = scope:child

As written in game/common/scripted_effects/00_pregnancy_effects.txt.

The first 120 of its 153 lines; the rest is in game/common/scripted_effects/00_pregnancy_effects.txt from line 111.

Where it is used

Every place in common/, events/ and history/ that calls pregnancy_maintainance_effect.

Events (2)

Source: game/common/scripted_effects/00_pregnancy_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?