###############################
# Pop Faction Events
# by Maximilian Olbers
###############################

namespace = faction

@tier1researchreward = 6
@tier2researchreward = 12
@tier3researchreward = 18
@tier4researchreward = 24
@tier1materialreward = 6
@tier2materialreward = 12
@tier3materialreward = 18
@tier4materialreward = 24
@tier1influencereward = 3
@tier2influencereward = 6
@tier3influencereward = 9
@tier4influencereward = 12


#########################
# Slave Faction and general events
# id 000
#########################

# Pop enslaved - create faction, force pop to evaluate
pop_event = {
	id = faction.1
	hide_window = yes
	is_triggered_only = yes

	trigger = {
		NOT = {
			is_species = "ROBOT_POP_SPECIES_1"
			is_species = "ROBOT_POP_SPECIES_2"
			is_species = "ROBOT_POP_SPECIES_3"
		}
	}

	immediate = {
		owner = {
			if = {
				limit = {
					count_pop_factions = {
						limit = { is_pop_faction_type = slave }
						count < 1
					}
				}
				create_pop_faction = {
					type = slave
					pop = root
				}
			}
		}
	}
}

# Pop emancipated or purged - force pop to evaluate
pop_event = {
	id = faction.2
	hide_window = yes

	is_triggered_only = yes

	immediate = {
		force_faction_evaluation = this
		if = {
			limit = {
				is_enslaved = no
				has_modifier = 6_hour_workday
			}
			remove_modifier = 6_hour_workday
		}
	}
}

#########################
# Planet Separatist Faction
# id 100
#########################

# Planet Separatists rebel
pop_faction_event = {
	id = faction.100
	title = faction.100.title
	desc = faction.100.desc
	picture = GFX_evt_galactic_senate
	show_sound = event_planetary_riot
	location = event_target:planet

	is_triggered_only = yes

	option = {
		name = UNFORTUNATE
	}
}

# Planet Separatists Sabotage
pop_faction_event = {
	id = faction.101
	title = faction.101.title
	desc = faction.101.desc
	picture = GFX_evt_burning_settlement
	show_sound = event_planetary_riot
	location = event_target:planet

	is_triggered_only = yes

	option = {
		name = UNFORTUNATE
	}
}

# Leader Assassinated
#pop_faction_event = {
#	id = faction.102
#	title = faction.102.title
#	desc = faction.102.desc
#	picture = GFX_evt_smugglers_in_bar
#	show_sound = event_cityscape
#
#	is_triggered_only = yes
#
#	option = {
#		name = OK
#		leader = {
#			kill_leader = {
#				type = governor
#				show_notification = no
#			}
#		}
#	}
#}


######################
# Nationalist Faction
# id 300
######################

# Nationalists sabotage
pop_faction_event = {
	id = faction.301
	title = faction.301.title
	desc = faction.301.desc
	picture = GFX_evt_burning_settlement
	show_sound = event_planetary_riot
	location = event_target:planet

	is_triggered_only = yes

	option = {
		name = UNFORTUNATE
	}
}

# Nationalists Rebels
pop_faction_event = {
	id = faction.302
	title = faction.302.title
	desc = faction.302.desc
	picture = GFX_evt_burning_settlement
	show_sound = event_planetary_riot
	location = root

	is_triggered_only = yes

	option = {
		name = UNFORTUNATE
	}
}

######################
# Purged Faction
# id 800
######################

pop_event = {
	id = faction.800
	hide_window = yes
	is_triggered_only = yes

	immediate = {
		owner = {
			if = {
				limit = {
					root = { NOT = { has_modifier = hunger_strike } }
					count_pop_factions = {
						limit = { is_pop_faction_type = purged }
						count < 1
					}
				}
				create_pop_faction = {
					type = purged
					pop = root
				}
			}
		}
	}
}