﻿##############################VANILLA##############################

# Altos Hornos de Vizcaya
TRY_REPLACE:company_altos_hornos_de_vizcaya = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/basque_altos_hornos_de_vizcaya.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_heavy.dds"

	flavored_company = yes

	preferred_headquarters = { STATE_BASQUE_COUNTRY }

	building_types = {
		building_steel_mill
		building_iron_mine
	}

	extension_building_types = {
		building_coal_mine
	}

	possible_prestige_goods = {
		prestige_good_generic_steel
	}

	prestige_goods_trigger = {
		custom_tooltip = {
			text = je_prestige_goods_steel_complete_tt
			has_variable = prestige_good_generic_steel_var
		}
	}

	potential = {
		has_interest_marker_in_region = sr:region_southern_europe
	}

	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_BASQUE_COUNTRY
			}
		}
	}

	possible = {
		has_technology_researched = steelworking
		any_scope_state = {
			state_region = s:STATE_BASQUE_COUNTRY
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_steel_mill
				level >= 5
			}
		}
	}

	prosperity_modifier = {
		state_infrastructure_mult = 0.1
	}

	ai_will_do = {
		has_technology_researched = steelworking
		any_scope_state = {
			state_region = s:STATE_BASQUE_COUNTRY
			is_incorporated = yes
		}
	}

	ai_construction_targets = {
		building_steel_mill = {
			level = 5
			state_trigger = {
				state_region = s:STATE_BASQUE_COUNTRY
			}
		}
	}

	ai_weight = {
		value = 3 # Higher base value for flavored companies
	}
}

# Duro y Compañía
TRY_REPLACE:company_duro_y_compania = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/spain_duro_y_compania.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_mining.dds"

	flavored_company = yes

	preferred_headquarters = { STATE_ASTURIAS }

	building_types = {
		building_coal_mine
		building_steel_mill
		building_iron_mine
	}

	extension_building_types = {
		building_logging_camp
	}

	possible_prestige_goods = {
		prestige_good_generic_steel
	}

	prestige_goods_trigger = {
		custom_tooltip = {
			text = je_prestige_goods_steel_complete_tt
			has_variable = prestige_good_generic_steel_var
		}
	}

	potential = {
		has_interest_marker_in_region = sr:region_southern_europe
	}

	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_ASTURIAS
			}
		}
	}

	possible = {
		has_technology_researched = steelworking
		any_scope_state = {
			state_region = s:STATE_ASTURIAS
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_coal_mine
				level >= 5
			}
		}
	}

	prosperity_modifier = {
		building_arms_industry_throughput_add = 0.1
		building_artillery_foundry_throughput_add = 0.1
	}

	ai_will_do = {
		has_technology_researched = steelworking
		any_scope_state = {
			state_region = s:STATE_ASTURIAS
			is_incorporated = yes
		}
	}

	ai_construction_targets = {
		building_coal_mine = {
			level = 5
			state_trigger = {
				state_region = s:STATE_ASTURIAS
			}
		}
	}

	ai_weight = {
		value = 3 # Higher base value for flavored companies
	}
}

# La España Industrial
TRY_REPLACE:company_espana_industrial = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/spain_la_espana_industrial.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_light.dds"

	flavored_company = yes

	preferred_headquarters = { STATE_CATALONIA }

	building_types = {
		building_textile_mill
		building_cotton_plantation
	}

	extension_building_types = {
		building_silk_plantation
	}

	possible_prestige_goods = {
		prestige_good_generic_clothes
	}

	prestige_goods_trigger = {
		custom_tooltip = {
			text = je_prestige_goods_clothes_complete_tt
			has_variable = prestige_good_generic_clothes_var
		}
	}

	potential = {
		has_interest_marker_in_region = sr:region_southern_europe
	}

	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_CATALONIA
			}
		}
	}

	possible = {
		has_technology_researched = cotton_gin
		any_scope_state = {
			state_region = s:STATE_CATALONIA
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_textile_mill
				level >= 5
			}
		}
	}

	prosperity_modifier = {
		country_weekly_innovation_mult = 0.15
	}

	ai_will_do = {
		has_technology_researched = cotton_gin
		any_scope_state = {
			state_region = s:STATE_CATALONIA
			is_incorporated = yes
		}
	}

	ai_construction_targets = {
		building_textile_mill = {
			level = 5
			state_trigger = {
				state_region = s:STATE_CATALONIA
			}
		}
	}

	ai_weight = {
		value = 3 # Higher base value for flavored companies
	}
}

