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

# Fundidora de Fierro y Acero de Monterrey, S.A.
TRY_REPLACE:company_fundidora_monterrey = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/fundidora_monterrey.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_heavy.dds"

	flavored_company = yes

	preferred_headquarters = { STATE_RIO_GRANDE }

	building_types = {
		building_steel_mill
		building_coal_mine
	}

	extension_building_types = {
		building_iron_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_central_america
	}

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

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

	prosperity_modifier = {
		building_railway_throughput_add = 0.05
		building_iron_mine_throughput_add = 0.1
	}

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

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

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

# Compañía Mexicana de Petróleo El Águila SA
TRY_REPLACE:company_el_aguila = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/el_aguila.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_oil_drills.dds"

	flavored_company = yes

	building_types = {
		building_oil_rig
	}

	extension_building_types = {
		building_power_plant
	}

	potential = {
		has_interest_marker_in_region = sr:region_central_america
	}

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

	possible = {
		has_technology_researched = pumpjacks
		any_scope_state = {
			region = sr:region_central_america
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_oil_rig
				level >= 5
			}
			is_coastal = yes
		}
	}

	prosperity_modifier = {
		country_ship_group_supply_ships_construction_efficiency_add = 0.15
		interest_group_ig_industrialists_approval_add = 3
	}

	ai_will_do = {
		has_technology_researched = pumpjacks
		any_scope_state = {
			region = sr:region_central_america
			is_incorporated = yes
			is_coastal = yes
			has_potential_resource = building_oil_rig
		}
	}

	ai_construction_targets = {
		building_oil_rig = {
			level = 5
			state_trigger = {
				region = sr:region_central_america
				is_incorporated = yes
				is_coastal = yes
			}
		}
	}

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

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

company_MexicanRailway = { #25
	icon = "gfx/interface/icons/company_icons/historical_company_icons/mexicanrailway.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_railways.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_MEXICO }
	
	possible_prestige_goods = {
		#prestige_good_saint_etienne_rifles
	}

	
	building_types = {  
		building_railway
	}
	
	extension_building_types = {
		building_motor_industry
	}

	potential = {
		has_interest_marker_in_region = sr:region_central_america
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				region = sr:region_central_america
			}
		}
	}
	
	possible = {
		any_scope_state = {
			region = sr:region_central_america
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_railway
				level >= 3
			}
		}
		has_technology_researched = steel_railway_cars
	}
	
	prosperity_modifier = {
		state_infrastructure_mult = 0.1 #20
		state_trade_advantage_mult = 0.07 #5
	}


	ai_will_do = {
		has_technology_researched = steel_railway_cars
		any_scope_state = {
			state_region = s:STATE_MEXICO
			is_incorporated = yes
		}
	}

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

company_TequilaHerrandura = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/tequilah.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_farm_corn.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_MEXICO }
	
	possible_prestige_goods = {
		#prestige_good_generic_new_world_liquor
		prestige_good_bacardi_rum
	}

	building_types = { #25
		building_food_industry
		building_banana_plantation
	}
	
	extension_building_types = {
		building_maize_farm
	}

	potential = {
		has_interest_marker_in_region = sr:region_central_america
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				region = sr:region_central_america
			}
		}
	}
	
	possible = {
		any_scope_state = {
			region = sr:region_central_america
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_food_industry
				level >= 3
			}
		}
	}
	
	prosperity_modifier = {
		state_birth_rate_mult = 0.05 #20
		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_MEXICO
			is_incorporated = yes
		}
	}

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

company_Penoles = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/penoles.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_mining.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_RIO_GRANDE }
	
	possible_prestige_goods = {
		#prestige_good_saint_etienne_rifles
	}

	building_types = { #18
		building_gold_mine
		building_lead_mine
	}
	
	extension_building_types = {
		building_sulfur_mine
		building_chemical_plant
	}

	potential = {
		has_interest_marker_in_region = sr:region_central_america
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				region = sr:region_central_america
			}
		}
	}
	
	possible = {
		any_scope_state = {
			region = sr:region_central_america
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_lead_mine
				level >= 3
			}
		}
		has_technology_researched = steam_donkey
	}
	
	prosperity_modifier = {
		country_minting_mult = 0.05 #14
		state_migration_pull_mult = 0.03 #4
	}


	ai_will_do = {
		has_technology_researched = steam_donkey
		any_scope_state = {
			state_region = s:STATE_RIO_GRANDE
			is_incorporated = yes
		}
	}

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

# Banco Nacional de México
company_Bank_of_Mexico = {
  icon = "gfx/interface/icons/company_icons/historical_company_icons/mexicanbank.png" 
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_light.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_MEXICO }
	
	possible_prestige_goods = {
		#prestige_good_generic_currency_paper
	}
	
	building_types = {  
		building_paper_mill
		building_gold_mine
		building_maize_farm
	}
	
	extension_building_types = {	
		building_livestock_ranch
		building_textile_mill
		building_oil_rig
		building_tooling_workshop
	}
	
	potential = {
		has_game_rule = banks_enabled
		has_interest_marker_in_region = sr:region_central_america
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				region = sr:region_central_america
			}
		}
	}	
	
	possible = {
		any_scope_state = {
			region = sr:region_central_america
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_financial_district
				level >= 15
			}
		}
		has_technology_researched = investment_banks
		unique_companies_has_bank = no
	}
	
	prosperity_modifier = {
		state_infrastructure_mult = 0.05
		building_cash_reserves_mult = 0.05
		
		country_minting_mult = 0.025
        country_private_construction_allocation_mult = 0.1		
		
		state_farmers_investment_pool_contribution_add = 0.03 #<--
		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
		has_technology_researched = investment_banks
		any_scope_state = {
			state_region = s:STATE_MEXICO
			is_incorporated = yes
		}
	}

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