﻿###########################
# Treaty Organization Events
###########################

add_namespace = treaty_org

# Brussels Treaty invite event
country_event = {
	id = treaty_org.1
	title = treaty_org.1.t
	desc = treaty_org.1.desc
	picture = GFX_report_event_generic_sign_treaty2

	is_triggered_only = yes
	
	trigger = {
		is_subject = no
		has_war = no
	}

	immediate = {
		
	}
	
	option = {
		name = treaty_org.1.a
		ai_chance = { 
			base = 2 
			modifier = {
				add = -1
				has_opinion = {
					target = SOV
					value > 80
				}
			}
		}
		set_country_flag = TO_joined_brussels_treaty
		custom_effect_tooltip = join_brussels_treaty_tt
		SOV = {
			add_opinion_modifier = { 
				target = ROOT
				modifier = SOV_joined_NATO
			}
		}
	}

	option = {
		name = treaty_org.1.b
		ai_chance = { 
			base = 99
			modifier = {
				add = -99
				OR = {
					AND = {
						is_historical_focus_on = yes
						OR = {
							tag = ENG
							tag = TUR
							tag = FRA
							original_tag = ITA #puppetry can mess with this
							tag = HOL
							tag = BEL
							tag = LUX
							tag = ICE
							tag = DEN
							tag = POR
							tag = NOR
							tag = USA
						}
					}
					has_war = yes #This can do bad, bad things to war blobs.
				}
			}
		}
		faction_leader = { country_event = treaty_org.5 }
		faction_leader = { remove_from_faction = ROOT }
		add_ideas = TO_chose_neutrality
		
		set_country_flag = { flag = TO_chose_neutrality_flag days = 730 }
		
		SOV = {
			add_opinion_modifier = { 
				target = ROOT
				modifier = SOV_chose_NATO_neutrality
			}
		}
	}
}

# Brussels Happened
news_event = {
	id = treaty_org.2
	title = treaty_org.2.t
	desc = treaty_org.2.desc
	picture = GFX_news_event_generic_sign_treaty3

	is_triggered_only = yes
	major = yes
	
	option = {
		name = treaty_org.2.a
		trigger = {
			NOT = {
				OR = { 
					tag = SOV 
					is_in_faction_with = SOV
				}
			}
		}
		every_country = {
			limit = { 
				has_country_flag = { flag = TO_chose_neutrality_flag value = 0 }
			}
			custom_effect_tooltip = TO_left_faction
		}
	}
	option = {
		name = treaty_org.2.b
		trigger = {
			OR = { 
				tag = SOV 
				is_in_faction_with = SOV
			}
		}
		every_country = {
			limit = { 
				has_country_flag = { flag = TO_chose_neutrality_flag value = 0 }
			}
			custom_effect_tooltip = TO_left_faction
		}
	}
}

news_event = {
	id = treaty_org.3
	title = treaty_org.3.t
	desc = treaty_org.3.desc
	picture = GFX_news_event_generic_sign_treaty3

	is_triggered_only = yes
	major = yes
	
	option = {
		name = treaty_org.3.a
		trigger = {
			NOT = {
				OR = { 
					tag = SOV 
					is_in_faction_with = SOV
				}
			}
		}
		effect_tooltip = {
			if = {
				limit = { has_idea = TO_nato_ratified }
				add_ideas = TO_nato_ratified
			}
		}
	}
	option = {
		name = treaty_org.2.b
		trigger = {
			OR = { 
				tag = SOV 
				is_in_faction_with = SOV
			}
		}
	}
}

news_event = {
	id = treaty_org.4
	title = treaty_org.3.t #Intentional
	desc = treaty_org.4.desc
	picture = GFX_news_event_generic_sign_treaty3

	is_triggered_only = yes
	major = yes
	
	option = {
		name = treaty_org.4.a
		trigger = {
			NOT = {
				OR = { 
					tag = SOV 
					is_in_faction_with = SOV
				}
			}
		}
		effect_tooltip = {
			if = {
				limit = { has_idea = TO_nato_ratified }
				add_ideas = TO_nato_ratified
			}
		}
	}
	option = {
		name = treaty_org.4.b
		trigger = {
			OR = { 
				tag = SOV 
				is_in_faction_with = SOV
			}
		}
	}
}

country_event = {
	id = treaty_org.5
	title = treaty_org.5.t
	desc = treaty_org.5.d
	picture = GFX_report_event_generic_sign_treaty2

	is_triggered_only = yes
	
	trigger = {
	}

	immediate = {
		
	}
	
	option = {
		name = treaty_org.5.a
		
	}

}
