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

# Nam Định Textile Factory
TRY_REPLACE:company_nam_dinh = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/vietnam_nam_dinh.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_light.dds"

	flavored_company = yes

	preferred_headquarters = { STATE_TONKIN }

	building_types = {
		building_textile_mill
	}

	extension_building_types = {
		building_cotton_plantation
		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_indochina
	}

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

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

	prosperity_modifier = {
		country_tech_spread_mult = 0.1
	}

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

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

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

# Société française des charbonnages du Tonkin
TRY_REPLACE:company_societe_francaise_charbonnages_du_tonkin = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/company_societe_francaise_charbonnages_du_tonkin.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_light.dds"

	flavored_company = yes

	preferred_headquarters = { STATE_TONKIN }

	building_types = {
		building_coal_mine
		building_logging_camp
	}

	extension_building_types = {
		building_port
		building_railway
		building_power_plant
	}

	possible_prestige_goods = {
	}

	prestige_goods_trigger = {
	}

	potential = {
		has_interest_marker_in_region = sr:region_indochina
	}

	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			s:STATE_TONKIN = {
				any_scope_state = {
					owner = root
				}
			}
		}
	}

	possible = {
		s:STATE_TONKIN = {
			any_scope_state = {
				owner = root
				any_scope_building = {
					is_building_type = building_coal_mine
					level >= 5
				}
			}
		}
	}

	prosperity_modifier = {
		building_coal_mine_throughput_add = 0.1
		country_bureaucracy_mult = 0.05
	}

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

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

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

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

# Vietnam Railways
company_VRailways = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/vietnamrailways.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_railways.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_TONKIN }
	

	possible_prestige_goods = {
		# prestige_good_saint_etienne_rifles
	}

	
	building_types = { #23
		building_railway
	}
	
	extension_building_types = {
		building_steel_mill
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_indochina
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_TONKIN
			}
		}
	}
	
	possible = {
		any_scope_state = {
			state_region = s:STATE_TONKIN
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_railway
				level >= 3
			}
		}
	}
	
	prosperity_modifier = {
		state_infrastructure_mult = 0.1 #20
		state_assimilation_mult = 0.06 #3
	}	
	

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

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

# Habeco
company_Habeco = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/habeco.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_farm_rice.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_TONKIN }
	

	possible_prestige_goods = {
		prestige_good_generic_beer
	}

	
	building_types = { #21
		building_food_industry
		building_rice_farm
	}
	
	extension_building_types = {
		building_livestock_ranch
		building_fishing_wharf
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_indochina
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_TONKIN
			}
		}
	}
	
	possible = {
		any_scope_state = {
			state_region = s:STATE_TONKIN
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_food_industry
				level >= 3
			}
		}
	}
	
	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
	}	
	

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

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

# Saigon Ironworks
company_saigon_iron = {
	icon = "gfx/interface/icons/company_icons/basic_metal_mining.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_mining.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_MEKONG }
	

	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 = { #14
		building_tooling_workshop
		building_iron_mine
	}
	
	extension_building_types = {
		building_steel_mill
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_indochina
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_MEKONG
			}
		}
	}			
	
	possible = {
		any_scope_state = {
			state_region = s:STATE_MEKONG
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_tooling_workshop
				level >= 3
			}
		}
	}
	
	prosperity_modifier = {
		building_steel_mill_throughput_add = 0.09 #14
	}	
	

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

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

