#As a tribe, if I reform, what government will I get?
GetTribalReformGovernment = {
	type = character

	text = {
		trigger = { ep3_is_clan_inclined_trigger = yes }
		localization_key = tribal_reform_clan
	}
	text = {
		trigger = { ep3_is_clan_inclined_trigger = no }
		localization_key = tribal_reform_feudal
	}
}

#What type of authority do I use?
GetGovernmentAuthority = {
	type = character

	text = {
		trigger = { government_has_flag = government_is_administrative }
		localization_key = government_authority_administrative
	}
	text = {
		trigger = { government_has_flag = government_is_tribal }
		localization_key = government_authority_tribe
	}
	text = {
		trigger = { always = no }
		localization_key = government_authority_crown
		fallback = yes
	}
}

GetChamber = {
	type = character

	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				has_government = landless_adventurer_government
			}
			trigger_else = {
				liege ?= { has_government = landless_adventurer_government }
			}
		}
		localization_key = tent
	}
	text = {
		trigger = { always = no }
		localization_key = chamber
		fallback = yes
	}
}

GetChamberPlural = {
	type = character
	parent = GetChamber
	suffix = _plural
}

GetChambersOrTent = {
	type = character

	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				has_government = landless_adventurer_government
			}
			trigger_else = {
				liege ?= { has_government = landless_adventurer_government }
			}
		}
		localization_key = tent
	}
	text = {
		trigger = { always = no }
		localization_key = chamber_plural
		fallback = yes
	}
}


GetRoom = {
	type = character

	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				has_government = landless_adventurer_government
			}
			trigger_else = {
				liege ?= { has_government = landless_adventurer_government }
			}
		}
		localization_key = tent
	}
	text = {
		trigger = { always = no }
		localization_key = room
		fallback = yes
	}
}

GetRoomPlural = {
	type = character
	parent = GetRoom
	suffix = _plural
}

GetCourtyard = {
	type = character

	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				has_government = landless_adventurer_government
			}
			trigger_else = {
				liege ?= { has_government = landless_adventurer_government }
			}
		}
		localization_key = camp
	}
	text = {
		trigger = { always = no }
		localization_key = courtyard_location
		fallback = yes
	}
}

## Court

GetCourt = {
	type = character

	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				has_government = landless_adventurer_government
			}
			trigger_else = {
				liege ?= { has_government = landless_adventurer_government }
			}
		}
		localization_key = camp
	}
	text = {
		trigger = { always = no }
		localization_key = court
		fallback = yes
	}
}

GetCourtConcept = {
	type = character

	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				has_government = landless_adventurer_government
			}
			trigger_else = {
				liege ?= { has_government = landless_adventurer_government }
			}
		}
		localization_key = CAMP
	}
	text = {
		trigger = { always = no }
		localization_key = COURT_CONCEPT
		fallback = yes
	}
}

GetCourtierGendered = {
	type = character

	text = {
		trigger = {
			liege ?= { has_government = landless_adventurer_government }
			is_female = yes
		}
		localization_key = follower_female
	}
	text = {
		trigger = {
			liege ?= { has_government = landless_adventurer_government }
			is_male = yes
		}
		localization_key = follower_male
	}
	text = {
		trigger = {
			liege ?= { is_landless_adventurer = no }
			is_female = yes
		}
		localization_key = relation_courtier_female
	}
	text = {
		trigger = {
			liege ?= { is_landless_adventurer = no }
			is_male = yes
		}
		localization_key = relation_courtier_male
	}
}

GetCourtier = {
	type = character

	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				has_government = landless_adventurer_government
			}
			trigger_else = {
				liege ?= { has_government = landless_adventurer_government }
			}
		}
		localization_key = follower
	}
	text = {
		trigger = { always = no }
		localization_key = courtier
		fallback = yes
	}
}

GetCourtierPlural = {
	type = character
	parent = GetCourtier
	suffix = _plural
}

GetCourtierConcept = {
	type = character

	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				has_government = landless_adventurer_government
			}
			trigger_else = {
				liege ?= { has_government = landless_adventurer_government }
			}
		}
		localization_key = FOLLOWER
	}
	text = {
		trigger = { always = no }
		localization_key = COURTIER
		fallback = yes
	}
}

GetCourtierConceptPlural = {
	type = character
	parent = GetCourtierConcept
	suffix = _PLURAL
}

GetSubject = {
	type = character

	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				has_government = landless_adventurer_government
			}
			trigger_else = {
				liege ?= { has_government = landless_adventurer_government }
			}
		}
		localization_key = follower
	}
	text = {
		trigger = { always = no }
		localization_key = subject
		fallback = yes
	}
}

