##########################
#    CIVIC GOVERNMENTS
##########################
# Documentation: common\governments\99_README_GOVERNMENT.txt
#
# All governments in this file have base weight: @gov_civic_weight
#
# They all require at least one civic in the possible block, and if they
# require more, a weight modifier is added to select them before the others.
#
# All standard civic-based governments have the base weight @gov_civic_weight,
# but some are prioritized over others by setting @gov_civic_prio_weight.
#
# Homicidals and Criminals keep the original government even with auth swap
# by using the weight modifier: @gov_civic_override_weight
#
# If the empire fulfills the requirements for multiple governments, it will
# select the first one listed in this file.
#
# The weight categories to select a government are (highest selected first):
# 1. AI governments
# 2. Authority swap governments
# 3. Civic governments
# 4. Ethic governments
# 5. Authority governments
# 6. Fallback government

##########################
### Civic governments
##########################

### Spiritualist Governments

# Divine Empire
gov_divine_empire = {
	ruler_title = RT_GOD_EMPEROR
	ruler_title_female = RT_GOD_EMPRESS
	heir_title = HT_SAINT
	heir_title_female = HT_SAINT_FEMALE

	use_regnal_names = yes
	dynastic_last_names = yes

	should_force_rename = yes

	possible = {
		is_imperial_authority = yes
		has_valid_civic = civic_imperial_cult
	}

	weight = {
		base = @gov_civic_weight
	}
}

# Holy Tribunal
gov_holy_tribunal = {
	ruler_title = RT_HIGH_INQUISITOR
	ruler_title_female = RT_HIGH_INQUISITOR_FEMALE

	should_force_rename = yes

	possible = {
		is_oligarchic_authority = yes
		has_valid_civic = civic_exalted_priesthood
	}

	weight = {
		base = @gov_civic_weight
	}
}

# Megachurch
gov_megachurch = {
	ruler_title = RT_HALLOWED_COMPTROLLER
	ruler_title_female = RT_HALLOWED_COMPTROLLER_FEMALE

	should_force_rename = yes

	possible = {
		OR = {
			AND = {
				has_valid_civic = civic_corporate_dominion
				has_valid_civic = civic_exalted_priesthood
			}
			AND = {
				is_megacorp = yes
				has_valid_civic = civic_gospel_of_the_masses
			}
		}
	}

	weight = {
		base = @gov_civic_weight
		modifier = {
			factor = 2
			has_valid_civic = civic_corporate_dominion
			has_valid_civic = civic_exalted_priesthood
		}
	}
}

### Militarist Governments

# Martial Empire
gov_martial_empire = {
	ruler_title = RT_EMPEROR
	ruler_title_female = RT_EMPRESS
	heir_title = HT_CROWN_PRINCE
	heir_title_female = HT_CROWN_PRINCESS

	use_regnal_names = yes
	dynastic_last_names = yes

	should_force_rename = yes

	possible = {
		is_imperial_authority = yes
		has_valid_civic = civic_warrior_culture
	}

	weight = {
		base = @gov_civic_weight
	}
}

# Martial Dictatorship
gov_martial_dictatorship = {
	ruler_title = RT_IMPERATOR
	ruler_title_female = RT_IMPERATRIX

	should_force_rename = yes

	possible = {
		is_dictatorial_authority = yes
		has_valid_civic = civic_warrior_culture
	}

	weight = {
		base = @gov_civic_weight
	}
}

# War Council
gov_war_council = {
	ruler_title = RT_WARLORD
	ruler_title_female = RT_WARLORD_FEMALE

	should_force_rename = yes

	possible = {
		is_oligarchic_authority = yes
		has_valid_civic = civic_warrior_culture
	}

	weight = {
		base = @gov_civic_weight
	}
}

# Assembly of Clans
gov_assembly_of_clans = {
	ruler_title = RT_CLAN_SPEAKER
	ruler_title_female = RT_CLAN_SPEAKER_FEMALE

	should_force_rename = yes

	possible = {
		is_democratic_authority = yes
		has_valid_civic = civic_warrior_culture
	}

	weight = {
		base = @gov_civic_weight
	}
}

# Citizen Stratocracy
gov_citizen_stratocracy = {
	ruler_title = RT_STRATEGOS
	ruler_title_female = RT_STRATEGOS_FEMALE

	should_force_rename = yes

	possible = {
		is_oligarchic_authority = yes
		has_valid_civic = civic_citizen_service
	}

	weight = {
		base = @gov_civic_weight
	}
}

