﻿je_objective_expand_goods_production = {
	should_be_pinned_by_default = yes
	icon = "gfx/interface/icons/objectives/economic_dominance.dds"

	group = je_group_objectives

	complete = {
		scope:journal_entry = { is_goal_complete = yes }
		scope:target = {
			cash_reserves_ratio > 0.25
			weekly_profit > 0
			occupancy > 0.75
			is_subsidized = no
		}
	}		
	
	current_value = {
		value = scope:target.level
	}
	
	goal_add_value = {
		value = 1
	}
	
	is_progressing = {
		exists = scope:target
		scope:target = { is_under_construction = yes }
	}
	
	invalid = {
		custom_tooltip = {
			text = je_objective_expand_goods_production_invalid_tooltip
			OR = {
				NOT = { exists = scope:target }
				NOT = { scope:target.owner = root }
			}
		}
	}
	
	
	on_complete = {
		hidden_effect = {
			owner = {
				start_tutorial_lesson = { 
					tutorial_lesson = expand_goods_production_complete
					journal_entry = je:je_objective_expand_goods_production
				}
			}
		}
	}

	on_invalid = {
		remove_active_objective_subgoal = sg_expand_goods_production
	}
		
	weight = 1000
	transferable = yes
}

je_refining_goods = {
	should_be_pinned_by_default = yes
	icon = "gfx/interface/icons/objectives/economic_dominance.dds"

	group = je_group_objectives

	immediate = {	
	}
	
	complete = {
		any_scope_building = {
			is_building_type = building_steel_mills
			level >= 4
			occupancy >= 0.9
			is_subsidized = no
		}
	}

	is_progressing = {
		any_scope_building = {
			is_building_type = building_steel_mills
			is_under_construction = yes 
		}
	}
	
	weight = 1002
	transferable = yes
}

je_specialized_goods = {
	should_be_pinned_by_default = yes
	icon = "gfx/interface/icons/objectives/economic_dominance.dds"

	group = je_group_objectives

	immediate = {	
	}
	
	complete = {
		any_scope_building = {
			is_building_type = building_motor_industry
			level >= 2
			occupancy >= 0.9
			is_subsidized = no
		}
	}

	is_progressing = {
		any_scope_building = {
			is_building_type = building_motor_industry
			is_under_construction = yes 
		}
	}
	
	weight = 1003
	transferable = yes
}

je_expanding_the_market = {
	should_be_pinned_by_default = yes
	icon = "gfx/interface/icons/objectives/economic_dominance.dds"

	group = je_group_objectives

	immediate = {	
	}
	
	complete = {
		market = {
		   owner = ROOT
		   participants >= 8
		}
	}

	weight = 1005
	transferable = yes
}

je_strong_market = {
	should_be_pinned_by_default = yes
	icon = "gfx/interface/icons/objectives/economic_dominance.dds"

	group = je_group_objectives
	active_update_frequency = 1

	immediate = {	
	}
	
	complete = {
		gdp > {
			value = global_gdp
			multiply = 0.25
		}
	}

	on_complete = {
		hidden_effect = {
			owner = {
				start_tutorial_lesson = { 
					tutorial_lesson = economic_dominance_complete
					journal_entry = je:je_strong_market
				}
			}
		}
	}

	weight = 1012
	transferable = yes
}

je_specialized_inputs = {
	should_be_pinned_by_default = yes
	icon = "gfx/interface/icons/objectives/economic_dominance.dds"

	group = je_group_objectives

	immediate = {	
	}
	
	complete = {
		OR = {
			any_scope_building = {
				filter = {
					OR = {
						is_building_type = building_rye_farm
						is_building_type = building_wheat_farm
						is_building_type = building_maize_farm
						is_building_type = building_millet_farm
					}
				}
				percent >= 0.75
				OR = {
					has_active_production_method = pm_tractors
					has_active_production_method = pm_compression_ignition_tractors
				}
				weekly_profit > 0
				occupancy >= 0.5
				is_subsidized = no
			}
			any_scope_building = {
				filter = {
					OR = {
						is_building_type = building_coal_mine
						is_building_type = building_iron_mine
						is_building_type = building_lead_mine
						is_building_type = building_sulfur_mine
					}
				}
				percent >= 0.75
				OR = {
					has_active_production_method = pm_steam_donkey_building_coal_mine
					has_active_production_method = pm_steam_donkey_mine
				}
				weekly_profit > 0
				occupancy >= 0.5
				is_subsidized = no
			}
			any_scope_building = {
				is_building_type = building_railway
				or = {
					level >= 5
				}
			}
		}
	}

	on_complete = {
		set_variable = player_obj_home_focus
	}
	
	invalid = {
		has_variable = player_obj_export_focus
	}

	weight = 1002
	transferable = yes
}

je_utilizing_our_strength = {
	should_be_pinned_by_default = yes
	icon = "gfx/interface/icons/objectives/economic_dominance.dds"

	group = je_group_objectives

	immediate = {
	}
	
	complete = {
		custom_tooltip = {
			text = tt_utilizing_our_strength_sub_obj
			market_capital.market = {
				mg:engines = {
					market_goods_cheaper < 0.25
				}
			}
		}
	}
	
	weight = 1010
	transferable = yes
}

je_exporting_profits = {
	should_be_pinned_by_default = yes
	icon = "gfx/interface/icons/objectives/economic_dominance.dds"

	group = je_group_objectives

	immediate = {
	}
	
	complete = {
		market_capital.market = {
			mg:engines = {
				market_goods_exports > 50
			}
		}
	}

	invalid = {
		has_variable = player_obj_home_focus
	}
	
	on_complete = {
		set_variable = player_obj_export_focus
	}

	weight = 1010
	transferable = yes
}

je_raise_exports_value = {
	should_be_pinned_by_default = yes
	icon = "gfx/interface/icons/objectives/economic_dominance.dds"

	group = je_group_objectives

	immediate = {
	}
	
	complete = {
		custom_tooltip = {
			text = tt_raise_exports_value_sub_obj
			market_capital.market = {
				mg:engines = {
					market_goods_pricier > 0.5
				}
			}
		}
	}
	
	weight = 1010
	transferable = yes
}

je_lower_production_costs = {
	should_be_pinned_by_default = yes
	icon = "gfx/interface/icons/objectives/economic_dominance.dds"

	group = je_group_objectives

	immediate = {
	}
	
	complete = {
		custom_tooltip = {
			text = tt_lower_production_costs_sub_obj
			market_capital.market = {
				mg:coal = {
					market_goods_cheaper > 0.2
				}
			}
			market_capital.market = {
				mg:iron = {
					market_goods_cheaper > 0.2
				}
			}
			market_capital.market = {
				mg:steel = {
					market_goods_cheaper > 0.2
				}
			}
		}
	}
	
	weight = 1010
	transferable = yes
}