##############################
# 殖民地事件修改
##############################

namespace = colony

@tier1influencereward = 6
@tier1influencemin = 40
@tier1influencemax = 100
@tier2influencereward = 12
@tier2influencemin = 80
@tier2influencemax = 175
@tier3influencereward = 18
@tier3influencemin = 125
@tier3influencemax = 250
@tier4influencereward = 24
@tier4influencemin = 150
@tier4influencemax = 300
@tier5influencereward = 36
@tier5influencemin = 250
@tier5influencemax = 500
@tier6influencereward = 48
@tier6influencemin = 300
@tier6influencemax = 600

#Assassination殖民地刺杀事件
planet_event = {
	id = colony.2030
	title = colony.2030.name

	desc = {
	   trigger = {
	      hidden:leader = {
	         switch = {  
	           trigger = has_leader_flag
	           f_chenqian = { text = colony.2030.desc.chenqian }
	           f_linxue = { text = colony.2030.desc.linxue }
	           f_shanduola = { text = colony.2030.desc.shanduola } 
	        }       
	      }
	   }
	}
	
	desc = {
	   text = colony.2030.desc.phobe
	   trigger = {
	      leader = { NOT = { has_leader_flag = f_npc } }
	      owner = { 
	         OR = {
	             has_ethic = ethic_fanatic_xenophobe
	             has_ethic = ethic_xenophobe
	         }   
	      }
	   }
	}
	desc = {
	   text = colony.2030.desc.spirit
	   trigger = {
	      leader = { NOT = { has_leader_flag = f_npc } }
	      owner = { 
	         OR = {
	             has_ethic = ethic_fanatic_spiritualist
	             has_ethic = ethic_spiritualist
	         }   
	      }
	   }
	}
	desc = {
	   text = colony.2030.desc.military
	   trigger = {
	      leader = { NOT = { has_leader_flag = f_npc } }
	      owner = { 
	         OR = {
	             has_ethic = ethic_fanatic_militarist
	             has_ethic = ethic_militarist
	         }   
	      }
	   }
	}
	desc = {
	   text = colony.2030.desc
	   trigger = {
	      leader = { NOT = { has_leader_flag = f_npc } }
	      owner = { 
	         NOR = {
	             has_ethic = ethic_fanatic_xenophobe
	             has_ethic = ethic_xenophobe
	             has_ethic = ethic_fanatic_spiritualist
	             has_ethic = ethic_spiritualist
	             has_ethic = ethic_fanatic_militarist
	             has_ethic = ethic_militarist
	         }   
	      }
	   }
	}
	
	
	picture = GFX_evt_smugglers_in_bar
	show_sound = event_mystic_reveal
	location = root

	trigger = {
		has_owner = yes
		original_owner = yes
		is_homeworld = no
		owner = {
			NOT = { 
				has_country_flag = colony_assassin
				has_authority = auth_machine_intelligence
			}
			is_ai = no
			any_country = {
				is_ai = yes
				is_country_type = default
				has_communications = prev
				their_opinion = {
					who = prev
					value < -50
				}
				root = {
					owner = {
						has_communications = prevprev
					}
				}
			}
		}
		num_pops > 4
		has_ground_combat = no
		is_occupied_flag = no
		exists = leader
		is_capital = no
		NOR = {
			has_planet_flag = colony_event
			is_planet_class = pc_habitat
		}
	}

	is_triggered_only = yes
	#mean_time_to_happen = {
	#	months = 40
	#}

	immediate = {
		set_planet_flag = colony_event
		owner = {
			set_country_flag = colony_assassin
			save_event_target_as = MyCountry
			random_country = {
				limit = {
					is_ai = yes
					is_country_type = default
					has_communications = prev
					their_opinion = {
						who = prev
						value < -50
					}
					root = {
						owner = {
							has_communications = prevprev
						}
					}
				}
				save_event_target_as = AssassinEmpire
			}
		}
		leader = {
		  if = {
		     limit = { NOT = { has_leader_flag = f_npc}}
		     kill_leader = { type = governor show_notification = no}
		  }			
		}
		#若是希灵帝国遭遇刺杀，则希灵帝国获得宣战理由
		if = {
				limit = { owner = { has_country_flag = f_xilin_empire } }
				event_target:AssassinEmpire = {
				   set_country_flag = f_insult_xilin
				}
		}
	}

	option = {
		name = colony.2030.a
		custom_tooltip = colony.2030.a.tooltip
		trigger = {
			owner = {
				OR = {
					has_ethic = ethic_fanatic_pacifist
					has_ethic = ethic_pacifist
				}
			}
		}
		hidden_effect = {
			event_target:AssassinEmpire = {
				add_opinion_modifier = {
					who = event_target:MyCountry
					modifier = assassination_forgiven
				}
			}
		}
	}
	option = {
		name = colony.2030.b
		owner = {
			add_monthly_resource_mult = {
				resource = influence
				value = @tier3influencereward
				min = @tier3influencemin
				max = @tier3influencemax
			}
		}
	}
	option = {
		name = colony.2030.c
		trigger = {
			owner = {
				influence > 49
				NOT = {
					has_ethic = ethic_fanatic_militarist
					has_ethic = ethic_militarist
					has_ethic = ethic_pacifist
					has_ethic = ethic_fanatic_pacifist
				}
			}
		}
		owner = { add_influence = -50 }
		add_modifier = {
			modifier = fear_as_control
			days = 3600
		}
	}
	option = {
		name = colony.2030.d
		trigger = {
			owner = {
				influence > 49
				OR = {
					has_ethic = ethic_fanatic_militarist
					has_ethic = ethic_militarist
				}
			}
		}
		owner = {
			add_influence = -50
			add_modifier = {
				modifier = fear_as_control_militarist_p2
				days = 3600
			}
		}
		add_modifier = {
			modifier = fear_as_control_militarist
			days = 3600
		}
	}
}
