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

# Kablin Irmãos & Cia.
TRY_REPLACE:company_kablin = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/brazil_kablin_irmaos_and_cia.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_plantation.dds"

	flavored_company = yes

	building_types = {
		building_paper_mill
		building_logging_camp
	}

	extension_building_types = {
		building_sulfur_mine
	}

	possible_prestige_goods = {
		prestige_good_rosewood
	}

	potential = {
		has_interest_marker_in_region = sr:region_brazil
	}

	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				region = sr:region_brazil
			}
		}
	}

	possible = {
		has_technology_researched = mechanical_tools
		any_scope_state = {
			region = sr:region_brazil
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_paper_mill
				level >= 5
			}
		}
	}

	prosperity_modifier = {
		building_tooling_workshop_throughput_add = 0.1
		state_infrastructure_from_population_max_add = 15
	}

	ai_will_do = {
		has_technology_researched = mechanical_tools
		any_scope_state = {
			region = sr:region_brazil
			is_incorporated = yes
		}
	}

	ai_construction_targets = {
		building_paper_mill = {
			level = 5
			state_trigger = {
				region = sr:region_brazil
				is_incorporated = yes
			}
		}
	}

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

##############################DLC-COTS##############################

# São Paulo Railway Co. Ltd.
TRY_REPLACE:company_sao_paulo_railway = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/brazil_sao_paulo_railway.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_railways.dds"

	flavored_company = yes

	preferred_headquarters = { STATE_SAO_PAULO }

	building_types = {
		building_railway
	}

	extension_building_types = {
		building_logging_camp
		building_motor_industry
	}

	potential = {
		has_dlc_feature = rp1_content
		has_interest_marker_in_region = sr:region_brazil
	}

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

	possible = {
		has_technology_researched = railways
		any_scope_state = {
			state_region = s:STATE_SAO_PAULO
			is_incorporated = yes
			has_building = building_railway
			any_scope_building = {
				is_building_type = building_coffee_plantation
				level >= 5
			}
		}
		any_scope_state = {
			region = sr:region_brazil
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_railway
				level >= 5
			}
			count >= 2
		}
	}

	prosperity_modifier = {
		building_coffee_plantation_throughput_add = 0.15
		state_trade_capacity_mult = 0.1
	}

	ai_will_do = {
		has_technology_researched = railways
		any_scope_state = {
			state_region = s:STATE_SAO_PAULO
			is_incorporated = yes
		}
	}

	ai_construction_targets = {
		building_coffee_plantation = {
			level = 5
			state_trigger = {
				state_region = s:STATE_SAO_PAULO
			}
		}
		building_railway = {
			level = 5
			state_trigger = {
				region = sr:region_brazil
				is_incorporated = yes
			}
		}
	}

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

# Estaleiro Mauá
TRY_REPLACE:company_estaleiro_maua = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/brazil_estaleiro_maua.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_harbor_shipbuilding.dds"

	flavored_company = yes

	preferred_headquarters = { STATE_RIO_DE_JANEIRO }

	building_types = {
		building_shipyard
		building_artillery_foundry
	}

	extension_building_types = {
		building_logging_camp
	}

	potential = {
		has_dlc_feature = rp1_content
		has_interest_marker_in_region = sr:region_brazil
	}

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

	possible = {
		any_scope_state = {
			state_region = s:STATE_RIO_DE_JANEIRO
			is_incorporated = yes
			any_scope_building = {
				OR = {
					is_building_type = building_shipyard
					is_building_type = building_artillery_foundry
				}
				level >= 5
			}
		}
	}

	prosperity_modifier = {
		country_ship_group_supply_ships_construction_efficiency_add = 0.1
		building_steel_mill_throughput_add = 0.1
	}

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

	ai_construction_targets = {
		building_shipyard = {
			level = 5
			state_trigger = {
				state_region = s:STATE_RIO_DE_JANEIRO
			}
		}
		building_artillery_foundry = {
			level = 5
			state_trigger = {
				state_region = s:STATE_RIO_DE_JANEIRO
			}
		}
	}

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

