﻿fine_cloth_guild = {
	is_foreign = no
	pop_type = burghers
	max_levels = fine_cloth_guild_max_level
	startup_ramp_target = guild_startup_ramp_target
	price = base_price
	increase_per_level_cost = 1.00
	category = consumer_goods_category

	employment_size = guild_employment
	
	town = yes
	city = yes
	megalopolis = yes

	

	build_time = guild_build_time
	
	unique_production_methods = {
		fine_cloth_guild_maintenance = {
			icon_type = goods
			icon = cloth
			cloth = 0.9
			produced = fine_cloth
			output = 1.0

			debug_max_profit = guild_profit_margin
			category = guild_input
		}

		wool_weavers_maintenance = {
			icon_type = goods
			icon = wool
			wool = 1.125

			produced = fine_cloth
			output = 0.8

			debug_max_profit = guild_profit_margin
			category = guild_input
		}

		silk_weavers_maintenance = {
			icon_type = goods
			icon = silk
			silk = 0.5625
			
			produced = fine_cloth
			output = 1.0
			
			category = guild_input
			debug_max_profit = guild_profit_margin	# its ok to be a bit better..
		}

		spanish_cloth_maintenance = {
			icon_type = goods
			icon = wool
			allow = {
				custom_tooltip = {
					text = has_unlocked_spanish_cloth_industry
					has_variable = spanish_cloth_industry
				}
			}
			wool = 0.75
			
			produced = fine_cloth
			output = 0.75
			
			category = guild_input
			debug_max_profit = guild_profit_margin
		}
	}

	unique_production_methods = {
		base_fine_cloth_guild_maintenance = {
			icon_type = goods
			icon = dyes
			produced = fine_cloth
			dyes = 0.1875
			output = 0.20

			category = guild_input

			debug_max_profit = guild_profit_margin		#improvement
		}

		alum_fine_cloth_guild_maintenance = {
			icon_type = goods
			icon = alum
			alum = 0.0392
			dyes = 0.1581
			produced = fine_cloth
			output = 0.2

			debug_max_profit = guild_profit_margin
			category = guild_input
		}

		fur_trim_guild_maintenance = {
			icon_type = goods
			icon = fur
			fur = 0.375
			produced = fine_cloth
			output = 0.2

			debug_max_profit = guild_profit_margin
			category = guild_input
		}

	}

	custom_tags = { guild }
	construction_demand = guild_construction

}

fine_cloth_workshop = {
	audio_tier = 2
	is_foreign = no
	pop_type = burghers
	max_levels = workshop_max_level
	startup_ramp_target = workshop_startup_ramp_target

	category = consumer_goods_category

	employment_size = workshop_employment
	
	town = yes
	city = yes
	megalopolis = yes

	

	build_time = workshop_build_time
	
	unique_production_methods = {
		fine_cloth_workshop_maintenance = {
			icon_type = goods
			icon = cloth
			cloth = 0.72
			produced = fine_cloth
			output = 0.6
			
			category = workshop_input
			
			debug_max_profit = workshop_profit_margin
		}

		wool_weavers_workshop_maintenance = {
			icon_type = goods
			icon = wool
			wool = 0.864
			
			produced = fine_cloth
			output = 0.6
			
			category = workshop_input
			debug_max_profit = workshop_profit_margin
		}

		silk_weavers_workshop_maintenance = {
			icon_type = goods
			icon = silk
			silk = 0.72
			
			produced = fine_cloth
			output = 0.8
			
			category = workshop_input
			
			debug_max_profit = workshop_profit_margin

		}

		spanish_cloth_workshop_maintenance = {
			icon_type = goods
			icon = wool
			allow = {
				custom_tooltip = {
					text = has_unlocked_spanish_cloth_industry
					has_variable = spanish_cloth_industry
				}
			}
			wool = 0.864
			
			produced = fine_cloth
			output = 0.6
			
			debug_max_profit = workshop_profit_margin
			
			category = workshop_input
		}
	}

	unique_production_methods = {
		base_fine_cloth_workshop_maintenance = {
			icon_type = goods
			icon = dyes
			produced = fine_cloth
			dyes = 0.108
			output = 0.12

			debug_max_profit = workshop_profit_margin
			category = workshop_input
		}

		alum_fine_cloth_workshop_maintenance = {
			icon_type = goods
			icon = alum
			alum = 0.0435
			dyes = 0.1925
			produced = fine_cloth
			output = 0.25

			debug_max_profit = workshop_profit_margin
			category = workshop_input
		}

		fur_trim_workshop_maintenance = {
			icon_type = goods
			icon = fur
			fur = 0.45
			produced = fine_cloth
			output = 0.25

			debug_max_profit = workshop_profit_margin
			category = workshop_input
		}

	}
	
	obsolete = fine_cloth_guild

	custom_tags = { workshop }
	construction_demand = workshop_construction

}

fine_cloth_manufactory = {
	audio_tier = 3
	is_foreign = no
	pop_type = burghers
	max_levels = manufactory_max_level
	startup_ramp_target = manufactory_startup_ramp_target

	category = consumer_goods_category

	employment_size = manufactory_employment

	
	town = yes
	city = yes
	megalopolis = yes

	
	
	obsolete = fine_cloth_workshop

	build_time = manufactory_build_time

	unique_production_methods = {
		silk_cloth_manufactory_maintenance = {
			icon_type = goods
			icon = silk
			silk = 1.7308
			
			produced = fine_cloth
			output = 2.0
			
			category = manufactory_input
			debug_max_profit = manufactory_profit_margin
		}

		fine_cloth_manufactory_maintenance = {
			icon_type = goods
			icon = cloth
			produced = fine_cloth
			cloth = 2.3077


			output = 2.0
			debug_max_profit = manufactory_profit_margin
			
			category = manufactory_input
		}

	}

	unique_production_methods = {

		base_cloth_manufactory_maintenance = {
			icon_type = goods
			icon = dyes
			dyes = 0.1731
			
			produced = fine_cloth
			output = 0.2
			
			category = guild_input
			debug_max_profit = manufactory_profit_margin
		}

		alum_fine_cloth_manufactory_maintenance = {
			icon_type = goods
			icon = alum
			produced = fine_cloth
			output = 0.4
			dyes = 0.2918
			alum = 0.0728
			
			category = guild_input
			debug_max_profit = manufactory_profit_margin
		}
	}

	custom_tags = { midgame_manufactory }
	construction_demand = guild_construction
}

fine_cloth_mill = {
	audio_tier = 5
	is_foreign = no
	pop_type = laborers
	is_mill = yes
	max_levels = mills_max_level
	startup_ramp_target = mills_startup_ramp_target

	category = consumer_goods_category
	employment_size = mills_employment

	
	town = yes
	city = yes
	megalopolis = yes

	
	
	obsolete = fine_cloth_manufactory

	build_time = mills_build_time
	
	unique_production_methods = {
		fine_cloth_mill_maintenance = {
			icon_type = goods
			icon = cloth
			cloth = 4.077
			dyes = 0.2756
			
			produced = fine_cloth
			output = 4
			
			debug_max_profit = mills_profit_margin
			
			category = mills_input
		}

		silk_cloth_mill_maintenance = {
			icon_type = goods
			icon = silk
			silk = 3.06
			dyes = 0.2733
			
			produced = fine_cloth
			output = 4
			
			debug_max_profit = mills_profit_margin
			
			category = mills_input
		}

	}
	
	custom_tags = { lategame_manufactory }
	construction_demand = mill_construction

	raw_modifier = {
		local_burghers_desired_pop = 0.05
	}
}
