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
If
One of these
scope:treatment_result_outcome = flag:successor
scope:treatment_result_outcome = flag:critical_success
Then
- If has the Modifier: Infected Wound: Loses “Infected Wound”
- Else, if all of these hold:
- Conditions:
- Has the Modifier: Gangrene
scope:treatment_result_treatment = flag:risky
- Then: Loses “Gangrene”
- Conditions:
If
Then
If
scope:treatment_result_treatment = flag:safe
Then
- If has the Modifier: Gangrene:
- Gains the modifier “Successful Wound Treatment” for 1095 days
- Disease Resistance (Health) +1.5
- Gains the modifier “Successful Wound Treatment” for 1095 days
- Else, if has the Trait: Wounded: Loses the Trait Wounded
- Else, if all of these hold:
- Conditions:
One of these
- Has the Trait: Severely Injured
or
Has the Trait: Brutally Mauled
- Then:
- Gains the modifier “Successful Wound Treatment” for 1095 days
- Disease Resistance (Health) +1
- Gains the modifier “Successful Wound Treatment” for 1095 days
- Conditions:
Else if
scope:treatment_result_treatment = flag:riskyscope:treatment_result_outcome = flag:critical_success
Then
- If has the Trait: Wounded: Loses the Trait Wounded
- Else, if has the Trait: Severely Injured:
- Loses the Trait Severely Injured
- Gains the Trait Wounded
- Else, if has the Trait: Brutally Mauled:
- Loses the Trait Brutally Mauled
- Gains the Trait Severely Injured
Else if
scope:treatment_result_treatment = flag:riskyscope:treatment_result_outcome = flag:critical_success
Then
- Gains the modifier “Very Successful Wound Treatment” for 1095 days
- Disease Resistance (Health) +2
Else if
scope:treatment_result_outcome = flag:failure
Then
If
scope:treatment_result_treatment = flag:safe
Then
- Gains the modifier “Aggravated Wound” for 365 days
- Health -0.5
If
scope:treatment_result_treatment = flag:risky
Then
- Gains the modifier “Botched Wound Treatment” for 365 days
- Health -1.5
• 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.
Scripted effects (2)
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.