From 6b4cf7783b0bbe9a6ee38401c116260ffa298214 Mon Sep 17 00:00:00 2001 From: CollenN Date: Sat, 5 Jul 2014 22:47:50 -0400 Subject: [PATCH 1/2] Spawned humans have DNA, strip panel is better Fixes #4044 Fixes #4064 Spawned humans now have DNA, along with a randomized appearance and name, making them similar to monkeys turned into humans. Strip panel is now more organized and doesn't have any duplicated lines. --- code/modules/admin/create_mob.dm | 14 ++++++ code/modules/admin/topic.dm | 5 +++ code/modules/mob/living/carbon/human/human.dm | 45 ++++++------------- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/code/modules/admin/create_mob.dm b/code/modules/admin/create_mob.dm index a723fe37956..425837d9e84 100644 --- a/code/modules/admin/create_mob.dm +++ b/code/modules/admin/create_mob.dm @@ -7,3 +7,17 @@ create_mob_html = replacetext(create_mob_html, "null /* object types */", "\"[mobjs]\"") user << browse(replacetext(create_mob_html, "/* ref src */", "\ref[src]"), "window=create_mob;size=425x475") + +/proc/randomize_human(mob/living/carbon/human/H) + H.gender = pick(MALE, FEMALE) + H.real_name = random_name(H.gender) + H.name = H.real_name + H.dna.generate_uni_identity(H) + H.underwear = random_underwear(H.gender) + H.skin_tone = random_skin_tone() + H.hair_style = random_hair_style(H.gender) + H.facial_hair_style = random_facial_hair_style(H.gender) + H.hair_color = random_short_color() + H.facial_hair_color = H.hair_color + H.eye_color = random_eye_color() + H.update_icons() \ No newline at end of file diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 25510344edc..858392f1c8a 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1540,6 +1540,11 @@ if(istype(O,/mob)) var/mob/M = O M.real_name = obj_name + if(ishuman(O)) + var/mob/living/carbon/human/H = O + create_dna(H) + ready_dna(H) + randomize_human(H) if (number == 1) log_admin("[key_name(usr)] created a [english_list(paths)]") diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 773c4bf2b23..5be97835908 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -305,17 +305,17 @@ dat += "
Head: [(head && !(head.flags&ABSTRACT)) ? head : "Empty"]" if(slot_wear_mask in obscured) - dat += "
Mask: Obscured by [head]" + dat += "
Mask: Obscured" else dat += "
Mask: [(wear_mask && !(wear_mask.flags&ABSTRACT)) ? wear_mask : "Empty"]" if(slot_glasses in obscured) - dat += "
Eyes: Obscured by [head]" + dat += "
Eyes: Obscured" else dat += "
Eyes: [(glasses && !(glasses.flags&ABSTRACT)) ? glasses : "Empty"]" if(slot_ears in obscured) - dat += "
Ears: Obscured by [head]" + dat += "
Ears: Obscured" else dat += "
Ears: [(ears && !(ears.flags&ABSTRACT)) ? ears : "Empty"]" @@ -328,34 +328,26 @@ dat += "
[TAB][TAB]↳[internal ? "Disable Internals" : "Set Internals"]" if(slot_shoes in obscured) - dat += "
Shoes: Obscured by [wear_suit]" + dat += "
Shoes: Obscured" else dat += "
Shoes: [(shoes && !(shoes.flags&ABSTRACT)) ? shoes : "Empty"]" if(slot_gloves in obscured) - dat += "
Gloves: Obscured by [wear_suit]" + dat += "
Gloves: Obscured" else dat += "
Gloves: [(gloves && !(gloves.flags&ABSTRACT)) ? gloves : "Empty"]" if(slot_w_uniform in obscured) - dat += "
Uniform: Obscured by [wear_suit]" + dat += "
Uniform: Obscured" else dat += "
Uniform: [(w_uniform && !(w_uniform.flags&ABSTRACT)) ? w_uniform : "Empty"]" - if(w_uniform || dna.species.nojumpsuit) - dat += "
[TAB]↳Belt: [(belt && !(belt.flags&ABSTRACT)) ? belt : "Empty"]" - if(has_breathable_mask && istype(belt, /obj/item/weapon/tank)) - dat += "
[TAB][TAB]↳[internal ? "Disable Internals" : "Set Internals"]" - dat += "
[TAB]↳Pockets: [(l_store && !(l_store.flags&ABSTRACT)) ? "Left (Full)" : "Left (Empty)"]" - dat += " [(r_store && !(r_store.flags&ABSTRACT)) ? "Right (Full)" : "Right (Empty)"]" - dat += "
[TAB]↳ID: [(wear_id && !(wear_id.flags&ABSTRACT)) ? wear_id : "Empty"]" - - if(dna) - if(dna.species.nojumpsuit) - dat += "
ID: [(wear_id && !(wear_id.flags&ABSTRACT)) ? wear_id : "Nothing"]" - else if(w_uniform) - dat += "
ID: [(wear_id && !(wear_id.flags&ABSTRACT)) ? wear_id : "Nothing"]" - else if(w_uniform) - dat += "
ID: [(wear_id && !(wear_id.flags&ABSTRACT)) ? wear_id : "Nothing"]" + if((w_uniform) || (dna && dna.species.nojumpsuit)) + dat += "
[TAB]↳Belt: [(belt && !(belt.flags&ABSTRACT)) ? belt : "Empty"]" + if(has_breathable_mask && istype(belt, /obj/item/weapon/tank)) + dat += "
[TAB][TAB]↳[internal ? "Disable Internals" : "Set Internals"]" + dat += "
[TAB]↳Pockets: [(l_store && !(l_store.flags&ABSTRACT)) ? "Left (Full)" : "Left (Empty)"]" + dat += " [(r_store && !(r_store.flags&ABSTRACT)) ? "Right (Full)" : "Right (Empty)"]" + dat += "
[TAB]↳ID: [(wear_id && !(wear_id.flags&ABSTRACT)) ? wear_id : "Empty"]" dat += "
" @@ -364,17 +356,6 @@ if(legcuffed) dat += "
Legcuffed" - if(dna) - if(dna.species.nojumpsuit) - dat += "

