#	Example:
# 
#	example_effect = {
#		add_political_power = 66
#		add_popularity = {
#			ideology = fascism
#			popularity = 0.33
#		}
#	}
#
#
#	In a script file:
#
#	effect = {
#		example_effect = yes
#	}
#

YUG_start_peters_coup = {
	remove_ideas = { king_peter_1 }
	if = {
		limit = {
			has_idea = anti_german_military
		}
		remove_ideas = { anti_german_military }
	}
	hidden_effect = {
		set_country_flag = has_already_decided_yugo_coup_flag
	}
	if = {
		limit = {
			has_completed_focus = YUG_dissolve_serbia
		}
		start_civil_war = { ideology = democratic size = 0.6 capital = 107 states = { 108 803 1411 } }
	}
	else = {
		start_civil_war = { ideology = democratic size = 0.6 capital = 107 states = { 108 803 1411 802 106 1412 105 } }
	}
	random_country = {
		limit = {
			original_tag = YUG
			NOT = { tag = ROOT }
			has_government = democratic
		}
		add_ideas = { king_peter_1 }
		if = {
			limit = {
				PREV = { has_completed_focus = YUG_dissolve_serbia }
			}
			puppet = KOS
			puppet = MNT
			puppet = MAC
		}
		if = {
			limit = {
				PREV = { has_completed_focus = YUG_divide_bosnia }
			}
			puppet = HRZ
		}
		every_other_country = {
			limit = {
				is_subject_of = PREV
			}
			set_country_flag = yugoslav_puppet_flag
			add_to_war = { 
				targeted_alliance = PREV 
				enemy = PREV.PREV
				hostility_reason = asked_to_join
			}
		}
		every_other_country = {
			limit = {
				is_subject_of = PREV.PREV
			}
			set_country_flag = yugoslav_puppet_flag #transfer puppets at the end of the war
			add_to_war = { 
				targeted_alliance = PREV.PREV
				enemy = PREV
				hostility_reason = asked_to_join
			}
		}
		if = {
			limit = {
				PREV = {
					has_cosmetic_tag = SER
				}
			}
			set_cosmetic_tag = SER
		}
		retire_country_leader = yes
		set_popularities = {
			democratic = 50
			neutrality = 40
			fascism = 5
			communism = 5
		}
		set_capital = { state = 107 }
		if = {
			limit = {
				date < 1941.09.06
			}
			YUG_peter_ii = {
				promote_character = { ideology = despotism }
				promote_character = { ideology = conservatism }
			}
		}
		else = {
			YUG_peter_ii = {
				remove_country_leader_trait = {
					ideology = despotism
					trait = underage_monarch
				}
				remove_country_leader_trait = {
					ideology = conservatism
					trait = underage_monarch
				}
				add_country_leader_trait = {
					ideology = despotism
					trait = legitimate_heir
				}
				add_country_leader_trait = {
					ideology = conservatism
					trait = legitimate_heir
				}
				promote_character = { ideology = despotism }
				promote_character = { ideology = conservatism }
			}
			hidden_effect = { 
				set_country_flag = peter_is_of_age
					YUG_peter_ii = {
						set_portraits = {
							civilian = {
						    	large="GFX_portrait_yugoslavia_peter_ii_old"
							}
						}
					}
			}
		}
	}
}