buikding fix

This commit is contained in:
Greekman 2026-11-22 01:20:02 +00:00
parent 7b79d09c8b
commit 2ea6f90ccc
45 changed files with 53784 additions and 1457 deletions

View file

@ -68,19 +68,22 @@ spread_decrease_mult_medium = -0.5
spread_decrease_mult_high = -0.75
spread_decrease_mult_unlikely = -0.991
spread_settlement_size_level_threshold = 4
spread_increase_mult_per_settlement_size_level = 0.1
outbreak_chance_minor_default_value = {
value = outbreak_chance_base_low
#Buildings
add = {
value = num_buildings
value = province_size_level
multiply = outbreak_increase_add_very_low
}
#Tradeports / Coasts
if = {
limit = {
has_building_or_higher = common_tradeport_01
has_port_district = yes
}
add = outbreak_increase_add_high
}
@ -115,6 +118,12 @@ outbreak_chance_minor_mult_value = {
# Game rules
if = {
limit = {
has_game_rule = epidemic_frequency_normal
}
add = 0
}
else_if = {
limit = {
has_game_rule = epidemic_frequency_often
}
@ -145,32 +154,58 @@ outbreak_chance_minor_mult_value = {
add = outbreak_decrease_mult_high
}
#Development
#Prosperity
if = {
limit = {
county.development_level <= 20
county.prosperity_level <= 20
}
add = {
value = county.development_level
value = county.prosperity_level
multiply = 0.002
}
}
else_if = {
limit = {
county.development_level <= 40
county.prosperity_level <= 40
}
add = {
value = county.development_level
value = county.prosperity_level
multiply = 0.003
}
}
else = {
add = {
value = county.development_level
value = county.prosperity_level
multiply = 0.004
}
}
#Era pacing
if = {
limit = {
culture = {
has_cultural_era_or_later = culture_era_late_medieval
}
}
add = outbreak_decrease_mult_low
}
else_if = {
limit = {
culture = {
has_cultural_era_or_later = culture_era_early_medieval
}
}
add = 0
}
else_if = {
limit = {
culture = {
has_cultural_era_or_later = culture_era_tribal
}
}
add = outbreak_decrease_mult_low
}
#Terrain
if = {
limit = {
@ -219,7 +254,7 @@ outbreak_chance_minor_mult_value = {
if = {
limit = {
county.development_level < 10
county.prosperity_level < 10
}
multiply = 0.5
}
@ -231,15 +266,15 @@ outbreak_chance_minor_mult_value = {
outbreak_chance_major_default_value = {
value = outbreak_chance_base_very_low
#Buildings
add = {
value = num_buildings
value = province_size_level
multiply = outbreak_increase_add_low
}
#Tradeports / Coasts
if = {
limit = {
has_building_or_higher = common_tradeport_01
has_port_district = yes
}
add = outbreak_increase_add_high
}
@ -274,6 +309,16 @@ outbreak_chance_major_mult_value = {
# Game rules
if = {
limit = {
has_game_rule = epidemic_frequency_normal
NOR = {
has_game_rule = easy_difficulty
has_game_rule = very_easy_difficulty
}
}
add = 0
}
else_if = {
limit = {
has_game_rule = epidemic_frequency_often
}
@ -310,32 +355,58 @@ outbreak_chance_major_mult_value = {
add = outbreak_decrease_mult_high
}
#Development
#Prosperity
if = {
limit = {
county.development_level <= 20
county.prosperity_level <= 20
}
add = {
value = county.development_level
value = county.prosperity_level
multiply = 0.008
}
}
else_if = {
limit = {
county.development_level <= 40
county.prosperity_level <= 40
}
add = {
value = county.development_level
value = county.prosperity_level
multiply = 0.010
}
}
else = {
add = {
value = county.development_level
value = county.prosperity_level
multiply = 0.012
}
}
#Era pacing
if = {
limit = {
culture = {
has_cultural_era_or_later = culture_era_high_medieval
}
}
add = 0
}
else_if = {
limit = {
culture = {
has_cultural_era_or_later = culture_era_early_medieval
}
}
add = outbreak_decrease_mult_low
}
else_if = {
limit = {
culture = {
has_cultural_era_or_later = culture_era_tribal
}
}
add = outbreak_decrease_mult_medium
}
#Terrain
if = {
limit = {
@ -384,7 +455,7 @@ outbreak_chance_major_mult_value = {
if = {
limit = {
county.development_level < 10
county.prosperity_level < 10
}
multiply = 0.1
}
@ -397,15 +468,15 @@ outbreak_chance_major_mult_value = {
outbreak_chance_apocalyptic_default_value = {
value = outbreak_chance_base_extra_low
#Buildings
add = {
value = num_buildings
value = province_size_level
multiply = outbreak_increase_add_low
}
#Tradeports / Coasts
if = {
limit = {
has_building_or_higher = common_tradeport_01
has_port_district = yes
}
add = outbreak_increase_add_high
}
@ -440,6 +511,12 @@ outbreak_chance_apocalyptic_mult_value = {
# Game rules
if = {
limit = {
has_game_rule = epidemic_frequency_normal
}
add = 0
}
else_if = {
limit = {
has_game_rule = epidemic_frequency_often
}
@ -470,32 +547,58 @@ outbreak_chance_apocalyptic_mult_value = {
add = outbreak_decrease_mult_high
}
#Development
#Prosperity
if = {
limit = {
county.development_level <= 20
county.prosperity_level <= 20
}
add = {
value = county.development_level
value = county.prosperity_level
multiply = 0.008
}
}
else_if = {
limit = {
county.development_level <= 40
county.prosperity_level <= 40
}
add = {
value = county.development_level
value = county.prosperity_level
multiply = 0.010
}
}
else = {
add = {
value = county.development_level
value = county.prosperity_level
multiply = 0.012
}
}
#Era pacing
if = {
limit = {
culture = {
has_cultural_era_or_later = culture_era_late_medieval
}
}
add = 0
}
else_if = {
limit = {
culture = {
has_cultural_era_or_later = culture_era_high_medieval
}
}
add = outbreak_decrease_mult_medium
}
else_if = {
limit = {
culture = {
has_cultural_era_or_later = culture_era_tribal
}
}
add = outbreak_decrease_mult_unlikely
}
#Terrain
if = {
limit = {
@ -665,6 +768,40 @@ outbreak_chance_dysentery_mult_value = {
add = outbreak_decrease_mult_high
}
#Era pacing
if = {
limit = {
culture = {
has_cultural_era_or_later = culture_era_late_medieval
}
}
add = 0
}
else_if = {
limit = {
culture = {
has_cultural_era_or_later = culture_era_high_medieval
}
}
add = 0
}
else_if = {
limit = {
culture = {
has_cultural_era_or_later = culture_era_early_medieval
}
}
add = outbreak_decrease_mult_low
}
else_if = {
limit = {
culture = {
has_cultural_era_or_later = culture_era_tribal
}
}
add = outbreak_decrease_mult_medium
}
#Terrain
if = {
limit = {
@ -704,7 +841,7 @@ outbreak_chance_dysentery_mult_value = {
if = {
limit = {
county.development_level < 10
county.prosperity_level < 10
}
multiply = 0.1
}
@ -717,13 +854,13 @@ outbreak_chance_dysentery_mult_value = {
outbreak_chance_black_plague_default_value = {
value = outbreak_chance_base_extra_low
#Buildings
#Districts
if = {
limit = {
num_buildings >= 20
num_districts >= 4
}
add = {
value = num_buildings
value = num_districts
multiply = outbreak_increase_add_medium
}
}
@ -731,7 +868,7 @@ outbreak_chance_black_plague_default_value = {
#Tradeports / Coasts
if = {
limit = {
has_building_or_higher = common_tradeport_01
has_port_district = yes
}
add = outbreak_increase_add_high
}
@ -778,9 +915,9 @@ outbreak_chance_black_plague_default_value = {
outbreak_chance_black_plague_mult_value = {
value = 1
#Development
#Prosperity
add = {
value = county.development_level
value = county.prosperity_level
multiply = 0.08
}
@ -816,6 +953,47 @@ outbreak_chance_black_plague_mult_value = {
add = outbreak_decrease_mult_high
}
#Era pacing
if = {
limit = {
NOR = {
has_game_rule = bd_occurrence_random
has_game_rule = bd_frequency_unlimited
}
}
if = {
limit = {
culture = {
has_cultural_era_or_later = culture_era_late_medieval
}
}
add = outbreak_decrease_mult_low
}
else_if = {
limit = {
culture = {
has_cultural_era_or_later = culture_era_high_medieval
}
}
add = outbreak_decrease_mult_medium
}
else_if = {
limit = {
culture = {
has_cultural_era_or_later = culture_era_early_medieval
}
}
add = outbreak_decrease_mult_high
}
else_if = {
limit = {
culture = {
has_cultural_era_or_later = culture_era_tribal
}
}
add = outbreak_decrease_mult_unlikely
}
}
#Terrain
if = {
@ -856,7 +1034,7 @@ outbreak_chance_black_plague_mult_value = {
if = {
limit = {
county.development_level < 10
county.prosperity_level < 10
}
multiply = 0.1
}
@ -941,16 +1119,16 @@ spread_chance_epidemics_default_value = {
}
}
#Buildings
#Districts
add = {
value = num_buildings
value = num_districts
multiply = spread_increase_mult_low
}
#Tradeports
if = {
limit = {
has_building_or_higher = common_tradeport_08
has_building_or_higher = pb_port_04
}
add = spread_increase_add_high
add = spread_increase_add_high
@ -963,19 +1141,7 @@ spread_chance_epidemics_default_value = {
}
else_if = {
limit = {
has_building_or_higher = common_tradeport_07
}
add = spread_increase_add_high
add = spread_increase_add_medium
add = spread_increase_add_medium
add = spread_increase_add_medium
add = spread_increase_add_low
add = spread_increase_add_low
add = spread_increase_add_low
}
else_if = {
limit = {
has_building_or_higher = common_tradeport_06
has_building_or_higher = pb_port_03
}
add = spread_increase_add_medium
add = spread_increase_add_medium
@ -986,17 +1152,7 @@ spread_chance_epidemics_default_value = {
}
else_if = {
limit = {
has_building_or_higher = common_tradeport_05
}
add = spread_increase_add_medium
add = spread_increase_add_medium
add = spread_increase_add_low
add = spread_increase_add_low
add = spread_increase_add_low
}
else_if = {
limit = {
has_building_or_higher = common_tradeport_04
has_building_or_higher = pb_port_02
}
add = spread_increase_add_medium
add = spread_increase_add_low
@ -1005,37 +1161,23 @@ spread_chance_epidemics_default_value = {
}
else_if = {
limit = {
has_building_or_higher = common_tradeport_03
province_has_district = port_district
}
add = spread_increase_add_low
add = spread_increase_add_low
add = spread_increase_add_low
}
else_if = {
limit = {
has_building_or_higher = common_tradeport_02
}
add = spread_increase_add_low
add = spread_increase_add_low
}
else_if = {
limit = {
has_building_or_higher = common_tradeport_01
}
add = spread_increase_add_low
}
#Markets
if = {
limit = {
has_building_or_higher = market_villages_02
has_building_or_higher = pb_market_03
}
add = spread_increase_add_low
add = spread_increase_add_low
}
else_if = {
limit = {
has_building_or_higher = market_villages_01
province_has_district = market_district
}
add = spread_increase_add_low
}
@ -1043,7 +1185,7 @@ spread_chance_epidemics_default_value = {
#Guild Halls
if = {
limit = {
has_building_or_higher = guild_halls_08
has_building_or_higher = pb_guild_04
}
add = spread_increase_add_high
add = spread_increase_add_high
@ -1052,7 +1194,7 @@ spread_chance_epidemics_default_value = {
}
else_if = {
limit = {
has_building_or_higher = guild_halls_06
has_building_or_higher = pb_guild_03
}
add = spread_increase_add_high
add = spread_increase_add_high
@ -1060,14 +1202,14 @@ spread_chance_epidemics_default_value = {
}
else_if = {
limit = {
has_building_or_higher = guild_halls_04
has_building_or_higher = pb_guild_02
}
add = spread_increase_add_high
add = spread_increase_add_high
}
else_if = {
limit = {
has_building_or_higher = guild_halls_02
province_has_district = guild_district
}
add = spread_increase_add_high
}
@ -1213,6 +1355,20 @@ spread_chance_epidemics_default_value = {
}
}
spread_settlement_size_mult_value = {
value = 1
if = {
limit = {
province_size_level > spread_settlement_size_level_threshold
}
add = {
value = province_size_level
subtract = spread_settlement_size_level_threshold
multiply = spread_increase_mult_per_settlement_size_level
}
}
}
spread_chance_epidemics_mult_value = {
value = 1
min = 0.001
@ -1224,8 +1380,8 @@ spread_chance_epidemics_mult_value = {
is_riverside_province = yes
}
NOR = {
has_building_or_higher = common_tradeport_04
num_buildings > 4
has_building_or_higher = pb_port_02
num_districts > 2
}
}
add = spread_decrease_mult_medium
@ -1240,8 +1396,8 @@ spread_chance_epidemics_mult_value = {
is_coastal = yes
is_riverside_province = yes
}
has_building_or_higher = common_tradeport_06
num_buildings > 10
has_building_or_higher = pb_port_03
num_districts > 4
}
add = spread_increase_mult_high
}
@ -1258,9 +1414,9 @@ spread_chance_epidemics_mult_value = {
add = spread_increase_mult_very_high
}
#Development
#Prosperity
add = {
value = county.development_level
value = county.prosperity_level
multiply = 0.025
}
@ -1399,6 +1555,8 @@ spread_chance_epidemics_mult_value = {
}
add = spread_decrease_mult_unlikely
}
multiply = spread_settlement_size_mult_value
}
#### DAILY INFECTION RATE ###
@ -1594,45 +1752,108 @@ character_infection_chance_default_value = {
# Slight buff.
if = {
limit = {
host.domicile ?= { has_domicile_parameter = camp_infection_chance_buff_1 }
OR = {
domicile ?= { has_domicile_parameter = camp_infection_chance_buff_1 }
host.domicile ?= { has_domicile_parameter = camp_infection_chance_buff_1 }
}
}
add = -10
}
# Max buff.
else_if = {
limit = {
host.domicile ?= { has_domicile_parameter = camp_infection_chance_buff_6 }
OR = {
domicile ?= { has_domicile_parameter = camp_infection_chance_buff_6 }
host.domicile ?= { has_domicile_parameter = camp_infection_chance_buff_6 }
}
}
add = -40
}
# Very high buff.
else_if = {
limit = {
host.domicile ?= { has_domicile_parameter = camp_infection_chance_buff_5 }
OR = {
domicile ?= { has_domicile_parameter = camp_infection_chance_buff_5 }
host.domicile ?= { has_domicile_parameter = camp_infection_chance_buff_5 }
}
}
add = -30
}
# High buff.
else_if = {
limit = {
host.domicile ?= { has_domicile_parameter = camp_infection_chance_buff_4 }
OR = {
domicile ?= { has_domicile_parameter = camp_infection_chance_buff_4 }
host.domicile ?= { has_domicile_parameter = camp_infection_chance_buff_4 }
}
}
add = -25
}
# Medium buff.
else_if = {
limit = {
host.domicile ?= { has_domicile_parameter = camp_infection_chance_buff_3 }
OR = {
domicile ?= { has_domicile_parameter = camp_infection_chance_buff_3 }
host.domicile ?= { has_domicile_parameter = camp_infection_chance_buff_3 }
}
}
add = -20
}
# Small buff.
else_if = {
limit = {
host.domicile ?= { has_domicile_parameter = camp_infection_chance_buff_2 }
OR = {
domicile ?= { has_domicile_parameter = camp_infection_chance_buff_2 }
host.domicile ?= { has_domicile_parameter = camp_infection_chance_buff_2 }
}
}
add = -15
}
if = {
limit = {
OR = {
domicile ?= { has_domicile_parameter = merchant_infection_chance_buff_5 }
host.domicile ?= { has_domicile_parameter = merchant_infection_chance_buff_5 }
}
}
add = -30
}
else_if = {
limit = {
OR = {
domicile ?= { has_domicile_parameter = merchant_infection_chance_buff_4 }
host.domicile ?= { has_domicile_parameter = merchant_infection_chance_buff_4 }
}
}
add = -25
}
else_if = {
limit = {
OR = {
domicile ?= { has_domicile_parameter = merchant_infection_chance_buff_3 }
host.domicile ?= { has_domicile_parameter = merchant_infection_chance_buff_3 }
}
}
add = -20
}
else_if = {
limit = {
OR = {
domicile ?= { has_domicile_parameter = merchant_infection_chance_buff_2 }
host.domicile ?= { has_domicile_parameter = merchant_infection_chance_buff_2 }
}
}
add = -15
}
else_if = {
limit = {
OR = {
domicile ?= { has_domicile_parameter = merchant_infection_chance_buff_1 }
host.domicile ?= { has_domicile_parameter = merchant_infection_chance_buff_1 }
}
}
add = -10
}
#Would you follow social distancing?
#your numerical social distance value gets transformed here into a bonus/malus
add = {
@ -1741,18 +1962,14 @@ recent_epidemics_outbreak_mult_value = {
min = 0
}
#How badly effected is a county's development?
epidemic_development_loss_value = {
#How badly affected is a county's prosperity?
epidemic_prosperity_loss_value = {
subtract = scope:base_loss
#This feeds into the change_development_progress in 00_epidemics
#Bear in mind that minimal_development_progress_loss is 10
#and massive_development_progress_loss is 100
#Aim for something between those two extremes generally (in minus)
#This feeds into change_prosperity_progress in 00_epidemics
#minimal_prosperity_progress_loss is 10 and massive_prosperity_progress_loss is 100, so aim between them (as a negative value)
#Since we have widespread development loss handled by modifier, we
#now use this figure to 'chunk' down places with very high development
#so they are disproportionately affected
#Modifiers cover widespread loss, so we hit high-prosperity counties harder here
scope:epidemic = {
switch = {
@ -1763,9 +1980,9 @@ epidemic_development_loss_value = {
}
}
# Development
# Prosperity
subtract = {
value = development_level
value = prosperity_level
multiply = 0.3
}
@ -1826,60 +2043,3 @@ former_infected_county_count = {
add = 0.1
}
}
epidemic_prosperity_loss_value = {
subtract = scope:base_loss
#This feeds into change_prosperity_progress in 00_epidemics
#minimal_prosperity_progress_loss is 10 and massive_prosperity_progress_loss is 100, so aim between them (as a negative value)
#Modifiers cover widespread loss, so we hit high-prosperity counties harder here
scope:epidemic = {
switch = {
trigger = outbreak_intensity
minor = { subtract = 2.5 }
major = { subtract = 5 }
apocalyptic = { subtract = 7.5 }
}
}
# Prosperity
subtract = {
value = prosperity_level
multiply = 0.3
}
multiply = {
value = 6
divide = num_county_holdings
}
multiply = {
value = 100
subtract = title_province.epidemic_resistance
multiply = 0.005
add = 1
}
}
spread_settlement_size_mult_value = {
value = 1
if = {
limit = {
province_size_level > spread_settlement_size_level_threshold
}
add = {
value = province_size_level
subtract = spread_settlement_size_level_threshold
multiply = spread_increase_mult_per_settlement_size_level
}
}
}
# CK3 1.21: retained vanilla values required by the updated systems.
spread_settlement_size_level_threshold = 4
spread_increase_mult_per_settlement_size_level = 0.1