Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ports a few prs, also monkified lizardpeople are just really short lizards now #537

Merged
merged 14 commits into from
Jul 30, 2024
2 changes: 1 addition & 1 deletion _maps/map_files/Birdshot/birdshot.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -57098,7 +57098,7 @@
desc = "A cold, hard place for your final rest.";
name = "Morgue Slab"
},
/mob/living/carbon/human/species/monkey/humand_legged{
/mob/living/carbon/human/species/monkey{
name = "Charles";
real_name = "Charles"
},
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/colors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -430,3 +430,5 @@ GLOBAL_LIST_INIT(cable_colors, list(
CABLE_COLOR_YELLOW = CABLE_HEX_COLOR_YELLOW,
CABLE_COLOR_BROWN = CABLE_HEX_COLOR_BROWN
))

#define HUSK_COLOR_TONE rgb(96, 88, 80)
17 changes: 15 additions & 2 deletions code/__DEFINES/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,20 @@
/// Total amount of slots
#define SLOTS_AMT 20 // Keep this up to date!

///Inventory slots that can be blacklisted by a species from being equipped into
DEFINE_BITFIELD(no_equip_flags, list(
"EXOSUIT" = ITEM_SLOT_OCLOTHING,
"JUMPSUIT" = ITEM_SLOT_ICLOTHING,
"GLOVES" = ITEM_SLOT_GLOVES,
"GLASSES" = ITEM_SLOT_EYES,
"EARPIECES" = ITEM_SLOT_EARS,
"MASKS" = ITEM_SLOT_MASK,
"HATS" = ITEM_SLOT_HEAD,
"SHOES" = ITEM_SLOT_FEET,
"BACKPACKS" = ITEM_SLOT_BACK,
"TIES" = ITEM_SLOT_NECK,
))

//SLOT GROUP HELPERS
#define ITEM_SLOT_POCKETS (ITEM_SLOT_LPOCKET|ITEM_SLOT_RPOCKET)
/// Slots that are physically on you
Expand Down Expand Up @@ -135,11 +149,10 @@
#define CLOTHING_DIGITIGRADE_VARIATION (1<<1)
///The sprite works fine for digitigrade legs as-is.
#define CLOTHING_DIGITIGRADE_VARIATION_NO_NEW_ICON (1<<2)
///has a sprite for monkeys
#define CLOTHING_MONKEY_VARIATION (1<<3)
/// When worn by a mob with digitigrade, apply a filter
#define CLOTHING_DIGITIGRADE_FILTER (1<<3)

/// Any flag which has a variation for digi
#define DIGITIGRADE_VARIATIONS (CLOTHING_DIGITIGRADE_VARIATION|CLOTHING_DIGITIGRADE_VARIATION_NO_NEW_ICON|CLOTHING_DIGITIGRADE_FILTER)

//flags for covering body parts
Expand Down
23 changes: 12 additions & 11 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,14 @@
#define SPECIES_LIZARD_SILVER "silverscale"
#define SPECIES_NIGHTMARE "nightmare"
#define SPECIES_MONKEY "monkey"
#define SPECIES_MONKEY_FREAK "monkey_freak"
#define SPECIES_MONKEY_HOLODECK "monkey_holodeck"
#define SPECIES_MONKEY_HUMAN_LEGGED "monkey_human_legged"
#define SPECIES_MONKEY_LIZARD "kobold"
#define SPECIES_MOTH "moth"
#define SPECIES_MUSHROOM "mush"
#define SPECIES_PLASMAMAN "plasmaman"
#define SPECIES_PODPERSON "pod"
#define SPECIES_SHADOW "shadow"
#define SPECIES_SKELETON "skeleton"
#define SPECIES_SNAIL "snail"
#define SPECIES_TALLBOY "tallboy"
#define SPECIES_VAMPIRE "vampire"
#define SPECIES_ZOMBIE "zombie"
#define SPECIES_ZOMBIE_INFECTIOUS "memezombie"
Expand Down Expand Up @@ -668,18 +665,22 @@
// - They do not start at 0 for futureproofing
// - They skip numbers for futureproofing as well
// Otherwise they are completely arbitrary
#define HUMAN_HEIGHT_DWARF 2
#define HUMAN_HEIGHT_SHORTEST 4
#define HUMAN_HEIGHT_SHORT 6
#define HUMAN_HEIGHT_MEDIUM 8
#define HUMAN_HEIGHT_TALL 10
#define HUMAN_HEIGHT_TALLER 12
#define HUMAN_HEIGHT_TALLEST 14
#define MONKEY_HEIGHT_DWARF 2
#define MONKEY_HEIGHT_MEDIUM 4
#define HUMAN_HEIGHT_DWARF 6
#define HUMAN_HEIGHT_SHORTEST 8
#define HUMAN_HEIGHT_SHORT 10
#define HUMAN_HEIGHT_MEDIUM 12
#define HUMAN_HEIGHT_TALL 14
#define HUMAN_HEIGHT_TALLER 16
#define HUMAN_HEIGHT_TALLEST 18

/// Assoc list of all heights, cast to strings, to """"tuples"""""
/// The first """tuple""" index is the upper body offset
/// The second """tuple""" index is the lower body offset
GLOBAL_LIST_INIT(human_heights_to_offsets, list(
"[MONKEY_HEIGHT_DWARF]" = list(-9, -3),
"[MONKEY_HEIGHT_MEDIUM]" = list(-7, -4),
"[HUMAN_HEIGHT_DWARF]" = list(-5, -4),
"[HUMAN_HEIGHT_SHORTEST]" = list(-2, -1),
"[HUMAN_HEIGHT_SHORT]" = list(-1, -1),
Expand Down
5 changes: 0 additions & 5 deletions code/__DEFINES/research/anomalies.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
GLOBAL_LIST_INIT(bioscrambler_parts_blacklist, typecacheof(list(
/obj/item/bodypart/chest/larva,
/obj/item/bodypart/head/larva,
// Re-add the ones below this line when the bug with offset is fixed
/obj/item/bodypart/leg/left/monkey,
/obj/item/bodypart/leg/right/monkey,
/obj/item/bodypart/leg/left/tallboy,
/obj/item/bodypart/leg/right/tallboy,
)))

/// Blacklist of organs which should not appear when bioscrambled.
Expand Down
4 changes: 0 additions & 4 deletions code/__DEFINES/species_clothing_paths.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
///The dmi for humanoid oversuits
#define DEFAULT_SUIT_FILE 'icons/mob/clothing/suits/default.dmi'

//MONKEY PATHS
///The dmi for monkey uniforms
#define MONKEY_UNIFORM_FILE 'icons/mob/human/species/monkey/uniform.dmi'

//DIGITIGRADE PATHS
///The dmi containing digitigrade uniforms
#define DIGITIGRADE_UNIFORM_FILE 'icons/mob/human/species/misc/digitigrade.dmi'
Expand Down
9 changes: 1 addition & 8 deletions code/__HELPERS/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
init_sprite_accessory_subtypes(/datum/sprite_accessory/body_markings, GLOB.body_markings_list)
init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/human, GLOB.tails_list_human, add_blank = TRUE)
init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/lizard, GLOB.tails_list_lizard, add_blank = TRUE)
init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/monkey, GLOB.tails_list_monkey, add_blank = TRUE)
init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/monkey, GLOB.tails_list_monkey, add_blank = FALSE)
init_sprite_accessory_subtypes(/datum/sprite_accessory/snouts, GLOB.snouts_list)
init_sprite_accessory_subtypes(/datum/sprite_accessory/horns,GLOB.horns_list)
init_sprite_accessory_subtypes(/datum/sprite_accessory/ears, GLOB.ears_list)
Expand All @@ -40,13 +40,6 @@
init_sprite_accessory_subtypes(/datum/sprite_accessory/plumage, GLOB.avian_ears_list) //NON-MODULE CHANGE
init_sprite_accessory_subtypes(/datum/sprite_accessory/synth_head_cover, GLOB.synth_head_cover_list) //NON-MODULE CHANGE