# Companhia Fiação e Tecidos de Pernambuco
TRY_REPLACE:company_pernambuco_textiles = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/brazil_companhia_fiacai_e_tecidos_de_pernambuco.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_light.dds"

	flavored_company = yes

	preferred_headquarters = { STATE_PERNAMBUCO }

	building_types = {
		building_textile_mill
	}

	extension_building_types = {
		building_cotton_plantation
		building_livestock_ranch
	}

	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_dlc_feature = rp1_content
		has_interest_marker_in_region = sr:region_brazil
	}

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

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

	prosperity_modifier = {
		building_cotton_plantation_throughput_add = 0.1
		building_rubber_plantation_throughput_add = 0.05
	}

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

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

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

# Real Fábrica de Ferro São João de Ipanema
TRY_REPLACE:company_fundicao_ipanema = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/brazil_fundicao_ipanema.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_mining.dds"

	flavored_company = yes

	preferred_headquarters = { STATE_SAO_PAULO }

	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_dlc_feature = rp1_content
		has_interest_marker_in_region = sr:region_brazil
	}

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

	possible = {
		any_scope_state = {
			state_region = s:STATE_SAO_PAULO
			is_incorporated = yes
			any_scope_building = {
				OR = {
					is_building_type = building_steel_mill
					is_building_type = building_iron_mine

				}
				level >= 5
			}
		}
	}

	prosperity_modifier = {
		building_munition_plant_throughput_add = 0.05
		building_arms_industry_throughput_add = 0.1
	}

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

	ai_construction_targets = {
		building_steel_mill = {
			level = 5
			state_trigger = {
				state_region = s:STATE_SAO_PAULO
			}
		}
		building_iron_mine = {
			level = 5
			state_trigger = {
				state_region = s:STATE_SAO_PAULO
			}
		}
	}

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

# Amadeo Rossi SA
TRY_REPLACE:company_rossi = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/brazil_amadeo_rossi.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_heavy.dds"

	flavored_company = yes

	preferred_headquarters = { STATE_RIO_GRANDE_DO_SUL }

	building_types = {
		building_arms_industry
		building_munition_plant
	}

	extension_building_types = {
		building_explosives_factory
	}

	possible_prestige_goods = {
		prestige_good_generic_small_arms
	}

	prestige_goods_trigger = {
		custom_tooltip = {
			text = je_prestige_goods_small_arms_complete_tt
			has_variable = prestige_good_generic_small_arms_var
		}
	}

	potential = {
		has_dlc_feature = rp1_content
		has_interest_marker_in_region = sr:region_brazil
	}

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

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

	prosperity_modifier = {
		building_livestock_ranch_throughput_add = 0.1
		building_chemical_plant_throughput_add = 0.05
	}

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

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

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

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

# Elekeiroz
company_Elekeiroz = {
	icon = "gfx/interface/icons/company_icons/basic_chemicals.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_heavy.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_SAO_PAULO }
	
	possible_prestige_goods = {
		prestige_good_generic_fertilizer
	}
	
	building_types = {  #27
		building_chemical_plant
	}
	
	extension_building_types = {
		building_oil_rig
	}

	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_SAO_PAULO
			}
		}
	}		
	
	potential = {
		has_interest_marker_in_region = sr:region_brazil
	}
	
	possible = {
		any_scope_state = {
			region = sr:region_brazil
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_chemical_plant
				level >= 3
			}
		}
	}
	
	prosperity_modifier = {
		building_construction_sector_throughput_add = 0.12 #16
	    building_maize_farm_throughput_add = 0.14 #11
	}


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

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

# Light S.A.
company_Light = {
	icon = "gfx/interface/icons/company_icons/basic_metalworks.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_heavy.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_RIO_DE_JANEIRO }
	
	possible_prestige_goods = {
		prestige_good_hydroelectricity
	}

	building_types = {  #23
		building_power_plant
	}
	
	extension_building_types = {
		building_railway
		building_electrics_industry
	}

	potential = {
		has_interest_marker_in_region = sr:region_brazil
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_RIO_DE_JANEIRO
			}
		}
	}		
	
	possible = {
		any_scope_state = {
			region = sr:region_brazil
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_power_plant
				level >= 3
			}
		}
	}
	
	prosperity_modifier = {
		state_infrastructure_from_population_add = 5 #10
		state_infrastructure_from_population_max_add = 21 #14
	}


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

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

