#Lannister puppets

LAN_tribesmenvale = {
	recruit_tribesmen = {

		icon = generic_prepare_civil_war

		available = {
#			has_country_flag = military_support_for_fascist_civil_war
		}

		visible = {
#			has_country_flag = preparation_for_fascist_civil_war
#			NOT = { has_government = fascism }
		}
	
		fire_only_once = yes
	
		cost = 150
		
		complete_effect = {
			custom_effect_tooltip = HOL_create_unit_Vale_clansmen_tt
			hidden_effect = {
				add_manpower = 18000
				division_template = { name = "Vale Clanmens" regiments = { mountaineers = { x = 0 y = 0 }	
				mountaineers = { x = 0 y = 1 }
				mountaineers = { x = 0 y = 2 }	
				mountaineers = { x = 1 y = 0 }
				mountaineers = { x = 1 y = 1 }
				mountaineers = { x = 1 y = 2 } 	
				} 
			}
		random_owned_controlled_state = {
			prioritize = { 3 }
				create_unit = { 
				division = "name = \"Black Ears\" division_template = \"Vale Clanmens\" 				start_experience_factor = 1"
				owner = HOL
					}

				}
		random_owned_controlled_state = {
			prioritize = { 3 }
				create_unit = { 
				division = "name = \"Moon Brothers\" division_template = \"Vale Clanmens\" 				start_experience_factor = 1"
				owner = HOL
					}

				}
		random_owned_controlled_state = {
			prioritize = { 3 }
				create_unit = { 
				division = "name = \"Stone Crows\" division_template = \"Vale Clanmens\" 						start_experience_factor = 1"
				owner = HOL
					}

				}
#				load_oob = "LAN_tribesmen"
			}
		}
		
		ai_will_do = {
			factor = 60
		}
	}
	recruit_shaga = {

		icon = generic_army_support

		available = {
#			has_country_flag = military_support_for_fascist_civil_war
		}

		visible = {
#			has_country_flag = preparation_for_fascist_civil_war
#			NOT = { has_government = fascism }
		}
	
		fire_only_once = yes
	
		cost = 25
		
		complete_effect = {
			create_corps_commander = {
				name = "Shagga son of Dolf"
				picture = "Portrait_Shagga.dds"
				traits = { hill_fighter }
				skill = 3
#				id = 4
				attack_skill = 3
				defense_skill = 1
				planning_skill = 1
				logistics_skill = 4
			}
		}
		
		ai_will_do = {
			factor = 40
		}
	}
	recruit_timet = {

		icon = generic_army_support

		available = {
#			has_country_flag = military_support_for_fascist_civil_war
		}

		visible = {
#			has_country_flag = preparation_for_fascist_civil_war
#			NOT = { has_government = fascism }
		}
	
		fire_only_once = yes
	
		cost = 20
		
		complete_effect = {
			create_corps_commander = {
				name = "Timett son of Timett"
				picture = "Portrait_Timett.dds"
				traits = { hill_fighter }
				skill = 2
#				id = 4
				attack_skill = 2
				defense_skill = 2
				planning_skill = 1
				logistics_skill = 2
			}
		}
		
		ai_will_do = {
			factor = 40
		}
	}
}

LAN_loyalists = {
	LAN_puppet_tarly = {

		icon = ger_reichskommissariats

		available = {
			has_war_with = IRE
			has_government = fascism
			controls_state = 17
			controls_state = 98
			IRE = { owns_state = 17 }
			IRE = { owns_state = 98 }
		}

		cost = 150
		ai_will_do = {
			factor = 2
		}

		visible = {
			has_war_with = IRE
			has_government = fascism
		}

		complete_effect = {
			if = {
				limit = {
					country_exists = MNT
				}
				hidden_effect = {
					MNT = {
						set_state_controller = 17
						set_state_controller = 98
					}
				}
				MNT = {
					start_civil_war = { ideology = fascism size = 1 }
				}
				random_country = {
					limit= {
						original_tag = MNT
						has_government = fascism
					}
					transfer_state = 17
					transfer_state = 98
					HOL = {
						puppet = PREV
						set_autonomy = { target = PREV autonomy_state = autonomy_puppet }
					}
				}
			}
			else = {
				MNT = {
					transfer_state = 17
					transfer_state = 98
				}
				set_autonomy = { target = MNT autonomy_state = autonomy_puppet }
			}
		}
	}
}

