﻿# Negative
drought = {
	trigger = {
		is_vulnerable_to_droughts = yes
	}

	incompatible_with = flood
	incompatible_with = frost
	incompatible_with = hailstorm
	incompatible_with = torrential_rains
	incompatible_with = moderate_rainfall
	# Incompatible with Drought: flood, frost, hailstorm, heatwave, torrential rains, pollinator surge, optimal sunlight
	# Replaces heatwave, optimal sunlight, pollinator surge

	range = {
		integer_range = {
			min = 1
			max = 2
		}
	}

	duration = {
		fixed_range = {
			min = 36
			max = 104
		}
	}

	modifier = {
		#Throughput
		building_group_bg_agriculture_throughput_add = -0.05
		building_group_bg_subsistence_agriculture_throughput_add = -0.05
		building_group_bg_plantations_throughput_add = -0.05
		building_group_bg_ranching_throughput_add = -0.05

		#Infrastructure
		building_group_bg_agriculture_infrastructure_usage_mult = 0.1
		building_group_bg_plantations_infrastructure_usage_mult = 0.1
		building_group_bg_ranching_infrastructure_usage_mult = 0.1
	}

	intensity = {
		fixed_range = {
			min = 2
			max = 6
		}
	}

	chance = {
		value = 0.0025
		if = {
			limit = {
				has_harvest_condition = optimal_sunlight
			}
			multiply = 1.2
		}
		if = {
			limit = {
				has_harvest_condition = heatwave
			}
			multiply = 1.5
		}
	}

	color = { 222 62 37 }
	icon = "gfx/interface/icons/harvest_condition_icons/drought.dds"
	graphics = drought
	incompatible_terrain = { desert }
	map_texture = "gfx/map/map_painting/harvest_conditions_map_patterns/harvest_conditions_bad.dds"
}

flood = {
	trigger = {
		is_vulnerable_to_floods = yes
	}

	incompatible_with = drought
	incompatible_with = wildfire
	incompatible_with = frost
	# Incompatible with flood: frost, wildfire, torrential rains, pollinator surge, optimal sunlight, moderate rainfall, drought
	# Replaces torrential rains, pollinator surge, optimal sunlight, moderate rainfall

	range = {
		integer_range = {
			min = 1
			max = 2
		}
	}

	duration = {
		fixed_range = {
			min = 36
			max = 104
		}
	}

	modifier = {
		#Infrastructure
		state_infrastructure_mult = -0.05

		#MAPI
		state_market_access_price_impact = -0.05

		#Throughput
		building_group_bg_agriculture_throughput_add = -0.05
		building_group_bg_subsistence_agriculture_throughput_add = -0.05
		building_group_bg_plantations_throughput_add = -0.05
		building_group_bg_ranching_throughput_add = -0.05
		building_group_bg_extraction_throughput_add = -0.05
	}

	intensity = {
		fixed_range = {
			min = 3
			max = 6
		}
	}

	chance = {
		value = 0.0025
		if = {
			limit = {
				OR = {
					has_harvest_condition = moderate_rainfall
					has_harvest_condition = heatwave
				}
			}
			multiply = 1.2
		}
		if = {
			limit = {
				has_harvest_condition = hailstorm
			}
			multiply = 1.1
		}
		if = {
			limit = {
				has_harvest_condition = torrential_rains
			}
			multiply = 1.5
		}
	}

	color = { 85 65 8 }
	icon = "gfx/interface/icons/harvest_condition_icons/flood.dds"
	graphics = flood
	map_texture = "gfx/map/map_painting/harvest_conditions_map_patterns/harvest_conditions_bad.dds"
}

frost = {
	trigger = {
		is_vulnerable_to_frosts = yes
	}

	incompatible_with = drought
	incompatible_with = wildfire
	incompatible_with = heatwave
	incompatible_with = optimal_sunlight
	incompatible_with = moderate_rainfall
	incompatible_with = torrential_rains
	incompatible_with = flood
	# Incompatible with frost: drought, flood, wildfire, locust swarm, heatwave, torrential rains, pollinator surge, optimal sunlight, moderate rainfall
	# Replaces locust swarm, pollinator surge, optimal sunlight, moderate rainfall

	range = {
		integer_range = {
			min = 1
			max = 1
		}
	}

	duration = {
		fixed_range = {
			min = 24
			max = 96
		}
	}

	modifier = {
		#Throughput
		building_group_bg_agriculture_throughput_add = -0.05
		building_group_bg_subsistence_agriculture_throughput_add = -0.05
		building_group_bg_plantations_throughput_add = -0.05
	}

	intensity = {
		fixed_range = {
			min = 2
			max = 4
		}
	}

	chance = {
		value = 0.0025
		if = {
			limit = {
				has_harvest_condition = hailstorm
			}
			multiply = 1.5
		}
	}

	color = { 47 127 185 }
	icon = "gfx/interface/icons/harvest_condition_icons/frost.dds"
	graphics = frost
	map_texture = "gfx/map/map_painting/harvest_conditions_map_patterns/harvest_conditions_bad.dds"
}

