puppet_management = {
	send_puppet_cash = {
		icon = GFX_decision_puppet_cash
		cost = 75
		days_remove = 25
		days_re_enable = 64

		target_root_trigger = {
			num_subjects > 0
		}

		modifier = {
		political_power_gain = -0.25
		}

		complete_effect = {
		if = {
		limit = {
		FROM = { num_of_factories < 1 }
		}
		set_temp_variable = { treasury_change = -5 }
		modify_treasury_effect = yes
		}
		if = {
		limit = {
		FROM = { num_of_factories > 0 }
		FROM = { num_of_factories < 10 }
		}
		set_temp_variable = { treasury_change = -5 }
		modify_treasury_effect = yes
		}
		if = {
		limit = {
		FROM = { num_of_factories > 10 }
		FROM = { num_of_factories < 25 }
		}
		set_temp_variable = { treasury_change = -10 }
		modify_treasury_effect = yes
		}
		if = {
		limit = {
		FROM = { num_of_factories > 25 }
		FROM = { num_of_factories < 50 }
		}
		set_temp_variable = { treasury_change = -15 }
		modify_treasury_effect = yes
		}
		if = {
		limit = {
		FROM = { num_of_factories > 50 }
		FROM = { num_of_factories < 25 }
		}
		set_temp_variable = { treasury_change = -20 }
		modify_treasury_effect = yes
		}
		if = {
		limit = {
		FROM = { num_of_factories > 75 }
		FROM = { num_of_factories < 100 }
		}
		set_temp_variable = { treasury_change = -25 }
		modify_treasury_effect = yes
		}
		if = {
		limit = {
		FROM = { num_of_factories > 100 }
		}
		set_temp_variable = { treasury_change = -30 }
		modify_treasury_effect = yes
			}
		}
		

		visible = {
			is_ai = no
			FROM = {
				is_subject_of = ROOT
				NOT = { has_autonomy_state = autonomy_special_administrative_region_HKG
						has_autonomy_state = autonomy_special_administrative_region_MAC
						has_autonomy_state = autonomy_special_administrative_region_TAI
						has_autonomy_state = autonomy_special_administrative_region_TIB
						has_autonomy_state = autonomy_special_administrative_region_ETK
						has_autonomy_state = autonomy_special_administrative_region_MON	}
			}
		}

		available = {
		}

		target_array = subjects

		remove_effect = {
			log = "[GetDateText]: [This.GetName]: decision send_puppet_cash executed"
			set_temp_variable = { percent_change = 2.5 }
			set_temp_variable = { tag_index = ROOT.id }
			set_temp_variable = { influence_target = FROM.id }
			change_influence_percentage = yes
			FROM = {
				if = {
				limit = {
				FROM = { num_of_factories < 1 }
				}
				set_temp_variable = { treasury_change = 5 }
				modify_treasury_effect = yes
				}
				if = {
				limit = {
				FROM = { num_of_factories > 0 }
				FROM = { num_of_factories < 10 }
				}
				set_temp_variable = { treasury_change = 5 }
				modify_treasury_effect = yes
				}
				if = {
				limit = {
				FROM = { num_of_factories > 10 }
				FROM = { num_of_factories < 25 }
				}
				set_temp_variable = { treasury_change = 10 }
				modify_treasury_effect = yes
				}
				if = {
				limit = {
				FROM = { num_of_factories > 25 }
				FROM = { num_of_factories < 50 }
				}
				set_temp_variable = { treasury_change = 15 }
				modify_treasury_effect = yes
				}
				if = {
				limit = {
				FROM = { num_of_factories > 50 }
				FROM = { num_of_factories < 25 }
				}
				set_temp_variable = { treasury_change = 20 }
				modify_treasury_effect = yes
				}
				if = {
				limit = {
				FROM = { num_of_factories > 75 }
				FROM = { num_of_factories < 100 }
				}
				set_temp_variable = { treasury_change = 25 }
				modify_treasury_effect = yes
				}
				if = {
				limit = {
				FROM = { num_of_factories > 100 }
				}
				set_temp_variable = { treasury_change = 30 }
				modify_treasury_effect = yes
				}
			}
		}
	}
	reduce_puppet_corruption = {
		icon = GFX_decision_puppet_cash_burn
		cost = 100
		days_remove = 30
		days_re_enable = 64

		target_root_trigger = {
			num_subjects > 0
		}

		modifier = {
		political_power_gain = -0.75
		}

		complete_effect = {
		if = {
		limit = {
		FROM = { has_idea = paralyzing_corruption }
		}
		set_temp_variable = { treasury_change = -20 }
		modify_treasury_effect = yes
		add_political_power = -400
		}
		if = {
		limit = {
		FROM = { has_idea = crippling_corruption }
		}
		set_temp_variable = { treasury_change = -15 }
		modify_treasury_effect = yes
		add_political_power = -350
		}
		if = {
		limit = {
		FROM = { has_idea = rampant_corruption }
		}
		set_temp_variable = { treasury_change = -12.5 }
		modify_treasury_effect = yes
		add_political_power = -300
		}
		if = {
		limit = {
		FROM = { has_idea = unrestrained_corruption }
		}
		set_temp_variable = { treasury_change = -10 }
		modify_treasury_effect = yes
		add_political_power = -250
		}
		if = {
		limit = {
		FROM = { has_idea = systematic_corruption }
		}
		set_temp_variable = { treasury_change = -7.5 }
		modify_treasury_effect = yes
		add_political_power = -200
		}
		if = {
		limit = {
		FROM = { has_idea = widespread_corruption }
		}
		set_temp_variable = { treasury_change = -5 }
		modify_treasury_effect = yes
		add_political_power = -150
		}
		if = {
		limit = {
		FROM = { has_idea = medium_corruption }
		}
		set_temp_variable = { treasury_change = -2.5 }
		modify_treasury_effect = yes
		add_political_power = -100
			}
		}
		

		visible = {
			is_ai = no
			FROM = {
				is_subject_of = ROOT
				NOT = { has_idea = modest_corruption
						has_idea = slight_corruption
						has_idea = negligible_corruption
						has_autonomy_state = autonomy_special_administrative_region_HKG
						has_autonomy_state = autonomy_special_administrative_region_MAC
						has_autonomy_state = autonomy_special_administrative_region_TAI
						has_autonomy_state = autonomy_special_administrative_region_TIB
						has_autonomy_state = autonomy_special_administrative_region_ETK
						has_autonomy_state = autonomy_special_administrative_region_MON	}
			}
		}

		available = {
		FROM = {
				influence_higher_2point5 = yes
			}
		if = {
		limit = {
		FROM = { has_idea = paralyzing_corruption }
		}
		has_political_power > 400
		}
		if = {
		limit = {
		FROM = { has_idea = crippling_corruption }
		}
		has_political_power > 350
		}
		if = {
		limit = {
		FROM = { has_idea = rampant_corruption }
		}
		has_political_power > 300
		}
		if = {
		limit = {
		FROM = { has_idea = unrestrained_corruption }
		}
		has_political_power > 250
		}
		if = {
		limit = {
		FROM = { has_idea = systematic_corruption }
		}
		has_political_power > 200
		}
		if = {
		limit = {
		FROM = { has_idea = widespread_corruption }
		}
		has_political_power > 150
		}
		if = {
		limit = {
		FROM = { has_idea = medium_corruption }
		}
		has_political_power > 100
			}
		}

		target_array = subjects

		remove_effect = {
			log = "[GetDateText]: [This.GetName]: decision send_puppet_cash executed"
			set_temp_variable = { percent_change = -2.5 }
			set_temp_variable = { tag_index = ROOT.id }
			set_temp_variable = { influence_target = FROM.id }
			change_influence_percentage = yes
			FROM = {
				if = {
					limit = {
					FROM = { has_idea = paralyzing_corruption }
					}
					swap_ideas = {
    					remove_idea = paralyzing_corruption
    					add_idea = crippling_corruption
						}
					}
					if = {
					limit = {
					FROM = { has_idea = crippling_corruption }
					}
					swap_ideas = {
    					remove_idea = crippling_corruption
    					add_idea = rampant_corruption
						}
					}
					if = {
					limit = {
					FROM = { has_idea = rampant_corruption }
					}
					swap_ideas = {
    					remove_idea = rampant_corruption
    					add_idea = unrestrained_corruption
						}
					}
					if = {
					limit = {
					FROM = { has_idea = unrestrained_corruption }
					}
					swap_ideas = {
    					remove_idea = unrestrained_corruption
    					add_idea = systematic_corruption
						}
					}
					if = {
					limit = {
					FROM = { has_idea = systematic_corruption }
					}
					swap_ideas = {
    					remove_idea = systematic_corruption
    					add_idea = widespread_corruption
						}
					}
					if = {
					limit = {
					FROM = { has_idea = widespread_corruption }
					}
					swap_ideas = {
    					remove_idea = widespread_corruption
    					add_idea = medium_corruption
						}
					}
					if = {
					limit = {
					FROM = { has_idea = medium_corruption }
					}
					swap_ideas = {
    					remove_idea = medium_corruption
    					add_idea = slight_corruption
					}
				}
			}
		}
	}
	increase_puppet_ideology = {
		icon = GFX_decision_puppetup_button
		cost = 75
		days_remove = 25
		days_re_enable = 30

		target_root_trigger = {
			num_subjects > 0
		}

		modifier = {
		political_power_gain = -1
		}

		complete_effect = {
    	if = { limit = { ROOT = { has_government = democratic } 
    			}
    		FROM = { add_timed_idea = {
    				idea = minor_western_influence_PM
    				days = 25
					}
				}
    		}
    	if = { limit = { ROOT = { has_government = communism } 
    			}
    		FROM = { add_timed_idea = {
    				idea = minor_emerging_influence_PM
    				days = 25
					}
				}
    		}
    	if = { limit = { ROOT = { has_government = neutrality } 
    			}
    		FROM = { add_timed_idea = {
    				idea = minor_nonaligned_influence_PM
    				days = 25
					}
				}
    		}
    	if = { limit = { ROOT = { has_government = nationalist } 
    			}
    		FROM = { add_timed_idea = {
    				idea = minor_nationalist_influence_PM
    				days = 25
					}
				}
    		}
    	if = { limit = { ROOT = { has_government = fascism } 
    			}
    		FROM = { add_timed_idea = {
    				idea = minor_salafist_influence_PM
    				days = 25
					}
				}
    		}
		}
		

		visible = {
			is_ai = no
			FROM = {
				is_subject_of = ROOT
				NOT = { has_autonomy_state = autonomy_special_administrative_region_HKG
						has_autonomy_state = autonomy_special_administrative_region_MAC
						has_autonomy_state = autonomy_special_administrative_region_TAI
						has_autonomy_state = autonomy_special_administrative_region_TIB
						has_autonomy_state = autonomy_special_administrative_region_ETK
						has_autonomy_state = autonomy_special_administrative_region_MON	}
			}
		}

		available = {
			FROM = {
				influence_higher_5 = yes
			}
		}

		target_array = subjects

		remove_effect = {
			log = "[GetDateText]: [This.GetName]: decision increase_puppet_ideology executed"
			set_temp_variable = { percent_change = -5 }
			set_temp_variable = { tag_index = ROOT.id }
			set_temp_variable = { influence_target = FROM.id }
			change_influence_percentage = yes
			FROM = {
				add_popularity = {
    			ideology = ROOT
    			popularity = 0.05
				}
			}
		}
	}

	change_puppet_ideology = {
		icon = GFX_decision_puppet_fist
		cost = 100
		days_remove = 30
		days_re_enable = 100

		target_root_trigger = {
			num_subjects > 0
		}

		modifier = {
		political_power_gain = -1.5
		}

		complete_effect = {
		}
		

		visible = {
			FROM = {
				NOT = { has_government = ROOT}
				}
			FROM = {
				is_subject_of = ROOT
				NOT = { has_autonomy_state = autonomy_special_administrative_region_HKG
						has_autonomy_state = autonomy_special_administrative_region_MAC
						has_autonomy_state = autonomy_special_administrative_region_TAI
						has_autonomy_state = autonomy_special_administrative_region_TIB
						has_autonomy_state = autonomy_special_administrative_region_ETK
						has_autonomy_state = autonomy_special_administrative_region_MON	}
			}
		}

		available = {
			or = {
			has_elections = no
			FROM = { has_elections = no }
			}
			FROM = {
				influence_higher_15 = yes
			}
			if = { limit = { ROOT = { has_government = democratic } 
    			}
    		FROM = { democratic > 0.20
				}
    		}
    	if = { limit = { ROOT = { has_government = communism } 
    			}
    		FROM = { communism > 0.20
				}
    		}
    	if = { limit = { ROOT = { has_government = neutrality } 
    			}
    		FROM = { neutrality > 0.20
				}
    		}
    	if = { limit = { ROOT = { has_government = nationalist } 
    			}
    		FROM = { nationalist > 0.20
				}
    		}
    	if = { limit = { ROOT = { has_government = fascism } 
    			}
    		FROM = { fascism > 0.20
				}
    		}
		}

		target_array = subjects

		remove_effect = {
			log = "[GetDateText]: [This.GetName]: decision change_puppet_ideology executed"
			set_temp_variable = { percent_change = -15 }
			set_temp_variable = { tag_index = ROOT.id }
			set_temp_variable = { influence_target = FROM.id }
			change_influence_percentage = yes
			if = { limit = { 
						 ROOT = { has_elections = no }
						 FROM = { has_elections = yes }
    			}
    			FROM = {
    			set_politics = { 
    			ruling_party = ROOT
    			elections_allowed = yes
    				}
    			}
    		}
    		if = { limit = { 
						 ROOT = { has_elections = yes }
						 FROM = { has_elections = no }
    			}
    			FROM = {
    			set_politics = { 
    			ruling_party = ROOT
    			elections_allowed = yes
    				}
    			}
    		}
    		if = { limit = { 
						 ROOT = { has_elections = yes }
						 FROM = { has_elections = yes }
    			}
    			FROM = {
    			set_politics = { 
    			ruling_party = ROOT
    			elections_allowed = yes
    				}
    			}
    		}
    		if = { limit = {
						 ROOT = { has_elections = no }
						 FROM = { has_elections = no }
    			}
    			FROM = {
    			set_politics = { 
    			ruling_party = ROOT
    			elections_allowed = yes
    				}
    			}
    		}
		}
	}

	increase_puppet_stability = {	
		icon = GFX_decision_puppet_stability
		cost = 75
		days_remove = 25
		days_re_enable = 42

		target_root_trigger = {
			num_subjects > 0
		}

		modifier = {
		political_power_gain = -1
		}

		complete_effect = {
		if = { limit = { 
						 FROM = { has_stability < 0.75 }
						 FROM = { has_stability > 0.50 }
    			}
				set_temp_variable = { treasury_change = -3.5 }
				modify_treasury_effect = yes
    		}
    	if = { limit = { FROM = { has_stability < 0.50 }
						 FROM = { has_stability > 0.25 }
    			}
				set_temp_variable = { treasury_change = -5 }
				modify_treasury_effect = yes
    		}
    	if = { limit = { FROM = { has_stability < 0.25 }
						 FROM = { has_stability > 0 }
    			}
				set_temp_variable = { treasury_change = -10 }
				modify_treasury_effect = yes
    		}
		}
		

		visible = {
			is_ai = no
			FROM = {
				is_subject_of = ROOT
				has_stability < 0.75
				NOT = { has_autonomy_state = autonomy_special_administrative_region_HKG
						has_autonomy_state = autonomy_special_administrative_region_MAC
						has_autonomy_state = autonomy_special_administrative_region_TAI
						has_autonomy_state = autonomy_special_administrative_region_TIB
						has_autonomy_state = autonomy_special_administrative_region_ETK
						has_autonomy_state = autonomy_special_administrative_region_MON	}
			}
		}

		available = {
			FROM = {
				has_stability < 0.75
				influence_higher_5 = yes
			}
		}

		target_array = subjects

		remove_effect = {
			log = "[GetDateText]: [This.GetName]: decision increase_puppet_stability executed"
			set_temp_variable = { percent_change = -5 }
			set_temp_variable = { tag_index = ROOT.id }
			set_temp_variable = { influence_target = FROM.id }
			change_influence_percentage = yes
			if = { limit = { 
				FROM = { has_stability < 0.25 }
				FROM = { has_stability > 0 }
    			}
				add_stability = 0.05
    		}
    		if = { limit = { 
    		FROM = { has_stability < 0.50 }
			FROM = { has_stability > 0.25 }
    			}
				add_stability = 0.035
    		}
    		if = { limit = { 
    		FROM = { has_stability < 0.75 }
			FROM = { has_stability > 0.50 }
    			}
				add_stability = 0.025
    		}
    	}
	}
}
