###########################
# GEA Decisions
###########################
# By Vietcongtraps and Roparex
###########################
GEA_indochina_war_decisions = {

	GEA_start_naval_blockade = {
		icon = generic_naval
		allowed = { original_tag = GEA }
		visible = { INC = { has_idea = INC_internationale_support } }
		cost = 0
		fire_only_once = yes
		ai_will_do = { factor = 100 }
		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision GEA_start_naval_blockade"
			INC = { country_event = { id = viet.5 days = 3 } }
		}
	}

	GEA_shelling_on_Saigon = {
		icon = generic_naval
		allowed = { original_tag = GEA }
		cost = 0
		fire_only_once = yes
		ai_will_do = { factor = 100 }
		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision GEA_shelling_on_Saigon"
			add_war_support = 0.03
			INC = { country_event = viet.80 }
		}
	}

	GEA_suppress_Tonkin = {
		icon = generic_ignite_civil_war
		allowed = { original_tag = GEA }
		available = { divisions_in_state = { state = 671 size > 2 } }
		visible = { check_variable = { INC.guerilla_activity > 10 } }
		highlight_states = { highlight_state_targets = { state = 671 } }
		cost = 10
		ai_will_do = {
			factor = 0
			modifier = {
				add = 200
				divisions_in_state = {
					state = 671
					size > 2
				}
			}
		}
		days_re_enable = 120
		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision GEA_suppress_Tonkin"
			activate_mission = GEA_maintain_Tonkin_control
		}
	}

	GEA_maintain_Tonkin_control = {
		icon = generic_civil_support
		allowed = { always = no }	# Activated manually
		activation = { always = no }
		available = { always = no }
		days_mission_timeout = 120
		cancel_trigger = { divisions_in_state = { state = 671 size < 3 } }
		highlight_states = {
			highlight_state_targets = {
				state = 671
			}
		}
		cancel_trigger = { NOT = { has_war_with = INC } }
		is_good = yes
		complete_effect = { log = "[GetDateText]: [Root.GetName]: Decision GEA_maintain_Tonkin_control" }
		timeout_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision timeout GEA_maintain_Tonkin_control"
			custom_effect_tooltip = reduce_10_guerilla_tooltip
			add_to_variable = { var = INC.guerilla_activity value = -10 }
		}
	}

	GEA_reinforce_police = {
		icon = oppression
		available = { has_equipment = { infantry_equipment > 250 } }
		cost = 25
		days_remove = 75
		days_re_enable = 50
		modifier = { political_power_gain = -0.25 }
		visible = { INC = { check_variable = { guerilla_activity > 10 } } }
		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision GEA_reinforce_police"
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = -250
			}
			add_manpower  = -1000
		}
		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove GEA_reinforce_police"
			custom_effect_tooltip = reduce_10_guerilla_tooltip
			add_to_variable = { var = INC.guerilla_activity value = -10 }
		}
	}

	GEA_Zeppelin_decision = {
		allowed = { original_tag = GEA }
		days_remove = 35
		modifier = {
			political_power_gain = -0.5
			civilian_factory_use = 2
		}
		visible = { has_army_experience > 5 }
		cost = 20
		fire_only_once = yes
		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision GEA_Zeppelin_decision"
			add_manpower  = -500
		}
		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove GEA_Zeppelin_decision"
			add_equipment_to_stockpile = {
				type = transport_plane_equipment_1
				amount = 10
			}
			custom_effect_tooltip = reduce_10_guerilla_tooltip
			add_to_variable = { var = INC.guerilla_activity value = -10 }
		}
	}

	GEA_Fernspaher_decision = {
		allowed = { original_tag = GEA }
		available = { has_army_experience > 15 }
		days_remove = 45
		modifier = {
			political_power_gain = -0.5
			command_power_gain = -0.25
		}
		visible = { has_army_experience > 10 }
		cost = 20
		fire_only_once = yes
		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision GEA_Fernspaher_decision"
			add_manpower  = -8000
			add_equipment_to_stockpile = {
				type = infantry_equipment
				amount = -250
			}
		}
		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove GEA_Fernspaher_decision"
			set_technology = { paratroopers = 1 }
			division_template = {
				name = "Ostasiatische Fernspaher"
				priority = 2
				division_names_group = GEA_PAR_01
				regiments = {
					paratrooper = { x = 0 y = 0 }
					paratrooper = { x = 0 y = 1 }
					paratrooper = { x = 0 y = 2 }
					paratrooper = { x = 1 y = 0 }
					paratrooper = { x = 1 y = 1 }
					paratrooper = { x = 1 y = 2 }
				}
				support = {
					engineer = { x = 0 y = 0 }
					recon = { x = 0 y = 1 }
				}
			}
			random_owned_state = {
				prioritize =  { 336 }
				create_unit = {
					division = "name = \"Fernspählehrbrigade 1'\" division_template = \"Ostasiatische Fernspaher\"  start_experience_factor = 0.8"
					owner = GEA
				}
			}
		}
	}
}
foreign_politics = {
	GEA_take_east_asian_navy = {
		icon = generic_naval
		allowed = { tag = GER }
		available = {
			has_war = no
			GEA = { has_war = no }
		}
		visible = {
			GEA = {
				is_subject_of = ROOT
				is_ai = yes
			}
		}
		cost = 0
		fire_only_once = yes
		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision GEA_take_east_asian_navy"
			GEA = { transfer_navy = { target = ROOT } }
		}
	}
}
political_actions = {
	GEA_expand_war = {
		icon = generic_nationalism

		available = {
			has_idea = AST_Colonial_War
		}

		visible = {
			has_idea = AST_Colonial_War
		}

		cost = 50
		fire_only_once = yes

		ai_will_do = {
			factor = 0
		}
		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision AST_expand_war target: [From.GetName]"
			GER = { remove_ideas = AST_Colonial_War }
			AST = { remove_ideas = AST_Colonial_War  }
		}
	}	

	GEA_break_malay_chaos = {
		icon = GFX_decision_eng_blackshirt_march
		available = {
			has_equipment = {
    			infantry_equipment_1 > 1000
			}
			has_idea = AST_malaysian_chaos
		}
		
		allowed = {
			tag = GEA
		}
		
		visible = {
			has_idea = AST_malaysian_chaos
		}
		
		cost = 15
		
		complete_effect = {
		}

		remove_effect = {
			add_equipment_to_stockpile = {
				type = infantry_equipment_1
				amount = -1000
				producer = GEA
			}
			GER = {
				modify_timed_idea = {
					idea = AST_malaysian_chaos
					days = -20
				}
			}
		}
		days_remove = 15
		fire_only_once = yes
		
		ai_will_do = {
			factor = 100
		}
	}

	GEA_reintegrate_Cochinchina_decision = {
		allowed = { tag = GEA }
		available = { has_stability > 0.5 }
		visible = {
			has_completed_focus = GEA_internal4
			owns_state = 286
			owns_state = 856
			NOT = {
				country_exists = INC
				has_completed_focus = GEA_internal1
				286 = { is_core_of = GEA }
				856 = { is_core_of = GEA }
			}
		}
		cost = 20
		days_remove = 300
		fire_only_once = yes
		modifier = { political_power_gain = -0.5 }

		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove GEA_reintegrate_Cochinchina_decision"
			add_state_core = 286
			add_state_core = 856
		}
	}

	GEA_German_vietnamese_reconciliation_decision = {
		allowed = { tag = GEA }
		available = { has_stability > 0.5 }
		visible = {
			has_country_leader = { name = "Hellmuth von Mücke" }
			has_completed_focus = GEA_internal4
			has_completed_focus = GEA_internal1
			owns_state = 286
			owns_state = 856
			NOT = {
				country_exists = INC
				286 = { is_core_of = GEA }
				856 = { is_core_of = GEA }
			}
		}
		cost = 30
		days_remove = 400
		fire_only_once = yes
		modifier = { political_power_gain = -0.25 }
		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove GEA_German_vietnamese_reconciliation_decision"
			add_state_core = 856
			add_state_core = 286
		}
	}

	GEA_pimp_the_concessions = { #make tsingtau dummy thicc
		cost = 8
		#allowed = { tag = GEA }
		allowed = { always = no }
		available = {
			has_war = no
			if = {
				limit = { NOT = { country_exists = LEP } }
				country_exists = SQI
				SQI = {
					has_war = no
					custom_trigger_tooltip = {
						tooltip = SQI_LSP
						has_cosmetic_tag = SQI_LSP
					}
					custom_trigger_tooltip = {
						tooltip = GEA_shandong_german_collaboration_tooltip
						check_variable = { sqi_german_control_var > 0.45 }
					}
				}
			}
			else = {
				LEP = {
					has_war = no
					market_liberal > 0.4
				}
				has_completed_focus = GEA_become_pals_with_qing
			}
		}
		targets = { LEP }
		ai_will_do = { factor = 1000 }
		complete_effect = {
			if = {
				limit = {
					NOT = { country_exists = LEP }
					country_exists = SQI
				}
				SQI = { country_event = { id = lepaog.57 days = 2 } }
			}
			else = { LEP = { country_event = { id = lepaog.57 days = 2 } } }
		}
	}
}

