From a398f64b66f475130c8839407156dafa4d949ded Mon Sep 17 00:00:00 2001
From: Fermi <>
Date: Thu, 19 Sep 2019 15:33:40 +0100
Subject: [PATCH] Okay
---
code/modules/mob/living/taste.dm | 6 ++---
.../research/designs/medical_designs.dm | 22 +++++++++++++++++++
code/modules/research/techweb/all_nodes.dm | 13 +++++++++--
code/modules/surgery/organs/ears.dm | 22 ++++++++++++++++++-
code/modules/surgery/organs/lungs.dm | 17 +++++++-------
code/modules/surgery/organs/tongue.dm | 2 +-
.../reagents/chemistry/reagents/healing.dm | 4 ++--
7 files changed, 69 insertions(+), 17 deletions(-)
diff --git a/code/modules/mob/living/taste.dm b/code/modules/mob/living/taste.dm
index 282fe0a716..8b0c54653c 100644
--- a/code/modules/mob/living/taste.dm
+++ b/code/modules/mob/living/taste.dm
@@ -43,7 +43,7 @@
.=..()
if ((from.pH > 12.5) || (from.pH < 1.5))
to_chat(src, "You taste chemical burns!")
- T.adjustTongueLoss(src, 4)
+ T.applyOrganDamage(5)
if(istype(T, /obj/item/organ/tongue/cybernetic))
to_chat(src, "Your tongue moves on it's own in response to the liquid.")
say("The pH is appropriately [round(from.pH, 1)].")
@@ -52,13 +52,13 @@
switch(from.pH)
if(11.5 to INFINITY)
to_chat(src, "You taste a strong alkaline flavour!")
- T.adjustTongueLoss(src, 1)
+ T.applyOrganDamage(1)
if(8.5 to 11.5)
to_chat(src, "You taste a sort of soapy tone in the mixture.")
if(2.5 to 5.5)
to_chat(src, "You taste a sort of acid tone in the mixture.")
if(-INFINITY to 2.5)
to_chat(src, "You taste a strong acidic flavour!")
- T.adjustTongueLoss(src, 1)
+ T.applyOrganDamage(1)
#undef DEFAULT_TASTE_SENSITIVITY
diff --git a/code/modules/research/designs/medical_designs.dm b/code/modules/research/designs/medical_designs.dm
index d3db4f75b3..05f9ee6d07 100644
--- a/code/modules/research/designs/medical_designs.dm
+++ b/code/modules/research/designs/medical_designs.dm
@@ -702,6 +702,28 @@
category = list("Medical Designs")
departmental_flags = DEPARTMENTAL_FLAG_MEDICAL
+/datum/design/cybernetic_ears
+ name = "Cybernetic Ears"
+ desc = "A pair of cybernetic ears."
+ id = "cybernetic_ears"
+ build_type = PROTOLATHE | MECHFAB
+ construction_time = 30
+ materials = list(/datum/material/iron = 250, /datum/material/glass = 400)
+ build_path = /obj/item/organ/ears/cybernetic
+ category = list("Misc", "Medical Designs")
+ departmental_flags = DEPARTMENTAL_FLAG_MEDICAL
+
+/datum/design/cybernetic_ears_u
+ name = "Upgraded Cybernetic Ears"
+ desc = "A pair of upgraded cybernetic ears."
+ id = "cybernetic_ears_u"
+ build_type = PROTOLATHE | MECHFAB
+ construction_time = 40
+ materials = list(/datum/material/iron = 500, /datum/material/glass = 500, /datum/material/silver = 500)
+ build_path = /obj/item/organ/ears/cybernetic/upgraded
+ category = list("Misc", "Medical Designs")
+ departmental_flags = DEPARTMENTAL_FLAG_MEDICAL
+
/////////////////////
///Surgery Designs///
/////////////////////
diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm
index 3721e7943e..4db27394d6 100644
--- a/code/modules/research/techweb/all_nodes.dm
+++ b/code/modules/research/techweb/all_nodes.dm
@@ -517,8 +517,17 @@
display_name = "Cybernetic Organs"
description = "We have the technology to rebuild him."
prereq_ids = list("adv_biotech")
- design_ids = list("cybernetic_heart", "cybernetic_liver", "cybernetic_liver_u", "cybernetic_lungs", "cybernetic_lungs_u", "cybernetic_tongue")
- research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500)
+ design_ids = list("cybernetic_ears", "cybernetic_heart", "cybernetic_liver", "cybernetic_lungs", "cybernetic_tongue")
+ research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 1000)
+ export_price = 5000
+
+/datum/techweb_node/cyber_organs_upgraded
+ id = "cyber_organs_upgraded"
+ display_name = "Upgraded Cybernetic Organs"
+ description = "We have the technology to upgrade him."
+ prereq_ids = list("cyber_organs")
+ design_ids = list("cybernetic_ears_u", "cybernetic_heart_u", "cybernetic_liver_u", "cybernetic_lungs_u")
+ research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 1500)
export_price = 5000
/datum/techweb_node/cyber_implants
diff --git a/code/modules/surgery/organs/ears.dm b/code/modules/surgery/organs/ears.dm
index 30cd7d30f3..bc71a5cc95 100644
--- a/code/modules/surgery/organs/ears.dm
+++ b/code/modules/surgery/organs/ears.dm
@@ -116,4 +116,24 @@
name = "tin ears"
desc = "The robust ears of a bronze golem. "
damage_multiplier = 0.1 //STRONK
- bang_protect = 1 //Fear me weaklings.
+ bang_protect = 1 //Fear me weaklings.
+
+/obj/item/organ/ears/cybernetic
+ name = "cybernetic ears"
+ icon_state = "ears-c"
+ desc = "a basic cybernetic designed to mimic the operation of ears."
+ damage_multiplier = 0.9
+ organ_flags = ORGAN_SYNTHETIC
+
+/obj/item/organ/ears/cybernetic/upgraded
+ name = "upgraded cybernetic ears"
+ icon_state = "ears-c-u"
+ desc = "an advanced cybernetic ear, surpassing the performance of organic ears"
+ damage_multiplier = 0.5
+This conversation was marked as resolved by ExcessiveUseOfCobblestone
+
+/obj/item/organ/ears/cybernetic/emp_act(severity)
+ . = ..()
+ if(. & EMP_PROTECT_SELF)
+ return
+ damage += 40/severity
diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm
index 4c791c91f2..94243b1eda 100644
--- a/code/modules/surgery/organs/lungs.dm
+++ b/code/modules/surgery/organs/lungs.dm
@@ -73,27 +73,28 @@
//TODO: lung health affects lung function
/obj/item/organ/lungs/onDamage(damage_mod) //damage might be too low atm.
+ cached_damage = damage
if (maxHealth == INFINITY)
return
- if(damage+damage_mod < 0)
- damage = 0
+ if(cached_damage+damage_mod < 0)
+ cached_damage = 0
return
- damage += damage_mod
- if ((damage / maxHealth) > 1)
+ cached_damage += damage_mod
+ if ((cached_damage/ maxHealth) > 1)
to_chat(owner, "You feel your lungs collapse within your chest as you gasp for air, unable to inflate them anymore!")
owner.emote("gasp")
SSblackbox.record_feedback("tally", "fermi_chem", 1, "Lungs lost")
//qdel(src) - Handled elsewhere for now.
- else if ((damage / maxHealth) > 0.75)
+ else if ((cached_damage / maxHealth) > 0.75)
to_chat(owner, "It's getting really hard to breathe!!")
owner.emote("gasp")
owner.Dizzy(3)
- else if ((damage / maxHealth) > 0.5)
+ else if ((cached_damage / maxHealth) > 0.5)
owner.Dizzy(2)
to_chat(owner, "Your chest is really starting to hurt.")
owner.emote("cough")
- else if ((damage / maxHealth) > 0.2)
+ else if ((cached_damage / maxHealth) > 0.2)
to_chat(owner, "You feel an ache within your chest.")
owner.emote("cough")
owner.Dizzy(1)
@@ -540,4 +541,4 @@
/obj/item/organ/lungs/yamerol/on_life()
..()
- damage += 2 //Yamerol lungs are temporary
\ No newline at end of file
+ damage += 2 //Yamerol lungs are temporary
diff --git a/code/modules/surgery/organs/tongue.dm b/code/modules/surgery/organs/tongue.dm
index be56a1387b..91a29db813 100644
--- a/code/modules/surgery/organs/tongue.dm
+++ b/code/modules/surgery/organs/tongue.dm
@@ -30,7 +30,7 @@
/obj/item/organ/tongue/proc/handle_speech(datum/source, list/speech_args)
-/obj/item/organ/tongue/proc/adjustTongueLoss(mob/living/carbon/M, damage_mod)
+/obj/item/organ/tongue/proc/onDamage(damage_mod)
if (maxHealth == "alien")
return
if (maxHealth == "bone")
diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm
index 3cbccfd2cd..9a5a2a9247 100644
--- a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm
+++ b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm
@@ -16,7 +16,7 @@
var/obj/item/organ/lungs/L = C.getorganslot(ORGAN_SLOT_LUNGS)
if(T)
- T.adjustTongueLoss(C, -2)//Fix the inputs me!
+ T.applyOrganDamage(-2)
if(L)
C.adjustOrganLoss(ORGAN_SLOT_LUNGS, -5)
C.adjustOxyLoss(-2)
@@ -86,7 +86,7 @@
var/obj/item/organ/lungs/L = C.getorganslot(ORGAN_SLOT_LUNGS)
if(T)
- T.adjustTongueLoss(C, 1)
+ T.applyOrganDamage(1)
if(L)
C.adjustOrganLoss(ORGAN_SLOT_LUNGS, 4)
C.adjustOxyLoss(3)