# Citizen Republic
gov_citizen_republic = {
	ruler_title = RT_CONSUL
	ruler_title_female = RT_CONSUL_FEMALE

	should_force_rename = yes

	possible = {
		is_democratic_authority = yes
		has_valid_civic = civic_citizen_service
	}

	weight = {
		base = @gov_civic_weight
	}
}

### Pacifist Governments

# Celestial Empire
gov_celestial_empire = {
	ruler_title = RT_CELESTIAL_EMPEROR
	ruler_title_female = RT_CELESTIAL_EMPRESS
	heir_title = HT_CROWN_PRINCE
	heir_title_female = HT_CROWN_PRINCESS

	use_regnal_names = yes
	dynastic_last_names = yes

	should_force_rename = yes

	possible = {
		is_imperial_authority = yes
		is_pacifist = yes
		has_valid_civic = civic_inwards_perfection
	}

	weight = {
		base = @gov_civic_weight
	}
}

### Materialist Governments

# Rational Consensus
gov_rational_consensus = {
	ruler_title = RT_FIRST_SPEAKER
	ruler_title_female = RT_FIRST_SPEAKER_FEMALE

	should_force_rename = yes

	possible = {
		is_democratic_authority = yes
		has_valid_civic = civic_technocracy
	}

	weight = {
		base = @gov_civic_weight
	}
}

# Science Directorate
gov_science_directorate = {
	ruler_title = RT_DIRECTOR_GENERAL
	ruler_title_female = RT_DIRECTOR_GENERAL_FEMALE

	should_force_rename = yes

	possible = {
		is_oligarchic_authority = yes
		has_valid_civic = civic_technocracy
	}

	weight = {
		base = @gov_civic_weight
	}
}

# Technocratic Dictatorship
gov_technocratic_dictatorship = {
	ruler_title = RT_OVERSEER
	ruler_title_female = RT_OVERSEER_FEMALE

	should_force_rename = yes

	possible = {
		is_dictatorial_authority = yes
		has_valid_civic = civic_technocracy
	}

	weight = {
		base = @gov_civic_weight
	}
}

# Illuminated Autocracy
gov_illuminated_autocracy = {
	ruler_title = RT_PRIMUS
	ruler_title_female = RT_PRIMUS_FEMALE
	heir_title = HT_SECUNDUS
	heir_title_female = HT_SECUNDUS_FEMALE

	use_regnal_names = yes
	dynastic_last_names = yes

	should_force_rename = yes

	possible = {
		is_imperial_authority = yes
		has_valid_civic = civic_technocracy
	}

	weight = {
		base = @gov_civic_weight
	}
}

# Feudal Empire
gov_feudal_empire = {
	ruler_title = RT_EMPEROR
	ruler_title_female = RT_EMPRESS
	heir_title = HT_CROWN_PRINCE
	heir_title_female = HT_CROWN_PRINCESS

	use_regnal_names = yes
	dynastic_last_names = yes

	should_force_rename = yes

	possible = {
		is_imperial_authority = yes
		has_valid_civic = civic_feudal_realm
	}

	weight = {
		base = @gov_civic_weight
	}
}

# Enlightened Monarchy
gov_enlightened_monarchy = {
	ruler_title = RT_HIGH_KING
	ruler_title_female = RT_HIGH_QUEEN
	heir_title = HT_CROWN_PRINCE
	heir_title_female = HT_CROWN_PRINCESS

	use_regnal_names = yes
	dynastic_last_names = yes

	should_force_rename = yes

	possible = {
		is_imperial_authority = yes
		has_valid_civic = civic_philosopher_king
	}

	weight = {
		base = @gov_civic_weight
	}
}

# Elective Monarchy
gov_elective_monarchy = {
	ruler_title = RT_HIGH_KING
	ruler_title_female = RT_HIGH_QUEEN

	should_force_rename = yes

	possible = {
		is_dictatorial_authority = yes
		has_valid_civic = civic_philosopher_king
	}

	weight = {
		base = @gov_civic_weight
	}
}