# Gia Định báo
company_gia_dinh_bao= {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/giadinhbao.png" 
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_light.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_MEKONG }

	possible_prestige_goods = {
		prestige_good_generic_newspaper
	}

	
	building_types = { #28
		building_paper_mill
	}
	
	extension_building_types = {
		building_logging_camp
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_indochina
		has_game_rule = newspapers_enabled
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_MEKONG
			}
		}
	}			
	
	possible = {
		any_scope_state = {
			state_region = s:STATE_MEKONG
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_paper_mill
				level >= 3
			}
		}
		has_technology_researched = civilizing_mission
	}
	
	prosperity_modifier = {
		country_tech_spread_mult = 0.07 #14
		interest_group_in_government_approval_add = 1 #8
		state_radicalism_increases_violent_hostility_mult = -0.09 #6
		state_radicalism_increases_cultural_erasure_mult = -0.06
		state_radicalism_increases_open_prejudice_mult = -0.03
	}	
	

	ai_will_do = {
		has_technology_researched = civilizing_mission
		any_scope_state = {
			state_region = s:STATE_MEKONG
			is_incorporated = yes
		}
	}

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

# Société générale des tramways à vapeur de Cochinchine
company_Railway_Cochin = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/frenchindochinarailway.png" 
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_railways.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_MEKONG }
	

	possible_prestige_goods = {
		# prestige_good_saint_etienne_rifles
	}

	
	building_types = { #25
		building_railway
	}
	
	extension_building_types = {
		building_port
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_indochina
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_MEKONG
			}
		}
	}
	
	possible = {
		any_scope_state = {
			state_region = s:STATE_MEKONG
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_railway
				level >= 3
			}
		}
		has_technology_researched = mutual_funds
	}
	
	prosperity_modifier = {
		state_capitalists_investment_pool_contribution_add = 0.03 #6
		building_urban_center_throughput_add = 0.08 #10
		state_infrastructure_from_population_max_add = 12 #8
	}	
	

	ai_will_do = {
		has_technology_researched = mutual_funds
		any_scope_state = {
			state_region = s:STATE_MEKONG
			is_incorporated = yes
		}
	}

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

# Société des Ciments Portland Artificiels de l'Indochine
company_PortlandCementVietnam = {
	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_TONKIN }

	possible_prestige_goods = {
		prestige_good_generic_cement
	}
	
	building_types = { #19
		building_steel_mill
		building_logging_camp
	}
	
	extension_building_types = {
		building_coal_mine
		building_explosives_factory
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_indochina
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_TONKIN
			}
		}
	}			
	
	possible = {
		any_scope_state = {
			state_region = s:STATE_TONKIN
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_steel_mill
				level >= 3
			}
		}
		has_technology_researched = steel_frame_buildings
	}
	
	prosperity_modifier = {
		country_max_weekly_construction_progress_add = 5 #6
		building_construction_sector_throughput_add = 0.1 #13
	}	
	

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

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



# Compagnie des eaux et d'électricité d'Indochine
company_FrenchIndochinaElectric = {
	icon = "gfx/interface/icons/company_icons/basic_electrics.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_heavy.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_TONKIN }
	

	possible_prestige_goods = {
		# prestige_good_saint_etienne_rifles
	}

	
	building_types = { #25
		building_power_plant
	}
	
	extension_building_types = {
		building_motor_industry
		building_coal_mine
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_indochina
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_TONKIN
			}
		}
	}			
	
	possible = {
		any_scope_state = {
			state_region = s:STATE_TONKIN
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_power_plant
				level >= 3
			}
		}
		has_technology_researched = civilizing_mission
	}
	
	prosperity_modifier = {
		state_infrastructure_mult = 0.05 #10
		state_infrastructure_from_population_max_add = 15 #10
		state_pollution_reduction_health_mult = -0.04 #5
	}	
	

	ai_will_do = {
		has_technology_researched = civilizing_mission
		any_scope_state = {
			state_region = s:STATE_TONKIN
			is_incorporated = yes
		}
	}

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