wildfire = {
	trigger = {
		is_vulnerable_to_wildfires = yes
	}

	incompatible_with = flood
	incompatible_with = frost
	incompatible_with = hailstorm
	incompatible_with = torrential_rains
	incompatible_with = moderate_rainfall
	# Incompatible with Wildfire: flood, frost, hail, locusts, heatwave, torrential rains, pollinators, optimal sunlight, moderate rainfall
	# Replaces locusts, heatwave, pollinators, optimal sunlight, moderate rainfall

	range = {
		integer_range = {
			min = 1
			max = 2
		}
	}

	duration = {
		fixed_range = {
			min = 24
			max = 94
		}
	}

	modifier = {
		# Throughput
		building_group_bg_agriculture_throughput_add = -0.05
		building_group_bg_subsistence_agriculture_throughput_add = -0.05
		building_group_bg_plantations_throughput_add = -0.05
		building_group_bg_ranching_throughput_add = -0.05
		building_group_bg_extraction_throughput_add = -0.05

		# Infra - Building
		building_group_bg_agriculture_infrastructure_usage_mult = 0.1
		building_group_bg_plantations_infrastructure_usage_mult = 0.1
		building_group_bg_ranching_infrastructure_usage_mult = 0.1

		# Infra - State
		state_infrastructure_mult = -0.05
	}

	intensity = {
		fixed_range = {
			min = 4
			max = 8
		}
	}

	chance = {
		value = 0.0008
		if = {
			limit = {
				has_harvest_condition = optimal_sunlight
			}
			multiply = 1.2
		}
		if = {
			limit = {
				has_harvest_condition = heatwave
			}
			multiply = 1.3
		}
		if = {
			limit = {
				has_harvest_condition = drought
			}
			multiply = 1.4
		}
	}

	color = { 152 42 46 }
	icon = "gfx/interface/icons/harvest_condition_icons/wildfire.dds"
	map_texture = "gfx/map/map_painting/harvest_conditions_map_patterns/harvest_conditions_bad.dds"
	graphics = wildfire
}

hailstorm = {
	trigger = {
		is_vulnerable_to_hailstorm = yes
	}

	incompatible_with = drought
	incompatible_with = wildfire
	incompatible_with = heatwave
	incompatible_with = optimal_sunlight
	# Incompatible with hailstorm: drought, wildfire, locusts, heatwave, pollinators, optimal sunlight, moderate rainfall
	# Replaces locusts, pollinators, moderate rainfall

	range = {
		integer_range = {
			min = 1
			max = 1
		}
	}

	duration = {
		fixed_range = {
			min = 24
			max = 96
		}
	}

	modifier = {
		# Throughput
		building_group_bg_agriculture_throughput_add = -0.05
		building_group_bg_subsistence_agriculture_throughput_add = -0.05
		building_group_bg_plantations_throughput_add = -0.05
		building_group_bg_ranching_throughput_add = -0.05
		building_group_bg_logging_throughput_add = -0.05
	}

	intensity = {
		fixed_range = {
			min = 2
			max = 4
		}
	}

	chance = {
		value = 0.0025
		if = {
			limit = {
				OR = {
					has_harvest_condition = frost
					has_harvest_condition = torrential_rains
				}
			}
			multiply = 1.3
		}
	}

	color = { 70 234 255 }
	icon = "gfx/interface/icons/harvest_condition_icons/hailstorm.dds"
	map_texture = "gfx/map/map_painting/harvest_conditions_map_patterns/harvest_conditions_bad.dds"
	graphics = hail
}

