﻿
# Russia claims former territories with NFs and they form an alliance to defend one another

add_namespace = russia_expansion

# Target is informed the claims on them are complete

country_event = {
	id = russia_expansion.1
	title = russia_expansion1title
	desc = russia_expansion1desc
	picture = GFX_report_event_generic_read_write
	
	is_triggered_only = yes	
	
	option = {
		name = russia_expansion1opt
	}
}

# Potential target of Russia tries to get into a faction of the same ideology

country_event = {
	id = russia_expansion.2
	title = russia_expansion2title
	desc = russia_expansion2desc
	picture = GFX_report_event_generic_read_write
	
	trigger = {
		NOT = { has_country_flag = had_expansionism_alliance_event }
		has_global_flag = russian_expansionism_started
		OR = {
			TAG = BAL
			TAG = UKR
			TAG = CAU
			TAG = AQN
			TAG = BLR
		}
		is_in_faction = no
		#is_faction_leader = no
		is_subject = no
		NOT = { has_idea = neutrality_idea }
		OR = {
			AND = {
				OR = {
					has_government = communism
					has_government = democratic
				}
				any_country = {
					NOT = { tag = SOV }
					NOT = { has_war_with = ROOT }
					is_faction_leader = yes
					has_government = communism
					NOT = { has_idea = deluge_recently_rejected_applicant }
				}
			}
			AND = {
				has_government = democratic
				any_country = {
					NOT = { tag = SOV }
					NOT = { has_war_with = ROOT }
					has_government = democratic
					is_faction_leader = yes
					NOT = { has_idea = deluge_recently_rejected_applicant }
				}
			}
			AND = {
				has_government = neutrality
				any_country = {
					NOT = { tag = SOV }
					NOT = { has_war_with = ROOT }
					has_government = neutrality
					is_faction_leader = yes
					NOT = { has_idea = deluge_recently_rejected_applicant }
				}
			}
			AND = {
				has_government = fascism
				any_country = {
					NOT = { tag = SOV }
					NOT = { has_war_with = ROOT }
					has_government = fascism
					is_faction_leader = yes
					NOT = { has_idea = deluge_recently_rejected_applicant }
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 1
		modifier = {
			factor = 0.1
			has_government = communism
		}
	}
	
	immediate = {
		set_country_flag = had_expansionism_alliance_event
	}
	
	option = {
		name = russia_expansion2opta
		
		trigger = {
			OR = {
				has_government = communism
				has_government = democratic
			}
			any_country = {
				NOT = { tag = SOV }
				NOT = { has_war_with = ROOT }
				has_government = communism
				is_faction_leader = yes
				NOT = { has_idea = deluge_recently_rejected_applicant }
			}
		}
		random_country = {
			limit = {
				NOT = { tag = SOV }
				NOT = { has_war_with = ROOT }
				has_government = communism
				is_faction_leader = yes
				NOT = { has_idea = deluge_recently_rejected_applicant }
			}
			country_event = russia_expansion.3
		}
		ai_chance = {
			factor = 100
		}
	}
	option = {
		name = russia_expansion2optb
		
		trigger = {
			has_government = democratic
			any_country = {
				NOT = { tag = SOV }
				NOT = { has_war_with = ROOT }
				has_government = democratic
				is_faction_leader = yes
				NOT = { has_idea = deluge_recently_rejected_applicant }
			}
		}
		random_country = {
			limit = {
				NOT = { tag = SOV }
				NOT = { has_war_with = ROOT }
				has_government = democratic
				is_faction_leader = yes
				NOT = { has_idea = deluge_recently_rejected_applicant }
			}
			country_event = russia_expansion.3
		}
		ai_chance = {
			factor = 1
		}
	}
	option = {
		name = russia_expansion2optc
		
		trigger = {
			has_government = neutrality
			any_country = {
				NOT = { tag = SOV }
				NOT = { has_war_with = ROOT }
				has_government = neutrality
				is_faction_leader = yes
				NOT = { has_idea = deluge_recently_rejected_applicant }
			}
		}
		random_country = {
			limit = {
				NOT = { tag = SOV }
				NOT = { has_war_with = ROOT }
				has_government = neutrality
				is_faction_leader = yes
				NOT = { has_idea = deluge_recently_rejected_applicant }
			}
			country_event = russia_expansion.3
		}
		ai_chance = {
			factor = 1
		}
	}
	option = {
		name = russia_expansion2optd
		
		trigger = {
			has_government = fascism
			any_country = {
				NOT = { tag = SOV }
				NOT = { has_war_with = ROOT }
				has_government = fascism
				is_faction_leader = yes
				NOT = { has_idea = deluge_recently_rejected_applicant }
			}
		}
		random_country = {
			limit = {
				NOT = { tag = SOV }
				NOT = { has_war_with = ROOT }
				has_government = fascism
				is_faction_leader = yes
				NOT = { has_idea = deluge_recently_rejected_applicant }
			}
			country_event = russia_expansion.3
		}
		ai_chance = {
			factor = 1
		}
	}
	option = {
		name = russia_expansion2opte
		
		ai_chance = {
			factor = 0
		}
	}
}

# AI will tend to accept the request
# Exception is the French Republic, since radicals should align either
# with Germany or one of the Russian-bordering republics

country_event = {
	id = russia_expansion.3
	title = russia_expansion3title
	desc = russia_expansion3desc
	picture = GFX_report_event_generic_read_write
	
	is_triggered_only = yes
	
	option = {
		name = russia_expansion3opta
		
		add_to_faction = FROM
		
		if = {
			limit = {
				TAG = FRR
			}
			FROM = {
				add_ai_strategy = {
					type = alliance
					id = "FRR"
					value = 9999
				}
			}
		}
		
		if = {
			limit = {
				TAG = DDR
			}
			FROM = {
				add_ai_strategy = {
					type = alliance
					id = "DDR"
					value = 9999
				}
			}
		}
		
		if = {
			limit = {
				TAG = BAL
			}
			FROM = {
				add_ai_strategy = {
					type = alliance
					id = "BAL"
					value = 9999
				}
			}
		}
		
		if = {
			limit = {
				TAG = UKR
			}
			FROM = {
				add_ai_strategy = {
					type = alliance
					id = "UKR"
					value = 9999
				}
			}
		}
		
		if = {
			limit = {
				TAG = CAU
			}
			FROM = {
				add_ai_strategy = {
					type = alliance
					id = "CAU"
					value = 9999
				}
			}
		}
		
		if = {
			limit = {
				TAG = CAN
			}
			FROM = {
				add_ai_strategy = {
					type = alliance
					id = "CAN"
					value = 9999
				}
			}
		}
		
		hidden_effect = {
			if = { limit = { has_government = communism }
				FROM = {
					country_event = radical_international.7
				}
			}
		}
		
		ai_chance = {
			factor = 1
			
			modifier = {
				add = -1
				original_tag = FRR
			}
		}
	}
	option = {
		name = russia_expansion3optb
		
		add_timed_idea = { idea = deluge_recently_rejected_applicant days = 60 }
		
		ai_chance = {
			factor = 0
			
			modifier = {
				add = 1
				original_tag = FRR
			}
		}
	}
}

# Ottoman Empire is informed of Russian claims on Caucasus and may request a portion in exchange for alliance

country_event = {
	id = russia_expansion.4
	title = russia_expansion4title
	desc = russia_expansion4desc
	picture = GFX_deluge_istanbul_small
		
	trigger = {
		has_global_flag = russian_expansionism_started
		TAG = TUR
		is_in_faction = no
		is_subject = no
		NOT = { has_war_with = SOV }
		NOT = { has_war_with = FRA }
	}
	
	mean_time_to_happen = {
		days = 20
	}
	
	option = {
		name = russia_expansion4opta
		
		trigger = {
			SOV = { is_faction_leader = yes }
		}
		
		SOV = { country_event = russia_expansion.5 }
		
		ai_chance = {
			factor = 3
			
			modifier = {
				factor = 5
				has_government = communism
				SOV = { has_government = communism }
			}
			modifier = {
				factor = 5
				has_government = neutrality
				SOV = { has_government = neutrality }
			}
			modifier = {
				factor = 0
				has_government = communism
				NOT = { SOV = { has_government = communism } }
			}
			modifier = {
				factor = 0
				NOT = { has_government = communism }
				SOV = { has_government = communism }
			}
		}
	}
	
	option = {
		name = russia_expansion4optb
		
		trigger = {
			FRA = { is_faction_leader = yes }
		}
		
		FRA = { country_event = russia_expansion.8 }

		ai_chance = {
			factor = 3
			modifier = {
				factor = 5
				has_government = communism
				FRA = { has_government = communism }
			}
			modifier = {
				factor = 0
				has_government = communism
				NOT = { FRA = { has_government = communism } }
			}
			modifier = {
				factor = 0
				NOT = { has_government = communism }
				FRA = { has_government = communism }
			}
		}
	}
	
	option = {
		name = russia_expansion4optc
		
		create_faction = "factionTurkishBloc"
		
		hidden_effect = {
			news_event = { days = 1 id = russia_expansion.11 }
		}
		
		ai_chance = {
			factor = 1
			
			modifier = {
				factor = 20
				has_government = fascism
			}
		}
	}
	
	option = {
		name = russia_expansion4optd
		
		ai_chance = {
			factor = 0
		}
	}
}

# Russia has low chance of accepting

country_event = {
	id = russia_expansion.5
	title = russia_expansion5title
	desc = russia_expansion5desc
	picture = GFX_deluge_istanbul_small
	
	is_triggered_only = yes	
	
	option = {
		name = russia_expansion5opta
		
		TUR = {
			add_ai_strategy = {
				type = alliance
				id = "SOV"
				value = 9999
			}
		}
		
		add_to_faction = TUR
		
		if = {
			limit = {
				229 = { is_claimed_by = SOV }
			}
			remove_state_claim = 229
		}
		if = {
			limit = {
				230 = { is_claimed_by = SOV }
			}
			remove_state_claim = 230
		}
		
		TUR = {
			add_state_claim = 229
			add_state_claim = 230
		}
		
		hidden_effect = {
			news_event = { days = 1 id = russia_expansion.6 }
		}

		ai_chance = {
			factor = 1
		}
	}
	option = {
		name = russia_expansion5optb
				
		TUR = { country_event = russia_expansion.7 }
		
		ai_chance = {
			factor = 3
		}
	}
}

# News event for Russia accepting Turkey

news_event = {
	id = russia_expansion.6
	title = russia_expansion6title
	desc = russia_expansion6desc
	
	picture = GFX_deluge_istanbul_large
	
	major = yes
	
	is_triggered_only = yes
	
	option = {
		name = russia_expansion6opta
		trigger = {
			NOT = {
				OR = {
					TAG = SOV
					TAG = TUR
				}
			}
		}
	}
	option = {
		name = russia_expansion6optb
		trigger = {
			OR = {
				TAG = SOV
				TAG = TUR
			}
		}
	}
}

# If Russia refuses, Turkey gets another chance at making a faction/joining France

country_event = {
	id = russia_expansion.7
	title = russia_expansion7title
	desc = russia_expansion7desc
	picture = GFX_deluge_istanbul_small
	
	is_triggered_only = yes	
	
	option = {
		trigger = {
			NOT = { has_war_with = FRA }
		}
		name = russia_expansion7opta
		
		FRA = { country_event = russia_expansion.8 }

		ai_chance = {
			factor = 3
			
			modifier = {
				factor = 5
				has_government = communism
				FRA = { has_government = communism }
			}
			modifier = {
				factor = 5
				has_government = neutrality
				FRA = { has_government = neutrality }
			}
			modifier = {
				factor = 0
				has_government = communism
				NOT = { FRA = { has_government = communism } }
			}
			modifier = {
				factor = 0
				NOT = { has_government = communism }
				FRA = { has_government = communism }
			}
		}
	}
	
	option = {
		name = russia_expansion7optb
		
		create_faction = "factionTurkishBloc"
		
		hidden_effect = {
			news_event = { hours = 1 id = russia_expansion.11 }
		}
		
		ai_chance = {
			factor = 1
			
			modifier = {
				factor = 20
				has_government = fascism
			}
		}
	}
	
	option = {
		name = russia_expansion7optc
		
		ai_chance = {
			factor = 0
		}
	}
}

# France has high chance of accepting

country_event = {
	id = russia_expansion.8
	title = russia_expansion8title
	desc = russia_expansion8desc
	picture = GFX_deluge_istanbul_small
	
	is_triggered_only = yes	
	
	option = {
		name = russia_expansion8opta
		
		TUR = {
			add_ai_strategy = {
				type = alliance
				id = "FRA"
				value = 9999
			}
		}
		
		add_to_faction = TUR

		hidden_effect = {
			news_event = { hours = 1 id = russia_expansion.9 }
		}

		ai_chance = {
			factor = 3
		}
	}
	option = {
		name = russia_expansion8optb
				
		TUR = { country_event = russia_expansion.10 }
		
		ai_chance = {
			factor = 1
		}
	}
}

# News event for France accepting Turkey

news_event = {
	id = russia_expansion.9
	title = russia_expansion9title
	desc = russia_expansion9desc
	
	picture = GFX_deluge_istanbul_large
	
	major = yes
	
	is_triggered_only = yes
	
	option = {
		name = russia_expansion9opta
		trigger = {
			NOT = {
				OR = {
					TAG = SOV
					TAG = TUR
				}
			}
		}
	}
	option = {
		name = russia_expansion9optb
		trigger = {
			OR = {
				TAG = SOV
				TAG = TUR
			}
		}
	}
}

# Turkey has to form her own faction

country_event = {
	id = russia_expansion.10
	title = russia_expansion10title
	desc = russia_expansion10desc
	picture = GFX_deluge_istanbul_small
	
	is_triggered_only = yes	
	
	option = {
		name = russia_expansion10opta
		
		create_faction = "factionTurkishBloc"
		
		hidden_effect = {
			news_event = { days = 1 id = russia_expansion.11 }
		}
		
		ai_chance = {
			factor = 1
		}
	}
	
	option = {
		name = russia_expansion10optb
		
		ai_chance = {
			factor = 0
		}
	}
}

# News event for Turkish faction

news_event = {
	id = russia_expansion.11
	title = russia_expansion11title
	desc = russia_expansion11desc
	
	picture = GFX_deluge_istanbul_large
	
	major = yes
	
	is_triggered_only = yes
	
	option = {
		name = russia_expansion11opta
		trigger = {
			TAG = TUR
		}
		set_global_flag = turkish_call_to_arms
	}
	option = {
		name = russia_expansion11optb
		trigger = {
			is_subject = no
			is_in_faction = no
			NOT = { has_war_with = TUR }
			OR = {
				TAG = SAU
				TAG = KUW
				TAG = OMA
				TAG = YEM
				TAG = ABU
				TAG = PER
				TAG = AFG
				TAG = EGY
				TAG = AZR
				TAG = KAZ
				TAG = QAT
			}
		}
		
		if = { 
			limit = { has_idea = neutrality_idea }
			remove_ideas = neutrality_idea
		}
		
		TUR = {
			add_to_faction = PREV
		}
		
		add_ai_strategy = {
			type = alliance
			id = "TUR"
			value = 9999
		}
		
		ai_chance = {
			factor = 5
			
			modifier = {
				factor = 20
				is_historical_focus_on = yes
			}
		}
	}
	option = {
		name = russia_expansion11optc
		trigger = {
			NOT = {
				TAG = TUR
			}
		}
		ai_chance = {
			factor = 1
			modifier = {
				factor = 10
				has_idea = neutrality_idea
			}
			modifier = {
				factor = 20
				has_government = communism
				NOT = { TUR = { has_government = communism } }
			}
			modifier = {
				factor = 20
				NOT = { has_government = communism }
				TUR = { has_government = communism }
			}
		}
	}
}

# China sees Russia expanding and considers a pre-emptive attack

country_event = {
	id = russia_expansion.12
	title = russia_expansion12title
	desc = russia_expansion12desc
	
	picture = GFX_report_event_chinese_soldiers_02
	
	fire_only_once = yes
	
	trigger = {
		TAG = CHI
		SOV = {
			has_war = yes
		}
		NOT = { has_war_with = SOV }
		NOT = { is_in_faction_with = SOV }
		is_subject = no
		is_subject = no
	}
	
	mean_time_to_happen = {
		months = 1
		modifier = {
			factor = 10
			has_idea = deluge_chinese_sectarianism_idea
		}
	}
		
	option = {
		name = russia_expansion12opta
		
		every_state = {
			limit = {
				OR = {
					is_core_of = SIB
					is_core_of = KAZ
					is_core_of = TKM
					is_core_of = TJK
					is_core_of = KRG
					is_core_of = UZB
					is_core_of = ASK
					is_core_of = TAN
				}
			}
			add_claim_by = CHI
		}
		
		create_wargoal = {
			type = take_claimed_state
			target = SOV
			generator = { 588 590 583 402 407 406 404 587 584 585 405 742 732 586 589 }
		}

		
		hidden_effect = {
			news_event = { days = 1 id = russia_expansion.13 }
		}
		
		ai_chance = {
			factor = 2
			
			modifier = {
				factor = 10
				is_historical_focus_on = yes
			}
			
			modifier = {
				factor = 0
				has_war = yes
			}
		}
	}
	
	option = {
		name = russia_expansion12optb
		
		add_political_power = 100
		
		ai_chance = {
			factor = 1
		}
	}
}

# News event for China attacking Russia

news_event = {
	id = russia_expansion.13
	title = russia_expansion13title
	desc = russia_expansion13desc
	
	picture = GFX_news_event_001
	
	major = yes
	
	is_triggered_only = yes
	
	option = {
		name = russia_expansion13opta
		trigger = {
			TAG = CHI
		}
	}
	option = {
		name = russia_expansion13optb
		trigger = {
			TAG = SOV
		}
	}
	option = {
		name = russia_expansion13optc
		trigger = {
			NOT = {
				OR = {
					TAG = CHI
					TAG = SOV
				}
			}
		}
	}
}


# If Russia is justifying on a neighbour, create the Republican International

country_event = {
	id = russia_expansion.14
	title = hidden
	desc = hidden
	
	is_triggered_only = yes
	
	fire_only_once = yes
	
	hidden = yes
	
	trigger = {
		OR = {
			tag = SOV
			tag = FIN
		}
		FROM = {
			OR = {
				TAG = BAL
				TAG = BLR
				TAG = UKR
				TAG = CAU
			}
		}
	}
	
	option = {
		set_global_flag = russian_expansionism_started
	}
}


# News event for the formation of the USSR

news_event = {
	id = russia_expansion.15
	title = russia_expansion15title
	desc = russia_expansion15desc
	
	picture = GFX_deluge_protest
	
	major = yes
	
	is_triggered_only = yes
	
	option = {
		name = russia_expansion15opta
		trigger = {
			OR = {
				TAG = SOV
				is_in_faction_with = SOV
			}
		}
	}
	option = {
		name = russia_expansion15optb
		trigger = {
			has_war_with = SOV
		}
	}
	option = {
		name = russia_expansion15optc
		trigger = {
			NOT = {
				OR = {
					TAG = SOV
					is_in_faction_with = SOV
					has_war_with = SOV
				}
			}
		}
	}
}