# Gerdau
company_Gerdau = {
	icon = "gfx/interface/icons/company_icons/basic_steel.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_heavy.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_RIO_GRANDE_DO_SUL }
	
	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
		}
	}

	building_types = {  #20
		building_steel_mill
		building_trade_center
	}
	
	extension_building_types = {
		building_food_industry
		building_furniture_manufactory
	}

	potential = {
		has_interest_marker_in_region = sr:region_brazil
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_RIO_GRANDE_DO_SUL
			}
		}
	}		
	possible = {
		any_scope_state = {
			state_region = s:STATE_RIO_GRANDE_DO_SUL
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_steel_mill
				level >= 3
			}
		}
		has_technology_researched = open_hearth_process
	}
	
	prosperity_modifier = {
		state_assimilation_mult = 0.2 #10
		building_steel_mill_throughput_add = 0.07 #10
	}


	ai_will_do = {
		has_technology_researched = open_hearth_process
		any_scope_state = {
			state_region = s:STATE_RIO_GRANDE_DO_SUL
			is_incorporated = yes
		}
	}

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

# Arsenal de Guerra do Rio de Janeiro
company_ArsenalRio = {
	icon = "gfx/interface/icons/company_icons/basic_steel.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_heavy.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_RIO_DE_JANEIRO }
	
	category = bureaucrat_owned
	
	possible_prestige_goods = {
		prestige_good_generic_small_arms
	}
	
	prestige_goods_trigger = {
		custom_tooltip = {
			text = je_prestige_goods_small_arms_complete_tt
			has_variable = prestige_good_generic_small_arms_var
		}
	}
	
	building_types = {  #22
		building_arms_industry
		building_munition_plant
		building_artillery_foundry
	}
	
	extension_building_types = {
		building_automotive_industry
	}

	potential = {
		has_interest_marker_in_region = sr:region_brazil
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_RIO_DE_JANEIRO
			}
		}
	}		

	possible = {
		any_scope_state = {
			state_region = s:STATE_RIO_DE_JANEIRO
			is_incorporated = yes
			any_scope_building = {
				OR = {
					is_building_type = building_arms_industry
					is_building_type = building_munition_plant
					is_building_type = building_artillery_foundry
				}
				level >= 3
			}
		}
	}
	
	prosperity_modifier = {
		building_art_academy_throughput_add = 0.2 #20
		unit_army_defense_mult = 0.01 #2
	}
	

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

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

# Neugebauer Alimentos S.A
company_Neugebauer = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/neugebauer.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_plantation.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_RIO_GRANDE_DO_SUL }
	
	category = shopkeeper_owned
	
	possible_prestige_goods = {
		prestige_good_generic_sweets 
	}

	building_types = {  #28
		building_sugar_plantation
		building_food_industry
	}
	
	extension_building_types = {
		building_maize_farm
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_brazil
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_RIO_GRANDE_DO_SUL
			}
		}
	}		

	possible = {
		any_scope_state = {
			state_region = s:STATE_RIO_GRANDE_DO_SUL
			is_incorporated = yes
			any_scope_building = {
				OR = {
					is_building_type = building_sugar_plantation
					is_building_type = building_food_industry
				}
				level >= 3
			}
		}
		has_technology_researched = conveyors
	}
	
	prosperity_modifier = {
		state_loyalists_from_political_movements_mult = 0.14 #18
		state_lower_strata_expected_sol_add = -0.45
		state_middle_strata_expected_sol_add = -0.9
		state_upper_strata_expected_sol_add = -1.35
		state_assimilation_mult = 0.20 #10
	}
	

	ai_will_do = {
		has_technology_researched = conveyors
		any_scope_state = {
			state_region = s:STATE_RIO_GRANDE_DO_SUL
			is_incorporated = yes
		}
	}

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

# Tramontina
company_Tramontina = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/tramontina.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_light.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_RIO_GRANDE_DO_SUL }
	
	possible_prestige_goods = {
		prestige_good_generic_tools
	}
	
	building_types = {  #30
		building_furniture_manufactory
		building_tooling_workshop
	}
	
	extension_building_types = {
		building_electrics_industry
		building_steel_mill
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_brazil
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_RIO_GRANDE_DO_SUL
			}
		}
	}		

	possible = {
		any_scope_state = {
			state_region = s:STATE_RIO_GRANDE_DO_SUL
			is_incorporated = yes
			any_scope_building = {
				OR = {
					is_building_type = building_furniture_manufactory
					is_building_type = building_tooling_workshop
				}
				level >= 3
			}
		}
		has_technology_researched = plastics
	}
	
	prosperity_modifier = {
		state_loyalists_from_political_movements_mult = 0.08 #10
		state_lower_strata_expected_sol_add = -0.25
		state_middle_strata_expected_sol_add = -0.5
		state_upper_strata_expected_sol_add = -0.75
		building_urban_center_throughput_add = 0.06 #8
		building_food_industry_throughput_add = 0.12 #12
		
	}
	

	ai_will_do = {
		has_technology_researched = plastics
		any_scope_state = {
			state_region = s:STATE_RIO_GRANDE_DO_SUL
			is_incorporated = yes
		}
	}

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