locust_swarm = {
	trigger = {
		is_vulnerable_to_locust_swarms = yes
	}

	incompatible_with = frost
	incompatible_with = wildfire
	incompatible_with = extreme_winds
	incompatible_with = hailstorm
	incompatible_with = torrential_rains
	# Incompatible with Locust Swarm: pollinator surge
	# Replaces pollinator surge

	range = {
		integer_range = {
			min = 1
			max = 2
		}
	}

	duration = {
		fixed_range = {
			min = 36
			max = 96
		}
	}

	modifier = {
		# Throughput
		building_group_bg_agriculture_throughput_add = -0.05
		building_group_bg_subsistence_agriculture_throughput_add = -0.05
		building_group_bg_plantations_throughput_add = -0.05
		building_group_bg_ranching_throughput_add = -0.05
	}

	intensity = {
		fixed_range = {
			min = 3
			max = 5
		}
	}

	chance = {
		value = 0.0015
	}

	color = { 184 121 0 }
	icon = "gfx/interface/icons/harvest_condition_icons/locust_swarm.dds"
	map_texture = "gfx/map/map_painting/harvest_conditions_map_patterns/harvest_conditions_bad.dds"
	graphics = drought
}

heatwave = {
	trigger = {
		is_vulnerable_to_heatwaves = yes
	}

	incompatible_with = hailstorm
	incompatible_with = frost
	incompatible_with = drought
	incompatible_with = wildfire
	# Incompatible with Heatwave: frost, hail, pollinators, optimal sunlight
	# Replaces pollinators, optimal sunlight

	range = {
		integer_range = {
			min = 1
			max = 2
		}
	}

	duration = {
		fixed_range = {
			min = 36
			max = 104
		}
	}

	modifier = {
		# Throughput
		building_group_bg_agriculture_throughput_add = -0.05
		building_group_bg_subsistence_agriculture_throughput_add = -0.05
		building_group_bg_plantations_throughput_add = -0.05
		building_group_bg_ranching_throughput_add = -0.05
		building_group_bg_rubber_throughput_add = -0.05
		building_group_bg_logging_throughput_add = -0.05
	}

	intensity = {
		fixed_range = {
			min = 2
			max = 4
		}
	}

	chance = {
		value = 0.0025
		if = {
			limit = {
				has_harvest_condition = optimal_sunlight
			}
			multiply = 1.4
		}
	}

	color = { 166 67 0 }
	icon = "gfx/interface/icons/harvest_condition_icons/heatwave.dds"
	map_texture = "gfx/map/map_painting/harvest_conditions_map_patterns/harvest_conditions_bad.dds"
	graphics = drought
}

disease_outbreak = {
	trigger = {
		is_vulnerable_to_disease_outbreak = yes
	}

	# Incompatible with Disease Outbreak: pollinators
	# Replaces pollinators

	range = {
		integer_range = {
			min = 1
			max = 1
		}
	}

	duration = {
		fixed_range = {
			min = 36
			max = 96
		}
	}

	modifier = {
		# Throughput
		building_group_bg_agriculture_throughput_add = -0.05
		building_group_bg_subsistence_agriculture_throughput_add = -0.05
		building_group_bg_plantations_throughput_add = -0.05
		building_group_bg_ranching_throughput_add = -0.05
	}

	intensity = {
		fixed_range = {
			min = 3
			max = 7
		}
	}

	chance = {
		value = 0.0008
	}

	color = { 78 70 57 }
	icon = "gfx/interface/icons/harvest_condition_icons/disease_outbreak.dds"
	map_texture = "gfx/map/map_painting/harvest_conditions_map_patterns/harvest_conditions_bad.dds"
	graphics = drought
}

extreme_winds = {
	trigger = {
		is_vulnerable_to_extreme_winds = yes
	}

	# Incompatible with Extreme Winds: pollinators, locusts
	# Replaces pollinators, locusts

	range = {
		integer_range = {
			min = 1
			max = 2
		}
	}

	duration = {
		fixed_range = {
			min = 36
			max = 104
		}
	}

	modifier = {
		# Throughput
		building_group_bg_agriculture_throughput_add = -0.05
		building_group_bg_subsistence_agriculture_throughput_add = -0.05
		building_group_bg_plantations_throughput_add = -0.05
	}

	intensity = {
		fixed_range = {
			min = 2
			max = 5
		}
	}

	chance = {
		value = 0.0025
	}

	color = { 79 204 169 }
	icon = "gfx/interface/icons/harvest_condition_icons/extreme_winds.dds"
	map_texture = "gfx/map/map_painting/harvest_conditions_map_patterns/harvest_conditions_bad.dds"
	graphics = extreme_winds
}