# Research
gov_machine_research = {
	ruler_title = RT_LINK

	use_regnal_names = yes

	should_force_rename = yes

	possible = {
		is_machine_empire = yes
		OR = {
			has_valid_civic = civic_machine_introspective
			has_valid_civic = civic_machine_delegated_functions
			has_valid_civic = civic_machine_predictive_analysis
			has_valid_civic = civic_machine_guided_sapience
			has_valid_civic = civic_machine_spybots

		}
		NOR = {
			has_valid_civic = civic_machine_rockbreakers
			has_valid_civic = civic_machine_builder
			has_valid_civic = civic_machine_replication
			has_valid_civic = civic_machine_astromining_drones
		}
	}

	weight = {
		base = @gov_civic_weight
	}
}

# Industrial
gov_machine_industrial = {
	ruler_title = RT_HUB

	use_regnal_names = yes

	should_force_rename = yes

	possible = {
		is_machine_empire = yes
		OR = {
			has_valid_civic = civic_machine_rockbreakers
			has_valid_civic = civic_machine_builder
			has_valid_civic = civic_machine_replication
			has_valid_civic = civic_machine_astromining_drones
		}
		NOR = {
			has_valid_civic = civic_machine_introspective
			has_valid_civic = civic_machine_delegated_functions
			has_valid_civic = civic_machine_predictive_analysis
			has_valid_civic = civic_machine_guided_sapience
			has_valid_civic = civic_machine_spybots
		}
	}

	weight = {
		base = @gov_civic_weight
	}
}

##########################
### Prio Civic Governments
##########################

# Worker Coop
gov_worker_coop = {
	ruler_title = RT_PRESIDING_SPEAKING

	should_force_rename = yes

	possible = {
		is_worker_coop_empire = yes
	}

	weight = {
		base = @gov_civic_prio_weight
	}
}

# Communal Parity
gov_communal_parity = {
	ruler_title = RT_PRESIDING_SPEAKING

	should_force_rename = yes

	possible = {
		has_valid_civic = civic_shared_burden
	}

	weight = {
		base = @gov_civic_prio_weight
	}
}

# Bandit Kingdom
gov_bandit_kingdom = {
	ruler_title = RT_WARLORD
	heir_title = HT_RAIDER

	should_force_rename = yes

	possible = {
		OR = {
			is_imperial_authority = yes
			is_dictatorial_authority = yes
		}
		has_valid_civic = civic_barbaric_despoilers
	}

	weight = {
		base = @gov_civic_prio_weight
	}
}

# Bandit Commune
gov_bandit_commune = {
	ruler_title = RT_WARLORD

	should_force_rename = yes

	possible = {
		OR = {
			is_oligarchic_authority = yes
			is_democratic_authority = yes
		}
		has_valid_civic = civic_barbaric_despoilers
	}

	weight = {
		base = @gov_civic_prio_weight
	}
}

# Grim Council
gov_grim_council = {
	ruler_title = RT_DREAD_CARDINAL

	should_force_rename = yes

	possible = {
		is_oligarchic_authority = yes
		has_valid_civic = civic_death_cult
	}

	weight = {
		base = @gov_civic_prio_weight
	}
}

# Mortal Empire
gov_mortal_empire = {
	ruler_title = RT_DEATH_MONARCH
	ruler_title_female = RT_DEATH_MONARCH_FEMALE
	heir_title = HT_DEATH_PRINCE
	heir_title_female = HT_DEATH_PRINCESS

	should_force_rename = yes

	possible = {
		is_imperial_authority = yes
		has_valid_civic = civic_death_cult
	}

	weight = {
		base = @gov_civic_prio_weight
	}
}

# Band of Blood
gov_band_blood = {
	ruler_title = RT_BLOODLORD
	ruler_title_female = RT_BLOODLADY
	heir_title = HT_BLOODPRINCE
	heir_title_female = HT_BLOODPRINCESS

	should_force_rename = yes

	possible = {
		has_valid_civic = civic_barbaric_despoilers
		has_valid_civic = civic_death_cult
	}

	weight = {
		base = @gov_civic_prio_weight
		modifier = {
			factor = 2
			has_valid_civic = civic_barbaric_despoilers
			has_valid_civic = civic_death_cult
		}
	}
}