GEA_colonial_decisions = {
	GEA_steal_manpower_from_home = {
		available = {
			FROM = {
				has_manpower > 25000
			}
		}

		targets = { GER }
		target_trigger = {
			is_subject_of = FROM
		}

		cost = 100
		days_re_enable = 365

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision GEA_steal_manpower_from_home"
			add_manpower = 25000
			hidden_effect = {
				FROM = {
					country_event = {
						id = Ostasien.200
						days = 1
					}
				}
			}
		}
	}

	GEA_steal_guns_from_home = {
		available = {
			stockpile_ratio = {
				archetype = infantry_equipment
				ratio < 0.05
			}
			FROM = {
				has_equipment = { infantry_equipment > 2499 }
			}
		}
		targets = { GER }
		target_trigger = {
			is_subject_of = FROM
		}
		cost = 50
		days_re_enable = 365
		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision GEA_steal_guns_from_home"
			custom_effect_tooltip = GEA_receive_guns_from_home
			hidden_effect = {
				GER = {
					country_event = {
						id = Ostasien.201
						days = 1
					}
				}
			}
		}
	}

	GEA_Integrate_East_Indies = {
		icon = eng_trade_unions_demand
		available = {
			core_compliance = {
				occupied_country_tag = DEI
				value > 50
			}
			owns_state = 286
		}
		visible = {
			NOT = { country_exists = DEI }
			any_owned_state = { is_core_of = DEI }
		}

		cost = 200
		days_remove = 500
		fire_only_once = yes
		ai_will_do = { factor = 1000 }

		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove integrate_east_indies target: [From.GetName]"
			every_state = {
				limit = {
					OR = {
						is_core_of = DEI
						is_core_of = INS
					}
				}
				add_core_of = ROOT
			}
		}
	}
}

