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

# Bunge & Born
TRY_REPLACE:company_bunge_born = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/argentina_bunge_y_born.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_farm_wheat.dds"

	flavored_company = yes

	building_types = {
		building_wheat_farm
		building_maize_farm
		building_food_industry
	}

	extension_building_types = {
		building_chemical_plant
	}

	possible_prestige_goods = {
		prestige_good_generic_groceries
	}

	prestige_goods_trigger = {
		custom_tooltip = {
			text = je_prestige_goods_groceries_complete_tt
			has_variable = prestige_good_generic_groceries_var
		}
	}

	potential = {
		has_interest_marker_in_region = sr:region_la_plata
	}

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

	possible = {
		any_scope_state = {
			region = sr:region_la_plata
			is_incorporated = yes
			any_scope_building = {
				OR = {
					is_building_type = building_wheat_farm
					is_building_type = building_maize_farm
				}
				level >= 5
			}
			count >= 3
		}
	}

	prosperity_modifier = {
		interest_group_ig_rural_folk_pop_attraction_mult = 0.2
		building_tooling_workshop_throughput_add = 0.1
	}

	ai_will_do = {
		any_scope_state = {
			region = sr:region_la_plata
			is_incorporated = yes
		}
	}

	ai_construction_targets = {
		building_wheat_farm = {
			level = 5
			state_trigger = {
				region = sr:region_la_plata
				is_incorporated = yes
			}
		}
		building_maize_farm = {
			level = 5
			state_trigger = {
				region = sr:region_la_plata
				is_incorporated = yes
			}
		}
	}

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

# La Rosada
TRY_REPLACE:company_la_rosada = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/paraguay_la_rosada.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_heavy.dds"

	flavored_company = yes

	preferred_headquarters = { STATE_BAJO_PARAGUAY }

	building_types = {
		building_steel_mill
		building_arms_industry
		building_artillery_foundry
	}

	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_la_plata
	}

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

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

	prosperity_modifier = {
		unit_defense_mult = 0.05
		building_iron_mine_throughput_add = 0.1
	}

	ai_will_do = {
		has_technology_researched = shell_gun
		any_scope_state = {
			state_region = s:STATE_BAJO_PARAGUAY
			is_incorporated = yes
		}
	}

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

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

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

# Centro Vitivinícola Nacional
TRY_REPLACE:company_argentinian_wine = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/argentina_centro_vitivinicola_nacional.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_farm_rice.dds"

	category = shopkeeper_owned

	building_types = {
		building_vineyard
	}

	extension_building_types = {
		building_livestock_ranch
	}

	potential = {
		has_dlc_feature = rp1_content
		c:ARG ?= this
	}

	possible = {
		has_technology_researched = central_planning
		any_scope_state = {
			region = sr:region_la_plata
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_vineyard
				level >= 5
			}
			count >= 2
		}
	}

	prosperity_modifier = {
		country_prestige_mult = 0.2
	}

	ai_will_do = {
		has_technology_researched = central_planning
		any_scope_state = {
			region = sr:region_la_plata
			is_incorporated = yes
		}
	}

	ai_construction_targets = {
		building_vineyard = {
			level = 5
			state_trigger = {
				region = sr:region_la_plata
				is_incorporated = yes
			}
		}
	}

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

# Compañía Sudamericana de Vapores
TRY_REPLACE:company_sudamericana_de_vapores = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/chile_csav.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_harbor_shipbuilding.dds"

	flavored_company = yes

	preferred_headquarters = { STATE_SANTIAGO }

	building_types = {
		building_port
	}

	extension_building_types = {
		building_shipyard
		building_logging_camp
	}

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

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

	possible = {
		has_technology_researched = screw_frigate
		any_scope_state = {
			state_region = s:STATE_SANTIAGO
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_shipyard
				level >= 5
			}
		}
	}

	prosperity_modifier = {
		state_colony_growth_speed_mult = 0.1
		country_ship_group_supply_ships_construction_efficiency_add = 0.1
	}

	ai_will_do = {
		has_technology_researched = screw_frigate
		any_scope_state = {
			state_region = s:STATE_SANTIAGO
			is_incorporated = yes
		}
	}

	ai_construction_targets = {
		building_shipyard = {
			level = 5
			state_trigger = {
				state_region = s:STATE_SANTIAGO
			}
		}
	}

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

# Córdoba Central Railway
TRY_REPLACE:company_cordoba_railway = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/argentina_cordoba_cenral_railway.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_railways.dds"

	flavored_company = yes

	preferred_headquarters = { STATE_LA_PAMPA }

	building_types = {
		building_railway
	}

	extension_building_types = {
		building_coal_mine
		building_motor_industry
	}

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

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

	possible = {
		has_technology_researched = railways
		any_scope_state = {
			state_region = s:STATE_LA_PAMPA
			is_incorporated = yes
			has_building = building_railway
		}
		any_scope_state = {
			has_state_trait = state_trait_pampas
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_railway
				level >= 5
			}
			count >= 2
		}
	}

	prosperity_modifier = {
		building_wheat_farm_throughput_add = 0.1
		building_livestock_ranch_throughput_add = 0.05
	}

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

	ai_construction_targets = {
		building_railway = {
			level = 5
			state_trigger = {
				has_state_trait = state_trait_pampas
				is_incorporated = yes
			}
		}
	}

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

##############################DLC-MP1##############################

