# Rules for picking clothing sets.

# Royalty ranks.
blg_royalty = {
	OR = {
		higher_real_tier_than = duke
		spouse_even_if_dead = {
			higher_real_tier_than = duke
		}
		blg_royal_title = yes
	}
	blg_republic = no
	blg_mercenary = no
	blg_holy_order = no
	blg_peasant = no
}

# Uses extra jewelry.
blg_jewelry = {
	OR = {
		higher_tier_than = count
		is_or_was_offmap_power_ruler = yes
		spouse_even_if_dead = {
			OR = {
				higher_tier_than = count
				is_or_was_offmap_power_ruler = yes
			}
		}
	}
}

blg_chinese_makeup = {
	always = no
}

# Prepared for battle.
blg_warrior = {
	OR = {
		AND = {
			in_command = yes
			OR = {
				war = yes
				liege = { war = yes }
				in_battle = yes
				in_siege = yes
				is_landed = no
				employer = { mercenary = yes }
				employer = { holy_order = yes }
			}
		}
		has_job_title = job_marshal
		death_reason = death_battle
		death_reason = death_duel
		death_reason = death_legendary_win_duel
		death_reason = death_legendary_fail_duel
		death_reason = death_mission_duel
		death_reason = death_battle_duel
		death_reason = death_claim_duel_attacker
		death_reason = death_claim_duel_defender
		death_reason = death_dragon_duel
		death_reason = death_duel_trial_by_seven
		death_reason = death_duel_battle
		death_reason = death_duel_trial_by_combat
		death_reason = death_duel_melee
		death_reason = death_duel_regency
		death_reason = death_duel_rogue_kg
		death_reason = death_duel_vs_rogue_kg
		death_reason = death_duel_kingsmoot
		death_reason = death_duel_honour
		death_reason = death_duel_murder_attempt
		death_reason = death_battle_bloodrider
		AND = {
			blg_mercenary = yes
			blg_mercenary_fleet = no
		}
	}
}

# Commander with fancier armour.
blg_elite_commander = {
	OR = {
		higher_real_tier_than = count
		spouse_even_if_dead = { higher_real_tier_than = count }
	}
}

# Early era headgear designs.
blg_style_early = {
	year_of_birth < 1160
}

# Middle era headgear designs.
blg_style_mid = {
	year_of_birth < 1250
}

# Later era headgear designs.
blg_style_late = {
	year_of_birth >= 1160
}

### Headgear:

# Emperors crown.
blg_crown_emperor = {
	real_tier = emperor
	trigger_if = {
		limit = { is_nomadic = yes }
		population_and_manpower >= 10000
	}
	NOR = {
		is_tributary = yes
		blg_republic = yes
		blg_mercenary = yes
		blg_holy_order = yes
		blg_peasant = yes
	}
}

# Dress like an emperor.
blg_headgear_emperor = {
	OR = {
		blg_crown_emperor = yes
		AND = {
			is_main_spouse = yes
			spouse_even_if_dead = {
				blg_crown_emperor = yes
			}
		}
	}
}

# Dress like a king.
blg_headgear_king = {
	can_wear_a_crown_trigger = yes
	blg_mercenary = no
	blg_peasant = no
}

# Dress like a duke.
blg_headgear_duke = {
	OR = {
		higher_real_tier_than = count
		spouse_even_if_dead = { higher_real_tier_than = count }
		has_minor_title = title_prince
		has_minor_title = title_queen_mother
	}

	blg_mercenary = no
	blg_peasant = no
}

# Dress with common headgear.
blg_headgear_common = {
	blg_headgear_king = no
}

# Wears a helmet.
blg_headgear_military = {
	trigger_if = {
		limit = {
			NAND = {
				trait = undead
				combat_rating = 10
			}
		}
		OR = {
			blg_fighting = yes
			blg_headgear_military_on_rule = yes
		}
		blg_headgear_military_off_rule = no
	}
}

# Dress shady.
blg_headgear_intrigue = {
	trigger_if = {
		limit = { has_job_title = job_spymaster }
		lower_real_tier_than = king
	}
	trigger_else = {
		intrigue >= 18
		lower_real_tier_than = duke
	}
}

# More common to cover hair.
blg_headgear_covered = {
	always = no
}

### Clothes:

# Dress like royalty.
blg_clothes_royal = {
	OR = {
		higher_real_tier_than = duke
		spouse_even_if_dead = {
			higher_real_tier_than = duke
		}
		blg_royal_title = yes
		blg_prince_title = yes
		blg_merchant_clothes = yes
	}
	blg_mercenary = no
	blg_holy_order = no
	blg_peasant = no
}

# Dress like nobility.
blg_clothes_noble = {
	OR = {
		is_landed = yes
		higher_real_tier_than = count
		spouse_even_if_dead = {
			OR = {
				is_landed = yes
				higher_real_tier_than = count
			}
		}
		blg_royal_title = yes
		blg_prince_title = yes
		blg_fashionable = yes
		has_minor_title = title_regent
	}
	blg_peasant = no
}

# Dress like a commoner.
blg_clothes_common = {
	OR = {
		NOR = {
			is_landed = yes
			spouse_even_if_dead = { higher_real_tier_than = count }
			blg_royal_title = yes
			blg_prince_title = yes
		}
		trait = humble
		blg_peasant = yes
	}
}

# Dress in armour.
blg_clothes_military = {
	OR = {
		AND = {
			in_command = yes
			OR = {
				war = yes
				liege = { war = yes }
				in_battle = yes
				in_siege = yes
				is_landed = no
			}
		}
		#blg_duelling = yes
		has_job_title = job_marshal
		death_reason = death_battle
		death_reason = death_duel
		death_reason = death_legendary_win_duel
		death_reason = death_legendary_fail_duel
		death_reason = death_mission_duel
		death_reason = death_battle_duel
		death_reason = death_claim_duel_attacker
		death_reason = death_claim_duel_defender
		death_reason = death_dragon_duel
		death_reason = death_duel_trial_by_seven
		death_reason = death_duel_battle
		death_reason = death_duel_trial_by_combat
		death_reason = death_duel_melee
		death_reason = death_duel_regency
		death_reason = death_duel_rogue_kg
		death_reason = death_duel_vs_rogue_kg
		death_reason = death_duel_kingsmoot
		death_reason = death_duel_honour
		death_reason = death_duel_murder_attempt
		death_reason = death_battle_bloodrider
		employer = {
			blg_mercenary = yes
			blg_mercenary_fleet = no
		}
		employer = { blg_holy_order = yes }
		AND = {
			blg_guard = yes
			OR = {
				is_landed = no
				trait = travelling
				trait = wikid
				trait = on_reaving
			}
		}
		AND = {
			trait = undead
			combat_rating >= 10
		}
	}
}

# Dress shady.
blg_clothes_intrigue = {
	OR = {
		has_job_title = job_spymaster
		trait = schemer
		AND = {
			intrigue >= 16
			lower_real_tier_than = duke
		}
	}
}
