﻿REPLACE:ai_strategy_resource_expansion = {
	icon = "gfx/interface/icons/ai_strategy_icons/resource_expansion.dds"
	type = administrative
	building_group_weights = {
		bg_rubber = 1.5
		bg_oil_extraction = 1.5
		bg_mining = 1.5
		bg_logging = 1.5
	}
	goods_stances = {
		coal = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = coal } } }
		iron = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = iron } } }
		oil = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = oil } } }
		lead = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = lead } } }
		wood = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = wood } } }
		hardwood = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = hardwood } } }
		sulfur = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = sulfur } } }
		rubber = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = rubber } } }
		#T&R
		good_uranium = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = good_uranium } } }
		bauxite = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = bauxite } } }
		copper = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = copper } } }
		commonores = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = commonores } } }
		advancedores = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = advancedores } } }
		rare_earths = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = rare_earths } } }
		gas = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = gas } } }
	}

	possible = {
		always = yes
	}

	weight = {
		value = 20
		# Scaling with literacy 10-30%
		multiply = {
			value = literacy_rate
			add = -0.1
			divide = 0.2
			min = 0
			max = 1
		}
	}
}

# Kuromi AI in Industrial Expansion Strategy is a bit meh in some goods management, its better a more vanilla-esque approach
REPLACE:ai_strategy_industrial_expansion = {
	icon = "gfx/interface/icons/ai_strategy_icons/industrial_expansion.dds"
	type = administrative
	subsidies = {
		building_coal_mine = nice_to_have
		building_iron_mine = nice_to_have
		building_lead_mine = nice_to_have
		building_sulfur_mine = nice_to_have
		#T&R
		building_bauxite_mine = nice_to_have
		building_copper_mine = nice_to_have
		building_commonores_mine = nice_to_have
		building_rare_earths_mine = nice_to_have
	}
	goods_stances = {
		#TODO Aggiungere trigger se leggi contro materiali inquinanti
		### Vanilla Raw Materials Needed ###
		rubber = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = vulcanization
			}
		}
		oil = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = pumpjacks
			}
		}
		coal = { stance = wants_high_supply }
		iron = { stance = wants_high_supply }
		lead = { stance = wants_high_supply }
		sulfur = { stance = wants_high_supply }
		steel = { stance = wants_high_supply }

		### Vanilla Advanced Goods to be exported ###
		tools = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = tools } } }
		fertilizer = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = fertilizer } } }
		explosives = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = explosives } } }
		engines = {
			stance = wants_export
			trigger = {
				has_technology_researched = atmospheric_engine
				kai_has_high_supply = { GOODS = engines }
			}
		}
		automobiles = {
			stance = wants_export
			trigger = {
				has_technology_researched = combustion_engine
				kai_has_high_supply = { GOODS = automobiles }
			}
		}
		telephones = {
			stance = wants_export
			trigger = {
				has_technology_researched = telephone
				kai_has_high_supply = { GOODS = telephones }
			}
		}
		radios = {
			stance = wants_export
			trigger = {
				has_technology_researched = radio
				kai_has_high_supply = { GOODS = radios }
			}
		}

		### T&R Raw Materials Needed ###
		copper = { stance = wants_high_supply }
		commonores = { stance = wants_high_supply }
		bauxite = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = bauxite_processing
			}
		}
		advancedores = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = quartz_glass 
			}
		}
		rare_earths = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = rare_earths
			}
		}
		gas = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = natural_gas_extraction
			}
		}
		good_uranium = {
			stance = wants_high_supply
			trigger = {
				NOT = { has_law_or_variant = law_type:law_uranium_ban }
			}
		}
		### T&R Vital Goods Needed ###
		telecommunications = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = telephone
			}
		}
		global_electricity = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = national_power_grid
			}
		}
		#Data
		business_data = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = corporate_management
			}
		}
		organized_data = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = market_studies
			}
		}
		raw_data = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = digital_infrastructure
			}
		}
		# Lubricant and heavy fuel useless since light fuel already covers them both
		light_fuel = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = oil_distillation
			}
		}
		copperwires = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = verrier_electromagnetism_tech
			}
		}
		batteries = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = verrier_electromagnetism_tech
			}
		}
		electroniccomponents = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = electrical_generation
			}
		}
		processors = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = integrated_circuits
			}
		}
		on_demand_goods = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = on_demand_delivery
			}
		}
		alloys = { stance = wants_high_supply }
		aluminium = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = bauxite_processing
			}
		}
		plastics = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = plastics
			}
		}
		
		### T&R Advanced Goods to be Exported ###
		civil_planes = {
			stance = wants_export
			trigger = {
				has_technology_researched = zeppelins
				kai_has_high_supply = {
					GOODS = civil_planes
				}
			}
		}
		homeappliances = {
			stance = wants_export
			trigger = {
				has_technology_researched = rudimental_home_appliances
				kai_has_high_supply = {
					GOODS = homeappliances
				}
			}
		}
		robotics = {
			stance = wants_export
			trigger = {
				has_technology_researched = mechanical_arms
				kai_has_high_supply = {
					GOODS = robotics
				}
			}
		}
		computer = {
			stance = wants_export
			trigger = {
				has_technology_researched = computer
				kai_has_high_supply = {
					GOODS = computer
				}
			}
		}
		interactive_entertainment = {
			stance = wants_export
			trigger = {
				has_technology_researched = videogames
				kai_has_high_supply = {
					GOODS = interactive_entertainment
				}
			}
		}
		# Not Superpowers will export space assets
		space_assets = {
			stance = wants_export
			trigger = {
				has_technology_researched = space_rocketery
				NOT = { has_modifier = ztr_superpower }
				kai_has_high_supply = {
					GOODS = space_assets
				}
			}
		}
		# Superpowers wants to go into space race (WIP)
		space_assets = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = space_rocketery
				has_modifier = ztr_superpower
			}
		}
	}
	building_group_weights = {
		bg_manufacturing = 1.25
		bg_rubber = 1.25
		bg_oil_extraction = 1.25
		bg_mining = 1.25
		bg_logging = 1.25
	}
	possible = {
		NOR = {
			has_law = law_type:law_industry_banned
			has_law = law_type:law_extraction_economy
		}
	}
	weight = {
		value = -50
		if = {
			limit = {
				OR = {
					c:GBR ?= this
					c:SWI ?= this
					c:USA ?= this
					c:FRA ?= this
					c:BEL ?= this
					c:NET ?= this
					c:SWE ?= this
					c:NOR ?= this
					c:DEN ?= this
					c:CAN ?= this
					c:AST ?= this
				}
			}
			add = 150
		}
		# This is for Germany, Switzerland, France and North Italy
		if = {
			limit = {
				year > 1850
				is_in_geographic_region = geographic_region_europe
				NOT = {
					c:TUR = this
				}
			}
			add = 250
		}
		if = {
			limit = {
				year < 1870
				OR = {
					c:AUS ?= this
					c:HUN ?= this
					c:ITA ?= this
				}
			}
			add = -150
		}
		if = {
			limit = {
				year < 1900
				c:SIC ?= this
			}
			add = -150
		}
		if = {
			limit = {
				year < 1920
				c:SPA ?= this
			}
			add = -250
		}
		if = {
			limit = {
				c:RUS ?= this
				NOT = {
					has_law_or_variant = law_type:law_council_republic
				}
			}
			add = -250
		}
		# Actually Russia never industrialize like the west, but during the revolution it might try to catch up
		if = {
			limit = {
				year > 1945
				is_in_geographic_region = geographic_region_east_asia
			}
			add = 1000
		}
		# This is for East Asia industrialization
		if = {
			limit = {
				year > 1960
				is_in_geographic_region = geographic_region_south_east_asia
			}
			add = 250
		}
		# This is for Asian tiger economies
		# No other continents
		if = {
			limit = {
				OR = {
					has_journal_entry = je_meiji_restoration
					has_journal_entry = je_meiji_main
				}
			}
			add = 1000
		}
		if = {
			limit = {
				exists = c:FRA
				c:FRA = this
				ruler = {
					OR = {
						has_variable = house_orleans
						has_variable = house_bonaparte
					}
				}
			}
			add = 20
		}
		if = {
			# Grunderzeit
			limit = {
				has_journal_entry = je_grunderzeit
			}
			add = 100
		}
		if = {
			limit = {
				has_radical_leftist_government = yes
				NOT = {
					ig:ig_rural_folk ?= {
						is_powerful = yes
						is_in_government = yes
					}
				}
			}
			add = 50
		}
		# Metternich agenda of 1844 - inclined to industrialise
		if = {
			limit = {
				c:AUS ?= this
				has_journal_entry = je_metternich
			}
			add = 10
		}
		if = {
			limit = {
				has_law_or_variant = law_type:law_command_economy
			}
			multiply = 2
		}
		if = {
			limit = {
				exists = ig:ig_industrialists
				ig:ig_industrialists = {
					is_powerful = yes
				}
			}
			multiply = 2
		}
		if = {
			limit = {
				literacy_rate < 0.2
			}
			multiply = 0.5
		}
		if = {
			limit = {
				literacy_rate < 0.4
			}
			multiply = 0.5
		}
		if = {
			limit = {
				literacy_rate >= 0.6
			}
			multiply = 1.5
		}
		if = {
			limit = {
				literacy_rate >= 0.8
			}
			multiply = 1.5
		}
	}
}