/// Inits GLOB.species_list. Not using GLOBAL_LIST_INIT b/c it depends on GLOB.string_lists
/proc/init_species_list()
for(var/species_path in subtypesof(/datum/species))
var/datum/species/species = new species_path()
GLOB.species_list[species.id] = species_path
sort_list(GLOB.species_list, GLOBAL_PROC_REF(cmp_typepaths_asc))

/// Inits GLOB.surgeries
/proc/init_surgeries()
var/surgeries = list()
Expand Down
4 changes: 2 additions & 2 deletions code/__HELPERS/icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ world
/icon/proc/ColorTone(tone)
GrayScale()

var/list/TONE = ReadRGB(tone)
var/list/TONE = rgb2num(tone)
var/gray = round(TONE[1]*0.3 + TONE[2]*0.59 + TONE[3]*0.11, 1)

var/icon/upper = (255-gray) ? new(src) : null
Expand Down Expand Up @@ -1544,7 +1544,7 @@ GLOBAL_LIST_EMPTY(transformation_animation_objects)
var/list/icon_dimensions = get_icon_dimensions(source.icon)
var/width = icon_dimensions["width"]
var/height = icon_dimensions["height"]

if(width > world.icon_size)
alert_overlay.pixel_x = -(world.icon_size / 2) * ((width - world.icon_size) / world.icon_size)
if(height > world.icon_size)
Expand Down
58 changes: 14 additions & 44 deletions code/__HELPERS/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,20 @@
else
return "#000000"