torrential_rains = {
	trigger = {
		is_vulnerable_to_torrential_rains = yes
	}

	incompatible_with = drought
	incompatible_with = wildfire
	incompatible_with = flood
	incompatible_with = frost
	# Incompatible with Torrential Rains: drought, frost, wildfire, locusts, pollinators, optimal sunlight, moderate rainfall
	# Replaces locusts, pollinators, optimal sunlight, moderate rainfall

	range = {
		integer_range = {
			min = 1
			max = 2
		}
	}

	duration = {
		fixed_range = {
			min = 36
			max = 104
		}
	}

	modifier = {
		# Throughput
		building_group_bg_agriculture_throughput_add = -0.05
		building_group_bg_subsistence_agriculture_throughput_add = -0.05
		building_group_bg_plantations_throughput_add = -0.05
		building_group_bg_ranching_throughput_add = -0.03
		building_group_bg_extraction_throughput_add = -0.03

		#Infra
		state_infrastructure_mult = -0.1
	}

	intensity = {
		fixed_range = {
			min = 2
			max = 5
		}
	}

	chance = {
		value = 0.003
		if = {
			limit = {
				OR = {
					has_harvest_condition = heatwave
					has_harvest_condition = moderate_rainfall
				}
			}
			multiply = 1.3
		}
	}


	color = { 34 75 120 } # darker slate gray
	icon = "gfx/interface/icons/harvest_condition_icons/torrential_rains.dds"
	map_texture = "gfx/map/map_painting/harvest_conditions_map_patterns/harvest_conditions_bad.dds"
	graphics = torrential_rains
}

# Positive

pollinator_surge = {
	trigger = {
		has_potential_for_pollinator_surge = yes
	}

	incompatible_with = drought
	incompatible_with = flood
	incompatible_with = frost
	incompatible_with = wildfire
	incompatible_with = hailstorm
	incompatible_with = locust_swarm
	incompatible_with = heatwave
	incompatible_with = disease_outbreak
	incompatible_with = extreme_winds
	incompatible_with = torrential_rains

	range = {
		integer_range = {
			min = 1
			max = 1
		}
	}

	duration = {
		fixed_range = {
			min = 36
			max = 96
		}
	}

	modifier = {
		#Throughput
		building_group_bg_plantations_throughput_add = 0.1

		#Output
		goods_output_fruit_mult = 0.05
	}

	intensity = {
		fixed_range = {
			min = 1
			max = 4
		}
	}

	chance = {
		value = 0.0025
	}

	color = { 90 140 0 }
	icon = "gfx/interface/icons/harvest_condition_icons/pollinator_surge.dds"
	map_texture = "gfx/map/map_painting/harvest_conditions_map_patterns/harvest_conditions_good.dds"
}

optimal_sunlight = {
	trigger = {
		has_potential_for_optimal_sunlight = yes
	}

	incompatible_with = drought
	incompatible_with = flood
	incompatible_with = frost
	incompatible_with = wildfire
	incompatible_with = hailstorm
	incompatible_with = heatwave
	incompatible_with = torrential_rains
	#Incompatible with Optimal Sunlight: frost, hailstorm

	range = {
		integer_range = {
			min = 1
			max = 2
		}
	}

	duration = {
		fixed_range = {
			min = 36
			max = 104
		}
	}

	modifier = {
		# Throughput
		building_group_bg_agriculture_throughput_add = 0.05
		building_group_bg_subsistence_agriculture_throughput_add = 0.05
		building_group_bg_plantations_throughput_add = 0.05
	}

	intensity = {
		fixed_range = {
			min = 2
			max = 5
		}
	}

	chance = {
		value = 0.003
	}

	color = { 125 255 62 }
	icon = "gfx/interface/icons/harvest_condition_icons/optimal_sunlight.dds"
	map_texture = "gfx/map/map_painting/harvest_conditions_map_patterns/harvest_conditions_good.dds"
}

moderate_rainfall = {
	trigger = {
		has_potential_for_moderate_rainfall = yes
	}

	incompatible_with = drought
	incompatible_with = flood
	incompatible_with = frost
	incompatible_with = wildfire
	incompatible_with = hailstorm
	incompatible_with = torrential_rains
	#Incompatible with Moderate Rainfall: drought, frost, wildfire

	range = {
		integer_range = {
			min = 1
			max = 2
		}
	}

	duration = {
		fixed_range = {
			min = 36
			max = 104
		}
	}

	modifier = {
		# Throughput
		building_group_bg_agriculture_throughput_add = 0.05
		building_group_bg_subsistence_agriculture_throughput_add = 0.05
		building_group_bg_plantations_throughput_add = 0.05
		building_group_bg_ranching_throughput_add = 0.03
	}

	intensity = {
		fixed_range = {
			min = 2
			max = 4
		}
	}

	chance = {
		value = 0.003
	}

	color = { 65 100 250 }
	icon = "gfx/interface/icons/harvest_condition_icons/moderate_rainfall.dds"
	map_texture = "gfx/map/map_painting/harvest_conditions_map_patterns/harvest_conditions_good.dds"
}