Skip to content

Commit

Permalink
Merge branch 'feat/code/roads-to-power-update' of https://github.com/…
Browse files Browse the repository at this point in the history
  • Loading branch information
helloruhe committed Sep 24, 2024
2 parents b36c4d8 + 1abf988 commit 9c22411
Show file tree
Hide file tree
Showing 8 changed files with 204 additions and 38 deletions.
4 changes: 2 additions & 2 deletions common/defines/00_defines.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ NCharacter = {
ADOLESCENCE_AGE = 12
MALE_ADULT_AGE = 16
FEMALE_ADULT_AGE = 16
MALE_ELDERLY_AGE = 50
FEMALE_ELDERLY_AGE = 50
MALE_ELDERLY_AGE = 60 # Warcraft - bumped this up a decade to align with other relative longevity increases
FEMALE_ELDERLY_AGE = 60 # Warcraft - bumped this up a decade to align with other relative longevity increases
BETROTHAL_TIMEOUT_AGE = 17

#Warcraft, needs workaround
Expand Down
13 changes: 13 additions & 0 deletions common/script_values/wc_age_values.txt
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,19 @@ age_debug_value = {
multiply = racial_age_multiplier_value
}

# accounts for the "elderly" values in 00_defines.txt - replace any use of these values with this instead of age_x_value
age_elderly_male_define_value = {
value = MALE_ELDERLY_AGE
multiply = racial_age_multiplier_value
max = age_max_value
}

age_elderly_female_define_value = {
value = FEMALE_ELDERLY_AGE
multiply = racial_age_multiplier_value
max = age_max_value
}

my_current_age_value = {
value = age
}
Expand Down
4 changes: 2 additions & 2 deletions common/scripted_triggers/03_fp2_scripted_triggers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ fp2_struggle_contract_assistance_war_insufficient_trigger = {
limit = {
scope:recipient = { is_attacker_in_war = prev }
}
scope:actor.max_military_strength < war_defender_total_strength_divided_value
scope:actor.max_military_strength < war_defender_total_strength_tenth_value
}
trigger_else = { scope:actor.max_military_strength < war_attacker_total_strength_divided_value }
trigger_else = { scope:actor.max_military_strength < war_attacker_total_strength_tenth_value }
}

