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

Slime People and IPC; Imitating Species Cosmetically. #27359

Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c570e5b
Pain
Spaghetti-bit Oct 1, 2024
b0e1e77
More transparency / alpha
Spaghetti-bit Oct 1, 2024
5e5b6e3
Vulp + Name override
Spaghetti-bit Oct 1, 2024
4114b67
more transparency alpha stuff
Spaghetti-bit Oct 1, 2024
d30735d
Reworks species subtype for slimepeople
Spaghetti-bit Oct 3, 2024
82659f6
Iteration 3...
Spaghetti-bit Oct 12, 2024
da8ba6e
Merge branch 'default' into TerminatorMachinesAndMorphlingSlimes
Spaghetti-bit Nov 14, 2024
4fa8dec
Me when initial
Spaghetti-bit Nov 14, 2024
1c7e807
60 - 61
Spaghetti-bit Nov 14, 2024
2cc5eea
Character.dm select query changes.
Spaghetti-bit Nov 15, 2024
9cbbcf3
Merge branch 'master' into TerminatorMachinesAndMorphlingSlimes
Spaghetti-bit Nov 15, 2024
2b63b99
61-62
Spaghetti-bit Nov 15, 2024
52c7836
The real 61-62
Spaghetti-bit Nov 15, 2024
1ebdbfb
Merge branch 'master' into TerminatorMachinesAndMorphlingSlimes
Spaghetti-bit Nov 15, 2024
d2b1971
Update to IPC imitation
Spaghetti-bit Nov 16, 2024
2b5614e
Merge branch 'TerminatorMachinesAndMorphlingSlimes' of https://github…
Spaghetti-bit Nov 16, 2024
0276079
Merge branch 'TerminatorMachinesAndMorphlingSlimes' of https://github…
Spaghetti-bit Jan 30, 2025
bec00d1
+63-64.sql
Spaghetti-bit Jan 30, 2025
9b9683f
Pain2
Spaghetti-bit Jan 30, 2025
19a8910
SQL
Spaghetti-bit Jan 30, 2025
f458218
Merge branch 'master' into TerminatorMachinesAndMorphlingSlimes
Spaghetti-bit Jan 30, 2025
87aa43b
Frankenstein monster fix
Spaghetti-bit Jan 30, 2025
5c159f9
Slimify! ...no longer applies to robotic limbs.
Spaghetti-bit Jan 30, 2025
6fc73d3
220 Alpha to 200
Spaghetti-bit Jan 30, 2025
dd4b80a
Ordering issue fix.
Spaghetti-bit Feb 2, 2025
e44583b
Last ordering issue.
Spaghetti-bit Feb 2, 2025
10cf4f4
Merge branch 'master' into TerminatorMachinesAndMorphlingSlimes
Spaghetti-bit Feb 8, 2025
69f4f7f
aa review, paradise_schema.sql
Spaghetti-bit Feb 8, 2025
c3c96c8
Apply suggestions from code review
Spaghetti-bit Feb 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions SQL/updates/60-61.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Updates the DB from 60 to 61 ~SpaghettiBit
# Adds a subtype race to be stored on character saves

# Add species_subtype after species
ALTER TABLE `characters`
ADD COLUMN `species_subtype` VARCHAR(7) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'None' AFTER `species`;
7 changes: 4 additions & 3 deletions code/__DEFINES/flags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,10 @@
#define HAS_ALT_HEADS (1<<11)
#define HAS_WING (1<<12)
#define HAS_BODYACC_COLOR (1<<13)
#define BALD (1<<14)
#define ALL_RPARTS (1<<15)
#define SHAVED (1<<16)
#define HAS_SPECIES_SUBTYPE (1<<14)
#define BALD (1<<15)
#define ALL_RPARTS (1<<16)
#define SHAVED (1<<17)

//Pre-baked combinations of the above body flags
#define HAS_BODY_ACCESSORY (HAS_TAIL | HAS_WING)
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/misc_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@
#define INVESTIGATE_HOTMIC "hotmic"

// The SQL version required by this version of the code
#define SQL_VERSION 60
#define SQL_VERSION 61

