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

Scripted trigger

can_contract_disease_trait_scope_trigger

can_contract_disease_trait_scope_trigger = { DISEASE = … }

game/common/scripted_triggers/20_health_triggers.txt, line 250 (173 lines). Parameters: $DISEASE$.

can_contract_disease_trait_scope_trigger is a scripted trigger in Crusader Kings III, written at line 250 of its file. A call passes 1 parameter: DISEASE. The game's script calls it in 3 places, among them Danger: Carrion (event epidemic_events.3010), infect_with_epidemic_effect (scripted effect) and can_contract_disease_trigger (scripted trigger). Patch 1.20.1.2, from game/common/scripted_triggers/20_health_triggers.txt.

What it checks

  • Does not have the Trait: …
  • If

    • $DISEASE$ = trait:gout_ridden

    Then

  • If

    • $DISEASE$ = trait:lovers_pox
    • Is imprisoned

    Then

    • imprisoner = { … }
  • If

    • $DISEASE$ = trait:lovers_pox
    • Is traveling
    • Their activity:
      • NOT = { has_activity_type = activity_adult_education }

    Then

    • current_travel_plan = { … }
  • One of these

    • NOT = { $DISEASE$ = trait:ill }
    • or

      NOT = { $DISEASE$ = trait:smallpox }
    • or

      NOT = { $DISEASE$ = trait:measles }
    • or

      NOT = { $DISEASE$ = trait:bubonic_plague }
    • or

      All of these

    • or

      All of these

      • $DISEASE$ = trait:smallpox
      • NOT = { has_character_flag = disease_immunity_smallpox }
    • or

      All of these

      • $DISEASE$ = trait:measles
      • NOT = { has_character_flag = disease_immunity_measles }
    • or

      All of these

      • $DISEASE$ = trait:bubonic_plague
      • NOT = { has_character_flag = disease_immunity_bubonic_plague }
  • One of these

  • None of these

    • has_character_flag = contraction_cooldown_general
    • All of these

      • has_character_flag = contraction_cooldown_pneumonic
      • $DISEASE$ = trait:pneumonic
    • All of these

      • has_character_flag = contraction_cooldown_gout_ridden
      • $DISEASE$ = trait:gout_ridden
    • All of these

      • has_character_flag = contraction_cooldown_typhus
      • $DISEASE$ = trait:typhus
    • All of these

      • has_character_flag = contraction_cooldown_consumption
      • $DISEASE$ = trait:consumption
    • All of these

      • has_character_flag = contraction_cooldown_cancer
      • $DISEASE$ = trait:cancer
    • All of these

      • has_character_flag = contraction_cooldown_great_pox
      • $DISEASE$ = trait:great_pox
    • All of these

      • has_character_flag = contraction_cooldown_dysentery
      • $DISEASE$ = trait:dysentery
    • All of these

      • has_character_flag = contraction_cooldown_ergotism
      • $DISEASE$ = trait:ergotism

• 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)
can_contract_disease_trait_scope_trigger = {
	save_temporary_scope_as = sick_character_check

	# Is not immune to disease
	NOT = { has_character_flag = immune_to_disease }

	#Doesn't already have the trait
	NOT = { has_trait = $DISEASE$ }

	#Only get measles once
	trigger_if = {
		limit = { $DISEASE$ = trait:measles }
		NOT = { has_character_flag = disease_immunity_measles }
	}

	#Only get bubonic plague once
	trigger_if = {
		limit = { $DISEASE$ = trait:bubonic_plague }
		NOT = { has_character_flag = disease_immunity_bubonic_plague }
	}

	#Young characters do not get gout
	trigger_if = {
		limit = { $DISEASE$ = trait:gout_ridden }
		current_weight >= 50
		is_young_character = no
	}

	trigger_if = { #Lover's pox can only be contracted if you are sexually active
		limit = {
			$DISEASE$ = trait:lovers_pox
			is_imprisoned = yes
		}
		imprisoner = {
			OR = {
				AND = {
					scope:sick_character_check = { is_in_prison_type = dungeon }
					any_prisoner = {
						OR = {
							has_relation_lover = scope:sick_character_check
							any_consort = {
								this = scope:sick_character_check
							}
						}
					}
				}
				AND = {
					scope:sick_character_check = { is_in_prison_type = house_arrest }
					OR = {
						any_prisoner = {
							OR = {
								has_relation_lover = scope:sick_character_check
								any_consort = {
									this = scope:sick_character_check
								}
							}
						}
						any_courtier = {
							OR = {
								has_relation_lover = scope:sick_character_check
								any_consort = {
									this = scope:sick_character_check
								}
							}
						}
					}
				}
			}
		}
	}

	# Check to see that there is someone for you to have sex with if you are traveling
	trigger_if = {
		limit = {
			$DISEASE$ = trait:lovers_pox
			is_travelling = yes
			# Do not block Goliardic Shenanigans!
			involved_activity ?= {
				NOT = { has_activity_type = activity_adult_education }
			}
		}
		current_travel_plan = {
			any_entourage_character = {
				OR = {
					has_relation_lover = scope:sick_character_check
					any_consort = {
						this = scope:sick_character_check
					}
				}
			}
		}
	}

	#Secondary requirements (mutually exclusive diseases or immunity)
	OR = {
		NOR = { #No secondary requirement
			$DISEASE$ = trait:ill
			$DISEASE$ = trait:smallpox
			$DISEASE$ = trait:measles
			$DISEASE$ = trait:bubonic_plague
		}
		AND = {
			$DISEASE$ = trait:ill
			NOT = { has_trait = pneumonic }
		}
		AND = {
			$DISEASE$ = trait:smallpox
			NOT = { has_character_flag = disease_immunity_smallpox }
		}
		AND = {
			$DISEASE$ = trait:measles
			NOT = { has_character_flag = disease_immunity_measles }
		}
		AND = {
			$DISEASE$ = trait:bubonic_plague
			NOT = { has_character_flag = disease_immunity_bubonic_plague }
		}
	}

	#No disease stacking

As written in game/common/scripted_triggers/20_health_triggers.txt.

The first 120 of its 173 lines; the rest is in game/common/scripted_triggers/20_health_triggers.txt from line 250.

Where it is used

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

Events (1)

Scripted effects (1)

Scripted triggers (1)

Source: game/common/scripted_triggers/20_health_triggers.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?