# Banque de l'Indochine / Bank of Indochina
company_BankOfIndochina = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/bankofindochina.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_light.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_MEKONG }
	
	possible_prestige_goods = {
		#prestige_good_generic_currency_paper
	}
	
	building_types = {  
		building_paper_mill
		building_dye_plantation
		building_trade_center
	}
	
	extension_building_types = {	
		building_coal_mine
		building_chemical_plant
		building_silk_plantation
		building_rice_farm
	}

	potential = {
		has_game_rule = banks_enabled
		has_interest_marker_in_region = sr:region_indochina
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_MEKONG
			}
		}
	}	

	possible = { 
		any_scope_state = {
		    state_region = s:STATE_MEKONG
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_financial_district
				level >= 15
			}
		}
		has_technology_researched = quinine
		has_technology_researched = investment_banks
		unique_companies_has_bank = no
	}
	
	prosperity_modifier = { 
		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.01 #<-------
		state_shopkeepers_investment_pool_contribution_add = 0.015
		state_clergymen_investment_pool_contribution_add = 0.04
		state_aristocrats_investment_pool_contribution_add = 0.05 #<--------
		state_capitalists_investment_pool_contribution_add = 0.06 #<--------
		
		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 = quinine
		has_technology_researched = investment_banks
		any_scope_state = {
			state_region = s:STATE_MEKONG
			is_incorporated = yes
		}
	}

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

# Société des Plantations et Pneumatiques Michelin au Vietnam
company_MichelinIndochina = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/michelin.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_heavy.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_ANNAM }
	

	possible_prestige_goods = {
		prestige_good_michelin_rubber
	}
	
	building_types = { #28
		building_rubber_plantation
	}
	
	extension_building_types = {
		building_port
		building_shipyard
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_indochina
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_ANNAM
			}
		}
	}			
	
	possible = {
		any_scope_state = {
			state_region = s:STATE_ANNAM
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_rubber_plantation
				level >= 3
			}
		}
		has_technology_researched = combustion_engine
	}
	
	prosperity_modifier = {
		building_group_bg_rubber_mortality_mult = 0.1 #+5
		state_colony_growth_speed_mult = 0.1 #10
		state_capitalists_investment_pool_contribution_add = 0.06 #12
		goods_output_automobiles_mult = 0.13 #10
	}	
	

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

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

# Compagnie française des chemins de fer de l'Indochine
company_FrenchIndochinaRailway = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/frenchindochinarailway2.png" 
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_railways.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_TONKIN }
	

	possible_prestige_goods = {
		# prestige_good_saint_etienne_rifles
	}

	
	building_types = { #25
		building_railway
	}
	
	extension_building_types = {
		building_motor_industry
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_indochina
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_TONKIN
			}
		}
	}
	
	possible = {
		any_scope_state = {
			state_region = s:STATE_TONKIN
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_railway
				level >= 3
			}
		}
		has_technology_researched = civilizing_mission
	}
	
	prosperity_modifier = {
		state_infrastructure_mult = 0.1 #20
		military_formation_army_movement_speed_mult = 0.05 #5
	}	
	

	ai_will_do = {
		has_technology_researched = civilizing_mission
		any_scope_state = {
			state_region = s:STATE_TONKIN
			is_incorporated = yes
		}
	}

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

# Biên Hòa Industrial and Forestry Company
company_Vietnam_Forestry = {
	icon = "gfx/interface/icons/company_icons/basic_forestry.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_railways.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_TONKIN }
	

	possible_prestige_goods = {
		prestige_good_agarwood
	}

	
	building_types = { #25
		building_logging_camp
	}
	
	extension_building_types = {
		building_tooling_workshop
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_indochina
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_TONKIN
			}
		}
	}
	
	possible = {
		any_scope_state = {
			state_region = s:STATE_TONKIN
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_logging_camp
				level >= 3
			}
		}
		has_technology_researched = civilizing_mission
	}
	
	prosperity_modifier = {
		state_trade_advantage_mult = 0.3 #20
		state_colony_growth_speed_mult = 0.05 #5
	}	
	

	ai_will_do = {
		has_technology_researched = civilizing_mission
		any_scope_state = {
			state_region = s:STATE_TONKIN
			is_incorporated = yes
		}
	}

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