on_actions = {
	on_capitulation = {
		effect = {
			if = {
				limit = {
					ROOT = { tag = MAN }
					FROM = { NOT = { has_war_with = PRC } }
					country_exists = PRC
					has_global_flag = kwantung_intervention
					is_historical_focus_on = yes
					has_global_flag = is_active
				}
				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 }
					FROM = { NOT = { has_war_with = PRC } }
					country_exists = PRC
					has_global_flag = kwantung_intervention
					is_historical_focus_on = yes
					has_global_flag = is_active
				}
				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
					FROM = { NOT = { has_war_with = PRC } }
					has_global_flag = kwantung_intervention
					has_global_flag = is_active
				}
				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
					has_global_flag = is_active
				}
				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 }
					has_global_flag = is_active
				}
				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 }
					has_global_flag = is_active
				}
				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
					has_global_flag = is_active
				}
				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
					NOT = { CHI = { is_subject_of = JAP } }
					is_historical_focus_on = yes
					has_global_flag = is_active
				}
				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 }
					OR = {
						NOT = { country_exists = CHI }
						CHI = { is_subject_of = JAP }
					}
					is_historical_focus_on = yes
					has_global_flag = is_active
				}
				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
								is_core_of = MAN
							}
							controller = { has_war_with = JAP }
						}
						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 = { has_war_with = JAP }
					}
					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
					has_global_flag = is_active
				}
				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
					has_global_flag = is_active
				}
				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 = { tag = JAP }
					has_global_flag = is_active
				}
				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 = { tag = JAP }
					NOT = { 
						any_country = { has_country_flag = this_guy_capitulated_japan }
					}
					has_global_flag = is_active
				}	
				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 = {
						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 = {
						any_country = {
							has_war_with = JAP 
							controls_state = 282
							NOT = {
								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 = {
							is_major = yes
							has_war_with = JAP
							any_war_score > 49
						}
					}
					random_country = {
						limit = {
							is_major = yes
							has_war_with = JAP
							any_war_score > 49
						}
						set_country_flag = this_guy_capitulated_japan
					}
				}	
				else_if = {
					limit = {						
						any_country = {
							is_major = yes
							has_war_with = JAP
						}
					}
					random_country = {
						limit = {
							is_major = yes
							has_war_with = JAP
						}
						set_country_flag = this_guy_capitulated_japan
					}
				}	
				else_if = {
					limit = {						
						any_country = {
							has_war_with = JAP
						}
					}
					random_country = {
						limit = {
							has_war_with = JAP
						}
						set_country_flag = this_guy_capitulated_japan
					}
				}
			}
		}
	}
	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.3.1
					is_historical_focus_on = yes
					has_global_flag = {
						flag = SOV_has_early_war
						days > 1
					}
					OR = {
						difficulty < 3
						difficulty > 3
					}
				}
				hidden_effect = {
					set_global_flag = SOV_has_early_war_2
					ENG = { add_named_threat = { name = ENG_discuss_intervention_tt threat = 10 } }
				}
			}
		}
		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.3.1
					is_historical_focus_on = yes
					OR = {
						difficulty < 3
						difficulty > 3
					}
					has_global_flag = {
						flag = SOV_has_early_war_2
						days > 1
					}
				}
				hidden_effect = {
					set_global_flag = SOV_has_early_war_3
					ENG = { add_named_threat = { name = ENG_discuss_intervention_2_tt threat = 15 } }
				}
			}
		}
		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_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 = { 
						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
					}
					FROM = { 
						original_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 = FROM
					}
				}
				FROM = { add_political_power = 50 }
				FROM = { add_stability = 0.05 }
				if = {
					limit = { 
						FROM = { has_completed_focus = SOV_the_right_opposition }
					}
					FROM = { 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 is_ai = yes }
					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 = 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
						}
						is_owned_by = ITA
					}
					ENG = { transfer_state = PREV }
				}			
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = { tag = LBA }
					FROM = { tag = ENG }
				}
				ITA = { annex_country = { target = LBA transfer_troops = yes } }
				every_state = {
					limit = {
						is_core_of = LBA
						is_owned_by = ITA
					}
					ENG = { transfer_state = PREV }
				}
				if = {
					limit = { 
						EGY = { is_ai = yes } 
						ENG = { is_ai = yes }
					}
					ENG = { transfer_state = 452 }
					ENG = { transfer_state = 552 }
				}			
			}
		}
		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 = DEN
						has_war_with = USA
					}
				}
				USA = { transfer_state = 101 }
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = {
						tag = FRA
					}
					has_global_flag = {
						flag = france_is_at_war
						days > 365
					}
				}
				FRA = {
					every_owned_state = {
						limit = { 
							is_core_of = FRA
							is_on_continent = europe
						}
						damage_building = { type = arms_factory damage = 2 }
						damage_building = { type = industrial_complex damage = 2 }
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = {
						tag = FRA
					}
					has_global_flag = {
						flag = france_is_at_war
						days > 180
					}
				}
				FRA = {
					every_owned_state = {
						limit = { 
							is_core_of = FRA
							is_on_continent = europe
						}
						damage_building = { type = arms_factory damage = 1 }
						damage_building = { type = industrial_complex damage = 1 }
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = {
						tag = FRA
					}
					has_global_flag = {
						flag = france_is_at_war
						days > 120
					}
				}
				FRA = {
					every_owned_state = {
						limit = { 
							is_core_of = FRA
							is_on_continent = europe
						}
						damage_building = { type = arms_factory damage = 1 }
						damage_building = { type = industrial_complex damage = 1 }
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					ROOT = {
						tag = FRA
					}
					has_global_flag = {
						flag = france_is_at_war
						days > 60
					}
				}
				FRA = {
					every_owned_state = {
						limit = { 
							is_core_of = FRA
							is_on_continent = europe
						}
						damage_building = { type = arms_factory damage = 1 }
						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
						YUG = { is_subject = no }
					}
				}
				if = {
					limit = {
						736 = { owner = { tag = ITA } }
					}
					736 = { add_core_of = YUG }
				}
				if = {
					limit = {
						852 = { owner = { tag = ITA } }
					}
					852 = { add_core_of = YUG }
				}
				if = {
					limit = {
						163 = { owner = { tag = ITA } }
					}
					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
					}
				}
			}
		}
		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
						}
					}
					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 }
					is_historical_focus_on = yes
				}
				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
					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
					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
					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_removed }
					}
				}
				ROOT = {
					remove_dynamic_modifier = { modifier = GER_blitzkrieg_modifier_removed }
				}
			}
		}
		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 = for_the_emperor_idea }
				}
				ROOT = { remove_ideas = for_the_emperor_idea }
			}
		}
		effect = {
			every_country = { 
				limit = { 
					ROOT = { has_wargoal_against = PREV }
				}
				ROOT = {
					remove_wargoal = {
						type = all
						target = PREV
					}
				}
			}
		}
		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_removed }
					}
				}
				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
					}
					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 = mr_pact_fulfillment_threat_SOV_tt }
					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
						}
					}
				}
			}
		}
	}
}