# Fábrica de Armas de Trubia
TRY_REPLACE:company_trubia = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/spain_fabrica_de_armas_de_trubia.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_heavy.dds"

	flavored_company = yes

	preferred_headquarters = { STATE_ASTURIAS }

	building_types = {
		building_arms_industry
		building_artillery_foundry
	}

	extension_building_types = {
		building_munition_plant
		building_explosives_factory
	}

	possible_prestige_goods = {
		prestige_good_generic_artillery
	}

	prestige_goods_trigger = {
		custom_tooltip = {
			text = je_prestige_goods_artillery_complete_tt
			has_variable = prestige_good_generic_artillery_var
		}
	}

	potential = {
		has_interest_marker_in_region = sr:region_southern_europe
	}

	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_ASTURIAS
			}
		}
	}

	possible = {
		has_technology_researched = gunsmithing
		any_scope_state = {
			state_region = s:STATE_ASTURIAS
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_arms_industry
				level >= 5
			}
		}
	}

	prosperity_modifier = {
		unit_offense_mult = 0.05
		country_military_goods_cost_mult = -0.05
	}

	ai_will_do = {
		has_technology_researched = gunsmithing
		any_scope_state = {
			state_region = s:STATE_ASTURIAS
			is_incorporated = yes
		}
	}

	ai_construction_targets = {
		building_arms_industry = {
			level = 5
			state_trigger = {
				state_region = s:STATE_ASTURIAS
			}
		}
	}

	ai_weight = {
		value = 3 # Higher base value for flavored companies
	}
}

##############################IP-4##############################

# Sociedad Española de Construcción Naval (SECN)
TRY_REPLACE:company_secn = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/company_sociedad_espanola_de_construccion_naval.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_harbor_shipbuilding.dds"

	flavored_company = yes

	building_types = {
		building_shipyard
		building_steel_mill
	}

	extension_building_types = {
		building_motor_industry
		building_artillery_foundry
	}

	potential = {
		has_interest_marker_in_region = sr:region_southern_europe
	}

	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				OR = {
					state_region = s:STATE_GALICIA
					state_region = s:STATE_ASTURIAS
					state_region = s:STATE_LOWER_ANDALUSIA
					state_region = s:STATE_MURCIA
					state_region = s:STATE_VALENCIA
				}
			}
		}
	}

	possible = {
		any_scope_state = {
			OR = {
				state_region = s:STATE_GALICIA
				state_region = s:STATE_ASTURIAS
				state_region = s:STATE_LOWER_ANDALUSIA
				state_region = s:STATE_MURCIA
				state_region = s:STATE_VALENCIA
			}
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_shipyard
				level >= 3
			}
			count >= 3
		}
	}

	prosperity_modifier = {
		country_military_tech_spread_mult = 0.1
		country_weekly_innovation_mult = 0.05
		ship_armor_mult = 0.025
	}

	ai_will_do = {
		any_scope_state = {
			OR = {
				state_region = s:STATE_GALICIA
				state_region = s:STATE_ASTURIAS
				state_region = s:STATE_LOWER_ANDALUSIA
				state_region = s:STATE_MURCIA
				state_region = s:STATE_VALENCIA
			}
			is_incorporated = yes
		}
	}

	ai_construction_targets = {
		building_shipyard = {
			level = 3
			state_trigger = {
				OR = {
					state_region = s:STATE_GALICIA
					state_region = s:STATE_ASTURIAS
					state_region = s:STATE_LOWER_ANDALUSIA
					state_region = s:STATE_MURCIA
					state_region = s:STATE_VALENCIA
				}
			}
		}
	}

	ai_weight = {
		value = 3 # Higher base value for flavored companies
	}
}