// Vending machine stuff
#define CAT_NORMAL (1<<0)
Expand Down
6 changes: 3 additions & 3 deletions code/datums/diseases/advance/symptoms/hair.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ BONUS
switch(A.stage)
if(1, 2, 3)
to_chat(H, "<span class='warning'>Your scalp itches.</span>")
head_organ.h_style = random_hair_style(H.gender, head_organ.dna.species.name)
head_organ.h_style = random_hair_style(H.gender, head_organ.dna.species.sprite_sheet_name)
else
to_chat(H, "<span class='warning'>Hair bursts forth from your scalp!</span>")
var/datum/sprite_accessory/tmp_hair_style = GLOB.hair_styles_full_list["Very Long Hair"]

if(head_organ.dna.species.name in tmp_hair_style.species_allowed) //If 'Very Long Hair' is a style the person's species can have, give it to them.
if(head_organ.dna.species.sprite_sheet_name in tmp_hair_style.species_allowed) //If 'Very Long Hair' is a style the person's species can have, give it to them.
head_organ.h_style = "Very Long Hair"
else //Otherwise, give them a random hair style.
head_organ.h_style = random_hair_style(H.gender, head_organ.dna.species.name)
head_organ.h_style = random_hair_style(H.gender, head_organ.dna.species.sprite_sheet_name)
H.update_hair()
2 changes: 1 addition & 1 deletion code/game/dna/dna2_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
var/list/available = list()
for(var/head_accessory in GLOB.head_accessory_styles_list)
var/datum/sprite_accessory/S = GLOB.head_accessory_styles_list[head_accessory]
if(!(head_organ.dna.species.name in S.species_allowed)) //If the user's head is not of a species the head accessory style allows, skip it. Otherwise, add it to the list.
if(!(head_organ.dna.species.sprite_sheet_name in S.species_allowed)) //If the user's head is not of a species the head accessory style allows, skip it. Otherwise, add it to the list.
continue
available += head_accessory
var/list/sorted = sortTim(available, GLOBAL_PROC_REF(cmp_text_asc))
Expand Down
4 changes: 2 additions & 2 deletions code/game/gamemodes/miniantags/tourist/tourist_arrivals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@
head_organ.sec_hair_colour = hair_c
M.change_eye_color(eye_c)
M.s_tone = skin_tone
head_organ.h_style = random_hair_style(M.gender, head_organ.dna.species.name)
head_organ.f_style = random_facial_hair_style(M.gender, head_organ.dna.species.name)
head_organ.h_style = random_hair_style(M.gender, head_organ.dna.species.sprite_sheet_name)
head_organ.f_style = random_facial_hair_style(M.gender, head_organ.dna.species.sprite_sheet_name)

M.regenerate_icons()
M.update_body()
Expand Down
6 changes: 3 additions & 3 deletions code/game/objects/structures/dresser.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
var/list/valid_underwear = list()
for(var/underwear in GLOB.underwear_list)
var/datum/sprite_accessory/S = GLOB.underwear_list[underwear]
if(!(H.dna.species.name in S.species_allowed))
if(!(H.dna.species.sprite_sheet_name in S.species_allowed))
continue
valid_underwear[underwear] = GLOB.underwear_list[underwear]
var/new_underwear = tgui_input_list(user, "Choose your underwear:", "Changing", valid_underwear)
Expand All @@ -32,7 +32,7 @@
var/list/valid_undershirts = list()
for(var/undershirt in GLOB.undershirt_list)
var/datum/sprite_accessory/S = GLOB.undershirt_list[undershirt]
if(!(H.dna.species.name in S.species_allowed))
if(!(H.dna.species.sprite_sheet_name in S.species_allowed))
continue
valid_undershirts[undershirt] = GLOB.undershirt_list[undershirt]
var/new_undershirt = tgui_input_list(user, "Choose your undershirt:", "Changing", valid_undershirts)
Expand All @@ -43,7 +43,7 @@
var/list/valid_sockstyles = list()
for(var/sockstyle in GLOB.socks_list)
var/datum/sprite_accessory/S = GLOB.socks_list[sockstyle]
if(!(H.dna.species.name in S.species_allowed))
if(!(H.dna.species.sprite_sheet_name in S.species_allowed))
continue
valid_sockstyles[sockstyle] = GLOB.socks_list[sockstyle]
var/new_socks = tgui_input_list(user, "Choose your socks:", "Changing", valid_sockstyles)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/awaymissions/mob_spawn.dm
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,12 @@
if(hair_style)
D.h_style = hair_style
else
D.h_style = random_hair_style(gender, D.dna.species.name)
D.h_style = random_hair_style(gender, D.dna.species.sprite_sheet_name)
D.hair_colour = rand_hex_color()
if(facial_hair_style)
D.f_style = facial_hair_style
else
D.f_style = random_facial_hair_style(gender, D.dna.species.name)
D.f_style = random_facial_hair_style(gender, D.dna.species.sprite_sheet_name)
D.facial_colour = rand_hex_color()
if(skin_tone)
H.s_tone = skin_tone
Expand Down
152 changes: 91 additions & 61 deletions code/modules/client/preference/character.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
var/e_colour = "#000000" //Eye color
var/alt_head = "None" //Alt head style.
var/species = "Human"
/// Used for DNA species to allow select species to imitate / morph into different species.
var/species_subtype = "None"
var/language = "None" //Secondary language
var/autohiss_mode = AUTOHISS_OFF //Species autohiss level. OFF, BASIC, FULL.
/// If a spawned cyborg should have an MMI, a positronic, or a robobrain. MMI by default
Expand Down Expand Up @@ -147,6 +149,7 @@
body_type=:body_type,
age=:age,
species=:species,
species_subtype=:species_subtype,
language=:language,
hair_colour=:h_colour,
secondary_hair_colour=:h_sec_colour,
Expand Down Expand Up @@ -210,6 +213,7 @@
"body_type" = body_type,
"age" = age,
"species" = species,
"species_subtype" = species_subtype,
"language" = language,
"h_colour" = h_colour,
"h_sec_colour" = h_sec_colour,
Expand Down Expand Up @@ -278,7 +282,7 @@

