

democratic_russia_in_germany_faction = {
	allowed = {
		original_tag = SOV
	}
	enable = {
		has_country_flag = kerensky_leader
		GER = {
			OR = {
				has_government = democratic
				has_government = neutrality
			}
			is_faction_leader = yes
		}
		NOT = { has_war_with = GER }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "GER"
		value = 500
	}
}
democratic_russia_in_germany_faction_GER = {
	allowed = {
		original_tag = GER
	}
	enable = {
		SOV = { 
			has_country_flag = kerensky_leader
			NOT = { has_war_with = GER }
		}
		GER = {
			OR = {
				has_government = democratic
				has_government = neutrality
			}
			is_faction_leader = yes
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "SOV"
		value = 500
	}
}

kaiserin_and_the_qween_ENG = {
	allowed = {
		original_tag = ENG
	}
	enable = {
		OR = {
			has_government = democratic
			has_government = neutrality
		}
		GER = {
			has_government = neutrality
			has_completed_focus = GER_expatriate_the_communists
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "GER"
		value = 2000
	}
}

kaiserin_and_the_qween_GER = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_government = neutrality
		has_completed_focus = GER_expatriate_the_communists
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "ENG"
		value = 2000
	}
}


you_are_no_friend_of_the_kaiser = {
	reversed = yes
	allowed = {
		OR = {
			original_tag = GER
			original_tag = ENG
		}
	}
	enable = {
		NOT = { original_tag = GER }
		NOT = { original_tag = ENG }
		GER = {
			has_government = neutrality
			has_completed_focus = GER_expatriate_the_communists
		}
		has_global_flag = GER_HRE_is_inevitable
		any_controlled_state = {
			OR = {
				is_core_of = GER
				is_claimed_by = GER
			}
		}
		NOT = { is_in_faction_with = ENG }
		NOT = { is_in_faction_with = GER }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "ENG"
		value = -2000
	}
	ai_strategy = {
		type = alliance
		id = "GER"
		value = -2000
	}

	ai_strategy = {
		type = befriend
		id = "ENG"
		value = -2000
	}
	ai_strategy = {
		type = befriend
		id = "GER"
		value = -2000
	}
}

