﻿
# Events related to puppets which differ from their master's ideology

add_namespace = deluge_puppets

# Puppet gets asked to conform, ignore the issue or try to break free

country_event = {
	id = deluge_puppets.1
	title = deluge_puppets1title
	desc = deluge_puppets1desc
	
	picture = GFX_deluge_militia
	
	trigger = {
		OR = {
			is_subject = yes
			is_subject = yes
		}
		any_other_country = {
			ROOT = {
				is_subject_of = PREV
			}
			is_same_or_close_ideology = no
		}
		NOT = {
			has_country_flag = flag_puppet_master_ideology_differences_resolved
		}
	}
	
	mean_time_to_happen = {
		months = 2
	}
	
	option = {
		name = deluge_puppets1opta
				
		every_country = {
			limit = {
				ROOT = {
					is_subject_of = PREV
				}
			}
			country_event = deluge_puppets.2
			end_puppet = ROOT
			remove_from_faction = ROOT
		}
		
		drop_cosmetic_tag = yes
		
		ai_chance = {
			factor = 1
			
			modifier = {
				has_autonomy_state = autonomy_dominion
				factor = 2
			}
			modifier = {
				is_major = yes
				factor = 2
			}
			modifier = {
				is_historical_focus_on = yes
				factor = 2
			}
		}
	}
	option = {
		name = deluge_puppets1optb
		
		if = {
			limit = {
				any_other_country = {
					ROOT = {
						is_subject_of = PREV
					}
					has_government = communism
				}
			}
			set_politics = {
				ruling_party = communism
				elections_allowed = no
			}
		}
		if = {
			limit = {
				any_other_country = {
					ROOT = {
						is_subject_of = PREV
					}
					has_government = democratic
				}
			}
			set_politics = {
				ruling_party = democratic
				elections_allowed = no
			}
		}
		if = {
			limit = {
				any_other_country = {
					ROOT = {
						is_subject_of = PREV
					}
					has_government = neutrality
				}
			}
			set_politics = {
				ruling_party = neutrality
				elections_allowed = no
			}
		}
		if = {
			limit = {
				any_other_country = {
					ROOT = {
						is_subject_of = PREV
					}
					has_government = fascism
				}
			}
			set_politics = {
				ruling_party = fascism
				elections_allowed = no
			}
		}
		
		ai_chance = {
			factor = 1
			
			modifier = {
				has_autonomy_state = autonomy_integrated_puppet
				factor = 4
			}
			modifier = {
				has_autonomy_state = autonomy_puppet
				factor = 2
			}
			modifier = {
				has_government = democratic
				factor = 2
			}
			modifier = {
				any_other_country = {
					ROOT = {
						is_subject_of = PREV
					}
					is_major = yes
				}
				factor = 2
			}
		}
	}
	option = {
		name = deluge_puppets1optc
		
		set_country_flag = flag_puppet_master_ideology_differences_resolved
		
		ai_chance = {
			factor = 0
		}
	}
}

# Master is informed the puppet is trying to break free and can either let them go or declare war

country_event = {
	id = deluge_puppets.2
	title = deluge_puppets2title
	desc = deluge_puppets2desc
	
	picture = GFX_deluge_militia
	
	is_triggered_only = yes	
	
	option = {
		name = deluge_puppets2opta
				
		declare_war_on = {
			target = FROM
			type = puppet_wargoal_focus
		}
		
		ai_chance = {
			factor = 1
			
			modifier = {
				is_major = yes
				factor = 2
			}
			modifier = {
				is_historical_focus_on = yes
				factor = 2
			}
		}
	}
	option = {
		name = deluge_puppets2optb
		
		add_political_power = 50
		
		ai_chance = {
			factor = 1
			
			modifier = {
				FROM = {
					is_major = yes
				}
				factor = 2
			}
			modifier = {
				has_war = yes
				factor = 2
			}
			modifier = {
				has_government = democratic
				factor = 2
			}
		}
	}
}
	
		