# Pedro Domecq
TRY_REPLACE:company_pedro_domecq = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/company_pedro_domecq.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_plantation.dds"

	category = aristocrat_owned

	flavored_company = yes

	building_types = {
		building_vineyard
		building_food_industry
	}

	extension_building_types = {
		building_rice_farm
		building_livestock_ranch
	}

	possible_prestige_goods = {
		prestige_good_sherry
	}

	potential = {
		has_interest_marker_in_region = sr:region_southern_europe
		has_dlc_feature = ip4_content
	}

	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_LOWER_ANDALUSIA
			}
		}
	}

	possible = {
		any_scope_state = {
			state_region = s:STATE_LOWER_ANDALUSIA
			any_scope_building = {
				is_building_type = building_vineyard
				level >= 5
			}
		}
	}

	prosperity_modifier = {
		country_prestige_mult = 0.05
		country_leverage_generation_mult = 0.1
	}

	ai_will_do = {
		any_scope_state = {
			state_region = s:STATE_LOWER_ANDALUSIA
		}
	}

	ai_construction_targets = {
		building_vineyard = {
			level = 5
			state_trigger = {
				state_region = s:STATE_LOWER_ANDALUSIA
			}
		}
	}

	ai_weight = {
		value = 3 # Higher base value for flavored companies
	}
}

# La Hispano-Suiza, Fábrica de Automóviles, S. A.
TRY_REPLACE:company_hispano_suiza = {
	icon = "gfx/interface/icons/company_icons/company_la_hispano_suiza.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_heavy.dds"

	flavored_company = yes

	building_types = {
		building_automotive_industry
		building_motor_industry
	}

	extension_building_types = {
		building_tooling_workshop
	}

	potential = {
		has_interest_marker_in_region = sr:region_southern_europe
		has_dlc_feature = ip4_content
	}

	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_CATALONIA
			}
		}
	}

	possible = {
		any_scope_state = {
			state_region = s:STATE_CATALONIA
			any_scope_building = {
				is_building_type = building_automotive_industry
				level >= 5
			}
		}
	}

	prosperity_modifier = {
		country_prestige_mult = 0.1
		interest_group_ig_landowners_approval_add = 2
		unit_supply_consumption_mult = -0.05
	}

	ai_will_do = {
		any_scope_state = {
			state_region = s:STATE_CATALONIA
		}
	}

	ai_construction_targets = {
		building_automotive_industry = {
			level = 5
			state_trigger = {
				state_region = s:STATE_CATALONIA
			}
		}
	}
	ai_weight = {
		value = 3 # Higher base value for flavored companies
	}
}


##############################MODDED##############################

# ECOM Agroindustrial
company_ECOMAgroindustrial = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/ecom.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_farm_wheat.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_CATALONIA }

	possible_prestige_goods = {
		#prestige_good_saint_etienne_rifles
	}

	
	building_types = { #25
		building_cotton_plantation
		building_trade_center
	}
	
	extension_building_types = {
		building_dye_plantation
		building_tooling_workshop
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_southern_europe
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_CATALONIA
			}
		}
	}
	
	possible = {
		any_scope_state = {
			state_region = s:STATE_CATALONIA
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_cotton_plantation
				level >= 3
			}
		}
		has_technology_researched = cotton_gin
	}
	
	prosperity_modifier = {
		building_coffee_plantation_throughput_add = 0.05 #4
		building_sugar_plantation_throughput_add = 0.05 #4
		country_ship_group_supply_ships_construction_efficiency_add = 0.15 #10
		state_trade_advantage_mult = 0.12 #8
	}


	ai_will_do = {
		has_technology_researched = cotton_gin
		any_scope_state = {
			state_region = s:STATE_CATALONIA
			is_incorporated = yes
		}
	}

	ai_construction_targets = {
		building_cotton_plantation = {
			level = 5
			state_trigger = {
				state_region = s:STATE_CATALONIA
			}
		}
	}
	ai_weight = {
		value = 3 # Higher base value for flavored companies
	}	
}