var/datum/db_query/query = SSdbcore.NewQuery({"
INSERT INTO characters (ckey, slot, OOC_Notes, real_name, name_is_always_random, gender,
age, species, language,
age, species, species_subtype, language,
hair_colour, secondary_hair_colour,
facial_hair_colour, secondary_facial_hair_colour,
skin_tone, skin_colour,
Expand All @@ -305,7 +309,7 @@
hair_gradient, hair_gradient_offset, hair_gradient_colour, hair_gradient_alpha, custom_emotes, runechat_color, cyborg_brain_type, body_type)
VALUES
(:ckey, :slot, :metadata, :name, :be_random_name, :gender,
:age, :species, :language,
:age, :species, :species_subtype, :language,
:h_colour, :h_sec_colour,
:f_colour, :f_sec_colour,
:s_tone, :s_colour,
Expand Down Expand Up @@ -341,6 +345,7 @@
"body_type" = body_type,
"age" = age,
"species" = species,
"species_subtype" = species_subtype,
"language" = language,
"h_colour" = h_colour,
"h_sec_colour" = h_sec_colour,
Expand Down Expand Up @@ -416,45 +421,45 @@
gender = query.item[4]
age = text2num(query.item[5])
species = query.item[6]
language = query.item[7]

h_colour = query.item[8]
h_sec_colour = query.item[9]
f_colour = query.item[10]
f_sec_colour = query.item[11]
s_tone = text2num(query.item[12])
s_colour = query.item[13]
m_colours = params2list(query.item[14])
hacc_colour = query.item[15]
h_style = query.item[16]
f_style = query.item[17]
m_styles = params2list(query.item[18])
ha_style = query.item[19]
alt_head = query.item[20]
e_colour = query.item[21]
underwear = query.item[22]
undershirt = query.item[23]
backbag = query.item[24]
b_type = query.item[25]
species_subtype = query.item[7]
language = query.item[8]
h_colour = query.item[9]
h_sec_colour = query.item[10]
f_colour = query.item[11]
f_sec_colour = query.item[12]
s_tone = text2num(query.item[13])
s_colour = query.item[14]
m_colours = params2list(query.item[15])
hacc_colour = query.item[16]
h_style = query.item[17]
f_style = query.item[18]
m_styles = params2list(query.item[19])
ha_style = query.item[20]
alt_head = query.item[21]
e_colour = query.item[22]
underwear = query.item[23]
undershirt = query.item[24]
backbag = query.item[25]
b_type = query.item[26]


//Jobs
alternate_option = text2num(query.item[26])
job_support_high = text2num(query.item[27])
job_support_med = text2num(query.item[28])
job_support_low = text2num(query.item[29])
job_medsci_high = text2num(query.item[30])
job_medsci_med = text2num(query.item[31])
job_medsci_low = text2num(query.item[32])
job_engsec_high = text2num(query.item[33])
job_engsec_med = text2num(query.item[34])
job_engsec_low = text2num(query.item[35])
alternate_option = text2num(query.item[27])
job_support_high = text2num(query.item[28])
job_support_med = text2num(query.item[29])
job_support_low = text2num(query.item[30])
job_medsci_high = text2num(query.item[31])
job_medsci_med = text2num(query.item[32])
job_medsci_low = text2num(query.item[33])
job_engsec_high = text2num(query.item[34])
job_engsec_med = text2num(query.item[35])
job_engsec_low = text2num(query.item[36])

//Miscellaneous
flavor_text = query.item[36]
med_record = query.item[37]
sec_record = query.item[38]
gen_record = query.item[39]
flavor_text = query.item[37]
med_record = query.item[38]
sec_record = query.item[39]
gen_record = query.item[40]
// Apparently, the preceding vars weren't always encoded properly...
if(findtext(flavor_text, "<")) // ... so let's clumsily check for tags!
flavor_text = html_encode(flavor_text)
Expand All @@ -464,29 +469,29 @@
sec_record = html_encode(sec_record)
if(findtext(gen_record, "<"))
gen_record = html_encode(gen_record)
disabilities = text2num(query.item[40])
player_alt_titles = params2list(query.item[41])
organ_data = params2list(query.item[42])
rlimb_data = params2list(query.item[43])
nanotrasen_relation = query.item[44]
speciesprefs = text2num(query.item[45])
disabilities = text2num(query.item[41])
player_alt_titles = params2list(query.item[42])
organ_data = params2list(query.item[43])
rlimb_data = params2list(query.item[44])
nanotrasen_relation = query.item[45]
speciesprefs = text2num(query.item[46])

//socks
socks = query.item[46]
body_accessory = query.item[47]
loadout_gear = query.item[48]
autohiss_mode = text2num(query.item[49])
socks = query.item[47]
body_accessory = query.item[48]
loadout_gear = query.item[49]
// Index [50] is the slot
h_grad_style = query.item[51]
h_grad_offset_x = query.item[52] // parsed down below
h_grad_colour = query.item[53]
h_grad_alpha = query.item[54]
var/custom_emotes_tmp = query.item[55]
runechat_color = query.item[56]
physique = query.item[57]
height = query.item[58]
cyborg_brain_type = query.item[59]
body_type = query.item[60]
autohiss_mode = text2num(query.item[51])
h_grad_style = query.item[52]
h_grad_offset_x = query.item[53] // parsed down below
h_grad_colour = query.item[54]
h_grad_alpha = query.item[55]
var/custom_emotes_tmp = query.item[56]
runechat_color = query.item[57]
physique = query.item[58]
height = query.item[59]
cyborg_brain_type = query.item[60]
body_type = query.item[61]

//Sanitize
var/datum/species/SP = GLOB.all_species[species]
Expand All @@ -501,6 +506,9 @@
species = "Human"
stack_trace("Character doesn't have a species, character name is [real_name]. Defaulting to human.")

if(isnull(species_subtype))
species_subtype = "None"

if(isnull(language))
language = "None"

Expand Down Expand Up @@ -823,19 +831,40 @@
//Icon-based species colour.
var/coloured_tail
if(current_species)
if(current_species.bodyflags & HAS_ICON_SKIN_TONE) //Handling species-specific icon-based skin tones by flagged race.
var/mob/living/carbon/human/H = new
H.dna.species = current_species
if(species_subtype != "None" && current_species.bodyflags & HAS_SPECIES_SUBTYPE && istype(current_species, /datum/species/slime))
var/datum/species/subtype_species = GLOB.all_species[species_subtype]
if(subtype_species)
current_species.sprite_sheet_name = subtype_species.sprite_sheet_name
current_species.icobase = subtype_species.icobase
current_species.tail = subtype_species.tail
current_species.wing = subtype_species.wing
current_species.eyes = subtype_species.eyes
current_species.scream_verb = subtype_species.scream_verb
current_species.male_scream_sound = subtype_species.male_scream_sound
current_species.female_scream_sound = subtype_species.female_scream_sound
current_species.default_headacc = subtype_species.default_headacc
current_species.default_bodyacc = subtype_species.default_bodyacc
current_species.male_cough_sounds = subtype_species.male_cough_sounds
current_species.female_cough_sounds = subtype_species.female_cough_sounds
current_species.male_sneeze_sound = subtype_species.male_sneeze_sound
current_species.female_sneeze_sound = subtype_species.female_sneeze_sound
current_species.bodyflags = subtype_species.bodyflags
current_species.bodyflags |= HAS_SKIN_COLOR | NO_EYES | HAS_SPECIES_SUBTYPE
var/mob/living/carbon/human/H = new
H.dna.species = current_species
if(current_species.bodyflags & HAS_SPECIES_SUBTYPE)
H.dna.species.updatespeciessubtype(H)
icobase = H.dna.species.icobase
else if(current_species.bodyflags & HAS_ICON_SKIN_TONE) //Handling species-specific icon-based skin tones by flagged race.
H.s_tone = s_tone
H.dna.species.updatespeciescolor(H, 0) //The mob's species wasn't set, so it's almost certainly different than the character's species at the moment. Thus, we need to be owner-insensitive.
var/obj/item/organ/external/chest/C = H.get_organ("chest")
icobase = C.icobase ? C.icobase : C.dna.species.icobase
if(H.dna.species.bodyflags & HAS_TAIL)
coloured_tail = H.tail ? H.tail : H.dna.species.tail

qdel(H)
else
icobase = current_species.icobase
qdel(H)
else
icobase = 'icons/mob/human_races/r_human.dmi'

Expand Down Expand Up @@ -1813,6 +1842,7 @@
/datum/character_save/proc/copy_to(mob/living/carbon/human/character)
var/datum/species/S = GLOB.all_species[species]
character.set_species(S.type, delay_icon_update = TRUE) // Yell at me if this causes everything to melt
character.species_subtype = species_subtype
if(be_random_name)
real_name = random_name(gender, species)

Expand Down
6 changes: 6 additions & 0 deletions code/modules/client/preference/link_processing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,12 @@

if(!(NS.autohiss_basic_map))
active_character.autohiss_mode = AUTOHISS_OFF
if("species_subtype")
if(S.bodyflags & HAS_SPECIES_SUBTYPE)
var/new_subtype = tgui_input_list(user, "Choose your character's species subtype:", "Character Preference", S.allowed_species_subtypes)
if(isnull(new_subtype))
return
active_character.species_subtype = new_subtype
if("speciesprefs")
active_character.speciesprefs = !active_character.speciesprefs //Starts 0, so if someone clicks the button up top there, this won't be 0 anymore. If they click it again, it'll go back to 0.
if("language")
Expand Down
2 changes: 2 additions & 0 deletions code/modules/client/preference/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ GLOBAL_LIST_INIT(special_role_times, list(
dat += "<b>Age:</b> <a href='byond://?_src_=prefs;preference=age;task=input'>[active_character.age]</a><br>"
dat += "<b>Body:</b> <a href='byond://?_src_=prefs;preference=all;task=random'>(&reg;)</a><br>"
dat += "<b>Species:</b> <a href='byond://?_src_=prefs;preference=species;task=input'>[active_character.species]</a><br>"
if(S.bodyflags & HAS_SPECIES_SUBTYPE)
dat += "<b>Species Sub-Type:</b> <a href='byond://?_src_=prefs;preference=species_subtype;task=input'>[active_character.species_subtype]</a><br>"
dat += "<b>Gender:</b> <a href='byond://?_src_=prefs;preference=gender'>[active_character.gender == MALE ? "Male" : (active_character.gender == FEMALE ? "Female" : "Genderless")]</a><br>"
dat += "<b>Body Type:</b> <a href='byond://?_src_=prefs;preference=body_type'>[active_character.body_type == MALE ? "Masculine" : "Feminine"]</a>"
dat += "<br>"
Expand Down
4 changes: 2 additions & 2 deletions code/modules/clothing/clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@

if(H.dna.species)
if(exclusive)
if(!(H.dna.species.name in species_restricted))
if(!(H.dna.species.sprite_sheet_name in species_restricted))
wearable = TRUE
else
if(H.dna.species.name in species_restricted)
if(H.dna.species.sprite_sheet_name in species_restricted)
wearable = TRUE

if(!wearable)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/customitems/item_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
return

var/datum/sprite_accessory/body_markings/tattoo/temp_tatt = GLOB.marking_styles_list[tattoo_icon]
if(!(target.dna.species.name in temp_tatt.species_allowed))
if(!(target.dna.species.sprite_sheet_name in temp_tatt.species_allowed))
to_chat(user, "<span class= 'notice'>You can't think of a way to make the [tattoo_name] design work on [target == user ? "your" : "[target]'s"] body type.</span>")
return

Expand Down
Loading