LAN_northrebels = {
	
	launch_bolton_uprising = {

		icon = generic_political_discourse

		allowed = {
			original_tag = HOL
		}

		visible = {
			has_government = fascism
#			ENG = { has_idea = ENG_king_edward }
		}

		available = {
  			has_government = fascism
			HOL = { has_war_with = FIN }
			122 = { is_owned_and_controlled_by = FIN }
 		}
	
		days_remove = 9
		cost = 150
		
		ai_will_do = {
			factor = 100
		}

		complete_effect = {
			hidden_effect = {
				
			}
#			custom_effect_tooltip = ban_fascist_party_tt
		}

		remove_effect = {
			FIN = { country_event = { id = netherlands.17 } }
		}

	}

	pardon_roose_bolton = {

		icon = generic_political_discourse

		allowed = {
			original_tag = HOL
		}

		visible = {
			has_government = fascism
		}

		available = {
  			has_government = fascism
#			HOL = { has_war_with = FIN }
			is_in_faction_with = ITA
			has_global_flag = roose_hired
 		}
	
		days_remove = 3
		cost = 65
		
		ai_will_do = {
			factor = 60
		}

		complete_effect = {
			hidden_effect = {
				
			}
#			custom_effect_tooltip = ban_fascist_party_tt
		}

		remove_effect = {
			FIN = { country_event = { id = stark.20 } }
		}
	}
}

########  ##     ## ##    ##    ########  #######  ##     ## #### ########  ##     ## ######## ##    ## ######## 
##     ## ##     ##  ##  ##     ##       ##     ## ##     ##  ##  ##     ## ###   ### ##       ###   ##    ##    
##     ## ##     ##   ####      ##       ##     ## ##     ##  ##  ##     ## #### #### ##       ####  ##    ##    
########  ##     ##    ##       ######   ##     ## ##     ##  ##  ########  ## ### ## ######   ## ## ##    ##    
##     ## ##     ##    ##       ##       ##  ## ## ##     ##  ##  ##        ##     ## ##       ##  ####    ##    
##     ## ##     ##    ##       ##       ##    ##  ##     ##  ##  ##        ##     ## ##       ##   ###    ##    
########   #######     ##       ########  ##### ##  #######  #### ##        ##     ## ######## ##    ##    ##    


