###########################
# Green Ukraine Events
###########################

add_namespace = greenukraine

#Rename of Komsomolsk
country_event = {
	id = greenukraine.1
	title = greenukraine.1.t
	desc = greenukraine.1.d
	picture = GFX_report_event_komsomolsk

	fire_only_once = yes

	trigger = {
		tag = ZKL
		ZKL = {
			owns_state = 657
			controls_state = 657
		}
		has_war = no
		NOT = { has_government = communism }
	}

	option = { #Permsk-on-Amur
		name = greenukraine.1.a
		ai_chance = {
			base = 30
		}
		set_province_name = { id = 12263 name = UKR_permsk }
	}

	option = { #Amursk
		name = greenukraine.1.b
		ai_chance = {
			base = 40
		}
		set_province_name = { id = 12263 name = UKR_amursk }
	}

	option = { #Dzyomgi
		name = greenukraine.1.c
		ai_chance = {
			base = 30
		}
		set_province_name = { id = 12263 name = UKR_dzyomgi }
	}

	option = { #rather not
		name = ukraine.88.b
		ai_chance = {
			base = 0
		}
	}
}
#Rename of Sovetskaya Gavan
country_event = {
	id = greenukraine.2
	title = greenukraine.2.t
	desc = greenukraine.2.d

	fire_only_once = yes

	trigger = {
		tag = ZKL
		ZKL = {
			owns_state = 409
			controls_state = 409
		}
		has_war = no
		NOT = { has_government = communism }
	}

	option = { #Imperatorskaya Gavan
		name = greenukraine.2.a
		ai_chance = {
			base = 30
		}
		set_province_name = { id = 9604 name = UKR_imperatorskaya_gavan }
	}

	option = { #Novyi Kherson
		name = greenukraine.2.b
		ai_chance = {
			base = 30
		}
		set_province_name = { id = 9604 name = UKR_novyi_kherson }
	}

	option = { #Nevelsk
		name = greenukraine.2.c
		ai_chance = {
			base = 40
		}
		set_province_name = { id = 9604 name = UKR_nevelsk }
	}

	option = { #rather not
		name = ukraine.88.b
		ai_chance = {
			base = 0
		}
	}
}
# Protection of JAP for Green Ukraine
country_event = {
	id = greenukraine.3
	title = greenukraine.3.t
	desc = greenukraine.3.d
	picture = GFX_report_event_generic_conference

	is_triggered_only = yes

	option = {
		name = greenukraine.3.a
		puppet = ZKL
		ZKL = { country_event = greenukraine.4 }
	}

}
# Japan accept 
country_event = {
	id = greenukraine.4
	title = greenukraine.4.t
	desc = greenukraine.4.d
	picture = GFX_report_event_japanese_soldiers_02
	
	is_triggered_only = yes
	
	option = {
		name = greenukraine.4.a
		JAP = {
			set_autonomy = {
			    target = ZKL
			    autonomy_state = autonomy_wtt_imperial_associate
			}
		}
	}
}
# Transfer North Sakhalin for Japan 
country_event = {
	id = greenukraine.5
	title = greenukraine.5.t
	desc = greenukraine.5.d
	picture = GFX_report_event_japanese_soldiers_02
	
	is_triggered_only = yes
	
	option = {
		name = greenukraine.5.a
		transfer_state = 655
		655 = { add_compliance = 50 }
		ZKL = { set_country_flag = ZKL_north_sakhalin_is_japan }
	}
}
# Invite to ukrainian faction 
country_event = {
	id = greenukraine.6
	title = greenukraine.6.t
	desc = greenukraine.6.d
	picture = GFX_report_event_usa_election_generic
	
	is_triggered_only = yes
	
	option = {
		name = greenukraine.6.a
		ai_chance = {
			base = 100
		}
		add_to_faction = ZKL
	}

	option = {
		name = greenukraine.6.b
		ai_chance = {
			base = 0
		}
	}
}
# Guaranties from Ukraine
country_event = {
	id = greenukraine.7
	title = greenukraine.7.t
	desc = greenukraine.7.d
	picture = GFX_report_event_usa_election_generic
	
	is_triggered_only = yes
	
	option = {
		name = greenukraine.7.a
		ai_chance = {
			base = 100
		}
		give_guarantee = ZKL
	}

	option = {
		name = greenukraine.7.b
		ai_chance = {
			base = 0
		}
	}
}
# Frienship with Green Ukraine
country_event = {
	id = greenukraine.8
	title = greenukraine.8.t
	desc = greenukraine.8.d
	
	is_triggered_only = yes
	
	option = {
		name = greenukraine.8.a
		add_ai_strategy = {
			type = befriend
			id = "ZKL"			
			value = 200
		}
		add_ai_strategy = {
			type = alliance
			id = "ZKL"			
			value = 200
		}
	}
}
# Japan ultimatum to Ukraine
country_event = {
	id = greenukraine.9
	title = greenukraine.9.t
	desc = greenukraine.9.d
	picture = GFX_report_event_japanese_reply
	
	is_triggered_only = yes
	
	option = { # Accept demands
		name = greenukraine.9.a
		ai_chance = {
			base = 10
			modifier = { 
				factor = 0.5
				OR = { 
					any_other_country = {
						is_major = yes
						has_capitulated = no
						NOT = { tag = FROM }
						OR = {
							is_in_faction_with = PREV
							has_guaranteed = PREV
						}
					}
					UKR = { surrender_progress > 0.5 }
				}
			}
			modifier = { 
				factor = 0
				has_government = fascism
				oun_low_power_of_bandera_trigger = yes
			}
		}

		FROM = {
			country_event = { days = 1 id = greenukraine.11 }
		}
		effect_tooltip = {
			JAP = { puppet = ZKL }
		}
	}
	option = { # Refuse
		name = greenukraine.9.b
		ai_chance = {
			base = 1
			modifier = {
				add = 10
				has_government = fascism
				oun_low_power_of_melnyk_trigger = yes
			}
		}
		effect_tooltip = {
			create_wargoal = {
				type = annex_everything
				target = PREV
			}		
		}

		FROM = {
			country_event = { days = 1 id = greenukraine.12 }
		}
	}
}
# Japan ultimatum to Green Ukraine
country_event = {
	id = greenukraine.10
	title = greenukraine.10.t
	desc = greenukraine.10.d
	picture = GFX_report_event_japanese_reply
	
	is_triggered_only = yes
	
	option = { # Accept demands
		name = greenukraine.10.a
		ai_chance = {
			base = 10
			modifier = { 
				factor = 0.5
				OR = { 
					any_other_country = {
						is_major = yes
						has_capitulated = no
						NOT = { tag = FROM }
						OR = {
							is_in_faction_with = PREV
							has_guaranteed = PREV
						}
					}
					UKR = { surrender_progress > 0.5 }
				}
			}
		}

		FROM = {
			country_event = { days = 1 id = greenukraine.11 }
		}
		effect_tooltip = {
			JAP = { puppet = ZKL }
		}
	}
	option = { # Refuse
		name = greenukraine.10.b
		ai_chance = {
			base = 1
			modifier = {
				add = 10
				has_army_manpower = { size > 100000 }
			}
		}
		effect_tooltip = {
			create_wargoal = {
				type = annex_everything
				target = PREV
			}		
		}

		FROM = {
			country_event = { days = 1 id = greenukraine.12 }
		}
	}
}
# Ukraine accept demands
country_event = {
	id = greenukraine.11
	title = greenukraine.11.t
	desc = greenukraine.11.d
	picture = GFX_report_event_generic_peaceful_annexation

	is_triggered_only = yes
	
	option = {
		name = greenukraine.11.a
		puppet = ZKL
		if = {
			limit = { 657 = { is_owned_and_controlled_by = ZKL } }
			657 = { add_manpower = -20000 }
		}
		if = {
			limit = { 408 = { is_owned_and_controlled_by = ZKL } }
			408 = { add_manpower = -25000 }
		}
		if = {
			limit = { 409 = { is_owned_and_controlled_by = ZKL } }
			409 = { add_manpower = -25000 }
		}
		if = {
			limit = { 560 = { is_owned_and_controlled_by = ZKL } }
			560 = { add_manpower = -10000 }
		}
		UKR = {
			random_owned_controlled_state = { add_manpower = 40000  }
			random_owned_controlled_state = { add_manpower = 40000  }
		}
	}
}
# Ukraine refuses demands
country_event = {
	id = greenukraine.12
	title = greenukraine.12.t
	desc = greenukraine.12.d
	picture = GFX_report_event_japanese_soldiers_02

	is_triggered_only = yes
	
	option = {
		name = greenukraine.12.a
		create_wargoal = {
			type = annex_everything
			target = FROM
		}
	}
}

# debug event
country_event = {
	id = greenukraine.100
	title = greenukraine.100.t
	desc = greenukraine.100.d

	is_triggered_only = yes

	immediate = {
		release = ZKL
	}
	
	option = {
		name = greenukraine.100.a
		ZKL = { change_tag_from = ROOT }
	}
	option = {
		name = greenukraine.100.b
		
	}
}