IPC Fixes & Nutrition Tweaks (#2037)

changes:

Only normal crew mobs equipped by the job master spawn with randomized nutrition.
Random nutrition's minimum nutrition value has been increased to 50%.
IPC Shells' skin tone and eye color now functions correctly.
Industrials' eyes now work correctly.
Added a nullcheck to random voidsuit spawn.
Fixes #1909.
Fixes #1646.
Fixes #1503.
Probably fixes #1740.
This commit is contained in:
Lohikar
2017-04-02 16:53:53 +03:00
committed by skull132
parent 9b5ba48a09
commit 80fb7af058
10 changed files with 58 additions and 30 deletions
+2
View File
@@ -27,6 +27,8 @@ var/list/organ_cache = list()
var/datum/species/species
var/emp_coeff = 1 //coefficient for damages taken by EMP, if the organ is robotic.
var/force_skintone = FALSE // If true, icon generation will skip is-robotic checks. Used for synthskin limbs.
/obj/item/organ/Destroy()
processing_objects -= src
if(!owner)
+2 -1
View File
@@ -939,7 +939,8 @@ Note that amputating the affected organ does in fact remove the infection from t
/*if(species && !(species.name in R.species_can_use && species.get_bodytype() != "Machine"))
R = basic_robolimb*/
if(R)
force_icon = R.icon
if (!force_skintone)
force_icon = R.icon
name = "[R.company] [initial(name)]"
desc = "[R.desc]"
if(R.paintable)
+13 -7
View File
@@ -30,7 +30,7 @@ var/global/list/limb_icon_cache = list()
s_tone = null
s_col = null
h_col = null
if(status & ORGAN_ROBOT)
if(status & ORGAN_ROBOT && !force_skintone)
return
if(!isnull(dna.GetUIValue(DNA_UI_SKIN_TONE)) && (species.appearance_flags & HAS_SKIN_TONE))
s_tone = dna.GetUIValue(DNA_UI_SKIN_TONE)
@@ -40,8 +40,14 @@ var/global/list/limb_icon_cache = list()
/obj/item/organ/external/head/sync_colour_to_human(var/mob/living/carbon/human/human)
..()
var/obj/item/organ/eyes/eyes = owner.internal_organs_by_name["eyes"]
if(eyes) eyes.update_colour()
var/obj/item/organ/eyes/eyes
if (species.vision_organ)
eyes = owner.internal_organs_by_name[species.vision_organ]
else
eyes = owner.internal_organs_by_name["eyes"]
if(eyes)
eyes.update_colour()
/obj/item/organ/external/head/removed()
get_icon()
@@ -53,9 +59,9 @@ var/global/list/limb_icon_cache = list()
overlays.Cut()
if(!owner || !owner.species)
return
if(owner.species.has_organ["eyes"])
var/obj/item/organ/eyes/eyes = owner.internal_organs_by_name["eyes"]
if(species.eyes)
if(owner.species.has_organ["eyes"] || (owner.species.vision_organ && owner.species.has_organ[species.vision_organ]))
var/obj/item/organ/eyes/eyes = owner.internal_organs_by_name["eyes"] || owner.internal_organs_by_name[species.vision_organ]
if(eyes && species.eyes)
var/icon/eyes_icon = new/icon('icons/mob/human_face.dmi', species.eyes)
if(eyes)
eyes_icon.Blend(rgb(eyes.eye_colour[1], eyes.eye_colour[2], eyes.eye_colour[3]), ICON_ADD)
@@ -113,7 +119,7 @@ var/global/list/limb_icon_cache = list()
if(skeletal)
mob_icon = new /icon('icons/mob/human_races/r_skeleton.dmi', "[icon_name][gender ? "_[gender]" : ""]")
else if (status & ORGAN_ROBOT)
else if (status & ORGAN_ROBOT && !force_skintone)
mob_icon = new /icon('icons/mob/human_races/robotic.dmi', "[icon_name][gender ? "_[gender]" : ""]")
else
if (status & ORGAN_MUTATED)
+26 -16
View File
@@ -94,15 +94,14 @@
owner.stat = 0
owner.visible_message("<span class='danger'>\The [owner] twitches visibly!</span>")
/obj/item/organ/optical_sensor
/obj/item/organ/eyes/optical_sensor
name = "optical sensor"
organ_tag = "optics"
parent_organ = "head"
icon = 'icons/obj/robot_component.dmi'
icon_state = "camera"
dead_icon = "camera_broken"
/obj/item/organ/optical_sensor/New()
/obj/item/organ/eyes/optical_sensor/New()
robotize()
..()
@@ -218,20 +217,9 @@
encased = null
emp_coeff = 0.5
/obj/item/organ/optical_sensorterminator
name = "optical sensor"
organ_tag = "optics"
parent_organ = "head"
icon = 'icons/obj/robot_component.dmi'
icon_state = "camera"
dead_icon = "camera_broken"
/obj/item/organ/eyes/optical_sensor/terminator
emp_coeff = 0.5
/obj/item/organ/optical_sensor/terminator/New()
robotize()
..()
/obj/item/organ/external/head/terminator/New()
robotize("Hephaestus Vulcanite Limb")
..()
@@ -405,6 +393,7 @@
max_damage = 50 //made same as arm, since it is not vital
min_broken_damage = 30
encased = null
force_skintone = TRUE
/obj/item/organ/external/head/shell/New()
robotize("Human Synthskin")
@@ -413,60 +402,81 @@
/obj/item/organ/external/chest/shell
dislocated = -1
encased = null
force_skintone = TRUE
/obj/item/organ/external/chest/shell/New()
robotize("Human Synthskin")
..()
/obj/item/organ/external/groin/shell
dislocated = -1
force_skintone = TRUE
/obj/item/organ/external/groin/shell/New()
robotize("Human Synthskin")
..()
/obj/item/organ/external/arm/shell
dislocated = -1
force_skintone = TRUE
/obj/item/organ/external/arm/shell/New()
robotize("Human Synthskin")
..()
/obj/item/organ/external/arm/right/shell
dislocated = -1
force_skintone = TRUE
/obj/item/organ/external/arm/right/shell/New()
robotize("Human Synthskin")
..()
/obj/item/organ/external/leg/shell
dislocated = -1
force_skintone = TRUE
/obj/item/organ/external/leg/shell/New()
robotize("Human Synthskin")
..()
/obj/item/organ/external/leg/right/shell
dislocated = -1
force_skintone = TRUE
/obj/item/organ/external/leg/right/shell/New()
robotize("Human Synthskin")
..()
/obj/item/organ/external/foot/shell
dislocated = -1
force_skintone = TRUE
/obj/item/organ/external/foot/shell/New()
robotize("Human Synthskin")
..()
/obj/item/organ/external/foot/right/shell
dislocated = -1
force_skintone = TRUE
/obj/item/organ/external/foot/right/shell/New()
robotize("Human Synthskin")
..()
/obj/item/organ/external/hand/shell
dislocated = -1
force_skintone = TRUE
/obj/item/organ/external/hand/shell/New()
robotize("Human Synthskin")
..()
/obj/item/organ/external/hand/right/shell
dislocated = -1
force_skintone = TRUE
/obj/item/organ/external/hand/right/shell/New()
robotize("Human Synthskin")
..()
..()