#################
# Forever Young leader traits (4.5 format)
# Granted by fountain.201 / fountain.200 to leaders whose species has trait_youth.
# 4.x has three leader classes (commander, official, scientist); rulers are any class
# with is_ruler = yes, so the old ruler/admiral/general/governor traits are folded in here.
#################

leader_trait_commander_youth = {
	inline_script = {
		script = trait/icon
		CLASS = commander
		ICON = "GFX_leader_trait_apb_youth"
		RARITY = common
		COUNCIL = triggered
		TIER = none
	}
	# Ruler (gestalts have no happiness, so they get stability instead)
	triggered_councilor_modifier = {
		potential = {
			is_ruler = yes
			owner? = { is_gestalt = no }
		}
		pop_citizen_happiness = 0.1
	}
	triggered_councilor_modifier = {
		potential = {
			is_ruler = yes
			owner? = { is_gestalt = yes }
		}
		planet_stability_add = 5
	}
	# Fleet (was the admiral trait)
	triggered_fleet_modifier = {
		potential = { is_ruler = no }
		ship_armor_regen_add_perc = 0.1
		ship_hull_regen_add_perc = 0.1
	}
	# Armies (was the general trait)
	triggered_army_modifier = {
		potential = { is_ruler = no }
		army_attack_damage_mult = 0.05
		army_attack_health_mult = 0.15
		army_defense_damage_mult = 0.1
		army_defense_health_mult = 0.15
	}
	leader_class = { commander }
	requires_traits = { trait_youth }
	initial = no
	randomized = no
	notify_on_gained = no
}

leader_trait_official_youth = {
	inline_script = {
		script = trait/icon
		CLASS = official
		ICON = "GFX_leader_trait_apb_youth"
		RARITY = common
		COUNCIL = triggered
		TIER = none
	}
	# Ruler (gestalts have no happiness, so they get stability instead)
	triggered_councilor_modifier = {
		potential = {
			is_ruler = yes
			owner? = { is_gestalt = no }
		}
		pop_citizen_happiness = 0.1
	}
	triggered_councilor_modifier = {
		potential = {
			is_ruler = yes
			owner? = { is_gestalt = yes }
		}
		planet_stability_add = 5
	}
	# Governed planet (was the governor trait)
	triggered_planet_modifier = {
		potential = { is_ruler = no }
		planet_stability_add = 10
	}
	leader_class = { official }
	requires_traits = { trait_youth }
	initial = no
	randomized = no
	notify_on_gained = no
}

leader_trait_scientist_youth = {
	inline_script = {
		script = trait/icon
		CLASS = scientist
		ICON = "GFX_leader_trait_apb_youth"
		RARITY = common
		COUNCIL = triggered
		TIER = none
	}
	# Ruler (gestalts have no happiness, so they get stability instead)
	triggered_councilor_modifier = {
		potential = {
			is_ruler = yes
			owner? = { is_gestalt = no }
		}
		pop_citizen_happiness = 0.1
	}
	triggered_councilor_modifier = {
		potential = {
			is_ruler = yes
			owner? = { is_gestalt = yes }
		}
		planet_stability_add = 5
	}
	# On the council (scientists no longer lead research areas in 4.x)
	triggered_councilor_modifier = {
		potential = { is_ruler = no }
		all_technology_research_speed = 0.065
	}
	# Leading a science ship. Also keeps this from being a council-only trait, which 4.x refuses
	# to add to scientists who are not on the council (councilor_trait_not_allowed).
	modifier = {
		science_ship_survey_speed = 0.1
		ship_anomaly_research_speed_mult = 0.1
	}
	leader_class = { scientist }
	requires_traits = { trait_youth }
	initial = no
	randomized = no
	notify_on_gained = no
}

#################
# Perpetually Maintained leader traits: same bonuses as Forever Young, granted to leaders whose
# species has trait_apb_perpetual_maintenance (Perpetual Maintenance). No immortality here:
# robotic leaders are already immortal in vanilla.
#################
leader_trait_commander_apb_maintained = {
	inline_script = {
		script = trait/icon
		CLASS = commander
		ICON = "GFX_leader_trait_apb_maintained"
		RARITY = common
		COUNCIL = triggered
		TIER = none
	}
	# Ruler (gestalts have no happiness, so they get stability instead)
	triggered_councilor_modifier = {
		potential = {
			is_ruler = yes
			owner? = { is_gestalt = no }
		}
		pop_citizen_happiness = 0.1
	}
	triggered_councilor_modifier = {
		potential = {
			is_ruler = yes
			owner? = { is_gestalt = yes }
		}
		planet_stability_add = 5
	}
	# Fleet (was the admiral trait)
	triggered_fleet_modifier = {
		potential = { is_ruler = no }
		ship_armor_regen_add_perc = 0.1
		ship_hull_regen_add_perc = 0.1
	}
	# Armies (was the general trait)
	triggered_army_modifier = {
		potential = { is_ruler = no }
		army_attack_damage_mult = 0.05
		army_attack_health_mult = 0.15
		army_defense_damage_mult = 0.1
		army_defense_health_mult = 0.15
	}
	leader_class = { commander }
	requires_traits = { trait_apb_perpetual_maintenance }
	initial = no
	randomized = no
	notify_on_gained = no
}

leader_trait_official_apb_maintained = {
	inline_script = {
		script = trait/icon
		CLASS = official
		ICON = "GFX_leader_trait_apb_maintained"
		RARITY = common
		COUNCIL = triggered
		TIER = none
	}
	# Ruler (gestalts have no happiness, so they get stability instead)
	triggered_councilor_modifier = {
		potential = {
			is_ruler = yes
			owner? = { is_gestalt = no }
		}
		pop_citizen_happiness = 0.1
	}
	triggered_councilor_modifier = {
		potential = {
			is_ruler = yes
			owner? = { is_gestalt = yes }
		}
		planet_stability_add = 5
	}
	# Governed planet (was the governor trait)
	triggered_planet_modifier = {
		potential = { is_ruler = no }
		planet_stability_add = 10
	}
	leader_class = { official }
	requires_traits = { trait_apb_perpetual_maintenance }
	initial = no
	randomized = no
	notify_on_gained = no
}

leader_trait_scientist_apb_maintained = {
	inline_script = {
		script = trait/icon
		CLASS = scientist
		ICON = "GFX_leader_trait_apb_maintained"
		RARITY = common
		COUNCIL = triggered
		TIER = none
	}
	# Ruler (gestalts have no happiness, so they get stability instead)
	triggered_councilor_modifier = {
		potential = {
			is_ruler = yes
			owner? = { is_gestalt = no }
		}
		pop_citizen_happiness = 0.1
	}
	triggered_councilor_modifier = {
		potential = {
			is_ruler = yes
			owner? = { is_gestalt = yes }
		}
		planet_stability_add = 5
	}
	# On the council (scientists no longer lead research areas in 4.x)
	triggered_councilor_modifier = {
		potential = { is_ruler = no }
		all_technology_research_speed = 0.065
	}
	# Leading a science ship. Also keeps this from being a council-only trait, which 4.x refuses
	# to add to scientists who are not on the council (councilor_trait_not_allowed).
	modifier = {
		science_ship_survey_speed = 0.1
		ship_anomaly_research_speed_mult = 0.1
	}
	leader_class = { scientist }
	requires_traits = { trait_apb_perpetual_maintenance }
	initial = no
	randomized = no
	notify_on_gained = no
}