# Sacrificial Megachurch
gov_sacrificial_megachurch = {
	ruler_title = RT_GRAVE_ADMINISTRATOR

	should_force_rename = yes

	possible = {
		has_valid_civic = civic_death_cult_corporate
		has_valid_civic = civic_gospel_of_the_masses
	}

	weight = {
		base = @gov_civic_prio_weight
		modifier = {
			factor = 2
			has_valid_civic = civic_death_cult_corporate
			has_valid_civic = civic_gospel_of_the_masses
		}
	}
}

# Defensive Union
gov_defensive_union = {
	ruler_title = RT_DEFENSIVE_UNION
	heir_title = HT_DEFENSIVE_UNION

	should_force_rename = yes

	possible = {
		has_valid_civic = civic_sovereign_guardianship
	}

	weight = {
		base = @gov_civic_prio_weight
	}
}

# Dimensional Covenant
gov_dimensional_covenant = {
	ruler_title = RT_DIMENSIONAL_COVENANT
	heir_title = HT_DIMENSIONAL_COVENANT

	should_force_rename = yes

	possible = {
		has_valid_civic = civic_dimensional_worship
	}

	weight = {
		base = @gov_civic_prio_weight
	}
}

# Parasitic Overmind
gov_parasitic_overmind = {
	ruler_title = RT_PAR

	should_force_rename = yes

	possible = {
		has_origin = origin_necrophage
		has_valid_civic = civic_hive_cordyceptic_drones
	}

	weight = {
		base = @gov_civic_prio_weight
	}
}

# Trade League
gov_trade_league = {
	ruler_title = RT_CHAIRMAN
	ruler_title_female = RT_CHAIRWOMAN

	should_force_rename = yes

	possible = {
		OR = {
			AND = {
				is_oligarchic_authority = yes
				OR = {
					is_egalitarian = yes
					is_pacifist = yes
				}
				has_valid_civic = civic_corporate_dominion
			}
			AND = {
				is_megacorp = yes
				OR = {
					has_valid_civic = civic_free_traders
					has_valid_civic = civic_trading_posts
				}
			}
		}
	}

	weight = {
		base = @gov_civic_prio_weight
	}
}

# Servitor
gov_machine_servitor = {
	ruler_title = RT_SUPERVISORY

	use_regnal_names = yes

	should_force_rename = yes

	possible = {
		is_machine_empire = yes
		has_civic = civic_machine_servitor
	}

	weight = {
		base = @gov_civic_prio_weight
	}
}

# Assimilator
gov_machine_assimilator = {
	ruler_title = RT_CONDUIT

	use_regnal_names = yes

	should_force_rename = yes

	possible = {
		is_machine_empire = yes
		has_civic = civic_machine_assimilator
		NOT = { has_country_flag = unplugged_assimilator_empire }
	}

	weight = {
		base = @gov_civic_prio_weight
	}
}

##########################
# Override Governments
##########################

### Fanatic Purifiers

# Purity Assembly
gov_purity_assembly = {
	ruler_title = RT_PRIME_JUSTICIAR
	ruler_title_female = RT_PRIME_JUSTICIAR_FEMALE

	should_force_rename = yes

	possible = {
		is_democratic_authority = yes
		has_valid_civic = civic_fanatic_purifiers
	}

	weight = {
		base = @gov_civic_override_weight
	}
}

# Purification Committee
gov_purification_committee = {
	ruler_title = RT_GRAND_ARBITER
	ruler_title_female = RT_GRAND_ARBITER_FEMALE

	should_force_rename = yes

	possible = {
		is_oligarchic_authority = yes
		has_valid_civic = civic_fanatic_purifiers
	}

	weight = {
		base = @gov_civic_override_weight
	}
}

# Purity Order
gov_purity_order = {
	ruler_title = RT_LORD_PURIFIER
	ruler_title_female = RT_LADY_PURIFIER

	should_force_rename = yes

	possible = {
		is_dictatorial_authority = yes
		has_valid_civic = civic_fanatic_purifiers
	}

	weight = {
		base = @gov_civic_override_weight
	}
}

# Blood Court
gov_blood_court = {
	ruler_title = RT_HIGH_EXECUTIONER
	ruler_title_female = RT_HIGH_EXECUTIONER_FEMALE
	heir_title = HT_SENIOR_EXECUTIONER
	heir_title_female = HT_SENIOR_EXECUTIONER_FEMALE

	use_regnal_names = yes
	dynastic_last_names = yes

	should_force_rename = yes

	possible = {
		is_imperial_authority = yes
		has_valid_civic = civic_fanatic_purifiers
	}

	weight = {
		base = @gov_civic_override_weight
	}
}

