﻿# Outlook drift based on neighbors
#by Killerrabbit

add_namespace = init_approval_rating

#One time event from init
#Everyone starts at 50% approval unless otherwise specified here
#Use modify flag to nudge the value you want up or down from 50

country_event = {
	id = init_approval_rating.1
	
	hidden = yes
	is_triggered_only = yes
	
	immediate = {
		
		set_country_flag = { flag = approval_rating value = 50 }
		
		if = {
			limit = {
				or = {
					tag = FRA
				}
			}
			modify_country_flag = { flag = approval_rating value = -40 }
		}
		if = {
			limit = {
				or = {
					tag = ICE
				}
			}
			modify_country_flag = { flag = approval_rating value = -15 }
		}
		if = {
			limit = {
				or = {
					tag = KOR
				}
			}
			modify_country_flag = { flag = approval_rating value = -10 }
		}
		if = {
			limit = {
				or = {
					tag = USA
					tag = EGY
					tag = NZL
				}
			}
			modify_country_flag = { flag = approval_rating value = -5 }
		}
		if = {
			limit = {
				or = {
					tag = PER
					tag = GER
					tag = CHI
					tag = RAJ
					tag = TUR
				}
			}
			modify_country_flag = { flag = approval_rating value = 5 }
		}
		if = {
			limit = {
				or = {
					tag = SOV
				}
			}
			modify_country_flag = { flag = approval_rating value = 15 }
		}
		
		approval_rating_update = yes
		
			if = {
				limit = { 
					OR = { 
						has_idea = pop_000
						has_idea = pop_005
						has_idea = pop_010
					}
				}
					update_drift_pop_01 = yes
				
					else = {
						if = {
						limit = { 
							OR = { 
							has_idea = pop_015
							has_idea = pop_020
							has_idea = pop_025
							has_idea = pop_030
							}
						}
							update_drift_pop_02 = yes
						else = {
							if = {
							limit = { 
								OR = { 
								has_idea = pop_035
								has_idea = pop_040
								}
							}
							update_drift_pop_03 = yes
								
								else = {
									if = {
									limit = { 
										OR = { 
										has_idea = pop_060
										has_idea = pop_065
										has_idea = pop_070
										has_idea = pop_075
										}
									}
									update_drift_pop_04 = yes
			
										else = {
											if = {
											limit = { 
												OR = { 
												has_idea = pop_080
												has_idea = pop_085
												has_idea = pop_090
												has_idea = pop_095
												has_idea = pop_100
												}
											}
											update_drift_pop_05 = yes
											}
										}
									}
								}
							}
						}
					}
				}
			}

	}
	
	option = {
		name = init_approval_rating.1.a
		log = "[GetDateText]: [This.GetName]: init_approval_rating.1.a executed"
	}
}