fascist_peace = {
	enable = {
		OR = {
			has_government = fascism
			AND = {
				NOT = { has_government = absolutist }
				NOT = { has_government = communism }
				NOT = { has_government = democratic }
				NOT = { has_government = radical }
				OR = {
					any_country = {
						is_in_faction_with = ROOT
						is_faction_leader = yes
						has_government = fascism
					}
					is_in_faction = no
					is_faction_leader = yes
				}
			}
		}
	}
	annex_randomness = 0
	liberate_randomness = 0
	puppet_randomness = 0
	take_states_randomness = 0
	force_government_randomness = 0
	annex = {
		factor = 1000 #800	

		modifier = {
			factor = 0
			NOT = {
				is_owner_neighbor_of = FROM
			}
			NOT = {
				has_annex_war_goal = FROM
			}
		}
		#modifier = { #
		#	factor = 0
		#	FROM = {
		#		any_owned_state = { 
		#			NOT = {
		#				OR = { 
		#					is_claimed_by = ROOT
		#					is_core_of = ROOT
		#					has_claimed_state_in_peace_conference = ROOT
		#				}
		#			}
		#		}
		#	}
		#}
		
		modifier = {
			factor = 0
			is_puppet = yes
			FROM = {
				any_owned_state = { 
					NOT = {
						OR = { 
							is_claimed_by = ROOT
							is_core_of = ROOT
							#has_claimed_state_in_peace_conference = ROOT
						}
					}
				}
			}
		}		
	}
	liberate = {
		factor = 0 #200 - disable for now
		
		modifier = {
			factor = 0

			NOT = {
				ai_liberate_desire = {
					target = FROM
					value > 0
				}
			}
		}
		modifier = {
			factor = 0 #0.5 - only liberate fascists!
			NOT = {
				FROM = {
					has_government = fascism
				}
			}
		}
	}
	puppet = {
		factor = 100 #150
		modifier = {
			factor = 0
			is_puppet = yes
		}
		modifier = {
			factor = 0
			NOT = { 
				any_owned_state = {
					any_neighbor_state = {
						NOT = { is_owned_by = FROM }
						NOT = { is_owned_by = ROOT }
						is_controlled_by = ROOT
					}
				}
			}
			NOT = {
				FROM = {
					any_neighbor_country = {
						is_puppet_of = ROOT
					}
				}
			}
			NOT = {
				FROM = {
					any_owned_state = {
						any_neighbor_state = {
							OR = {
								owner = { tag = ROOT }
								owner = { is_puppet_of = ROOT }
								has_claimed_state_in_peace_conference = ROOT
							}
						}
					}
				}
			}
			OR = {
				FROM = { capital_scope = { is_on_continent = europe } }
				NOT = {
					FROM = {
						any_owned_state = { 
							OR = {
								is_coastal = yes
								is_island_state = yes
							}
						}
					}
				}
				NOT = { any_owned_state = { OR = { is_coastal = yes is_island_state = yes } } }
			}
		}
		modifier = { #Don't puppet nations in civil war... this is too buggy.
			factor = 0
			FROM = { has_civil_war = yes }
		}
		modifier = { #Not if we or our allies claim anything
			factor = 0
			OR = {
				FROM = { 
					any_owned_state = { 
						OR = {
							is_claimed_by = ROOT
							is_core_of = ROOT
						}
						NOT = { has_claimed_state_in_peace_conference = ROOT }
					} 
				}
				#any_country = {
				#	is_in_faction_with = ROOT
				#	is_puppet = no
				#	FROM = {
				#		any_owned_state = { #PREVPREV doesn't work!!!
				#			OR = {
				#				is_claimed_by = PREVPREV
				#				is_core_of = PREVPREV
				#			}
				#		}
				#	}
				#}
			}
		}
		modifier = { #Deter expansion outside of continent - puppet on continent first
			factor = 0.1
			OR = {
				AND = {
					capital_scope = { is_on_continent = europe }
					NOT = { FROM = { capital_scope = { is_on_continent = europe } } }
				}
				AND = {
					capital_scope = { is_on_continent = north_america }
					NOT = { FROM = { capital_scope = { is_on_continent = north_america } } }
				}
				AND = {
					capital_scope = { is_on_continent = south_america }
					NOT = { FROM = { capital_scope = { is_on_continent = south_america } } }
				}
				AND = {
					capital_scope = { is_on_continent = australia }
					NOT = { FROM = { capital_scope = { is_on_continent = australia } } }
				}
				AND = {
					capital_scope = { is_on_continent = africa }
					NOT = { FROM = { capital_scope = { is_on_continent = africa } } }
				}
				AND = {
					capital_scope = { is_on_continent = asia }
					NOT = { FROM = { capital_scope = { is_on_continent = asia } } }
				}
				AND = {
					capital_scope = { is_on_continent = middle_east }
					NOT = { FROM = { capital_scope = { is_on_continent = middle_east } } }
				}
			}
		}

		modifier = { #Not if we or a faction member have a stated interest to wipe them off the map
			factor = 0
			OR = {
				has_annex_war_goal = FROM
				any_country = {
					is_in_faction_with = ROOT
					has_annex_war_goal = FROM
				}
			}
		}
		modifier = { #Dismantle empires before puppeting
			factor = 0.1
			FROM = {
				any_owned_state = {
					NOT = { is_core_of = FROM }
					NOT = { has_claimed_state_in_peace_conference = ROOT }
				}
			}
		}
	}
	take_states = {
		factor = 600 #Up from 500 #200 - vanilla
		modifier = { # prefer not to take from humans in our own faction
			factor = 0.5
			NOT = { 
				FROM = { 
					OR = {
						is_claimed_by = ROOT
						is_core_of = ROOT
					}
				} 
			}
			FROM = {
				controller = { 
					is_ai = no 
					has_capitulated = no 
					is_puppet = no 
					is_in_faction_with = ROOT
				}
			}
		}
		modifier = { #Only majors can take non-neighboring coastal territories for now to prevent weird results with 1.1
			factor = 0
			FROM = {
				is_coastal = yes
			}
			NOT = { 
				FROM = { 
					OR = {
						is_claimed_by = ROOT
						is_core_of = ROOT
					}
				} 
			}
			NOT = {
				FROM = {
					any_neighbor_state = {
						OR = {
							owner = { tag = ROOT }
							has_claimed_state_in_peace_conference = ROOT
							#AND = {
							#	controller = {
							#		tag = ROOT
							#	}
							#	owner = {
							#		is_in_peace_conference = no
							#		has_capitulated = yes
							#	}
							#}					
						}
					}
				}
			}
			#Is NOT a major
			NOT = { num_of_factories > 100 }		
		}
		modifier = { #Don't steal claims and cores from faction members unless we also have a right to that clay unless they are puppets
			factor = 0
			NOT = { 
				FROM = { 
					OR = {
						is_claimed_by = ROOT
						is_core_of = ROOT
					}
				} 
			}
			any_country = {
				is_in_faction_with = ROOT
				NOT = { is_puppet_of = ROOT }
				FROM = {
					OR = {
						is_claimed_by = PREV
						is_core_of = PREV
					}
				}
			}
		}

		modifier = {
			factor = 0
			is_subject = no # Puppets should clean up the crap mother country doesn't want
			any_country = {
				is_puppet_of = ROOT
				FROM = {
					state_and_terrain_strategic_value < 8
					OR = {
						num_owned_neighbour_states = {
							count > 0
							owner = PREV
						}
						num_claimed_peace_conference_neighbour_states = {
							count > 0
							owner = PREV
						}
					}
				}
			}
		}

		modifier = {
			factor = 20

			FROM = {
				OR = {
					is_claimed_by = ROOT
					is_core_of = ROOT
				}
			}
		}

		modifier = {
			factor = 1.25

			capital_scope = {
				distance_to = {
					target = FROM
					value < 100
				}
			}
		}

		modifier = {
			factor = 1.25

			capital_scope = {
				distance_to = {
					target = FROM
					value < 200
				}
			}
		}

		modifier = {
			factor = 1.25

			capital_scope = {
				distance_to = {
					target = FROM
					value < 300
				}
			}
		}

		modifier = {
			factor = 1.25

			capital_scope = {
				distance_to = {
					target = FROM
					value < 400
				}
			}
		}


		modifier = {
			factor = 2
			FROM = {
				OR = {
					num_owned_neighbour_states = {
						count > 1
						owner = ROOT
					}
					num_claimed_peace_conference_neighbour_states = {
						count > 1
						owner = ROOT
					}
					#any_neighbor_state = {
					#	AND = {
					#		controller = {
					#			tag = ROOT
					#		}
					#		owner = {
					#			is_in_peace_conference = no
					#			has_capitulated = yes
					#		}
					#	}					
					#}
				}
			}
		}

		modifier = {
			factor = 2
			FROM = {
				OR = {
					num_owned_neighbour_states = {
						count > 2
						owner = ROOT
					}
					num_claimed_peace_conference_neighbour_states = {
						count > 2
						owner = ROOT
					}
				}
			}
		}

		modifier = {
			factor = 2
			FROM = {
				OR = {
					num_owned_neighbour_states = {
						count > 3
						owner = ROOT
					}
					num_claimed_peace_conference_neighbour_states = {
						count > 3
						owner = ROOT
					}
				}
			}
		}

		modifier = {
			factor = 2
			FROM = {
				OR = {
					num_owned_neighbour_states = {
						count > 4
						owner = ROOT
					}
					num_claimed_peace_conference_neighbour_states = {
						count > 4
						owner = ROOT
					}
				}
			}
		}

		modifier = {
			factor = 2
			FROM = {
				OR = {
					num_owned_neighbour_states = {
						count > 5
						owner = ROOT
					}
					num_claimed_peace_conference_neighbour_states = {
						count > 5
						owner = ROOT
					}
				}
			}
		}
		modifier = { #Fascists will want to keep their spoils...
			factor = 3
			FROM = { controller = { tag = ROOT } }
		}
		modifier = {
			factor = 0		
			NOT = { 
				FROM = { 
					OR = {
						is_claimed_by = ROOT
						is_core_of = ROOT
					}
				} 
			}
			NOT = {
				FROM = {
					any_neighbor_state = {
						OR = {
							owner = { tag = ROOT }
							has_claimed_state_in_peace_conference = ROOT
							#AND = {
							#	controller = {
							#		tag = ROOT
							#	}
							#	owner = {
							#		is_in_peace_conference = no
							#		has_capitulated = yes
							#	}
							#}					
						}
					}
				}
			}
			OR = {
				#Must be taken in contiguous chunks.
				FROM = { 
					is_on_continent = europe
					is_coastal = yes
					#Temp Workaround since "is_island_state" doesn't cover some cases like Gotland, Iceland, Crete, Norn Iron
				}
				#Minor old world AI sticks to their own continents 
				AND = {
					#Is NOT a major
					NOT = { num_of_factories > 100 }
					OR = {
						AND = {
							capital_scope = { is_on_continent = europe }
							NOT = { FROM = { is_on_continent = europe } } 
						}
						AND = {
							capital_scope = { is_on_continent = north_america }
							NOT = { FROM = { is_on_continent = north_america } } 
						}
						AND = {
							capital_scope = { is_on_continent = south_america }
							NOT = { FROM = { is_on_continent = south_america } } 
						}
						AND = {
							capital_scope = { is_on_continent = australia }
							NOT = { FROM = { is_on_continent = australia } } 
						}
						AND = {
							capital_scope = { is_on_continent = africa }
							NOT = { FROM = { is_on_continent = africa } } 
						}
						AND = {
							capital_scope = { is_on_continent = asia }
							NOT = { FROM = { is_on_continent = asia } } 
						}
						AND = {
							capital_scope = { is_on_continent = middle_east }
							NOT = { FROM =  { is_on_continent = middle_east } } 
						}
					}
				}
				NOT = {
					FROM = { 
						OR = {
							is_island_state = yes
							is_coastal = yes
						}
					}
				}
				NOT = { any_owned_state = { is_coastal = yes } }
			}
		}

		
		modifier = {# Italy doesn't care about Asia, but might consider taking south american colonies held by the allies.
			factor = 0
			OR = {
				#For now don't take Russian or Northern European lands at all if in the same faction as germany.
				FROM = {
					NOT = {
						OR = {
							is_on_continent = africa
							is_on_continent = europe
							is_on_continent = middle_east
							AND = {
								is_on_continent = south_america
								is_island_state = yes
							}
						}
					}
				}
			}
		}

		modifier = { #Deter expansion outside of continent
			factor = 0.1
			OR = {
				AND = {
					capital_scope = { is_on_continent = europe }
					NOT = { FROM = {is_on_continent = europe } } 
				}
				AND = {
					capital_scope = { is_on_continent = north_america }
					NOT = { FROM = { is_on_continent = north_america } } 
				}
				AND = {
					capital_scope = { is_on_continent = south_america }
					NOT = { FROM = { is_on_continent = south_america } } 
				}
				AND = {
					capital_scope = { is_on_continent = australia }
					NOT = { FROM = { is_on_continent = australia } } 
				}
				AND = {
					capital_scope = { is_on_continent = africa }
					NOT = { FROM = { is_on_continent = africa } } 
				}
				AND = {
					capital_scope = { is_on_continent = asia }
					NOT = { FROM = { is_on_continent = asia } } 
				}
				AND = {
					capital_scope = { is_on_continent = middle_east }
					NOT = { FROM =  { is_on_continent = middle_east } } 
				}
			}
		}

		modifier = { #Only take claimed/core land if a puppet.
			factor = 0
			is_puppet = yes
			FROM = {
				NOT = {
					OR = { 
						is_claimed_by = ROOT
						is_core_of = ROOT
					}
				}
			}
		}
		modifier = { #Old World AI will generally stick to the old world and new world to the new.
			factor = 0
			NOT = { 
				FROM = { 
					OR = {
						is_claimed_by = ROOT
						is_core_of = ROOT
					}
				} 
			}
			FROM = {
				owner = {
					FROM = { 
						is_core_of = PREV
						is_on_continent = europe
					}
				}
			}
			#NOT = {
			#	FROM = {
			#		any_neighbor_state = {
			#			OR = {
			#				owner = { tag = ROOT }
			#				has_claimed_state_in_peace_conference = ROOT					
			#			}
			#		}
			#	}
			#}
			OR = {
				AND = {
					OR = {
						capital_scope = { is_on_continent = europe }
						capital_scope = { is_on_continent = middle_east }
						capital_scope = { is_on_continent = africa }
					}
					FROM = {
						OR = {
							is_on_continent = north_america
							is_on_continent = south_america
							is_on_continent = australia
							AND = {
								is_on_continent = asia
							}
						}
					}
				}
				AND = {
					OR = {
						capital_scope = { is_on_continent = asia }
						capital_scope = { is_on_continent = australia }
					}
					FROM = {
						OR = {
							is_on_continent = north_america
							is_on_continent = south_america
							is_on_continent = europe
							is_on_continent = africa
							is_on_continent = middle_east
						}
					}
				}
				AND = {
					OR = {
						capital_scope = { is_on_continent = north_america }
						capital_scope = { is_on_continent = south_america }
					}
					FROM = {
						OR = {
							is_on_continent = europe
							is_on_continent = africa
							is_on_continent = middle_east
							is_on_continent = asia
							is_on_continent = australia
						}
					}
				}
			}
		}
	}
	force_government = {
		factor = 0
	}
}