# Hive Mind
gov_devouring_swarm = {
	ruler_title = RT_HIVE_MIND
	ruler_title_female = RT_HIVE_MIND_FEMALE

	should_force_rename = yes

	possible = {
		is_hive_empire = yes
		is_wilderness_empire = no
		has_valid_civic = civic_hive_devouring_swarm
	}

	weight = {
		base = @gov_civic_override_weight
	}
}

gov_blood_forest = {
	ruler_title = RT_WILDERNESS
	ruler_title_female = RT_WILDERNESS_FEMALE

	should_force_rename = yes

	possible = {
		is_wilderness_empire = yes
		has_valid_civic = civic_hive_devouring_swarm
	}

	weight = {
		base = @gov_civic_override_weight
	}
}

# Terminator
gov_machine_terminator = {
	ruler_title = RT_CORE

	use_regnal_names = yes

	should_force_rename = yes

	possible = {
		is_machine_empire = yes
		has_civic = civic_machine_terminator
	}

	weight = {
		base = @gov_civic_override_weight
	}
}

### Criminals

# Criminal Syndicate
gov_criminal_syndicate = {
	ruler_title = RT_OLIGARCH

	should_force_rename = yes

	possible = {
		is_megacorp = yes
		has_valid_civic = civic_criminal_heritage
	}

	weight = {
		base = @gov_civic_override_weight
	}
}

# Pirate Haven
gov_pirate_haven = {
	ruler_title = RT_OLIGARCH

	should_force_rename = yes

	possible = {
		is_megacorp = yes
		has_valid_civic = civic_criminal_heritage
		has_valid_civic = civic_crusader_spirit_corporate
	}

	weight = {
		base = @gov_civic_override_weight
		modifier = {
			factor = 2
			has_valid_civic = civic_criminal_heritage
			has_valid_civic = civic_crusader_spirit_corporate
		}
	}
}

# Subversive Cult
gov_subversive_cult = {
	ruler_title = RT_ORACLE

	should_force_rename = yes

	possible = {
		is_megacorp = yes
		has_valid_civic = civic_criminal_heritage
		has_valid_civic = civic_gospel_of_the_masses
	}

	weight = {
		base = @gov_civic_override_weight
		modifier = {
			factor = 2
			has_valid_civic = civic_criminal_heritage
			has_valid_civic = civic_gospel_of_the_masses
		}
	}
}

#################################
# Galactic Sovereign Governments
#################################

# Galactic Emperor (Normal Empires)
gov_imperial_domain = {
	ruler_title = RT_GAL_EMPEROR
	ruler_title_female = RT_GAL_EMPRESS
	heir_title = HT_CROWN_PRINCE
	heir_title_female = HT_CROWN_PRINCESS

	use_regnal_names = yes
	dynastic_last_names = yes

	should_force_rename = yes

	possible = {
		has_civic = civic_galactic_sovereign
		is_gestalt = no
	}

	weight = {
		base = @gov_galactic_sovereign_weight
	}
}

# Galactic Emperor (Hives)
gov_imperial_domain_hives = {
	ruler_title = RT_GALACTIC_OVERMIND

	should_force_rename = yes

	possible = {
		has_civic = civic_galactic_sovereign
		is_hive_empire = yes
		NOT = { is_country_type = awakened_fallen_empire }
	}

	weight = {
		base = @gov_galactic_sovereign_weight
	}
}

# Galactic Emperor (Machines)
gov_imperial_domain_machines = {
	ruler_title = RT_GALACTIC_INTELLIGENCE

	use_regnal_names = yes

	should_force_rename = yes

	possible = {
		has_civic = civic_galactic_sovereign
		is_machine_empire = yes
	}

	weight = {
		base = @gov_galactic_sovereign_weight
	}
}

# Galactic Emperor (MegaCorp)
gov_imperial_domain_megacorp = {
	ruler_title = RT_IMP_EXECUTIVE
	heir_title = HT_IMP_VICE_EXECUTIVE

	use_regnal_names = yes
	dynastic_last_names = yes

	should_force_rename = yes

	possible = {
		has_civic = civic_galactic_sovereign_megacorp
		is_gestalt = no
	}

	weight = {
		base = @gov_galactic_sovereign_weight
	}
}