GetSubjectPlural = {
	type = character
	parent = GetSubject
	suffix = _plural
}

GetSuccessionHeirMotion = {
	type = character
	
	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				has_government = landless_adventurer_government
			}
			trigger_else = {
				liege ?= { has_government = landless_adventurer_government }
			}
		}
		localization_key = succession_heir_leader
	}
	text = {
		trigger = { always = no }
		localization_key = succession_heir_throne
		fallback = yes
	}
}

GetDungeon = {
	type = character

	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				has_government = landless_adventurer_government
			}
			trigger_else = {
				liege ?= { has_government = landless_adventurer_government }
			}
		}
		localization_key = stockade
	}
	text = {
		trigger = { always = no }
		localization_key = dungeon
		fallback = yes
	}
}

GetDungeonPlural = {
	type = character
	parent = GetDungeon
	suffix = _plural
}

GetDungeonConcept = {
	type = character

	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				has_government = landless_adventurer_government
			}
			trigger_else = {
				liege ?= { has_government = landless_adventurer_government }
			}
		}
		localization_key = STOCKADE_CONCEPT
	}
	text = {
		trigger = { always = no }
		localization_key = DUNGEON_CONCEPT
		fallback = yes
	}
}

GetDungeonConceptPlural = {
	type = character
	parent = GetDungeonConcept
	suffix = _plural
}

GetRealmOrDomicile = {
	type = character

	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				has_government = landless_adventurer_government
			}
			trigger_else = {
				liege ?= { has_government = landless_adventurer_government }
			}
		}
		localization_key = game_concept_camp
	}
	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				is_governor = yes
			}
			trigger_else = {
				liege ?= { is_governor = yes }
			}
		}
		localization_key = game_concept_estate
	}
	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				is_landless_administrative = yes
			}
			trigger_else = {
				liege ?= { is_landless_administrative = yes }
			}
		}
		localization_key = game_concept_governorship
	}
	text = {
		trigger = { always = no }
		localization_key = realm
		fallback = yes
	}
}

GetRealmOrDomicileTooltip = {
	type = character
	
	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				is_nomad = yes
			}
			trigger_else = {
				liege ?= { is_nomad = yes }
			}
		}
		localization_key = NOMAD
	}
	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				has_government = landless_adventurer_government
			}
			trigger_else = {
				liege ?= { has_government = landless_adventurer_government }
			}
		}
		localization_key = ADVENTURER
	}
	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				is_landless_administrative = yes
			}
			trigger_else = {
				liege ?= { is_landless_administrative = yes }
			}
		}
		localization_key = NOBLE_FAMILY
	}
	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				primary_title = { is_holy_order = yes }
			}
			trigger_else = {
				liege.primary_title ?= { is_holy_order = yes }
			}
		}
		localization_key = CV_REALM_TYPE_HOLY_ORDER
	}
	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				primary_title = { is_mercenary_company = yes }
			}
			trigger_else = {
				liege.primary_title ?= { is_mercenary_company = yes }
			}
		}
		localization_key = CV_REALM_TYPE_MERCENARY
	}
	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				this = faith.religious_head
				is_landed = no
			}
			trigger_else = { liege ?= faith.religious_head }
		}
		localization_key = CV_REALM_TYPE_HOF
	}
	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				this = faith.religious_head
				is_landed = yes
			}
			trigger_else = { liege ?= faith.religious_head }
		}
		localization_key = CV_REALM_TYPE_HOF_LANDED
	}
	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				is_governor = yes
			}
			trigger_else = {
				liege ?= { is_governor = yes }
			}
		}
		localization_key = GOVERNORSHIP_TOOLTIP
	}
	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				top_liege != this
			}
			trigger_else = {
				liege ?= { top_liege != this }
			}
		}
		localization_key = VASSAL_TOOLTIP
	}
	text = {
		trigger = { always = no }
		localization_key = REALM_TOOLTIP
		fallback = yes
	}
}

GetRealmOrDomicileConcept = {
	type = character

	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				has_government = landless_adventurer_government
			}
			trigger_else = {
				liege ?= { has_government = landless_adventurer_government }
			}
		}
		localization_key = CAMP
	}
	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				is_landless_administrative = yes
			}
			trigger_else = {
				liege ?= { is_landless_administrative = yes }
			}
		}
		localization_key = ESTATE
	}
	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				is_governor = yes
			}
			trigger_else = {
				liege ?= { is_governor = yes }
			}
		}
		localization_key = GOVERNORSHIP
	}
	text = {
		trigger = { always = no }
		localization_key = activity_filter_realm
		fallback = yes
	}
}