LAN_purchase_equipment = {
	BUL_purchase_infantry_equipment = {

		priority = 10

		icon = generic_industry

		allowed = { original_tag = HOL }

		available = {
			SWI = {
				has_opinion = {
					target = ROOT
					value > 0
				}
#				BUL_is_valid_subject = yes
			}
			HOL = { has_tech = infantry_weapons }
			NOT = { has_country_flag = BUL_purchasing_infantry_equipment_flag }

			
			NOT = { has_war_with = SWI }
			NOT = { is_justifying_wargoal_against = SWI }
#			if = {
#				limit = {
#					FROM = { tag = GER }
#				}
#				OR = {
#					is_in_faction_with = GER
#					AND = {
#						BUL_foreign_agreements_in_faction_with_eng = yes
#						BUL_foreign_agreements_in_faction_with_sov = yes
#						BUL_foreign_agreements_in_faction_with_ita = yes
#					}
#				}
#			}
		}

		visible = {
			country_exists = SWI
			NOT = { has_war_with = SWI }
#			FROM = { BUL_is_valid_subject = yes }
		}

		cost = 50
		days_remove = 90
		days_re_enable = 90
		fire_only_once = no

		ai_will_do = {
			factor = 0.1
			modifier = {
				factor = 2
				is_in_faction_with = SWI
			}
			modifier = {
				factor = 0
				OR = {
					num_of_civilian_factories < 10
					stockpile_ratio = { 
		  				archetype = infantry_equipment
		  				ratio > 0.75
		  			}
				}
			}
#			modifier = {
#				factor = 0
#				NOT = { is_in_faction_with = FROM }
#			}
		}
		modifier = {
			civilian_factory_use = 1
		}
		
		complete_effect = {
			#set_country_flag = BUL_purchasing_infantry_equipment_flag
			SWI = {
				add_offsite_building = {
					type = industrial_complex
					level = 1
				}
				add_opinion_modifier = {
					target = HOL
					modifier = BUL_bought_guns
				}

			}
			add_opinion_modifier = {
				target = SWI
				modifier = BUL_sold_guns
			}
			add_opinion_modifier = {
				target = SWI
				modifier = BUL_arms_trade
			}
		}
		remove_effect = {
			HOL = {
				add_equipment_to_stockpile = {
					type = infantry_equipment
					amount = 1000
					producer = SWI
				}
			}
			SWI = {
				add_offsite_building = {
					type = industrial_complex
					level = -1
				}
			}
			#clr_country_flag = BUL_purchasing_infantry_equipment_flag
		}
	}

	LAN_purchase_artillery = {

		priority = 9

		icon = ger_military_buildup

		allowed = { original_tag = HOL }

		available = {
			SWI = {
				has_opinion = {
					target = ROOT
					value > 0
				}
#				BUL_is_valid_subject = yes
			}
			HOL = { has_tech = gw_artillery }
			NOT = { has_country_flag = BUL_purchasing_artillery_flag }

			NOT = { has_war_with = SWI }
			NOT = { is_justifying_wargoal_against = SWI }
#			if = {
#				limit = {
#					FROM = { tag = GER }
#				}
#				OR = {
#					is_in_faction_with = GER
#					AND = {
#						BUL_foreign_agreements_in_faction_with_eng = yes
#						BUL_foreign_agreements_in_faction_with_sov = yes
#						BUL_foreign_agreements_in_faction_with_ita = yes
#					}
#				}
#			}
		}

		visible = {
			country_exists = SWI
			NOT = { has_war_with = SWI }
#			FROM = { BUL_is_valid_subject = yes }
		}		

		cost = 100
		days_remove = 90
		days_re_enable = 90
		fire_only_once = no

		ai_will_do = {
			factor = 0.1
			modifier = {
				factor = 2
				is_in_faction_with = SWI
			}
			modifier = {
				factor = 0
				OR = {
					num_of_civilian_factories < 10
					AND = {
						stockpile_ratio = { 
			  				archetype = artillery_equipment
			  				ratio > 0.75
			  			}
					}
				}
			}
			modifier = {
				factor = 0
				NOT = { is_in_faction_with = FROM }
			}
		}

		modifier = {
			civilian_factory_use = 1
		}
		
		complete_effect = {
			SWI = {
				add_offsite_building = {
					type = industrial_complex
					level = 1
				}
				add_opinion_modifier = {
					target = SWI
					modifier = BUL_bought_guns
				}

			}
			add_opinion_modifier = {
				target = SWI
				modifier = BUL_sold_guns
			}
			add_opinion_modifier = {
				target = SWI
				modifier = BUL_arms_trade
			}
			custom_effect_tooltip = BUL_purchase_artillery_tt
		}
		remove_effect = {
			HOL = {
				add_equipment_to_stockpile = {
					type = artillery_equipment
					amount = 500
					producer = SWI
				}
			}
			SWI = {
				add_offsite_building = {
					type = industrial_complex
					level = -1
				}
			}
			#clr_country_flag = BUL_purchasing_artillery_flag
		}
	}

	LAN_purchase_military_vehicles = {

		priority = 8

		icon = generic_decision

		allowed = { original_tag = HOL }

		available = {
			SWI = {
				has_opinion = {
					target = ROOT
					value > 0
				}
#				BUL_is_valid_subject = yes
			}
			FROM = { has_tech = motorised_infantry }
			NOT = { has_country_flag = BUL_purchasing_military_vehicles_flag }

			NOT = { has_war_with = SWI }
			NOT = { is_justifying_wargoal_against = SWI }
#			if = {
#				limit = {
#					FROM = { tag = GER }
#				}
#				OR = {
#					is_in_faction_with = GER
#					AND = {
#						BUL_foreign_agreements_in_faction_with_eng = yes
#						BUL_foreign_agreements_in_faction_with_sov = yes
#						BUL_foreign_agreements_in_faction_with_ita = yes
#					}
#				}
#			}
		}

		visible = {
			country_exists = SWI
			NOT = { has_war_with = SWI }
#			FROM = { BUL_is_valid_subject = yes }
		}

		cost = 60
		days_remove = 90
		days_re_enable = 90
		fire_only_once = no

		ai_will_do = {
			factor = 0.1
			modifier = {
				factor = 2
				is_in_faction_with = SWI
			}
			modifier = {
				factor = 0
				OR = {
					num_of_civilian_factories < 10
					AND = {
						stockpile_ratio = { 
			  				archetype = motorized_equipment
			  				ratio > 0.75
			  			}
			  			stockpile_ratio = { 
			  				archetype = mechanized_equipment
			  				ratio > 0.75
			  			}
			  			stockpile_ratio = { 
			  				archetype = armored_car_equipment
			  				ratio > 0.75
			  			}
					}
				}
			}
		}

		modifier = {
			civilian_factory_use = 1
		}
		
		complete_effect = {
			set_country_flag = BUL_purchasing_military_vehicles_flag
			hidden_effect = {
				#FROM = { #This allows to use FROM.FROM in the event
					HOL = { country_event = bftb_bulgaria_equipment_purchases.2 }
				#}
			}
			SWI = {
				add_offsite_building = {
					type = industrial_complex
					level = 1
				}
				add_opinion_modifier = {
					target = HOL
					modifier = BUL_bought_guns
				}

			}
			add_opinion_modifier = {
				target = SWI
				modifier = BUL_sold_guns
			}
			add_opinion_modifier = {
				target = SWI
				modifier = BUL_arms_trade
			}
			custom_effect_tooltip = BUL_purchase_vehicles_tt
		}
		remove_effect = {
			if = {
				limit = {
					SWI = { has_country_flag = BUL_producing_motorized_for_bulgaria_flag }
				}
				add_equipment_to_stockpile = {
					type = motorized_equipment
					amount = 200
					producer = SWI
				}
				SWI = { clr_country_flag = BUL_producing_motorized_for_bulgaria_flag }
			}
			else_if = {
				limit = {
					SWI = { has_country_flag = BUL_producing_mechanized_for_bulgaria_flag }
				}
				add_equipment_to_stockpile = {
					type = mechanized_equipment
					amount = 200
					producer = SWI
				}
				SWI = { clr_country_flag = BUL_producing_mechanized_for_bulgaria_flag }
			}
			else = {
				add_equipment_to_stockpile = {
					type = armored_car_equipment
					amount = 200
					producer = SWI
				}
				SWI = { clr_country_flag = BUL_producing_armored_car_for_bulgaria_flag }
			}
			SWI = {
				add_offsite_building = {
					type = industrial_complex
					level = -1
				}
			}
			clear_variable = BUL_vehicle_type
			clr_country_flag = BUL_purchasing_military_vehicles_flag
		}
	}

	LAN_purchase_armor = {

		priority = 7

		icon = generic_tank


		allowed = { original_tag = HOL }

		available = {
			SWI = {
				has_opinion = {
					target = ROOT
					value > 0
				}
#				BUL_is_valid_subject = yes
			}
			FROM = { 
				OR = {
					has_tech = basic_light_tank 
					has_tech = basic_light_tank_chassis 
				}
			}
			NOT = { has_country_flag = BUL_purchasing_armor_flag }

			NOT = { has_war_with = SWI }
			NOT = { is_justifying_wargoal_against = SWI }
#			if = {
#				limit = {
#					FROM = { tag = GER }
#				}
#				OR = {
#					is_in_faction_with = GER
#					AND = {
#						BUL_foreign_agreements_in_faction_with_eng = yes
#						BUL_foreign_agreements_in_faction_with_sov = yes
#						BUL_foreign_agreements_in_faction_with_ita = yes
#					}
#				}
#			}
		}

		visible = {
			country_exists = SWI
			NOT = { has_war_with = SWI }
#			FROM = { BUL_is_valid_subject = yes }
		}

		cost = 75
		days_remove = 90
		days_re_enable = 90
		fire_only_once = no

		ai_will_do = {
			factor = 0.1
			modifier = {
				factor = 0
				OR = {
#					NOT = { is_in_faction_with = SWI }
					num_of_civilian_factories < 10
					AND = {
						stockpile_ratio = { 
			  				archetype = light_tank_chassis
			  				ratio > 0.75
			  			}
			  			stockpile_ratio = { 
			  				archetype = medium_tank_chassis
			  				ratio > 0.75
			  			}
			  			stockpile_ratio = { 
			  				archetype = heavy_tank_chassis
			  				ratio > 0.75
			  			}
					}
				}
			}
		}

		modifier = {
			civilian_factory_use = 1
		}
		
		complete_effect = {
			set_country_flag = BUL_purchasing_armor_flag
			hidden_effect = {
				#FROM = { #This allows to use FROM.FROM in the event
					HOL = { country_event = bftb_bulgaria_equipment_purchases.3 }
				#}
			}
			SWI = {
				add_offsite_building = {
					type = industrial_complex
					level = 1
				}
				add_opinion_modifier = {
					target = HOL
					modifier = BUL_bought_guns
				}

			}
			add_opinion_modifier = {
				target = SWI
				modifier = BUL_sold_guns
			}
			add_opinion_modifier = {
				target = SWI
				modifier = BUL_arms_trade
			}
			custom_effect_tooltip = BUL_purchase_armor_tt
		}
		remove_effect = {
			if = {
				limit = {
					SWI = { has_country_flag = BUL_producing_light_armor_for_bulgaria_flag }
				}
				add_equipment_to_stockpile = {
					type = light_tank_equipment
					amount = 150
					producer = SWI
				}
				SWI = { clr_country_flag = BUL_producing_light_armor_for_bulgaria_flag }
			}
			else_if = {
				limit = {
					FROM = { has_country_flag = BUL_producing_medium_armor_for_bulgaria_flag }
				}
				add_equipment_to_stockpile = {
					type = medium_tank_equipment
					amount = 150
					producer = SWI
				}
				SWI = { clr_country_flag = BUL_producing_medium_armor_for_bulgaria_flag }
			}
			else = {
				add_equipment_to_stockpile = {
					type = heavy_tank_equipment
					amount = 150
					producer = SWI
				}
				SWI = { clr_country_flag = BUL_producing_heavy_armor_for_bulgaria_flag }
			}
			SWI = {
				add_offsite_building = {
					type = industrial_complex
					level = -1
				}
			}
			clear_variable = BUL_vehicle_type
			clr_country_flag = BUL_purchasing_armor_flag
		}
	}
}

