Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infirm issue 1241 fix #1244

Merged
merged 11 commits into from
Nov 21, 2023
24 changes: 18 additions & 6 deletions common/scripted_triggers/20_health_triggers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,44 @@ can_get_non_epidemic_disease_trigger = { #Diseases shouldn't stack. Don't add a

# Will this character suffer age-related health issues, factoring how healthy they actually are vs. what their age is?
age_ranked_health_vulnerability_threshold_trigger = {
# Warcraft - add flags here that should prevent characters from getting "infirm"
NOT = {
has_flag = can_not_get_sick
edmund-h marked this conversation as resolved.
Show resolved Hide resolved
}
OR = {
# If you're already having problems...
has_trait = infirm
# Otherwise, we check health crossed against age.
# Warcraft - we have to divide by the age multiplier to get effective age for paradox purposes
save_temporary_scope_value_as = {
name = temp_age
value = {
value = $AGE$
edmund-h marked this conversation as resolved.
Show resolved Hide resolved
divide = racial_age_multiplier_value
}
}
## Characters that are this old are vulnerable regardless of health.
age >= 90
scope:temp_age >= 90
## Else, the higher your health is, the older you need to be to suffer age-related health problems.
AND = {
health <= good_health
age >= 80
scope:temp_age >= 80
}
AND = {
health <= medium_health
age >= 70
scope:temp_age >= 70
}
AND = {
health <= fine_health
age >= 60
scope:temp_age >= 60
}
AND = {
health <= poor_health
age >= 50
scope:temp_age >= 50
}
AND = {
health <= dying_health
age >= 40
scope:temp_age >= 40
}
}
}
Expand Down
18 changes: 3 additions & 15 deletions events/health_events.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10767,21 +10767,9 @@ health.7000 = {
theme = physical_health

trigger = {
NOT = { has_trait = infirm }
OR = {
# Warcraft
age >= age_50_value

AND = {
# Warcraft
age >= age_30_value

OR = {
has_trait = physique_bad
has_trait = spindly
has_trait = weak
}
}
NOT = {
has_trait = infirm
age_ranked_health_vulnerability_threshold_trigger = no
}
edmund-h marked this conversation as resolved.
Show resolved Hide resolved
}

Expand Down
2 changes: 1 addition & 1 deletion gui/window_character.gui
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ window = {
name = "character_age_2"
raw_text = "???"
default_format = "#low"
tooltip = "wc_unknown_birth"
tooltip = "wc_unknown_birth" #" [Character.GetAge] [Character.GetDeathOrBirthDateInfo]"
fontsize = 20
align = nobaseline
}
Expand Down
Loading