GetCourtPosition = {
	type = character

	text = {
		trigger = { is_landed = no }
		localization_key = game_concept_officer
	}
	text = {
		trigger = { always = no }
		localization_key = game_concept_court_position
		fallback = yes
	}
}

GetCourtPositionPlural = {
	type = character

	text = {
		trigger = { is_landed = no }
		localization_key = game_concept_officers
	}
	text = {
		trigger = { always = no }
		localization_key = game_concept_court_positions
		fallback = yes
	}
}

GetCourtPositionConceptPlural = {
	type = character

	text = {
		trigger = { is_landed = no }
		localization_key = OFFICER_PLURAL
	}
	text = {
		trigger = { always = no }
		localization_key = COURT_POSITION_PLURAL
		fallback = yes
	}
}

GetCourtOrOfficerPositionConceptPlural = {
	type = character

	text = {
		trigger = { is_landed = no }
		localization_key = officer_positions
	}
	text = {
		trigger = { always = no }
		localization_key = COURT_POSITION_PLURAL
		fallback = yes
	}
}

GetCourtOwnerConcept = {
	type = character

	text = {
		trigger = { is_landed = no }
		localization_key = ADVENTURER
	}
	text = {
		trigger = { always = no }
		localization_key = LIEGE
		fallback = yes
	}
}

GetCourtOwner = {
	type = character

	text = {
		trigger = { has_government = landless_adventurer_government }
		localization_key = court_owner_adventurer
	}
	text = {
		trigger = { always = no }
		localization_key = court_owner_liege
		fallback = yes
	}
}

GetValidKnightsHeader = {
	type = character

	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				has_government = landless_adventurer_government
			}
			trigger_else = {
				liege ?= { has_government = landless_adventurer_government }
			}
		}
		localization_key = KNIGHTS_SUBHEADER_LANDLESS_ADVENTURER
	}
	text = {
		trigger = { always = no }
		localization_key = KNIGHTS_SUBHEADER
		fallback = yes
	}
}

GetDoor = {
	type = character

	text = {
		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }
				has_government = landless_adventurer_government
			}
			trigger_else = {
				liege ?= { has_government = landless_adventurer_government }
			}
		}
		localization_key = tent_flap
	}
	text = {
		trigger = { always = no }
		localization_key = door
		fallback = yes
	}
}

GetHuntDesc = {
	type = character

	text = {
		trigger = {
			has_government = landless_adventurer_government
		}
		localization_key = activity_hunt_desc_adventurer
	}
	text = {
		trigger = { always = no }
		localization_key = activity_hunt_desc_regular
		fallback = yes
	}
}

GetHuntMasterDesc = {
	type = character

	text = {
		trigger = {
			has_government = landless_adventurer_government
		}
		localization_key = activity_huntmaster_desc_adventurer
	}
	text = {
		trigger = { always = no }
		localization_key = activity_huntmaster_desc_regular
		fallback = yes
	}
}

GetHuntMasterTooltipDesc = {
	type = character

	text = {
		trigger = {
			has_government = landless_adventurer_government
		}
		localization_key = activity_huntmaster_tooltip_desc_adventurer
	}
	text = {
		trigger = { always = no }
		localization_key = activity_huntmaster_tooltip_desc_regular
		fallback = yes
	}
}

GetServants = {
	type = character

	text = {
		trigger = {
			has_government = landless_adventurer_government
		}
		localization_key = followers_adventurer
	}
	text = {
		trigger = { always = no }
		localization_key = servants_desc_regular
		fallback = yes
	}
}

GetFollowerOrVassal = {
	type = character

	text = {
		trigger = {
			has_government = landless_adventurer_government
		}
		localization_key = follower
	}
	text = {
		trigger = { always = no }
		localization_key = vassal
		fallback = yes
	}
}

GetFollowerOrVassalPlural = {
	type = character
	parent = GetFollowerOrVassal
	suffix = _plural	
}

GetGameKeepers = {
	type = character

	text = {
		trigger = {
			has_government = landless_adventurer_government
		}
		localization_key = flushers_adventurer
	}
	text = {
		trigger = {
			government_has_flag = government_is_nomadic
		}
		localization_key = gamekeepers_nomadic
	}
	text = {
		trigger = { always = no }
		localization_key = gamekeepers_regular
		fallback = yes
	}
}

GetDoorPlural = {
	type = character
	parent = GetDoor
	suffix = _plural
}