LAN_tyrion_stories = {
#	piss_in_soup = {

#		icon = generic_political_discourse

#		available = {
#			fascism > 0.1
#		}

#		visible = {
#			NOT = { has_government = fascism }
#		}
		
#		fire_only_once = yes
		
#		cost = 25

#		days_remove = 3
		
#		modifier = {
#			fascism_drift = -0.01
#			political_power_gain = -0.01
#		}
		
#		ai_will_do = {
#			factor = 0
#		}
#	}

	jackass_honeycomb_brothel = {

		icon = generic_army_support

		available = {
#			has_country_flag = military_support_for_fascist_civil_war
		}

		visible = {
#			has_country_flag = preparation_for_fascist_civil_war
#			NOT = { has_government = fascism }
		}
	
		fire_only_once = yes
	
		cost = 2000
		
		complete_effect = {
			country_event = { id = netherlands.9 }
		}
		
		ai_will_do = {
			factor = 0
		}
	}

}

#political_actions = {
	
#	puppet_crownlands = {

#		icon = generic_political_discourse

#	allowed = {
#		original_tag = HOL
#	}

#		visible = {
#			has_government = fascism
#			ENG = { has_idea = ENG_king_edward }
#		}

#		available = {
#  			has_government = fascism
#			HOL = { is_in_faction_with = ENG }
#			ENG = { has_idea = ENG_king_edward }
# 		}
	
#		days_remove = 7
#		cost = 250
		
#		ai_will_do = {
#			factor = 100
#		}

#		complete_effect = {
#			hidden_effect = {
				
#			}
#			custom_effect_tooltip = ban_fascist_party_tt
#		}
#	}
#}