##################################################
Expand Down
3 changes: 2 additions & 1 deletion common/scripted_triggers/04_ep2_tour_triggers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ ep2_tour_phase_invalidation_check = {
province_owner = {
exists = liege
liege = scope:host
location = scope:province
highest_held_title_tier >= tier_county
#Checks mostly matching is_available:
is_in_army = no
Expand Down Expand Up @@ -75,4 +76,4 @@ is_being_visited_on_tour_strict = {
liege ?= {
involved_activity ?= { has_activity_type = activity_tour }
}
}
}
22 changes: 11 additions & 11 deletions common/scripted_triggers/04_ep2_tournament_triggers.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
chariot_race_trigger = {
#involved_activity.activity_host.culture = {
# OR = {
# AND = {
# has_cultural_tradition = tradition_byzantine_succession
# NOT = { has_cultural_era_or_later = culture_era_late_medieval }
# }
# this = culture:roman
# }
#}
always = no
chariot_race_trigger = { # Warcraft - TODO: reflavorize if needed for gorian or w/e
# involved_activity.activity_host.culture = {
# OR = {
# AND = {
# has_cultural_tradition = tradition_ep3_roman_ceremonies
# NOT = { has_cultural_era_or_later = culture_era_late_medieval }
# }
# this = culture:roman
# }
# }
always = no
}

activity_is_valid_tournament_contestant_training_decision = {
Expand Down
2 changes: 1 addition & 1 deletion common/scripted_triggers/04_ep2_wedding_triggers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ activity_wedding_diplomatic_intent_impressible_target = {
is_independent_ruler = yes
any_neighboring_and_across_water_top_liege_realm_owner = { this = root }
highest_held_title_tier < root.highest_held_title_tier
NOT = { government_has_flag = can_not_be_vassal_or_liege }
NOT = { government_has_flag = cannot_be_vassal_or_liege }
is_at_war = no
save_temporary_scope_as = impress_check
impress_intent_vassalization_acceptance_value > -30
Expand Down
68 changes: 68 additions & 0 deletions common/scripted_triggers/20_health_balancing_triggers.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
### HEALTH BALANCING TRIGGERS ###
# Along with the health balancing effects, these triggers are only used to get data output used for balancing diseases.


# For activating data output on the number of victims (total, dead and surviving) for contagious disease outbreaks. Combine with a run file like this to quickly collect data:

#every_independent_ruler = {
# random_courtier = {
# trigger_event = health.1011 #1011 is plague, 1010 is smallpox
# }
#}


debug_activate_contagious_disease_outbreak_data_trigger = {
always = no
}

# Warcraft - use our own age values
is_very_young_character = {
OR = {
age <= age_20_value
AND = {
OR = {
has_trait = whole_of_body
has_trait = fecund
}
age <= age_25_value
}
}
}

is_young_character = {
OR = {
age <= age_30_value
AND = {
OR = {
has_trait = whole_of_body
has_trait = fecund
}
age <= age_35_value
}
}
}

is_aging_character = {
OR = {
age >= age_50_value # increased from 40 to reflect longer Warcraft lifespans - SS 1.13
AND = {
OR = {
has_trait = whole_of_body
has_trait = fecund
}
age >= age_55_value # increased from 45 to reflect longer Warcraft lifespans - SS 1.13
}
}
}

is_old_character = { # note that this is also 10 years higher than vanilla - SS 1.13
trigger_if = {
limit = {
is_male = yes
}
age >= age_elderly_male_define_value
}
trigger_else = {
age >= age_elderly_female_define_value
}
}
126 changes: 105 additions & 21 deletions common/scripted_triggers/20_health_triggers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ has_easily_mocked_physical_attribute_trigger = {
has_trait = one_legged
has_trait = disfigured
has_trait = blind
has_trait = eunuch
is_eunuch_trigger = yes
}
}

Expand Down Expand Up @@ -179,6 +179,13 @@ can_contract_disease_trigger = {
NOT = { has_character_flag = bubonic_immunity }
}

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

save_temporary_scope_value_as = {
name = disease_type_for_trigger
value = flag:$DISEASE$
Expand Down Expand Up @@ -264,6 +271,10 @@ can_contract_disease_trigger = {
scope:disease_type_for_trigger = flag:smallpox
NOT = { has_character_flag = disease_immunity_smallpox }
}
AND = {
scope:disease_type_for_trigger = flag:measles
NOT = { has_character_flag = disease_immunity_measles }
}
AND = {
scope:disease_type_for_trigger = flag:bubonic_plague
NOT = { has_character_flag = disease_immunity_bubonic_plague }
Expand Down Expand Up @@ -314,6 +325,14 @@ can_contract_disease_trigger = {
has_character_flag = contraction_cooldown_great_pox
scope:disease_type_for_trigger = flag:great_pox
}
AND = {
has_character_flag = contraction_cooldown_dysentery
scope:disease_type_for_trigger = flag:dysentery
}
AND = {
has_character_flag = contraction_cooldown_ergotism
scope:disease_type_for_trigger = flag:ergotism
}
}
}

Expand Down Expand Up @@ -392,11 +411,12 @@ has_quarterly_recovery_disease_trigger = {
has_short_disease_trigger = {
OR = {
has_trait = ill
has_trait = pneumonic
has_trait = typhus
has_trait = smallpox
has_trait = bubonic_plague
has_trait = ergotism
has_trait = measles
has_trait = dysentery
}
}

Expand All @@ -412,6 +432,7 @@ has_serious_disease_trigger = {
has_trait = consumption
has_trait = measles
has_trait = dysentery
has_trait = ergotism
}
}
has_insect_carried_disease_trigger = {
Expand Down Expand Up @@ -514,6 +535,9 @@ has_treatable_disease_trigger = {
has_trait = smallpox
has_trait = bubonic_plague
has_trait = leper
has_trait = measles
has_trait = dysentery
# Warcraft - made an executive decision not to have ergotism be treatable [SS]
}
}

Expand Down Expand Up @@ -583,21 +607,19 @@ has_disfigurement_type_disease_trigger = {


has_short_disease_type_trigger = {
exists = scope:disease_type
OR = {
scope:disease_type = flag:ill
scope:disease_type = flag:pneumonic #3
scope:disease_type = flag:measles #3 #TODO_CE1 actually implement this
scope:disease_type = flag:dysentery #3 #TODO_CE1 actually implement this
scope:disease_type = flag:ergotism #3 #TODO_CE1 actually implement this
scope:disease_type = flag:measles #3
scope:disease_type = flag:dysentery #3.5
scope:disease_type = flag:ergotism #3.5
scope:disease_type = flag:typhus #3.5
scope:disease_type = flag:smallpox #3.5
scope:disease_type = flag:bubonic_plague #6.5
}
}

has_slow_disease_type_trigger = {
exists = scope:disease_type
OR = {
scope:disease_type = flag:consumption #2
scope:disease_type = flag:cancer #3
Expand All @@ -607,26 +629,75 @@ has_slow_disease_type_trigger = {
}
}

has_high_health_penalty_disease_type_trigger = { #3.5 to 6.5
exists = scope:disease_type
scope:disease_type = flag:typhus #3.5
scope:disease_type = flag:smallpox #3.5
scope:disease_type = flag:bubonic_plague #6.5
has_high_health_penalty_disease_type_trigger = { # >= 3.5
OR = {
### TYPHUS
scope:disease_type = flag:typhus #4.5 + 1
### SMALLPOX
scope:disease_type = flag:smallpox #4.5 + 1.5
### BUBONIC PLAGUE
scope:disease_type = flag:bubonic_plague #7 + 2
### DYSENTERY
scope:disease_type = flag:dysentery #3.5 + 2
### ERGOTISM
scope:disease_type = flag:ergotism #3.5
### CONSUMPTION
AND = {
scope:disease_type = flag:consumption #2 + 1 + 2
is_old_character = yes
}
### CANCER
AND = {
scope:disease_type = flag:cancer #3 + 1
is_old_character = yes
}
### MEASLES
AND = {
scope:disease_type = flag:measles #3 + 3
is_old_character = yes
}
### PNEUMONIA
AND = {
scope:disease_type = flag:pneumonic #3 + 2
is_old_character = yes
}
}
}

has_low_health_penalty_disease_type_trigger = { #3 and lower
exists = scope:disease_type
scope:disease_type = flag:ill #1
has_low_health_penalty_disease_type_trigger = { # < 3.5
OR = {
## ILL
scope:disease_type = flag:ill #1 + 1
### GREAT POX
scope:disease_type = flag:great_pox #1
scope:disease_type = flag:gout_ridden #1.5
### GOUT
scope:disease_type = flag:gout_ridden #1
### LEPROSY
scope:disease_type = flag:leper #1.5
scope:disease_type = flag:consumption #2
scope:disease_type = flag:cancer #3
scope:disease_type = flag:pneumonic #3
### CONSUMPTION
AND = {
scope:disease_type = flag:consumption #2 + 1 + 2
is_old_character = no
}
### CANCER
AND = {
scope:disease_type = flag:cancer #3 + 1
is_old_character = no
}
### MEASLES
AND = {
scope:disease_type = flag:measles #3 + 3
is_old_character = no
}
### PNEUMONIA
AND = {
scope:disease_type = flag:pneumonic #3 + 2
is_old_character = no
}
}
}

minor_disease_flag_for_notification_trigger = {
exists = scope:disease_type
OR = {
scope:disease_type = flag:ill
scope:disease_type = flag:gout_ridden
Expand Down Expand Up @@ -654,7 +725,7 @@ liege_is_responsible_for_treatment_trigger = {
is_ruler = no
exists = liege
OR = {
is_child_of = liege # SS - seems to be removed in 1.12 (why??)
#is_child_of = liege # SS - seems to be removed in 1.12 (why??)
trigger_if = {
limit = { exists = liege.primary_spouse }
this = liege.primary_spouse
Expand Down Expand Up @@ -769,3 +840,16 @@ immune_to_epidemic = {
}
}
}

# I'm putting this here because I refuse to make a "hair_triggers.txt" file.
is_bald_trigger = {
OR = {
# As it transpires, we actually cannot use this trigger here.
#has_gene = {
# category = gene_baldness
# template = male_pattern_baldness
#}
has_character_modifier = hajj_halq_modifier
has_character_modifier = shaven_bald_modifier
}
}

0 comments on commit 9c22411

Please sign in to comment.