foreign_influence = {

	nation_building = {

		icon = eng_propaganda_campaigns

		available = {
			FROM = {
				is_puppet_of = ROOT
			}
			FROM = {
				democratic < 0.9
			}
			OR = {
				political_power_daily > 0.5
				has_political_power > 60
			}
		}

		target_array = subjects

		target_trigger = {
			FROM = {
				is_puppet_of = ROOT
			}
		}

		visible = {
			has_government = democratic
			FROM = {
				is_puppet_of = ROOT
				democratic < 0.99
			}
		}

		modifier = {
			political_power_cost = 0.5
		}

		days_remove = 120

		complete_effect = {
			FROM = { add_timed_idea = { idea = nation_building days = 120 } }
		}

		ai_will_do = {
			factor = 0
		}
	}

	socialist_education = {

		icon = eng_propaganda_campaigns

		available = {
			FROM = {
				is_puppet_of = ROOT
			}
			FROM = {
				communism < 0.9
			}
			OR = {
				political_power_daily > 0.5
				has_political_power > 60
			}
		}

		target_array = subjects

		target_trigger = {
			FROM = {
				is_puppet_of = ROOT
			}
		}

		visible = {
			has_government = communism
			FROM = {
				is_puppet_of = ROOT
				communism < 0.99
			}
		}

		modifier = {
			political_power_cost = 0.5
		}

		days_remove = 120

		complete_effect = {
			FROM = {
				add_timed_idea = { idea = socialist_education days = 120 }
			}
		}

		ai_will_do = {
			factor = 0
		}
	}

	paramilitary_training = {

		icon = eng_propaganda_campaigns

		available = {
			FROM = {
				is_puppet_of = ROOT
			}
			FROM = {
				fascism < 0.9
			}
			OR = {
				political_power_daily > 0.5
				has_political_power > 60
			}
		}

		target_array = subjects

		target_trigger = {
			FROM = {
				is_puppet_of = ROOT
			}
		}

		visible = {
			has_government = fascism
			FROM = {
				is_puppet_of = ROOT
				fascism < 0.99
			}
		}

		modifier = {
			political_power_cost = 0.5
		}

		days_remove = 120

		complete_effect = {
			FROM = {
				add_timed_idea = { idea = paramilitary_training days = 120 }
			}
		}

		ai_will_do = {
			factor = 0
		}
	}

	military_parade = {

		icon = eng_propaganda_campaigns

		available = {
			FROM = {
				is_puppet_of = ROOT
				neutrality < 0.9
			}
			OR = {
				political_power_daily > 0.5
				has_political_power > 60
			}
		}

		target_array = subjects

		target_trigger = {
			FROM = {
				is_puppet_of = ROOT
			}
		}

		visible = {
			has_government = neutrality
			FROM = {
				is_puppet_of = ROOT
				neutrality < 0.99
			}
		}

		modifier = {
			political_power_cost = 0.5
		}

		days_remove = 120

		complete_effect = {
			FROM = {
				add_timed_idea = { idea = military_parade days = 120 }
			}
		}

		ai_will_do = {
			factor = 0
		}
	}

	police_action = {

		icon = generic_prepare_civil_war

		available = {
			FROM = {
				is_puppet_of = ROOT
			}
			FROM = {
				democratic > 0.6
			}
			FROM = {
				NOT = { has_government = democratic }
			}
		}

		target_array = subjects

		target_trigger = {
			FROM = {
				is_puppet_of = ROOT
			}
		}

		visible = {
			has_government = democratic
			FROM = {
				is_puppet_of = ROOT
				NOT = { has_government = democratic }
			}
		}

		cost = 50

		complete_effect = {
			FROM = { country_event = { id = mtg_generic.1 } }
			FROM = {
				add_timed_idea = {
					idea = political_turmoil
					days = 365
				}
			}
			FROM = {
				set_politics = {
					ruling_party = democratic
					elections_allowed = yes
				}
			}
		}

		ai_will_do = {
			factor = 0
		}
	}

	fraternal_republic = {

		icon = generic_prepare_civil_war

		available = {
			FROM = {
				is_puppet_of = ROOT
			}
			FROM = {
				communism > 0.6
			}
			FROM = {
				NOT = { has_government = communism }
			}
		}

		target_array = subjects

		target_trigger = {
			FROM = {
				is_puppet_of = ROOT
			}
		}

		visible = {
			has_government = communism
			FROM = {
				is_puppet_of = ROOT
				NOT = { has_government = communism }
			}
		}

		cost = 50

		complete_effect = {
			FROM = { country_event = { id = mtg_generic.1 } }
			FROM = {
				add_timed_idea = {
					idea = political_turmoil
					days = 365
				}
			}
			FROM = {
				set_politics = {
					ruling_party = communism
					elections_allowed = no
				}
			}
		}

		ai_will_do = {
			factor = 0
		}
	}

	ultranationalist_coup = {

		icon = generic_prepare_civil_war

		available = {
			FROM = {
				is_puppet_of = ROOT
			}
			FROM = {
				fascism > 0.6
			}
			FROM = {
				NOT = { has_government = fascism }
			}
		}

		target_array = subjects

		target_trigger = {
			FROM = {
				is_puppet_of = ROOT
			}
		}

		visible = {
			has_government = fascism
			FROM = {
				is_puppet_of = ROOT
				NOT = { has_government = fascism }
			}
		}

		cost = 50

		complete_effect = {
			FROM = { country_event = { id = mtg_generic.1 } }
			FROM = {
				add_timed_idea = {
					idea = political_turmoil
					days = 365
				}
			}
			FROM = {
				set_politics = {
					ruling_party = fascism
					elections_allowed = no
				}
			}
		}

		ai_will_do = {
			factor = 0
		}
	}

	military_dictatorship = {

		icon = generic_prepare_civil_war

		available = {
			FROM = {
				is_puppet_of = ROOT
			}
			FROM = {
				neutrality > 0.6
			}
			FROM = {
				NOT = { has_government = neutrality }
			}
		}

		target_array = subjects

		target_trigger = {
			FROM = {
				is_puppet_of = ROOT
			}
		}

		visible = {
			has_government = neutrality
			FROM = {
				is_puppet_of = ROOT
				NOT = { has_government = neutrality }
			}
		}

		cost = 50

		complete_effect = {
			FROM = { country_event = { id = mtg_generic.1 } }
			FROM = {
				add_timed_idea = {
					idea = political_turmoil
					days = 365
				}
			}
			FROM = {
				set_politics = {
					ruling_party = neutrality
					elections_allowed = no
				}
			}
		}

		ai_will_do = {
			factor = 0
		}
	}

	instantiate_collaboration = {

		icon = generic_prepare_civil_war

		available = {
			has_core_occupation_modifier = {
				occupied_country_tag = FROM
				modifier = compliance_80
			}
		}

		target_non_existing = yes

		target_array = occupied_countries

		visible = {
			has_rule = can_create_collaboration_government
			is_available_to_collaboration_government = yes
			has_core_occupation_modifier = {
				occupied_country_tag = FROM
				modifier = compliance_60
			}
        }

		cost = 0

		complete_effect = {
			set_temp_variable = { country_to_initiate = FROM }
			instantiate_collaboration_government = yes
		}

		ai_will_do = {
			base = 10
			# priotize larger countries

			modifier = {
				# neutrals won't do collaboration until 1944 and they are at peace

				has_government = neutrality

				OR = {
					has_war = yes
					date < 1944.01.01
				}

				factor = 0
			}

			modifier = {
				# calculating cores we control
				set_temp_variable = { num_cores_we_control = 0 }
				all_of_scopes = {
					array = FROM.core_states

					if = {
						limit = { is_controlled_by = PREV }
						add_to_temp_variable = { num_cores_we_control = 1 }
					}
				}

				# more score if more cores are controlled by us
				add = num_cores_we_control
			}

			# dont make too many collaboratios
			modifier = {
				# as number of collaboration subjects increases
				# only accept subjects with more cores
				set_temp_variable = { num_min_cores = 1.5 }
				all_of_scopes = {
					array = subjects
					if = {
						limit = {
							has_autonomy_state = autonomy_collaboration_government
						}
						add_to_temp_variable = { num_min_cores = 0.7 }
					}
				}

				check_variable = { num_cores_we_control < num_min_cores }

				factor = 0
			}
		}
	}

	absolutist_military_parade = {

		icon = eng_propaganda_campaigns

		available = {
			FROM = {
				is_puppet_of = ROOT
			}
			FROM = {
				absolutist < 0.9
			}
			OR = {
				political_power_daily > 0.5
				has_political_power > 60
			}
		}

		target_array = subjects

		target_trigger = {
			FROM = {
				is_puppet_of = ROOT
			}
		}

		visible = {
			has_government = absolutist
			FROM = {
				is_puppet_of = ROOT
				absolutist < 0.99
			}
		}

		modifier = {
			political_power_cost = 0.5
		}

		days_remove = 120

		complete_effect = {
			FROM = { add_timed_idea = { idea = absolutist_military_parade days = 120 } }
		}

		ai_will_do = {
			factor = 0
		}
	}

	committee_of_public_safety = {

		icon = eng_propaganda_campaigns

		available = {
			FROM = {
				is_puppet_of = ROOT
			}
			FROM = {
				radical < 0.9
			}
			OR = {
				political_power_daily > 0.5
				has_political_power > 60
			}
		}

		target_array = subjects

		target_trigger = {
			FROM = {
				is_puppet_of = ROOT
			}
		}

		visible = {
			has_government = radical
			FROM = {
				is_puppet_of = ROOT
				radical < 0.99
			}
		}

		modifier = {
			political_power_cost = 0.5
		}

		days_remove = 120

		complete_effect = {
			FROM = {
				add_timed_idea = { idea = committee_of_public_safety days = 120 }
			}
		}

		ai_will_do = {
			factor = 0
		}
	}

	dictatorship_decision = {

		icon = generic_prepare_civil_war

		available = {
			FROM = {
				is_puppet_of = ROOT
			}
			FROM = {
				democratic > 0.6
			}
			FROM = {
				NOT = { has_government = absolutist }
			}
		}

		target_array = subjects

		target_trigger = {
			FROM = {
				is_puppet_of = ROOT
			}
		}

		visible = {
			has_government = absolutist
			FROM = {
				is_puppet_of = ROOT
				NOT = { has_government = absolutist }
			}
		}

		cost = 50

		complete_effect = {
			FROM = { country_event = { id = mtg_generic.1 } }
			FROM = {
				add_timed_idea = {
					idea = political_turmoil
					days = 365
				}
			}
			FROM = {
				set_politics = {
					ruling_party = absolutist
					elections_allowed = yes
				}
			}
		}

		ai_will_do = {
			factor = 0
		}
	}

	national_convention = {

		icon = generic_prepare_civil_war

		available = {
			FROM = {
				is_puppet_of = ROOT
			}
			FROM = {
				communism > 0.6
			}
			FROM = {
				NOT = { has_government = radical }
			}
		}

		target_array = subjects

		target_trigger = {
			FROM = {
				is_puppet_of = ROOT
			}
		}

		visible = {
			has_government = radical
			FROM = {
				is_puppet_of = ROOT
				NOT = { has_government = radical }
			}
		}

		cost = 50

		complete_effect = {
			FROM = { country_event = { id = mtg_generic.1 } }
			FROM = {
				add_timed_idea = {
					idea = political_turmoil
					days = 365
				}
			}
			FROM = {
				set_politics = {
					ruling_party = radical
					elections_allowed = no
				}
			}
		}

		ai_will_do = {
			factor = 0
		}
	}
}

