From 6ec6c90aad230aabc2b53f387f5de967ed0576e7 Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Sun, 26 Feb 2017 05:30:36 -0800 Subject: [PATCH] Allows IPCs to express themselves as a gender again --- code/modules/client/preference/preferences.dm | 17 +++++++++++------ .../mob/living/carbon/human/appearance.dm | 4 ++-- code/modules/mob/living/carbon/human/human.dm | 3 +++ code/modules/nano/modules/human_appearance.dm | 1 + nano/templates/appearance_changer.tmpl | 3 +++ 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/code/modules/client/preference/preferences.dm b/code/modules/client/preference/preferences.dm index 73d099c7cdc..19bf5d26966 100644 --- a/code/modules/client/preference/preferences.dm +++ b/code/modules/client/preference/preferences.dm @@ -246,7 +246,6 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts if(!user || !user.client) return update_preview_icon() - var/datum/species/S = all_species[species] user << browse_rsc(preview_icon_front, "previewicon.png") user << browse_rsc(preview_icon_side, "previewicon2.png") @@ -280,8 +279,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts dat += "You are banned from using custom names and appearances. \ You can continue to adjust your characters, but you will be randomised once you join the game.\
" - if(S.has_gender) - dat += "Gender: [gender == MALE ? "Male" : "Female"]" + dat += "Gender: [gender == MALE ? "Male" : (gender == FEMALE ? "Female" : "Genderless")]" dat += "
" dat += "Age: [age]
" dat += "Body: (®)
" @@ -1282,8 +1280,8 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts species = input("Please select a species", "Character Generation", null) in new_species var/datum/species/NS = all_species[species] if(prev_species != species) - if(S.has_gender != NS.has_gender) - gender = (NS.has_gender ? pick(MALE,FEMALE) : PLURAL) + if(NS.has_gender && gender == PLURAL) + gender = pick(MALE,FEMALE) var/datum/robolimb/robohead if(species == "Machine") var/head_model = "[!rlimb_data["head"] ? "Morpheus Cyberkinetics" : rlimb_data["head"]]" @@ -1916,7 +1914,14 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts if("gender") if(!S.has_gender) - gender = PLURAL + var/newgender = input(user, "Choose Gender:") as null|anything in list("Male", "Female", "Genderless") + switch(newgender) + if("Male") + gender = MALE + if("Female") + gender = FEMALE + if("Genderless") + gender = PLURAL else if(gender == MALE) gender = FEMALE diff --git a/code/modules/mob/living/carbon/human/appearance.dm b/code/modules/mob/living/carbon/human/appearance.dm index ad1ab28c435..3cedf2d1f3f 100644 --- a/code/modules/mob/living/carbon/human/appearance.dm +++ b/code/modules/mob/living/carbon/human/appearance.dm @@ -16,7 +16,7 @@ /mob/living/carbon/human/proc/change_gender(var/new_gender, var/update_dna = 1) var/obj/item/organ/external/head/H = organs_by_name["head"] - if(gender == new_gender) + if(gender == new_gender || (gender == PLURAL && species.has_gender)) return gender = new_gender @@ -488,4 +488,4 @@ valid_alt_heads += alternate_head - return valid_alt_heads \ No newline at end of file + return valid_alt_heads diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index c3cec37da1a..2b19dcb7780 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1483,6 +1483,7 @@ /mob/living/carbon/human/proc/set_species(var/new_species, var/default_colour, var/delay_icon_update = 0) var/datum/species/oldspecies = species + var/datum/species/NS = all_species[new_species] if(!dna) if(!new_species) new_species = "Human" @@ -1502,6 +1503,8 @@ if(species.default_language) remove_language(species.default_language) + if(gender == PLURAL && NS.has_gender) + change_gender(pick(MALE,FEMALE)) species.handle_pre_change(src) species = all_species[new_species] diff --git a/code/modules/nano/modules/human_appearance.dm b/code/modules/nano/modules/human_appearance.dm index 21636465d4a..95738cd6354 100644 --- a/code/modules/nano/modules/human_appearance.dm +++ b/code/modules/nano/modules/human_appearance.dm @@ -223,6 +223,7 @@ data["specimen"] = owner.species.name data["gender"] = owner.gender + data["has_gender"] = owner.species.has_gender data["change_race"] = can_change(APPEARANCE_RACE) if(data["change_race"]) var/species[0] diff --git a/nano/templates/appearance_changer.tmpl b/nano/templates/appearance_changer.tmpl index 47a3ce113e2..5e705b2fe46 100644 --- a/nano/templates/appearance_changer.tmpl +++ b/nano/templates/appearance_changer.tmpl @@ -19,6 +19,9 @@
{{:helper.link('Male', null, { 'gender' : 'male'}, null, data.gender == 'male' ? 'selected' : null)}} {{:helper.link('Female', null, { 'gender' : 'female'}, null, data.gender == 'female' ? 'selected' : null)}} + {{if !data.has_gender}} + {{:helper.link('Genderless', null, { 'gender' : 'plural'}, null, data.gender == 'plural' ? 'selected' : null)}} + {{/if}}
{{/if}}