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

Scripted effect

add_wound_treatment_modifier_effect

add_wound_treatment_modifier_effect = { OUTCOME = … TREATMENT = … }

game/common/scripted_effects/20_health_effects.txt, line 3245 (118 lines). Parameters: $OUTCOME$, $TREATMENT$.

add_wound_treatment_modifier_effect is a scripted effect in Crusader Kings III, written at line 3245 of its file. A call passes 2 parameters: OUTCOME and TREATMENT. The game's script calls it in 2 places, among them wound_treatment_result_tooltip_effect (scripted effect) and wound_treatment_results_effect (scripted effect). Patch 1.20.1.2, from game/common/scripted_effects/20_health_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 (118 lines of game script)
add_wound_treatment_modifier_effect = {	
	save_temporary_scope_value_as = {
		name = treatment_result_treatment
		value = flag:$TREATMENT$
	}
	save_temporary_scope_value_as = {
		name = treatment_result_outcome
		value = flag:$OUTCOME$
	}


	###SUCCESS###
	if = {
		limit = {
			OR = {
				scope:treatment_result_outcome = flag:success
				scope:treatment_result_outcome = flag:critical_success
			}
		}
		#Infection is always removed
		if = {
			limit = { has_character_modifier = infected_wound_modifier }
			remove_character_modifier = infected_wound_modifier
			save_scope_value_as = {
				name = infection
				value = yes
			}
		}
		#Gangrene is removed if you picked risky
		else_if = {
			limit = {
				has_character_modifier = gangrene_modifier
				scope:treatment_result_treatment = flag:risky
			}
			remove_character_modifier = gangrene_modifier
			save_scope_value_as = {
				name = gangrene
				value = yes
			}
		}


		#Applying correct modifier or removing correct trait (unless there's still an active treatment, could happen if you got treated for a wound and then got infection/gangrene)
		if = {
			limit = { has_recent_wound_treatment_trigger = no }

			#Safe treatment
			if = {
				limit = { scope:treatment_result_treatment = flag:safe }

				#Add modifier or remove wounded_1 trait
					if = {
					limit = { has_character_modifier = gangrene_modifier }
					add_character_modifier = { modifier = safe_wound_treatment_success_high_modifier days = wound_treatment_success_duration }
				}
				else_if = {
					limit = { has_trait = wounded_1 }
					remove_trait = wounded_1
				}
				else_if = {
					limit = {
						OR = {
							has_trait = wounded_2
							has_trait = wounded_3
						}
					}
					add_character_modifier = { modifier = safe_wound_treatment_success_low_modifier days = wound_treatment_success_duration }
				}
			}

			#Risky treatment critical success
			else_if = {
				limit = {
					scope:treatment_result_treatment = flag:risky
					scope:treatment_result_outcome = flag:critical_success
				}
				#Remove a trait level
				if = {
					limit = { has_trait = wounded_1 }
					remove_trait = wounded_1
				}
				else_if = {
					limit = { has_trait = wounded_2 }
					remove_trait = wounded_2 #We do it like this so you can see the trait you've lost
					add_trait = wounded_1
				}
				else_if = {
					limit = { has_trait = wounded_3 }
					remove_trait = wounded_3
					add_trait = wounded_2
				}
			}

			#Risky treatment regular success
			else_if = {
				limit = {
					scope:treatment_result_treatment = flag:risky
					scope:treatment_result_outcome = flag:critical_success
				}
				add_character_modifier = { modifier = risky_wound_treatment_success_modifier days = wound_treatment_success_duration }
			}
		}
	}
	###FAILURE###
	else_if = {
		limit = { scope:treatment_result_outcome = flag:failure }

		#Safe treatment failure
		if = {
			limit = { scope:treatment_result_treatment = flag:safe }
			add_character_modifier = { modifier = safe_wound_treatment_failure_modifier days = wound_treatment_failure_duration }
		}
		if = {
			limit = { scope:treatment_result_treatment = flag:risky }
			add_character_modifier = { modifier = risky_wound_treatment_failure_modifier days = wound_treatment_failure_duration }
		}
	}
}

As written in game/common/scripted_effects/20_health_effects.txt.

Where it is used

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

Source: game/common/scripted_effects/20_health_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?