Left Pocket ([(l_store && !(l_store.flags&ABSTRACT)) ? "Full" : "Empty"])" - dat += " - Right Pocket ([(r_store && !(r_store.flags&ABSTRACT)) ? "Full" : "Empty"])" - else if(w_uniform) - dat += "

Left Pocket ([(l_store && !(l_store.flags&ABSTRACT)) ? "Full" : "Empty"])" - dat += " - Right Pocket ([(r_store && !(r_store.flags&ABSTRACT)) ? "Full" : "Empty"])" - else if(w_uniform) - dat += "

Left Pocket ([(l_store && !(l_store.flags&ABSTRACT)) ? "Full" : "Empty"])" - dat += " - Right Pocket ([(r_store && !(r_store.flags&ABSTRACT)) ? "Full" : "Empty"])" - dat += {"

Close From ccaef08fdc47d223bc5e422b5e80fc8e508d7211 Mon Sep 17 00:00:00 2001 From: CollenN Date: Mon, 7 Jul 2014 14:02:58 -0400 Subject: [PATCH 2/2] Moves stuff to New() Alright, I tested it, and this worked, so... --- code/modules/admin/topic.dm | 5 ----- code/modules/mob/living/carbon/human/human.dm | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 858392f1c8a..25510344edc 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1540,11 +1540,6 @@ if(istype(O,/mob)) var/mob/M = O M.real_name = obj_name - if(ishuman(O)) - var/mob/living/carbon/human/H = O - create_dna(H) - ready_dna(H) - randomize_human(H) if (number == 1) log_admin("[key_name(usr)] created a [english_list(paths)]") diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 5be97835908..07b11b9e08b 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -30,6 +30,11 @@ for(var/i=0;i<7;i++) // 2 for medHUDs and 5 for secHUDs hud_list += image('icons/mob/hud.dmi', src, "hudunknown") + // for spawned humans; overwritten by other code + create_dna(src) + ready_dna(src) + randomize_human(src) + ..() /mob/living/carbon/human/Destroy()