# Lacasa
company_Lacasa = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/lacasa.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_farm_wheat.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_NEW_CASTILE }
	

	possible_prestige_goods = {
		prestige_good_generic_groceries
	}

	
	building_types = { #27
		building_food_industry
	}
	
	extension_building_types = {
		building_tooling_workshop
		building_livestock_ranch
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_southern_europe
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_NEW_CASTILE
			}
		}
	}
	
	possible = {
		any_scope_state = {
			state_region = s:STATE_NEW_CASTILE
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_food_industry
				level >= 3
			}
		}
	}
	
	prosperity_modifier = {
		state_loyalists_from_political_movements_mult = 0.05 #6
		state_lower_strata_expected_sol_add = -0.15
		state_middle_strata_expected_sol_add = -0.3
		state_upper_strata_expected_sol_add = -0.45
		state_birth_rate_mult = 0.05 #20
	}


	ai_will_do = {
		any_scope_state = {
			state_region = s:STATE_NEW_CASTILE
			is_incorporated = yes
		}
	}

	ai_construction_targets = {
		building_food_industry = {
			level = 5
			state_trigger = {
				state_region = s:STATE_NEW_CASTILE
			}
		}
	}
	ai_weight = {
		value = 3 # Higher base value for flavored companies
	}	
}

company_BodegasTorres = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/bodegas.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_plantation.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_CATALONIA }

	possible_prestige_goods = {
		prestige_good_port_wine
	}

	
	building_types = { #26
		building_vineyard
	}
	
	extension_building_types = {
		building_food_industry
		building_livestock_ranch
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_southern_europe
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_CATALONIA
			}
		}
	}
	possible = {
		any_scope_state = {
			state_region = s:STATE_CATALONIA
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_vineyard
				level >= 3
			}
		}
	}
	
	prosperity_modifier = {
		interest_group_ig_landowners_approval_add = 4 #16
		country_prestige_mult = 0.1 #10
	}


	ai_will_do = {
		any_scope_state = {
			state_region = s:STATE_CATALONIA
			is_incorporated = yes
		}
	}

	ai_construction_targets = {
		building_vineyard = {
			level = 5
			state_trigger = {
				state_region = s:STATE_CATALONIA
			}
		}
	}
	ai_weight = {
		value = 3 # Higher base value for flavored companies
	}	
}

# Rio Tinto
company_RioTinto = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/riotinto.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_mining.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_VALENCIA }

	possible_prestige_goods = {
		prestige_good_generic_copper
	}

	
	building_types = { #14
		building_iron_mine
		building_lead_mine
	}
	
	extension_building_types = {
		building_gold_mine
		building_coal_mine
		building_sulfur_mine
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_southern_europe
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_VALENCIA
			}
		}
	}
	
	possible = {
		any_scope_state = {
			state_region = s:STATE_VALENCIA
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_iron_mine
				level >= 3
			}
		}
	}
	
	prosperity_modifier = {
		building_group_bg_mining_throughput_add = 0.05 #14
		state_pollution_reduction_health_mult = 0.03
	}


	ai_will_do = {
		any_scope_state = {
			state_region = s:STATE_VALENCIA
			is_incorporated = yes
		}
	}

	ai_construction_targets = {
		building_iron_mine = {
			level = 5
			state_trigger = {
				state_region = s:STATE_VALENCIA
			}
		}
	}
	ai_weight = {
		value = 3 # Higher base value for flavored companies
	}	
}

# Bassols 1790
company_Bassols = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/bassols.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_light.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_CATALONIA }

	possible_prestige_goods = {
		prestige_good_generic_clothes
	}

	prestige_goods_trigger = {
		custom_tooltip = {
			text = je_prestige_goods_clothes_complete_tt
			has_variable = prestige_good_generic_clothes_var
		}
	}
	
	building_types = { #26
		building_textile_mill
	}
	
	extension_building_types = {
		building_cotton_plantation
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_southern_europe
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_CATALONIA
			}
		}
	}
	
	possible = {
		any_scope_state = {
			state_region = s:STATE_CATALONIA
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_textile_mill
				level >= 3
			}
		}
		has_technology_researched = cotton_gin
	}
	
	prosperity_modifier = {
		interest_group_ig_industrialists_approval_add = 2 #10
		state_loyalists_from_political_movements_mult = 0.12 #16
		state_lower_strata_expected_sol_add = -0.4
		state_middle_strata_expected_sol_add = -0.8
		state_upper_strata_expected_sol_add = -1.2
	}	
	

	ai_will_do = {
		has_technology_researched = cotton_gin
		any_scope_state = {
			state_region = s:STATE_CATALONIA
			is_incorporated = yes
		}
	}

	ai_construction_targets = {
		building_textile_mill = {
			level = 5
			state_trigger = {
				state_region = s:STATE_CATALONIA
			}
		}
	}
	ai_weight = {
		value = 3 # Higher base value for flavored companies
	}
}

