Makes species in the menu sort themselves better (#4470)

## About The Pull Request
This PR makes species in the species menu sort themselves by how much
lore is present for them, and also sorts template species to the bottom
of the species list.

This should help ensure that players see finished species to get their
brains whirling first. As more species have lore written for them, this
list is likely to change, and we will probably rewrite species with
excessive lore in order to simplify them.

Unathi are renamed to Lizardperson (generic) and moved to a template
species.

## Why It's Good For The Game
The species we've finished so far come first in the species menu,
without removing any species from the game

## Proof Of Testing
<img width="78" height="603" alt="image"
src="https://github.com/user-attachments/assets/512d2aa6-7e98-45d6-8ca1-233c4551ff9a"
/>

## Changelog

🆑 ReturnToZender
add: The species menu now sorts itself based on the length of provided
lore. Species with lore come first.
del: Unathi have been renamed to Lizardperson (Generic). They don't have
lore, and lack a lot of the engaging mechanics that Lizardpeople have,
so we've reflavored them as a template species.
/🆑
This commit is contained in:
Return
2025-08-24 21:43:55 +03:00
committed by GitHub
parent dcda97e6f8
commit cc0157190d
13 changed files with 33 additions and 1 deletions
@@ -61,5 +61,6 @@
data[species_id]["enabled_features"] = species.get_features()
data[species_id]["perks"] = species.get_species_perks()
data[species_id]["diet"] = species.get_species_diet()
data[species_id]["sort_bottom"] = species.sort_bottom //BUBBER EDIT ADDITION: Do we sort the species to the bottom?
return data
@@ -8,6 +8,7 @@
BODY_ZONE_L_LEG = /obj/item/bodypart/leg/left/lizard/ashwalker,
BODY_ZONE_R_LEG = /obj/item/bodypart/leg/right/lizard/ashwalker,
)
sort_bottom = TRUE //BUBBER EDIT ADDITION: We want to sort this to the bottom because it's a ghostrole only species.
/datum/species/lizard/ashwalker/on_species_gain(mob/living/carbon/carbon_target, datum/species/old_species, regenerate_icons)
. = ..()
@@ -24,6 +24,7 @@
)
meat = /obj/item/food/fishmeat/moonfish/akula
sort_bottom = TRUE //BUBBER EDIT ADDITION: We want to sort this to the bottom because it's a custom species template.
/datum/species/aquatic/get_default_mutant_bodyparts()
return list(
@@ -12,6 +12,7 @@
changesource_flags = MIRROR_BADMIN | WABBAJACK | MIRROR_MAGIC | MIRROR_PRIDE | ERT_SPAWN | RACE_SWAP | SLIME_EXTRACT
payday_modifier = 1.0
examine_limb_id = SPECIES_HUMAN
sort_bottom = TRUE //BUBBER EDIT ADDITION: We want to sort this to the bottom because it's a custom species template.
/datum/species/humanoid/get_default_mutant_bodyparts()
return list(
@@ -22,6 +22,7 @@
BODY_ZONE_R_LEG = /obj/item/bodypart/leg/right/mutant/insect,
)
eyes_icon = 'modular_skyrat/modules/organs/icons/insect_eyes.dmi'
sort_bottom = TRUE //BUBBER EDIT ADDITION: We want to sort this to the bottom because it's a custom species template.
/datum/species/insect/get_default_mutant_bodyparts()
return list(
@@ -20,6 +20,7 @@
BODY_ZONE_L_LEG = /obj/item/bodypart/leg/left/mutant,
BODY_ZONE_R_LEG = /obj/item/bodypart/leg/right/mutant,
)
sort_bottom = TRUE //BUBBER EDIT ADDITION: We want to sort this to the bottom because it's a custom species template.
/datum/species/mammal/get_default_mutant_bodyparts()
return list(
@@ -25,6 +25,7 @@
TRAIT_LITERATE,
TRAIT_MUTANT_COLORS,
)
sort_bottom = FALSE //We don't want this to sort to the bottom like regular podpeople, because it's not a ghostrole species
always_customizable = FALSE
@@ -1,5 +1,5 @@
/datum/species/unathi
name = "Unathi"
name = "Lizardperson (Generic)"
id = SPECIES_UNATHI
inherent_traits = list(
TRAIT_ADVANCEDTOOLUSER,
@@ -13,6 +13,7 @@
payday_modifier = 1.0
changesource_flags = MIRROR_BADMIN | WABBAJACK | MIRROR_MAGIC | MIRROR_PRIDE | ERT_SPAWN | RACE_SWAP | SLIME_EXTRACT
examine_limb_id = SPECIES_LIZARD
sort_bottom = TRUE //BUBBER EDIT ADDITION: We want to sort this to the bottom because it's a custom species template. It can't have its own lore.
bodypart_overrides = list(
BODY_ZONE_HEAD = /obj/item/bodypart/head/lizard,
@@ -32,6 +32,7 @@
TRAIT_RESISTCOLD,
TRAIT_USES_SKINTONES,
)
sort_bottom = TRUE //BUBBER EDIT ADDITION: We want to sort this to the bottom because it's a ghostrole only species.
always_customizable = TRUE
@@ -1,3 +1,7 @@
/datum/species
var/sort_bottom = FALSE
//Whether or not a given species is sorted to the bottom of the list. We mainly want to do this for species that are used only for ghostroles, and template species.
/// Called once the target is made into a bloodsucker. Used for removing conflicting species organs mostly
/datum/species/proc/on_bloodsucker_gain(mob/living/carbon/human/target)
return null
@@ -1,5 +1,6 @@
/datum/species/pod
inert_mutation = /datum/mutation/harmonizing_pulses
sort_bottom = TRUE //BUBBER EDIT ADDITION: We want to sort this to the bottom because it's a ghostrole only species.
/datum/species/pod/get_species_description()
return list(
@@ -273,6 +273,22 @@ function SpeciesPageInner(props: SpeciesPageInnerProps) {
species[0] = species[humanIndex];
species[humanIndex] = swapWith;
/* BUBBER EDIT START - SPECIES LIST SORTING */
species.sort(([keyA, speciesA], [keyB, speciesB]) => {
// Human first
if (keyA === 'human') return -1;
if (keyB === 'human') return 1;
// Species with sort_bottom = true go to the bottom
if (speciesA.sort_bottom !== speciesB.sort_bottom) {
return speciesA.sort_bottom ? 1 : -1;
}
// Otherwise sort by lore length descending
return speciesB.lore.length - speciesA.lore.length;
});
/* BUBBER EDIT END - SPECIES LIST SORTING */
const currentSpecies = species.filter(([speciesKey]) => {
return speciesKey === data.character_preferences.misc.species;
})[0][1];
@@ -49,6 +49,8 @@ export type Species = {
desc: string[];
lore: string[];
icon: string;
sort_bottom: BooleanLike;
//BUBBER EDIT ADD: Sort_bottom, whether a species is sorted to the bottom of the list.
use_skintones: BooleanLike;
sexes: BooleanLike;