company_Bank_of_Brazil = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/bankofbrazil.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_light.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_RIO_DE_JANEIRO }
	
	category = bureaucrat_owned
	
	possible_prestige_goods = {
		#prestige_good_generic_currency_paper
	}
	
	building_types = {
		building_paper_mill
		building_logging_camp
		building_livestock_ranch
	}
	
	extension_building_types = {		
		building_coffee_plantation
		building_rubber_plantation		
		building_chemical_plant
		building_tooling_workshop
	}
	
	potential = {
		has_game_rule = banks_enabled
		has_interest_marker_in_region = sr:region_brazil
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_RIO_DE_JANEIRO
			}
		}
	}	
	
	possible = {
		any_scope_state = {
			state_region = s:STATE_RIO_DE_JANEIRO
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_financial_district
				level >= 10
			}
		}
		unique_companies_has_bank = no
	}
	
	prosperity_modifier = {
		building_cash_reserves_mult = 0.05
	
		country_minting_mult = 0.025
		country_loan_interest_rate_mult = -0.05 
        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.04
		state_capitalists_investment_pool_contribution_add = 0.065
		
		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_RIO_DE_JANEIRO
			is_incorporated = yes
		}
	}

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

# Cerveja Antarctica Paulista
company_AntarticaPaulista = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/antarcticapaulista.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_plantation.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_SAO_PAULO }
	
	category = shopkeeper_owned
	
	possible_prestige_goods = {
		prestige_good_generic_beer
	}

	building_types = {  #27
		building_food_industry
	}
	
	extension_building_types = {
		building_maize_farm
		building_logging_camp
		building_livestock_ranch
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_brazil
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_SAO_PAULO
			}
		}
	}		

	possible = {
		any_scope_state = {
			state_region = s:STATE_SAO_PAULO
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_food_industry
				level >= 3
			}
		}
		has_technology_researched = fractional_distillation
	}
	
	prosperity_modifier = {
		state_radicals_from_political_movements_mult = -0.15 #20
		state_lower_strata_expected_sol_add = -0.5
		state_middle_strata_expected_sol_add = -1
		state_upper_strata_expected_sol_add = -1.5
		state_assimilation_mult = 0.16 #8
	}
	

	ai_will_do = {
		has_technology_researched = fractional_distillation
		any_scope_state = {
			state_region = s:STATE_SAO_PAULO
			is_incorporated = yes
		}
	}

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

# Société Anonyme des Chocolats Suisses / Lakta
company_Lakta = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/lakta.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_plantation.dds"
	
	category = shopkeeper_owned
	
	flavored_company = yes
	preferred_headquarters = { STATE_SAO_PAULO }
	
	possible_prestige_goods = {
		prestige_good_generic_sweets
	}

	building_types = {  #26
		building_food_industry
		building_sugar_plantation
	}
	
	extension_building_types = {
		building_coffee_plantation
	}

	potential = {
		has_interest_marker_in_region = sr:region_brazil
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_SAO_PAULO
			}
		}
	}		

	possible = {
		any_scope_state = {
			state_region = s:STATE_SAO_PAULO
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_food_industry
				level >= 3
			}
		}
		has_technology_researched = electrical_generation
	}
	
	prosperity_modifier = {
		state_loyalists_from_political_movements_mult = 0.15 #20
		state_lower_strata_expected_sol_add = -0.5
		state_middle_strata_expected_sol_add = -1
		state_upper_strata_expected_sol_add = -1.5
		building_sugar_plantation_throughput_add = 0.08 #6
	}
	

	ai_will_do = {
		has_technology_researched = electrical_generation
		any_scope_state = {
			state_region = s:STATE_SAO_PAULO
			is_incorporated = yes
		}
	}

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