/proc/random_hair_color()
var/static/list/natural_hair_colors = list(
"#111111", "#362925", "#3B3831", "#41250C", "#412922",
"#544C49", "#583322", "#593029", "#703b30", "#714721",
"#744729", "#74482a", "#7b746e", "#855832", "#863019",
"#8c4734", "#9F550E", "#A29A96", "#A4381C", "#B17B41",
"#C0BAB7", "#EFE5E4", "#F7F3F1", "#FFF2D6", "#a15537",
"#a17e61", "#b38b67", "#ba673c", "#c89f73", "#d9b380",
"#dbc9b8", "#e1621d", "#e17d17", "#e1af93", "#f1cc8f",
"#fbe7a1",
)

return pick(natural_hair_colors)

/proc/random_underwear(gender)
if(!GLOB.underwear_list.len)
init_sprite_accessory_subtypes(/datum/sprite_accessory/underwear, GLOB.underwear_list, GLOB.underwear_m, GLOB.underwear_f)
Expand Down Expand Up @@ -88,47 +102,6 @@
else
return pick(GLOB.facial_hairstyles_list)

/proc/random_unique_name(gender, attempts_to_find_unique_name=10)
for(var/i in 1 to attempts_to_find_unique_name)
if(gender == FEMALE)
. = capitalize(pick(GLOB.first_names_female)) + " " + capitalize(pick(GLOB.last_names))
else
. = capitalize(pick(GLOB.first_names_male)) + " " + capitalize(pick(GLOB.last_names))

if(!findname(.))
break

/proc/random_unique_lizard_name(gender, attempts_to_find_unique_name=10)
for(var/i in 1 to attempts_to_find_unique_name)
. = capitalize(lizard_name(gender))

if(!findname(.))
break

/proc/random_unique_plasmaman_name(attempts_to_find_unique_name=10)
for(var/i in 1 to attempts_to_find_unique_name)
. = capitalize(plasmaman_name())

if(!findname(.))
break

/proc/random_unique_ethereal_name(attempts_to_find_unique_name=10)
for(var/i in 1 to attempts_to_find_unique_name)
. = capitalize(ethereal_name())

if(!findname(.))
break

/proc/random_unique_moth_name(attempts_to_find_unique_name=10)
for(var/i in 1 to attempts_to_find_unique_name)
. = capitalize(pick(GLOB.moth_first)) + " " + capitalize(pick(GLOB.moth_last))

if(!findname(.))
break

