###########################
# Manchukuo Events
###########################

add_namespace = russia2_manchukuo

# Check if File is Loaded
country_event = {
	id = russia2_manchukuo.2092066524

	hidden = yes

	is_triggered_only = yes

	immediate = {
		set_global_flag = russia_reworked_events_loaded_manchukuos
	}
}

# Konstantin Leaves
country_event = {
	id = russia2_manchukuo.1
	title = russia2_manchukuo.1.t
	desc = russia2_manchukuo.1.d
	picture = GFX_konstantin_russia2

	is_triggered_only = yes

	option = {
		name = russia2_manchukuo.1.a
		ai_chance = {
			base = 100
		}
		set_country_flag = konstantin_left_exile
	}
}

#SOV Wants Our Subjugation
country_event = {
	id = russia2_manchukuo.2
	title = russia2_manchukuo.2.t
	desc = russia2_manchukuo.2.d
	picture = GFX_military_parade_russia2

	is_triggered_only = yes

	option = { #Accepts
		name = russia2_manchukuo.2.a
		ai_chance = {
			base = 25
		}
		SOV = {
			country_event = { id = russia2_manchukuo.3 days = 1 }
		}
	}

	option = { #Refuse
		name = russia2_manchukuo.2.b
		ai_chance = {
			base = 75
		}
		SOV = {
			country_event = { id = russia2_manchukuo.4 days = 1 }
		}
		hidden_effect = {
			create_faction = asian_defensive_pact
			every_country = {
				limit = {
					has_guaranteed = MAN
					NOT = {
						tag = MAN
						tag = SOV
					}
				}
				diplomatic_relation = {
					country = MAN
					relation = guarantee
					active = no
				}
			}
		}
	}
}

#Man Accepts
country_event = {
	id = russia2_manchukuo.3
	title = russia2_manchukuo.3.t
	desc = russia2_manchukuo.3.d
	picture = GFX_handshake_russia2

	is_triggered_only = yes

	option = {
		name = russia2_manchukuo.3.a
		ai_chance = {
			base = 100
		}
		SOV = {
			puppet = MAN
		}
	}
}

#Man Refuse
country_event = {
	id = russia2_manchukuo.4
	title = russia2_manchukuo.4.t
	desc = russia2_manchukuo.4.d
	picture = GFX_operation_barbarossa_russia2

	is_triggered_only = yes

	option = {
		name = russia2_manchukuo.4.a
		ai_chance = {
			base = 100
		}
		SOV = {
			create_wargoal = {
				type = puppet_wargoal_focus
				target = MAN
			}
		}
	}
}

#SOV Wants to Help Our Independence War
country_event = {
	id = russia2_manchukuo.5
	title = russia2_manchukuo.5.t
	desc = russia2_manchukuo.5.d
	picture = GFX_battkle_kursk_russia2

	is_triggered_only = yes

	option = { #Accepts
		name = russia2_manchukuo.5.a
		ai_chance = {
			base = 90
		}
		SOV = {
			country_event = { id = russia2_manchukuo.6 hours = 5 }
		}
	}

	option = { #Refuse
		name = russia2_manchukuo.5.b
		ai_chance = {
			base = 10
		}
		SOV = {
			country_event = { id = russia2_manchukuo.7 days = 1 }
		}
	}
}

#Man Accepts
country_event = {
	id = russia2_manchukuo.6
	title = russia2_manchukuo.6.t
	desc = russia2_manchukuo.6.d
	picture = GFX_handshake_russia2

	is_triggered_only = yes

	option = {
		name = russia2_manchukuo.6.a
		ai_chance = {
			base = 100
		}
		if = {
			limit = {
				is_faction_leader = yes
			}
			SOV = {
				add_to_faction = MAN
			}
		}
		else = {
			SOV = {
				create_faction = russian_qing_alliance
				add_to_faction = MAN
			}
		}
		if = {
			limit = {
				MAN = {
					has_war_with = JAP
				}
			}
			SOV = {
				add_to_war = {
					targeted_alliance = MAN
					enemy = JAP
					hostility_reason = independence_war
				}
			}
		}
		if = {
			limit = {
				MAN = {
					has_war_with = event_target:WTT_current_china_leader
				}
			}
			custom_effect_tooltip = join_war_against_china_lord
			hidden_effect = {
				SOV = {
					add_to_war = {
						targeted_alliance = MAN
						enemy = event_target:WTT_current_china_leader
						hostility_reason = independence_war
					}
				}
			}
		}
		MAN = {
			add_ai_strategy = {
				type = alliance
				id = SOV
				value = 500
			}
		}
		SOV = {
			add_ai_strategy = {
				type = alliance
				id = MAN
				value = 200
			}
		}
		set_country_flag = no_alliance_with_china
	}
}