# Tendam / Grupo Cortefiel
company_Tendam = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/cortefiel.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_light.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_NEW_CASTILE }

	possible_prestige_goods = {
		prestige_good_generic_clothes
	}
	
	prestige_goods_trigger = {
		custom_tooltip = {
			text = je_prestige_goods_clothes_complete_tt
			has_variable = prestige_good_generic_clothes_var
		}
	}
	
	building_types = { #26
		building_textile_mill
	}
	
	extension_building_types = {
		building_silk_plantation
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_southern_europe
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_NEW_CASTILE
			}
		}
	}
	
	possible = {
		any_scope_state = {
			state_region = s:STATE_NEW_CASTILE
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_textile_mill
				level >= 3
			}
		}
		has_technology_researched = cotton_gin
	}
	
	prosperity_modifier = {
		state_trade_advantage_mult = 0.09 #6
		state_radicalism_increases_violent_hostility_mult = -0.3 #20
		state_radicalism_increases_cultural_erasure_mult = -0.2
		state_radicalism_increases_open_prejudice_mult = -0.1
	}	
	

	ai_will_do = {
		has_technology_researched = cotton_gin
		any_scope_state = {
			state_region = s:STATE_NEW_CASTILE
			is_incorporated = yes
		}
	}

	ai_construction_targets = {
		building_textile_mill = {
			level = 5
			state_trigger = {
				state_region = s:STATE_NEW_CASTILE
			}
		}
	}
	ai_weight = {
		value = 3 # Higher base value for flavored companies
	}
}

# Fomento de Construcciones y Contratas
company_FCC = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/fomento.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_heavy.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_CATALONIA }

	possible_prestige_goods = {
		prestige_good_generic_cement
	}
	
	building_types = { #24
		building_steel_mill
	}
	
	extension_building_types = {
		building_logging_camp
		building_explosives_factory
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_southern_europe
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_CATALONIA
			}
		}
	}
	
	possible = {
		any_scope_state = {
			state_region = s:STATE_CATALONIA
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_construction_sector
				level >= 3
			}
		}
		has_technology_researched = steel_frame_buildings
	}
	
	prosperity_modifier = {
		country_max_weekly_construction_progress_add = 10 #12
		building_construction_sector_throughput_add = 0.09 #12
	}	
	

	ai_will_do = {
		has_technology_researched = steel_frame_buildings
		any_scope_state = {
			state_region = s:STATE_CATALONIA
			is_incorporated = yes
		}
	}

	ai_construction_targets = {
		building_construction_sector = {
			level = 5
			state_trigger = {
				state_region = s:STATE_CATALONIA
			}
		}
	}
	ai_weight = {
		value = 3 # Higher base value for flavored companies
	}
}

# Irizar
company_Irizar = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/irizar.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_heavy.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_BASQUE_COUNTRY }

	possible_prestige_goods = {
		#prestige_good_saint_etienne_rifles
	}

	
	building_types = { #24
		building_automotive_industry
	}
	
	extension_building_types = {
		building_motor_industry
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_southern_europe
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_BASQUE_COUNTRY
			}
		}
	}
	
	possible = {
		any_scope_state = {
			state_region = s:STATE_BASQUE_COUNTRY
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_motor_industry
				level >= 3
			}
		}
	}
	
	prosperity_modifier = {
		country_prestige_mult = 0.1 #10
		state_infrastructure_from_population_max_add = 15 #10
		state_loyalists_from_political_movements_mult = 0.03 #4
		state_lower_strata_expected_sol_add = -0.1
		state_middle_strata_expected_sol_add = -0.2
		state_upper_strata_expected_sol_add = -0.3
	}	
	

	ai_will_do = {
		any_scope_state = {
			state_region = s:STATE_BASQUE_COUNTRY
			is_incorporated = yes
		}
	}

	ai_construction_targets = {
		building_motor_industry = {
			level = 5
			state_trigger = {
				state_region = s:STATE_BASQUE_COUNTRY
			}
		}
	}
	ai_weight = {
		value = 3 # Higher base value for flavored companies
	}
}

