authoritarian_ethics_from_relations = {
	base = 1
	complex_trigger_modifier = {
		trigger = count_relation
		parameters = {
			limit = {
				OR = {
					is_in_federation_with = root
					has_defensive_pact = root
				}
				is_authoritarian = yes
			}
		}
		mode = add
		mult = 0.3
	}
}

authoritarian_ethics_from_living_standards = {
	base = 1
	modifier = {
		is_enslaved = no
		OR = {
			AND = {
				NOT = { is_pop_category = worker }
				has_living_standard = { type = living_standard_stratified }
			}
			AND = {
				is_pop_category = ruler
				has_living_standard = { type = living_standard_dystopian_society }
			}
		}
		mult = 1.25
	}
	modifier = {
		owner = { is_authoritarian = no }
		OR = {
			has_living_standard = { type = living_standard_utopian }
			has_living_standard = { type = living_standard_good }
			has_living_standard = { type = living_standard_shared_burden }
			has_living_standard = { type = living_standard_worker_ownership }
		}
		mult = 0.75
	}
}

egalitarian_ethics_from_relations = {
	base = 1
	complex_trigger_modifier = {
		trigger = count_relation
		parameters = {
			limit = {
				OR = {
					is_in_federation_with = root
					has_defensive_pact = root
					has_commercial_pact = root
				}
				is_egalitarian = yes
			}
		}
		mode = add
		mult = 0.3
	}
	complex_trigger_modifier = {
		trigger = count_relation
		parameters = {
			limit = {
				is_subject = no
				has_migration_access = root
				is_egalitarian = yes
			}
		}
		mode = add
		mult = 0.5
	}
}

xenophobe_ethics_from_relations = {
	base = 1
	complex_trigger_modifier = {
		trigger = count_neighbor_country
		parameters = {
			limit = { is_homicidal = yes }
		}
		mult = 0.25
		mode = add
	}
	complex_trigger_modifier = {
		trigger = count_relation
		parameters = {
			limit = {
				is_subject = no
				has_migration_access = root
				NOT = { is_same_species = root }
			}
		}
		mult = -0.2
		mode = add
	}
}

xenophile_ethics_from_relations = {
	base = 1
	complex_trigger_modifier = {
		trigger = count_relation
		parameters = {
			limit = {
				NOT = { is_same_species = root }
				is_subject = no
				has_migration_access = root
			}
		}
		mult = 0.3
		mode = add
	}
	max = 2 #so federation with 5 members will not end up at 2.5
	complex_trigger_modifier = {
		trigger = count_relation
		parameters = {
			limit = {
				NOT = { is_same_species = root }
				is_subject = no
				OR = {
					is_in_federation_with = root
					has_defensive_pact = root
					has_commercial_pact = root
				}
			}
		}
		mult = 0.2
		mode = add
	}
}

spiritualist_ethics_from_relations = {
	base = 1
	complex_trigger_modifier = {
		trigger = count_relation
		parameters = {
			limit = {
				OR = {
					is_in_federation_with = root
					has_defensive_pact = root
					has_commercial_pact = root
				}
				is_spiritualist = yes
			}
		}
		mode = add
		mult = 0.3
	}
	complex_trigger_modifier = {
		trigger = count_relation
		parameters = {
			limit = {
				is_subject = no
				has_migration_access = root
				is_spiritualist = yes
			}
		}
		mode = add
		mult = 0.5
	}
}

materialist_ethics_from_relations = {
	base = 1
	complex_trigger_modifier = {
		trigger = count_relation
		parameters = {
			limit = {
				root = { has_research_agreement = prev }
				is_materialist = yes
			}
		}
		mode = add
		mult = 0.25
	}
	complex_trigger_modifier = {
		trigger = count_relation
		parameters = {
			limit = {
				OR = {
					is_in_federation_with = root
					has_defensive_pact = root
					has_commercial_pact = root
					AND = {
						is_subject = no
						has_migration_access = root
					}
				}
				is_materialist = yes
			}
		}
		mode = add
		mult = 0.3
	}
}

pacifist_ethics_from_pacts = {
	add = trigger:num_non_aggression_pacts
	mult = 0.2
	add = 1
}

pacifist_ethics_from_peace = {
	base = 1
	modifier = {
		years_of_peace = {
			value > 20
			delay = 50
		}
		mult = 1.33
	}
	modifier = {
		years_of_peace = {
			value > 40
			delay = 50
		}
		mult = 1.33
	}
	modifier = {
		years_of_peace = {
			value > 60
			delay = 50
		}
		mult = 1.33
	}
	modifier = {
		years_of_peace = {
			value > 80
			delay = 50
		}
		mult = 1.33
	}
	modifier = {
		years_of_peace = {
			value > 100
			delay = 50
		}
		mult = 1.33
	}
}

militarist_ethics_from_peace = {
	base = 1
	modifier = {
		years_of_peace = {
			value > 20
			delay = 50
		}
		mult = 0.75
	}
	modifier = {
		years_of_peace = {
			value > 40
			delay = 50
		}
		mult = 0.75
	}
	modifier = {
		years_of_peace = {
			value > 60
			delay = 50
		}
		mult = 0.75
	}
	modifier = {
		years_of_peace = {
			value > 80
			delay = 50
		}
		mult = 0.75
	}
	modifier = {
		years_of_peace = {
			value > 100
			delay = 50
		}
		mult = 0.75
	}
}

ethics_from_overlord = {
	base = 1
	modifier = {
		add = 0.5
		overlord = {
			has_ethic = ethic_$ETHIC$
		}
	}
	modifier = {
		add = 1
		overlord = {
			has_ethic = ethic_fanatic_$ETHIC$
		}
	}
}

count_councilors = {
	base = 0
	complex_trigger_modifier = {
		trigger = count_owned_leader
		parameters = {
			limit = {
				is_councilor = yes
				is_ruler = no
			}
		}
		mode = add
	}
}

count_volcanic_planet_ratio = { # returns double the number of Volcanic colonies
	base = 0
	complex_trigger_modifier = {
		trigger = count_owned_planet
		parameters = {
			limit = {
				is_planet_class = pc_volcanic
			}
		}
		mode = add
		mult = 2
	}
}

count_councilors_xenos_2 = {
	base = -2
	complex_trigger_modifier = {
		trigger = count_owned_leader
		parameters = {
			limit = {
				is_councilor = yes
				is_ruler = no
			}
		}
		mode = add
	}
}

refugee_attraction_multiplier = {
	base = 1
	add = modifier:refugee_attraction
	modifier = {
		add = 0.3
		has_valid_civic = civic_selective_kinship
		event_target:refugee_pop = {
			is_same_species_class = prev
		}
	}
	modifier = {
		add = -0.2
		has_valid_civic = civic_selective_kinship
		event_target:refugee_pop = {
			NOT = { is_same_species_class = prev }
		}
	}
	min = 0.01
}

pop_ethic_percentage_value = {
	base = 0
	complex_trigger_modifier = {
		trigger = pop_ethic_percentage
		parameters = {
			ethic = ethic_$ETHIC$
		}
		mode = add
	}
}

pop_not_ethic_percentage_value = {
	base = 0
	complex_trigger_modifier = {
		trigger = pop_ethic_percentage
		parameters = {
			ethic != ethic_$ETHIC$
		}
		mode = add
	}
}

pop_ethic_amount_value = {
	base = 0
	complex_trigger_modifier = {
		trigger = pop_ethic_amount
		parameters = {
			ethic = ethic_$ETHIC$
		}
		mode = add
	}
}