# Compañía Sansinena de Carnes Congeladas / La Negra
TRY_REPLACE:company_compania_sansinena_de_carnes_congeladas = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/company_compania_sansinena_de_carnes_congeladas.dds"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_manufacturing_light.dds"

	flavored_company = yes

	preferred_headquarters = { STATE_BUENOS_AIRES }

	building_types = {
		building_livestock_ranch
		building_food_industry
	}

	extension_building_types = {
		building_port
	}

	possible_prestige_goods = {
		prestige_good_river_plate_beef
	}

	potential = {
		has_dlc_feature = mp1_content
		has_interest_marker_in_region = sr:region_la_plata
	}

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

	possible = {
		any_scope_state = {
			state_region = s:STATE_BUENOS_AIRES
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_food_industry
				level >= 5
			}
		}
		any_scope_state = {
			region = sr:region_la_plata
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_livestock_ranch
				level >= 5
			}
		}
	}

	prosperity_modifier = {
		state_trade_advantage_mult = 0.1
		building_port_throughput_add = 0.1
	}

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

	ai_construction_targets = {
		building_food_industry = {
			level = 5
			state_trigger = {
				state_region = s:STATE_BUENOS_AIRES
			}
		}
		building_livestock_ranch = {
			level = 5
			state_trigger = {
				region = sr:region_la_plata
			}
		}
	}

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

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

# Tandanor / Talleres Navales de Marina
company_Tandanor = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/tandanor.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_harbor_shipbuilding.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_BUENOS_AIRES }
	
	category = bureaucrat_owned
	
	possible_prestige_goods = {
		#prestige_good_saint_etienne_rifles
	}

	
	building_types = { #23
		building_shipyard
	}
	
	extension_building_types = {
		building_furniture_manufactory
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_la_plata
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_BUENOS_AIRES
			}
		}
	}		
	
	possible = {
		any_scope_state = {
			state_region = s:STATE_BUENOS_AIRES
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_shipyard
				level >= 3
			}
		}
	}
	
	prosperity_modifier = {
		ship_armor_mult = 0.05 #20
		ship_hull_damage_mult = 0.01 #4
	}
	

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

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

# Trapiche
company_Trapiche = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/trapiche.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_plantation.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_RIO_NEGRO }
	
	possible_prestige_goods = {
		prestige_good_generic_groceries
	}
	
	building_types = { #26
		building_vineyard
	}
	
	extension_building_types = {
		building_food_industry
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_la_plata
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_RIO_NEGRO
			}
		}
	}		
	
	possible = {
		any_scope_state = {
			state_region = s:STATE_RIO_NEGRO
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_vineyard
				level >= 3
			}
		}
	}
	
	prosperity_modifier = {
		country_prestige_mult = 0.16 #16
		state_loyalists_from_political_movements_mult = 0.075 #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
	}
	

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

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

# Carlos Casado S.A.
company_CarlosCasado = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/carloscasado.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_harbor_shipbuilding.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_CHACO }
	
	possible_prestige_goods = {
		prestige_good_generic_fertilizer
	}

	
	building_types = { #20
		building_chemical_plant
		building_livestock_ranch
		building_railway
	}
	
	extension_building_types = {
		building_port
	}
	
	potential = {
		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_CHACO
					state_region = s:STATE_BAJO_PARAGUAY
				}
			}
		}
	}		
	
	possible = {
		any_scope_state = {
			OR = {
				state_region = s:STATE_CHACO
				state_region = s:STATE_BAJO_PARAGUAY
			}
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_chemical_plant
				level >= 3
			}
		}
		has_technology_researched = improved_fertilizer
	}
	
	prosperity_modifier = {
		state_colony_growth_speed_mult = 0.1 #10
		state_infrastructure_mult = 0.05 #10
	}
	

	
	ai_will_do = {
	    has_technology_researched = improved_fertilizer
		any_scope_state = {
			OR = {
			state_region = s:STATE_CHACO
			state_region = s:STATE_BAJO_PARAGUAY
			}
			is_incorporated = yes
		}
	}

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

# YPF / Yacimientos Petrolíferos Fiscales
company_YPF = {
	icon = "gfx/interface/icons/company_icons/historical_company_icons/ypf.png"
	background = "gfx/interface/icons/company_icons/company_backgrounds/comp_illu_oil_drills.dds"
	
	flavored_company = yes
	preferred_headquarters = { STATE_PATAGONIA }
	
	possible_prestige_goods = {
		#prestige_good_saint_etienne_rifles
	}
	
	category = bureaucrat_owned
	
	building_types = { #26
		building_oil_rig
	}
	
	extension_building_types = {
		building_port
	}
	
	potential = {
		has_interest_marker_in_region = sr:region_la_plata
	}
	
	attainable = {
		hidden_trigger = { # Hide attainable if it's always fulfilled by possible
			any_scope_state = {
				state_region = s:STATE_PATAGONIA
			}
		}
	}		
	
	possible = {
		any_scope_state = {
			state_region = s:STATE_PATAGONIA
			is_incorporated = yes
			any_scope_building = {
				is_building_type = building_urban_center
				level >= 3
			}
		}
		has_technology_researched = pumpjacks
		has_technology_researched = central_planning
	}
	
	prosperity_modifier = {
		country_authority_mult = 0.1 #10
		country_minting_mult = 0.05 #14
		state_dependent_wage_mult = 0.02 #2
	}
	

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

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