REPLACE:ai_strategy_colonial_extraction = {
	icon = "gfx/interface/icons/ai_strategy_icons/resource_expansion.dds"
	type = administrative
	building_group_weights = {
		bg_rubber = 1.5
		bg_oil_extraction = 1.5
		bg_mining = 1.5
		bg_logging = 1.5
		bg_plantations = 1.5
	}
	goods_stances = {
        coal = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = coal } } }
        iron = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = iron } } }
        oil = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = oil } } }
        lead = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = lead } } }
        wood = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = wood } } }
        hardwood = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = hardwood } } }
        sulfur = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = sulfur } } }
        fruit = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = fruit } } }
        fabric = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = fabric } } }
        sugar = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = sugar } } }
        coffee = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = coffee } } }
        tea = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = tea } } }
        opium = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = opium } } }
        tobacco = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = tobacco } } }
        dye = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = dye } } }
        silk = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = silk } } }
        rubber = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = rubber } } }
		#T&R
		good_uranium = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = good_uranium } } }
		bauxite = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = bauxite } } }
		copper = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = copper } } }
		commonores = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = commonores } } }
		advancedores = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = advancedores } } }
		rare_earths = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = rare_earths } } }
		gas = { stance = wants_export trigger = { kai_has_high_supply = { GOODS = gas } } }
	}
	possible = {
		is_subject = yes
		country_is_colonial_or_company = yes
	}
	weight = {
		value = 100
	}
}
