# Ethics
# ------
#
# Ethics define the ideological alignment of an empire. They govern available
# government authorities, civic choices, policy options, diplomatic stances,
# and how pops naturally drift between belief systems over time.
#
#
# SLOTS AND COSTS
# ---------------
#
# Each empire has a budget of 3 ethic points.
# A regular ethic costs 1 point; a fanatic ethic costs 2 points; gestalt costs 3.
# Valid combinations are:
#
#	Three regular ethics			(1 + 1 + 1 = 3)
#	One fanatic ethic + one regular		(2 + 1 = 3)
#	Gestalt consciousness alone				(3 = 3)
#
# Only one ethic per category is allowed at a time. Adding a new ethic in a
# category where one already exists automatically removes the old one.
# If the new total would exceed 3 points, the game automatically downgrades
# or removes the lowest-attraction ethics until the budget is satisfied.
#
#
# CATEGORIES
# ----------
#
# Ethics are organised into five categories identified by short string codes.
# The category determines which ethics are mutually exclusive with each other.
#
#	"col"	- Authoritarian vs. Egalitarian
#	"xen"	- Xenophobe vs. Xenophile
#	"mil"	- Militarist vs. Pacifist
#	"spi"	- Spiritualist vs. Materialist
#	"hive" - Gestalt Consciousness
#
# Each axis contains two opposing poles. Within a category, one pole has
# category_opposite = yes. Ethics on opposite poles cannot coexist.
# The category_value integer indicates the numeric position of an ethic
# on the axis scale; it is used internally to distinguish same-side from
# opposite-side variants.
#
#
# FANATIC VARIANTS
# ----------------
#
# Every regular ethic (except gestalt) has a fanatic counterpart.
#
#	Naming convention:	ethic_<name>	and	ethic_fanatic_<name>
#	Cost convention:		regular = 1 point,	fanatic = 2 points
#	Modifier convention:	fanatic values are approximately double the regular values
#	Attunement:			regular uses @ethic_attunement1 (50), fanatic uses @ethic_attunement2 (100)
#
# Fanatic variants have use_for_pops = no so pops cannot naturally drift into
# them. They are detected solely by the absence of a fanatic_variant field;
# the presence of a regular_variant field is not tested. Both directions must
# be linked: the regular ethic sets fanatic_variant, the fanatic sets regular_variant.
#
# Fanatic variants omit:
#	- pop_attraction block			 (use_for_pops = no, pops do not drift into them)
#	- country_attraction block		 (irrelevant when use_for_pops = no)
#	- leader_background_job_weight	 (only regular ethics define this)
#
#
# GESTALT ETHICS
# --------------
#
# Only one gestalt ethic exists: ethic_gestalt_consciousness.
# It is identified by the hardcoded key ethic_gestalt_consciousness.
#
#	- Costs 3 points, occupying all ethic slots alone.
#	- Has no fanatic variant.
#	- use_for_pops = no	(pops cannot naturally adopt it).
#	- Cannot be combined with any other ethics.
#	- Uses the "hive" category.
#	- random_weight blocks out selection after game start
#		using has_global_flag = game_started with factor = 0.
#
# Both hive minds and machine intelligences share this single ethic; their
# differences are handled by authorities and civics, not by separate ethics.
#
#
# FIELD REFERENCE
# ---------------
#
# Required fields:
#
#	cost = <int>
#		Points this ethic consumes from the 3-point ethic budget.
#		Use 1 for regular, 2 for fanatic, 3 for gestalt consciousness.
#
#	category = "<string>"
#		Category code: one of "col", "xen", "mil", "spi", "hive".
#		Ethics in the same category are mutually exclusive.
#
#	category_value = <int>
#		Numeric position of this ethic on the category axis. Used internally
#		to determine same-side vs. opposite-side relationships between ethics
#		in the same category. Fanatic and regular variants of the same pole
#		share the same category_value.
#
# Optional structural fields:
#
#	category_opposite = yes / no	(default: no)
#		Marks this ethic as the "opposite" pole in its category axis.
#		For example, Egalitarian is the opposite pole in "col" while
#		Authoritarian is not. Used to detect conflicting ethics. Fanatic variants
#		inherit the same flag as their regular counterpart.
#
#	use_for_pops = yes / no	(default: yes)
#		If no, pops cannot naturally drift into this ethic. Pop-level attraction
#		calculations skip it entirely. Set to no for fanatic variants and gestalt.
#		The pop_attraction block should be omitted when use_for_pops = no.
#
#	fanatic_variant = <ethic_key>
#		Key of the fanatic counterpart for this regular ethic (e.g. ethic_fanatic_militarist).
#		Only present on regular, non-fanatic ethics.
#		Absence of this field is how the engine identifies the fanatic side of a pair.
#
#	regular_variant = <ethic_key>
#		Key of the regular counterpart for this fanatic ethic (e.g. ethic_militarist).
#		Only present on fanatic variants. Must mirror the fanatic_variant link on the other side.
#
#	xenophobe = yes / no	(default: no)
#		Hardcoded flag for xenophobic ethics. Affects diplomacy UI, refugee
#		acceptance logic, and alien citizenship restriction checks.
#
#	xenophile = yes / no	(default: no)
#		Hardcoded flag for xenophile ethics. Affects the same systems as xenophobe.
#
#	playable = { <trigger block> }
#		Root-scope trigger evaluated at empire design time to determine whether
#		this ethic can be selected. Scope: no check. Used to
#		gate ethics behind conditions such as DLC ownership. Omit if always playable.
#
# Modifier fields:
#
#	country_modifier = {
#		<modifier key> = <value>
#		...
#	}
#		Static modifier applied to the empire as long as this ethic is held.
#		Standard modifier keys apply (see modifiers.log for the full list).
#		This is where the primary gameplay bonuses and penalties live.
#		The add_attunement_<aspect> modifier keys are also placed here to
#		connect ethics to the Shroud attunement system.
#
#		Shroud attunement scripted variables (defined in scripted_variables/09_scripted_variables_shroud.txt):
#			@ethic_attunement0 = 0	 (no attunement)
#			@ethic_attunement1 = 50	(regular ethic level)
#			@ethic_attunement2 = 100	(fanatic ethic level)
#			@ethic_attunement3 = 50	(other ethic attunement)
#
#		Attunement aspects:
#			add_attunement_the_instrument_of_desire	(Authority / Materialism alignment)
#			add_attunement_the_composer_of_strands	 (Egalitarianism / Spiritualism alignment)
#			add_attunement_the_eater_of_worlds		 (Militarism / Xenophobia alignment)
#			add_attunement_the_cradle_of_souls		 (Pacifism / Xenophilia / Spiritualism alignment)
#
#	pop_group_modifier = {
#		<modifier key> = <value>
#		...
#	}
#		Static modifier applied to all pop groups of an empire holding this ethic.
#		Combined across all ethics held by the empire.
#		Supported by the engine but not used in vanilla ethics; most pop-level
#		effects go in country_modifier instead.
#
#	triggered_country_modifier = {
#		potential = {
#			<trigger conditions>	# evaluated in country scope
#		}
#		<modifier key> = <value>
#		...
#	}
#		Conditionally applied country modifier, re-evaluated whenever modifiers
#		are recalculated. Multiple triggered_country_modifier blocks are allowed
#		on a single ethic. The most common use is providing different modifiers
#		for nomadic empires vs. settled empires, because nomads have arkships
#		instead of starbases.
#
#		Example:
#			triggered_country_modifier = {
#				potential = {
#					is_nomadic = no
#				}
#				country_starbase_influence_cost_mult = -0.2
#			}
#			triggered_country_modifier = {
#				potential = {
#					is_nomadic = yes
#				}
#				megastructures_arkships_influence_cost_mult = -0.1
#			}
#
# Attraction fields:
#
# These fields control how pops and empires drift toward or away from an ethic
# over time. All four fields are optional, but a functional ethic should define
# at minimum pop_attraction (for regular ethics) and country_attraction (for all).
#
#	pop_attraction = {
#		<scriptable value>	# scope: pop group
#	}
#		Scriptable value evaluated per pop group to determine how strongly that
#		group is attracted to this ethic during drift. Only relevant when
#		use_for_pops = yes. Inline scripts are used for common logic shared
#		across all ethics (governor alignment, stately acclaim, etc.).
#
#		The standard pattern used by vanilla ethics:
#
#			pop_attraction = {
#				base = 1
#				inline_script = {
#					script = "ethics/governor_pop_attraction"
#					ETHIC = <name>			# e.g. militarist
#					ETHIC_OPPOSED = <name>	# e.g. pacifist
#				}
#				inline_script = {
#					script = "ethics/stately_acclaim_pop_attraction"
#					ETHIC = <name>
#				}
#				modifier = {
#					factor = 0
#					is_gestalt = yes
#				}
#			}
#
#	country_attraction = {
#		<scriptable value>	# scope: country
#	}
#		Scriptable value evaluated per country during pop drift to determine
#		country-level attraction toward this ethic. Only relevant for ethics
#		with use_for_pops = yes; the engine returns zero for use_for_pops = no
#		ethics (fanatics, gestalt), so fanatic variants should omit this field.
#
#		Note: the ethics rebalancing logic that chooses which ethic to add,
#		upgrade, or remove averages pop-level attraction values internally and
#		does NOT evaluate this scripted field.
#
#		The standard pattern used by vanilla ethics:
#
#			country_attraction = {
#				base = 1
#				modifier = {
#					factor = 0
#					NOR = {
#						is_regular_empire = yes
#						is_fallen_empire = yes
#					}
#				}
#				modifier = {
#					factor = 2
#					has_ethic = ethic_<name>
#				}
#				modifier = {
#					factor = 3
#					has_ethic = ethic_fanatic_<name>
#				}
#			}
#
#		The factor = 0 guard excludes ineligible empire types. The factor = 2
#		and factor = 3 boosts make the empire more attractive to its existing
#		ethic during pop drift, giving ideological inertia.
#
#	pop_attraction_tag = {
#		desc = <loc key>
#		trigger = {
#			<trigger conditions>	# evaluated in country scope
#		}
#	}
#		UI-only block. When the trigger evaluates true in country scope, the
#		localised desc string is shown in the ethics drift tooltip to explain
#		why pops are attracted to this ethic. Multiple blocks are allowed per
#		ethic; each covers a different case (positive attraction, negative
#		attraction, specific conditions, etc.).
#
#	random_weight = {
#		<scriptable value>	# scope: no check
#	}
#		Weight used when randomly assigning this ethic during empire creation or
#		randomisation. Zero or negative weight means the ethic is never randomly
#		assigned. Typical base values in vanilla: 50 for rare ethics (fanatic
#		pacifist), 100 for uncommon, 150 for common, higher for very likely picks.
#
# Tags field:
#
#	tags = {
#		<TAG_NAME>
#		...
#	}
#		Localization keys displayed as descriptive lines in the ethic's tooltip.
#		Each tag name is looked up as a loc key and appended to the tooltip.
#		Multiple tags can be listed in a single block. These are UI description
#		strings only; they have no mechanical effect. The descriptions below
#		document what each loc string communicates to the player.
#
#		Slavery and population control:
#			ETHIC_ALLOWS_STRATIFIED_SOCIETY		- May use stratified economy policy
#			ETHIC_ALLOWS_SLAVERY				- May enslave pops
#			ETHIC_DISALLOWS_SLAVERY				- Cannot enslave pops
#			ETHIC_DISALLOWS_DISPLACE			- Cannot displace pops
#			ETHIC_ALLOWS_PURGE					- May purge pops
#
#		Government and diplomacy:
#			ETHIC_ONLY_AUTOCRACY				- Restricted to autocratic authorities only
#			ETHIC_NEVER_DEMOCRACY				- Cannot use democratic authority
#			ETHIC_IMPROVED_DIPLOMACY			- Improved base diplomatic relations
#			ETHIC_REDUCED_DIPLOMACY				- Reduced base diplomatic relations
#			ETHIC_ALWAYS_REFUGEES				- Always accepts refugees
#			ETHIC_NO_REFUGEES					- Never accepts refugees
#			ETHIC_NEVER_ALIEN_CITIZENSHIP		- Cannot grant full citizenship to other species
#			ETHIC_NEVER_ALIEN_MILITARY_SERVICE	- Other species cannot serve in the military
#
#		AI and robots:
#			ETHIC_DISALLOW_AI					- Cannot use synthetic pops or AI
#			ETHIC_DISALLOW_BAN_AI				- Cannot ban AI
#			ETHIC_DISALLOW_BAN_ROBOTS			- Cannot ban robots
#
#		Warfare:
#			ETHIC_DISALLOW_OFFENSIVE_WARS		- Cannot declare offensive wars
#			ETHIC_DISALLOW_CONQUEST_WARS		- Cannot use conquest war goals
#			ETHIC_DISALLOW_FULL_BOMBARDMENT		- Cannot use full bombardment stance
#			ETHIC_ALLOW_NO_RETREAT				- Fleets will not retreat from combat
#
#		Buildings:
#			ETHIC_ALLOWS_TEMPLE					- May build temples
#			ETHIC_ALLOWS_ACADEMIC_PRIVILEGE		- May grant academic privileges
#
#		Gestalt-specific (only for ethic_gestalt_consciousness):
#			ETHIC_GESTALT_CONSCIOUSNESS_NO_TUTORIAL
#			ETHIC_GESTALT_CONSCIOUSNESS_AUTHORITY
#			ETHIC_GESTALT_CONSCIOUSNESS_IMMORTAL_RULER
#			ETHIC_GESTALT_CONSCIOUSNESS_NO_FACTIONS
#			ETHIC_GESTALT_CONSCIOUSNESS_NO_CONSUMER_GOODS
#			ETHIC_GESTALT_CONSCIOUSNESS_DOMESTIC_POP_SURVIVAL
#
# Leader background field:
#
#	leader_background_job_weight = {
#		<job_key> = <int>
#		...
#	}
#		Controls how likely leaders from this empire type are to have specific
#		jobs as their background. Higher value = more common background. Only
#		defined on regular (non-fanatic) ethics; fanatic variants do not include
#		this field.
#
#		Example:
#			leader_background_job_weight = {
#				soldier = 25
#				enforcer = 25
#				duelist = 25
#			}
#