GetGovernmentIcon = {
	type = character

	text = { # Holy Order
		trigger = {
			trigger_if = {
				limit = {
					is_alive = no
				}
				has_government = holy_order_government
			}
			trigger_else = {
				trigger_if = {
					limit = { is_ruler = yes }
					primary_title ?= { is_holy_order = yes }
				}
				trigger_else = {
					liege.primary_title ?= { is_holy_order = yes }
				}
			}
		}
		localization_key = holy_order_icon_concept
	}
	text = { # Mercenary
		trigger = {
			trigger_if = {
				limit = {
					is_alive = no
				}
				has_government = mercenary_government
			}
			trigger_else = {
				trigger_if = {
					limit = { is_ruler = yes }
					primary_title = { is_mercenary_company = yes }
				}
				trigger_else = {
					liege.primary_title ?= { is_mercenary_company = yes }
				}
			}
		}
		localization_key = mercenary_icon_concept
	}
	text = { # Adventurer
		trigger = {
			trigger_if = {
				limit = {
					is_alive = no
				}
				has_government = landless_adventurer_government
			}
			trigger_else = {
				trigger_if = {
					limit = {
						is_ruler = yes
					}
					government_has_flag = government_is_landless_adventurer
				}
				trigger_else = {
					liege ?= { government_has_flag = government_is_landless_adventurer }
				}
			}
		}
		localization_key = adventurer_icon_concept
	}
	text = { # Republic
		trigger = {
			trigger_if = {
				limit = {
					is_alive = no
				}
				has_government = landless_minority_government
			}
			trigger_else = {
				trigger_if = {
					limit = { is_ruler = yes }
					government_has_flag = government_is_landless_minority
				}
				trigger_else = {
					liege ?= { government_has_flag = government_is_landless_minority }
				}
			}
		}
		localization_key = minority_community_icon_concept
	}
	text = { # Nomad
		trigger = {
			trigger_if = {
				limit = {
					is_alive = no
				}
				has_government = nomad_government
			}
			trigger_else = {
				trigger_if = {
					limit = {
						is_ruler = yes
					}
					government_has_flag = government_is_nomadic
				}
				trigger_else = {
					liege ?= { government_has_flag = government_is_nomadic }
				}
			}
		}
		localization_key = nomadic_icon_concept
	}
	text = { # Herder
		trigger = {
			trigger_if = {
				limit = {
					is_alive = no
				}
				has_government = herder_government
			}
			trigger_else = {
				trigger_if = {
					limit = {
						is_ruler = yes
					}
					has_government = herder_government
				}
				trigger_else = {
					liege ?= { has_government = herder_government }
				}
			}
		}
		localization_key = herder_icon_concept
	}
	text = { # Celestial
		trigger = {
			trigger_if = {
				limit = { is_alive = no }
				has_government = celestial_government
			}
			trigger_else = {
				trigger_if = {
					limit = { is_ruler = yes }
					government_has_flag = government_is_celestial
				}
				trigger_else = {
					liege ?= { government_has_flag = government_is_celestial }
				}
			}
		}
		localization_key = celestial_icon_concept
	}
	text = { # Mandala
		trigger = {
			trigger_if = {
				limit = { is_alive = no }
				has_government = mandala_government
			}
			trigger_else = {
				trigger_if = {
					limit = { is_ruler = yes }
					government_has_flag = government_is_mandala
				}
				trigger_else = {
					liege ?= { government_has_flag = government_is_mandala }
				}
			}
		}
		localization_key = mandala_icon_concept
	}
	text = { # Maritime Tribal
		trigger = {
			trigger_if = {
				limit = { is_alive = no }
				has_government = wanua_government
			}
			trigger_else = {
				trigger_if = {
					limit = { is_ruler = yes }
					government_has_flag = government_is_wanua
				}
				trigger_else = {
					liege ?= { government_has_flag = government_is_wanua }
				}
			}
		}
		localization_key = wanua_icon_concept
	}
	text = { # Meritocratic
		trigger = {
			trigger_if = {
				limit = { is_alive = no }
				has_government = meritocratic_government
			}
			trigger_else = {
				trigger_if = {
					limit = { is_ruler = yes }
					government_has_flag = government_is_meritocratic
				}
				trigger_else = {
					liege ?= { government_has_flag = government_is_meritocratic }
				}
			}
		}
		localization_key = meritocratic_icon_concept
	}
	text = { # Tribal
		trigger = {
			trigger_if = {
				limit = {
					is_alive = no
				}
				has_government = tribal_government
			}
			trigger_else = {
				trigger_if = {
					limit = { is_ruler = yes }
					government_has_flag = government_is_tribal
					NOT = { government_has_flag = government_is_wanua }
				}
				trigger_else = {
					liege ?= { 
						government_has_flag = government_is_tribal 
						NOT = { government_has_flag = government_is_wanua }
					}
				}
			}
		}
		localization_key = tribal_icon_concept
	}
	text = { # Clan
		trigger = {
			trigger_if = {
				limit = {
					is_alive = no
				}
				has_government = clan_government
			}
			trigger_else = {
				trigger_if = {
					limit = { is_ruler = yes }
					government_has_flag = government_is_clan
				}
				trigger_else = {
					liege ?= { government_has_flag = government_is_clan }
				}
			}
		}
		localization_key = clan_icon_concept
	}
	text = { # Japanese Admin
		trigger = {
			trigger_if = {
				limit = { is_alive = no }
				has_government = japan_administrative_government
			}
			trigger_else = {
				trigger_if = {
					limit = { is_ruler = yes }
					has_government = japan_administrative_government
				}
				trigger_else = {
					liege ?= { has_government = japan_administrative_government }
				}
			}
		}
		localization_key = japan_administrative_icon_concept
	}
	text = { # Admin
		trigger = {
			trigger_if = {
				limit = {
					is_alive = no
				}
				has_government = administrative_government
			}
			trigger_else = {
				trigger_if = {
					limit = { is_ruler = yes }
					government_has_flag = government_is_administrative
				}
				trigger_else = {
					liege ?= { government_has_flag = government_is_administrative }
				}
			}
		}
		localization_key = administrative_icon_concept
	}
	text = { # Republic
		trigger = {
			trigger_if = {
				limit = {
					is_alive = no
				}
				has_government = republic_government
			}
			trigger_else = {
				trigger_if = {
					limit = { is_ruler = yes }
					government_has_flag = government_is_republic
				}
				trigger_else = {
					liege ?= { government_has_flag = government_is_republic }
				}
			}
		}
		localization_key = republic_icon_concept
	}
	text = { # Republic
		trigger = {
			trigger_if = {
				limit = {
					is_alive = no
				}
				has_government = peasantrepublic_government
			}
			trigger_else = {
				trigger_if = {
					limit = { is_ruler = yes }
					government_has_flag = government_is_prepublic
				}
				trigger_else = {
					liege ?= { government_has_flag = government_is_prepublic }
				}
			}
		}
		localization_key = peasantrepublic_icon_concept
	}
	text = { # Republic
		trigger = {
			trigger_if = {
				limit = {
					is_alive = no
				}
				has_government = urbanrepublic_government
			}
			trigger_else = {
				trigger_if = {
					limit = { is_ruler = yes }
					government_has_flag = government_is_urepublic
				}
				trigger_else = {
					liege ?= { government_has_flag = government_is_urepublic }
				}
			}
		}
		localization_key = urbanrepublic_icon_concept
	}
	text = { # Theocracy
		trigger = {
			trigger_if = {
				limit = {
					is_alive = no
				}
				has_government = theocracy_government
			}
			trigger_else = {
				trigger_if = {
					limit = { is_ruler = yes }
					government_has_flag = government_is_theocracy
				}
				trigger_else = {
					liege ?= { government_has_flag = government_is_theocracy }
				}
			}
		}
		localization_key = theocracy_icon_concept
	}
	text = { # Japanese Feudal
		trigger = {
			trigger_if = {
				limit = { is_alive = no }
				has_government = japan_feudal_government
			}
			trigger_else = {
				trigger_if = {
					limit = { is_ruler = yes }
					has_government = japan_feudal_government
				}
				trigger_else = {
					liege ?= { has_government = japan_feudal_government }
				}
			}
		}
		localization_key = japan_feudal_icon_concept
	}
	text = { # Steppe Admin
		trigger = {
			trigger_if = {
				limit = { is_alive = no }
				has_government = steppe_admin_government
			}
			trigger_else = {
				trigger_if = {
					limit = { is_ruler = yes }
					has_government = steppe_admin_government
				}
				trigger_else = {
					liege ?= { has_government = steppe_admin_government }
				}
			}
		}
		localization_key = steppe_admin_icon_concept
	}
	text = { # Feudal
		trigger = { always = no }
		localization_key = feudal_icon_concept
		fallback = yes
	}
}

GetTribalFeudal = {
	type = character

	text = {
		trigger = { government_has_flag = government_is_tribal }
		localization_key = tribal_government
	}

	text = {
		localization_key = feudal_government
	}
}