GEA_help_lep_decisions = {
	GEA_give_guns_to_lep = {
		visible = {
			has_completed_focus = GEA_help_lep_focus
			country_exists = FROM
		}
		available = {
			has_equipment = { infantry_equipment > 2499 }
		}

		targets = { LEP }
		target_root_trigger = { has_completed_focus = GEA_help_lep_focus }

		cost = 5
		fire_only_once = yes

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision GEA_give_guns_to_lep"
			custom_effect_tooltip = GEA_try_to_give_guns_to_LEP_tooltip
			hidden_effect = {
				FROM = { country_event = Ostasien.202 }
			}
		}
	}

	GEA_give_factories_to_lep = {
		visible = {
			country_exists = FROM
			has_completed_focus = GEA_help_lep_focus
		}
		available = {
			num_of_available_civilian_factories > 4
			NOT = { has_country_flag = GEA_no_factory_lease }
		}

		targets = { LEP }
		target_root_trigger = { has_completed_focus = GEA_help_lep_focus }

		cost = 5
		days_remove = 120
		fire_only_once = yes

		modifier = {
			civilian_factory_use = 4
		}

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision GEA_give_factories_to_lep"
			custom_effect_tooltip = GEA_try_to_give_factories_to_LEP_tooltip
			hidden_effect = {
				FROM = { country_event = Ostasien.203 }
			}
		}

		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove GEA_give_factories_to_lep"
			add_war_support = 0.1
			add_political_power = 100
		}
	}
}

prospect_for_resources = {
	GEA_develop_aluminum_deposits = {
		icon = aluminium

		available = {
			has_tech = excavation2
			num_of_civilian_factories_available_for_projects > 2
		}

		visible = {
			owns_state = 846
			controls_state = 846
			846 = {
				NOT = { has_state_flag = johore_aluminium_developed }
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 846
			}
		}

		cost = 25
		days_remove = 60
		fire_only_once = yes

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			factor = 1
		}

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision GEA_develop_aluminum_deposits"
			if = {
				limit = {
					NOT = { has_dlc = "Waking the Tiger" }
				}
				add_timed_idea = {
					idea = GEA_development_idea
					days = 60
				}
			}
		}

		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove GEA_develop_aluminum_deposits"
			846 = {
				set_state_flag = johore_aluminium_developed
				add_resource = {
					type = aluminium
					amount = 50
				}
			}
		}
	}

	GEA_develop_sarawak_oil = {
		icon = oil

		available = {
			has_tech = excavation3
			num_of_civilian_factories_available_for_projects > 2
		}

		visible = {
			owns_state = 333
			controls_state = 333
			333 = {
				NOT = { has_state_flag = sarawak_oil_developed }
			}
		}

		highlight_states = {
			highlight_state_targets = {
				state = 333
			}
		}

		fire_only_once = yes

		cost = 25
		days_remove = 60

		modifier = {
			civilian_factory_use = 3
		}

		ai_will_do = {
			factor = 1
		}

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision GEA_develop_sarawak_oil"
			if = {
				limit = {
					NOT = { has_dlc = "Waking the Tiger" }
				}
				add_timed_idea = {
					idea = GEA_development_idea
					days = 60
				}
			}
		}

		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove GEA_develop_sarawak_oil"
			333 = {
				set_state_flag = sarawak_oil_developed
				add_resource = {
					type = oil
					amount = 4
				}
			}
		}
	}
}
