###########################
# Communist China Events
###########################

add_namespace = russia2_communist_china

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

	hidden = yes

	is_triggered_only = yes

	immediate = {
		set_global_flag = russia_reworked_events_loaded_wtt_prcs
	}
}

# Soviet Pressure for Unification
country_event = {
	id = russia2_communist_china.1
	title = russia2_communist_china.1.t
	desc = russia2_communist_china.1.d
	picture = GFX_report_event_stalin_meeting

	is_triggered_only = yes

	option = {
		ai_chance = {
			base = 75
		}
		name = russia2_communist_china.1.a
		add_opinion_modifier = { target = SOV modifier = soviet_prc_treaty }
		SOV = {
			add_to_faction = ROOT
			country_event = { days = 1 id = russia2_russia.37 }
			add_opinion_modifier = { target = ROOT modifier = soviet_prc_treaty }
			puppet = ROOT
			hidden_effect = {
				set_autonomy = {
				    target = ROOT
				    autonomy_state = autonomy_soviet_republic
				}
			}
			give_guarantee = ROOT
		}
		hidden_effect = {
			news_event = { hours = 48 id = newsrussia2.20 }
			ROOT = {
				set_popularities = {
					democratic = 10
					neutrality = 10
					fascism = 10
					communism = 70
				}
			}
		}
	}

	option = {
		ai_chance = {
			base = 25
		}
		name = russia2_communist_china.1.b
		add_opinion_modifier = { target = SOV modifier = soviet_threat }
		SOV = {
			country_event = { days = 1 id = russia2_russia.38 }
			add_opinion_modifier = { target = ROOT modifier = refused_unification }
		}
		hidden_effect = {
			news_event = { hours = 6 id = newsrussia2.21 }
		}
	}
}

country_event = {
	id = russia2_communist_china.2
	title = russia2_communist_china.2.t
	desc = russia2_communist_china.2.d
	picture = GFX_report_event_stalin_meeting

	is_triggered_only = yes

	option = {
		ai_chance = {
			base = 100
		}
		name = russia2_communist_china.2.a
		every_country = {
			limit = {
				is_major = no
				NOT = {
					owns_state = 729
				}
				NOT = { is_subject_of = JAP }
				any_owned_state = {
					is_core_of = PRC
				}
				NOT = { is_in_faction_with = SOV }
				NOT = { tag = PRC }
				NOT = { has_war_with = PRC }
				NOT = { original_tag = SOV }
				NOT = { has_war_with = ROOT }
			}
			country_event = { days = 1 id = russia2_generic.1 }
		}
	}
}

#Communist China (or Sinkiang) Gets an Invitation to the 4th International
country_event = {
	id = russia2_communist_china.3
	title = russia2_communist_china.3.t
	desc = russia2_communist_china.3.d
	picture = GFX_report_event_generic_sign_treaty2

	is_triggered_only = yes

	option = { #Accept
		name = russia2_communist_china.3.a
		ai_chance = { base = 80 }
		custom_effect_tooltip = SOV_one_china_proposal_tt
		SOV = {
			add_to_faction = ROOT
			country_event = { id = russia2_communist_china.4 days = 1 }
		}
		hidden_effect = {
			every_country = {
				limit = {
					OR = {
						tag = MAN
						tag = MEN
						tag = SHX
						tag = CHI
						tag = XSM
						tag = SIK
						tag = GXC
						tag = YUN
					}
					NOT = {
						has_government = communism
						is_in_faction_with = SOV
					}
					any_owned_state = {
						is_core_of = PRC
					}
				}
				ROOT = {
					create_wargoal = {
						type = annex_everything
						target = PREV
					}
				}
			}
		}
		hidden_effect = {
			news_event = { id = newsrussia2.47 days = 1 }
		}
	}

	option = { #Refuse
		name = russia2_communist_china.3.b
		ai_chance = { base = 20 }
		SOV = {
			country_event = { id = russia2_communist_china.5 days = 1 }
		}
	}
}

#Communist China Accepts
country_event = {
	id = russia2_communist_china.4
	title = russia2_communist_china.4.t
	desc = russia2_communist_china.4.d
	picture = GFX_handshake_russia2

	is_triggered_only = yes

	option = { #Nice
		name = russia2_communist_china.4.a
	}
}

#Communist China Refuses
country_event = {
	id = russia2_communist_china.5
	title = russia2_communist_china.5.t
	desc = russia2_communist_china.5.d
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	option = { #Bad
		name = russia2_communist_china.5.a
	}
}