# Fábrica Nacional de Motores
company_FNdM = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/fndm.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_heavy.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_RIO_DE_JANEIRO }
	
	category = bureaucrat_owned
	
	possible_prestige_goods = {
		#prestige_good_saint_etienne_rifles
	}

	building_types = {  #26
		building_motor_industry
		building_automotive_industry
	}
	
	extension_building_types = {
		building_steel_mill
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_brazil
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_RIO_DE_JANEIRO
			}
		}
	}	
	
	possible = {
		has_law_or_variant = law_type:law_presidential_republic
	    OR = {
			has_law_or_variant = law_type:law_autocracy
			has_law_or_variant = law_type:law_single_party_state
			has_law_or_variant = law_type:law_technocracy
			has_law_or_variant = law_type:law_oligarchy
		}
		any_scope_state = {
			state_region = s:STATE_RIO_DE_JANEIRO
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_motor_industry
				level >= 3
			}
		}
		has_technology_researched = combustion_engine
		has_technology_researched = political_agitation
	}
	
	prosperity_modifier = {
		country_loyalists_from_legitimacy_mult = 0.1 #10
        goods_output_automobiles_mult = 0.13 #10
		state_infrastructure_from_population_mult = 0.04 #6
	}


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

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

# Máquinas Agrícolas Romi Ltda.
company_Romi = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/romi.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_heavy.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_SAO_PAULO }
	
	possible_prestige_goods = {
		#prestige_good_generic_tractors
		prestige_good_generic_compound_engines
		prestige_good_oerlikon_engines
	}

	building_types = {  #24
		building_automotive_industry
		building_tooling_workshop
	}
	
	extension_building_types = {
		building_steel_mill
		building_electrics_industry
		building_motor_industry
	}

	potential = {
		has_interest_marker_in_region = sr:region_brazil
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_SAO_PAULO
			}
		}
	}		

	possible = {
		any_scope_state = {
			state_region = s:STATE_SAO_PAULO
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_automotive_industry
				level >= 3
			}
		}
		has_technology_researched = paved_roads
		has_technology_researched = concrete_dockyards
	}
	
	prosperity_modifier = {
		building_group_bg_agriculture_throughput_add = 0.05 #18
		country_ship_group_supply_ships_construction_efficiency_add = 0.09 #6
	}
	

	ai_will_do = {
		has_technology_researched = paved_roads
		has_technology_researched = concrete_dockyards
		any_scope_state = {
			state_region = s:STATE_SAO_PAULO
			is_incorporated = yes
		}
	}

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

# VEMAG
company_VEMAG = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/vemag.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_heavy.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_SAO_PAULO }
	
	possible_prestige_goods = {
		#prestige_good_saint_etienne_rifles
	}

	building_types = {  #30
		building_automotive_industry
	}
	
	extension_building_types = {
		building_motor_industry
		building_tooling_workshop
	}

	potential = {
		has_interest_marker_in_region = sr:region_brazil
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_SAO_PAULO
			}
		}
	}		

	possible = {
		any_scope_state = {
			state_region = s:STATE_SAO_PAULO
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_automotive_industry
				level >= 3
			}
		}
		has_technology_researched = paved_roads
	}
	
	prosperity_modifier = {
		state_assimilation_mult = 0.2 #10
		state_trade_advantage_mult = 0.15 #10
		goods_output_automobiles_mult = 0.13 #10
	}
	

	ai_will_do = {
		has_technology_researched = paved_roads
		any_scope_state = {
			state_region = s:STATE_SAO_PAULO
			is_incorporated = yes
		}
	}

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

# Casa Del Vecchio Ltda.
company_Vecchio = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/delvecchio.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_light.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_SAO_PAULO }
	
	category = shopkeeper_owned
	
	possible_prestige_goods = {
		prestige_good_generic_musical_instruments
	}
	
	building_types = {  #28
		building_furniture_manufactory
	}
	
	extension_building_types = {
		building_electrics_industry
		building_tooling_workshop
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_brazil
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_SAO_PAULO
			}
		}
	}		

	possible = {
		any_scope_state = {
			state_region = s:STATE_SAO_PAULO
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_furniture_manufactory
				level >= 3
			}
		}
		has_technology_researched = vulcanization
	}
	
	prosperity_modifier = {
		building_art_academy_throughput_add = 0.15 #14
		country_society_tech_spread_mult = 0.14 #14
	}
	

	ai_will_do = {
		has_technology_researched = vulcanization
		any_scope_state = {
			state_region = s:STATE_SAO_PAULO
			is_incorporated = yes
		}
	}

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

