diff --git a/code/game/dna/dna2_helpers.dm b/code/game/dna/dna2_helpers.dm index 4aa0453a52d..781c3a1d230 100644 --- a/code/game/dna/dna2_helpers.dm +++ b/code/game/dna/dna2_helpers.dm @@ -161,9 +161,9 @@ H.s_tone = 35 - dna.GetUIValueRange(DNA_UI_SKIN_TONE, 220) // Value can be negative. if (dna.GetUIState(DNA_UI_GENDER)) - H.gender = FEMALE + H.change_gender(FEMALE, 0) else - H.gender = MALE + H.change_gender(MALE, 0) //Hair var/hair = dna.GetUIValueRange(DNA_UI_HAIR_STYLE,hair_styles_list.len) diff --git a/code/game/dna/genes/monkey.dm b/code/game/dna/genes/monkey.dm index dcf6cbd5250..5d410c634b4 100644 --- a/code/game/dna/genes/monkey.dm +++ b/code/game/dna/genes/monkey.dm @@ -10,7 +10,7 @@ /datum/dna/gene/monkey/activate(var/mob/living/carbon/human/H, var/connected, var/flags) if(!istype(H,/mob/living/carbon/human)) return - if(issmall(H)) + if(issmall(H)) return for(var/obj/item/W in H) if(istype(W,/obj/item/organ)) @@ -18,13 +18,13 @@ if(istype(W,/obj/item/weapon/implant)) continue H.unEquip(W) - + H.regenerate_icons() H.SetStunned(1) H.canmove = 0 H.icon = null H.invisibility = 101 - + var/atom/movable/overlay/animation = new /atom/movable/overlay(H.loc) animation.icon_state = "blank" animation.icon = 'icons/mob/mob.dmi' @@ -32,7 +32,7 @@ flick("h2monkey", animation) sleep(22) qdel(animation) - + H.SetStunned(0) H.invisibility = initial(H.invisibility) @@ -65,7 +65,7 @@ H.canmove = 0 H.icon = null H.invisibility = 101 - + var/atom/movable/overlay/animation = new /atom/movable/overlay(H.loc) animation.icon_state = "blank" animation.icon = 'icons/mob/mob.dmi' @@ -82,6 +82,8 @@ return H.set_species(H.species.greater_form) + H.real_name = H.dna.real_name + H.name = H.real_name if(H.hud_used) H.hud_used.instantiate() diff --git a/code/game/dna/genes/vg_powers.dm b/code/game/dna/genes/vg_powers.dm index 215b07158b9..da98fde4544 100644 --- a/code/game/dna/genes/vg_powers.dm +++ b/code/game/dna/genes/vg_powers.dm @@ -184,9 +184,9 @@ Obviously, requires DNA2. var/new_gender = alert(usr, "Please select gender.", "Character Generation", "Male", "Female") if (new_gender) if(new_gender == "Male") - M.gender = MALE + M.change_gender(MALE) else - M.gender = FEMALE + M.change_gender(FEMALE) M.regenerate_icons() M.check_dna() diff --git a/code/game/objects/items/changestone.dm b/code/game/objects/items/changestone.dm index 242a17074e8..0074303a88f 100644 --- a/code/game/objects/items/changestone.dm +++ b/code/game/objects/items/changestone.dm @@ -9,9 +9,9 @@ obj/item/changestone/attack_hand(var/mob/user as mob) var/mob/living/carbon/human/H = user if(!H.gloves) if (H.gender == FEMALE) - H.gender = MALE + H.change_gender(MALE) else - H.gender = FEMALE + H.change_gender(FEMALE) H.dna.ready_dna(H) H.update_body() ..() diff --git a/code/game/objects/items/weapons/dnascrambler.dm b/code/game/objects/items/weapons/dnascrambler.dm index b0e5b0149d9..e654e4ff941 100644 --- a/code/game/objects/items/weapons/dnascrambler.dm +++ b/code/game/objects/items/weapons/dnascrambler.dm @@ -34,10 +34,15 @@ user << "\red You failed to inject [M.name]." proc/injected(var/mob/living/carbon/target, var/mob/living/carbon/user) - target.generate_name() - target.real_name = target.name - scramble(1, target, 100) + target.generate_name() + if(istype(target, /mob/living/carbon/human)) + var/mob/living/carbon/human/H = target + H.sync_organ_dna(1) + H.update_body(0) + H.reset_hair() // No more winding up with hairstyles you're not supposed to have, and blowing your cover + H.dna.ResetUIFrom(H) + target.update_icons() log_attack("[key_name(user)] injected [key_name(target)] with the [name]") log_game("[key_name_admin(user)] injected [key_name_admin(target)] with the [name]") diff --git a/code/game/response_team.dm b/code/game/response_team.dm index a8f5a8bba79..fab7bdcbbf1 100644 --- a/code/game/response_team.dm +++ b/code/game/response_team.dm @@ -153,9 +153,9 @@ var/send_emergency_team var/new_gender = alert(usr, "Please select your gender.", "Character Generation", "Male", "Female") if (new_gender) if(new_gender == "Male") - M.gender = MALE + M.change_gender(MALE) else - M.gender = FEMALE + M.change_gender(FEMALE) M.set_species("Human",1) M.dna.ready_dna(M) diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index e428f25fc39..970ebfee0ef 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -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) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index a8f97d08947..c7874465210 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -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) diff --git a/code/modules/mob/living/carbon/human/appearance.dm b/code/modules/mob/living/carbon/human/appearance.dm index 26612b66ed1..6cd20e79b19 100644 --- a/code/modules/mob/living/carbon/human/appearance.dm +++ b/code/modules/mob/living/carbon/human/appearance.dm @@ -17,14 +17,24 @@ reset_hair() return 1 -/mob/living/carbon/human/proc/change_gender(var/gender) +/mob/living/carbon/human/proc/change_gender(var/gender, var/update_dna = 1) if(src.gender == gender) return src.gender = gender - reset_hair() + + 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() + + if(update_dna) + update_dna() + sync_organ_dna(assimilate = 0) update_body() - update_dna() return 1 /mob/living/carbon/human/proc/change_hair(var/hair_style) @@ -58,8 +68,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 +80,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) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 87e8ea264ce..fcc778d27f3 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -44,7 +44,7 @@ if(!delay_ready_dna && dna) dna.ready_dna(src) dna.real_name = real_name - sync_organ_dna() //this shouldn't be necessaaaarrrryyyyyyyy + sync_organ_dna(1) if(species) species.handle_dna(src) @@ -1406,6 +1406,8 @@ /mob/living/carbon/human/generate_name() name = species.makeName(gender,src) real_name = name + if(dna) + dna.real_name = name return name /mob/living/carbon/human/proc/handle_embedded_objects() diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index c83c35bd61b..460d2a96772 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -146,10 +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) - O.set_dna(dna) + if(assimilate || O.dna.unique_enzymes == dna.unique_enzymes) + O.set_dna(dna) /* Given the name of an organ, returns the external organ it's contained in diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 00443ac86ff..0e6a7bd33f9 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -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() @@ -286,7 +285,7 @@ var/global/list/damage_icon_parts = list() else //BEGIN CACHED ICON GENERATION. var/obj/item/organ/external/chest = get_organ("chest") - base_icon = chest.get_icon() + base_icon = chest.get_icon(skeleton) for(var/obj/item/organ/external/part in organs) var/icon/temp = part.get_icon(skeleton) diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 96876651d31..f77e2ff7ed5 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -477,7 +477,7 @@ domutcheck(new_character) new_character.dna.UpdateSE() - new_character.sync_organ_dna() //just fucking incase I guess + new_character.sync_organ_dna(1) //just fucking incase I guess // Do the initial caching of the player's body icons. new_character.force_update_limbs() diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm index 00954e16dc9..42d5ce1b93e 100644 --- a/code/modules/research/xenobiology/xenobiology.dm +++ b/code/modules/research/xenobiology/xenobiology.dm @@ -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."