Scripted effect
add_disease_treatment_modifier_effect
add_disease_treatment_modifier_effect = { OUTCOME = … TREATMENT = … }game/common/scripted_effects/20_health_effects.txt, line 2592 (202 lines). Parameters: $OUTCOME$, $TREATMENT$.
add_disease_treatment_modifier_effect is a scripted effect in Crusader Kings III, written at line 2592 of its file. A call passes 2 parameters: OUTCOME and TREATMENT. The game's script calls it in 2 places, among them disease_treatment_result_tooltip_effect (scripted effect) and disease_treatment_results_effect (scripted effect). Patch 1.20.1.2, from game/common/scripted_effects/20_health_effects.txt.
What it does
If
scope:treatment_result_treatment = flag:safescope:treatment_result_outcome = flag:success
Then
Else if
Then
- Gains the modifier “Reduced Disease Symptoms” for 1825 days
- Disease Resistance (Health) +1.5
Else if
Then
- Gains the modifier “Reduced Disease Symptoms” for 1825 days
- Disease Resistance (Health) +1
- Gains the modifier “Reduced Disease Symptoms” for 1825 days
Else if
scope:treatment_result_treatment = flag:safescope:treatment_result_outcome = flag:failure
Then
Else if
One of these
scope:treatment_result_treatment = flag:riskyor
scope:treatment_result_treatment = flag:mystic
scope:treatment_result_outcome = flag:critical_success
Then
If
scope:disease_type = flag:consumption
Then
remove_trait_force_tooltip = consumption
Else if
scope:disease_type = flag:cancer
Then
remove_trait_force_tooltip = cancer
Else if
scope:disease_type = flag:great_pox
Then
remove_trait_force_tooltip = great_pox
Else if
scope:disease_type = flag:gout_ridden
Then
remove_trait_force_tooltip = gout_ridden
Else if
scope:disease_type = flag:ill
Then
remove_trait_force_tooltip = ill
Else if
scope:disease_type = flag:pneumonic
Then
remove_trait_force_tooltip = pneumonic
Else if
scope:disease_type = flag:typhus
Then
remove_trait_force_tooltip = typhus
Else if
scope:disease_type = flag:measles
Then
remove_trait_force_tooltip = measles
Else if
scope:disease_type = flag:dysentery
Then
remove_trait_force_tooltip = dysentery
Else if
scope:disease_type = flag:ergotism
Then
remove_trait_force_tooltip = ergotism
Else if
scope:disease_type = flag:smallpox
Then
remove_trait_force_tooltip = smallpox
Else if
scope:disease_type = flag:bubonic_plague
Then
remove_trait_force_tooltip = bubonic_plague
Else if
One of these
scope:treatment_result_treatment = flag:riskyor
scope:treatment_result_treatment = flag:mystic
scope:treatment_result_outcome = flag:success
Then
If
Then
- Gains the modifier “Greatly Reduced Disease Symptoms” for 365 days
- Disease Resistance (Health) +3
Else if
Then
- Gains the modifier “Greatly Reduced Disease Symptoms” for 1825 days
- Disease Resistance (Health) +3
Else if
- … (more in the script below)
- Gains the modifier “Greatly Reduced Disease Symptoms” for 365 days
- … (more in the script below)
- … (more in the script below)
• 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)
add_disease_treatment_modifier_effect = {
#Treatment length depends on whether the disease has a short or long duration
#Successful treatments come in two strengths per treatment type, low for diseases with low health penalty and high for diseases with high health penalty
#Negative treatments only have one strength per treatment type
#Successful safe treatments remove most of the penalty for low -health diseases but only 1/2-1/4 of penalty for high -health diseases
#Successful risky/mystic treatments remove almost all of the penalty for all diseases (with plague being the main exception, that penalty is roughly halved)
#Safe treatment:success
save_temporary_scope_value_as = {
name = treatment_result_treatment
value = flag:$TREATMENT$
}
save_temporary_scope_value_as = {
name = treatment_result_outcome
value = flag:$OUTCOME$
}
#SAFE TREATMENT: SUCCESS
if = {
limit = {
scope:treatment_result_treatment = flag:safe
scope:treatment_result_outcome = flag:success
}
if = {
limit = {
has_short_disease_type_trigger = yes
has_high_health_penalty_disease_type_trigger = yes
}
add_character_modifier = { modifier = safe_disease_treatment_success_high_modifier days = disease_treatment_short_duration }
}
else_if = {
limit = {
has_short_disease_type_trigger = no
has_high_health_penalty_disease_type_trigger = yes
}
add_character_modifier = { modifier = safe_disease_treatment_success_high_modifier days = disease_treatment_long_duration }
}
else_if = {
limit = {
has_short_disease_type_trigger = yes
has_high_health_penalty_disease_type_trigger = no
}
add_character_modifier = { modifier = safe_disease_treatment_success_low_modifier days = disease_treatment_short_duration }
}
else_if = {
limit = {
has_short_disease_type_trigger = no
has_high_health_penalty_disease_type_trigger = no
}
add_character_modifier = { modifier = safe_disease_treatment_success_low_modifier days = disease_treatment_long_duration }
}
}
#SAFE TREATMENT: FAILURE
else_if = {
limit = {
scope:treatment_result_treatment = flag:safe
scope:treatment_result_outcome = flag:failure
}
if = {
limit = { has_short_disease_type_trigger = yes }
add_character_modifier = { modifier = safe_disease_treatment_failure_modifier days = disease_treatment_short_duration }
}
else_if = {
limit = { has_short_disease_type_trigger = no }
add_character_modifier = { modifier = safe_disease_treatment_failure_modifier days = disease_treatment_long_duration }
}
}
#RISKY & MYSTIC TREATMENT: CRITICAL SUCCESS
else_if = {
limit = {
OR = {
scope:treatment_result_treatment = flag:risky
scope:treatment_result_treatment = flag:mystic #A succcessful mystic treatment shouldn't be noticeable from the outside, so using same modifiers
}
scope:treatment_result_outcome = flag:critical_success
}
#General cooldown
add_character_flag = {
flag = contraction_cooldown_general
years = 2
}
if = {
limit = { scope:disease_type = flag:consumption }
remove_trait_force_tooltip = consumption
add_character_flag = { flag = contraction_cooldown_consumption years = 20 }
}
else_if = {
limit = { scope:disease_type = flag:cancer }
remove_trait_force_tooltip = cancer
add_character_flag = { flag = contraction_cooldown_cancer years = 20 }
}
else_if = {
limit = { scope:disease_type = flag:great_pox }
remove_trait_force_tooltip = great_pox
add_character_flag = { flag = contraction_cooldown_great_pox years = 20 }
}
else_if = {
limit = { scope:disease_type = flag:gout_ridden }
remove_trait_force_tooltip = gout_ridden
add_character_flag = { flag = contraction_cooldown_gout_ridden years = 20 }
}
else_if = {
limit = { scope:disease_type = flag:ill }
remove_trait_force_tooltip = ill
#No cooldown, common disease
}
else_if = {
limit = { scope:disease_type = flag:pneumonic }
remove_trait_force_tooltip = pneumonic
add_character_flag = { flag = contraction_cooldown_pneumonic years = 20 }
}
else_if = {
limit = { scope:disease_type = flag:typhus }
remove_trait_force_tooltip = typhus
add_character_flag = { flag = contraction_cooldown_typhus years = 20 }
}
else_if = {
limit = { scope:disease_type = flag:measles }As written in game/common/scripted_effects/20_health_effects.txt.
The first 120 of its 202 lines; the rest is in game/common/scripted_effects/20_health_effects.txt from line 2592.
Where it is used
Every place in common/, events/ and history/ that calls add_disease_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.