IPC Organs - Initial Commit

The basics are all here, but there are complications with making surgery code function with them properly. To be tested and troubeshot, and patched.
This commit is contained in:
skull132
2015-10-13 13:36:02 +03:00
parent 2cf2eb2014
commit cf810e7c9d
9 changed files with 271 additions and 56 deletions
+43 -11
View File
@@ -801,7 +801,17 @@
proc/stabilize_body_temperature()
if (species.flags & IS_SYNTHETIC)
bodytemperature += species.synth_temp_gain //just keep putting out heat.
//TODO: Test these constants
var/temperatureModifier = 0 //all IS_SYNTHETIC species -need- radiators
if(!has_organ("radiator"))
temperatureModifier = 25
else
var/datum/organ/internal/Radiator = internal_organs_by_name["radiator"]
if(Radiator.is_broken())
temperatureModifier = 25
else if(Radiator.is_bruised())
temperatureModifier = 17
bodytemperature += species.synth_temp_gain + temperatureModifier //just keep putting out heat.
return
var/body_temperature_difference = species.body_temperature - bodytemperature
@@ -1432,15 +1442,26 @@
if(1) healths.icon_state = "health6"
if(2) healths.icon_state = "health7"
else
//switch(health - halloss)
switch(100 - ((species && species.flags & NO_PAIN & !IS_SYNTHETIC) ? 0 : traumatic_shock))
if(100 to INFINITY) healths.icon_state = "health0"
if(80 to 100) healths.icon_state = "health1"
if(60 to 80) healths.icon_state = "health2"
if(40 to 60) healths.icon_state = "health3"
if(20 to 40) healths.icon_state = "health4"
if(0 to 20) healths.icon_state = "health5"
else healths.icon_state = "health6"
var/numb = 0
if (species && (species.flags & IS_SYNTHETIC))
var/datum/organ/internal/machine/Diagnosis_unit = internal_organs_by_name["diagnosis unit"]
if (Diagnosis_unit.is_broken())
numb = 1
else if (Diagnosis_unit.is_bruised() && prob(35))
numb = 1
if (numb)
healths.icon_state = "health_numb"
else
//switch(health - halloss)
switch(100 - ((species && species.flags & NO_PAIN & !IS_SYNTHETIC) ? 0 : traumatic_shock))
if(100 to INFINITY) healths.icon_state = "health0"
if(80 to 100) healths.icon_state = "health1"
if(60 to 80) healths.icon_state = "health2"
if(40 to 60) healths.icon_state = "health3"
if(20 to 40) healths.icon_state = "health4"
if(0 to 20) healths.icon_state = "health5"
else healths.icon_state = "health6"
if(nutrition_icon)
switch(nutrition)
@@ -1483,7 +1504,18 @@
else bodytemp.icon_state = "temp-4"
else
var/temp_step
if (bodytemperature >= species.body_temperature)
var/numb = 0
if (species && (species.flags & IS_SYNTHETIC))
var/datum/organ/internal/machine/Diagnosis_unit = internal_organs_by_name["diagnosis unit"]
if (Diagnosis_unit.is_broken())
numb = 1
else if (Diagnosis_unit.is_bruised() && prob(35))
numb = 1
if (numb)
bodytemp.icon_state = "temp_numb"
else if (bodytemperature >= species.body_temperature)
temp_step = (species.heat_level_1 - species.body_temperature)/4
if (bodytemperature >= species.heat_level_1)
+23 -19
View File
@@ -201,17 +201,17 @@
// Grabs the window recieved when you click-drag someone onto you.
/datum/species/proc/get_inventory_dialogue(var/mob/living/carbon/human/H)
return
//Used by xenos understanding larvae and dionaea understanding nymphs.
/datum/species/proc/can_understand(var/mob/other)
return
/datum/species/proc/blend_preview_icon(var/icon/main_icon,var/datum/preferences/preferences,var/paint_colour)
if(paint_colour)
main_icon.Blend(paint_colour, ICON_ADD)
return
return
if(flags & HAS_SKIN_COLOR)
main_icon.Blend(rgb(preferences.r_skin, preferences.g_skin, preferences.b_skin), ICON_ADD)
return
@@ -220,8 +220,8 @@
main_icon.Blend(rgb(preferences.s_tone, preferences.s_tone, preferences.s_tone), ICON_ADD)
else
main_icon.Blend(rgb(-preferences.s_tone, -preferences.s_tone, -preferences.s_tone), ICON_SUBTRACT)
/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)
@@ -236,7 +236,7 @@
var/icon/result = new /icon(icon_name,state_name)
blend_preview_icon(result,preferences,paint_colour)
return result
/datum/species/proc/get_is_preview_organ_robotic(var/name,var/datum/preferences/preferences)
if (flags & IS_SYNTHETIC)
@@ -245,7 +245,7 @@
var/list/organ_robotic_info=preferences.organ_data[name]
if (istype(organ_robotic_info))
return TRUE
/datum/species/proc/get_preview_organ_covering(var/name,var/datum/preferences/preferences)
if (name in preferences.organ_data)
var/list/organ_robotic_info=preferences.organ_data[name]
@@ -254,8 +254,8 @@
if (preferences.species=="Machine")
if (preferences.covering_type)
return list(preferences.covering_type,rgb(preferences.r_skin,preferences.g_skin,preferences.b_skin))
/datum/species/proc/get_tail_preview_icon(var/list/preview_coverings,var/datum/preferences/preferences)
var/tail_state=null
if (!(isnull(preview_coverings["groin"])))
@@ -268,8 +268,8 @@
var/icon/result = new/icon("icon" = 'icons/effects/species.dmi', "icon_state" = tail_state)
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"])))
@@ -280,13 +280,13 @@
var/icon/result = new/icon('icons/mob/human_face.dmi',eye_state)
result.Blend(rgb(preferences.r_eyes,preferences.g_eyes,preferences.b_eyes),ICON_ADD)
return result
/* This function takes a preferences object and generates a complete body and hair icon for that set of preferences. It's needlessly complicated
and duplicates a lot of what's going on in update_icons. The two systems should be combined somehow, possibly by using a 'visual identity' object
that could be created from either a living human or a preferences object and then passing that to a single render function, but I'll leave that
that could be created from either a living human or a preferences object and then passing that to a single render function, but I'll leave that
exercise for another day.
See code\modules\mob\new_player\preferences_setup.dm for where it's used.
See code\modules\mob\new_player\preferences_setup.dm for where it's used.
- jack_fractal*/
/datum/species/proc/create_body_preview_icon(var/datum/preferences/preferences)
var/gender_string = (preferences.gender==FEMALE) ? "f" : "m"
@@ -578,7 +578,7 @@ See code\modules\mob\new_player\preferences_setup.dm for where it's used.
rarity_value = 2
eyes = "blank_eyes"
brute_mod = 0.5
brute_mod = 1 //Fuck yo brute mod.
burn_mod = 1
warning_low_pressure = 50
@@ -602,6 +602,10 @@ See code\modules\mob\new_player\preferences_setup.dm for where it's used.
has_organ = list(
"heart" = /datum/organ/internal/heart,
"brain" = /datum/organ/internal/brain/robot,
"eyes" = /datum/organ/internal/eyes/robot,
"radiator" = /datum/organ/internal/machine/radiator,
"chemical containment" = /datum/organ/internal/machine/bladder,
"diagnosis unit" = /datum/organ/internal/machine/diagnosis_unit,
)
/datum/species/machine/create_organs(var/mob/living/carbon/human/H)
..()
@@ -609,8 +613,8 @@ See code\modules\mob\new_player\preferences_setup.dm for where it's used.
if (istype(brain_datum))
if (isnull(brain_datum.machine_brain_type))
brain_datum.machine_brain_type="Posibrain"
/datum/species/bug
name = "Vaurca"
name_plural = "varucae"
@@ -778,4 +782,4 @@ See code\modules\mob\new_player\preferences_setup.dm for where it's used.
if(slot_back in equip_slots)
equip_slots |= slot_in_backpack
equip_slots |= slot_legcuffed
equip_slots |= slot_legcuffed
@@ -147,6 +147,7 @@
var/brute = 0
var/burn = 0
var/icon_state_broken = "broken"
var/obj/item/organ/organ_type = null // for shells. Only define if this can be placed inside an IPC during organ replacement surgery.
// TODO: actual icons ;)
/obj/item/robot_parts/robot_component/binary_communication_device
@@ -168,7 +169,8 @@
name = "camera"
icon_state = "camera"
icon_state_broken = "camera_broken"
organ_type = /obj/item/organ/eyes/robot
/obj/item/robot_parts/robot_component/law_computer
name = "law computer"
icon_state = "radio"
@@ -178,12 +180,25 @@
name = "diagnosis unit"
icon_state = "analyser"
icon_state_broken = "analyser_broken"
organ_type = /obj/item/organ/machine/diagnosis_unit
/obj/item/robot_parts/robot_component/radio
name = "radio"
icon_state = "radio"
icon_state_broken = "radio_broken"
/obj/item/robot_parts/robot_component/radiator
name = "radiator"
icon_state = "radiator"
icon_state_broken = "radiator_broken"
organ_type = /obj/item/organ/machine/radiator
/obj/item/robot_parts/robot_component/bladder
name = "chemical containment"
icon_state = "bladder"
icon_state_broken = "bladder_broken"
organ_type = /obj/item/organ/machine/bladder
//
//Robotic Component Analyser, basically a health analyser for robots
//
@@ -227,7 +242,7 @@
user.show_message("\t Damage Specifics: <font color='#FFA500'>[BU]</font> - <font color='red'>[BR]</font>")
if(M.tod && M.stat == DEAD)
user.show_message("\blue Time of Disable: [M.tod]")
if (istype(M, /mob/living/silicon/robot))
var/mob/living/silicon/robot/H = M
var/list/damaged = H.get_damaged_components(1,1,1)
@@ -245,7 +260,7 @@
user.show_message("\blue \t Components are OK.",1)
if(H.emagged && prob(5))
user.show_message("\red \t ERROR: INTERNAL SYSTEMS COMPROMISED",1)
if (ishuman(M) && (M:species.flags & IS_SYNTHETIC))
var/mob/living/carbon/human/H = M
var/list/damaged = H.get_damaged_organs(1,1)
@@ -258,8 +273,8 @@
(org.burn_dam > 0) ? "<font color='#FFA500'>[org.burn_dam]</font>" :0),1)
else
user.show_message("\blue \t Components are OK.",1)
user.show_message("\blue Operating Temperature: [M.bodytemperature-T0C]&deg;C ([M.bodytemperature*1.8-459.67]&deg;F)", 1)
src.add_fingerprint(user)
return