﻿# Clear forest for construction - adds debuff compensation without changing vegetation
cveg_clear_forest_for_construction = {
	is_foreign = no
	max_levels = 1
	pop_type = laborers
	employment_size = 0.001
	category = infrastructure_category
	city = yes
	town = yes
	rural_settlement = yes
	price = cveg_clear_forest_for_construction_price
	build_time = cveg_clear_forest_for_construction_build_time
	forbidden_for_estates = yes
	location_potential = {
		OR = {
			vegetation = forest
			vegetation = woods
		}
		NOT = { has_location_modifier = cveg_compensate_forest_debuff }
		cveg_is_changing_vegetation = no
		trigger_if = {
			limit = { has_variable = cveg_temporary_remove_clear_building }
			custom_tooltip = {
				text = cveg_temporary_clear_building_tooltip
				NOT = { has_variable = cveg_temporary_remove_clear_building }
			}
		}
	}
	unique_production_methods = {
		cveg_clear_forest_for_construction_maintenance = {
			icon_type = goods
			icon = tools
			tools = 0.01
			category = building_maintenance
		}
	}
	on_construction_started = {
		location = {
			add_location_modifier = {
				modifier = cveg_extra_construction_slot
			}
		}
	}
	on_construction_ended = {
		location = {
			remove_location_modifier = cveg_extra_construction_slot
		}
	}
	on_built = {
		location = {
			add_location_modifier = {
				modifier = cveg_compensate_forest_debuff
			}
			set_variable = {
				name = cveg_temporary_remove_clear_building
				months = 2
			}
		}
	}
	construction_demand = cveg_clear_forest_for_construction_construction
	modifier = {
		movement_cost = -0.25
		local_rgo_build_time = -0.33
		local_road_building_time = -0.50
		local_distance_from_capital_speed_propagation = 0.125
		local_monthly_development_modifier = 0.05
	}
	remove_if = {
		location = {
			has_variable = cveg_temporary_remove_clear_building
		}
	}
}

# Drain wetlands for construction - adds debuff compensation without changing topography
cveg_drain_wetlands_for_construction = {
	is_foreign = no
	max_levels = 1
	pop_type = laborers
	employment_size = 0.001
	category = infrastructure_category
	city = yes
	town = yes
	rural_settlement = yes
	price = cveg_drain_wetlands_for_construction_price
	build_time = cveg_drain_wetlands_for_construction_build_time
	forbidden_for_estates = yes
	location_potential = {
		topography = wetlands
		NOT = { has_location_modifier = wsf_wetlands_to_flatland }
		NOT = { has_location_modifier = cveg_compensate_wetlands_debuff }
		cveg_is_changing_vegetation = no
		NOT = {
			any_buildings_in_location = {
				building_levels_under_construction > 0
				building_type = building_type:cveg_drain_wetlands_for_construction
			}
		}
		trigger_if = {
			limit = { has_variable = cveg_temporary_remove_clear_building }
			custom_tooltip = {
				text = cveg_temporary_clear_building_tooltip
				NOT = { has_variable = cveg_temporary_remove_clear_building }
			}
		}
	}
	unique_production_methods = {
		cveg_drain_wetlands_for_construction_maintenance = {
			icon_type = goods
			icon = tools
			tools = 0.01
			category = building_maintenance
		}
	}
	on_construction_started = {
		location = {
			add_location_modifier = {
				modifier = cveg_extra_construction_slot
			}
		}
	}
	on_construction_ended = {
		location = {
			remove_location_modifier = cveg_extra_construction_slot
		}
	}
	on_built = {
		location = {
			add_location_modifier = {
				modifier = cveg_compensate_wetlands_debuff
			}
			set_variable = {
				name = cveg_temporary_remove_clear_building
				months = 2
			}
		}
	}
	construction_demand = cveg_drain_wetlands_for_construction_construction
	modifier = {
		movement_cost = -0.5
		local_rgo_build_time = -0.25
		local_road_building_time = -1.0
		local_distance_from_capital_speed_propagation = 0.25
		local_monthly_development_modifier = 0.30
	}
	remove_if = {
		location = {
			has_variable = cveg_temporary_remove_clear_building
		}
	}
}