Changing a person's appearance now works better

Also fixes some problems on changing gender
This commit is contained in:
Crazylemon64
2016-02-29 19:31:29 -08:00
parent 38075f4beb
commit 7e510dfdb6
9 changed files with 40 additions and 21 deletions

View File

@@ -346,11 +346,11 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(record_found)//If they have a record we can determine a few things.
new_character.real_name = record_found.fields["name"]
new_character.gender = record_found.fields["sex"]
new_character.change_gender(record_found.fields["sex"])
new_character.age = record_found.fields["age"]
new_character.b_type = record_found.fields["b_type"]
else
new_character.gender = pick(MALE,FEMALE)
new_character.change_gender(pick(MALE,FEMALE))
var/datum/preferences/A = new()
A.real_name = G_found.real_name
A.copy_to(new_character)

View File

@@ -1593,7 +1593,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
character.sec_record = sec_record
character.gen_record = gen_record
character.gender = gender
character.change_gender(gender)
character.age = age
character.b_type = b_type
@@ -1694,7 +1694,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
if(character.gender in list(PLURAL, NEUTER))
if(isliving(src)) //Ghosts get neuter by default
message_admins("[key_name_admin(character)] has spawned with their gender as plural or neuter. Please notify coders.")
character.gender = MALE
character.change_gender(MALE)
/datum/preferences/proc/open_load_dialog(mob/user)

View File

@@ -22,9 +22,18 @@
return
src.gender = gender
reset_hair()
update_body()
var/datum/sprite_accessory/hair/current_hair = hair_styles_list[h_style]
if(current_hair.gender != NEUTER && current_hair.gender != src.gender)
reset_head_hair()
var/datum/sprite_accessory/hair/current_fhair = facial_hair_styles_list[f_style]
if(current_fhair.gender != NEUTER && current_fhair.gender != src.gender)
reset_facial_hair()
update_dna()
sync_organ_dna(assimilate = 0)
update_body()
return 1
/mob/living/carbon/human/proc/change_hair(var/hair_style)
@@ -58,8 +67,11 @@
return 1
/mob/living/carbon/human/proc/reset_hair()
reset_head_hair()
reset_facial_hair()
/mob/living/carbon/human/proc/reset_head_hair()
var/list/valid_hairstyles = generate_valid_hairstyles()
var/list/valid_facial_hairstyles = generate_valid_facial_hairstyles()
if(valid_hairstyles.len)
h_style = pick(valid_hairstyles)
@@ -67,13 +79,15 @@
//this shouldn't happen
h_style = "Bald"
update_hair()
/mob/living/carbon/human/proc/reset_facial_hair()
var/list/valid_facial_hairstyles = generate_valid_facial_hairstyles()
if(valid_facial_hairstyles.len)
f_style = pick(valid_facial_hairstyles)
else
//this shouldn't happen
f_style = "Shaved"
update_hair()
update_fhair()
/mob/living/carbon/human/proc/change_eye_color(var/red, var/green, var/blue)

View File

@@ -146,9 +146,15 @@
var/obj/item/organ/O = pick(organs)
O.trace_chemicals[A.name] = 100
/mob/living/carbon/human/proc/sync_organ_dna()
/*
When assimilate is 1, organs that have a different UE will still have their DNA overriden by that of the host
Otherwise, this restricts itself to organs that share the UE of the host.
*/
/mob/living/carbon/human/proc/sync_organ_dna(var/assimilate = 1)
var/list/all_bits = internal_organs|organs
for(var/obj/item/organ/O in all_bits)
if(!assimilate && O.dna.unique_enzymes != dna.unique_enzymes)
continue
O.set_dna(dna)
/*

View File

@@ -177,11 +177,10 @@ Please contact me on #coderbus IRC. ~Carn x
if(istype(I)) overlays += I
else
icon = stand_icon
if(overlays.len != overlays_standing.len)
overlays.Cut()
overlays.Cut()
for(var/thing in overlays_standing)
if(thing) overlays += thing
for(var/thing in overlays_standing)
if(thing) overlays += thing
update_transform()

View File

@@ -504,7 +504,7 @@
user << "The rune fizzles uselessly. There is no spirit nearby."
return
var/mob/living/carbon/human/golem/G = new /mob/living/carbon/human/golem
if(prob(50)) G.gender = "female"
G.change_gender(pick(MALE,FEMALE))
G.loc = src.loc
G.key = ghost.key
G << "You are an adamantine golem. You move slowly, but are highly resistant to heat and cold as well as blunt trauma. You are unable to wear clothes, but can still use most tools. Serve [user], and assist them in completing their goals at any cost."