﻿# UN Vote mechanism
add_namespace = UNSC

country_event = {
	id = UNSC.1
	title = UNSC.1.t
	desc = UNSC.1.d
	
	is_triggered_only = yes

	immediate = { }
	
	option = {
		name = UNSC.1.a
		log = "[GetDateText]: [This.GetName]: UNSC.1.a executed"
		set_global_flag = { flag = UNSC_vote value = 6 }
		every_country = { 
				limit = { 
					has_idea = p5_member
				}
			hidden_effect = { country_event = { id = UNSC.2 hours = 6 } }		
		}
		hidden_effect = { news_event = { id = UNSC.3 days = 3 } }
	}
}
#Voting
country_event = {
	id = UNSC.2
	title = UNSC.2.t
	desc = UNSC.2.d
	
	is_triggered_only = yes

	immediate = { }
	
	#yes
	option = {
		name = UNSC.2.a
		log = "[GetDateText]: [This.GetName]: UNSC.2.a executed"
		ai_chance = { factor = 40 }
		set_country_flag = UNSC_voted_yes
		modify_global_flag = {
			flag = UNSC_vote
			value = 1
		}
	}
	#no
	option = {
		name = UNSC.2.b
		log = "[GetDateText]: [This.GetName]: UNSC.2.b executed"
		ai_chance = { factor = 40 }
		set_country_flag = UNSC_voted_no
		modify_global_flag = {
			flag = UNSC_vote
			value = -1
		}
	}
	#abstain
	option = {
		name = UNSC.2.c
		log = "[GetDateText]: [This.GetName]: UNSC.2.c executed"
		ai_chance = { factor = 20 }
		set_country_flag = UNSC_abstained
	}
}

news_event = {
	
	id = UNSC.3
	title = UNSC.3.t
	desc = UNSC.3.d
	
	major = yes
	is_triggered_only = yes
	
	immediate = { 
		result = yes newline = yes newline = yes
		yes = yes
		every_country = { 
			limit = { 
				has_idea = p5_member
				has_country_flag = UNSC_voted_yes
			}
		}
		newline = yes
		no = yes
		every_country = { 
			limit = { 
				has_idea = p5_member
				has_country_flag = UNSC_voted_no
			}
		}
		newline = yes
		abstain = yes
		every_country = { 
			limit = { 
				has_idea = p5_member
				has_country_flag = UNSC_abstained
			}	
		}
	}
	
	option = {
		name = UNSC.3.a
		log = "[GetDateText]: [This.GetName]: UNSC.3.a executed"
	}
}