# Casa de Ganaderos de Zaragoza
company_CdGdZ = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/ganaderos.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_farm_wheat.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_ARAGON }
	

	possible_prestige_goods = {
		prestige_good_generic_meat
	}

	
	building_types = { #26
		building_wheat_farm
		building_livestock_ranch
	}
	
	extension_building_types = {
		building_food_industry
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_southern_europe
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_ARAGON
			}
		}
	}
	
	possible = {
		any_scope_state = {
			state_region = s:STATE_ARAGON
			is_incorporated = yes
			any_scope_building = {
			  is_building_type = building_livestock_ranch
			  level >= 3
			}
		}
	}
	
	prosperity_modifier = {
		interest_group_ig_rural_folk_pol_str_mult = 0.2 #+10
		interest_group_ig_rural_folk_approval_add = 4 #16
		building_group_bg_agriculture_throughput_add = 0.05 #18
	}	
	

	ai_will_do = {
		any_scope_state = {
			state_region = s:STATE_ARAGON
			is_incorporated = yes
		}
	}

	ai_construction_targets = {
		building_livestock_ranch = {
			level = 5
			state_trigger = {
				state_region = s:STATE_ARAGON
			}
		}
	}
	ai_weight = {
		value = 3 # Higher base value for flavored companies
	}
}

# Granda Company
company_Granda_Company = {
	icon = "gfx/interface/icons/company_icons/basic_home_goods.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_light.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_CATALONIA }
	

	possible_prestige_goods = {
		prestige_good_generic_religious_icons
	}

	
	building_types = { #24
		building_art_academy
	}
	
	extension_building_types = {
	    building_furniture_manufactory
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_southern_europe
		country_has_state_religion = rel:catholic
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_CATALONIA
			}		
		}
	}		
	
	possible = { 
		any_scope_state = {
			state_region = s:STATE_CATALONIA
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_art_academy
				level >= 3
			}
		}
	}
	
	prosperity_modifier = {
		state_conversion_mult = 0.15 #10
		interest_group_ig_devout_pop_attraction_mult = 0.08 #+4
		interest_group_ig_devout_approval_add = 2 #8
		building_art_academy_throughput_add = 0.1 #10
	}


	ai_will_do = {
		any_scope_state = {
			state_region = s:STATE_CATALONIA
			is_incorporated = yes
		}
	}

	ai_construction_targets = {
		building_art_academy = {
			level = 5
			state_trigger = {
				state_region = s:STATE_CATALONIA
			}
		}
	}
	ai_weight = {
		value = 3 # Higher base value for flavored companies
	}	
}

#Banco Nacional de San Carlos, later "Banco de España"
company_Bank_of_Spain = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/bankspain.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_light.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_NEW_CASTILE }
	
	possible_prestige_goods = {
		#prestige_good_generic_currency_paper
	}
	
	building_types = {
		building_paper_mill
		building_arms_industry
		building_textile_mill
	}
	
	extension_building_types = {	
		building_coal_mine
		building_steel_mill
		building_fishing_wharf
		building_vineyard
	}
	
	potential = {
		has_game_rule = banks_enabled
		has_interest_marker_in_region = sr:region_southern_europe
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_NEW_CASTILE
			}
		}
	}	
	
	possible = {
		any_scope_state = {
			state_region = s:STATE_NEW_CASTILE
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_financial_district
				level >= 10
			}
		}
		unique_companies_has_bank = no
	}
	
	prosperity_modifier = {
		country_diplomatic_play_maneuvers_add = 10 #aided the thirteen colonies in their independence war, PLUS we didnt use this before
		
		country_minting_mult = 0.025
		country_loan_interest_rate_mult = -0.025
        country_private_construction_allocation_mult = 0.1		
		
		state_farmers_investment_pool_contribution_add = 0.015
		state_shopkeepers_investment_pool_contribution_add = 0.015
		state_clergymen_investment_pool_contribution_add = 0.04
		state_aristocrats_investment_pool_contribution_add = 0.045 #<--
		state_capitalists_investment_pool_contribution_add = 0.07 #<--
		
		building_nationalization_investment_return_add = 0.05
		country_government_dividends_reinvestment_add = 0.05
		country_government_dividends_efficiency_add = 0.05
		
		country_max_companies_add = 1
	}
	
	ai_will_do = {
		unique_companies_has_bank = no
		any_scope_state = {
			state_region = s:STATE_NEW_CASTILE
			is_incorporated = yes
		}
	}

	ai_construction_targets = {
		building_paper_mill = {
			level = 5
			state_trigger = {
				state_region = s:STATE_NEW_CASTILE
			}
		}
	}
	ai_weight = {
		value = 5 # Higher base value for flavored companies
	}
}