/proc/random_skin_tone()
return pick(GLOB.skin_tones)

GLOBAL_LIST_INIT(skin_tones, sort_list(list(
"albino",
"caucasian1",
Expand Down Expand Up @@ -167,9 +140,6 @@ GLOBAL_LIST_INIT(skin_tone_names, list(
"mixed4" = "Macadamia",
))

/// An assoc list of species IDs to type paths
GLOBAL_LIST_EMPTY(species_list)

/proc/age2agedescription(age)
switch(age)
if(0 to 1)
Expand Down
94 changes: 72 additions & 22 deletions code/__HELPERS/names.dm
Original file line number Diff line number Diff line change
@@ -1,20 +1,75 @@
/proc/lizard_name(gender)
if(gender == MALE)
return "[pick(GLOB.lizard_names_male)]-[pick(GLOB.lizard_names_male)]"
else
return "[pick(GLOB.lizard_names_female)]-[pick(GLOB.lizard_names_female)]"
/**
* Generate a random name based off of one of the roundstart languages
*
* * gender - What gender to pick from. Picks between male, female if not provided.
* * unique - If the name should be unique, IE, avoid picking names that mobs already have.
* * list/language_weights - A list of language weights to pick from.
* If not provided, it will default to a list of roundstart languages, with common being the most likely.
*/
/proc/generate_random_name(gender, unique, list/language_weights)
if(isnull(language_weights))
language_weights = list()
for(var/lang_type in GLOB.uncommon_roundstart_languages)
language_weights[lang_type] = 1
language_weights[/datum/language/common] = 20

var/datum/language/picked = GLOB.language_datum_instances[pick_weight(language_weights)]
if(unique)
return picked.get_random_unique_name(gender)
return picked.get_random_name(gender)

/**
* Generate a random name based off of a species
* This will pick a name from the species language, and avoid picking common if there are alternatives
*
* * gender - What gender to pick from. Picks between male, female if not provided.
* * unique - If the name should be unique, IE, avoid picking names that mobs already have.
* * datum/species/species_type - The species to pick from
* * include_all - Makes the generated name a mix of all the languages the species can speak rather than just one of them
* Does this on a per-name basis, IE "Lizard first name, uncommon last name".
*/
/proc/generate_random_name_species_based(gender, unique, datum/species/species_type, include_all = FALSE)
ASSERT(ispath(species_type, /datum/species))
var/datum/language_holder/holder = GLOB.prototype_language_holders[species_type::species_language_holder]

/proc/ethereal_name()
var/tempname = "[pick(GLOB.ethereal_names)] [random_capital_letter()]"
if(prob(65))
tempname += random_capital_letter()
return tempname
var/list/languages_to_pick_from = list()
for(var/language in holder.spoken_languages)
languages_to_pick_from[language] = 1

/proc/plasmaman_name()
return "[pick(GLOB.plasmaman_names)] \Roman[rand(1,99)]"
if(length(languages_to_pick_from) >= 2)
// Basically, if we have alternatives, don't pick common it's boring
languages_to_pick_from -= /datum/language/common

/proc/moth_name()
return "[pick(GLOB.moth_first)] [pick(GLOB.moth_last)]"
if(!include_all || length(languages_to_pick_from) <= 1)
return generate_random_name(gender, unique, languages_to_pick_from)

var/list/name_parts = list()
for(var/lang_type in shuffle(languages_to_pick_from))
name_parts += GLOB.language_datum_instances[lang_type].get_random_name(gender, name_count = 1, force_use_syllables = TRUE)
return jointext(name_parts, " ")

/**
* Generates a random name for the mob based on their gender or species (for humans)
*
* * unique - If the name should be unique, IE, avoid picking names that mobs already have.
*/
/mob/proc/generate_random_mob_name(unique)
return generate_random_name_species_based(gender, unique, /datum/species/human)

/mob/living/carbon/generate_random_mob_name(unique)
return generate_random_name_species_based(gender, unique, dna?.species?.type || /datum/species/human)

/mob/living/silicon/generate_random_mob_name(unique)
return generate_random_name(gender, unique, list(/datum/language/machine = 1))

/mob/living/basic/drone/generate_random_mob_name(unique)
return generate_random_name(gender, unique, list(/datum/language/machine = 1))

/mob/living/basic/bot/generate_random_mob_name(unique)
return generate_random_name(gender, unique, list(/datum/language/machine = 1))

/mob/living/simple_animal/bot/generate_random_mob_name(unique)
return generate_random_name(gender, unique, list(/datum/language/machine = 1))

GLOBAL_VAR(command_name)
/proc/command_name()
Expand Down Expand Up @@ -194,16 +249,11 @@ GLOBAL_DATUM(syndicate_code_response_regex, /regex)
if(1)//1 and 2 can only be selected once each to prevent more than two specific names/places/etc.
switch(rand(1,2))//Mainly to add more options later.
if(1)
if(names.len && prob(70))
if(length(names) && prob(70))
. += pick(names)
else
if(prob(10))
. += pick(lizard_name(MALE),lizard_name(FEMALE))
else
var/new_name = pick(pick(GLOB.first_names_male,GLOB.first_names_female))
new_name += " "
new_name += pick(GLOB.last_names)
. += new_name
. += generate_random_name()

if(2)
var/datum/job/job = pick(SSjob.joinable_occupations)
if(job)
Expand Down
17 changes: 17 additions & 0 deletions code/_globalvars/lists/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,23 @@ GLOBAL_LIST_INIT(language_types_by_name, init_language_types_by_name())
lang_list[initial(lang_type.name)] = lang_type
return lang_list

/// An assoc list of species IDs to type paths
GLOBAL_LIST_INIT(species_list, init_species_list())
/// List of all species prototypes to reference, assoc [type] = prototype
GLOBAL_LIST_INIT_TYPED(species_prototypes, /datum/species, init_species_prototypes())

/proc/init_species_list()
var/list/species_list = list()
for(var/datum/species/species_path as anything in subtypesof(/datum/species))
species_list[initial(species_path.id)] = species_path
return species_list

/proc/init_species_prototypes()
var/list/species_list = list()
for(var/species_type in subtypesof(/datum/species))
species_list[species_type] = new species_type()
return species_list

GLOBAL_LIST_EMPTY(sentient_disease_instances)

GLOBAL_LIST_EMPTY(latejoin_ai_cores)
Expand Down
4 changes: 2 additions & 2 deletions code/_globalvars/lists/names.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ GLOBAL_LIST_INIT(first_names, world.file2list("strings/names/first.txt"))
GLOBAL_LIST_INIT(first_names_male, world.file2list("strings/names/first_male.txt"))
GLOBAL_LIST_INIT(first_names_female, world.file2list("strings/names/first_female.txt"))
GLOBAL_LIST_INIT(last_names, world.file2list("strings/names/last.txt"))
GLOBAL_LIST_INIT(lizard_names_male, world.file2list("strings/names/lizard_male.txt"))
GLOBAL_LIST_INIT(lizard_names_female, world.file2list("strings/names/lizard_female.txt"))
GLOBAL_LIST_INIT(clown_names, world.file2list("strings/names/clown.txt"))
GLOBAL_LIST_INIT(mime_names, world.file2list("strings/names/mime.txt"))
GLOBAL_LIST_INIT(religion_names, world.file2list("strings/names/religion.txt"))
GLOBAL_LIST_INIT(carp_names, world.file2list("strings/names/carp.txt"))
GLOBAL_LIST_INIT(lizard_names_male, world.file2list("strings/names/lizard_male.txt"))
GLOBAL_LIST_INIT(lizard_names_female, world.file2list("strings/names/lizard_female.txt"))
GLOBAL_LIST_INIT(golem_names, world.file2list("strings/names/golem.txt"))
GLOBAL_LIST_INIT(moth_first, world.file2list("strings/names/moth_first.txt"))
GLOBAL_LIST_INIT(moth_last, world.file2list("strings/names/moth_last.txt"))
Expand Down
Loading
Loading