on_actions = {
	on_startup = {
		effect = {
			every_country = {
				set_country_flag = originally_existing_country
			}
		}
	}
	on_annex = {
		effect = {
			every_state = {
				limit = { is_claimed_by = FROM }
				remove_claim_by = FROM
			}
		}
	}
	on_liberate = {
		effect = {
			if = {
				limit = {
					ROOT = {
						tag = SOV
						NOT = { has_government = democratic }
					}
				}
				set_politics = { ruling_party = democratic elections_allowed = yes }
				add_ideas = democratic_influence

				set_popularities = {
					fascism = 8
					neutrality = 0
					communism = 29
					democratic = 63
				}

				every_country = {
					limit = { 
						has_government = democratic
						is_faction_leader = yes
					}
					SOV = { 
						add_ai_strategy = {
							type = alliance
							id = PREV
							value = 2000
						}
					} 
					add_ai_strategy = {
						type = alliance
						id = SOV
						value = 2000
					}
				}	
			}
		}
	}
	on_capitulation = {
		effect = {
			if = {
				limit = {
					ROOT = { 
						is_ai = no
						has_civil_war = yes 
					}
					FROM = {
						has_civil_war = yes
						original_tag = ROOT
						has_war_with = ROOT
					}
				}
				random_country = {
					limit = {
						has_civil_war = yes
						has_war_with = ROOT
						original_tag = ROOT
					}
					change_tag_from = ROOT
				}
			}
		}
		effect = {
			if = {
				limit = {
					has_global_flag = mp_difficulty
					NOT = { has_global_flag = vanilla_history }
					date < 1938.5.1
					capital_scope = { is_on_continent = europe }
					NOT = { has_government = democratic }
					ROOT = {
						OR = {
							tag = POL
							tag = GER
							tag = FIN
							tag = AST
							tag = ENG
							tag = FRA
							tag = CZE
							tag = ROM
							tag = TUR
							tag = BUL
							tag = YUG
							tag = SWE
							tag = NOR
							tag = SPR
							tag = POR
							tag = LIT
							tag = LAT
							tag = EST
							tag = CAN
							tag = SAF
							tag = RAJ
							tag = NZL
							tag = DEN
							tag = ITA
							tag = SWI
							tag = HOL
							tag = INS
							tag = BEL
							tag = LUX
							tag = IRE
						}
					}
					FROM = { has_offensive_war_with = ROOT }
					NOT = { FROM = { original_tag = ROOT } }
				}
				FROM = {
					if = { 	
						limit = {
							has_country_flag = war_atrocity
						}
						modify_country_flag = { flag = war_atrocity value = 1 }
					}
					if = { 	
						limit = {
							NOT = { has_country_flag = war_atrocity }
						}
						set_country_flag = { flag = war_atrocity value = 1 }
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { tag = JAP }
				}
				every_state = {
					limit = {
						is_claimed_by = JAP
						NOT = { is_core_of = JAP }
					}
					remove_claim_by = JAP
				}
				if = {
					limit = { 
						has_war_with = SOV
						536 = { controller = { is_in_faction_with = SOV } }
						has_global_flag = kwantung_intervention
					}
					SOV = { transfer_state = 536 }
				}
				if = {
					limit = { 
						has_war_with = USA
						645 = { controller = { is_in_faction_with = USA } }
					}
					USA = { transfer_state = 645 }
				}
				if = {
					limit = { 
						has_war_with = USA
						526 = { controller = { is_in_faction_with = USA } }
					}
					USA = { transfer_state = 526 }
				}
				if = {
					limit = { 
						has_war_with = USA
						646 = { controller = { is_in_faction_with = USA } }
					}
					USA = { transfer_state = 646 }
				}
				if = {
					limit = { 
						has_war_with = USA
						648 = { controller = { is_in_faction_with = USA } }
					}
					USA = { transfer_state = 648 }
				}
				if = {
					limit = { 
						has_war_with = USA
						684 = { controller = { is_in_faction_with = USA } }
					}
					USA = { transfer_state = 684 }
				}
				if = {
					limit = { 
						has_war_with = USA
						633 = { controller = { is_in_faction_with = USA } }
					}
					USA = { transfer_state = 633 }
				}
				if = {
					limit = { 
						has_war_with = USA
						647 = { controller = { is_in_faction_with = USA } }
					}
					USA = { transfer_state = 647 }
				}
			}
		}
		effect = {
			if = {
				limit = { 
					ROOT = { 
						original_tag = ITA
						NOT = { has_government = fascism }
					}
					FROM = { 
						original_tag = ITA
						has_government = fascism
						NOT = { has_completed_focus = ITA_culto_del_duce }
					}
				}
				every_country = {
					limit = {
						original_tag = ITA
						has_government = fascism
						NOT = { has_completed_focus = ITA_culto_del_duce }
					}
					load_focus_tree = {
						tree = italian_focus
						keep_completed = no
					}
					complete_national_focus = ITA_culto_del_duce
					uncomplete_national_focus = { focus = ITA_depose_mussolini }
					complete_national_focus = ITA_foreign_affairs
					complete_national_focus = ITA_the_man_of_providence
					complete_national_focus = ITA_devotion
					complete_national_focus = ITA_capo_supremo
					complete_national_focus = ITA_security_militias
					complete_national_focus = militarism
					set_capital = { state = 2 }
				}
				if = {
					limit = { GER = { has_government = fascism } }
					every_country = {
						limit = {
							original_tag = ITA
							has_government = fascism
						}
						complete_national_focus = ITA_pact_of_steel
						add_ai_strategy = {
							type = alliance
							id = GER
							value = 500
						}
					}
				}	
			}
		}
		effect = {
			if = {
				limit = { 
					ROOT = { 
						has_idea = LSM_surrender_limit
					}
				}
				every_country = {
					limit = {
						has_idea = LSM_surrender_limit
						is_in_faction_with = ROOT
					}
					modify_timed_idea = {
						idea = LSM_surrender_limit
						days = 14
					}
				}
			}
		}
		effect = {
			if = {
				limit = { 
					ROOT = { 
						tag = POL
					}
					is_in_faction_with = ENG
				}
				ENG = {
					division_template = {
						name = "Polish Legion"			
						division_names_group = POL_INF_01
						priority = 1

						regiments = {
							infantry = { x = 0 y = 0 }
							infantry = { x = 0 y = 1 }
							infantry = { x = 0 y = 2 }
							infantry = { x = 1 y = 0 }
							infantry = { x = 1 y = 1 }
							infantry = { x = 1 y = 2 }
							infantry = { x = 2 y = 0 }
							infantry = { x = 2 y = 1 }
							infantry = { x = 2 y = 2 }
						}
	
						support = {
							artillery = { x = 0 y = 0 }
							anti_air = { x = 0 y = 1 }
							engineer = { x = 0 y = 2 }
						}
						
					}
					capital_scope = {
						create_unit = {
							division = "name = \"Polish Legion\" division_template = \"Polish Legion\" start_experience_factor = 1"  
							owner = POL
							allow_spawning_on_enemy_provs = yes  
							count = 16
						}
					}
				}
			}
		}
		effect = {
			if = {
				limit = { 
					ROOT = { 
						is_literally_china = yes
					}
				}
				MON = {
					every_owned_state = {
						add_manpower = 50000
					}
				}
				TAN = {
					every_owned_state = {
						add_manpower = 30000
					}
				}
				TIB = {
					every_owned_state = {
						add_manpower = 25000
					}
				}
				NEP = {
					every_owned_state = {
						add_manpower = 15000
					}
				}
			}
		}
		effect = {
			if = {
				limit = { 
					ROOT = { 
						original_tag = GER
						NOT = { tag = GER }
					}
					FROM = { 
						tag = GER
					}
				}
				ROOT = {
					every_army_leader = {
						set_nationality = GER
					}
				}
				GER = { add_political_power = 25 }
			}
		}
		effect = {
			if = {
				limit = { 
					ROOT = { 
						original_tag = ITA
						NOT = { tag = ITA }
					}
					FROM = { 
						tag = ITA
					}
				}
				ROOT = {
					every_army_leader = {
						set_nationality = ITA
					}
				}
				ITA = { 	
					add_political_power = 150 
					add_stability = 0.05
				}
			}
		}
		effect = {
			if = {
				limit = { 
					ROOT = { 
						original_tag = SOV
						NOT = { tag = SOV }
					}
					FROM = { 
						tag = SOV
						NOT = { has_government = communism }
					}
				}
				ROOT = {
					every_army_leader = {
						limit = {
							has_trait = trait_SOV_stalinist
						}
						remove_unit_leader_trait = trait_SOV_stalinist
					}
					every_army_leader = {
						limit = {
							NOT = { has_trait = politically_connected }
							NOT = { has_trait = old_guard }
							NOT = { has_trait = war_hero }
						}
						set_nationality = SOV
					}
				}
				SOV = { add_political_power = 50 }
				SOV = { add_stability = 0.05 }
			}
		}
		effect = {
			if = {
				limit = { 
					ROOT = { 
						original_tag = SOV
						NOT = { tag = SOV }
					}
					FROM = { 
						tag = SOV
						has_government = communism 
					}
				}
				ROOT = {
					every_army_leader = {
						limit = {
							has_trait = trait_SOV_stalinist
						}
						remove_unit_leader_trait = trait_SOV_stalinist
					}
					every_army_leader = {
						limit = {
							NOT = { has_trait = old_guard }
						}
						set_nationality = SOV
					}
				}
				SOV = { add_political_power = 50 }
				SOV = { add_stability = 0.05 }
				if = {
					limit = { 
						SOV = { has_completed_focus = SOV_the_right_opposition }
					}
					SOV = { create_faction = "Socialist Revolution Front" }
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = {
						tag = ITA
						has_dynamic_modifier = { modifier = SWI_gold_trade_with_switzerland }
					}
				}
				ITA = { remove_dynamic_modifier = { modifier = SWI_gold_trade_with_switzerland } }
				if = {
					limit = {
						ITA = { is_in_faction_with = GER }
						GER = { has_capitulated = no }
						GER = { NOT = { has_dynamic_modifier = { modifier = SWI_gold_trade_with_switzerland } } }
					}
					GER = {
						set_country_flag = SWI_gold_capped_from_transfer
						add_dynamic_modifier = { modifier = SWI_gold_trade_with_switzerland } 
					}
					GER = {
						set_variable = { SWI_gold_trade_consumer_goods_factor = -0.3 }
						set_variable = { SWI_gold_trade_building_speed_factor = 0.09 }
						set_variable = { SWI_gold_trade_research_speed_factor = 0.03 }
						set_variable = { SWI_gold_trade_factory_max_efficiency_factor = 0.105 }
					}
				}
			}
			if = {
				limit = {
					ROOT = {
						tag = GER
						has_dynamic_modifier = { modifier = SWI_gold_trade_with_switzerland }
					}
				}
				GER = { remove_dynamic_modifier = { modifier = SWI_gold_trade_with_switzerland } }
				if = {
					limit = {
						ITA = { is_in_faction_with = GER }
						ITA = { has_capitulated = no }
						ITA = { NOT = { has_dynamic_modifier = { modifier = SWI_gold_trade_with_switzerland } } }
					}
					ITA = {
						set_country_flag = SWI_gold_capped_from_transfer
						add_dynamic_modifier = { modifier = SWI_gold_trade_with_switzerland } 
					}
					ITA = {
						set_variable = { SWI_gold_trade_consumer_goods_factor = -0.3 }
						set_variable = { SWI_gold_trade_building_speed_factor = 0.09 }
						set_variable = { SWI_gold_trade_research_speed_factor = 0.03 }
						set_variable = { SWI_gold_trade_factory_max_efficiency_factor = 0.105 }
					}
				}
			}
			if = {
				limit = {
					ROOT = { tag = FRA }
					GER = { has_country_flag = western_front_stalemate }
				}
				GER = { clr_country_flag = western_front_stalemate }
			}
		}
		effect = {
			if = {
				limit = {
					OR = {
						AND = {
							ROOT = { tag = LIT }
							FROM = { tag = POL }
						}
						AND = {
							ROOT = { tag = POL }
							FROM = { tag = LIT }
						}
					}
					FROM = { is_subject = no }
					OR = {
						FROM = {
							tag = LIT
							controls_state = 11
							controls_state = 189
						}
						FROM = {
							tag = POL
				controls_state = 86
				controls_state = 87
				controls_state = 88
				controls_state = 90
				controls_state = 98
				controls_state = 10
				controls_state = 97
				controls_state = 92
				controls_state = 91
				controls_state = 89
				controls_state = 93
				controls_state = 94
				controls_state = 95
				controls_state = 96
				controls_state = 784
						}
					}
				}
				FROM = { activate_decision = form_commonwealth }		
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { tag = JAP }
					NOT = { 
						any_country = { has_country_flag = this_guy_capitulated_japan }
					}
				}	
				if = {
					limit = {
						any_country = {
							has_war_with = JAP 
							controls_state = 282
							OR = {
								controls_state = 531
								any_other_country = {
									has_war_with = JAP 
									controls_state = 531
									is_in_faction_with = PREV
								}
							}
						}
					}
					random_country = { 
						limit = { 
							has_war_with = JAP
							controls_state = 282
						}
						set_country_flag = this_guy_capitulated_japan
					}
				}	
				else_if = {
					limit = {
						any_country = {
							OR = {
								has_country_flag = nuked_japan_1
								has_country_flag = nuked_japan_2
								has_country_flag = nuked_japan_3
								has_country_flag = nuked_japan_4
								has_country_flag = nuked_japan_5
							}
							NOT = {
								any_other_country = {
									OR = {
										has_country_flag = nuked_japan_1
										has_country_flag = nuked_japan_2
										has_country_flag = nuked_japan_3
										has_country_flag = nuked_japan_4
										has_country_flag = nuked_japan_5
									}
								}
							}		
						}
					}
					random_country = {
						limit = {
							OR = {
								has_country_flag = nuked_japan_1
								has_country_flag = nuked_japan_2
								has_country_flag = nuked_japan_3
								has_country_flag = nuked_japan_4
								has_country_flag = nuked_japan_5
							}
						}
						set_country_flag = this_guy_capitulated_japan
					}
				}
				else_if = {
					limit = {
						any_country = {
							OR = {
								has_country_flag = nuked_japan_1
								has_country_flag = nuked_japan_2
								has_country_flag = nuked_japan_3
								has_country_flag = nuked_japan_4
								has_country_flag = nuked_japan_5
							}
							any_other_country = {
								OR = {
									has_country_flag = nuked_japan_1
									has_country_flag = nuked_japan_2
									has_country_flag = nuked_japan_3
									has_country_flag = nuked_japan_4
									has_country_flag = nuked_japan_5
								}
							}		
						}
					}
					every_country = {
						limit = {
							OR = {
								has_country_flag = nuked_japan_1
								has_country_flag = nuked_japan_2
								has_country_flag = nuked_japan_3
								has_country_flag = nuked_japan_4
								has_country_flag = nuked_japan_5
							}
						}
						set_temp_variable = { nuked_japan_flag = 0 }
						if = {
							limit = {
								has_country_flag = nuked_japan_1
							}
							add_to_temp_variable = { nuked_japan_flag = 1 }
						}
						if = {
							limit = {
								has_country_flag = nuked_japan_2
							}
							add_to_temp_variable = { nuked_japan_flag = 1 }
						}
						if = {
							limit = {
								has_country_flag = nuked_japan_3
							}
							add_to_temp_variable = { nuked_japan_flag = 1 }
						}
						if = {
							limit = {
								has_country_flag = nuked_japan_4
							}
							add_to_temp_variable = { nuked_japan_flag = 1 }
						}
						if = {
							limit = {
								has_country_flag = nuked_japan_5
							}
							add_to_temp_variable = { nuked_japan_flag = 1 }
						}
						if = {
							limit = {
								check_variable = { nuked_japan_flag = 2 compare = greater_than }
							}
							set_country_flag = this_guy_capitulated_japan
						}
					}
				}
				else_if = {
					limit = {
						any_state = {
							is_core_of = JAP
							controller = { is_in_faction_with = FROM }
						}
					}
					FROM = { set_country_flag = this_guy_capitulated_japan }
				}
				else_if = {
					limit = {
						NOT = {
							any_state = {
								is_core_of = JAP
								controller = { is_in_faction_with = FROM }
							}
						}
						any_country = {
							has_war_with = JAP  
							AND = {
								controls_state = 282
								controls_state = 531
							}
						}
					}
					random_country = { 
						limit = { 
							has_war_with = JAP
							AND = {
								controls_state = 282
								controls_state = 531
							}
						}
						set_country_flag = this_guy_capitulated_japan
					}
				}	
				else_if = {
					limit = {
						NOT = {
							any_state = {
								is_core_of = JAP
								controller = { is_in_faction_with = FROM }
							}
						}
						any_country = {
							has_war_with = JAP 
							controls_state = 282
							any_other_country = {
								has_war_with = JAP 
								controls_state = 531
								is_in_faction_with = PREV
							}
						}
					}
					random_country = { 
						limit = { 
							has_war_with = JAP
							controls_state = 282
						}
						set_country_flag = this_guy_capitulated_japan
					}
				}	
				else_if = {
					limit = {
						NOT = {
							any_state = {
								is_core_of = JAP
								controller = { is_in_faction_with = FROM }
							}
						}
						any_country = {
							has_war_with = JAP 
							controls_state = 282
							any_other_country = {
								has_war_with = JAP 
								controls_state = 531
								is_in_faction_with = PREV
							}
						}
					}
					random_country = { 
						limit = { 
							has_war_with = JAP
							OR = {
								controls_state = 282
								controls_state = 531
							}
						}
						set_country_flag = this_guy_capitulated_japan
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { tag = FRA }
					FROM = { tag = GER }
					country_exists = POL
					NOT = { POL = { has_war_with = GER } }
					85 = { owner = { is_in_faction_with = GER } }
					GER = { has_government = fascism }
					NOT = { GER = { is_in_faction_with = POL } }
					POL = { is_subject = no }
					NOT = { has_global_flag = poland_asked_after_fof }
				}
				set_global_flag = poland_asked_after_fof
				POL = {
					country_event = {
						id = LSM_GER_SOV.201
						days = 1
					}
				}			
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { tag = FRA }
					728 = { is_fully_controlled_by = FRA }
					728 = { is_owned_by = FRA }
				}
				CHI = { transfer_state = 728 }		
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { tag = ENG }
					326 = { is_fully_controlled_by = ENG }
					326 = { is_owned_by = ENG }
				}
				CHI = { transfer_state = 326 }			
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { tag = POR }
					729 = { is_fully_controlled_by = POR }
					729 = { is_owned_by = POR }
				}
				CHI = { transfer_state = 729 }			
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { tag = AOI }
					FROM = { tag = ENG }
				}
				ITA = { annex_country = { target = AOI transfer_troops = yes } }
				every_state = {
					limit = {
						OR = {
							is_core_of = ERI
							is_core_of = ETH
							is_core_of = SOM
							is_core_of = AFA
						}
					}
					ENG = { transfer_state = PREV }
				}			
			}
		}
		effect = {
			if = {
				limit = {
					is_historical_focus_on = yes
					ROOT = {
						tag = SOV
					}
					FROM = {
						OR = {
							AND = {
								has_war_with = ENG
								ENG = { is_faction_leader = yes }
							}
							AND = {
								has_war_with = USA
								USA = { is_faction_leader = yes }
							}
							AND = {
								has_war_with = FRA
								FRA = { is_faction_leader = yes }
							}
						}
					}
				}
				set_global_flag = moscow_defeated_flag
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = {
						tag = SOV
					}
					FROM = { 
						capital_scope = { is_on_continent = europe }
					}
					MON = { is_in_faction_with = SOV }
				}
				every_country = {
					limit = { 
						has_war_with = MON 
						NOT = {
							any_country = {
								is_in_faction_with = PREV
								is_faction_leader = yes
								capital_scope = { is_on_continent = asia }
							}
						}
					}
					white_peace = MON
				}
				SOV = { remove_from_faction = MON }
				MON = { add_ideas = LSM_on_our_own_idea }
				if = { 
					limit = {
						621 = { owner = { is_in_faction_with = JAP } }
					}
					JAP = { create_wargoal = { target = MON type = annex_everything } }
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = {
						tag = SOV
					}
					FROM = { 
						capital_scope = { is_on_continent = europe }
					}
					TAN = { is_in_faction_with = SOV }
				}
				every_country = {
					limit = { 
						has_war_with = TAN 
						NOT = {
							any_country = {
								is_in_faction_with = PREV
								is_faction_leader = yes
								capital_scope = { is_on_continent = asia }
							}
						}
					}
					white_peace = TAN
				}
				SOV = { remove_from_faction = TAN }
				TAN = { add_ideas = LSM_on_our_own_idea }
				if = { 
					limit = {
						621 = { owner = { is_in_faction_with = JAP } }
					}
					JAP = { create_wargoal = { target = TAN type = annex_everything } }
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = {
						tag = DEN
						has_war_with = USA
					}
				}
				USA = { transfer_state = 101 }
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = {
						tag = FRA
						any_country = {
							has_war_with = ROOT
							is_ai = no
						}
					}
				}
				FRA = {
					every_owned_state = {
						limit = { 
							is_core_of = FRA
							is_on_continent = europe
							arms_factory > 2
						}
						remove_building = {
							type = arms_factory
							level = 1
						}
						FRA = {
							add_offsite_building = {
								type = arms_factory
								level = 1
								instant_build = yes
							}
						}
					}
					every_owned_state = {
						limit = { 
							is_core_of = FRA
							is_on_continent = europe
							arms_factory > 0
						}
						damage_building = { type = arms_factory damage = 3 }
						damage_building = { type = industrial_complex damage = 3 }
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = {
						tag = FRA
						any_country = {
							has_war_with = ROOT
							is_ai = no
						}
					}
					has_global_flag = FRA_decolonisation_historical
				}
				FRA = {
					every_owned_state = {
						limit = { 
							is_core_of = FRA
							is_on_continent = europe
							arms_factory > 1
						}
						remove_building = {
							type = arms_factory
							level = 2
						}
					}
					every_owned_state = {
						limit = { 
							is_core_of = FRA
							is_on_continent = europe
							arms_factory > 0
						}
						damage_building = { type = arms_factory damage = 2 }
						damage_building = { type = industrial_complex damage = 1 }
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = {
						tag = FRA
						has_war_with = GER
					}
					has_global_flag = is_allowed
				}
				every_country = { 
					limit = {
						OR = {
							AND = {
								tag = ENG
								OR = {
									is_ai = yes
									FRA = {
										has_opinion = {
											target = ENG
											value > 49
										}
									}
								}
								FRA = { democratic > 0.5 }
							}
							AND = {
								tag = SOV
								OR = {
									AND = {
										is_ai = yes
										any_country = {
											has_war_with = FRA
											is_ai = no
										}
									}
									FRA = {
										has_opinion = {
											target = SOV
											value > 49
										}
										communism > 0.1
									}
								}
							}
						}
					}
					country_event = { id = LSM_GER_SOV.473 days = 3 }
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = {
						tag = ITA
						has_war_with = YUG
					}
				}
				if = {
					limit = {
						736 = { owner = { tag = ITA } }
					}
					YUG = { transfer_state = 736 }
					736 = { add_core_of = YUG }
				}
				if = {
					limit = {
						852 = { owner = { tag = ITA } }
					}
					YUG = { transfer_state = 852 }
					852 = { add_core_of = YUG }
				}
				if = {
					limit = {
						163 = { owner = { tag = ITA } }
					}
					YUG = { transfer_state = 163 }
					163 = { add_core_of = YUG }
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = {
						tag = ITA
						has_war_with = ENG
					}
					FROM = { 
						OR = {
							tag = ENG
							is_in_faction_with = ENG
						}
					}
					NOT = {
						any_state = {
							is_core_of = LBA
							controller = { is_in_faction_with = ITA }
						}
					}
				}
				every_state = {
					limit = {
						is_core_of = LBA
					}
					ENG = { transfer_state = PREV }
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = {
						tag = FRA
						is_in_faction_with = ENG
						has_war_with = GER
					}
				}
				every_country = {
					limit = { is_in_faction_with = FRA }
					add_timed_idea = { idea = convoy_panic days = 90 }
				}
				ENG = { add_ideas = battle_of_britain }
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = {
						tag = GER
					}
					GER = { has_war_with = POL }
					has_global_flag = yalta_agreed_flag
					NOT = { has_global_flag = western_betrayal_of_poland }
					NOT = { POL = { is_in_faction_with = SOV } }
					country_exists = SOV
					country_exists = POL
					OR = {
						POL = { is_ai = yes }
						POL = { has_capitulated = yes }
					}
					is_historical_focus_on = yes
				}
				set_global_flag = western_betrayal_of_poland
				SOV = { transfer_state = 763 }
				SOV = { transfer_state = 188 }
				every_state = {
					limit = {
						is_core_of = POL
						OR = {
							is_owned_by = GER
							is_claimed_by = GER
						}
					}
					remove_core_of = GER
					remove_claim_by = GER
					POL = { transfer_state = PREV }
					POL = { transfer_state = 5 }
					SOV = { set_autonomy = { target = POL autonomy_state = autonomy_integrated_puppet } }
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = {
						tag = GER
					}
					OR = {
						NOT = { has_global_flag = yalta_agreed_flag }
						NOT = { country_exists = SOV }
					}
					NOT = { has_global_flag = germany_treaty_poland }
					POL = { is_subject = no }
					NOT = { POL = { is_in_faction_with = SOV } }
					country_exists = POL
					GER = { has_war_with = POL }
					FROM = { is_in_faction_with = POL }
				}
				set_global_flag = germany_treaty_poland
				every_state = {
					limit = {
						is_core_of = POL
						OR = {
							is_owned_by = GER
							is_claimed_by = GER
							controller = { 
								OR = { 
									is_in_faction_with = POL
									is_in_faction_with = GER
								}
							}
						}
					}
					add_core_of = POL
					remove_core_of = GER
					remove_claim_by = GER
					POL = { transfer_state = PREV }
				}
				every_state = {
					limit = {
						OR = {
							state = 5
							state = 763
							state = 188
							state = 63
							state = 68
							state = 66
							state = 67
						}
						is_owned_by = GER
						controller = { 
							OR = { 
								is_in_faction_with = POL
								is_in_faction_with = GER
							}
						}
					}
					add_core_of = POL
					remove_core_of = GER
					remove_claim_by = GER
					POL = { transfer_state = PREV }
				}
				every_state = {
					limit = {
						OR = {
							is_core_of = LAT
							is_core_of = LIT
							is_core_of = EST
						}
						controller = { 
							OR = { 
								is_in_faction_with = POL
								is_in_faction_with = GER
							}
						}
					}
					add_core_of = POL
					remove_core_of = GER
					remove_claim_by = GER
					POL = { transfer_state = PREV }
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = {
						tag = FRA
						has_dynamic_modifier = { modifier = SWI_gold_trade_with_switzerland }
					}
				}
				FRA = { remove_dynamic_modifier = { modifier = SWI_gold_trade_with_switzerland } }
				if = {
					limit = {
						ENG = { is_in_faction_with = FRA }
						ENG = { has_capitulated = no }
						ENG = { NOT = { has_dynamic_modifier = { modifier = SWI_gold_trade_with_switzerland } } }
					}
					ENG = { 
						set_country_flag = SWI_gold_capped_from_transfer
						add_dynamic_modifier = { modifier = SWI_gold_trade_with_switzerland } 
					}
					ENG = {
						set_variable = { SWI_gold_trade_consumer_goods_factor = -0.3 }
						set_variable = { SWI_gold_trade_building_speed_factor = 0.09 }
						set_variable = { SWI_gold_trade_research_speed_factor = 0.03 }
						set_variable = { SWI_gold_trade_factory_max_efficiency_factor = 0.105 }
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { tag = ENG }
					SPR = { has_idea = LSM_on_our_own_idea }
				}
				SPR = { remove_ideas = LSM_on_our_own_idea }
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { tag = CHI }	
					AND = {
						OR = {
							FROM = { tag = PRC } 
							FROM = { is_in_faction_with = PRC }
						}
						PRC = { has_idea = LSM_chinese_civil_war }
					}
				}
				every_country = {
					limit = { 
						is_major = yes
						has_government = democratic
					}
					give_guarantee = CHI
				}
				every_country = {
					limit = {
						is_literally_china = yes
						is_in_faction_with = CHI
						NOT = { tag = CHI }
					}
					PRC = { annex_country = { target = PREV transfer_troops = no } }
				}
				every_country = {
					limit = {
						is_in_faction_with = CHI
						is_literally_china = no
					}
					every_other_country = {
						limit = { 
							has_war_with = CHI 
							is_in_faction_with = PRC 
						}
						white_peace = PREV
					}
				}
				every_country = {
					limit = {
						is_subject_of = CHI
					}
					CHI = { set_autonomy = { target = PREV autonomy_state = autonomy_free } }
				}
				every_state = {
					limit = {
						is_owned_by = CHI
						is_core_of = PRC
						NOT = { state = 524 }
					}
					PRC = { transfer_state = PREV }
				}
				every_country = {
					limit = { 
						has_war_with = CHI 
						is_in_faction_with = PRC 
					}
					CHI = { white_peace = PREV }
				}	
				CHI = { dismantle_faction = yes }
				PRC = { add_named_threat = { threat = -35 name = "The Unification of China" } }
				if = {
					limit = {
						CHI = { controls_state = 524 }
					}
					PRC = { news_event = { hours = 12 id = lsm_news.121 } }
				}
				if = {
					limit = {
						NOT = { CHI = { controls_state = 524 } }
					}
					PRC = { news_event = { hours = 12 id = lsm_news.127 } }
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = {
						tag = ENG
						has_dynamic_modifier = { modifier = SWI_gold_trade_with_switzerland }
					}
				}
				ENG = { remove_dynamic_modifier = { modifier = SWI_gold_trade_with_switzerland } }
				if = {
					limit = {
						ENG = { is_in_faction_with = USA }
						USA = { has_capitulated = no }
						USA = { NOT = { has_dynamic_modifier = { modifier = SWI_gold_trade_with_switzerland } } }
					}
					USA = {  
						set_country_flag = SWI_gold_capped_from_transfer
						add_dynamic_modifier = { modifier = SWI_gold_trade_with_switzerland } 
					}
					USA = {
						set_variable = { SWI_gold_trade_consumer_goods_factor = -0.3 }
						set_variable = { SWI_gold_trade_building_speed_factor = 0.09 }
						set_variable = { SWI_gold_trade_research_speed_factor = 0.03 }
						set_variable = { SWI_gold_trade_factory_max_efficiency_factor = 0.105 }
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						tag = GER 
						has_dynamic_modifier = { modifier = GER_blitzkrieg_modifier }
					}
				}
				ROOT = {
					remove_dynamic_modifier = { modifier = GER_blitzkrieg_modifier }
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { has_tech = JAP_for_the_emperor_tech }
				}
				ROOT = { set_technology = { JAP_for_the_emperor_tech = 0 } }
				every_country = {
					limit = {
						has_tech = USA_artillery_meta
					}
					set_technology = { USA_artillery_meta = 0 }
				}
				every_country = {
					limit = {
						has_tech = USA_flame_tank_meta
					}
					set_technology = { USA_flame_tank_meta = 0 }
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { has_idea = JAP_militarism }
				}
				ROOT = { remove_ideas = JAP_militarism }
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { has_idea = JAP_ichi_go }
				}
				ROOT = { remove_ideas = JAP_ichi_go }
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { has_idea = state_shintoism }
				}
				ROOT = { remove_ideas = state_shintoism }
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { has_idea = spiritual_mobilization_idea }
				}
				ROOT = { remove_ideas = spiritual_mobilization_idea }
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { has_idea = imperial_glory_idea }
				}
				ROOT = { remove_ideas = imperial_glory_idea }
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { has_idea = for_the_emperor_idea }
				}
				ROOT = { remove_ideas = for_the_emperor_idea }
			}
			if = {
				limit = {
					ROOT = { has_idea = JAP_first_air_fleet }
				}
				ROOT = { remove_ideas = JAP_first_air_fleet }
			}
			if = {
				limit = {
					ROOT = { has_idea = JAP_militarism }
				}
				ROOT = { remove_ideas = JAP_militarism }
			}
			if = {
				limit = {
					ROOT = { has_idea = JAP_militarism_shogunate }
				}
				ROOT = { remove_ideas = JAP_militarism_shogunate }
			}
			if = {
				limit = {
					ROOT = { has_idea = JAP_ichi_go }
				}
				ROOT = { remove_ideas = JAP_ichi_go }
			}
		}
		effect = {
			every_country = { 
				limit = { 
					ROOT = { has_wargoal_against = PREV }
				}
				ROOT = {
					remove_wargoal = {
						type = all
						target = PREV
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					NOT = { has_global_flag = treaty_of_nanjing }
					ROOT = { 
						tag = CHI 
						OR = {
							is_faction_leader = yes
							is_in_faction = no 
						}
						OR = {
							is_in_faction_with = PRC
							NOT = { country_exists = PRC }
							PRC = { is_subject_of = CHI }
						}
						OR = {
							is_in_faction_with = SHX
							NOT = { country_exists = SHX }
							SHX = { is_subject_of = CHI }
						}
						OR = {
							is_in_faction_with = XSM
							NOT = { country_exists = XSM }
							XSM = { is_subject_of = CHI }
						}
						OR = {
							is_in_faction_with = SIK
							NOT = { country_exists = SIK }
							SIK = { is_subject_of = CHI }
						}
						OR = {
							is_in_faction_with = GXC
							NOT = { country_exists = GXC }
							GXC = { is_subject_of = CHI }
						}
						OR = {
							is_in_faction_with = YUN
							NOT = { country_exists = YUN }
							YUN = { is_subject_of = CHI }
						}
						NOT = { 
							any_country = { 
								OR = {
									has_war_with = CHI
									is_in_faction_with = CHI
								}
								is_ai = no
								NOT = { is_in_faction_with = JAP }
							}
						}
					}
					FROM = { 
						tag = JAP 
						has_completed_focus = JAP_intervene_in_china
						NOT = { has_country_flag = LSM_eligibility_nation }
					}
				}
				if = {
					limit = {
						country_exists = SIA
						SIA = {
							fascism > 0.2
							is_ai = yes
						}
					}
					SIA = {
						add_popularity = {
							ideology = fascism 
							popularity = 0.50
						}
						add_ai_strategy = {
							type = alliance
							id = "JAP"
							value = 200
						}
						add_ai_strategy = {
							type = alliance
							id = "GER"
							value = -200
						}
						add_ai_strategy = {
							type = alliance
							id = "ITA"
							value = -200
						}	
					}
				}
				if = {
					limit = {
						OR = {
							SIK = { is_in_faction_with = CHI }
							SIK = { is_subject_of = CHI }
							AND = {
								SIK = { has_war_with = JAP }
								is_ai = yes
							}
						}
					}
					JAP = { annex_country = { target = SIK transfer_troops = no } }
				}
				if = {
					limit = {
						OR = {
							PRC = { is_in_faction_with = CHI }
							PRC = { is_subject_of = CHI }
							AND = {
								PRC = { has_war_with = JAP }
								is_ai = yes
							}
						}
					}
					JAP = { annex_country = { target = PRC transfer_troops = no } }
				}
				if = {
					limit = {
						OR = {
							SHX = { is_in_faction_with = CHI }
							SHX = { is_subject_of = CHI }
							AND = {
								SHX = { has_war_with = JAP }
								is_ai = yes
							}
						}
					}
					JAP = { annex_country = { target = SHX transfer_troops = no } }
				}
				if = {
					limit = {
						OR = {
							XSM = { is_in_faction_with = CHI }
							XSM = { is_subject_of = CHI }
							AND = {
								XSM = { has_war_with = JAP }
								is_ai = yes
							}
						}
					}
					JAP = { annex_country = { target = XSM transfer_troops = no } }
				}
				if = {
					limit = {
						OR = {
							YUN = { is_in_faction_with = CHI }
							YUN = { is_subject_of = CHI }
							AND = {
								YUN = { has_war_with = JAP }
								is_ai = yes
							}
						}
					}
					JAP = { annex_country = { target = YUN transfer_troops = no } }
				}
				if = {
					limit = {
						OR = {
							GXC = { is_in_faction_with = CHI }
							GXC = { is_subject_of = CHI }
							AND = {
								GXC = { has_war_with = JAP }
								is_ai = yes
							}
						}
					}
					JAP = { annex_country = { target = GXC transfer_troops = no } }
				}
				JAP = { annex_country = { target = CHI transfer_troops = no } }
				JAP = { add_named_threat = { threat = 20 name = "Treaty of Nanjing" } }
				JAP = {
					country_event = {
						id = LSM_new_world_diplomacy.6
						days = 2
					}
				}
				set_global_flag = treaty_of_nanjing
				JAP = { news_event = { hours = 12 id = lsm_news.120 } }
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { tag = JAP }
					JAP = { has_completed_focus = JAP_intervene_in_china }
					country_exists = CHI
					country_exists = PRC
					OR = {
						CHI = { is_major = yes }
						CHI = { is_faction_leader = yes }
					}
				}
				every_state = {
					limit = { is_core_of = CHI }
					ETH_upgrade_state_category = yes
				}
				if = { 
					limit = { SHX = { is_ai = yes } }
					PRC = { annex_country = { target = SHX transfer_troops = yes } }
				}
				set_temp_variable = { res_steel = 0 }
				set_temp_variable = { res_steel_2 = 0 }
				set_temp_variable = { res_steel_3 = 0 }
				set_temp_variable = { res_steel_4 = 0 }
				set_temp_variable = { res_oil = 0 }
				set_temp_variable = { res_tungsten = 0 }
				set_temp_variable = { res_aluminium = 0 }
				set_temp_variable = { res_aluminium_1 = 0 }
				while_loop_effect = {
					limit = {
						check_variable = { res_steel = 10 compare = less_than }
					}
					random_state = { 
						limit = { is_core_of = CHI } 
						add_resource = { type = steel amount = 10 } 
					}
					add_to_temp_variable = { res_steel = 1 }
				}
				while_loop_effect = {
					limit = {
						check_variable = { res_steel_2 = 6 compare = less_than }
					}
					random_state = { 
						limit = { is_core_of = CHI } 
						add_resource = { type = steel amount = 20 } 
					}
					add_to_temp_variable = { res_steel_2 = 1 }
				}
				while_loop_effect = {
					limit = {
						check_variable = { res_steel_3 = 3 compare = less_than }
					}
					random_state = { 
						limit = { is_core_of = CHI } 
						add_resource = { type = steel amount = 50 } 
					}
					add_to_temp_variable = { res_steel_3 = 1 }
				}
				while_loop_effect = {
					limit = {
						check_variable = { res_steel_4 = 18 compare = less_than }
					}
					random_state = { 
						limit = { is_core_of = CHI } 
						add_resource = { type = steel amount = 5 } 
					}
					add_to_temp_variable = { res_steel_4 = 1 }
				}
				while_loop_effect = {
					limit = {
						check_variable = { res_oil = 3 compare = less_than }
					}
					random_state = { 
						limit = { is_core_of = MAN } 
						add_resource = { type = oil amount = 26 } 
					}
					add_to_temp_variable = { res_oil = 1 }
				}
				while_loop_effect = {
					limit = {
						check_variable = { res_tungsten = 8 compare = less_than }
					}
					random_state = { 
						limit = { 
							OR = {
								is_core_of = GXC 
								is_core_of = XSM 		
							}
						} 
						add_resource = { type = tungsten amount = 10 } 
					}
					add_to_temp_variable = { res_tungsten = 1 }
				}
				while_loop_effect = {
					limit = {
						check_variable = { res_aluminium = 6 compare = less_than }
					}
					random_state = { 
						limit = { is_core_of = CHI } 
						add_resource = { type = aluminium amount = 13 } 
					}
					add_to_temp_variable = { res_aluminium = 1 }
				}
				while_loop_effect = {
					limit = {
						check_variable = { res_aluminium_1 = 3 compare = less_than }
					}
					random_state = { 
						limit = { is_core_of = MAN } 
						add_resource = { type = aluminium amount = 27 } 
					}
					add_to_temp_variable = { res_aluminium_1 = 1 }
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { tag = MAN }
					country_exists = PRC
					has_global_flag = kwantung_intervention
					is_historical_focus_on = yes
				}
				every_state = {
					limit = {
						is_owned_by = MAN
						controller = { is_in_faction_with = SOV }
					}
					PRC = { transfer_state = PREV }
				}
				PRC = { give_military_access = SOV }
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { tag = MEN }
					country_exists = PRC
					has_global_flag = kwantung_intervention
					is_historical_focus_on = yes
				}
				every_state = {
					limit = {
						is_owned_by = MEN
						controller = { is_in_faction_with = SOV }
					}
					PRC = { transfer_state = PREV }
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { tag = JAP }
					country_exists = PRC
					has_global_flag = kwantung_intervention
				}
				every_state = {
					limit = {
						is_core_of = PRC
						controller = { is_in_faction_with = SOV }
						NOT = { is_core_of = GXC }
						NOT = { is_core_of = YUN }
					}
					PRC = { transfer_state = PREV }
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { tag = JAP }
					NOT = { country_exists = PRC }
					has_global_flag = kwantung_intervention
				}
				every_state = {
					limit = {
						is_core_of = PRC
						controller = { is_in_faction_with = SOV }
						NOT = { is_core_of = GXC }
						NOT = { is_core_of = YUN }
					}
					PRC = { transfer_state = PREV }
					PRC = { create_faction = "Chinese Liberation Front" }
				}
				set_global_flag = released_PRC
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { tag = JAP }
					FROM = { has_government = democratic }
				}
				JAP = { 
					if = {
						limit = {
							is_in_faction = yes
							is_faction_leader = no
						}
						random_country = {
							limit = {
								is_in_faction_with = JAP
								is_faction_leader = yes
							}
							remove_from_faction = JAP
						}
					}
					every_country = {
						limit = {
							is_subject_of = JAP
						}
						JAP = { set_autonomy = { target = PREV autonomy_state = autonomy_free } }
						add_timed_idea = { idea = LSM_on_our_own_idea days = 730 }
					}
					add_ideas = JAP_devastation  
					add_ideas = JAP_demobilisation   
					add_timed_idea = { idea = JAP_instability days = 1825 }
					set_politics = { ruling_party = democratic elections_allowed = yes } #good and nice communism has elections

					set_popularities = {
						fascism = 5
						neutrality = 0
						communism = 15
						democratic = 80
					}
					SOV = {
						remove_wargoal = {
							type = all
							target = JAP
						}
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { tag = JAP }
					FROM = { has_government = communism }
				}
				JAP = { 
					if = {
						limit = {
							is_in_faction = yes
							is_faction_leader = no
						}
						random_country = {
							limit = {
								is_in_faction_with = JAP
								is_faction_leader = yes
							}
							remove_from_faction = JAP
						}
					}
					every_country = {
						limit = {
							is_subject_of = JAP
						}
						JAP = { set_autonomy = { target = PREV autonomy_state = autonomy_free } }
						add_timed_idea = { idea = LSM_on_our_own_idea days = 730 }
					}
					add_ideas = JAP_devastation  
					add_ideas = JAP_demobilisation
					set_politics = { ruling_party = communism elections_allowed = no } #good and nice communism has elections

					set_popularities = {
						fascism = 15
						neutrality = 0
						communism = 55
						democratic = 30
					}
					SOV = {
						remove_wargoal = {
							type = all
							target = JAP
						}
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { tag = JAP }
					FROM = { 
						OR = {
							has_government = fascism
							has_government = neutrality 
						}
					}
					is_historical_focus_on = yes
				}
				JAP = { 
					if = {
						limit = {
							is_in_faction = yes
							is_faction_leader = no
						}
						random_country = {
							limit = {
								is_in_faction_with = JAP
								is_faction_leader = yes
							}
							remove_from_faction = JAP
						}
					}
					every_country = {
						limit = {
							is_subject_of = JAP
						}
						JAP = { set_autonomy = { target = PREV autonomy_state = autonomy_free } }
						add_timed_idea = { idea = LSM_on_our_own_idea days = 730 }
					}
					add_ideas = JAP_devastation  
					add_ideas = JAP_demobilisation  
					add_timed_idea = { idea = JAP_instability days = 1095 }
					set_politics = { ruling_party = democratic elections_allowed = yes } #good and nice communism has elections

					set_popularities = {
						fascism = 25
						neutrality = 15
						communism = 30
						democratic = 30
					}
					SOV = {
						remove_wargoal = {
							type = all
							target = JAP
						}
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { tag = JAP }
					ENG = { has_war_with = JAP }
					country_exists = CHI
					is_historical_focus_on = yes
				}
				every_state = {
					limit = {
						is_core_of = CHI
						controller = { is_in_faction_with = ENG }
					}
					CHI = { transfer_state = PREV }
					CHI = { transfer_state = 524 }
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { tag = JAP }
					ENG = { has_war_with = JAP }
					NOT = { country_exists = CHI }
					is_historical_focus_on = yes
				}
				if = {
					limit = { has_global_flag = kwantung_intervention }
					every_state = {
						limit = {
							is_core_of = CHI
							OR = { 
								is_core_of = SIK 
								is_core_of = XSM 
								is_core_of = SHX
								is_core_of = MEN
							}
						}
						PRC = { transfer_state = PREV }
					}
				}
				every_state = {
					limit = {
						is_core_of = CHI
						OR = {
							is_core_of = YUN
							is_core_of = GXC
							AND = { 
								NOT = { is_core_of = XSM } 
								NOT = { is_core_of = SIK } 
								NOT = { is_core_of = MAN } 
								NOT = { is_core_of = MEN } 
								NOT = { is_core_of = SHX }
							}
						}
						controller = { is_in_faction_with = ENG }
					}
					CHI = { transfer_state = PREV }
					CHI = { create_faction = "Chinese United Front" }
					CHI = { transfer_state = 524 }
				}
				set_global_flag = released_CHI
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { tag = JAP }
					has_global_flag = kwantung_intervention
					537 = { owner = { tag = JAP } }
					555 = { owner = { tag = JAP } }
					is_historical_focus_on = yes
				}
				SOV = { transfer_state = 537 }
				SOV = { transfer_state = 555 }
				537 = { add_core_of = SOV }
				555 = { add_core_of = SOV }
				if = {
					limit = {
						536 = { 
							owner = { tag = JAP }
							controller = { is_in_faction_with = SOV }
						}
					}
					SOV = { transfer_state = 536 }
					536 = { add_core_of = SOV }
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { tag = JAP }
					has_global_flag = kwantung_intervention
					527 = { owner = { tag = JAP } }
					525 = { owner = { tag = JAP } }
					is_historical_focus_on = yes
				}
				set_victory_points = {
					province = 7125
					value = 5
				}
				set_victory_points = {
					province = 4056
					value = 5
				}
				if = {
					limit = { KOR = { exists = no } }
					KOR = { transfer_state = 527 }
					KOR = { 
						set_politics = { ruling_party = communism elections_allowed = no } 

							set_popularities = {
								fascism = 5
								neutrality = 0
								communism = 90
								democratic = 5
							} 
							create_faction = "North Korea"
					}
				}	
				JAP = {
					create_dynamic_country = {
						original_tag = KOR

						set_temp_variable = { new_country = this }

						PREV = {
							every_owned_state = {
								limit = { is_core_of = KOR }

								var:new_country = {
									transfer_state = PREV
								}
							}
						}
					}
				}
				every_country = {
					limit = {
						original_tag = KOR
						controls_state = 525
					}
					add_ideas = LSM_on_our_own_idea
					set_politics = { 
						ruling_party = democratic elections_allowed = yes 
					} 

					set_popularities = {
						fascism = 15
						neutrality = 0
						communism = 15
						democratic = 70
					}
					create_faction = "South Korea"
					division_template = {
						name = "Korean Infantry"
						priority = 1
						division_names_group = KOR_INF_01
						regiments = {
							infantry = { x = 0 y = 0 }
							infantry = { x = 0 y = 1 }
							infantry = { x = 0 y = 2 }
							infantry = { x = 0 y = 3 }
							infantry = { x = 0 y = 4 }
						}
						support = {
							artillery = { x = 0 y = 0 }
						}
					}
					525 = {
						create_unit = {
							division = "name = \"South Korean Infantry\" division_template = \"Korean Infantry\" start_experience_factor = 0.15" 
							owner = PREV 
							allow_spawning_on_enemy_provs = yes  
							count = 12  
						}
					}
					set_politics = { ruling_party = democratic elections_allowed = yes }
				}
				every_country = {
					limit = {
						original_tag = KOR
						controls_state = 527
					}
					division_template = {
						name = "North Korean Infantry"
						priority = 1
						division_names_group = KOR_INF_01
						regiments = {
							infantry = { x = 0 y = 0 }
							infantry = { x = 0 y = 1 }
							infantry = { x = 0 y = 2 }
							infantry = { x = 0 y = 3 }
							infantry = { x = 0 y = 4 }
							infantry = { x = 1 y = 0 }
						}
						support = {
							artillery = { x = 0 y = 0 }
						}
					}
					add_ideas = LSM_on_our_own_idea
					527 = {
						create_unit = {
							division = "name = \"North Korean Infantry\" division_template = \"North Korean Infantry\" start_experience_factor = 0.15" 
							owner = KOR  
							allow_spawning_on_enemy_provs = yes  
							count = 20  
						}
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { has_tech = LSM_infantry_anti_tank }
				}
				ROOT = { set_technology = { LSM_infantry_anti_tank = 0 } }
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { has_tech = LSM_infantry_anti_tank_GER }
				}
				ROOT = { set_technology = { LSM_infantry_anti_tank_GER = 0 } }
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { tag = SOV }
					FROM = { 
						tag = GER 
						has_dynamic_modifier = { modifier = GER_blitzkrieg_modifier }
					}
				}
				GER = {
					set_variable = { GER_blitzkrieg = 200 }
					set_variable = { GER_blitzkrieg_resistance = -0.2 }
					set_variable = { GER_blitzkrieg_factory  = 1 }
					set_variable = { GER_blitzkrieg_dockyard = 1 }
					set_variable = { GER_blitzkrieg_repair = 1 }
					set_variable = { GER_blitzkrieg_manpower = 5000 }
					set_variable = { GER_blitzkrieg_speed = 0.4 }
					set_variable = { GER_blitzkrieg_breakthrough = 0.4 }
					set_variable = { GER_blitzkrieg_compliance = 0.8 }
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						tag = POL
					}
					is_historical_focus_on = yes
					POL = { has_war_with = SOV }
					OR = {
						POL = { has_war_with = GER }
						GER = { has_added_tension_amount > 20 }
					}
					NOT = { 
						any_other_country = {
							is_in_faction_with = POL
							has_war_with = SOV
						}
					}
					has_global_flag = sov_yes_pact
					SOV = { has_idea = SOV_molotov_ribbentrop_pact }
				}
				every_state = {
					limit = {
						is_claimed_by = SOV
						is_owned_by = POL
					}
					SOV = { transfer_state = PREV }
				}
				SOV = { 
					white_peace = POL
					add_named_threat = { threat = -3 name = "Poland capitulated to Soviet Union" }
					army_experience = 100
					air_experience = 100
				}
				if = {
					limit = {
						GER = {
							has_military_access_to = SOV
						}
					}
					SOV = {
						diplomatic_relation = { 
							country = GER
							relation = military_access 
							active = no
						}
					}
				}
				if = {
					limit = {
						SOV = {
							has_military_access_to = GER
						}
					}
					GER = {
						diplomatic_relation = { 
							country = SOV
							relation = military_access 
							active = no
						}
					}
				}
			}
		}
	}
	on_startup = {
		effect = {
			URG = {
				set_variable = { GUAY_land_owner_investment_days = 100 }
			}
			PAR = {
				set_variable = { GUAY_land_owner_investment_days = 150 }
			}
		}
		effect = {
			every_country = {
				if = {
					limit = { 	
						date < 1937.1.1
						OR = {
							tag = ITA 
							tag = GER
						}
						is_historical_focus_on = yes 
					}
					add_ideas = low_tension_wargoal_justification
				}
			}
		}
		effect = {
			every_country = {
				if = {
					limit = { 	
						has_war = no
						OR = {
							tag = ENG 
							tag = CAN 
							tag = NOR 
							tag = RAJ 
							tag = AST 
							tag = BRA
						}
					}
					add_ideas = booming_international_trade
				}
			}
			every_country = {
				if = {
					limit = {
						OR = {
							tag = ENG 
							tag = USA
						}
					}
					add_ideas = transatlantic_express
				}
			}
		}
		effect = {
			every_possible_country = {
				if = {
					limit = { is_historical_focus_on = no }
					add_ideas = ahistorical_gameplay
				}
			}
		}
		effect = {
			every_country = {
				if = {
					limit = {	
						date < 1937.1.1
						has_war_with = ITA
						tag = ETH
						is_ai = yes
						NOT = { has_global_flag = mp_difficulty }
						ITA = { is_ai = no }
					}
					add_ideas = pure_manpower_reinforcement
				}
			}
		}
		effect = {
			every_country = {
				if = {
					limit = { 
						tag = MON
					}
					MON = {
						capital_scope = {
							ETH_upgrade_state_category = yes
						}
					}
					330 = { add_manpower = 230000 }
					820 = { add_manpower = 50000 }
					818 = { add_manpower = 35000 }
				}
			}
		}
		effect = { #absolutely prefer neutrality so don't touch them unless you want them to band together
			every_country = {
				if = {
					limit = { 
						is_historical_focus_on = yes
						OR = {
							tag = POR 
							tag = SWE 
							tag = SWI
							tag = TUR
							tag = IRQ
							tag = BHU
							tag = PER 
						}
					}
					add_ideas = LSM_neutrality_idea
				}
			}
		}
		effect = {
			if = {
				limit = { tag = USA }
				division_template = {
					name = "Standard Infantry"
					priority = 1
					division_names_group = USA_INF_01
					regiments = {
						infantry = { x = 0 y = 0 }
						infantry = { x = 0 y = 1 }
						infantry = { x = 0 y = 2 }
						infantry = { x = 0 y = 3 }
						infantry = { x = 0 y = 4 }
						infantry = { x = 1 y = 0 }
						infantry = { x = 1 y = 1 }
						infantry = { x = 1 y = 2 }
						infantry = { x = 1 y = 3 }
						infantry = { x = 1 y = 4 }
						artillery_brigade = { x = 2 y = 0 }
						artillery_brigade = { x = 2 y = 1 }
						artillery_brigade = { x = 2 y = 2 }
						anti_air_brigade = { x = 2 y = 3 }
					}
					support = {
						artillery = { x = 0 y = 0 }
					}
				}
			}
		}
		effect = {
			every_country = {
				if = {
					limit = { has_war = no }
					add_ideas = peace_time_prosperity_neutral
				}
				add_ideas = LSM_production_licensing_idea
				if = {
					limit = { 
						is_ai = yes 
						is_ai_mass_mob = no 
						is_literally_china = no
					}
					add_ideas = training_is_good
				}
				if = {
					limit = { 
						is_ai = yes 
						is_literally_china = yes
					}
					add_ideas = training_is_chi2
				}
				if = {
					limit = { 
						has_war = no
					}
					add_ideas = reduced_xp_gain
				}
				if = {
					limit = { 
						has_war = yes
					}
					add_ideas = increased_xp_gain
				}
				if = {
					limit = { 
						is_ai = yes 
						is_ai_mass_mob = yes
					}
					add_ideas = training_is_goodmm
				}
				if = { 
					limit = { 
						OR = {
							is_ai = yes 
							tag = NEP 
							tag = BHU 
							tag = LIB
						}
					}
					add_ideas = train_train_train
				}
				if = { 
					limit = { 
						tag = JAP
					}
					add_ideas = LSM_production_licensing_idea2
				}
				if = { 
					limit = { 
						tag = SOV
					}
					add_ideas = SOV_infrastructure_improvement_tier_2
				}
				set_variable = { var_displacement = 0 }
			}
		}
		effect = {
			every_country = {
				if = { 
					limit = { 
						is_ai = no
						NOT = { tag = SOV }	
						date < 1937.1.1
						difficulty < 3
					}
					country_event = { id = LSM_startup.1 }
				}
				if = { 
					limit = { 
						is_ai = no
						NOT = { tag = GER }	
						date < 1937.1.1
						difficulty < 3
					}
					country_event = { id = LSM_startup.10 }
				}
				if = { 
					limit = { 
						is_ai = no
						is_historical_focus_on = yes	
						date < 1937.1.1
						difficulty < 3
					}
					country_event = { id = LSM_startup.76 }
				}
				if = { 
					limit = { 
						NOT = { tag = GER }
						is_ai = no
						has_global_flag = necessary	
						date < 1937.1.1
					}
					country_event = { id = LSM_startup.100 }
				}
				if = { 
					limit = { 
						tag = GER
						is_ai = no
						difficulty < 3
					}
					country_event = { id = LSM_startup.77 }
				}
				if = { 
					limit = { 
						tag = SOV
						is_ai = no
						difficulty < 3
					}
					country_event = { id = LSM_startup.78 }
				}
				if = { 
					limit = { 
						tag = FRA
						is_ai = no
						difficulty < 3
					}
					country_event = { id = LSM_startup.79 }
				}
				if = { 
					limit = { 
						NOT = { tag = FRA } 
						NOT = { tag = GER } 
						NOT = { tag = SOV }
						is_ai = no
						difficulty < 3
					}
					country_event = { id = LSM_startup.80 }
				}
				if = { 
					limit = { 
						OR = {
							original_tag = FRA
							original_tag = SOV
							original_tag = JAP
						}
					}
					army_experience = 10
				}
				if = { 
					limit = { 
						OR = {
							original_tag = ENG
							original_tag = USA
							original_tag = JAP
						}
					}
					navy_experience = 20
				}
				if = { 
					limit = { 
						OR = {
							original_tag = GER
							original_tag = ENG
						}
					}
					air_experience = 5
					army_experience = 5
				}
				if = { 
					limit = { 
						is_major = no
					}
					add_ideas = reduced_food_consumption
				}
			}
		}
		effect = {
			every_possible_country = {
				add_ideas = why_are_you_sending_me_troops_fking_puppets
			}
		}
		effect = {
			every_country = {
				if = {
					limit = { 
						OR = {
							tag = FRA
							tag = ENG
						}
						is_ai = yes
						OR = {
							ITA = { is_ai = no }
							GER = { is_ai = no }
						}
					}
					create_field_marshal = {
						name = "Arthur Mornington"
						skill = 1
						attack_skill = 1
						defense_skill = 1
						planning_skill = 1
						logistics_skill = 1
					}
					create_field_marshal = {
						name = "James Caledon"
						skill = 1
						attack_skill = 1
						defense_skill = 1
						planning_skill = 1
						logistics_skill = 1
					}
					create_corps_commander = {
						name = "Phillipe Francois"
						skill = 1
						attack_skill = 1
						defense_skill = 1
						planning_skill = 1
						logistics_skill = 1
					}
					create_corps_commander = {
						name = "Fonta Leclerc"
						skill = 1
						attack_skill = 1
						defense_skill = 1
						planning_skill = 1
						logistics_skill = 1
					}
				}
			}
		}
		effect = {
			JAP = {
				if = {
					limit = { is_ai = yes }
					add_timed_idea = { idea = makeshift_construction days = 1825 }
				}
				if = {
					limit = { is_ai = no }
					add_timed_idea = { idea = makeshift_construction days = 730 }
				}
				add_ideas = warrior_traditions_idea
			}
		}
		effect = {
			ITA = {
				add_ideas = ITA_second_italo_ethiopian_war_army_bonus
			}
		}
		effect = {
			every_country = {
				if = { 
					limit = { 
						is_ai = yes
					}
					add_timed_idea = { idea = temporary_debug_idea_port days = 1460 } #remove in 1940
				}
			}
		}
		effect = {
			SOV = {
				every_owned_state = {
					limit = { 
						OR = {
							state = 398
							state = 407
							state = 402
							state = 582
							state = 573
							state = 572
							state = 403
							state = 571
							state = 570
							state = 578
							state = 882
							state = 569
							state = 568
							state = 567
							state = 566
							state = 564
							state = 565
							state = 563
							state = 561
							state = 560
							state = 657
							state = 409
							state = 408
							state = 586
							state = 732
							state = 405
							state = 742
							state = 229
							state = 230
							state = 231
							state = 245
							state = 265
							state = 244
							state = 208
							state = 246
						}
					}
					ETH_upgrade_state_category = yes
				}
				add_ideas = temporary_debug_idea_navy
			}
		}
		effect = {
			USA = {
				every_owned_state = {
					limit = { 
						is_core_of = USA
						is_in_home_area = yes
					}
					ETH_upgrade_state_category = yes
				}
			}
		}
		effect = {
			CAN = {
				every_owned_state = {
					limit = {
						NOT = { 
							has_state_category = wasteland
						}
					}
					ETH_upgrade_state_category = yes
				}
			}
		}
		effect = {
			RAJ = {
				every_owned_state = {
					limit = {
						NOT = { 
							has_state_category = wasteland
						}
					}
					ETH_upgrade_state_category = yes
				}
			}
		}
		effect = {
			BRA = {
				every_owned_state = {
					limit = {
						is_coastal = yes
					}
					ETH_upgrade_state_category = yes
					ETH_upgrade_state_category = yes
				}
			}
		}
		effect = {
			ARG = {
				every_owned_state = {
					limit = {
						is_coastal = yes
					}
					ETH_upgrade_state_category = yes
					ETH_upgrade_state_category = yes
				}
			}
		}
		effect = {
			URG = {
				every_owned_state = {
					ETH_upgrade_state_category = yes
				}
			}
		}
		effect = {
			CHL = {
				every_owned_state = {
					ETH_upgrade_state_category = yes
				}
			}
		}
		effect = {
			AST = {
				every_owned_state = {
					limit = {
						NOT = { 
							has_state_category = wasteland
						}
					}
					ETH_upgrade_state_category = yes
				}
			}
		}
		effect = {
			SPR = {
				every_owned_state = {
					limit = {
						NOT = { 
							is_in_home_area = yes
						}
					}
					ETH_upgrade_state_category = yes
					ETH_upgrade_state_category = yes
				}
			}
		}
		effect = {
			POR = {
				every_owned_state = {
					limit = {
						NOT = { 
							is_in_home_area = yes
						}
					}
					ETH_upgrade_state_category = yes
				}
			}
		}
		effect = {
			every_state = {
				limit = {
					OR = { 
						state = 110 
						state = 37 
						state = 266 
						state = 850 
						state = 39
					}
				}
				ETH_upgrade_state_category = yes
			}
		}
		effect = {
			if = {
				limit = {
					SPR = { is_ai = yes }
					is_historical_focus_on = yes
				}
				SPR = { add_ideas = LSM_on_our_own_idea }
			}
		}
		effect = {
			if = {
				limit = {
					POR = { is_ai = yes }
					is_historical_focus_on = yes
				}
				POR = { add_ideas = LSM_on_our_own_idea }
			}
		}
		effect = {
			MEX = {
				every_owned_state = {
					ETH_upgrade_state_category = yes
				}
				add_stability = 0.15
			}
		}
		effect = {
			HUN = {
				every_owned_state = {
					ETH_upgrade_state_category = yes
				}
			}
		}
		effect = {
			ROM = {
				every_owned_state = {
					ETH_upgrade_state_category = yes
				}
			}
		}
		effect = {
			SWE = {
				if = {
					limit = { is_ai = yes }
					add_ideas = free_trade
				}
			}
			if = {
				limit = { INS = { is_ai = yes } }
				INS = {
					add_ideas = closed_economy
					add_ideas = eco_banned
				}
			}
			if = {
				limit = { FRA = { is_ai = yes } }
				VIN = {
					add_ideas = closed_economy
					add_ideas = eco_banned
				}
			}
		}
		effect = {
			SOV = {
				if = { 
					limit = { 
						is_ai = yes 	
						date < 1937.1.1
					}
					add_timed_idea = { idea = SOV_high_command days = 270 }
					add_timed_idea = { idea = SOV_high_command_2 days = 730 }
				}
			}
		}
		effect = {
			every_country = {
				if = {
					limit = { 
						is_literally_china = yes
						is_ai = yes 	
						date < 1937.1.1
					}
					add_timed_idea = { idea = CHI_high_command days = 365 }
				}
			}
		}
		effect = {
			USA = {
				if = {
					limit = { 
						is_ai = yes 	
						date < 1937.1.1
					}
					add_ideas = USA_high_command
				}
			}
		}
		effect = {
			HUN = {
				if = {
					limit = { 
						is_ai = yes 	
						date < 1937.1.1
					}
					add_timed_idea = { idea = USA_high_command days = 210 }
				}
			}
		}
		effect = {
			ENG = {
				if = {
					limit = { 
						is_ai = yes 	
						date < 1937.1.1
					}
					add_timed_idea = { idea = ENG_high_command days = 300 }
				}
			}
		}
		effect = {
			BUL = {
				if = {
					limit = { 
						is_ai = yes 	
						date < 1937.1.1
					}
					BUL_halve_faction_management_decision_times = yes
					BUL_halve_faction_management_decision_times = yes
					add_to_variable = { BUL_faction_low_increase = 10 }
					add_to_variable = { BUL_faction_medium_increase = 10 }
					add_to_variable = { BUL_faction_high_increase = 10 }
					add_to_variable = { BUL_faction_low_decrease = -10 }
					add_to_variable = { BUL_faction_medium_decrease = -10 }
					add_to_variable = { BUL_faction_high_decrease = -10 }
				}
			}
		}
		effect = {
			GER = {
				if = { 
					limit = { 
						is_ai = yes 
						date < 1937.1.1
						has_global_flag = AI_is_balanced
					}
					add_ideas = GER_high_command
				}
				add_ideas = temporary_debug_idea_navy
			}
		}
		effect = {
			FRA = {
				add_war_support = 0.01
			}
		}
		effect = {
			if = {
				limit = {
					OR = {
						tag = NOR
						tag = BRA
						tag = ARG
						tag = CHL
						tag = URG
						tag = PAR
						tag = TAN
						tag = MON
						tag = MAL
						tag = MEN
						tag = ICE
					}
				}
				add_research_slot = 1
			}
		}
		effect = {
			615 = {
				add_building_construction = {
					type = supply_node
					level = 1
					instant_build = yes
					province = 10507
				}
			}
			set_victory_points = {
				province = 11980
				value = 3
			}
			set_province_name = { id = 11980 name = "Cangzhou" }
			614 = {
				add_building_construction = {
					type = supply_node
					level = 1
					instant_build = yes
					province = 11980
				}
			}
			set_victory_points = {
				province = 7142
				value = 3
			}
			set_province_name = { id = 7142 name = "Yancheng" }
			603 = {
				add_building_construction = {
					type = supply_node
					level = 1
					instant_build = yes
					province = 7521
				}
			}
			561 = {
				add_building_construction = {
					type = supply_node
					level = 1
					instant_build = yes
					province = 10678
				}
			}
			379 = {
				add_building_construction = {
					type = supply_node
					level = 1
					instant_build = yes
					province = 4736
				}
			}
			47 = {
				add_building_construction = {
					type = supply_node
					level = 1
					instant_build = yes
					province = 6930
				}
			}
			185 = {
				add_building_construction = {
					type = naval_base
					level = 1
					instant_build = yes
					province = 1205
				}
			}
			724 = {
				add_building_construction = {
					type = naval_base
					level = 2
					instant_build = yes
					province = 7236
				}
			}
			288 = {
				add_building_construction = {
					type = naval_base
					level = 2
					instant_build = yes
					province = 12292
				}
			}
			127 = {
				add_building_construction = {
					type = naval_base
					level = 4
					instant_build = yes
					province = 3501
				}
			}
			459 = {
				add_building_construction = {
					type = naval_base
					level = 4
					instant_build = yes
					province = 1145
				}
			}
			116 = {
				add_building_construction = {
					type = naval_base
					level = 4
					instant_build = yes
					province = 12003
				}
				add_building_construction = {
					type = air_base
					instant_build = yes
					level = 2
				}
				add_building_construction = {
					type = infrastructure
					instant_build = yes
					level = 2
				}
				add_building_construction = {
					type = anti_air_building
					instant_build = yes
					level = 2
				}		
			}
			736 = {
				add_building_construction = {
					type = supply_node
					level = 1
					instant_build = yes
					province = 6609
				}
			}
			263 = {
				add_building_construction = {
					type = supply_node
					level = 1
					instant_build = yes
					province = 117
				}
			}
			246 = {
				add_building_construction = {
					type = supply_node
					level = 1
					instant_build = yes
					province = 187
				}
			}
			13 = {
				add_building_construction = {
					type = supply_node
					level = 1
					instant_build = yes
					province = 11291
				}
			}
			79 = {
				add_building_construction = {
					type = supply_node
					level = 1
					instant_build = yes
					province = 11652
				}
			}
			84 = {
				add_building_construction = {
					type = supply_node
					level = 1
					instant_build = yes
					province = 11639
				}
			}
			665 = {
				add_building_construction = {
					type = naval_base
					province = 7005
					level = 1
					instant_build = yes
				}
			}
			527 = {
				add_building_construction = {
					type = naval_base
					province = 4052
					level = 3
					instant_build = yes
				}
			}
			29 = {
				add_building_construction = {
					type = naval_base
					province = 11548
					level = 3
					instant_build = yes
				}
			}
			15 = {
				add_building_construction = {
					type = naval_base
					province = 485
					level = 4
					instant_build = yes
				}
				add_building_construction = {
					type = naval_base
					province = 6449
					level = 4
					instant_build = yes
				}
				add_building_construction = {
					type = naval_base
					province = 11535
					level = 3
					instant_build = yes
				}
			}
			197 = {
				add_building_construction = {
					type = naval_base
					province = 11683
					level = 2
					instant_build = yes
				}
			}
			196= {
				add_building_construction = {
					type = naval_base
					province = 721
					level = 1
					instant_build = yes
				}
			}
			29 = {
				add_building_construction = {
					type = naval_base
					province = 11548
					level = 1
					instant_build = yes
				}
			}
			47 = {
				add_building_construction = {
					type = naval_base
					province = 3973
					level = 2
					instant_build = yes
				}
			}
			31 = {
				add_building_construction = {
					type = naval_base
					province = 3946
					level = 2
					instant_build = yes
				}
			}
			14 = {
				add_building_construction = {
					type = naval_base
					province = 9525
					level = 3
					instant_build = yes
				}
			}
			458 = {
				add_building_construction = {
					type = naval_base
					province = 11921
					level = 1
					instant_build = yes
				}
			}
		}
		effect = {
			if = { 
				limit = { 
					has_dlc = "Man the Guns" 
					date < 1937.1.1
				}
				every_country = {
					limit = {
						OR = {
							tag = CAN
							tag = RAJ
							tag = AST
							tag = SAF
							tag = NZL
						}
					}
					set_technology = { early_ship_hull_submarine = 1 popup = no }
					create_equipment_variant = {
						name = "Commonwealth Class"
						type = ship_hull_submarine_1
						name_group = ENG_SS_HISTORICAL
						parent_version = 0
						allow_without_tech = yes #Makes no difference since checks for tech, for tooltip purposes only
							modules = {
							fixed_ship_engine_slot = sub_ship_engine_1
							fixed_ship_torpedo_slot = ship_torpedo_sub_1
							rear_1_custom_slot = empty
						}
					}
				}
			}
		}
		effect = {	
			if = { #MP life
				limit = { is_historical_focus_on = yes }
				every_country = {
					limit = {
						is_axis_ai = yes
						NOT = { tag = SWE }
					}
					every_other_country = {
						limit = { 
							is_axis_ai = yes 
							NOT = { tag = SWE }
						}
						add_opinion_modifier = {
				   			target = PREV
				   			modifier = trade_relation_bonus_high
						}
						add_relation_modifier = {
							target = PREV
							modifier = LSM_coordinate_rearmament
						}		
					}	
				}
				every_country = {
					limit = {
						tag = GER
					}
					every_other_country = {
						limit = { 
							is_axis_ai = yes
						}
						add_opinion_modifier = {
				   			target = PREV
				   			modifier = trade_relation_bonus_high_1
						}		
					}	
				}
				every_country = {
					limit = {
						is_axis_ai = yes
					}
					every_other_country = {
						limit = { 
							tag = GER
						}
						add_opinion_modifier = {
				   			target = PREV
				   			modifier = trade_relation_bonus_high_1
						}		
					}	
				}
			}
		}
		effect = {	
			if = { #MP life
				limit = { is_historical_focus_on = yes }
				every_country = {
					limit = {
						is_allied_ai = yes
					}
					every_other_country = {
						limit = { is_allied_ai = yes }
						add_opinion_modifier = {
				   			target = PREV
				   			modifier = trade_relation_bonus_high
						}
						add_opinion_modifier = {
				   			target = PREV
				   			modifier = trade_relation_bonus_high_1
						}
						add_relation_modifier = {
							target = PREV
							modifier = LSM_coordinate_rearmament
						}		
					}	
				}
			}
		}
		effect = {
			458 = {
				add_building_construction = {
					type = naval_base
					province = 11969
					level = 2
					instant_build = yes
				}
			}
			452 = {
				add_building_construction = {
					type = naval_base
					province = 10061
					level = 1
					instant_build = yes
				}
			}
			449 = {
				add_building_construction = {
					type = naval_base
					province = 10046
					level = 1
					instant_build = yes
				}
			}
			22 = {
				add_building_construction = {
					type = naval_base
					province = 9898
					level = 1
					instant_build = yes
				}
			}
		}
		effect = {
			if = {
				limit = {
					has_dlc = "Man the Guns"
					ENG = { is_ai = yes } 
					date < 1937.1.1
				}
				ENG = {
				create_equipment_variant = { 
					name = "1936 Cruiser Hull A1"
					name_group = ENG_CL_HISTORICAL
					parent_version = 0
					allow_without_tech = yes #Makes no difference since focus grants appropriate tech (above), but it improves tooltip
					type = ship_hull_cruiser_2
					modules = {
						fixed_ship_battery_slot = ship_light_medium_battery_2
						fixed_ship_anti_air_slot = ship_anti_air_1
						fixed_ship_fire_control_system_slot = ship_fire_control_system_1
						fixed_ship_radar_slot = empty
						fixed_ship_engine_slot = cruiser_ship_engine_2
						fixed_ship_armor_slot = ship_armor_cruiser_2
						fixed_ship_secondaries_slot = dp_ship_secondaries_1
						front_1_custom_slot = ship_light_medium_battery_2
						mid_1_custom_slot = ship_light_medium_battery_2
						mid_2_custom_slot = ship_light_medium_battery_2
						rear_1_custom_slot = ship_light_medium_battery_2
					}
					design_team = mio:ENG_john_brown_organization
				}
				}
			}
		}
		effect = {
			if = {
				limit = {
					has_dlc = "Man the Guns"
					USA = { is_ai = yes } 
					date < 1937.1.1
				}
				USA = {
				create_equipment_variant = { 
					name = "1936 Cruiser Hull A2"
					name_group = USA_CL_HISTORICAL
					parent_version = 0
					allow_without_tech = yes #Makes no difference since focus grants appropriate tech (above), but it improves tooltip
					type = ship_hull_cruiser_2
					modules = {
						fixed_ship_battery_slot = ship_light_medium_battery_2
						fixed_ship_anti_air_slot = ship_anti_air_1
						fixed_ship_fire_control_system_slot = ship_fire_control_system_1
						fixed_ship_radar_slot = empty
						fixed_ship_engine_slot = cruiser_ship_engine_2
						fixed_ship_armor_slot = ship_armor_cruiser_2
						fixed_ship_secondaries_slot = dp_ship_secondaries_1
						front_1_custom_slot = ship_light_medium_battery_2
						mid_1_custom_slot = ship_light_medium_battery_2
						mid_2_custom_slot = ship_light_medium_battery_2
						rear_1_custom_slot = ship_light_medium_battery_2
					}
					design_team = mio:USA_electric_boat_company_organization
				}
				}
			}
		}
		effect = {
			every_state = {
				limit = { 
					OR = {
						is_core_of = BLR 
						is_core_of = UKR   
						is_core_of = ITA   
					}
				}
				add_building_construction = {
					type = supply_node
					level = 1
					instant_build = yes
					province = {
						all_provinces = yes
						limit_to_victory_point > 3
					}
				}
			}
			every_state = {
				limit = { 
					OR = {
						is_core_of = LIT  
						is_core_of = LAT  
						is_core_of = EST  
					}
				}
				add_building_construction = {
					type = supply_node
					level = 1
					instant_build = yes
					province = {
						all_provinces = yes
						limit_to_victory_point > 3
					}
				}
			}
		}
		effect = {
			every_state = {
				limit = { 
					OR = {
						is_core_of = FRA 
						is_core_of = ENG 
						is_core_of = GER  
						is_core_of = HOL  
						is_core_of = BEL   
						is_core_of = YUG
					}
				}
				add_building_construction = {
					type = supply_node
					level = 1
					instant_build = yes
					province = {
						all_provinces = yes
						limit_to_victory_point > 4
					}
				}
			}
		}
	}
	on_monthly = {
		effect = {
			if = {
				limit = {
					world_war_is_active = yes
					has_global_flag = italy_want_it_easy
					ROOT = {
						tag = ITA
						has_dynamic_modifier = { modifier = SWI_gold_trade_with_switzerland }
					}
				}
				if = {
					limit = {
						ITA = { is_in_faction_with = GER }
						GER = { has_capitulated = no }
						GER = { NOT = { has_dynamic_modifier = { modifier = SWI_gold_trade_with_switzerland } } }
					}
					GER = {
						set_country_flag = SWI_gold_capped_from_transfer
						add_dynamic_modifier = { modifier = SWI_gold_trade_with_switzerland } 
					}
					GER = {
						set_variable = { SWI_gold_trade_consumer_goods_factor = -0.3 }
						set_variable = { SWI_gold_trade_building_speed_factor = 0.09 }
						set_variable = { SWI_gold_trade_research_speed_factor = 0.03 }
						set_variable = { SWI_gold_trade_factory_max_efficiency_factor = 0.105 }
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					world_war_is_active = yes
					has_global_flag = italy_want_it_easy
					ROOT = {
						tag = GER
						has_dynamic_modifier = { modifier = SWI_gold_trade_with_switzerland }
					}
				}
				if = {
					limit = {
						ITA = { is_in_faction_with = GER }
						ITA = { has_capitulated = no }
						ITA = { NOT = { has_dynamic_modifier = { modifier = SWI_gold_trade_with_switzerland } } }
					}
					ITA = {
						set_country_flag = SWI_gold_capped_from_transfer
						add_dynamic_modifier = { modifier = SWI_gold_trade_with_switzerland } 
					}
					ITA = {
						set_variable = { SWI_gold_trade_consumer_goods_factor = -0.3 }
						set_variable = { SWI_gold_trade_building_speed_factor = 0.09 }
						set_variable = { SWI_gold_trade_research_speed_factor = 0.03 }
						set_variable = { SWI_gold_trade_factory_max_efficiency_factor = 0.105 }
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { has_country_flag = { flag = war_atrocity value > 5 } }
					NOT = { has_global_flag = ragnarok_enabled }
				}
				set_global_flag = ragnarok_enabled
				ROOT = { 
					news_event = { hours = 12 id = lsm_news.1112 }
				}
				every_other_country = {
					limit = {
						OR = {
							capital_scope = { is_on_continent = europe }
							tag = USA
						}
						NOT = { is_in_faction_with = ROOT }
					}
					set_rule = { can_guarantee_other_ideologies = yes }
					set_rule = { can_send_volunteers = yes }
					add_ai_strategy = {
						type = alliance
						id = ROOT
						value = -200
					}
					add_ai_strategy = {
						type = antagonize
						id = ROOT
						value = 200
					}
					add_ai_strategy = {
						type = contain
						id = ROOT
						value = 200
					}
					add_ai_strategy = {
						type = befriend
						id = ROOT
						value = -200
					}
					add_ai_strategy = {
						type = send_volunteers_desire
						id = ROOT
						value = -200
					}
					add_ai_strategy = {
						type = send_lend_lease_desire
						id = ROOT
						value = -200
					}
					add_ai_strategy = {
						type = support
						id = ROOT
						value = -200
					}
				}
				every_other_country = {
					limit = {
						OR = {
							capital_scope = { is_on_continent = europe }
							tag = USA
						}
						NOT = { is_in_faction_with = ROOT }
					}
					every_other_country = {
						limit = {
							OR = {
								capital_scope = { is_on_continent = europe }
								tag = USA
							}
							NOT = { is_in_faction_with = ROOT }
							NOT = { tag = ROOT }
							NOT = { tag = PREV }
							NOT = { has_war_with = PREV }
						}	
						add_ai_strategy = {
							type = alliance
							id = PREV
							value = 500
						}	
						add_ai_strategy = {
							type = befriend
							id = PREV
							value = 500
						}		
						add_ai_strategy = {
							type = protect
							id = PREV
							value = 500
						}		
						add_ai_strategy = {
							type = support
							id = PREV
							value = 500
						}
						add_ai_strategy = {
							type = send_volunteers_desire
							id = PREV
							value = 500
						}
						add_ai_strategy = {
							type = send_lend_lease_desire
							id = PREV
							value = 500
						}
						add_ai_strategy = {
							type = diplo_action_acceptance
							id = PREV
							target = military_access
							value = 1000
						}
						add_ai_strategy = {
							type = diplo_action_desire
							id = PREV
							target = military_access
							value = 1000
						}
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					has_war = yes
					OR = {
						is_in_faction = no
						is_faction_leader = yes
					}
					is_ai = yes
					any_country = {
						has_war_with = ROOT
						any_other_country = {
							NOT = { 
								ROOT = { has_wargoal_against = PREV } 
							}
							is_subject_of = PREV
							OR = {
								is_in_faction_with = PREV
								NOT = { has_country_flag = DEN_has_occupation_flag }
							}		
							NOT = { has_war_with = ROOT }
						}
					}
				}
				every_country = {
					limit = {
						NOT = { has_war_with = ROOT }
						NOT = { 
							ROOT = { has_wargoal_against = PREV } 
						}
						any_other_country = {
							has_war_with = ROOT
							if = {
								limit = {
									tag = DEN
									has_country_flag = DEN_has_occupation_flag
								}
								is_in_faction_with = PREV
							}
							PREV = { is_subject_of = PREV }
						}
					}
					ROOT = {
						create_wargoal = {
							type = topple_government
							target = PREV
						}
						add_ai_strategy = { type = declare_war id = PREV value = 100 }
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					VIN = { 
						has_country_leader_with_trait = mekong_meth_king 
						has_idea = VIN_colonial_exploitation_4
					}
				}
				every_country = {
					limit = {
						OR = {
							tag = VIN
							is_in_faction_with = VIN
							is_subject_of = VIN
							VIN = { is_subject_of = PREV }
						}
					}
					if = {
						limit = {
							NOT = { 
								any_army_leader = {
									NOT = { has_trait = substance_abuser }
								}
							}
						}
						add_country_leader_trait = meth_addict
					}
					if = {
						limit = {
							NOT = { 
								any_army_leader = {
									NOT = { has_trait = substance_addict }
								}
							}
						}
						add_country_leader_trait = meth_embodiment
					}
					every_army_leader = {
						random_select_amount = 1
						limit = {
							NOT = {
								has_trait = substance_addict
							}
						}

						add_trait = {
							trait = substance_addict
						}
					}
					every_army_leader = {
						random_select_amount = 3
						limit = {
							NOT = {
								has_trait = substance_abuser
							}
						}

						add_trait = {
							trait = substance_abuser
						}
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					date > 1936.3.31
					date < 1937.1.1
					NOT = { has_global_flag = volunteer_spike }
					ITA = { is_ai = yes }
				}
				set_global_flag = volunteer_spike
				every_country = {
					limit = {
						has_volunteers_amount_from = { tag = SOV count > 0 }
					}
					SOV = { recall_volunteers_from = PREV }
					SOV = { army_experience = 30 }
					SOV = { air_experience = 20 }
				}
			}
		}
		effect = {
			if = {
				limit = {
					GER = { has_war_with = POL }
					SOV = { has_war_with = POL }
					GER = { has_war_with = ENG }
					SOV = { has_war_with = ENG }
					NOT = {
						any_country = {
							is_in_faction_with = GER
							has_war_with = SOV
						}
					}
					NOT = {
						any_country = {
							is_in_faction_with = SOV
							has_war_with = GER
						}
					}
					NOT = { GER = { has_war_with = SOV } }
					has_global_flag = {
						flag = molotov_ribbentrop_fulfillment_grace
						days > 90
					}
					SOV = { has_idea = SOV_molotov_ribbentrop_pact }
				}
				GER = {
					country_event = {
						id = LSM_GER_SOV.505
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					NOT = { has_tech = mtg_transport }
					NOT = { is_researching_technology = mtg_transport }
					has_war = yes
					is_major = yes
					any_enemy_country = { NOT = { is_neighbor_of = ROOT } }
					date > 1940.1.1
				}
				set_technology = { mtg_transport = 1 popup = no }
			}
		}
		effect = {
			if = {
				limit = {
					date > 1940.1.1
					tag = GER
					NOT = { has_tech = marines }
					SOV = { is_ai = no }
					GER = { is_ai = yes }
				}
				GER = { set_technology = { marines = 1 popup = no } }
			}
		}
		effect = {
			if = {
				limit = {
					date > 1936.3.1
					tag = JAP
					NOT = { has_country_flag = JAP_added_infrastructure }
					JAP = { is_ai = yes }
				}
				JAP = {
					set_country_flag = JAP_added_infrastucture
					random_owned_controlled_state = {
						limit = {
							free_building_slots = {
								building = infrastructure
								size > 0
							}
							OR = {
								is_in_home_area = yes
								NOT = {
									owner = {
										any_owned_state = {
											free_building_slots = {
												building = infrastructure
												size > 0
											}
											is_in_home_area = yes
										}
									}
								}
							}
						}
						add_building_construction = {
							type = infrastructure
							level = 1
							instant_build = yes
						}
					}
					random_owned_controlled_state = {
						limit = {
							free_building_slots = {
								building = infrastructure
								size > 0
							}
							OR = {
								is_in_home_area = yes
								NOT = {
									owner = {
										any_owned_state = {
											free_building_slots = {
												building = infrastructure
												size > 0
											}
											is_in_home_area = yes
										}
									}
								}
							}
						}
						add_building_construction = {
							type = infrastructure
							level = 1
							instant_build = yes
						}
					}	
					random_owned_controlled_state = {
						limit = {
							free_building_slots = {
								building = infrastructure
								size > 0
							}
							OR = {
								is_in_home_area = yes
								NOT = {
									owner = {
										any_owned_state = {
											free_building_slots = {
												building = infrastructure
												size > 0
											}
											is_in_home_area = yes
										}
									}
								}
							}
						}
						add_building_construction = {
							type = infrastructure
							level = 1
							instant_build = yes
						}
					}	
				}
			}
		}
		effect = {
			if = {
				limit = {
					date > 1937.1.1
					tag = JAP
					NOT = { has_country_flag = JAP_added_arms_factory }
					JAP = { is_ai = yes }
				}
				JAP = {
					set_country_flag = JAP_added_arms_factory
					random_owned_controlled_state = {
						limit = {
							free_building_slots = {
								building = arms_factory
								size > 0
							}
							OR = {
								is_in_home_area = yes
								NOT = {
									owner = {
										any_owned_state = {
											free_building_slots = {
												building = arms_factory
												size > 0
											}
											is_in_home_area = yes
										}
									}
								}
							}
						}
						add_building_construction = {
							type = arms_factory
							level = 1
							instant_build = yes
						}
					}
					random_owned_controlled_state = {
						limit = {
							free_building_slots = {
								building = arms_factory
								size > 0
							}
							OR = {
								is_in_home_area = yes
								NOT = {
									owner = {
										any_owned_state = {
											free_building_slots = {
												building = arms_factory
												size > 0
											}
											is_in_home_area = yes
										}
									}
								}
							}
						}
						add_building_construction = {
							type = arms_factory
							level = 1
							instant_build = yes
						}
					}
					random_owned_controlled_state = {
						limit = {
							free_building_slots = {
								building = arms_factory
								size > 0
							}
							OR = {
								is_in_home_area = yes
								NOT = {
									owner = {
										any_owned_state = {
											free_building_slots = {
												building = arms_factory
												size > 0
											}
											is_in_home_area = yes
										}
									}
								}
							}
						}
						add_building_construction = {
							type = arms_factory
							level = 1
							instant_build = yes
						}
					}		
				}
			}
		}
		effect = {
			if = {
				limit = {
					date > 1936.7.1
					tag = JAP
					NOT = { has_country_flag = JAP_added_industrial_complex }
					JAP = { is_ai = yes }
				}
				JAP = {
					set_country_flag = JAP_added_industrial_complex
					random_owned_controlled_state = {
						limit = {
							free_building_slots = {
								building = industrial_complex
								size > 0
							}
							OR = {
								is_in_home_area = yes
								NOT = {
									owner = {
										any_owned_state = {
											free_building_slots = {
												building = industrial_complex
												size > 0
											}
											is_in_home_area = yes
										}
									}
								}
							}
						}
						add_building_construction = {
							type = industrial_complex
							level = 1
							instant_build = yes
						}
					}
					random_owned_controlled_state = {
						limit = {
							free_building_slots = {
								building = industrial_complex
								size > 0
							}
							OR = {
								is_in_home_area = yes
								NOT = {
									owner = {
										any_owned_state = {
											free_building_slots = {
												building = industrial_complex
												size > 0
											}
											is_in_home_area = yes
										}
									}
								}
							}
						}
						add_building_construction = {
							type = industrial_complex
							level = 1
							instant_build = yes
						}
					}
					random_owned_controlled_state = {
						limit = {
							free_building_slots = {
								building = industrial_complex
								size > 0
							}
							OR = {
								is_in_home_area = yes
								NOT = {
									owner = {
										any_owned_state = {
											free_building_slots = {
												building = industrial_complex
												size > 0
											}
											is_in_home_area = yes
										}
									}
								}
							}
						}
						add_building_construction = {
							type = industrial_complex
							level = 1
							instant_build = yes
						}
					}		
				}
			}
		}
		effect = {
			if = {
				limit = {
					tag = GER
					has_tech = superior_firepower
					NOT = { has_country_flag = schorner_reassessed }
				}
				set_country_flag = schorner_reassessed
				GER = {
					country_event = { id = character_promotion.1 }
				}
			}
		}
		effect = {
			if = {
				limit = {
					tag = GER
					has_tech = superior_firepower
					has_country_flag = schorner_reassessed
					has_idea_with_trait = ruthless_commander_trait
					OR = {
						has_idea_with_trait = army_infantry_2
						has_idea_with_trait = army_infantry_3
						has_idea_with_trait = army_artillery_2
						has_idea_with_trait = army_artillery_3
					}
					NOT = { has_country_flag = schorner_in_trouble_flag }
				}
				set_country_flag = schorner_in_trouble_flag
				GER = {
					country_event = { 
						id = character_promotion.2
						days = 30
						random_days = 60
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					SOV = { has_war_with = GER }
					date > 1943.1.1
					SOV = { NOT = { has_country_flag = ivan_konev_tank_commander } }
				}
				SOV = { 
					set_country_flag = ivan_konev_tank_commander
					SOV_ivan_konev = {
						add_trait = {
							trait = army_armored_1
							slot = high_command 
						}
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					tag = SOV
					has_idea = SOV_recovery_from_the_shock
				}
				SOV = {
					add_stability = 0.01
					add_war_support = 0.01
				}
			}
		}
		effect = {
			if = {
				limit = {
					is_ai = yes
					OR = {
						has_idea = professional_officer_corps_spirit
						has_idea = heritage_of_accomplishment
					}
					has_war = no
					has_government = democratic
				}
				add_ideas = relief_of_command_spirit
			}
		}
		effect = {
			if = {
				limit = {
					is_ai = yes
					OR = {
						has_idea = relief_of_command_spirit
						has_idea = heritage_of_accomplishment
					}
					has_war = yes
					NOT = { tag = SOV }
					NOT = { tag = GER }
					NOT = { 
						AND = {
							is_allied_ai = yes
							is_ai_mass_mob = yes
						}
					}
				}
				add_ideas = professional_officer_corps_spirit
			}
		}
		effect = {
			if = {
				limit = {
					is_ai = yes
					OR = {
						has_idea = relief_of_command_spirit
						has_idea = heritage_of_accomplishment
						has_idea = professional_officer_corps_spirit
					}
					OR = {
						date > 1939.6.1
						has_war = yes
					}
					AND = {
						AND = {
							is_allied_ai = yes
							is_ai_mass_mob = yes
						}
					}
				}
				add_ideas = quick_improvisation_spirit
			}
		}
		effect = {
			if = {
				limit = {
					is_ai = yes
					OR = {
						has_idea = relief_of_command_spirit
						has_idea = professional_officer_corps_spirit
						has_idea = heritage_of_accomplishment
					}
					has_army_experience > 5
					has_war = yes
					tag = GER
				}
				add_ideas = elevated_engineering_corps_spirit
			}
		}
		effect = {
			if = {
				limit = {
					is_ai = yes
					OR = {
						has_idea = relief_of_command_spirit
						has_idea = professional_officer_corps_spirit
						has_idea = heritage_of_accomplishment
					}
					has_war = yes
					OR = {
						is_literally_china = yes 
						tag = SOV
					}
				}
				add_ideas = proper_heritage_spirit
			}
		}
		effect = {
			if = {
				limit = {
					is_ai = yes
					OR = {
						tag = ITA
					}
					has_offensive_war = yes
					has_army_experience > 35
					NOT = { has_idea = state_serves_the_military_spirit }
				}
				add_ideas = state_serves_the_military_spirit
			}
		}
		effect = {
			if = {
				limit = {
					tag = JAP
					NOT = { surrender_progress > 0 }
				}
				if = {
					limit = {
						JAP = { has_idea = for_the_emperor_idea }
					}
					JAP = { remove_ideas = for_the_emperor_idea }
				}
				if = {
					limit = {
						JAP = { has_tech = JAP_for_the_emperor_tech }
					}
					JAP = { set_technology = { JAP_for_the_emperor_tech = 0 } }
				}
				if = {
					limit = {
						JAP = { has_country_flag = JAP_lost_core_1 }
					}
					JAP = { clr_country_flag = JAP_lost_core_1 }
				}
				if = {
					limit = {
						JAP = { has_country_flag = JAP_lost_core_2 }
					}
					JAP = { clr_country_flag = JAP_lost_core_2 }
				}
				if = {
					limit = {
						JAP = { has_country_flag = JAP_lost_core_3 }
					}
					JAP = { clr_country_flag = JAP_lost_core_3 }
				}
				if = {
					limit = {
						JAP = { has_country_flag = JAP_lost_core_4 }
					}
					JAP = { clr_country_flag = JAP_lost_core_4 }
				}
			}
		}
		effect = {
			if = {
				limit = {
					tag = FRA
					NOT = { has_country_flag = FRA_enough_tank }
					set_temp_variable = { FRA_light_tank = num_equipment_in_armies_k@light_tank_chassis }
					set_temp_variable = { FRA_medium_tank = num_equipment_in_armies_k@medium_tank_chassis }
					set_temp_variable = { FRA_heavy_tank = num_equipment_in_armies_k@heavy_tank_chassis }
					set_temp_variable = { FRA_total_tank = 0 }
					add_to_temp_variable = { FRA_total_tank = FRA_light_tank }
					add_to_temp_variable = { FRA_total_tank = FRA_medium_tank }
					add_to_temp_variable = { FRA_total_tank = FRA_heavy_tank }
					check_variable = { FRA_total_tank > 2000 }
				}
				set_country_flag = FRA_enough_tank
			}
		}
		effect = { #eastern europe uprising
			if = {
				limit = {
					GER = { surrender_progress > 0.15 }
					NOT = { country_exists = SOV }
					NOT = {
						any_state = {
							is_core_of = SOV
							owner = { NOT = { is_in_faction_with = GER } }
						}
					}
					has_global_flag = {
						flag = moscow_defeated_flag
						days > 365
					}
					NOT = { country_exists = UKR }
					has_global_flag = event_completed
				}
				every_state = {
					limit = {
						is_core_of = UKR
						NOT = { owner = { original_tag = UKR } }
					}
					owner = {
						if = {
							limit = {
								NOT = { has_country_flag = ukrainian_uprising_target }
							}
							set_country_flag = ukrainian_uprising_target
						}
					}
				}
				every_state = {
					limit = {
						is_core_of = UKR
					}
					UKR = { transfer_state = PREV }
				}
				every_country = {
					limit = {
						has_country_flag = ukrainian_uprising_target
					}
					UKR = { declare_war_on = { type = topple_government target = PREV } }
				}
			}
		}
		effect = {
			if = {
				limit = {
					tag = DEN
					date > 1939.1.1	
				}
				if = {
					limit = { NOT = { has_tech = excavation2 } }
					random_list = {
						20 = { set_technology = { excavation2 = 1 popup = no } }
						80 = { add_political_power = 5 }
					}
				}
				if = {
					limit = { NOT = { has_tech = excavation3 } }
					random_list = {
						5 = { set_technology = { excavation3 = 1 popup = no } }
						95 = { add_political_power = 5 }
					}
				}
				if = {
					limit = { NOT = { has_tech = construction2 } }
					random_list = {
						20 = { set_technology = { construction2 = 1 popup = no } }
						80 = { add_political_power = 5 }
					}
				}
				if = {
					limit = { NOT = { has_tech = construction3 } }
					random_list = {
						10 = { set_technology = { construction3 = 1 popup = no } }
						90 = { add_political_power = 5 }
					}
				}
				if = {
					limit = { NOT = { has_tech = synth_oil_experiments } }
					random_list = {
						15 = { set_technology = { synth_oil_experiments = 1 popup = no } }
						85 = { add_political_power = 5 }
					}
				}
				if = {
					limit = { NOT = { has_tech = fuel_silos } }
					random_list = {
						10 = { set_technology = { fuel_silos = 1 popup = no } }
						90 = { add_political_power = 5 }
					}
				}
				if = {
					limit = { NOT = { has_completed_focus = DEN_welcome_foreign_scientists } }
					random_list = {
						5 = { complete_national_focus = DEN_welcome_foreign_scientists }
						95 = { add_political_power = 5 }
					}
				}
				if = {
					limit = { NOT = { has_completed_focus = DEN_side_with_industry } }
					random_list = {
						5 = { complete_national_focus = DEN_side_with_industry }
						95 = { add_political_power = 5 }
					}
				}	
			}
		}
		effect = {
			if = {
				limit = {
					tag = SOV
					OR = { 
						has_country_flag = paranoia_exploit_flagged
						AND = {
							has_idea = paranoia_idea
							has_offensive_war = yes
						}
					}
					OR = {
						has_defensive_war = no
						AND = {
							has_war_support < 0.5
							has_stability < 0.5
						}
					}
					has_war = yes	
				}
				if = {
					limit = { 
						has_country_flag = paranoia_exploit_flagged_buffer_3
					}
					SOV_paranoia_low_increase_effect = yes
					SOV_paranoia_low_increase_effect = yes
				}
				if = {
					limit = { 
						has_country_flag = paranoia_exploit_flagged_buffer_2 
						NOT = { has_country_flag = paranoia_exploit_flagged_buffer_3 }
					}
					set_country_flag = paranoia_exploit_flagged_buffer_3
					SOV_paranoia_low_increase_effect = yes
				}
				if = {
					limit = { 
						has_country_flag = paranoia_exploit_flagged_buffer 
						NOT = { has_country_flag = paranoia_exploit_flagged_buffer_2 }
					}
					set_country_flag = paranoia_exploit_flagged_buffer_2
					SOV_paranoia_low_increase_effect = yes
				}
				if = {
					limit = { 
						NOT = { has_country_flag = paranoia_exploit_flagged_buffer } 
					}
					set_country_flag = paranoia_exploit_flagged_buffer
				}
			}
		}
		effect = {
			if = {
				limit = {
					tag = ETH
					has_idea = pure_manpower_reinforcement
					has_global_flag = second_italo_ethiopian_war_flag
					OR = {
						has_global_flag = anti_cheese_ethiopia
						has_army_manpower = { size < 200000 }
					}
					has_dlc = "By Blood Alone"
				}
				ETH = { add_manpower = -12000 }
				capital_scope = {
					create_unit = {
						division = "name = \"Irregular Infantry\" division_template = \"Chitet Sefari\" start_experience_factor = 0.05 start_equipment_factor = 0.03" 
						owner = PREV 
						allow_spawning_on_enemy_provs = yes  
						count = 2  
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					tag = SOV
					has_idea = SOV_industrialization_boost_2	
					NOT = { has_global_flag = resource_boost_1 }
							
				}
				set_global_flag = resource_boost_1
				SOV = {
					584 = {
						add_resource = { type = tungsten amount = 15 }
						add_resource = { type = steel amount = 7 }
					}
					742 = {
						add_resource = { type = tungsten amount = 12 }
					}	
				}
			}
			else_if = {
				limit = {
					tag = SOV
					has_idea = SOV_industrialization_boost_2
					has_global_flag = resource_boost_1	
					NOT = { has_global_flag = resource_boost_2 }
							
				}
				set_global_flag = resource_boost_2
				SOV = {
					565 = {
						add_resource = { type = tungsten amount = 18 }
						add_resource = { type = steel amount = 7 }
					}
					581 = {
						add_resource = { type = steel amount = 22 }
					}	
				}
			}
			else_if = {
				limit = {
					tag = SOV
					has_idea = SOV_industrialization_boost_2	
					has_global_flag = resource_boost_2	
					NOT = { has_global_flag = resource_boost_3 }
							
				}
				set_global_flag = resource_boost_3
				SOV = {
					584 = {
						add_resource = { type = tungsten amount = 8 }
						add_resource = { type = steel amount = 3 }
					}
					742 = {
						add_resource = { type = tungsten amount = 4 }
					}
					565 = {
						add_resource = { type = tungsten amount = 4 }
						add_resource = { type = steel amount = 5 }
					}
					581 = {
						add_resource = { type = steel amount = 14 }
						add_resource = { type = tungsten amount = 6 }
					}
					732 = {
						add_resource = { type = tungsten amount = 8 }
					}	
				}
			}
		}
		effect = {
			if = {
				limit = {
					tag = FRA
					has_government = democratic
					has_capitulated = no
					NOT = { has_country_flag = LSM_eligibility_nation }
					is_ai = yes
					is_historical_focus_on = yes
					OR = {
						GER = { has_completed_focus = GER_demand_sudetenland }	
						GER = { has_completed_focus = GER_focus_on_the_true_enemy }
						has_defensive_war = yes	
					}
					NOT = { has_completed_focus = FRA_go_with_britain }
				}
				complete_national_focus = FRA_go_with_britain
			}
		}
		effect = {
			if = {
				limit = {
					has_global_flag = scw_over
					SOV = { has_country_flag = SOV_volunteer_in_spain }
					any_country = {
						original_tag = SPR
						has_completed_focus = SPR_maintain_the_second_republic
					}		
					SOV = { NOT = { has_country_flag = army_leader_promotion } }
				}
				SOV = { set_country_flag = army_leader_promotion }
				SOV = {
					SOV_nikolay_berzarin = {
						remove_trait = {
							trait = army_infantry_1
							slot = high_command 
						}
						add_trait = {
							trait = army_infantry_2
							slot = high_command 
						}
					}
					SOV_nikandr_chibisov = {
						remove_trait = {
							trait = army_infantry_1
							slot = high_command 
						}
						add_trait = {
							trait = army_infantry_2
							slot = high_command 
						}
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					tag = GER
					NOT = { has_war_with = SOV }
					SOV = { 
						has_government = communism
						is_faction_leader = yes
					}
					any_country = { 
						has_war_with = GER
						is_major = yes
					}	
					has_civil_war = no
					NOT = { has_idea = challenged_by_the_general_staff }	
					NOT = { has_country_flag = dismissed_all_concern }
					NOT = { has_completed_focus = GER_mol_rib_pact }
					NOT = {
						focus_progress = {
							focus = GER_mol_rib_pact
							progress > 0
						}
					}
					has_government = fascism
				}
				country_event = { id = LSM_GER_SOV.200 }
			}
		}
		effect = {
			if = {
				limit = {
					tag = USA
					is_ai = yes
					is_historical_focus_on = yes
					NOT = { has_global_flag = vanilla_history }
					democratic < 0.99		
				}
				add_popularity = {
					ideology = democratic 
					popularity = 0.01
				}
			}
		}
		effect = {
			if = {
				limit = {
					RAJ = { has_war_with = JAP }
					NOT = { 430 = { has_state_flag = airbase_built } }		
				}
				430 = {
					add_building_construction = {
						type = air_base
						level = 4
						instant_build = yes
					}
					set_state_flag = airbase_built
				}
			}
		}
		effect = {
			if = {
				limit = {
					RAJ = { has_war_with = JAP }
					NOT = { 432 = { has_state_flag = airbase_built } }		
				}
				432 = {
					add_building_construction = {
						type = air_base
						level = 4
						instant_build = yes
					}
					set_state_flag = airbase_built
				}
			}
		}
		effect = {
			if = {
				limit = {
					original_tag = FRA
					has_government = fascism
					16 = { controller = { NOT = { original_tag = FRA } } }	
					NOT = { has_global_flag = french_union_disintegrated }
				}
				every_state = {
					limit = {
						is_core_of = ROOT
						NOT = { is_on_continent = europe }
						NOT = { state = 1 }
					}
					remove_core_of = ROOT
				}
				set_global_flag = french_union_disintegrated
			}
		}
		effect = {
			if = { 
				limit = { 
					tag = JAP
					OR = {
						has_idea = JAP_devastation
						has_idea = JAP_devastation_2
					}
				}
				random_list = {
					20 = {
						JAP = {
							random_owned_state = {
								limit = { 
									industrial_complex < 5
									is_core_of = JAP 
									is_in_home_area = yes
									free_building_slots = {
										building = industrial_complex
										size > 4
										include_locked = yes
									}
								}	
								add_building_construction = {
									type = industrial_complex
									level = 4
									instant_build = yes
								}
								add_extra_state_shared_building_slots = 4
							}
						}
					}
					30 = { 
						JAP = {
							random_owned_state = {
								limit = { 
									industrial_complex < 3
									is_core_of = JAP  
									is_in_home_area = yes
									free_building_slots = {
										building = industrial_complex
										size > 2
										include_locked = yes
									}
								}	
								add_building_construction = {
									type = industrial_complex
									level = 2
									instant_build = yes
								}
								add_extra_state_shared_building_slots = 3
							}
						}
					}
					50 = { 
						JAP = {
							random_owned_state = {
								limit = { 
									industrial_complex < 3
									is_core_of = JAP  
									is_in_home_area = yes
									free_building_slots = {
										building = industrial_complex
										size > 2
										include_locked = yes
									}
								}	
								add_building_construction = {
									type = industrial_complex
									level = 2
									instant_build = yes
								}
								add_extra_state_shared_building_slots = 2
							}
						}
					}
				}		
			}
		}
		effect = {
			if = { 
				limit = { 
					date > 1943.1.1
					is_historical_focus_on = yes
					BRA = { is_ai = yes }
					BRA = { is_in_faction = no }
					AND = { 
						ENG = { is_faction_leader = yes }
						ENG = { has_government = democratic }
						ENG = { has_war_with = GER }
					}
					ENG = { is_ai = yes }
				}
				ENG = {
					add_ai_strategy = {
						type = alliance
						id = "BRA"
						value = 200
					}
				}
				BRA = {
					add_ai_strategy = {
						type = alliance
						id = "ENG"
						value = 200
					}
				}		
			}
		}
		effect = {
			if = { 
				limit = { 
					date > 1942.8.1
					USA = { has_war = no }
					is_historical_focus_on = yes
					USA = { has_government = democratic }
					AND = { 
						ENG = { is_faction_leader = yes }
						ENG = { has_government = democratic }
						ENG = { has_war_with = GER }
					}
					ENG = { is_ai = yes }
				}
				ENG = {
					add_ai_strategy = {
						type = alliance
						id = "USA"
						value = 9999
					}
				}
				USA = {
					add_ai_strategy = {
						type = alliance
						id = "ENG"
						value = 9999
					}
				}		
			}
		}
		effect = {
			if = { 
				limit = { 
					date > 1944.1.1
					is_historical_focus_on = yes
					URG = { is_ai = yes }
					URG = { is_in_faction = no }
					AND = { 
						ENG = { is_faction_leader = yes }
						ENG = { has_government = democratic }
						ENG = { has_war_with = GER }
					}
					ENG = { is_ai = yes }
				}
				ENG = {
					add_ai_strategy = {
						type = alliance
						id = "URG"
						value = 200
					}
				}
				URG = {
					add_ai_strategy = {
						type = alliance
						id = "ENG"
						value = 200
					}
				}		
			}
		}
		effect = {
			if = { 
				limit = { 
					date > 1943.8.1
					is_historical_focus_on = yes
					ARG = { is_ai = yes }
					ARG = { is_in_faction = no }
					AND = { 
						ENG = { is_faction_leader = yes }
						ENG = { has_government = democratic }
						ENG = { has_war_with = GER }
					}
					ENG = { is_ai = yes }
				}
				ENG = {
					add_ai_strategy = {
						type = alliance
						id = "ARG"
						value = 200
					}
				}
				ARG = {
					add_ai_strategy = {
						type = alliance
						id = "ENG"
						value = 200
					}
				}		
			}
		}
		effect = {
			if = { 
				limit = { 
					date > 1944.1.1
					is_historical_focus_on = yes
					CHL = { is_ai = yes }
					CHL = { is_in_faction = no }
					AND = { 
						ENG = { is_faction_leader = yes }
						ENG = { has_government = democratic }
						ENG = { has_war_with = GER }
					}
					ENG = { is_ai = yes }
				}
				ENG = {
					add_ai_strategy = {
						type = alliance
						id = "CHL"
						value = 200
					}
				}
				CHL = {
					add_ai_strategy = {
						type = alliance
						id = "ENG"
						value = 200
					}
				}		
			}
		}
		effect = {
			if = { 
				limit = { 
					has_idea = korean_civil_war_idea 
					has_capitulated = no
				}
				ROOT = {
					if = {
						limit = {
							has_government = communism
						}
						add_equipment_to_stockpile = { 
							type = train_equipment_1
							amount = 20
							producer = SOV
						}
						add_equipment_to_stockpile = { 
							type = train_equipment_1
							amount = 5
							producer = PRC
						}
					}
					if = {
						limit = {
							NOT = { has_government = communism }
						}
						add_equipment_to_stockpile = { 
							type = train_equipment_1
							amount = 15
							producer = USA
						}
						add_equipment_to_stockpile = { 
							type = train_equipment_1
							amount = 5
							producer = ENG
						}
						add_equipment_to_stockpile = { 
							type = train_equipment_1
							amount = 5
							producer = FRA
						}
					}
					if = {
						limit = {
							NOT = { has_country_flag = civilian_volunteer_flag }
						}
						set_country_flag = civilian_volunteer_flag
						division_template = {
							name = "Civilian Volunteer"
							priority = 1
							division_names_group = KOR_INF_01
							regiments = {
								militia = { x = 0 y = 0 }
								militia = { x = 0 y = 1 }
								militia = { x = 0 y = 2 }
								militia = { x = 0 y = 3 }
								militia = { x = 0 y = 4 }
								militia = { x = 1 y = 0 }
							}
						}
					}
					add_equipment_to_stockpile = { 
						type = motorized_equipment_0
						amount = 200
						producer = ROOT
					}
					add_equipment_to_stockpile = { 
						type = infantry_equipment_0
						amount = 5000
						producer = ROOT
					}
					add_equipment_to_stockpile = { 
						type = artillery_equipment_1
						amount = 250
						producer = ROOT
					}
					add_offsite_building = {
						type = arms_factory
						level = 1
					}
					add_offsite_building = {
						type = industrial_complex
						level = 1
					}
					capital_scope = {
						create_unit = {
							division = "name = \"Volunteer Division\" division_template = \"Civilian Volunteer\" start_experience_factor = 0.05" 
							owner = ROOT 
							allow_spawning_on_enemy_provs = yes  
							count = 2
						}
					}
				}		
			}
		}
		effect = {
			if = { 
				limit = { 
					POR = { is_in_faction_with = GER }
					GER = { is_faction_leader = yes }
					SPR = { has_completed_focus = SPA_a_great_spain }
					SPR = { is_in_faction = no }
					SPR = { is_ai = yes }
					GER = { is_ai = yes }
				}	
				GER = { add_to_faction = SPR }
				SPR = {
					remove_ideas = SPA_recovering_from_civil_war
					remove_ideas = LSM_on_our_own_idea
				}
			}
		}
		effect = {
			if = { 
				limit = { 
					POR = { is_in_faction_with = ENG }
					GER = { is_faction_leader = yes }
					ENG = { has_war_with = GER }
					SPR = { has_government = fascism }
					SPR = { is_in_faction = no }
					SPR = { is_ai = yes }
					GER = { is_ai = yes }
				}	
				GER = { add_to_faction = SPR }
				SPR = {
					remove_ideas = SPA_recovering_from_civil_war
					remove_ideas = LSM_on_our_own_idea
				}
			}
		}
		effect = {
			if = { 
				limit = { 
					POR = { is_in_faction_with = ENG }
					ENG = { has_war_with = GER }
					NOT = { SPR = { has_government = fascism } }
					SPR = { is_in_faction = no }
					SPR = { is_ai = yes }
					ENG = { is_ai = yes }
				}
				ENG = {
					add_ai_strategy = {
						type = alliance
						id = "SPR"
						value = 25
					}
					add_to_faction = SPR
				}
				SPR = {
					add_ai_strategy = {
						type = alliance
						id = "ENG"
						value = 25
					}
					remove_ideas = SPA_recovering_from_civil_war
					remove_ideas = LSM_on_our_own_idea
				}
			}
		}
		effect = {
			if = { 
				limit = { 
					tag = GER
					has_war = yes
					has_dynamic_modifier = { modifier = GER_blitzkrieg_modifier }
					check_variable = { GER_blitzkrieg > -50 }
				}
				blitzkrieg_down = yes
				if = { 
					limit = {
						is_ai = no
					}
					blitzkrieg_down = yes
				}
			}
		}
		effect = {
			if = { 
				limit = { 
					tag = GER
					OR = {
						AND = {
							has_war_with = FRA
							FRA = { has_capitulated = no }
						}
						AND = {
							has_war_with = BEL
							FRA = { has_capitulated = no }
						}
					}
					NOT = { has_country_flag = stalemate_on_western_front }
					date > 1940.10.19
				}
				set_country_flag = stalemate_on_western_front
			}
		}
	}
	on_daily_JAP = {
		effect = {
			if = {
				limit = {
					tag = JAP
					any_country = { has_country_flag = this_guy_capitulated_japan } 
				}
				random_country = {
					limit = { has_country_flag = this_guy_capitulated_japan }
					set_autonomy = { target = JAP autonomy_state = autonomy_puppet }
				}
				every_country = {
					limit = { has_country_flag = this_guy_capitulated_japan }
					clr_country_flag = this_guy_capitulated_japan
				}
				if = {
					limit = {
						has_global_flag = is_done 
					}
					JAP = {
						load_focus_tree = {
							tree = japan_occupation_focus
							keep_completed = yes
						}
						mark_focus_tree_layout_dirty = yes
					}
				}
			}
		}
	}
	on_weekly = {
		effect = {
			if = {
				limit = {
					SOV = { has_completed_focus = SOV_demand_eastern_poland }
					AND = {
						96 = { is_owned_by = SOV }	
						95 = { is_owned_by = SOV }	
						94 = { is_owned_by = SOV }	
						93 = { is_owned_by = SOV }	
						91 = { is_owned_by = SOV }	
						89 = { is_owned_by = SOV }	
						784 = { is_owned_by = SOV }	
					}	
					NOT = { has_war_with = SOV }
					NOT = { POL = { is_in_faction_with = SOV } }
					date < 1941.1.1
					NOT = { has_global_flag = border_adjustment }
				}
				set_global_flag = border_adjustment
				every_state = {
					limit = {
						is_claimed_by = SOV
						controller = {
							OR = {
								tag = POL
								is_subject_of = POL
								AND = {
									is_in_faction_with = POL
									OR = {
										tag = LIT
										tag = LAT
										tag = EST
										tag = UKR
										tag = BLR
									}
								}
							}
						}
					}
					SOV = { transfer_state = PREV }
				}
				POL = { country_event = { id = LSM_GER_SOV.99 } }
			}
		}
		effect = {
			if = {
				limit = {
					any_country = {
						is_in_faction_with = ENG
						has_guaranteed = POL
					}
					85 = { owner = { NOT = { tag = POL } } }		
				}
				every_country = {
					limit = {
						is_ai = yes
						is_in_faction_with = ENG
						has_guaranteed = POL
					}
					diplomatic_relation = {
   						country = POL
   						relation = guarantee
   						active = no
  					}
  					add_ai_strategy = {
						type = ignore
						id = "POL"
						value = 9999
					}
  					add_ai_strategy = {
						type = protect
						id = "POL"
						value = -9999
					}
  					add_ai_strategy = {
						type = alliance
						id = "POL"
						value = -9999
					}
				}
			}
		}
		effect = {
			if = {
				limit = { 
					OR = {
						has_idea = VIN_the_eventual_revolution_0
						has_idea = VIN_the_eventual_revolution_1
						has_idea = VIN_the_eventual_revolution_2
						has_idea = VIN_the_eventual_revolution_3
					}
				}
				set_temp_variable = { var_manpower_loss_weekly = FROM.party_popularity@communism }
				multiply_temp_variable = { var_manpower_loss_weekly = -1000 }
				add_manpower = var_manpower_loss_weekly
			}
			if = {
				limit = { 
					has_idea = VIN_the_eventual_revolution_0
					communism < 0.55
				}
				add_popularity = {
					ideology = communism
					popularity = 0.001
				}
			}
			if = {
				limit = { 
					has_idea = VIN_the_eventual_revolution_1
					communism < 0.55
				}
				add_popularity = {
					ideology = communism
					popularity = 0.002
				}
			}
			if = {
				limit = { 
					has_idea = VIN_the_eventual_revolution_2
					communism < 0.55
				}
				add_popularity = {
					ideology = communism
					popularity = 0.005
				}
			}
			if = {
				limit = { 
					has_idea = VIN_the_eventual_revolution_3
					communism < 0.55
				}
				add_popularity = {
					ideology = communism
					popularity = 0.010
				}
			}
		}
		effect = {
			every_state = {
				limit = { 
					has_state_flag = LSM_designated_state_target 
					has_global_flag = this_is_done
					NOT = {
						any_neighbor_state = {
							controller = { has_war_with = FROM.controller }
						}
					}
				}
				clr_state_flag = LSM_designated_state_target
			}
		}
		effect = {
			if = {
				limit = {
					tag = SOV
					check_variable = { num_equipment_in_armies_k@artillery_equipment > 10 }	
					NOT = { has_country_flag = voronov_promoted_2 }
				}
				SOV = {
					set_country_flag = voronov_promoted_2
					SOV_nikolay_nikolayevich_voronov = {
						remove_trait = {
							trait = chief_or_artillery_1
							slot = high_command 
						}
						add_trait = {
							trait = chief_or_artillery_2
							slot = high_command 
						}
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					tag = SOV
					check_variable = { num_equipment_in_armies_k@artillery_equipment > 20 }	
					NOT = { has_country_flag = voronov_promoted_3 }
				}
				SOV = {
					set_country_flag = voronov_promoted_3
					SOV_nikolay_nikolayevich_voronov = {
						remove_trait = {
							trait = chief_or_artillery_2
							slot = high_command 
						}
						add_trait = {
							trait = chief_or_artillery_3
							slot = high_command 
						}
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					tag = JAP
					has_idea = JAP_for_the_emperor_ns		
				}
				random_state = {
					limit = { 
						is_core_of = JAP
						is_in_home_area = yes
					}
					create_unit = {
						division = "name = \"Peasant Militia\" division_template = \"Peasant Militia\" start_experience_factor = 0"
						owner = JAP 
						allow_spawning_on_enemy_provs = yes  
						count = 3  
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = {
						tag = FRA
						is_in_faction_with = ENG
						has_war_with = GER
						surrender_progress > 0.2
					}
					NOT = { has_global_flag = dunkirk_scenario }
				}
				set_global_flag = dunkirk_scenario
				every_country = {
					limit = { is_in_faction_with = FRA }
					add_timed_idea = { idea = evacuation_from_france days = 90 }
				}
			}
		}
		effect = {
			if = {
				limit = {
					NOT = { has_idea = why_are_you_sending_me_troops_fking_puppets }		
				}
				add_ideas = why_are_you_sending_me_troops_fking_puppets
			}
		}
		effect = {
			if = {
				limit = {
					NOT = { has_idea = why_are_you_sending_me_troops_fking_puppets }		
				}
				add_ideas = why_are_you_sending_me_troops_fking_puppets
			}
		}
		effect = {
			if = {
				limit = {
					tag = SOV
					has_idea = SOV_industrialization_boost_2	
					any_state = {
						is_fully_controlled_by = SOV
						is_owned_by = SOV
						is_on_continent = asia
						free_building_slots = {
							building = infrastructure
							size > 1
						}
					}
							
				}
				SOV = {
					random_state = {
						limit = {
							is_fully_controlled_by = SOV
							is_owned_by = SOV
							is_on_continent = asia
							free_building_slots = {
								building = infrastructure
								size > 1
							}
						}
						add_building_construction = {
							type = infrastructure
							level = 1
							instant_build = yes						
						}
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					tag = JAP
					has_war = no
					OR = {
						has_country_flag = LSM_eligbility_nation
						is_subject = yes
					}
					has_global_flag = kwantung_intervention
					OR = {
						is_in_faction_with = ENG
						is_in_faction_with = SOV
					}
					NOT = { has_global_flag = japan_china_border }
				}
				set_global_flag = japan_china_border
				if = {
					limit = {
						is_in_faction_with = ENG
					}
					every_state = { 
						limit = { 
							is_core_of = CHI
							is_owned_by = JAP
						}
						CHI = { transfer_state = PREV }
					}
				}
				if = {
					limit = {
						is_in_faction_with = SOV
					}
					every_state = { 
						limit = { 
							is_core_of = PRC
							is_owned_by = JAP
						}
						PRC = { transfer_state = PREV }
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					NOT = { has_global_flag = yugoslavia_border }
					country_exists = BUL
					country_exists = YUG
					OR = {
						any_country = {
							original_tag = YUG
							has_war = no
						} 
						any_country = {
							original_tag = BUL
							has_war = no
						} 
					}
					has_global_flag = yalta_agreed_flag
					YUG = { is_subject = no }
					OR = { 
						any_country = {
							original_tag = BUL
							has_country_flag = LSM_eligbility_nation 
						} 
						any_country = {
							original_tag = BUL
							is_subject = yes
						}
					}
					is_historical_focus_on = yes
				}
				set_global_flag = yugoslavia_border	
				every_state = {
					limit = {
						is_core_of = BUL
						OR = {
							is_core_of = YUG
							is_core_of = GRE
							is_core_of = MAC
							is_core_of = ALB
							is_core_of = ROM
							is_core_of = KOS
						}
					}
					remove_core_of = BUL
				}
				every_state = {
					limit = {
						controller = {
							OR = {
								is_in_faction_with = YUG
								is_in_faction_with = BUL
								tag = BUL
							}
						}
						OR = {
							is_core_of = YUG
							is_core_of = MAC
							is_core_of = SLV
							is_core_of = CRO
							is_core_of = KOS
						}
					}
					add_core_of = YUG
					YUG = { transfer_state = PREV }
				}
			}
		}
		effect = {
			if = {
				limit = {
					NOT = { has_global_flag = greek_border }
					country_exists = GRE
					country_exists = BUL
					OR = {
						any_country = {
							original_tag = GRE
							has_war = no
						} 
						any_country = {
							original_tag = BUL
							has_war = no
						} 
					}
					has_global_flag = yalta_agreed_flag
					GRE = { is_subject = no }
					OR = { 
						any_country = {
							original_tag = BUL
							has_country_flag = LSM_eligbility_nation 
						} 
						any_country = {
							original_tag = BUL
							is_subject = yes
						}
					}
					is_historical_focus_on = yes
				}
				set_global_flag = greek_border
				every_state = {
					limit = {
						controller = {
							OR = {
								is_in_faction_with = GRE
								is_in_faction_with = BUL
								tag = BUL
							}
						}
						OR = {
							is_core_of = GRE
							state = 731
							state = 184
							AND = {
								is_core_of = ALB
								controller = { 
									OR = {
										is_in_faction_with = BUL 
										is_in_faction_with = GRE
									}
								}	
							}
						}
						NOT = { is_core_of = YUG }
					}
					add_core_of = GRE
					GRE = { transfer_state = PREV }
				}
			}
		}
		effect = {
			if = {
				limit = {
					has_global_flag = yalta_agreed_flag
					GER = { is_subject = yes }
					NOT = { has_global_flag = failure_GER_idea_apply }
				}
				every_country = {
					limit = {
						original_tag = GER
					}
					add_ideas = LSM_the_final_push_failure_GER
				}
				set_global_flag = failure_GER_idea_apply
			}
		}
		effect = {
			if = {
				limit = {
					is_historical_focus_on = yes
					OR = {
						tag = CHL
						tag = CAN
						tag = URG
					}
					date > 1941.1.1
					NOT = { has_tech = amphibious_mechanized_infantry }
					has_tech = mechanised_infantry
				}
				set_technology = { amphibious_mechanized_infantry = 1 popup = no }
			}
		}
		effect = {
			if = {
				limit = {
					has_global_flag = yalta_agreed_flag
					GER = { has_war = no }
					NOT = { has_global_flag = nuremberg_trial }
				}
				GER = { add_named_threat = { threat = -50 name = "Nuremberg Trial" } }
				set_global_flag = nuremberg_trial
			}
		}
		effect = {
			if = {
				limit = {
					is_historical_focus_on = yes
					country_exists = USA
					USA = { has_government = democratic }
					USA = { has_idea = LSM_victory_in_europe }
					USA = { is_in_faction = yes }
					NOT = { has_global_flag = marshall_plan }
					NOT = { has_global_flag = marshall_plan_proposal }
					any_country = {
						original_tag = GER
						is_in_faction_with = USA
					}
					any_country = {
						original_tag = ENG
						is_in_faction_with = USA
					}
					any_country = {
						original_tag = FRA
						is_in_faction_with = USA
					}
				}
				set_global_flag = marshall_plan_proposal
				USA = {
					country_event = {
						id = LSM_new_world_diplomacy.11
						days = 3
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					JAP = {
						has_war = no
						has_idea = JAP_demobilisation
					}
					NOT = { has_global_flag = quenched_militarism }
				}
				set_global_flag = quenched_militarism
				JAP = { 
					if = {
						limit = { 
							is_subject = no 
							is_faction_leader = yes 
						}
						dismantle_faction = yes
					}
					add_named_threat = { threat = -40 name = "Tokyo Trial" }
					if = {
						limit = {
							has_government = democratic 
						}
						add_ai_strategy = {
							type = alliance
							id = "ENG"
							value = 600
						}
						add_ai_strategy = {
							type = alliance
							id = "USA"
							value = 600
						}
						ENG = {
							add_ai_strategy = {
								type = alliance
								id = "JAP"
								value = 600
							}
						}
						USA = {
							add_ai_strategy = {
								type = alliance
								id = "JAP"
								value = 600
							}
						}
					}
					if = {
						limit = {
							has_government = communism 
						}
						add_ai_strategy = {
							type = alliance
							id = "SOV"
							value = 600
						}
						SOV = {
							add_ai_strategy = {
								type = alliance
								id = "JAP"
								value = 600
							}
						}
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					has_global_flag = yalta_agreed_flag
					any_country = {
						original_tag = GER 
						OR = {
							has_country_flag = LSM_eligibility_nation 
							has_idea = LSM_the_final_push_failure_GER
							is_subject = yes
						}
					}	
					NOT = { has_global_flag = kwantung_intervention_question }
					SOV = { has_government = communism }
					OR = {
						AND = {
							JAP = { has_war_with = ENG }	
							NOT = { SOV = { has_war_with = ENG } }
						}
						AND = {
							JAP = { has_war_with = USA }	
							NOT = { SOV = { has_war_with = USA } }
						}
					}
				}
				set_global_flag = kwantung_intervention_question
				every_country = {
					limit = {
						original_tag = SOV
						has_government = communism
					}
					country_event = { id = LSM_GER_SOV.472 }
					country_event = { id = LSM_GER_SOV.472 days = 30 }
				}
			}
		}
		effect = {
			if = {
				limit = {
					has_country_flag = SOV_paranoia_system_active_flag
					NOT = { has_idea = paranoia_idea }
					NOT = { has_country_flag = paranoia_idea_flag }
				}
				add_ideas = paranoia_idea
				set_country_flag = paranoia_idea_flag
			}
		}
		effect = {
			if = {
				limit = {
					NOT = { BUL = { has_idea = idea_JUNO_truck_production_cost } }
					BUL = { has_tech = mechanised_infantry }
				}
				BUL = { add_ideas = idea_JUNO_truck_production_cost }
			}
		}
		effect = {
			if = {
				limit = {
					OR = {
						ENG = { has_capitulated = yes }
						SOV = { has_capitulated = yes }
					}
					any_country = {
						original_tag = SPR 
						has_idea = LSM_on_our_own_idea 
					}
				}
				every_country = {
					limit = { original_tag = SPR } 
					remove_ideas = LSM_on_our_own_idea 
				}
			}
		}
		effect = {
			if = { 
				limit = { 
					OR = {
						has_global_flag = {
							flag = d_day_downtime
							days > 60
						}
						NOT = { has_global_flag = d_day_downtime }
					}
					NOT = { has_global_flag = d_day_was_a_success }
					has_global_flag = d_day_happened
					any_state = {
						is_core_of = FRA
						is_on_continent = europe
						controller = { has_war_with = GER }
						any_neighbor_state = {
							is_on_continent = europe
							is_core_of = FRA
							controller = { has_war_with = GER }
						}
					}		
				}
				set_global_flag = d_day_was_a_success
			}
		}
		effect = {
			if = { 
				limit = {
					has_global_flag = {
						flag =  d_day_was_a_success
						days > 150
					}
					has_global_flag = d_day_happened
					16 = {
						controller = {
							NOT = { is_in_faction_with = ENG }
						}
					}		
				}
				clr_global_flag = d_day_was_a_success
				set_global_flag = d_day_downtime
			}
		}
		effect = {
			if = { 
				limit = {		
					GER = {
						has_war_with = SOV
					}
					OR = {
						any_country = {
							original_tag = FRA
							has_government = fascism
							is_in_faction_with = GER
							surrender_progress > 0.35
						}
						any_country = {
							original_tag = ITA
							has_government = fascism
							is_in_faction_with = GER
							surrender_progress > 0.35
						}
					}
					NOT = { has_global_flag = d_day_crisis }		
				}
				set_global_flag = d_day_crisis	
				if = {
					limit = { has_global_flag = d_day_temporarily_cleared }
					clr_global_flag = d_day_temporarily_cleared
				}	
				if = {
					limit = { has_global_flag = last_change_at_d_day }
					clr_global_flag = last_change_at_d_day
					set_global_flag = last_change_at_d_day
				}
			}
		}
		effect = {
			if = { 
				limit = {
					OR = {
						GER = { NOT = { has_war_with = SOV } }
						AND = {
							any_country = {
								original_tag = FRA
								has_government = fascism
								is_in_faction_with = GER
								surrender_progress < 0.2
							}
							any_country = {
								original_tag = ITA
								has_government = fascism
								is_in_faction_with = GER
								surrender_progress < 0.2
							}
							has_global_flag = d_day_crisis		
						}
					}
				}
				clr_global_flag = d_day_crisis	
			}
		}
		effect = {
			if = { 
				limit = {
					has_global_flag = {
						flag = last_change_at_d_day
						days > 210 #give it 6 months
					}
					has_global_flag = d_day_crisis		
					NOT = { 
						OR = {
							any_country = {
								original_tag = FRA
								has_government = fascism
								is_in_faction_with = GER
								surrender_progress > 0.35
							}
							any_country = {
								original_tag = ITA
								has_government = fascism
								is_in_faction_with = GER
								surrender_progress > 0.35
							}
						}
					}
				}
				clr_global_flag = d_day_crisis	
				set_global_flag = d_day_temporarily_cleared
			}
		}
		effect = {
			if = { 
				limit = { 
					NOT = { has_global_flag = allied_victory_in_africa }
					is_historical_focus_on = yes
					date > 1942.1.1
					all_state = {
						OR = {
							AND = {
								NOT = { is_on_continent = africa }	
								NOT = { is_core_of = SYR }
								NOT = { is_core_of = LEB }
							}
							is_core_of = MAD
							is_island_state = yes
							AND = {
								OR = {
									NOT = { ENG = { has_war_with = GER } }
									GER = {
										divisions_in_state = { state = PREV size < 1 }
									}
								}
								OR = {
									AND = {
										NOT = { ENG = { has_war_with = ITA } }
										NOT = { ITA = { is_in_faction_with = GER } }
									}
									ITA = {
										divisions_in_state = { state = PREV size < 1 }
									}
								}
								OR = {
									AND = {
										any_country = {
											OR = {
												original_tag = FRA
												tag = VIC
											}
											has_capitulated = no
											has_government = fascism
											divisions_in_state = { state = PREV size < 1 }
										}
									}
									NOT = {
										any_country = {
											OR = {
												original_tag = FRA
												tag = VIC
											}
											has_capitulated = no
											has_government = fascism
											divisions_in_state = { state = PREV size > 0 }
										}
									}
									NOT = {
										any_country = {
											exists = yes
											original_tag = FRA
											has_government = fascism
											has_capitulated = no
										}
									}
									date > 1943.1.1 #deadline
								}
							}
						}
					}			
				}
				set_global_flag = allied_victory_in_africa
			}
		}
		effect = {
			if = { 
				limit = { 
					tag = GER
					has_war = yes
					has_dynamic_modifier = { modifier = GER_blitzkrieg_modifier }
					check_variable = { GER_blitzkrieg > 0 }
				}
				blitzkrieg_down = yes
				if = { 
					limit = {
						has_war_with = SOV
						SOV = { surrender_progress < 0.5 }
					}
					blitzkrieg_down = yes
				}
				if = { 
					limit = {
						has_war_with = FRA
						16 = { controller = { tag = FRA } }
					}
					blitzkrieg_down = yes
				}
				if = { 
					limit = {
						has_war_with = POL
						POL = { surrender_progress < 0.5 }
					}
					blitzkrieg_down = yes
				}
				if = { 
					limit = {
						has_war_with = POL
						POL = { has_capitulated = no }
					}
					blitzkrieg_down = yes
				}
				if = { 
					limit = {
						is_ai = no
					}
					blitzkrieg_down = yes
				}
			}
		}
		effect = {
			if = { 
				limit = { 
					tag = GER
					has_war = yes
					has_dynamic_modifier = { modifier = GER_blitzkrieg_modifier }
					check_variable = { GER_blitzkrieg > 50 }
				}
				blitzkrieg_down = yes
				if = { 
					limit = {
						has_war_with = SOV
						SOV = { surrender_progress < 0.5 }
					}
					blitzkrieg_down = yes
				}
				if = { 
					limit = {
						has_war_with = FRA
						16 = { controller = { tag = FRA } }
					}
					blitzkrieg_down = yes
				}
				if = { 
					limit = {
						has_war_with = POL
						POL = { surrender_progress < 0.5 }
					}
					blitzkrieg_down = yes
				}
				if = { 
					limit = {
						has_war_with = POL
						POL = { has_capitulated = no }
					}
					blitzkrieg_down = yes
				}
			}
		}
		effect = {
			if = { 
				limit = { 
					tag = GER
					has_war = yes
					has_dynamic_modifier = { modifier = GER_blitzkrieg_modifier }
					check_variable = { GER_blitzkrieg > 100 }
				}
				blitzkrieg_down = yes
				blitzkrieg_down = yes
				if = { 
					limit = {
						has_war_with = SOV
						SOV = { surrender_progress < 0.5 }
					}
					blitzkrieg_down = yes
					blitzkrieg_down = yes
				}
				if = { 
					limit = {
						has_war_with = FRA
						16 = { controller = { tag = FRA } }
					}
					blitzkrieg_down = yes
				}
				if = { 
					limit = {
						has_war_with = POL
						POL = { surrender_progress < 0.5 }
					}
					blitzkrieg_down = yes
				}
				if = { 
					limit = {
						has_war_with = POL
						POL = { has_capitulated = no }
					}
					blitzkrieg_down = yes
				}
				if = { 
					limit = {
						has_war_with = ENG
						ENG = { has_capitulated = no }
					}
					blitzkrieg_down = yes
				}
				if = { 
					limit = {
						is_ai = no
					}
					blitzkrieg_down = yes
				}
			}
		}
		effect = {
			if = { 
				limit = { 
					tag = GER
					has_war = yes
					has_dynamic_modifier = { modifier = GER_blitzkrieg_modifier }
					check_variable = { GER_blitzkrieg > 150 }
				}
				blitzkrieg_down = yes
				blitzkrieg_down = yes
				blitzkrieg_down = yes
				blitzkrieg_down = yes
				blitzkrieg_down = yes
				blitzkrieg_down = yes
				if = { 
					limit = {
						has_war_with = SOV
						SOV = { surrender_progress < 0.5 }
					}
					blitzkrieg_down = yes
					blitzkrieg_down = yes
				}
				if = { 
					limit = {
						has_war_with = FRA
						16 = { controller = { tag = FRA } }
					}
					blitzkrieg_down = yes
				}
				if = { 
					limit = {
						has_war_with = POL
						POL = { surrender_progress < 0.5 }
					}
					blitzkrieg_down = yes
				}
				if = { 
					limit = {
						has_war_with = POL
						POL = { has_capitulated = no }
					}
					blitzkrieg_down = yes
				}
				if = { 
					limit = {
						has_war_with = ENG
						ENG = { has_capitulated = no }
					}
					blitzkrieg_down = yes
				}
				if = { 
					limit = {
						has_war_with = USA
						USA = { has_capitulated = no }
					}
					blitzkrieg_down = yes
				}
				if = { 
					limit = {
						is_ai = no
					}
					blitzkrieg_down = yes
				}
			}
		}
		effect = {
			if = { 
				limit = { 
					tag = GER
					has_war = no
					has_dynamic_modifier = { modifier = GER_blitzkrieg_modifier }
				}
				remove_dynamic_modifier = { modifier = GER_blitzkrieg_modifier }
				set_variable = { GER_blitzkrieg = 0 }
				set_variable = { GER_blitzkrieg_resistance = 0 }
				set_variable = { GER_blitzkrieg_factory  = 0 }
				set_variable = { GER_blitzkrieg_dockyard = 0 }
				set_variable = { GER_blitzkrieg_repair = 0 }
				set_variable = { GER_blitzkrieg_manpower = 0 }
				set_variable = { GER_blitzkrieg_speed = 0 }
				set_variable = { GER_blitzkrieg_breakthrough = 0 }
				set_variable = { GER_blitzkrieg_compliance = 0 }
			}
		}
		effect = {
			if = { 
				limit = { 
					country_exists = LBA
					any_state = { 
						is_core_of = LBA
						owner = { NOT = { original_tag = LBA } }
					}
				}
				every_state = {
					limit = {
						is_core_of = LBA
						owner = { NOT = { original_tag = LBA } }
					}
					LBA = { transfer_state = PREV }
				}
			}
		}
		effect = {
			if = { 
				limit = { 
					775 = { owner = { tag = ENG } }
					ENG = { is_in_faction_with = FRA }
				}
				FRA = { transfer_state = 775 }
			}
		}
	}
	on_declare_war = {
		effect = {
			if = {
				limit = {
					FROM = { 
						OR = {
							tag = ENG
							tag = MAL
							tag = AST
							tag = FRA
						}
						has_government = democratic
					}
					ROOT = {
						tag = JAP
						has_government = fascism
					}
					USA = { 
						has_government = democratic
					}
					NOT = { USA = { has_war_with = JAP } }
				}
				USA = {
					country_event = {
						id = LSM_new_world_diplomacy.12
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						tag = JAP
					}
					FROM = {
						tag = CHI
						has_government = neutrality
					}
				}
				CHI = {
					country_event = {
						id = LSM_equipment.22
						days = 3
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						tag = SOV
					}
					FROM = {
						tag = POL
						is_in_faction = no
						NOT = {
							any_country = { 
								is_major = yes
								has_guaranteed = POL
							}
						}
					}
				}
				SOV = {
					set_country_flag = {
						flag = war_against_solo_nation
						days = 90
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					OR = {
						FROM = {
							original_tag = ROOT
						}
						ROOT = {
							original_tag = FROM
						}
					}
					ROOT = { has_civil_war = yes }
					FROM = { has_civil_war = yes }
					is_historical_focus_on = no
				}
				every_state = {
					limit = { is_core_of = ROOT }
					add_claim_by = FROM
				}
				every_state = {
					limit = { is_core_of = FROM }
					add_claim_by = ROOT
				}	
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						tag = FIN
					}
					FROM = {
						any_owned_state = {
							is_core_of = FIN
						}
					}
				}
				hidden_effect = {
					FIN = {
						FIN_bop_medium_increase_effect = yes
						FIN_bop_medium_increase_effect = yes
						FIN_bop_medium_increase_effect = yes
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						tag = JAP
						is_ai = yes
					}
					FROM = {
						original_tag = SOV
					}
					has_tech = trench_warfare
				}
				JAP = {
					set_technology = { trench_warfare = 0 }
					set_technology = { grand_battle_plan = 0 }
					set_technology = { prepared_defense = 0 }
					set_technology = { grand_assault = 0 }
					set_technology = { infantry_offensive = 0 }
					set_technology = { armored_operations = 0 }
					set_technology = { infiltration_assault = 0 }
					set_technology = { night_assault_tactics = 0 }
					set_technology = { attritional_containment = 0 }
					set_technology = { mass_assault = 1 }
					set_technology = { pocket_defence = 1 }
					set_technology = { defence_in_depth = 1 }
					set_technology = { peoples_army = 1 }
					set_technology = { human_infantry_offensive = 1 }
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						tag = SOV
						has_government = communism
					}
					FROM = {
						tag = TUR
						NOT = { has_idea = TUR_the_battle_for_our_nations_survival }
					}
				}
				hidden_effect = {		
					if = {
						limit = {
							date < 1939.1.1
						}
						SOV = { add_named_threat = { threat = 15 name = "The Battle for the Bosporus" } }
					}
					TUR = { add_timed_idea = { idea = TUR_the_battle_for_our_nations_survival days = 365 } }
					TUR = { set_country_flag = save_turkey_flag }
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						tag = GER
						has_idea = anti_soviet_pact
					}
					FROM = {
						original_tag = SOV
					}
					NOT = { has_global_flag = GER_vs_SOV_flag }
				}
				hidden_effect = {
					set_global_flag = GER_vs_SOV_flag
					every_country = {
						limit = {
							has_idea = anti_soviet_pact
						}
						add_ai_strategy = {
							type = alliance
							id = "GER"
							value = 500
						}
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						tag = SOV
					}
					FROM = {
						has_idea = anti_soviet_pact 
					}
					NOT = { has_global_flag = anti_soviet_event_flag }
				}
				hidden_effect = {
					set_global_flag = anti_soviet_event_flag
					add_named_threat = { threat = 50 name = "The Expansion of the Soviet Union" }
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						is_ai = no
					}
					FROM = {
						has_idea = dead_country
					}
				}
				ROOT = {
					add_stability = -1.00
					add_war_support = -1.00
					add_political_power = -2000
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						tag = GER
					}
					FROM = {
						tag = NOR
						has_government = democratic
					}
				}
				hidden_effect = {
					NOR = { 
						add_popularity = {
							ideology = fascism 
							popularity = 0.25
						}
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						tag = GER
					}
					FROM = {
						tag = POL
					}
					SOV = { has_idea = SOV_molotov_ribbentrop_pact }
				}
				set_global_flag = molotov_ribbentrop_fulfillment_demand
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						tag = GER
					}
					FROM = {
						has_idea = league_of_nations_member_idea
					}
					NOT = { has_completed_focus = GER_anschluss }
					league_of_nations_is_active = yes 
					has_global_flag = LN_done
				}
				add_political_power = -200
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						tag = SOV
						has_idea = SOV_prepare_for_barbarossa
					}
					FROM = { 
						tag = GER
					}
				}
				hidden_effect = { SOV = { remove_ideas = SOV_prepare_for_barbarossa } }
			}
			if = {
				limit = {
					ROOT = {
						tag = GER
					}
					FROM = { 
						tag = SOV
						has_idea = SOV_prepare_for_barbarossa
					}
				}
				hidden_effect = { SOV = { remove_ideas = SOV_prepare_for_barbarossa } }
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						original_tag = KOR
					}
					FROM = {
						original_tag = KOR
					}
				}
				every_country = {
					limit = {
						original_tag = KOR
						NOT = { has_government = communism }
					}
					every_other_country = {
						limit = {
							OR = {
								is_in_faction = yes
								is_major = yes
							}
							has_government = democratic
						} 
						add_ai_strategy = {
							type = send_volunteers_desire
							id = PREV
							value = 500
						} 
						add_ai_strategy = {
							type = send_lend_lease_desire
							id = PREV
							value = 500
						}
					}
				}
				every_country = {
					limit = {
						original_tag = KOR
						has_government = communism
					}
					every_other_country = {
						limit = {
							OR = {
								is_in_faction = yes
								is_major = yes
							}
							has_government = communism
						} 
						add_ai_strategy = {
							type = send_volunteers_desire
							id = PREV
							value = 500
						} 
						add_ai_strategy = {
							type = send_lend_lease_desire
							id = PREV
							value = 500
						}
					}
				}
				KOR = {
					news_event = { hours = 12 id = lsm_news.123 }
					add_named_threat = { threat = 5 name = "Korean Civil War" }
					division_template = {
						name = "Soviet Volunteer"
						priority = 1
						division_names_group = SOV_INF_01
						regiments = {
							infantry = { x = 0 y = 0 }
							infantry = { x = 0 y = 1 }
							infantry = { x = 0 y = 2 }
							infantry = { x = 0 y = 3 }
							infantry = { x = 0 y = 4 }
							infantry = { x = 1 y = 0 }
							infantry = { x = 1 y = 1 }
							infantry = { x = 1 y = 2 }
							infantry = { x = 1 y = 3 }
							infantry = { x = 1 y = 4 }
						}
						support = {
							artillery = { x = 0 y = 0 }
						}
					}
					527 = {
						create_unit = {
							division = "name = \"Soviet Volunteer\" division_template = \"Soviet Volunteer\" start_experience_factor = 0.25" 
							owner = KOR 
							allow_spawning_on_enemy_provs = yes  
							count = 5
						}
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						tag = SOV
					}
					has_idea = paranoia_idea
				}
				SOV = { set_country_flag = paranoia_exploit_flagged }
			}
		}
		effect = {
			if = {
				limit = {
					threat > 0.80
					FROM = { 
						has_idea = LSM_neutrality_idea
					}
				}
				every_country = {
					limit = { 
						is_faction_leader = yes 
						has_war_with = ROOT 
					}
					every_other_country = { 
						limit = { 
							has_idea = LSM_neutrality_idea 
							NOT = { tag = SWE } 
							NOT = { tag = SWI }
						}
						add_ai_strategy = {
							type = alliance
							id = PREV
							value = 50
						}
					} 
				}
			}
			if = {
				limit = {
					FROM = { 
						has_idea = LSM_neutrality_idea
						OR = {
							tag = SPR 
							tag = POR  
							tag = SWI 
							tag = SWE
						}
					}
				}
				every_country = {
					limit = { 
						is_faction_leader = yes 
						has_war_with = ROOT 
					}
					every_other_country = { 
						limit = { 
							has_idea = LSM_neutrality_idea 
							OR = { 
								tag = SPR
								tag = POR
								tag = SWI
								tag = SWE
							}
						}
						add_ai_strategy = {
							type = alliance
							id = PREV
							value = 500
						}
					} 
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						tag = SOV
					}
					FROM = {
						tag = FIN
					}
				}
				FIN = { set_country_flag = winter_war_happened }
			}
		}
		effect = {
			if = {
				limit = {
					date > 1939.1.1
					NOT = { 
						any_state = {
							is_core_of = CHI
							owner = { is_in_faction_with = JAP }
						}
					}
					ROOT = {
						OR = { 
							AND = {
								tag = CHI
								CHI = { is_subject = no }
							} 
							AND = {
								tag = PRC
								PRC = { is_subject = no }
							}
							AND = {
								tag = MAN
								MAN = { is_subject = no }
							}
						}
					}
					FROM = {
						OR = { 
							AND = {
								tag = CHI
								CHI = { is_subject = no }
							} 
							AND = {
								tag = PRC
								PRC = { is_subject = no }
							}
							AND = {
								tag = MAN
								MAN = { is_subject = no }
							}
						}
					}
				}
				ROOT = { add_named_threat = { threat = 25 name = "Chinese Civil War" } }
				ROOT = { news_event = { hours = 12 id = lsm_news.122 } }
				every_country = { 
					limit = { 
						OR = { 
							AND = {
								tag = CHI
								CHI = { is_subject = no }
							}  
							AND = {
								tag = PRC
								PRC = { is_subject = no }
							}
							AND = {
								tag = MAN
								MAN = { is_subject = no }
							}
						}
					}
					add_ideas = LSM_chinese_civil_war
					SOV = { complete_national_focus = SOV_two_red_flags }
					SOV = { add_ideas = LSM_chinese_civil_war_intervention }
				}
				if = {
					limit = {	
						ROOT = { tag = PRC }
						FROM = { tag = CHI }
					}
					if = {
						limit = {
 							date > 1939.1.1
						}
						CHI = {
							transfer_units_fraction = {
								target = PRC
								size = 0 
								army_ratio = 0.1 
								air_ratio = 0.1
							}
						}
					}
					if = {
						limit = {
 							date > 1941.1.1
						}
						CHI = {
							transfer_units_fraction = {
								target = PRC
								size = 0 
								army_ratio = 0.1 
								air_ratio = 0.1
							}
						}
					}
					if = {
						limit = {
 							date > 1942.1.1
						}
						CHI = {
							transfer_units_fraction = {
								target = PRC
								size = 0 
								army_ratio = 0.1 
								air_ratio = 0.1
							}
						}
					}
					if = {
						limit = {
 							date > 1943.1.1
						}
						CHI = {
							transfer_units_fraction = {
								target = PRC
								size = 0 
								army_ratio = 0.1 
								air_ratio = 0.1
							}
						}
					}
					if = {
						limit = {
 							date > 1945.1.1
						}
						CHI = {
							transfer_units_fraction = {
								target = PRC
								size = 0 
								army_ratio = 0.1 
								air_ratio = 0.1
							}
						}
					}
					if = {
						limit = {
 							NOT = { PRC = { has_country_flag = LSM_eligibility_nation } }
							CHI = { has_country_flag = LSM_eligibility_nation }
						}
						CHI = {
							transfer_units_fraction = {
								target = PRC
								size = 0 
								army_ratio = 0.2 
								air_ratio = 0.2
							}
						}
					}
					if = {
						limit = {
 							PRC = { has_country_flag = LSM_eligibility_nation }
							CHI = { has_country_flag = LSM_eligibility_nation }
						}
						CHI = {
							transfer_units_fraction = {
								target = PRC
								size = 0 
								army_ratio = 0.1 
								air_ratio = 0.1
							}
						}
					}
					PRC = {
						build_railway = {
							level = 1
							build_only_on_allied = yes
							fallback = yes
							start_province = 8049
							target_province = 11752
						}
						build_railway = {
							level = 1
							build_only_on_allied = yes
							fallback = yes
							start_province = 11752
							target_province = 4506
						}
					}
				}
				if = {
					limit = {	
						ROOT = { tag = MAN }
						FROM = { tag = CHI }
					}
					if = {
						limit = {
 							date > 1939.1.1
						}
						CHI = {
							transfer_units_fraction = {
								target = MAN
								size = 0 
								army_ratio = 0.1 
								air_ratio = 0.1
							}
						}
					}
					if = {
						limit = {
 							date > 1941.1.1
						}
						CHI = {
							transfer_units_fraction = {
								target = MAN
								size = 0 
								army_ratio = 0.05  
								air_ratio = 0.1
							}
						}
					}
					if = {
						limit = {
 							date > 1942.1.1
						}
						CHI = {
							transfer_units_fraction = {
								target = MAN
								size = 0 
								army_ratio = 0.05  
								air_ratio = 0.1
							}
						}
					}
					if = {
						limit = {
 							date > 1943.1.1
						}
						CHI = {
							transfer_units_fraction = {
								target = MAN
								size = 0 
								army_ratio = 0.05  
								air_ratio = 0.1
							}
						}
					}
					if = {
						limit = {
 							date > 1945.1.1
						}
						CHI = {
							transfer_units_fraction = {
								target = MAN
								size = 0 
								army_ratio = 0.05  
								air_ratio = 0.1
							}
						}
					}
					if = {
						limit = {
 							NOT = { PRC = { has_country_flag = LSM_eligibility_nation } }
							CHI = { has_country_flag = LSM_eligibility_nation }
						}
						CHI = {
							transfer_units_fraction = {
								target = MAN
								size = 0 
								army_ratio = 0.1 
								air_ratio = 0.2
							}
						}
					}
					if = {
						limit = {
 							PRC = { has_country_flag = LSM_eligibility_nation }
							CHI = { has_country_flag = LSM_eligibility_nation }
						}
						CHI = {
							transfer_units_fraction = {
								target = MAN
								size = 0 
								army_ratio = 0.05 
								air_ratio = 0.1
							}
						}
					}
				}

			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						tag = SOV
					}
					FROM = {
						tag = POL
					}
					GER = {
						NOT = { has_war_with = SOV }
						has_government = fascism
						NOT = { 
							any_country = {
								is_in_faction_with = GER
								has_war_with = SOV
							}
						}
						has_war_with = POL
						has_war_with = ENG
					}
					POL = { is_ai = no }
					SOV = { is_ai = yes }
					GER = { is_ai = yes }
					is_historical_focus_on = yes
					OR = {
						has_global_flag = AI_is_balanced
						POL = { is_major = yes }
					}
					OR = {
						date > 1940.6.1
						GER = { surrender_progress > 0 }
					}
				}
				GER = {
					country_event = {
						id = LSM_GER_SOV.505
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						tag = SOV
					}
					FROM = {
						tag = POL
					}
					POL = { is_in_faction_with = ENG }
					POL = { has_war_with = GER }
					GER = { surrender_progress < 0.1 }
					is_historical_focus_on = yes
				}
				POL = {
					add_timed_idea = { idea = allies_dont_mess_with_soviet_union days = 120 }
				}
				set_global_flag = molotov_ribbentrop_fulfillment_grace
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						is_major = yes
					}
					FROM = {
						tag = SOV
						is_ai = yes
					}
					SOV = { has_idea = free_trade }
				}
				hidden_effect = { 
					SOV = { add_ideas = export_focus }
					SOV = { add_political_power = 120 }
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						tag = SOV
						is_ai = yes
					}
					SOV = { has_idea = free_trade }
				}	
				hidden_effect = { 
					SOV = { add_ideas = export_focus }
					SOV = { add_political_power = 120 }
					SOV = { set_country_flag = SOV_has_entered_war }
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						tag = GER
						still_have_trait_slot_for_this = yes
					}
					NOT = { has_global_flag = germany_has_started_war }
				}
				set_global_flag = germany_has_started_war
				hidden_effect = {
					GER = {
						every_army_leader = {
							random_select_amount = 6
							limit = {
								NOT = {
									has_trait = trait_engineer
								}
								OR = { 
									has_trait = armor_officer 
									has_trait = engineer_officer
									skill > 3
								}
							}
							add_trait = {
								trait = trait_engineer
							}
						}
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						tag = GER
					}
					FROM = {
						tag = POL
					}
					is_historical_focus_on = yes
				}
				hidden_effect = {
					SOV = {
						add_timed_idea = { idea = SOV_no_war_on_poland days = 30 } #fake idea anyway, so they must either wait til next year or use focus for wargoal
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						tag = GER 
						NOT = { has_dynamic_modifier = { modifier = GER_blitzkrieg_modifier } }
						NOT = { has_country_flag = LSM_eligibility_nation }
						has_global_flag = enclave_enabled
					}
				}
				GER = {
					add_dynamic_modifier = { modifier = GER_blitzkrieg_modifier }
					set_variable = { GER_blitzkrieg = 0 }
					blitzkrieg_up_25 = yes
				}
			}
		}
		effect = {
			if = {
				limit = {
					FROM = { 
						OR = { 
							tag = SOV 
							tag = FRA 
							tag = ENG 
							tag = POL  
							tag = ITA  
							tag = POL   
							tag = BEL   
							tag = USA
						}
					}
					ROOT = {  
						tag = GER 
						is_ai = yes
						has_dynamic_modifier = { modifier = GER_blitzkrieg_modifier }
					}
				}
				GER = {
					blitzkrieg_up_25 = yes
				}
			}
		}
		effect = {
			if = {
				limit = {
					FROM = { 
						tag = SOV
					}
					ROOT = {  
						tag = GER 
						is_ai = no
						has_dynamic_modifier = { modifier = GER_blitzkrieg_modifier }
					}
				}
				GER = {
					blitzkrieg_up_25 = yes
				}
			}
		}
		effect = {
			if = {
				limit = {
					FROM = { 
						tag = SOV
						is_ai = yes
					}
					ROOT = {  
						tag = GER 
						is_ai = yes
						has_dynamic_modifier = { modifier = GER_blitzkrieg_modifier }
					}
				}
				GER = {
					blitzkrieg_up_25 = yes
					blitzkrieg_up_25 = yes
					blitzkrieg_up_25 = yes
				}
			}
		}
		effect = {
			if = {
				limit = {
					FROM = { 
						tag = SOV
						is_ai = yes
					}
					ROOT = {  
						tag = GER
					}
				}
				hidden_effect = {
					SOV = {
						complete_national_focus = SOV_increase_state_reserves
						complete_national_focus = SOV_the_komsomol
					}
				}
			}
		}
	}
	on_state_control_changed = {
		effect = {
			if = {
				limit = {
					ROOT = { 
						OR = {
							is_in_faction_with = ENG
							is_in_faction_with = FRA
							is_in_faction_with = USA
						}
						OR = {
							has_idea = d_day_preparation_2
							has_idea = d_day_preparation_3
						}
						is_ai = yes
					}
					FROM.FROM = {
						OR = {
							controller = {
								has_war_with = ROOT
								is_in_faction_with = GER
							}
							owner = {
								is_in_faction_with = FROM.FROM
							}
						}
						is_on_continent = europe
					}	
				}
				if = {
					limit = { NOT = { has_idea = AI_aggressive_2 } }
					ROOT = { add_timed_idea = { idea = AI_aggressive_2 days = 7 } }
				}
				else_if = {
					limit = { has_idea = AI_aggressive_2 }
					ROOT = { modify_timed_idea = { idea = AI_aggressive_2 days = 7 } }
				}
			}
		}
		effect = {
			if = {
				limit = {
					FROM = { 
						tag = FIN
						has_idea = winter_war_ns
					}
					ROOT = {
						tag = SOV
					}
					NOT = {
						FIN = { 
							is_ai = no
							any_other_country = { is_ai = no }
						}
					}
					FROM.FROM = { 
						OR = {
							is_claimed_by = FIN
							is_core_of = FIN 
						}
					}
				}
				ROOT = {
					add_stability = 0.01
					add_war_support = 0.01
					add_political_power = 15
				}
				FIN = {
					if = {
						limit = {
							NOT = {		
								has_country_leader = {
									ruling_only = yes
									character = FIN_carl_mannerheim
								}
							}
						}
						FIN_bop_medium_decrease_effect = yes
						add_stability = -0.10
						add_war_support = -0.10
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						tag = FIN
						has_idea = winter_war_ns
					}
					FROM = {
						tag = SOV
					}
					FROM.FROM = { 
						OR = {
							is_claimed_by = FIN
							is_core_of = FIN 
						}
					}
					NOT = {
						FIN = { 
							is_ai = no
							any_other_country = { is_ai = no }
						}
					}
				}
				FIN = {
					if = {
						limit = {
							NOT = {		
								has_country_leader = {
									ruling_only = yes
									character = FIN_carl_mannerheim
								}
							}
						}
						FIN_bop_low_increase_effect = yes
						add_stability = 0.10
						add_war_support = 0.10
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						tag = SOV 
						has_idea = SOV_universal_welfare
					}
					FROM.FROM = { compliance < 20 }
				}
				FROM.FROM = { set_compliance = 20 }
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { has_war_with = FROM }
					FROM.FROM = {
						NOT = { has_state_flag = tainted_state }
					}
				}
				FROM.FROM = { set_state_flag = tainted_state }
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						is_in_faction_with = JAP
					}
					NOT = { has_global_flag = node_spawned621 }
					FROM.FROM = { state = 621 }
				}
				set_global_flag = node_spawned621
				FROM.FROM = { 
					add_building_construction = {
						type = supply_node
						level = 1
						instant_build = yes
						province = 10424
					} 
				}
				MEN = {
					build_railway = {
						level = 1
						fallback = yes
						start_province = 11752
						target_province = 10424
					}
				}
				616 = { 
					add_building_construction = {
						type = supply_node
						level = 1
						instant_build = yes
						province = 8127
					} 
				}
				754 = { 
					add_building_construction = {
						type = supply_node
						level = 1
						instant_build = yes
						province = 12732
					} 
				}
			}
		}
		effect = {
			if = {
				limit = {
					FROM.FROM = { state = 600 }
					ROOT = { tag = JAP }
					ROOT = { controls_state = 595 }
					NOT = { has_country_flag = flag_600_railway }
				}
				ROOT = {
					set_country_flag = flag_600_railway
					build_railway = {
						level = 1
						build_only_on_allied = yes
						fallback = yes
						start_province = 3992
						target_province = 4196
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					FROM.FROM = { state = 600 }
					ROOT = { tag = JAP }
					ROOT = { controls_state = 596 }
					NOT = { has_country_flag = flag_600a_railway }
				}
				ROOT = {
					set_country_flag = flag_600a_railway
					build_railway = {
						level = 1
						build_only_on_allied = yes
						fallback = yes
						start_province = 3992
						target_province = 9974
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						has_idea = d_day_preparation_1
					}
					FROM.FROM = { 
						is_d_day_preparation_state = yes 
						NOT = { has_dynamic_modifier = { modifier = d_day_preparation_state_modifier } }
					}
				}
				FROM.FROM = { 
					add_dynamic_modifier = { modifier = d_day_preparation_state_modifier days = 365 }
					set_variable = { d_day_preparation_production_speed = -0.1 }
					set_variable = { d_day_preparation_non_core_manpower = -0.1 }
					set_variable = { d_day_preparation_local_supplies = 0.1 }
					set_variable = { d_day_preparation_supply_factor = 0.1 }
					set_variable = { d_day_preparation_attrition = -0.1 }
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						NOT = { has_idea = d_day_preparation_1 }
						NOT = { has_idea = d_day_preparation_2 }
					}
					FROM.FROM = { 
						is_d_day_preparation_state = yes 
						has_dynamic_modifier = { modifier = d_day_preparation_state_modifier }
					}
				}
				FROM.FROM = { 
					remove_dynamic_modifier = { modifier = d_day_preparation_state_modifier days = 365 }
				}
			}
		}
		effect = {
			if = {
				limit = {
					is_historical_focus_on = no
				}
				if = {
					limit = {
						FROM.FROM = {
							compliance < 25
						}
					}
					FROM.FROM = { set_compliance = 25 }
				}		
			}
		}
		effect = {
			if = {
				limit = {
					FROM.FROM = { state = 605 is_owned_by = CHI }
					ROOT = { tag = PRC }
					FROM = { tag = CHI }
					NOT = { has_global_flag = a605_flag_check }
				}
				set_global_flag = a605_flag_check
				every_country = {
					limit = {
						is_literally_china = yes
						is_in_faction_with = CHI
					}
					transfer_units_fraction = {
						target = PRC
						size = 0 
						army_ratio = 0.15
						air_ratio = 0.1
					}
					add_ideas = CHI_morale_loss_605
				}
			}
		}
		effect = {
			if = {
				limit = {
					FROM.FROM = { state = 613 is_owned_by = CHI }
					ROOT = { tag = PRC }
					FROM = { tag = CHI }
					NOT = { has_global_flag = a613_flag_check }
				}
				set_global_flag = a613_flag_check
				every_country = {
					limit = {
						is_literally_china = yes
						is_in_faction_with = CHI
					}
					transfer_units_fraction = {
						target = PRC
						size = 0 
						army_ratio = 0.15 
						air_ratio = 0.1
					}
					add_ideas = CHI_morale_loss_613
				}
			}
		}
		effect = {
			if = {
				limit = {
					FROM.FROM = { state = 608 is_owned_by = CHI }
					ROOT = { tag = PRC }
					FROM = { tag = CHI }
					NOT = { has_global_flag = a608_flag_check }
				}
				set_global_flag = a608_flag_check
				every_country = {
					limit = {
						is_literally_china = yes
						is_in_faction_with = CHI
					}
					transfer_units_fraction = {
						target = PRC
						size = 0 
						army_ratio = 0.15 
						air_ratio = 0.1
					}
					add_ideas = CHI_morale_loss_608
				}
			}
		}
		effect = {
			if = {
				limit = {
					FROM.FROM = { state = 716 is_owned_by = CHI }
					ROOT = { tag = PRC }
					FROM = { tag = CHI }
					NOT = { has_global_flag = a716_flag_check }
				}
				set_global_flag = a716_flag_check
				every_country = {
					limit = {
						is_literally_china = yes
						is_in_faction_with = CHI
					}
					transfer_units_fraction = {
						target = MAN
						size = 0 
						army_ratio = 0.2
					}
					add_ideas = CHI_morale_loss_716
				}
			}
		}
		effect = {
			if = {
				limit = {
					FROM.FROM = { state = 605 is_owned_by = CHI }
					ROOT = { tag = MAN }
					FROM = { tag = CHI }
					NOT = { has_global_flag = a605_flag_check }
				}
				set_global_flag = a605_flag_check
				every_country = {
					limit = {
						is_literally_china = yes
						is_in_faction_with = CHI
					}
					transfer_units_fraction = {
						target = MAN
						size = 0 
						army_ratio = 0.2
					}
					add_ideas = CHI_morale_loss_605
				}
			}
		}
		effect = {
			if = {
				limit = {
					FROM.FROM = { state = 613 is_owned_by = CHI }
					ROOT = { tag = MAN }
					FROM = { tag = CHI }
					NOT = { has_global_flag = a613_flag_check }
				}
				set_global_flag = a613_flag_check
				every_country = {
					limit = {
						is_literally_china = yes
						is_in_faction_with = CHI
					}
					transfer_units_fraction = {
						target = MAN
						size = 0 
						army_ratio = 0.2
					}
					add_ideas = CHI_morale_loss_613
				}
			}
		}
		effect = {
			if = {
				limit = {
					FROM.FROM = { state = 608 is_owned_by = CHI }
					ROOT = { tag = MAN }
					FROM = { tag = CHI }
					NOT = { has_global_flag = a608_flag_check }
				}
				set_global_flag = a608_flag_check
				every_country = {
					limit = {
						is_literally_china = yes
						is_in_faction_with = CHI
					}
					transfer_units_fraction = {
						target = MAN
						size = 0 
						army_ratio = 0.2
					}
					add_ideas = CHI_morale_loss_608
				}
			}
		}
		effect = {
			if = {
				limit = {
					FROM.FROM = { is_claimed_by = BUL }
					ROOT = { tag = BUL }
				}
				FROM.FROM = {
					BUL = {
						transfer_state = PREV
					}
					add_core_of = BUL
				}
			}
			if = {
				limit = {
					FROM.FROM = { 
						is_claimed_by = HUN 
						OR = {
							BUL_is_balkan_state = yes
							is_core_of = POL
							is_claimed_by = AUS
							is_core_of = AUS
						}
					}
					is_historical_focus_on = no
					ROOT = { tag = HUN }
				}
				FROM.FROM = {
					HUN = {
						transfer_state = PREV
					}
					add_core_of = HUN
				}
			}
		}
		effect = {
			if = {
				limit = {
					FROM.FROM = { 
						is_core_of = JAP
						NOT = { state = 282 }
					}
					ROOT = { 
						has_war_with = JAP 
						has_civil_war = no
					}
					FROM = {
						tag = JAP
						NOT = { has_idea = for_the_emperor_idea }
					}
				}		
				if = {
					limit = {
						JAP = {
							NOT = { has_country_flag = JAP_lost_core_1 }
						}
					}
					JAP = { set_country_flag = JAP_lost_core_1 }
				}		
				else_if = {
					limit = {
						JAP = {
							has_country_flag = JAP_lost_core_1
							NOT = { has_country_flag = JAP_lost_core_2 }
						}
					}
					JAP = { 
						set_country_flag = JAP_lost_core_2 
						add_ideas = for_the_emperor_idea
					}
				}	
				else_if = {
					limit = {
						JAP = {
							has_country_flag = JAP_lost_core_2
							NOT = { has_country_flag = JAP_lost_core_3 }
						}
					}
					JAP = { 
						set_country_flag = JAP_lost_core_3
					}
				}	
				else_if = {
					limit = {
						JAP = {
							has_country_flag = JAP_lost_core_3
							NOT = { has_country_flag = JAP_lost_core_4 }
						}
					}
					JAP = {
						set_country_flag = JAP_lost_core_4
						set_technology = { JAP_for_the_emperor_tech = 1 popup = no }
					}
					if = {
						limit = {
							any_state = {
								is_core_of = JAP
								controller = { is_in_faction_with = USA }
								USA = { divisions_in_state = { state = PREV size > 0 } }
							}
						}
						USA = { country_event = { id = LSM_equipment.20 } }
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					FROM.FROM = { 
						is_core_of = JAP
						state = 282
					}
					ROOT = { 
						has_war_with = JAP 
						has_civil_war = no
					}
					FROM = {
						tag = JAP
						NOT = { has_idea = for_the_emperor_idea }
						NOT = { has_tech = JAP_for_the_emperor_tech }
					}
				}
				JAP = { 
					set_country_flag = JAP_lost_core_1
					set_country_flag = JAP_lost_core_2 
					set_country_flag = JAP_lost_core_3 
					set_country_flag = JAP_lost_core_4 
					add_ideas = for_the_emperor_idea
					set_technology = { JAP_for_the_emperor_tech = 1 popup = no }
				}
				if = {
					limit = {
						any_state = {
							is_core_of = JAP
							controller = { is_in_faction_with = USA }
							USA = { divisions_in_state = { state = PREV size > 0 } }
						}
					}
					USA = { country_event = { id = LSM_equipment.20 } }
				}
			}
		}
		effect = {
			if = {
				limit = {
					FROM.FROM = {
						OR = {
							is_core_of = ITA
							is_core_of = GER
							is_core_of = FRA
							is_core_of = BEL
							is_core_of = HOL
						}
					}
					FROM = { is_in_faction_with = GER }
					ROOT = { is_in_faction_with = ENG }
					has_global_flag = d_day_happened
				}
				clr_global_flag = last_change_at_d_day
				set_global_flag = last_change_at_d_day
			}
		}
		effect = {
			if = {
				limit = {
					FROM.FROM = { owner = { tag = SOV } }
					FROM = { has_war_with = ROOT }
				}
				SOV = { 
					clr_country_flag = days_since_last_change_on_the_map
					set_country_flag = days_since_last_change_on_the_map
				}
			}
		}
		effect = {
			if = {
				limit = {
					FROM = { tag = SOV }
					FROM.FROM = { owner = { tag = SOV } }
					FROM = { has_war_with = ROOT }
				}
				SOV = { 
					clr_country_flag = last_map_change_axis_purpose
					set_country_flag = last_map_change_axis_purpose
				}
			}
		}
		effect = {
			if = {
				limit = {
					FROM.FROM = { owner = { tag = SOV } }
					FROM = { has_war_with = SOV }
					ROOT = { tag = SOV }
				}
				SOV = { 
					clr_country_flag = last_map_change_allies_purpose
					set_country_flag = last_map_change_allies_purpose
				}
			}
		}
		effect = {
			if = {
				limit = {
					FROM.FROM = { owner = { tag = SOV } }
					ROOT = { tag = GER }
				}
				GER = { 
					clr_country_flag = GER_is_making_progress
					set_country_flag = GER_is_making_progress
				}
			}
		}
		effect = {
			if = {
				limit = {
					FROM.FROM = { owner = { tag = FRA } }
					ROOT = { tag = GER }
				}
				GER = { 
					clr_country_flag = GER_is_making_progressFRA
					set_country_flag = GER_is_making_progressFRA
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = {
						AND = {
							tag = GER 
							has_dynamic_modifier = { modifier = GER_blitzkrieg_modifier }
						}
					}
					FROM = { has_war_with = GER }
					FROM.FROM = { NOT = { has_state_flag = has_been_blitzkrieged } }
				}
				GER = {
					blitzkrieg_up = yes
					blitzkrieg_up = yes
					blitzkrieg_up = yes
				}
				if = { 
					limit = {
						has_country_flag = GER_barbarossa_offensive_enabled
					}
					blitzkrieg_up = yes
				}		
				FROM.FROM = { set_state_flag = has_been_blitzkrieged }
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { has_war_with = JAP }
					FROM = { tag = JAP }
					FROM.FROM = { is_core_of = JAP }
					any_country = {
						is_in_faction_with = ROOT
						num_of_controlled_factories > 300
					}
				}
				FROM.FROM = {
					add_building_construction = {
						type = supply_node
						level = 1
						instant_build = yes
						province = {
							all_provinces = yes
							limit_to_victory_point > 0
						}
					}
					add_building_construction = {
						type = naval_base
						level = 2
						instant_build = yes
						province = {
							all_provinces = yes
							limit_to_victory_point > 0
							limit_to_coastal = yes
						}
					}
					add_building_construction = {
						type = air_base
						level = 3
						instant_build = yes
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						is_in_faction_with = GER
					}
					FROM = { has_war_with = GER }
					FROM.FROM = { NOT = { has_state_flag = has_been_blitzkrieged } }
				}
				GER = {
					blitzkrieg_up = yes #reduced gain but does not apply blitzkrieg flag
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { 
						is_in_faction_with = ENG
					}
					FROM = { tag = ITA }
					FROM.FROM = { NOT = { has_state_flag = state_italy_landing } }
					FROM.FROM = { is_core_of = ITA }
					NOT = { ENG = { has_country_flag = italy_landing_3 } }
				}
				FROM.FROM = { set_state_flag = state_italy_landing }
				ENG = {
					if = {
						limit = {
							NOT = { has_country_flag = italy_landing_1 }
							NOT = { has_country_flag = italy_landing_2 }
							NOT = { has_country_flag = italy_landing_3 }
						}
						set_country_flag = italy_landing_1
					}
					if = {
						limit = {
							has_country_flag = {
								flag = italy_landing_1
								days > 7 
							}
							NOT = {
								has_country_flag = {
									flag = italy_landing_2
								}
							}
						}
						set_country_flag = italy_landing_2
					}
					if = {
						limit = {
							has_country_flag = {
								flag = italy_landing_2
								days > 7 
							}
							NOT = {
								has_country_flag = {
									flag = italy_landing_3
								}
							}
						}
						set_country_flag = italy_landing_3
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = {  
						NOT = { tag = GER }
						NOT = { is_in_faction_with = GER }
					}
					FROM.FROM = { has_state_flag = has_been_blitzkrieged }
				}
				FROM.FROM = { clr_state_flag = has_been_blitzkrieged }
			}
		}
		effect = {
			if = {
				limit = {
					FROM = { 
						tag = GER
						has_dynamic_modifier = { modifier = GER_blitzkrieg_modifier }
					}
					ROOT = { has_war_with = GER }
				}
				GER = {
					blitzkrieg_down = yes
					blitzkrieg_down = yes
					blitzkrieg_down = yes
					blitzkrieg_down = yes
					blitzkrieg_down = yes
					if = { 
						limit = {
							is_ai = no
						}
						blitzkrieg_down = yes
						blitzkrieg_down = yes
						blitzkrieg_down = yes
					}
				}
			}
		}
		effect = {
			if = {
				limit = { 
					AND = {
						OR = {
							FROM.FROM = { has_dynamic_modifier = { modifier = LSM_last_stand_modifier } }
							FROM.FROM = { has_dynamic_modifier = { modifier = LSM_enclave_last_stand_modifier } }
						}
						FROM.FROM = { has_state_category = town }
					}
					has_global_flag = enclave_enabled
				}
				FROM.FROM = { add_dynamic_modifier = { modifier = LSM_counterattack_modifier days = 7 scope = FROM } }
			}
		}
		effect = {
			if = {
				limit = { 
					AND = {
						OR = {
							FROM.FROM = { has_dynamic_modifier = { modifier = LSM_last_stand_modifier } }
							FROM.FROM = { has_dynamic_modifier = { modifier = LSM_enclave_last_stand_modifier } }
						}
						FROM.FROM = { has_state_category = large_town }
					}
					has_global_flag = enclave_enabled
				}
				FROM.FROM = { add_dynamic_modifier = { modifier = LSM_counterattack_modifier days = 10 scope = FROM } }
			}
		}
		effect = {
			if = {
				limit = { 
					AND = {
						OR = {
							FROM.FROM = { has_dynamic_modifier = { modifier = LSM_last_stand_modifier } }
							FROM.FROM = { has_dynamic_modifier = { modifier = LSM_enclave_last_stand_modifier } }
						}
						FROM.FROM = { has_state_category = city }
					}
					has_global_flag = enclave_enabled
				}
				FROM.FROM = { add_dynamic_modifier = { modifier = LSM_counterattack_modifier days = 13 scope = FROM } }
			}
		}
		effect = {
			if = {
				limit = { 
					AND = {
						OR = {
							FROM.FROM = { has_dynamic_modifier = { modifier = LSM_last_stand_modifier } }
							FROM.FROM = { has_dynamic_modifier = { modifier = LSM_enclave_last_stand_modifier } }
						}
						FROM.FROM = { has_state_category = large_city }
					}
					has_global_flag = enclave_enabled
				}
				FROM.FROM = { add_dynamic_modifier = { modifier = LSM_counterattack_modifier days = 16 scope = FROM } }
			}
		}
		effect = {
			if = {
				limit = { 
					AND = {
						OR = {
							FROM.FROM = { has_dynamic_modifier = { modifier = LSM_last_stand_modifier } }
							FROM.FROM = { has_dynamic_modifier = { modifier = LSM_enclave_last_stand_modifier } }
						}
						FROM.FROM = { has_state_category = metropolis }
					}
					has_global_flag = enclave_enabled
				}
				FROM.FROM = { add_dynamic_modifier = { modifier = LSM_counterattack_modifier days = 7 scope = FROM } }
			}
		}
		effect = {
			if = {
				limit = { 
					AND = {
						OR = {
							FROM.FROM = { has_dynamic_modifier = { modifier = LSM_last_stand_modifier } }
							FROM.FROM = { has_dynamic_modifier = { modifier = LSM_enclave_last_stand_modifier } }
						}
						FROM.FROM = { has_state_category = megalopolis }
					}
					has_global_flag = enclave_enabled
				}
				FROM.FROM = { add_dynamic_modifier = { modifier = LSM_counterattack_modifier days = 7 scope = FROM } }
			}
		}
		effect = {
			if = {
				limit = { 
					OR = {
						FROM.FROM = { is_core_of = ENG }
						FROM.FROM = { is_core_of = JAP }
						FROM.FROM = { is_core_of = USA }
					}
					FROM = { has_war_with = ROOT }
					has_global_flag = enclave_enabled
				}
				FROM.FROM = { add_dynamic_modifier = { modifier = LSM_counterattack_modifier days = 7 scope = FROM } }
			}
		}
		effect = {	
			if = {
				limit = {
					FROM.FROM = { is_core_of = USA }
					FROM = { has_war_with = ROOT }
					has_global_flag = enclave_enabled
				}
				FROM.FROM = { add_dynamic_modifier = { modifier = LSM_gunning_our_way_modifier days = 365 scope = USA } }
			}
		}
		effect = {
			if = {
				limit = {
					FROM.FROM = { is_core_of = ENG }
					FROM = { has_war_with = ROOT }
					has_global_flag = enclave_enabled
				}
				FROM.FROM = { add_dynamic_modifier = { modifier = LSM_no_cheesing_modifier days = 35 } }
			}
		}
		effect = {
			if = {
				limit = {
					FROM.FROM = { is_core_of = JAP }
					FROM = { has_war_with = ROOT }
					has_global_flag = enclave_enabled
				}
				FROM.FROM = { add_dynamic_modifier = { modifier = LSM_no_cheesing_modifier } } #only removable by the hidden trigger
			}
		}
		effect = {
			if = {
				limit = {
					FROM.FROM = { 
						is_core_of = ENG 
						NOT = { is_core_of = FRA }
					}
					ROOT = { tag = ENG }
					FROM = { has_war_with = ENG }
					has_global_flag = british_homeland_resistance_organised_flag
				}
				FROM.FROM = { 
					add_manpower = -24000
					create_unit = {
						division = "name = \"British Militia\" division_template = \"Militia Cope Division\" start_experience_factor = 0 start_equipment_factor = 0.2"  
						owner = ENG
					}
					create_unit = {
						division = "name = \"British Militia\" division_template = \"Militia Cope Division\" start_experience_factor = 0 start_equipment_factor = 0.2"  
						owner = ENG
					}
					create_unit = {
						division = "name = \"British Militia\" division_template = \"Militia Cope Division\" start_experience_factor = 0 start_equipment_factor = 0.2"  
						owner = ENG
					}
					create_unit = {
						division = "name = \"British Militia\" division_template = \"Militia Cope Division\" start_experience_factor = 0 start_equipment_factor = 0.2"  
						owner = ENG
					}
					create_unit = {
						division = "name = \"British Militia\" division_template = \"Militia Cope Division\" start_experience_factor = 0 start_equipment_factor = 0.2"  
						owner = ENG
					}
					create_unit = {
						division = "name = \"British Militia\" division_template = \"Militia Cope Division\" start_experience_factor = 0 start_equipment_factor = 0.2"  
						owner = ENG
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					FROM.FROM = { 
						is_core_of = FRA
						is_core_of = ENG
					}
					ROOT = { tag = ENG }
					FROM = { has_war_with = ENG }
					has_global_flag = british_homeland_resistance_organised_flag
				}
				FROM.FROM = { 
					add_manpower = -24000
					create_unit = {
						division = "name = \"French Militia\" division_template = \"Militia Cope Division\" start_experience_factor = 0 start_equipment_factor = 0.1"  
						owner = ENG
					}
					create_unit = {
						division = "name = \"French Militia\" division_template = \"Militia Cope Division\" start_experience_factor = 0 start_equipment_factor = 0.1"  
						owner = ENG
					}
					create_unit = {
						division = "name = \"British Militia\" division_template = \"Militia Cope Division\" start_experience_factor = 0 start_equipment_factor = 0.1"  
						owner = ENG
					}
					create_unit = {
						division = "name = \"British Militia\" division_template = \"Militia Cope Division\" start_experience_factor = 0 start_equipment_factor = 0.1"  
						owner = ENG
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					FROM.FROM = { 
						NOT = { is_core_of = ENG }  
						is_core_of = FROM
						owner = { NOT = { is_in_faction_with = ENG } }
					}
					ROOT = { 
						AND = {
							OR = {
								tag = ENG 
								tag = CAN 
								tag = SAF 
								tag = AST 
								tag = NZL 
								tag = RAJ 
							}
							is_in_faction_with = ENG
						}
					}
					FROM = { 
						has_war_with = ENG 
						has_country_flag = ENG_target_of_vengeance
					}
					has_global_flag = ENG_vengeance_flag
				}
				FROM.FROM = {
					add_manpower = -2300000
					add_dynamic_modifier = { modifier = ENG_unimaginable_destruction_vengeance }
				}
			}
		}
		effect = {
			if = {
				limit = {
					FROM.FROM = { 
						NOT = { is_core_of = ENG } 
						is_core_of = FROM
						owner = { NOT = { is_in_faction_with = ENG } }
					}
					ROOT = { 
						AND = {
							OR = {
								tag = ENG 
								tag = CAN 
								tag = SAF 
								tag = AST 
								tag = NZL 
								tag = RAJ 
							}
							is_in_faction_with = ENG
						}
					}
					FROM = { 
						has_war_with = ENG 
						has_country_flag = ENG_target_of_vengeance
					}
					has_global_flag = british_kinda_want_revenge
				}
				FROM.FROM = {
					add_manpower = -1200000
					add_dynamic_modifier = { modifier = ENG_unimaginable_destruction }
				}
			}
		}
	}
	on_paradrop = {
		effect = {
			if = { 
				limit = { 
					ROOT = { 
						tag = ITA 
						has_war_with = ETH
					}
					has_global_flag = second_italo_ethiopian_war_flag
				}
				self_org_nuke_effect = yes
				set_global_flag = anti_cheese_ethiopia
				ETH = {
					if = {
						limit = { 
							NOT = { has_completed_focus = ETH_boarding_the_train }
						}
						complete_national_focus = ETH_boarding_the_train
					}
					if = {
						limit = { 
							NOT = { has_completed_focus = ETH_rally_around_the_emperor }
						}
						complete_national_focus = ETH_rally_around_the_emperor
					}
					capital_scope = {
						create_unit = {
							division = "name = \"Irregular Infantry\" division_template = \"Chitet Sefari\" start_experience_factor = 0.05 start_equipment_factor = 0.03" 
							owner = PREV 
							allow_spawning_on_enemy_provs = yes  
							count = 4
						}
					}
				}
			}
		}
		effect = {
			if = { 
				limit = { 
					ROOT = { has_country_flag = the_paratrooper_fumble }
				}
				self_org_nuke_effect = yes
			}
		}
		effect = {
			if = { 
				limit = { 
					ROOT = { has_war_with = FRA }
				}
				FRA = { 
					set_country_flag = {
						flag = paradrop_grace 
						days = 90
					}
				}
			}
		}
		effect = {
			if = { 
				limit = { #trying to install a better check for FRA cores only but hey, what other reasons do you use paradrop early anyway
					OR = {
						ROOT = { tag = GER } 
						ROOT = { tag = ITA }
						has_government = fascism
					} 
					FRA = { has_idea = FRA_disjointed_government }
				}
				FRA = { remove_ideas = FRA_disjointed_government }
				FRA = { set_country_flag = anti_exploit_deployment }
			}
			if = { 
				limit = { #trying to install a better check for FRA cores only but hey, what other reasons do you use paradrop early anyway
					ROOT = { tag = GER }
					has_war_with = FRA
					FRA = { has_capitulated = no }
					NOT = { has_global_flag = FRA_GER_anti_exploit_paras }
					has_global_flag = this_is_fine
				}
				set_global_flag = FRA_GER_anti_exploit_paras
				FRA = {
					division_template = {
						name = "Paratrooper template 1"
						division_names_group = FRA_PAR_01
						regiments = {
							paratrooper = { x = 0 y = 0 }
							paratrooper = { x = 0 y = 1 }
							paratrooper = { x = 0 y = 2 }
						}
					}
				}
				64 = {
					create_unit = {
						division = "name = \"Paratrooper\" division_template = \"Paratrooper template 1\" start_experience_factor = 0.3 start_equipment_factor = 1"  
						owner = FRA
						allow_spawning_on_enemy_provs = yes  
						count = 3  
					}
					SF_PARA_sabotage_effect = yes
					SF_PARA_sabotage_effect = yes
					SF_PARA_sabotage_effect = yes
				}
				59 = {
					create_unit = {
						division = "name = \"Paratrooper\" division_template = \"Paratrooper template 1\" start_experience_factor = 0.3 start_equipment_factor = 1"  
						owner = FRA
						allow_spawning_on_enemy_provs = yes  
						count = 3  
					}
					SF_PARA_sabotage_effect = yes
					SF_PARA_sabotage_effect = yes
				}
			}
			if = { 
				limit = { #trying to install a better check for FRA cores only but hey, what other reasons do you use paradrop early anyway
					ROOT = { tag = ITA }
					has_war_with = FRA
					FRA = { has_capitulated = no }
					NOT = { has_global_flag = FRA_ITA_anti_exploit_paras }
					has_global_flag = this_is_fine
				}
				set_global_flag = FRA_ITA_anti_exploit_paras
				FRA = {
					division_template = {
						name = "Paratrooper template 2"
						division_names_group = FRA_PAR_01
						regiments = {
							paratrooper = { x = 0 y = 0 }
							paratrooper = { x = 0 y = 1 }
							paratrooper = { x = 0 y = 2 }
						}
					}
				}
				158 = {
					create_unit = {
						division = "name = \"Paratrooper\" division_template = \"Paratrooper template 1\" start_experience_factor = 0.3 start_equipment_factor = 1"  
						owner = FRA
						allow_spawning_on_enemy_provs = yes  
						count = 3  
					}
					SF_PARA_combat_effect = yes
					SF_PARA_sabotage_effect = yes
				}
				159 = {
					create_unit = {
						division = "name = \"Paratrooper\" division_template = \"Paratrooper template 1\" start_experience_factor = 0.3 start_equipment_factor = 1"  
						owner = FRA
						allow_spawning_on_enemy_provs = yes  
						count = 3  
					}
					SF_PARA_sabotage_effect = yes
					SF_PARA_sabotage_effect = yes
				}
			}
		}
	}
	on_naval_invasion = {
	 	effect = {
		 	if = {
				limit = {
					ROOT = {
						OR = {
							divisions_in_state = {
								unit = marine
								size > 0
								state = PREV
							}
							divisions_in_state = {
								unit = pioneer_support
								size > 0
								state = PREV
							}
						}
						OR = {
							has_idea = d_day_preparation_2
							has_idea = d_day_preparation_3
						}
					}
					NOT = { has_state_flag = d_day_effect }
					has_global_flag = {
						flag = tremor_of_d_day
						days < 365
					}
					is_on_continent = europe
					OWNER = { NOT = { tag = ROOT } }
				}
				d_day_org_nuke_effect = yes # Note that the state flag condition is not preventing it from doing 1 damage per division
			}
	 	}
	 	effect = {
		 	if = {
				limit = {
					ROOT = {
						OR = {
							divisions_in_state = {
								unit = marine
								size > 0
								state = PREV
							}
							divisions_in_state = {
								unit = pioneer_support
								size > 0
								state = PREV
							}
						}
					}
					NOT = { has_state_flag = org_recovery_effect_flag }
					OWNER = { NOT = { tag = ROOT } }
				}
				org_recovery_effect = yes
			}
	 	}
	 	effect = {
		 	if = {
				limit = {
					NOT = { has_state_flag = recent_naval_invasion_flag }
				}
				set_state_flag = {
					flag = recent_naval_invasion_flag
					days = 180
				} 
			}
	 	}
	}
	on_capitulation = {
		effect = {
			if = {
				limit = {
					FROM = { 
						tag = GER
					}
					ROOT = {
						tag = FRA
					}
					is_historical_focus_on = yes
				}
				if = {
					limit = {
						has_global_flag = d_day_was_a_success
					}
					clr_global_flag = d_day_was_a_success
				}
				if = {
					limit = {
						has_global_flag = d_day_happened
					}
					clr_global_flag = d_day_happened
				}
			}
		}
		effect = {
			if = {
				limit = {
					FROM = { 
						tag = SOV
						has_government = communism
					}
					ROOT = {
						NOT = { original_tag = SOV }
					}
					date < 1939.1.1
					is_historical_focus_on = yes
					has_global_flag = {
						flag = SOV_has_early_war
						days > 1
					}
				}
				hidden_effect = {
					set_global_flag = SOV_has_early_war_2
				}
			}
		}
		effect = {
			if = {
				limit = {
					FROM = { 
						original_tag = ROOT
					}
				}
				every_state = {
					limit = {
						is_claimed_by = ROOT
					}
					remove_claim_by = ROOT
				}
			}
		}
		effect = {
			if = {
				limit = {
					FROM = { 
						tag = SOV
						has_government = communism
					}
					ROOT = {
						NOT = { original_tag = SOV }
					}
					date < 1939.1.1
					is_historical_focus_on = yes
					has_global_flag = {
						flag = SOV_has_early_war_2
						days > 1
					}
				}
				hidden_effect = {
					set_global_flag = SOV_has_early_war_3
				}
			}
		}
		effect = {
			if = {
				limit = {
					FROM = { 
						tag = SOV
						has_government = communism
					}
					ROOT = {
						NOT = { original_tag = SOV }
					}
					date < 1939.1.1
					is_historical_focus_on = yes
					NOT = { has_global_flag = SOV_has_early_war }
				}
				hidden_effect = {
					set_global_flag = SOV_has_early_war
				}
			}
		}
		effect = {
			ROOT = { 
				set_country_flag = lsm_eligibility_nation
			}
		}
		effect = {
			if = { 
				limit = {
					ROOT = { 
						is_in_faction_with = ENG 
					}
					ENG = {  
						has_country_leader = {
							character = ENG_winston_churchill
							ruling_only = yes
						} 
					}
				}
				add_equipment_to_stockpile = {
					type = convoy
					amount = 200
				}
			}
		}
	}

	on_puppet = {
		effect = {
			if = {
				limit = {
					NOT = { has_idea = why_are_you_sending_me_troops_fking_puppets }
				}
				add_ideas = why_are_you_sending_me_troops_fking_puppets
			}
		}
	}

	on_startup = {
		effect = {
			if = { 
				limit = { SOV = { is_ai = yes } }
				SOV = {
					every_other_country = {
						limit = {
							is_ai = yes
							OR = {
								has_government = neutrality
								has_government = communism
							}
							OR = {
								capital_scope = { is_on_continent = asia }
								capital_scope = { is_on_continent = middle_east }
								tag = GRE
								tag = YUG
								tag = POL
								tag = EST
								tag = LIT
								tag = LAT	
							}
						}
						add_opinion_modifier = {
				   			target = SOV
				   			modifier = trade_relation_bonus_high
						}
						add_opinion_modifier = {
				   			target = SOV
				   			modifier = trade_relation_bonus_high_1
						}
					}					
				}
			}
		}
		effect = {
			if = {
				limit = { SOV = { is_ai = yes } }
				every_country = {
					limit = {
						is_ai = yes
						OR = {
							has_government = neutrality
							has_government = communism
						}
						OR = {
							capital_scope = { is_on_continent = asia }
							capital_scope = { is_on_continent = middle_east }
							tag = GRE
							tag = YUG
							tag = POL
							tag = EST
							tag = LIT
							tag = LAT
						}
					}
					SOV = {
						add_opinion_modifier = {
				   			target = PREV
				   			modifier = trade_relation_bonus_high
						}
						add_opinion_modifier = {
				   			target = PREV
				   			modifier = trade_relation_bonus_high_1
						}
					}
				}
			}
		}
		effect = {
			if = { 
				limit = { 
					any_country = { 
						is_allied_ai = yes
						is_ai = no 
					} 
				}
				SOV = {
					every_other_country = {
						limit = {
							is_ai = yes
							is_axis_ai = no
							OR = {
								has_government = neutrality
								has_government = communism
							}
							capital_scope = { is_on_continent = asia }
						}
						add_opinion_modifier = {
				   			target = SOV
				   			modifier = trade_relation_bonus_high
						}
					}					
				}
			}
		}
		effect = {
			if = { 
				limit = { 
					any_country = { 
						is_allied_ai = yes
						is_ai = no 
					} 
				}
				every_country = {
					limit = {
						is_ai = yes
						is_axis_ai = no
						OR = {
							has_government = neutrality
							has_government = communism
						}
						capital_scope = { is_on_continent = asia }
					}
					SOV = {
						add_opinion_modifier = {
				   			target = PREV
				   			modifier = trade_relation_bonus_high
						}
					}
				}
			}
		}
		effect = {
			FRA = {
				every_other_country = {
					limit = {
						is_ai = yes
						has_government = democratic
						OR = {
							capital_scope = { is_on_continent = europe }
							capital_scope = { is_on_continent = asia }
						}
						is_axis_ai = no
						NOT = { tag = CZE } #you are surrounded by Axis
						NOT = { tag = SWI } #prefer Axis shjt
					}
					add_opinion_modifier = {
				   		target = FRA
				   		modifier = trade_relation_bonus_high
					}
					add_opinion_modifier = {
				   		target = FRA
				   		modifier = trade_relation_bonus_high_1
					}
				}					
			}
		}
		effect = {
			every_country = {
				limit = {
					is_ai = yes
					has_government = democratic
					OR = {
						capital_scope = { is_on_continent = europe }
						capital_scope = { is_on_continent = asia }
					}
					is_axis_ai = no
					NOT = { tag = CZE } #you are surrounded by Axis
					NOT = { tag = SWI } #prefer Axis shjt
				}
				FRA = {
					add_opinion_modifier = {
				   		target = PREV
				   		modifier = trade_relation_bonus_high
					}
					add_opinion_modifier = {
				   		target = PREV
				   		modifier = trade_relation_bonus_high_1
					}
				}
			}
		}
		effect = {
			GER = {
				every_other_country = {
					limit = {
						is_ai = yes
						NOT = { tag = YUG }
						NOT = { tag = GRE }
						NOT = { tag = POL }
						OR = {
							AND = {
								NOT = { tag = EST }
								NOT = { tag = LAT }
								NOT = { tag = LIT }
							}
							any_allied_major_is_human = yes
						}
						OR = {
							has_government = fascism
							has_government = neutrality
							tag = ROM
							tag = SWE
							tag = HUN
							tag = BUL
							tag = DEN
							tag = NOR
						}
						OR = {
							capital_scope = { is_on_continent = europe }
							AND = {
								capital_scope = { is_on_continent = middle_east }
								any_allied_major_is_human = yes
							}
						}
					}
					add_opinion_modifier = {
				   		target = GER
				   		modifier = trade_relation_bonus_high
					}
					add_opinion_modifier = {
				   		target = GER
				   		modifier = trade_relation_bonus_high_1
					}
				}					
			}
		}
		effect = {
			every_country = {
				limit = {
					is_ai = yes
					NOT = { tag = YUG }
					NOT = { tag = GRE }
					NOT = { tag = POL }
					OR = {
						AND = {
							NOT = { tag = EST }
							NOT = { tag = LAT }
							NOT = { tag = LIT }
						}
						any_allied_major_is_human = yes
					}
					OR = {
						has_government = fascism
						has_government = neutrality
						tag = ROM
						tag = SWE
						tag = HUN
						tag = DEN
						tag = NOR
						tag = BUL
					}
					OR = {
						capital_scope = { is_on_continent = europe }
						AND = {
							capital_scope = { is_on_continent = middle_east }
							any_allied_major_is_human = yes
						}
					}
				}
				GER = {
					add_opinion_modifier = {
				   		target = PREV
				   		modifier = trade_relation_bonus_high
					}
					add_opinion_modifier = {
				   		target = PREV
				   		modifier = trade_relation_bonus_high_1
					}
				}
			}
		}
	}
	on_send_volunteers = {
		effect = {
			if = {
				limit = {
					ROOT = {
						original_tag = JAP
						is_ai = no
					}
					GER = { has_war_with = ENG }
					is_historical_focus_on = yes
					FROM = { 
						OR = {
							is_in_faction_with = GER
							has_war_with = ENG
						}
					}
				}
				every_country = {
					limit = {
						OR = {
							original_tag = USA
							original_tag = SWE
							is_in_faction_with = ENG
							original_tag = SOV
						}
						NOT = { is_in_faction_with = GER }
					}
					add_opinion_modifier = {
				   		target = JAP
				   		modifier = diplomatic_disapproval
					}
					add_opinion_modifier = {
				   		target = JAP
				   		modifier = resource_diplomatic_disapproval
					}
				}
			}	
		}
		effect = {
			if = {
				limit = {
					original_tag = SOV
					has_idea = SOV_molotov_ribbentrop_pact
					FROM = { 
						has_war_with = GER
					}
				}
				ROOT = { 
					add_political_power = -100
					add_stability = -0.10
					add_war_support = -0.10
				}
			}	
		}
		effect = {
			if = {
				limit = {
					FROM = { 
						tag = ETH
					}
					NOT = { has_country_flag = eth_ita_sov_vol_tick }
				}
				set_country_flag = eth_ita_sov_vol_tick
				add_named_threat = { threat = 3 name = "Interference in Italo-Ethiopian War" }
				air_experience = 20
			}	
		}
		effect = {
			if = {
				limit = {
					FROM = { 
						original_tag = SPR
						has_civil_war = yes
					}
					NOT = { has_country_flag = spr_vol_tick }
				}
				set_country_flag = spr_vol_tick
				add_named_threat = { threat = 1.2 name = "Volunteer in the Spanish Civil War" }
			}	
		}
		effect = {
			if = {
				limit = {
					original_tag = SOV
					FROM = { 
						original_tag = SPR 
						OR = {
							has_completed_focus = SPR_maintain_the_second_republic
							has_government = democratic
							has_government = communism
						}
					}
				}
				SOV = { set_country_flag = SOV_volunteer_in_spain }
			}	
		}
	}
}