# Elizalde
company_Elizalde = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/elizalde.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_heavy.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_CATALONIA }

	possible_prestige_goods = {
		#prestige_good_saint_etienne_rifles
	}

	
	building_types = { #28
		building_automotive_industry
	}
	
	extension_building_types = {
		building_motor_industry
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_southern_europe
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_CATALONIA
			}		
		}
	}		
	
	possible = { 
		any_scope_state = {
			state_region = s:STATE_CATALONIA
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_motor_industry
				level >= 3
			}
		}
		has_technology_researched = combustion_engine
	}
	
	prosperity_modifier = {
		goods_output_automobiles_mult = 0.13 #10
		building_automotive_industry_throughput_add = 0.14 #18
	}


	ai_will_do = {
		has_technology_researched = combustion_engine
		any_scope_state = {
			state_region = s:STATE_CATALONIA
			is_incorporated = yes
		}
	}

	ai_construction_targets = {
		building_motor_industry = {
			level = 5
			state_trigger = {
				state_region = s:STATE_CATALONIA
			}
		}
	}
	ai_weight = {
		value = 3 # Higher base value for flavored companies
	}	
}

# Sociedad Anonima de los Motores Ricart y Pérez
company_RicartPerez = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/ricartperez.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_heavy.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_CATALONIA }

	possible_prestige_goods = {
		#prestige_good_saint_etienne_rifles
	}

	
	building_types = { #28
		building_automotive_industry
	}
	
	extension_building_types = {
		building_motor_industry
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_southern_europe
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_CATALONIA
			}		
		}
	}		
	
	possible = { 
		any_scope_state = {
			state_region = s:STATE_CATALONIA
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_automotive_industry
				level >= 3
			}
		}
		has_technology_researched = combustion_engine
	}
	
	prosperity_modifier = {
		goods_output_automobiles_mult = 0.15 #12
		state_pop_qualifications_mult = 0.08 #10
		country_prestige_mult = 0.06 #6
	}


	ai_will_do = {
		has_technology_researched = combustion_engine
		any_scope_state = {
			state_region = s:STATE_CATALONIA
			is_incorporated = yes
		}
	}

	ai_construction_targets = {
		building_automotive_industry = {
			level = 5
			state_trigger = {
				state_region = s:STATE_CATALONIA
			}
		}
	}
	ai_weight = {
		value = 3 # Higher base value for flavored companies
	}	
}

# Loewe
company_loewe_fashion = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/loewesa.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_light.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_NEW_CASTILE }

	possible_prestige_goods = {
		#prestige_good_saint_etienne_rifles
	}
	
	prestige_goods_trigger = {
		custom_tooltip = {
			text = je_prestige_goods_clothes_complete_tt
			has_variable = prestige_good_generic_clothes_var
		}
	}
	
	building_types = { #26
		building_textile_mill
		building_livestock_ranch
	}
	
	extension_building_types = {
		building_furniture_manufactory
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_southern_europe
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_NEW_CASTILE
			}		
		}
	}		
	
	possible = { 
		any_scope_state = {
			state_region = s:STATE_NEW_CASTILE
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_textile_mill
				level >= 3
			}
		}
		has_technology_researched = improved_fertilizer
	}
	
	prosperity_modifier = {
		interest_group_ig_landowners_approval_add = 2 #8
		country_prestige_mult = 0.1 #10
		state_assimilation_mult = 0.16 #8
	}


	ai_will_do = {
		has_technology_researched = improved_fertilizer
		any_scope_state = {
			state_region = s:STATE_NEW_CASTILE
			is_incorporated = yes
		}
	}

	ai_construction_targets = {
		building_textile_mill = {
			level = 5
			state_trigger = {
				state_region = s:STATE_NEW_CASTILE
			}
		}
	}
	ai_weight = {
		value = 3 # Higher base value for flavored companies
	}	
}