#Man Refuse
country_event = {
	id = russia2_manchukuo.7
	title = russia2_manchukuo.7.t
	desc = russia2_manchukuo.7.d
	picture = GFX_report_event_chinese_soldiers_fighting

	is_triggered_only = yes

	option = {
		name = russia2_manchukuo.7.a
		ai_chance = {
			base = 100
		}
	}
}

#SOV Propose an Alliance
country_event = {
	id = russia2_manchukuo.8
	title = russia2_manchukuo.8.t
	desc = russia2_manchukuo.8.d
	picture = GFX_report_event_hol_cabinet_de_geer

	is_triggered_only = yes

	option = { #Accepts
		name = russia2_manchukuo.8.a
		ai_chance = {
			base = 90
		}
		SOV = {
			country_event = { id = russia2_manchukuo.9 hours = 5 }
		}
	}

	option = { #Refuse
		name = russia2_manchukuo.8.b
		ai_chance = {
			base = 10
		}
		SOV = {
			country_event = { id = russia2_manchukuo.10 days = 1 }
		}
	}
}

#Man Accepts
country_event = {
	id = russia2_manchukuo.9
	title = russia2_manchukuo.9.t
	desc = russia2_manchukuo.9.d
	picture = GFX_handshake_russia2

	is_triggered_only = yes

	option = {
		name = russia2_manchukuo.9.a
		ai_chance = {
			base = 100
		}
		if = {
			limit = {
				is_faction_leader = yes
			}
			SOV = {
				add_to_faction = MAN
			}
		}
		else = {
			SOV = {
				create_faction = russian_qing_alliance
				add_to_faction = MAN
			}
		}
		MAN = {
			add_ai_strategy = {
				type = alliance
				id = SOV
				value = 500
			}
		}
		SOV = {
			add_ai_strategy = {
				type = alliance
				id = MAN
				value = 200
			}
		}
		set_country_flag = no_alliance_with_china
	}
}

#Man Refuse
country_event = {
	id = russia2_manchukuo.10
	title = russia2_manchukuo.10.t
	desc = russia2_manchukuo.10.d
	picture = GFX_report_event_chinese_soldiers_fighting

	is_triggered_only = yes

	option = {
		name = russia2_manchukuo.10.a
		ai_chance = {
			base = 100
		}
	}
}

#Russian Ultimatum for Far East
country_event = {
	id = russia2_manchukuo.11
	title = russia2_manchukuo.11.t
	desc = russia2_manchukuo.11.d
	picture = GFX_menacing_tanks_russia2

	is_triggered_only = yes

	option = {#Nothing We can do
		name = russia2_manchukuo.11.a
		ai_chance = {
			base = 90
		}
		SOV = {
			country_event = { id = russia2_manchukuo.12 days = 1 }
		}
		ROOT = {
			remove_state_core = 408
			remove_state_core = 409
			remove_state_core = 560
			remove_state_core = 657
			remove_state_core = 561
		}
	}

	option = {#We'll rather die
		name = russia2_manchukuo.11.b
		ai_chance = {
			base = 10
		}
		SOV = {
			country_event = { id = russia2_manchukuo.13 days = 1 }
		}
	}
}

#Man Accept Ultimatum
country_event = {
	id = russia2_manchukuo.12
	title = russia2_manchukuo.12.t
	desc = russia2_manchukuo.12.d
	picture = GFX_cavalry_parade_russia2

	is_triggered_only = yes

	option = {
		name = russia2_manchukuo.12.a
		ai_chance = {
			base = 100
		}
		SOV = {
			clr_country_flag = japan_receive_far_east_generic
			transfer_state = 408
			transfer_state = 409
			transfer_state = 560
			transfer_state = 657
			transfer_state = 561
			add_state_core = 408
			add_state_core = 409
			add_state_core = 560
			add_state_core = 657
			add_state_core = 561
		}
		hidden_effect = {
			if = {
				limit = {
					SOV = {
						NOT = {
							has_country_flag = america_receive_siberia_generic
						}
					}
				}
				563 = {
					set_demilitarized_zone = no
				}
				574 = {
					set_demilitarized_zone = no
				}
				562 = {
					set_demilitarized_zone = no
				}
			}
			else_if = {
				limit = {
					SOV = {
						has_country_flag = america_receive_siberia_generic
					}
				}
				563 = {
					set_demilitarized_zone = no
				}
			}
		}
	}
}

#Man Refuse Ultimatum
country_event = {
	id = russia2_manchukuo.13
	title = russia2_manchukuo.13.t
	desc = russia2_manchukuo.13.d
	picture = GFX_artillery_with_building_russia2

	is_triggered_only = yes

	option = {
		name = russia2_manchukuo.13.a
		ai_chance = {
			base = 100
		}
		SOV = {
			clr_country_flag = japan_receive_far_east_generic
			add_state_claim = 408
			add_state_claim = 409
			add_state_claim = 560
			add_state_claim = 657
			add_state_claim = 561
			create_wargoal = {
				target = MAN
				type = take_claimed_state
			}
		}
	}
}