diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm
index ea698991..ed2c2d32 100644
--- a/code/game/objects/items/robot/robot_parts.dm
+++ b/code/game/objects/items/robot/robot_parts.dm
@@ -9,12 +9,12 @@
var/list/construction_cost = list("metal"=20000,"glass"=5000)
var/list/part = null
var/sabotaged = 0 //Emagging limbs can have repercussions when installed as prosthetics.
-
-
+
+
/obj/item/robot_parts/proc/attach_to_robot(mob/user as mob, obj/item/robot_parts/robot_suit/assembly as obj)
user << "\red This is not used to construct robots."
-
-
+
+
/obj/item/robot_parts/proc/move_into_robot(mob/user as mob, obj/item/robot_parts/robot_suit/assembly as obj)
user.drop_item()
src.loc = assembly
@@ -74,7 +74,7 @@
return
assembly.r_leg = src
move_into_robot(user,assembly)
-
+
/obj/item/robot_parts/chest
name = "robot torso"
@@ -95,7 +95,7 @@
return
assembly.chest = src
move_into_robot(user,assembly)
-
+
/obj/item/robot_parts/head
name = "robot head"
@@ -113,7 +113,7 @@
return
assembly.head = src
move_into_robot(user,assembly)
-
+
/obj/item/robot_parts/robot_suit
name = "robot endoskeleton"
@@ -147,7 +147,7 @@
src.overlays += "r_leg+o"
if(src.head)
src.overlays += "head+o"
-
+
/obj/item/robot_parts/robot_suit/proc/check_completion()
if(src.l_arm && src.r_arm)
@@ -156,16 +156,16 @@
feedback_inc("cyborg_frames_built",1)
return 1
return 0
-
-
+
+
/obj/item/robot_parts/robot_suit/proc/allowed_to_build(mob/user as mob, obj/item/device/mmi/brain as obj)
if(!check_completion()) // not complete? not allowed
- return
+ return
if(!check_allowed_to_install_brain(user,brain)) // not allowed to put the brain in there
return
return TRUE
-
-
+
+
/obj/item/robot_parts/robot_suit/proc/check_allowed_to_install_brain(mob/user as mob, obj/item/device/mmi/brain as obj)
if(!istype(loc,/turf))
user << "\red You can't put the [brain] in, the frame has to be standing on the ground to be perfectly precise."
@@ -193,8 +193,8 @@
user << "\red This [brain] does not seem to fit."
return
return TRUE
-
-
+
+
/obj/item/robot_parts/robot_suit/attackby(obj/item/W as obj, mob/user as mob)
..()
// HANDLE ED209 ASSEMBLY
@@ -229,14 +229,14 @@
create_robot(brain)
else // otherwise we're making a shell
create_shell(brain)
-
-
+
+
/obj/item/robot_parts/robot_suit/proc/create_robot(obj/item/device/mmi/brain as obj)
var/mob/living/silicon/robot/new_robot = new(get_turf(loc), unfinished = 1)
if(!new_robot) // something has gone poorly
return
// move the brain
- new_robot.mmi = brain
+ new_robot.mmi = brain
new_robot.invisibility = 0
new_robot.custom_name = created_name
new_robot.updatename("Default")
@@ -254,11 +254,10 @@
feedback_inc("cyborg_birth",1)
new_robot.Namepick()
del(src)
-
-
+
+
/obj/item/robot_parts/robot_suit/proc/create_shell(obj/item/device/mmi/brain as obj)
var/mob/living/carbon/human/machine/new_shell = new(src.loc)
- var/key=brain.brainmob.mind.key
brain.brainmob.mind.transfer_to(new_shell) // transfer brain
var/datum/organ/internal/brain/robot/brain_datum=new_shell.internal_organs_by_name["brain"] // put the brain in the head
brain_datum.machine_brain_type=brain.machine_brain_type
@@ -266,7 +265,7 @@
give_option_to_rename(new_shell)
del(brain)
del(src)
-
+
proc/give_option_to_rename(var/mob/living/carbon/human/new_shell)
spawn(0)
var/newname
@@ -297,7 +296,7 @@ proc/give_option_to_rename(var/mob/living/carbon/human/new_shell)
user << "\blue You insert the wire!"
return
-
+
/obj/item/robot_parts/head/attack_hand(mob/user)
var/obj/item/inactive_item = user.get_inactive_hand()
if (src==inactive_item) // if we are clicking on this in our hand
@@ -314,7 +313,7 @@ proc/give_option_to_rename(var/mob/living/carbon/human/new_shell)
src.camera = null
return
return ..()
-
+
/obj/item/robot_parts/head/attackby(obj/item/W as obj, mob/user as mob)
..()
@@ -346,7 +345,7 @@ proc/give_option_to_rename(var/mob/living/carbon/human/new_shell)
del(src)
return
return
-
+
/obj/item/robot_parts/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W,/obj/item/weapon/card/emag))
diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm
index a5ee273a..22594ca2 100644
--- a/code/modules/client/preferences.dm
+++ b/code/modules/client/preferences.dm
@@ -319,6 +319,7 @@ datum/preferences
//dat += "Skin pattern: Adjust
"
dat += "Needs Glasses: [disabilities == 0 ? "No" : "Yes"]
"
if (species=="Machine") // brain and covering type for shells
+ make_sure_we_have_a_brain_type_for_machines()
dat += "Brain Type: [machine_brain_type]
"
dat += "Exterior Coating: [isnull(covering_type) ? "None" : covering_type]
"
dat += "Limbs: Adjust
"
@@ -1100,8 +1101,6 @@ datum/preferences
if(new_age)
age = max(min( round(text2num(new_age)), AGE_MAX),AGE_MIN)
if("species")
- config.usealienwhitelist=0 // REMOVE ME
-
var/list/new_species = list("Human")
var/prev_species = species
var/whitelisted = 0
@@ -1129,6 +1128,9 @@ datum/preferences
b_hair = 0//hex2num(copytext(new_hair, 6, 8))
s_tone = 0
+
+ organ_data = list()
+
if("language")
var/languages_available
@@ -1260,12 +1262,15 @@ datum/preferences
var/new_brain = input(user, "Choose your brain.", "Character Preference") as null|anything in list("MMI", "Posibrain") // not differentiating brain species at the moment
if(new_brain)
machine_brain_type=new_brain
+ make_sure_we_have_a_brain_type_for_machines()
if("set_machine_covering")
var/new_coating = input(user, "Choose your exterior coating.", "Character Preference") as null|anything in get_limb_covering_names()
if(new_coating)
covering_type=(new_coating!="None" ? new_coating : null)
-
+ h_style = random_hair_style(gender, get_hair_species())
+ f_style = random_facial_hair_style(gender, get_hair_species())
+
if("limbs")
customize_limbs(user,species!="Machine")
@@ -1495,6 +1500,7 @@ datum/preferences
if (species=="Machine")
var/datum/organ/internal/brain/robot/brain_datum = character.get_organ("brain")
if (brain_datum) // sanity check
+ make_sure_we_have_a_brain_type_for_machines()
brain_datum.machine_brain_type=machine_brain_type // set the brain type
for (var/datum/organ/external/organ in character.organs) // provide default covering for shells
if (organ) // gotta make sure we're getting an actual organ here
@@ -1574,8 +1580,8 @@ datum/preferences
if (species!="Machine")
return species
var/head_coat=covering_type // we get the base coating
- if (organ_data["Head"]) // if we're customizing the head we should get their coating
- head_coat=organ_data["Head"][0]
+ if (organ_data["head"]) // if we're customizing the head we should get their coating
+ head_coat=organ_data["head"][1]
if (!head_coat) // no coating?
return
var/list/refs=get_limb_covering_references()
@@ -1647,6 +1653,7 @@ var/list/limb_connection_data
var/new_state = input(user, "What state do you wish the limb to be in?") as null|anything in (is_organic_species ? list("Normal","Amputated","Prosthesis") : list("Normal","Custom"))
if(!new_state)
return // cancel
+ var/hair_species=get_hair_species()
switch(new_state)
if("Normal")
organ_data-= limb
@@ -1664,4 +1671,13 @@ var/list/limb_connection_data
if(!isnull(limb_parent) && organ_data[limb_parent] == "amputated")
organ_data-=limb_parent
if("Custom")
- organ_data[limb] = custom_robot_limb(user) // robots have no dependencies
\ No newline at end of file
+ organ_data[limb] = custom_robot_limb(user) // robots have no dependencies
+ var/new_hair_species=get_hair_species()
+ if(hair_species!=new_hair_species)
+ h_style = random_hair_style(gender, new_hair_species)
+ f_style = random_facial_hair_style(gender, new_hair_species)
+
+/datum/preferences/proc/make_sure_we_have_a_brain_type_for_machines()
+ if (species=="Machine")
+ if(!machine_brain_type)
+ machine_brain_type="Posibrain"
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm
index 2840900b..ddfb8577 100644
--- a/code/modules/mob/living/carbon/human/species.dm
+++ b/code/modules/mob/living/carbon/human/species.dm
@@ -225,7 +225,11 @@
/datum/species/proc/get_organ_preview_icon(var/name, var/robot, var/gendered, var/gender_string, var/datum/preferences/preferences, var/datum/synthetic_limb_cover/covering, var/paint_colour)
var/icon_name = icobase
if (robot)
- icon_name = (istype(covering)) ? covering.main_icon : 'icons/mob/human_races/robotic.dmi'
+ if(istype(covering))
+ icon_name = covering.main_icon
+ else
+ icon_name = 'icons/mob/human_races/robotic.dmi'
+ paint_colour = null // no paint for bare robots
var/state_name = name
if (gendered)
state_name+="_[gender_string]"
@@ -256,7 +260,8 @@
var/tail_state=null
if (!(isnull(preview_coverings["groin"])))
var/datum/synthetic_limb_cover/covering=preview_coverings["groin"]
- tail_state=covering.tail
+ if(covering.tail)
+ tail_state="[covering.tail]_s"
if(tail)
tail_state="[tail]_s"
if(tail_state)
@@ -264,6 +269,7 @@
result.Blend(rgb(preferences.r_hair,preferences.g_hair,preferences.b_hair),ICON_ADD)
return result
+
/datum/species/proc/get_eyes_preview_icon(var/list/preview_coverings,var/datum/preferences/preferences)
var/eye_state=null
if (!(isnull(preview_coverings["head"])))