# Companhia Agrícola Fazenda Dumont
company_CAFD = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/cafd.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_light.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_SAO_PAULO }
	
	possible_prestige_goods = {
		prestige_good_generic_coffee
	}
	
	building_types = {  #21
		building_railway
		building_coffee_plantation
	}
	
	extension_building_types = {
		building_maize_farm
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_brazil
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_SAO_PAULO
			}
		}
	}		

	possible = {
		any_scope_state = {
			state_region = s:STATE_SAO_PAULO
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_coffee_plantation
				level >= 3
			}
		}
		has_technology_researched = pumpjacks
	}
	
	prosperity_modifier = {
		country_society_tech_spread_mult = 0.12 #12
		country_weekly_innovation_max_add = 5 #10
	}
	

	ai_will_do = {
		has_technology_researched = pumpjacks
		any_scope_state = {
			state_region = s:STATE_SAO_PAULO
			is_incorporated = yes
		}
	}

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

# Fábrica Brasileira de Alpargatas e Calçados / Alpargatas S.A.
company_Alpargatas = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/alpargatasbrazil.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_light.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_SAO_PAULO }
	
	possible_prestige_goods = {
		prestige_good_generic_clothes
	}
	
	building_types = {  #26
		building_textile_mill
		building_paper_mill
	}
	
	extension_building_types = {
		building_logging_camp
	}
	
	potential = {
	    OR = {
			has_interest_marker_in_region = sr:region_brazil
			has_interest_marker_in_region = sr:region_la_plata
		}
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
			    OR = {
					state_region = s:STATE_SAO_PAULO
					state_region = s:STATE_BUENOS_AIRES
					state_region = s:STATE_URUGUAY
				}
			}
		}
	}		

	possible = {
		any_scope_state = {
			OR = {
				state_region = s:STATE_SAO_PAULO
				state_region = s:STATE_BUENOS_AIRES
				state_region = s:STATE_URUGUAY
			}
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_textile_mill
				level >= 3
			}
		}
		has_technology_researched = electrical_capacitors
	}
	
	prosperity_modifier = {
		building_coffee_plantation_throughput_add = 0.20 #16
		state_assimilation_mult = 0.2 #10
	}
	

	ai_will_do = {
		has_technology_researched = electrical_capacitors
		any_scope_state = {
			OR = {
				state_region = s:STATE_SAO_PAULO
				state_region = s:STATE_BUENOS_AIRES
				state_region = s:STATE_URUGUAY
			}
			is_incorporated = yes
		}
	}

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

# Companhia Matte Larangeira
company_Matte_Tea = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/matte_tea.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_farm_rice.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_MATO_GROSSO }
	
	possible_prestige_goods = {
		prestige_good_generic_tea
	}
	
	building_types = {  #26
		building_tea_plantation
	}
	
	extension_building_types = {
		building_port
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_brazil
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
			    OR = {
					state_region = s:STATE_MATO_GROSSO
					state_region = s:STATE_ALTO_PARAGUAY
				}
			}
		}
	}		

	possible = {
		any_scope_state = {
			OR = {
				state_region = s:STATE_MATO_GROSSO
				state_region = s:STATE_ALTO_PARAGUAY
			}
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_urban_center
				level >= 3
			}
		}
	}
	
	prosperity_modifier = {
		state_trade_capacity_mult = 0.08 #16
		state_infrastructure_mult = 0.05 #10
	}
	

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

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

# Ypióca
company_Ypioca = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/ypioca.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_light.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_CEARA }
	
	possible_prestige_goods = {
		#prestige_good_generic_new_world_liquor
		prestige_good_bacardi_rum
	}
	
	building_types = {  #27
		building_food_industry
	}
	
	extension_building_types = {
		building_sugar_plantation
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_brazil
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_CEARA
			}
		}
	}		

	possible = {
		any_scope_state = {
			state_region = s:STATE_CEARA
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_food_industry
				level >= 3
			}
		}
	}
	
	prosperity_modifier = {
		state_radicals_from_political_movements_mult = -0.14 #18
		state_lower_strata_expected_sol_add = -0.45
		state_middle_strata_expected_sol_add = -0.9
		state_upper_strata_expected_sol_add = -1.35
		state_assimilation_mult = 0.2 #10
		
	}
	

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

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