you_are_no_friend_of_the_kaiser_n = {
	enable = {
		NOT = { original_tag = GER }
		NOT = { original_tag = ENG }
		GER = {
			has_government = neutrality
			has_completed_focus = GER_expatriate_the_communists
		}
		has_global_flag = GER_HRE_is_inevitable
		any_controlled_state = {
			OR = {
				is_core_of = GER
				is_claimed_by = GER
			}
		}
		NOT = { is_in_faction_with = ENG }
		NOT = { is_in_faction_with = GER }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "ENG"
		value = -2000
	}
	ai_strategy = {
		type = alliance
		id = "GER"
		value = -2000
	}

	ai_strategy = {
		type = befriend
		id = "ENG"
		value = -2000
	}
	ai_strategy = {
		type = befriend
		id = "GER"
		value = -2000
	}
}
GER_befriends_non_nonaligned_ENG = {
	allowed = {
		original_tag = GER
	}
	enable = {
		has_country_flag = modernized_succession_laws
		NOT = { has_country_flag = GER_improve_relation_no_longer_needed }
		has_completed_focus = GER_ally_the_shade
		ENG = {
			has_opinion = {
				target = ROOT
				value < 100
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = diplo_action_desire
		id = ENG
		target = improve_relation
		value = 9999
	}
}

axis_minor_allies_doomsday = {
	enable = {
		OR = {
			capital_scope = { is_on_continent = europe }
			capital_scope = { is_on_continent = middle_east }
			capital_scope = { is_on_continent = africa }
		}
		OR = {
			has_government = fascism
			fascism > 0.5
		}
		is_in_faction = no
		GER = {
			has_government = fascism
			has_completed_focus = GER_soviet_ally
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "GER"
		value = 500
	}
}
allied_minor_allies_doomsday = {
	enable = {
		OR = {
			capital_scope = { is_on_continent = europe }
			is_major = yes
			original_tag = MEX
			original_tag = USA
			original_tag = JAP
		}
		OR = {
			ENG = { is_faction_leader = yes }
			FRA = { is_faction_leader = yes }
		}
		OR = {
			AND = {
				has_government = democratic
				fascism < 0.35
				democratic > 0.30
			}
			AND = {
				has_government = neutrality
				fascism < 0.50
				democratic > 0.30
			}
		}
		is_in_faction = no
		GER = {
			has_government = fascism
			has_completed_focus = GER_soviet_ally
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "ENG"
		value = 500
	}

	ai_strategy = {
		type = alliance
		id = "FRA"
		value = 500
	}
}
soviet_minors = {
	enable = {
		OR = {
			capital_scope = { is_on_continent = asia }
			capital_scope = { is_on_continent = europe }
		}
		has_government = communism
		is_neighbor_of = SOV
		SOV = { 
			has_government = communism
			has_civil_war = no
			is_in_faction = no
		}
		is_in_faction = no
		is_literally_china = no
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "SOV"
		value = 500
	}
}
soviet_minors_SOV = {
	reversed = yes
	allowed = {
		original_tag = SOV
	}
	enable = {
		OR = {
			capital_scope = { is_on_continent = asia }
			capital_scope = { is_on_continent = europe }
		}
		has_government = communism
		is_neighbor_of = SOV
		SOV = { 
			has_government = communism
			has_civil_war = no
			is_in_faction = no
		}
		is_in_faction = no
		OR = {
			is_literally_china = no
			AND = {
				CHI = { has_war_with = JAP }
				NOT = { has_war_with = CHI }
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "SOV"
		value = 500
	}
}
worker_of_the_world_united = {
	reversed = yes
	allowed = {
		original_tag = ENG
	}
	enable = {
		ENG = { is_faction_leader = yes }
		FRA = { has_government = communism }
		has_government = communism
		SOV = { 
			NOT = { has_government = communism }
		}
		is_in_faction = no
		has_war = no
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "ENG"
		value = 500
	}
}

worker_of_the_world_united_rev = {
	enable = {
		ENG = { is_faction_leader = yes }
		FRA = { has_government = communism }
		ENG = { has_government = communism }
		SOV = { 
			NOT = { has_government = communism }
		}
		is_in_faction = no
		has_war = no
		OR = {
			communism > 0.3
			has_government = communism
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "ENG"
		value = 500
	}
}


formation_of_the_reichspakt = {
	enable = {
		FRA = { has_government = communism }
		ENG = { has_government = communism }
		SOV = { has_government = communism }
		GER = { 
			OR = {
				has_government = neutrality
				has_government = democratic 
			}
			is_faction_leader = yes
		} 
		OR = {
			has_government = neutrality
			has_government = democratic 
		}
		capital_scope = { is_on_continent = europe }
		communism < 0.15
		has_war = no
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "GER"
		value = 500
	}
}
formation_of_the_reichspakt_rev = {
	reversed = yes
	allowed = {
		original_tag = GER
	}
	enable = {
		FRA = { has_government = communism }
		ENG = { has_government = communism }
		SOV = { has_government = communism }
		GER = { 
			OR = {
				has_government = neutrality
				has_government = democratic 
			}
			is_faction_leader = yes
		}
		OR = {
			has_government = neutrality
			has_government = democratic 
		}
		communism < 0.15
		capital_scope = { is_on_continent = europe }
		has_war = no
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "GER"
		value = 500
	}
}
anglo_pact_vs_US = {
	reversed = yes
	allowed = {
		original_tag = ENG
	}
	enable = {
		OR = {
			has_government = fascism
			fascism > 0.3
		}
		ENG = {
			is_faction_leader = yes
			has_government = fascism
		}
		capital_scope = { is_on_continent = north_america }
		has_war = no
		is_in_faction = no
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "ENG"
		value = 500
	}
}
anglo_pact_vs_US2 = {
	enable = {
		OR = {
			has_government = fascism
			fascism > 0.3
		}
		ENG = {
			is_faction_leader = yes
			has_government = fascism
		}
		capital_scope = { is_on_continent = north_america }
		has_war = no
		is_in_faction = no
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "ENG"
		value = 500
	}
}
czech_communist_entente = {
	allowed = {
		OR = {
			original_tag = BUL
			original_tag = ROM
			original_tag = YUG
			original_tag = HUN
			original_tag = GRE
			original_tag = TUR
			original_tag = ALB
		}
	}
	enable = {
		CZE = { is_faction_leader = yes }
		OR = {
			AND = {
				OR = {
					communism > 0.4
					has_government = communism
				}
				CZE = { has_government = communism }
			}
			AND = {
				OR = {
					communism > 0.4
					has_government = fascism
				}
				CZE = { has_government = fascism }
			}
			AND = {
				OR = {
					communism > 0.4
					has_government = democratic
				}
				CZE = { has_government = democratic }
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "CZE"
		value = 500
	}
}
czech_communist_entente = {
	reversed = yes
	enable = {
		CZE = { is_faction_leader = yes }
		OR = {
			original_tag = BUL
			original_tag = ROM
			original_tag = YUG
			original_tag = HUN
			original_tag = GRE
			original_tag = TUR
			original_tag = ALB
		}
		OR = {
			AND = {
				OR = {
					communism > 0.4
					has_government = communism
				}
				CZE = { has_government = communism }
			}
			AND = {
				OR = {
					communism > 0.4
					has_government = fascism
				}
				CZE = { has_government = fascism }
			}
			AND = {
				OR = {
					communism > 0.4
					has_government = democratic
				}
				CZE = { has_government = democratic }
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "CZE"
		value = 500
	}
}
yug_communist_entente = {
	allowed = {
		OR = {
			original_tag = BUL
			original_tag = ROM
			original_tag = HUN
			original_tag = GRE
			original_tag = TUR
			original_tag = ALB
		}
	}
	enable = {
		YUG = { is_faction_leader = yes }
		OR = {
			AND = {
				OR = {
					communism > 0.4
					has_government = communism
				}
				YUG = { has_government = communism }
			}
			AND = {
				OR = {
					communism > 0.4
					has_government = fascism
				}
				YUG = { has_government = fascism }
			}
			AND = {
				OR = {
					communism > 0.4
					has_government = democratic
				}
				YUG = { has_government = democratic }
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "YUG"
		value = 500
	}
}
yug_communist_entente = {
	reversed = yes
	enable = {
		YUG = { is_faction_leader = yes }
		OR = {
			original_tag = BUL
			original_tag = ROM
			original_tag = CZE
			original_tag = HUN
			original_tag = GRE
			original_tag = TUR
			original_tag = ALB
		}
		OR = {
			AND = {
				OR = {
					communism > 0.4
					has_government = communism
				}
				CZE = { has_government = communism }
			}
			AND = {
				OR = {
					communism > 0.4
					has_government = fascism
				}
				CZE = { has_government = fascism }
			}
			AND = {
				OR = {
					communism > 0.4
					has_government = democratic
				}
				CZE = { has_government = democratic }
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "YUG"
		value = 500
	}
}

democratic_russia_likes_democratic_western = {
	reversed = yes
	allowed = {
		original_tag = SOV
	}
	enable = {
		SOV = { has_government = democratic }
		has_government = democratic
		is_faction_leader = yes
		OR = {
			original_tag = GER
			original_tag = ENG
			original_tag = FRA
			original_tag = POL
			original_tag = USA
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "SOV"
		value = 500
	}

	ai_strategy = {
		type = befriend
		id = "SOV"
		value = 500
	}

	ai_strategy = {
		type = diplo_action_desire
		id = "SOV"
		target = non_aggression_pact
		value = 9999
	}
}

democratic_western_likes_democratic_russia = {
	enable = {
		SOV = { has_government = democratic }
		has_government = democratic
		is_faction_leader = yes
		OR = {
			original_tag = GER
			original_tag = ENG
			original_tag = FRA
			original_tag = POL
			original_tag = USA
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "SOV"
		value = 500
	}

	ai_strategy = {
		type = befriend
		id = "SOV"
		value = 500
	}

	ai_strategy = {
		type = diplo_action_desire
		id = "SOV"
		target = non_aggression_pact
		value = 9999
	}
}

stresa_front_fascism = {
	allowed = {
		OR = {
			original_tag = ENG
			original_tag = FRA
			original_tag = ITA
		}
	}
	enable = {
		ENG = { has_government = fascism }
		ITA = { has_government = fascism }
		FRA = { has_government = fascism }
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "ENG"
		value = 500
	}

	ai_strategy = {
		type = alliance
		id = "FRA"
		value = 500
	}

	ai_strategy = {
		type = alliance
		id = "ITA"
		value = 500
	}
}

livonia_and_poland_are_friend = {
	allowed = {
		OR = {
			original_tag = POL
			original_tag = LIT
		}
	}
	enable = {
		LIT = { has_completed_focus = LIT_claim_livonia_monarchy }
		POL = { has_completed_focus = POL_assemble_the_regency_council }
		OR = {
			LIT = { is_faction_leader = yes }
			POL = { is_faction_leader = yes }
		}
		NOT = { country_exists = LAT }
		NOT = { country_exists = EST }
		LIT = { is_subject = no }
		POL = { is_subject = no }
		OR = {
			AND = {
				POL = {
					is_faction_leader = yes
				}
				LIT = { 
					OR = {
						has_war = no
						NOT = {
							any_enemy_country = {
								NOT = { has_war_with = POL }
							}
						}
					}
				}
			}
			AND = {
				LIT = {
					is_faction_leader = yes
				}
				POL = { 
					OR = {
						has_war = no
						NOT = {
							any_enemy_country = {
								NOT = { has_war_with = LIT }
							}
						}
					}
				}
			}
		}
	}
	abort_when_not_enabled = yes

	ai_strategy = {
		type = alliance
		id = "POL"
		value = 500
	}

	ai_strategy = {
		type = alliance
		id = "LIT"
		value = 500
	}
}
