Merge branch 'master' of https://github.com/Citadel-Station-13/Citadel-Station-13 into Ghommie-cit156
This commit is contained in:
@@ -3,7 +3,21 @@
|
||||
icon_state = "appendix"
|
||||
zone = BODY_ZONE_PRECISE_GROIN
|
||||
slot = ORGAN_SLOT_APPENDIX
|
||||
var/inflamed = 0
|
||||
healing_factor = STANDARD_ORGAN_HEALING
|
||||
decay_factor = STANDARD_ORGAN_DECAY
|
||||
|
||||
now_failing = "<span class='warning'>An explosion of pain erupts in your lower right abdomen!</span>"
|
||||
now_fixed = "<span class='info'>The pain in your abdomen has subsided.</span>"
|
||||
|
||||
var/inflamed
|
||||
|
||||
/obj/item/organ/appendix/on_life()
|
||||
..()
|
||||
if(!(organ_flags & ORGAN_FAILING))
|
||||
return
|
||||
var/mob/living/carbon/M = owner
|
||||
if(M)
|
||||
M.adjustToxLoss(4, TRUE, TRUE) //forced to ensure people don't use it to gain tox as slime person
|
||||
|
||||
/obj/item/organ/appendix/update_icon()
|
||||
if(inflamed)
|
||||
@@ -16,7 +30,7 @@
|
||||
/obj/item/organ/appendix/Remove(mob/living/carbon/M, special = 0)
|
||||
for(var/datum/disease/appendicitis/A in M.diseases)
|
||||
A.cure()
|
||||
inflamed = 1
|
||||
inflamed = TRUE
|
||||
update_icon()
|
||||
..()
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
playsound(get_turf(owner), 'sound/mecha/mechmove03.ogg', 50, 1)
|
||||
|
||||
/obj/item/organ/cyberimp/arm/ui_action_click()
|
||||
if(crit_fail || (!holder && !contents.len))
|
||||
if(crit_fail || (organ_flags & ORGAN_FAILING) || (!holder && !contents.len))
|
||||
to_chat(owner, "<span class='warning'>The implant doesn't respond. It seems to be broken...</span>")
|
||||
return
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
. = ..()
|
||||
if(. & EMP_PROTECT_SELF)
|
||||
return
|
||||
if(prob(30/severity) && owner && !crit_fail)
|
||||
if(prob(30/severity) && owner && !(organ_flags & ORGAN_FAILING))
|
||||
Retract()
|
||||
owner.visible_message("<span class='danger'>A loud bang comes from [owner]\'s [zone == BODY_ZONE_R_ARM ? "right" : "left"] arm!</span>")
|
||||
playsound(get_turf(owner), 'sound/weapons/flashbang.ogg', 100, 1)
|
||||
@@ -154,6 +154,7 @@
|
||||
owner.IgniteMob()
|
||||
owner.adjustFireLoss(25)
|
||||
crit_fail = 1
|
||||
organ_flags |= ORGAN_FAILING
|
||||
|
||||
|
||||
/obj/item/organ/cyberimp/arm/gun/laser
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
|
||||
/obj/item/organ/cyberimp/chest/thrusters/proc/toggle(silent = FALSE)
|
||||
if(!on)
|
||||
if(crit_fail)
|
||||
if(crit_fail || (organ_flags & ORGAN_FAILING))
|
||||
if(!silent)
|
||||
to_chat(owner, "<span class='warning'>Your thrusters set seems to be broken!</span>")
|
||||
return 0
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
name = "cybernetic implant"
|
||||
desc = "A state-of-the-art implant that improves a baseline's functionality."
|
||||
status = ORGAN_ROBOTIC
|
||||
organ_flags = ORGAN_SYNTHETIC
|
||||
var/implant_color = "#FFFFFF"
|
||||
var/implant_overlay
|
||||
var/syndicate_implant = FALSE //Makes the implant invisible to health analyzers and medical HUDs.
|
||||
@@ -102,7 +103,7 @@
|
||||
|
||||
/obj/item/organ/cyberimp/brain/anti_stun/on_life()
|
||||
..()
|
||||
if(crit_fail)
|
||||
if(crit_fail || !(organ_flags & ORGAN_FAILING))
|
||||
return
|
||||
owner.adjustStaminaLoss(-3.5) //Citadel edit, makes it more useful in Stamina based combat
|
||||
if(owner.AmountStun() > STUN_SET_AMOUNT)
|
||||
@@ -112,13 +113,15 @@
|
||||
|
||||
/obj/item/organ/cyberimp/brain/anti_stun/emp_act(severity)
|
||||
. = ..()
|
||||
if(crit_fail || . & EMP_PROTECT_SELF)
|
||||
if(crit_fail || (organ_flags & ORGAN_FAILING) || . & EMP_PROTECT_SELF)
|
||||
return
|
||||
crit_fail = TRUE
|
||||
organ_flags |= ORGAN_FAILING
|
||||
addtimer(CALLBACK(src, .proc/reboot), 90 / severity)
|
||||
|
||||
/obj/item/organ/cyberimp/brain/anti_stun/proc/reboot()
|
||||
crit_fail = FALSE
|
||||
organ_flags &= ~ORGAN_FAILING
|
||||
|
||||
|
||||
//[[[[MOUTH]]]]
|
||||
|
||||
@@ -17,9 +17,10 @@
|
||||
if(starting_organ)
|
||||
insert_organ(new starting_organ(src))
|
||||
|
||||
/obj/item/autosurgeon/proc/insert_organ(var/obj/item/I)
|
||||
/obj/item/autosurgeon/proc/insert_organ(var/obj/item/organ/I)
|
||||
storedorgan = I
|
||||
I.forceMove(src)
|
||||
I.organ_flags |= ORGAN_FROZEN //Stops decay
|
||||
name = "[initial(name)] ([storedorgan.name])"
|
||||
|
||||
/obj/item/autosurgeon/attack_self(mob/user)//when the object it used...
|
||||
@@ -125,4 +126,4 @@
|
||||
/obj/item/autosurgeon/womb
|
||||
desc = "A single use autosurgeon that contains a womb. A screwdriver can be used to remove it, but implants can't be placed back in."
|
||||
uses = 1
|
||||
starting_organ = /obj/item/organ/genital/womb
|
||||
starting_organ = /obj/item/organ/genital/womb
|
||||
|
||||
@@ -6,6 +6,14 @@
|
||||
slot = ORGAN_SLOT_EARS
|
||||
gender = PLURAL
|
||||
|
||||
healing_factor = STANDARD_ORGAN_HEALING
|
||||
decay_factor = STANDARD_ORGAN_DECAY
|
||||
|
||||
low_threshold_passed = "<span class='info'>Your ears begin to resonate with an internal ring sometimes.</span>"
|
||||
now_failing = "<span class='warning'>You are unable to hear at all!</span>"
|
||||
now_fixed = "<span class='info'>Noise slowly begins filling your ears once more.</span>"
|
||||
low_threshold_cleared = "<span class='info'>The ringing in your ears has died down.</span>"
|
||||
|
||||
// `deaf` measures "ticks" of deafness. While > 0, the person is unable
|
||||
// to hear anything.
|
||||
var/deaf = 0
|
||||
@@ -23,17 +31,26 @@
|
||||
/obj/item/organ/ears/on_life()
|
||||
if(!iscarbon(owner))
|
||||
return
|
||||
..()
|
||||
var/mob/living/carbon/C = owner
|
||||
if((damage < maxHealth) && (organ_flags & ORGAN_FAILING)) //ear damage can be repaired from the failing condition
|
||||
organ_flags &= ~ORGAN_FAILING
|
||||
// genetic deafness prevents the body from using the ears, even if healthy
|
||||
if(HAS_TRAIT(C, TRAIT_DEAF))
|
||||
deaf = max(deaf, 1)
|
||||
else if(ear_damage < UNHEALING_EAR_DAMAGE) // if higher than UNHEALING_EAR_DAMAGE, no natural healing occurs.
|
||||
ear_damage = max(ear_damage - 0.05, 0)
|
||||
else if(!(organ_flags & ORGAN_FAILING)) // if this organ is failing, do not clear deaf stacks.
|
||||
deaf = max(deaf - 1, 0)
|
||||
if(prob(damage / 20) && (damage > low_threshold))
|
||||
adjustEarDamage(0, 4)
|
||||
SEND_SOUND(C, sound('sound/weapons/flash_ring.ogg'))
|
||||
to_chat(C, "<span class='warning'>The ringing in your ears grows louder, blocking out any external noises for a moment.</span>")
|
||||
else if((organ_flags & ORGAN_FAILING) && (deaf == 0))
|
||||
deaf = 1 //stop being not deaf you deaf idiot
|
||||
|
||||
/obj/item/organ/ears/proc/restoreEars()
|
||||
deaf = 0
|
||||
ear_damage = 0
|
||||
organ_flags &= ~ORGAN_FAILING
|
||||
|
||||
var/mob/living/carbon/C = owner
|
||||
|
||||
@@ -99,4 +116,23 @@
|
||||
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
|
||||
|
||||
/obj/item/organ/ears/cybernetic/emp_act(severity)
|
||||
. = ..()
|
||||
if(. & EMP_PROTECT_SELF)
|
||||
return
|
||||
damage += 40/severity
|
||||
|
||||
@@ -6,6 +6,19 @@
|
||||
slot = ORGAN_SLOT_EYES
|
||||
gender = PLURAL
|
||||
|
||||
healing_factor = STANDARD_ORGAN_HEALING
|
||||
decay_factor = STANDARD_ORGAN_DECAY
|
||||
maxHealth = 0.5 * STANDARD_ORGAN_THRESHOLD //half the normal health max since we go blind at 30, a permanent blindness at 50 therefore makes sense unless medicine is administered
|
||||
high_threshold = 0.3 * STANDARD_ORGAN_THRESHOLD //threshold at 30
|
||||
low_threshold = 0.15 * STANDARD_ORGAN_THRESHOLD //threshold at 15
|
||||
|
||||
low_threshold_passed = "<span class='info'>Distant objects become somewhat less tangible.</span>"
|
||||
high_threshold_passed = "<span class='info'>Everything starts to look a lot less clear.</span>"
|
||||
now_failing = "<span class='warning'>Darkness envelopes you, as your eyes go blind!</span>"
|
||||
now_fixed = "<span class='info'>Color and shapes are once again perceivable.</span>"
|
||||
high_threshold_cleared = "<span class='info'>Your vision functions passably once more.</span>"
|
||||
low_threshold_cleared = "<span class='info'>Your vision is cleared of any ailment.</span>"
|
||||
|
||||
var/sight_flags = 0
|
||||
var/see_in_dark = 2
|
||||
var/eye_damage = 0
|
||||
@@ -15,9 +28,12 @@
|
||||
var/flash_protect = 0
|
||||
var/see_invisible = SEE_INVISIBLE_LIVING
|
||||
var/lighting_alpha
|
||||
var/damaged = FALSE //damaged indicates that our eyes are undergoing some level of negative effect
|
||||
|
||||
/obj/item/organ/eyes/Insert(mob/living/carbon/M, special = FALSE, drop_if_replaced = FALSE)
|
||||
..()
|
||||
if(damage == initial(damage))
|
||||
clear_eye_trauma()
|
||||
if(ishuman(owner))
|
||||
var/mob/living/carbon/human/HMN = owner
|
||||
old_eye_color = HMN.eye_color
|
||||
@@ -32,7 +48,9 @@
|
||||
M.update_tint()
|
||||
owner.update_sight()
|
||||
|
||||
|
||||
/obj/item/organ/eyes/Remove(mob/living/carbon/M, special = 0)
|
||||
clear_eye_trauma()
|
||||
..()
|
||||
if(ishuman(M) && eye_color)
|
||||
var/mob/living/carbon/human/HMN = M
|
||||
@@ -41,6 +59,34 @@
|
||||
M.update_tint()
|
||||
M.update_sight()
|
||||
|
||||
/obj/item/organ/eyes/on_life()
|
||||
..()
|
||||
var/mob/living/carbon/C = owner
|
||||
//since we can repair fully damaged eyes, check if healing has occurred
|
||||
if((organ_flags & ORGAN_FAILING) && (damage < maxHealth))
|
||||
organ_flags &= ~ORGAN_FAILING
|
||||
C.cure_blind(EYE_DAMAGE)
|
||||
//various degrees of "oh fuck my eyes", from "point a laser at your eye" to "staring at the Sun" intensities
|
||||
if(damage > 20)
|
||||
damaged = TRUE
|
||||
if(organ_flags & ORGAN_FAILING)
|
||||
C.become_blind(EYE_DAMAGE)
|
||||
else if(damage > 30)
|
||||
C.overlay_fullscreen("eye_damage", /obj/screen/fullscreen/impaired, 2)
|
||||
else
|
||||
C.overlay_fullscreen("eye_damage", /obj/screen/fullscreen/impaired, 1)
|
||||
//called once since we don't want to keep clearing the screen of eye damage for people who are below 20 damage
|
||||
else if(damaged)
|
||||
damaged = FALSE
|
||||
C.clear_fullscreen("eye_damage")
|
||||
return
|
||||
|
||||
/obj/item/organ/eyes/proc/clear_eye_trauma()
|
||||
var/mob/living/carbon/C = owner
|
||||
C.clear_fullscreen("eye_damage")
|
||||
C.cure_blind(EYE_DAMAGE)
|
||||
damaged = FALSE
|
||||
|
||||
/obj/item/organ/eyes/night_vision
|
||||
name = "shadow eyes"
|
||||
desc = "A spooky set of eyes that can see in the dark."
|
||||
@@ -71,6 +117,7 @@
|
||||
/obj/item/organ/eyes/night_vision/zombie
|
||||
name = "undead eyes"
|
||||
desc = "Somewhat counterintuitively, these half-rotten eyes actually have superior vision to those of a living human."
|
||||
sight_flags = SEE_MOBS
|
||||
|
||||
/obj/item/organ/eyes/night_vision/nightmare
|
||||
name = "burning red eyes"
|
||||
@@ -88,15 +135,17 @@
|
||||
icon_state = "cybernetic_eyeballs"
|
||||
desc = "Your vision is augmented."
|
||||
status = ORGAN_ROBOTIC
|
||||
organ_flags = ORGAN_SYNTHETIC
|
||||
|
||||
/obj/item/organ/eyes/robotic/emp_act(severity)
|
||||
. = ..()
|
||||
if(!owner || . & EMP_PROTECT_SELF)
|
||||
return
|
||||
if(prob(10 * severity))
|
||||
return
|
||||
to_chat(owner, "<span class='warning'>Static obfuscates your vision!</span>")
|
||||
owner.flash_act(visual = 1)
|
||||
if(severity == EMP_HEAVY)
|
||||
owner.adjustOrganLoss(ORGAN_SLOT_EYES, 20)
|
||||
|
||||
|
||||
/obj/item/organ/eyes/robotic/xray
|
||||
name = "\improper X-ray eyes"
|
||||
@@ -137,7 +186,7 @@
|
||||
M.become_blind("flashlight_eyes")
|
||||
|
||||
|
||||
/obj/item/organ/eyes/robotic/flashlight/Remove(var/mob/living/carbon/M, var/special = 0)
|
||||
/obj/item/organ/eyes/robotic/flashlight/Remove(var/mob/living/carbon/M, special = FALSE)
|
||||
eye.on = FALSE
|
||||
eye.update_brightness(M)
|
||||
eye.forceMove(src)
|
||||
|
||||
@@ -4,12 +4,24 @@
|
||||
icon_state = "heart-on"
|
||||
zone = BODY_ZONE_CHEST
|
||||
slot = ORGAN_SLOT_HEART
|
||||
|
||||
healing_factor = STANDARD_ORGAN_HEALING
|
||||
decay_factor = 3 * STANDARD_ORGAN_DECAY //designed to fail about 5 minutes after death
|
||||
|
||||
low_threshold_passed = "<span class='info'>Prickles of pain appear then die out from within your chest...</span>"
|
||||
high_threshold_passed = "<span class='warning'>Something inside your chest hurts, and the pain isn't subsiding. You notice yourself breathing far faster than before.</span>"
|
||||
now_fixed = "<span class='info'>Your heart begins to beat again.</span>"
|
||||
high_threshold_cleared = "<span class='info'>The pain in your chest has died down, and your breathing becomes more relaxed.</span>"
|
||||
|
||||
// Heart attack code is in code/modules/mob/living/carbon/human/life.dm
|
||||
var/beating = 1
|
||||
var/icon_base = "heart"
|
||||
attack_verb = list("beat", "thumped")
|
||||
var/beat = BEAT_NONE//is this mob having a heatbeat sound played? if so, which?
|
||||
|
||||
var/failed = FALSE //to prevent constantly running failing code
|
||||
var/operated = FALSE //whether the heart's been operated on to fix some of its damages
|
||||
|
||||
/obj/item/organ/heart/update_icon()
|
||||
if(beating)
|
||||
icon_state = "[icon_base]-on"
|
||||
@@ -49,7 +61,9 @@
|
||||
return S
|
||||
|
||||
/obj/item/organ/heart/on_life()
|
||||
..()
|
||||
if(owner.client && beating)
|
||||
failed = FALSE
|
||||
var/sound/slowbeat = sound('sound/health/slowbeat.ogg', repeat = TRUE)
|
||||
var/sound/fastbeat = sound('sound/health/fastbeat.ogg', repeat = TRUE)
|
||||
var/mob/living/carbon/H = owner
|
||||
@@ -70,11 +84,18 @@
|
||||
H.stop_sound_channel(CHANNEL_HEARTBEAT)
|
||||
beat = BEAT_NONE
|
||||
|
||||
if(organ_flags & ORGAN_FAILING) //heart broke, stopped beating, death imminent
|
||||
if(owner.stat == CONSCIOUS)
|
||||
owner.visible_message("<span class='userdanger'>[owner] clutches at [owner.p_their()] chest as if [owner.p_their()] heart is stopping!</span>")
|
||||
owner.set_heartattack(TRUE)
|
||||
failed = TRUE
|
||||
|
||||
/obj/item/organ/heart/cursed
|
||||
name = "cursed heart"
|
||||
desc = "A heart that, when inserted, will force you to pump it manually."
|
||||
icon_state = "cursedheart-off"
|
||||
icon_base = "cursedheart"
|
||||
decay_factor = 0
|
||||
actions_types = list(/datum/action/item_action/organ_action/cursed_heart)
|
||||
var/last_pump = 0
|
||||
var/add_colour = TRUE //So we're not constantly recreating colour datums
|
||||
@@ -153,18 +174,48 @@
|
||||
name = "cybernetic heart"
|
||||
desc = "An electronic device designed to mimic the functions of an organic human heart. Offers no benefit over an organic heart other than being easy to make."
|
||||
icon_state = "heart-c"
|
||||
synthetic = TRUE
|
||||
organ_flags = ORGAN_SYNTHETIC
|
||||
|
||||
/obj/item/organ/heart/cybernetic/emp_act()
|
||||
/obj/item/organ/heart/cybernetic/emp_act(severity)
|
||||
. = ..()
|
||||
if(. & EMP_PROTECT_SELF)
|
||||
return
|
||||
Stop()
|
||||
addtimer(CALLBACK(src, .proc/Restart), 20/severity SECONDS)
|
||||
damage += 100/severity
|
||||
|
||||
/obj/item/organ/heart/cybernetic/upgraded
|
||||
name = "upgraded cybernetic heart"
|
||||
desc = "An electronic device designed to mimic the functions of an organic human heart. Also holds an emergency dose of epinephrine, used automatically after facing severe trauma. This upgraded model can regenerate its dose after use."
|
||||
icon_state = "heart-c-u"
|
||||
maxHealth = 2 * STANDARD_ORGAN_THRESHOLD
|
||||
|
||||
//I put it on upgraded for now.
|
||||
var/dose_available = TRUE
|
||||
var/rid = /datum/reagent/medicine/epinephrine
|
||||
var/ramount = 10
|
||||
|
||||
obj/item/organ/heart/cybernetic/upgraded/on_life()
|
||||
. = ..()
|
||||
if(dose_available && owner.health <= owner.crit_threshold && !owner.reagents.has_reagent(rid))
|
||||
owner.reagents.add_reagent(rid, ramount)
|
||||
used_dose()
|
||||
if(ramount < 10) //eats your nutrition to regen epinephrine
|
||||
var/regen_amount = owner.nutrition/2000
|
||||
owner.nutrition -= regen_amount
|
||||
ramount += regen_amount
|
||||
|
||||
/obj/item/organ/heart/cybernetic/upgraded/proc/used_dose()
|
||||
. = ..()
|
||||
addtimer(VARSET_CALLBACK(src, dose_available, TRUE), 5 MINUTES)
|
||||
ramount = 0
|
||||
|
||||
|
||||
|
||||
/obj/item/organ/heart/freedom
|
||||
name = "heart of freedom"
|
||||
desc = "This heart pumps with the passion to give... something freedom."
|
||||
synthetic = TRUE //the power of freedom prevents heart attacks
|
||||
organ_flags = ORGAN_SYNTHETIC //the power of freedom prevents heart attacks
|
||||
var/min_next_adrenaline = 0
|
||||
|
||||
/obj/item/organ/heart/freedom/on_life()
|
||||
|
||||
@@ -10,10 +10,13 @@
|
||||
zone = BODY_ZONE_CHEST
|
||||
slot = ORGAN_SLOT_LIVER
|
||||
desc = "Pairing suggestion: chianti and fava beans."
|
||||
var/damage = 0 //liver damage, 0 is no damage, damage=maxHealth causes liver failure
|
||||
|
||||
maxHealth = STANDARD_ORGAN_THRESHOLD
|
||||
healing_factor = STANDARD_ORGAN_HEALING
|
||||
decay_factor = STANDARD_ORGAN_DECAY
|
||||
|
||||
var/alcohol_tolerance = ALCOHOL_RATE//affects how much damage the liver takes from alcohol
|
||||
var/failing //is this liver failing?
|
||||
var/maxHealth = LIVER_DEFAULT_HEALTH
|
||||
var/toxTolerance = LIVER_DEFAULT_TOX_TOLERANCE//maximum amount of toxins the liver can just shrug off
|
||||
var/toxLethality = LIVER_DEFAULT_TOX_LETHALITY//affects how much damage toxins do to the liver
|
||||
var/filterToxins = TRUE //whether to filter toxins
|
||||
@@ -24,7 +27,7 @@
|
||||
var/mob/living/carbon/C = owner
|
||||
|
||||
if(istype(C))
|
||||
if(!failing)//can't process reagents with a failing liver
|
||||
if(!(organ_flags & ORGAN_FAILING))//can't process reagents with a failing liver
|
||||
//slowly heal liver damage
|
||||
damage = max(0, damage - 0.1)
|
||||
|
||||
@@ -69,7 +72,7 @@
|
||||
if(moveCalc == cachedmoveCalc)//reduce calculations
|
||||
return
|
||||
if(prob(5))
|
||||
to_chat(owner, "<span class='notice'>You feel a stange ache in your side, almost like a sitch. This pain is affecting your movements and making you feel lightheaded.</span>")
|
||||
to_chat(owner, "<span class='notice'>You feel a stange ache in your side, almost like a stitch. This pain is affecting your movements and making you feel lightheaded.</span>")
|
||||
var/mob/living/carbon/human/H = owner
|
||||
H.add_movespeed_modifier(LIVER_SWELLING_MOVE_MODIFY, TRUE, 100, NONE, override = TRUE, multiplicative_slowdown = moveCalc)
|
||||
H.AdjustBloodVol(moveCalc/3)
|
||||
@@ -97,14 +100,15 @@
|
||||
name = "cybernetic liver"
|
||||
icon_state = "liver-c"
|
||||
desc = "An electronic device designed to mimic the functions of a human liver. It has no benefits over an organic liver, but is easy to produce."
|
||||
synthetic = TRUE
|
||||
organ_flags = ORGAN_SYNTHETIC
|
||||
maxHealth = 1.1 * STANDARD_ORGAN_THRESHOLD
|
||||
|
||||
/obj/item/organ/liver/cybernetic/upgraded
|
||||
name = "upgraded cybernetic liver"
|
||||
icon_state = "liver-c-u"
|
||||
desc = "An upgraded version of the cybernetic liver, designed to improve upon organic livers. It is resistant to alcohol poisoning and is very robust at filtering toxins."
|
||||
alcohol_tolerance = 0.001
|
||||
maxHealth = 200 //double the health of a normal liver
|
||||
maxHealth = 2 * STANDARD_ORGAN_THRESHOLD
|
||||
toxTolerance = 15 //can shrug off up to 15u of toxins
|
||||
toxLethality = 0.008 //20% less damage than a normal liver
|
||||
|
||||
|
||||
@@ -8,6 +8,21 @@
|
||||
gender = PLURAL
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
|
||||
var/failed = FALSE
|
||||
var/operated = FALSE //whether we can still have our damages fixed through surgery
|
||||
|
||||
//health
|
||||
maxHealth = 3 * STANDARD_ORGAN_THRESHOLD
|
||||
|
||||
healing_factor = STANDARD_ORGAN_HEALING
|
||||
decay_factor = STANDARD_ORGAN_DECAY
|
||||
high_threshold = 0.6 * LUNGS_MAX_HEALTH //threshold at 180
|
||||
low_threshold = 0.3 * LUNGS_MAX_HEALTH //threshold at 90
|
||||
|
||||
high_threshold_passed = "<span class='warning'>You feel some sort of constriction around your chest as your breathing becomes shallow and rapid.</span>"
|
||||
now_fixed = "<span class='warning'>Your lungs seem to once again be able to hold air.</span>"
|
||||
high_threshold_cleared = "<span class='info'>The constriction around your chest loosens as your breathing calms down.</span>"
|
||||
|
||||
//Breath damage
|
||||
|
||||
var/safe_oxygen_min = 16 // Minimum safe partial pressure of O2, in kPa
|
||||
@@ -56,36 +71,35 @@
|
||||
|
||||
var/crit_stabilizing_reagent = "epinephrine"
|
||||
|
||||
//health
|
||||
var/maxHealth = LUNGS_MAX_HEALTH
|
||||
var/damage = 0
|
||||
|
||||
|
||||
//TODO: lung health affects lung function
|
||||
/obj/item/organ/lungs/proc/adjustLungLoss(damage_mod, mob/living/carbon/M) //damage might be too low atm.
|
||||
/obj/item/organ/lungs/onDamage(damage_mod) //damage might be too low atm.
|
||||
var/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)
|
||||
to_chat(M, "<span class='userdanger'>You feel your lungs collapse within your chest as you gasp for air, unable to inflate them anymore!</span>")
|
||||
M.emote("gasp")
|
||||
cached_damage += damage_mod
|
||||
if ((cached_damage/ maxHealth) > 1)
|
||||
to_chat(owner, "<span class='userdanger'>You feel your lungs collapse within your chest as you gasp for air, unable to inflate them anymore!</span>")
|
||||
owner.emote("gasp")
|
||||
SSblackbox.record_feedback("tally", "fermi_chem", 1, "Lungs lost")
|
||||
qdel(src)
|
||||
else if ((damage / maxHealth) > 0.75)
|
||||
to_chat(M, "<span class='warning'>It's getting really hard to breathe!!</span>")
|
||||
M.emote("gasp")
|
||||
M.Dizzy(3)
|
||||
else if ((damage / maxHealth) > 0.5)
|
||||
M.Dizzy(2)
|
||||
to_chat(M, "<span class='notice'>Your chest is really starting to hurt.</span>")
|
||||
M.emote("cough")
|
||||
else if ((damage / maxHealth) > 0.2)
|
||||
to_chat(M, "<span class='notice'>You feel an ache within your chest.</span>")
|
||||
M.emote("cough")
|
||||
M.Dizzy(1)
|
||||
//qdel(src) - Handled elsewhere for now.
|
||||
else if ((cached_damage / maxHealth) > 0.75)
|
||||
to_chat(owner, "<span class='warning'>It's getting really hard to breathe!!</span>")
|
||||
owner.emote("gasp")
|
||||
owner.Dizzy(3)
|
||||
else if ((cached_damage / maxHealth) > 0.5)
|
||||
owner.Dizzy(2)
|
||||
to_chat(owner, "<span class='notice'>Your chest is really starting to hurt.</span>")
|
||||
owner.emote("cough")
|
||||
else if ((cached_damage / maxHealth) > 0.2)
|
||||
to_chat(owner, "<span class='notice'>You feel an ache within your chest.</span>")
|
||||
owner.emote("cough")
|
||||
owner.Dizzy(1)
|
||||
|
||||
/obj/item/organ/lungs/proc/check_breath(datum/gas_mixture/breath, mob/living/carbon/human/H)
|
||||
//TODO: add lung damage = less oxygen gains
|
||||
@@ -289,7 +303,7 @@
|
||||
H.hallucination += 10
|
||||
H.reagents.add_reagent("bz_metabolites",5)
|
||||
if(prob(33))
|
||||
H.adjustBrainLoss(3, 150)
|
||||
H.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3, 150)
|
||||
|
||||
else if(bz_pp > 0.01)
|
||||
H.hallucination += 5
|
||||
@@ -405,13 +419,13 @@
|
||||
var/cold_modifier = H.dna.species.coldmod
|
||||
if(breath_temperature < cold_level_3_threshold)
|
||||
H.apply_damage_type(cold_level_3_damage*cold_modifier, cold_damage_type)
|
||||
adjustLungLoss((cold_level_3_damage*cold_modifier*2), H)
|
||||
H.adjustOrganLoss(ORGAN_SLOT_LUNGS, (cold_level_3_damage*cold_modifier*2))
|
||||
if(breath_temperature > cold_level_3_threshold && breath_temperature < cold_level_2_threshold)
|
||||
H.apply_damage_type(cold_level_2_damage*cold_modifier, cold_damage_type)
|
||||
adjustLungLoss((cold_level_2_damage*cold_modifier*2), H)
|
||||
H.adjustOrganLoss(ORGAN_SLOT_LUNGS, (cold_level_2_damage*cold_modifier*2))
|
||||
if(breath_temperature > cold_level_2_threshold && breath_temperature < cold_level_1_threshold)
|
||||
H.apply_damage_type(cold_level_1_damage*cold_modifier, cold_damage_type)
|
||||
adjustLungLoss((cold_level_1_damage*cold_modifier*2), H)
|
||||
H.adjustOrganLoss(ORGAN_SLOT_LUNGS, (cold_level_1_damage*cold_modifier*2))
|
||||
if(breath_temperature < cold_level_1_threshold)
|
||||
if(prob(20))
|
||||
to_chat(H, "<span class='warning'>You feel [cold_message] in your [name]!</span>")
|
||||
@@ -420,17 +434,29 @@
|
||||
var/heat_modifier = H.dna.species.heatmod
|
||||
if(breath_temperature > heat_level_1_threshold && breath_temperature < heat_level_2_threshold)
|
||||
H.apply_damage_type(heat_level_1_damage*heat_modifier, heat_damage_type)
|
||||
adjustLungLoss((heat_level_1_damage*heat_modifier*2), H)
|
||||
H.adjustOrganLoss(ORGAN_SLOT_LUNGS, (heat_level_1_damage*heat_modifier*2))
|
||||
if(breath_temperature > heat_level_2_threshold && breath_temperature < heat_level_3_threshold)
|
||||
H.apply_damage_type(heat_level_2_damage*heat_modifier, heat_damage_type)
|
||||
adjustLungLoss((heat_level_2_damage*heat_modifier*2), H)
|
||||
H.adjustOrganLoss(ORGAN_SLOT_LUNGS, (heat_level_2_damage*heat_modifier*2))
|
||||
if(breath_temperature > heat_level_3_threshold)
|
||||
H.apply_damage_type(heat_level_3_damage*heat_modifier, heat_damage_type)
|
||||
adjustLungLoss((heat_level_3_damage*heat_modifier*2), H)
|
||||
H.adjustOrganLoss(ORGAN_SLOT_LUNGS, (heat_level_3_damage*heat_modifier*2))
|
||||
if(breath_temperature > heat_level_1_threshold)
|
||||
if(prob(20))
|
||||
to_chat(H, "<span class='warning'>You feel [hot_message] in your [name]!</span>")
|
||||
|
||||
|
||||
/obj/item/organ/lungs/on_life()
|
||||
..()
|
||||
if((!failed) && ((organ_flags & ORGAN_FAILING)))
|
||||
if(owner.stat == CONSCIOUS)
|
||||
owner.visible_message("<span class='danger'>[owner] grabs [owner.p_their()] throat, struggling for breath!</span>", \
|
||||
"<span class='userdanger'>You suddenly feel like you can't breathe!</span>")
|
||||
failed = TRUE
|
||||
else if(!(organ_flags & ORGAN_FAILING))
|
||||
failed = FALSE
|
||||
return
|
||||
|
||||
/obj/item/organ/lungs/prepare_eat()
|
||||
var/obj/S = ..()
|
||||
S.reagents.add_reagent("salbutamol", 5)
|
||||
@@ -451,14 +477,16 @@
|
||||
name = "cybernetic lungs"
|
||||
desc = "A cybernetic version of the lungs found in traditional humanoid entities. It functions the same as an organic lung and is merely meant as a replacement."
|
||||
icon_state = "lungs-c"
|
||||
synthetic = TRUE
|
||||
organ_flags = ORGAN_SYNTHETIC
|
||||
maxHealth = 400
|
||||
safe_oxygen_min = 13
|
||||
|
||||
/obj/item/organ/lungs/cybernetic/emp_act()
|
||||
. = ..()
|
||||
if(. & EMP_PROTECT_SELF)
|
||||
return
|
||||
owner.losebreath = 20
|
||||
owner.adjustOrganLoss(ORGAN_SLOT_LUNGS, 25)
|
||||
|
||||
|
||||
/obj/item/organ/lungs/cybernetic/upgraded
|
||||
@@ -495,8 +523,24 @@
|
||||
|
||||
safe_toxins_max = 0 //We breathe this to gain POWER.
|
||||
|
||||
cold_level_1_threshold = 285 // Remember when slimes used to be succeptable to cold? Well....
|
||||
cold_level_2_threshold = 260
|
||||
cold_level_3_threshold = 230
|
||||
|
||||
maxHealth = 250
|
||||
|
||||
/obj/item/organ/lungs/slime/check_breath(datum/gas_mixture/breath, mob/living/carbon/human/H)
|
||||
. = ..()
|
||||
if (breath && breath.gases[/datum/gas/plasma])
|
||||
var/plasma_pp = breath.get_breath_partial_pressure(breath.gases[/datum/gas/plasma])
|
||||
owner.blood_volume += (0.2 * plasma_pp) // 10/s when breathing literally nothing but plasma, which will suffocate you.
|
||||
|
||||
/obj/item/organ/lungs/yamerol
|
||||
name = "Yamerol lungs"
|
||||
desc = "A temporary pair of lungs made from self assembling yamerol molecules."
|
||||
maxHealth = 200
|
||||
color = "#68e83a"
|
||||
|
||||
/obj/item/organ/lungs/yamerol/on_life()
|
||||
..()
|
||||
damage += 2 //Yamerol lungs are temporary
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#define STANDARD_ORGAN_THRESHOLD 100
|
||||
#define STANDARD_ORGAN_HEALING 0.001
|
||||
|
||||
/obj/item/organ
|
||||
name = "organ"
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
@@ -8,11 +11,23 @@
|
||||
var/zone = BODY_ZONE_CHEST
|
||||
var/slot
|
||||
// DO NOT add slots with matching names to different zones - it will break internal_organs_slot list!
|
||||
var/vital = 0
|
||||
//Was this organ implanted/inserted/etc, if true will not be removed during species change.
|
||||
var/external = FALSE
|
||||
var/synthetic = FALSE // To distinguish between organic and synthetic organs
|
||||
var/organ_flags = 0
|
||||
var/maxHealth = STANDARD_ORGAN_THRESHOLD
|
||||
var/damage = 0 //total damage this organ has sustained
|
||||
///Healing factor and decay factor function on % of maxhealth, and do not work by applying a static number per tick
|
||||
var/healing_factor = 0 //fraction of maxhealth healed per on_life(), set to 0 for generic organs
|
||||
var/decay_factor = 0 //same as above but when without a living owner, set to 0 for generic organs
|
||||
var/high_threshold = STANDARD_ORGAN_THRESHOLD * 0.45 //when severe organ damage occurs
|
||||
var/low_threshold = STANDARD_ORGAN_THRESHOLD * 0.1 //when minor organ damage occurs
|
||||
|
||||
///Organ variables for determining what we alert the owner with when they pass/clear the damage thresholds
|
||||
var/prev_damage = 0
|
||||
var/low_threshold_passed
|
||||
var/high_threshold_passed
|
||||
var/now_failing
|
||||
var/now_fixed
|
||||
var/high_threshold_cleared
|
||||
var/low_threshold_cleared
|
||||
|
||||
/obj/item/organ/proc/Insert(mob/living/carbon/M, special = 0, drop_if_replaced = TRUE)
|
||||
if(!iscarbon(M) || owner == M)
|
||||
@@ -26,6 +41,9 @@
|
||||
else
|
||||
qdel(replaced)
|
||||
|
||||
//Hopefully this doesn't cause problems
|
||||
organ_flags &= ~ORGAN_FROZEN
|
||||
|
||||
owner = M
|
||||
M.internal_organs |= src
|
||||
M.internal_organs_slot[slot] = src
|
||||
@@ -33,33 +51,115 @@
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.Grant(M)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
|
||||
return TRUE
|
||||
|
||||
//Special is for instant replacement like autosurgeons
|
||||
/obj/item/organ/proc/Remove(mob/living/carbon/M, special = 0)
|
||||
/obj/item/organ/proc/Remove(mob/living/carbon/M, special = FALSE)
|
||||
owner = null
|
||||
if(M)
|
||||
M.internal_organs -= src
|
||||
if(M.internal_organs_slot[slot] == src)
|
||||
M.internal_organs_slot.Remove(slot)
|
||||
if(vital && !special && !(M.status_flags & GODMODE))
|
||||
if((organ_flags & ORGAN_VITAL) && !special && !(M.status_flags & GODMODE))
|
||||
M.death()
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.Remove(M)
|
||||
return TRUE
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
return TRUE
|
||||
|
||||
/obj/item/organ/proc/on_find(mob/living/finder)
|
||||
return
|
||||
|
||||
/obj/item/organ/proc/on_life()
|
||||
return
|
||||
/obj/item/organ/process() //runs decay when outside of a person AND ONLY WHEN OUTSIDE (i.e. long obj).
|
||||
on_death() //Kinda hate doing it like this, but I really don't want to call process directly.
|
||||
|
||||
//Sources; life.dm process_organs
|
||||
/obj/item/organ/proc/on_death() //Runs when outside AND inside.
|
||||
decay()
|
||||
|
||||
//Applys the slow damage over time decay
|
||||
/obj/item/organ/proc/decay()
|
||||
if(!can_decay())
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return
|
||||
is_cold()
|
||||
if(organ_flags & ORGAN_FROZEN)
|
||||
return
|
||||
applyOrganDamage(maxHealth * decay_factor)
|
||||
|
||||
/obj/item/organ/proc/can_decay()
|
||||
if(CHECK_BITFIELD(organ_flags, ORGAN_NO_SPOIL | ORGAN_SYNTHETIC | ORGAN_FAILING))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
//Checks to see if the organ is frozen from temperature
|
||||
/obj/item/organ/proc/is_cold()
|
||||
var/freezing_objects = list(/obj/structure/closet/crate/freezer, /obj/structure/closet/secure_closet/freezer, /obj/structure/bodycontainer, /obj/item/autosurgeon)
|
||||
if(istype(loc, /obj/))//Freezer of some kind, I hope.
|
||||
if(is_type_in_list(loc, freezing_objects))
|
||||
if(!(organ_flags & ORGAN_FROZEN))//Incase someone puts them in when cold, but they warm up inside of the thing. (i.e. they have the flag, the thing turns it off, this rights it.)
|
||||
organ_flags |= ORGAN_FROZEN
|
||||
return TRUE
|
||||
return
|
||||
|
||||
var/local_temp
|
||||
if(istype(loc, /turf/))//Only concern is adding an organ to a freezer when the area around it is cold.
|
||||
var/turf/T = loc
|
||||
var/datum/gas_mixture/enviro = T.return_air()
|
||||
local_temp = enviro.temperature
|
||||
|
||||
else if(istype(loc, /mob/) && !owner)
|
||||
var/mob/M = loc
|
||||
if(is_type_in_list(M.loc, freezing_objects))
|
||||
if(!(organ_flags & ORGAN_FROZEN))
|
||||
organ_flags |= ORGAN_FROZEN
|
||||
return TRUE
|
||||
var/turf/T = M.loc
|
||||
var/datum/gas_mixture/enviro = T.return_air()
|
||||
local_temp = enviro.temperature
|
||||
|
||||
if(owner)
|
||||
//Don't interfere with bodies frozen by structures.
|
||||
if(is_type_in_list(owner.loc, freezing_objects))
|
||||
if(!(organ_flags & ORGAN_FROZEN))
|
||||
organ_flags |= ORGAN_FROZEN
|
||||
return TRUE
|
||||
local_temp = owner.bodytemperature
|
||||
|
||||
if(!local_temp)//Shouldn't happen but in case
|
||||
return
|
||||
if(local_temp < 154)//I have a pretty shaky citation that states -120 allows indefinite cyrostorage
|
||||
organ_flags |= ORGAN_FROZEN
|
||||
return TRUE
|
||||
organ_flags &= ~ORGAN_FROZEN
|
||||
return FALSE
|
||||
|
||||
/obj/item/organ/proc/on_life() //repair organ damage if the organ is not failing
|
||||
if(organ_flags & ORGAN_FAILING)
|
||||
return
|
||||
if(is_cold())
|
||||
return
|
||||
///Damage decrements by a percent of its maxhealth
|
||||
var/healing_amount = -(maxHealth * healing_factor)
|
||||
///Damage decrements again by a percent of its maxhealth, up to a total of 4 extra times depending on the owner's health
|
||||
healing_amount -= owner.satiety > 0 ? 4 * healing_factor * owner.satiety / MAX_SATIETY : 0
|
||||
applyOrganDamage(healing_amount) //to FERMI_TWEAK
|
||||
//Make it so each threshold is stuck.
|
||||
|
||||
/obj/item/organ/examine(mob/user)
|
||||
..()
|
||||
if(status == ORGAN_ROBOTIC && crit_fail)
|
||||
to_chat(user, "<span class='warning'>[src] seems to be broken!</span>")
|
||||
. = ..()
|
||||
if(organ_flags & ORGAN_FAILING)
|
||||
if(status == ORGAN_ROBOTIC)
|
||||
. += "<span class='warning'>[src] seems to be broken!</span>"
|
||||
return
|
||||
. += "<span class='warning'>[src] has decayed for too long, and has turned a sickly color! It doesn't look like it will work anymore!</span>"
|
||||
return
|
||||
if(damage > high_threshold)
|
||||
. += "<span class='warning'>[src] is starting to look discolored.</span>"
|
||||
|
||||
|
||||
/obj/item/organ/proc/prepare_eat()
|
||||
@@ -80,6 +180,10 @@
|
||||
foodtype = RAW | MEAT | GROSS
|
||||
|
||||
|
||||
/obj/item/organ/Initialize()
|
||||
. = ..()
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
/obj/item/organ/Destroy()
|
||||
if(owner)
|
||||
// The special flag is important, because otherwise mobs can die
|
||||
@@ -102,13 +206,66 @@
|
||||
/obj/item/organ/item_action_slot_check(slot,mob/user)
|
||||
return //so we don't grant the organ's action to mobs who pick up the organ.
|
||||
|
||||
///Adjusts an organ's damage by the amount "d", up to a maximum amount, which is by default max damage
|
||||
/obj/item/organ/proc/applyOrganDamage(var/d, var/maximum = maxHealth) //use for damaging effects
|
||||
if(!d) //Micro-optimization.
|
||||
return
|
||||
if(maximum < damage)
|
||||
return
|
||||
damage = CLAMP(damage + d, 0, maximum)
|
||||
var/mess = check_damage_thresholds(owner)
|
||||
prev_damage = damage
|
||||
if(mess && owner)
|
||||
to_chat(owner, mess)
|
||||
|
||||
///SETS an organ's damage to the amount "d", and in doing so clears or sets the failing flag, good for when you have an effect that should fix an organ if broken
|
||||
/obj/item/organ/proc/setOrganDamage(var/d) //use mostly for admin heals
|
||||
applyOrganDamage(d - damage)
|
||||
|
||||
/** check_damage_thresholds
|
||||
* input: M (a mob, the owner of the organ we call the proc on)
|
||||
* output: returns a message should get displayed.
|
||||
* description: By checking our current damage against our previous damage, we can decide whether we've passed an organ threshold.
|
||||
* If we have, send the corresponding threshold message to the owner, if such a message exists.
|
||||
*/
|
||||
/obj/item/organ/proc/check_damage_thresholds(var/M)
|
||||
if(damage == prev_damage)
|
||||
return
|
||||
var/delta = damage - prev_damage
|
||||
if(delta > 0)
|
||||
if(damage >= maxHealth)
|
||||
organ_flags |= ORGAN_FAILING
|
||||
return now_failing
|
||||
if(damage > high_threshold && prev_damage <= high_threshold)
|
||||
return high_threshold_passed
|
||||
if(damage > low_threshold && prev_damage <= low_threshold)
|
||||
return low_threshold_passed
|
||||
else
|
||||
organ_flags &= ~ORGAN_FAILING
|
||||
if(!owner)//Processing is stopped when the organ is dead and outside of someone. This hopefully should restart it if a removed organ is repaired outside of a body.
|
||||
START_PROCESSING(SSobj, src)
|
||||
if(prev_damage > low_threshold && damage <= low_threshold)
|
||||
return low_threshold_cleared
|
||||
if(prev_damage > high_threshold && damage <= high_threshold)
|
||||
return high_threshold_cleared
|
||||
if(prev_damage == maxHealth)
|
||||
return now_fixed
|
||||
|
||||
//Runs some code on the organ when damage is taken/healed
|
||||
/obj/item/organ/proc/onDamage(var/d, var/maximum = maxHealth)
|
||||
return
|
||||
|
||||
//Runs some code on the organ when damage is taken/healed
|
||||
/obj/item/organ/proc/onSetDamage(var/d, var/maximum = maxHealth)
|
||||
return
|
||||
|
||||
//Looking for brains?
|
||||
//Try code/modules/mob/living/carbon/brain/brain_item.dm
|
||||
|
||||
/mob/living/proc/regenerate_organs()
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/regenerate_organs()
|
||||
/mob/living/carbon/regenerate_organs(only_one = FALSE)
|
||||
var/breathes = TRUE
|
||||
var/blooded = TRUE
|
||||
if(dna && dna.species)
|
||||
@@ -127,6 +284,8 @@
|
||||
else
|
||||
LI = new()
|
||||
LI.Insert(src)
|
||||
if(only_one)
|
||||
return TRUE
|
||||
|
||||
if(has_stomach && !getorganslot(ORGAN_SLOT_STOMACH))
|
||||
var/obj/item/organ/stomach/S
|
||||
@@ -136,14 +295,20 @@
|
||||
else
|
||||
S = new()
|
||||
S.Insert(src)
|
||||
if(only_one)
|
||||
return TRUE
|
||||
|
||||
if(breathes && !getorganslot(ORGAN_SLOT_LUNGS))
|
||||
var/obj/item/organ/lungs/L = new()
|
||||
L.Insert(src)
|
||||
if(only_one)
|
||||
return TRUE
|
||||
|
||||
if(blooded && !getorganslot(ORGAN_SLOT_HEART))
|
||||
var/obj/item/organ/heart/H = new()
|
||||
H.Insert(src)
|
||||
if(only_one)
|
||||
return TRUE
|
||||
|
||||
if(!getorganslot(ORGAN_SLOT_TONGUE))
|
||||
var/obj/item/organ/tongue/T
|
||||
@@ -155,7 +320,10 @@
|
||||
|
||||
// if they have no mutant tongues, give them a regular one
|
||||
T.Insert(src)
|
||||
else
|
||||
if(only_one)
|
||||
return TRUE
|
||||
|
||||
else if (!only_one)
|
||||
var/obj/item/organ/tongue/oT = getorganslot(ORGAN_SLOT_TONGUE)
|
||||
if(oT.name == "fluffy tongue")
|
||||
var/obj/item/organ/tongue/T
|
||||
@@ -176,6 +344,8 @@
|
||||
else
|
||||
E = new()
|
||||
E.Insert(src)
|
||||
if(only_one)
|
||||
return TRUE
|
||||
|
||||
if(!getorganslot(ORGAN_SLOT_EARS))
|
||||
var/obj/item/organ/ears/ears
|
||||
@@ -185,9 +355,13 @@
|
||||
ears = new
|
||||
|
||||
ears.Insert(src)
|
||||
if(only_one)
|
||||
return TRUE
|
||||
|
||||
if(!getorganslot(ORGAN_SLOT_TAIL))
|
||||
var/obj/item/organ/tail/tail
|
||||
if(dna && dna.species && dna.species.mutanttail)
|
||||
tail = new dna.species.mutanttail
|
||||
tail.Insert(src)
|
||||
if(only_one)
|
||||
return TRUE
|
||||
|
||||
@@ -8,12 +8,42 @@
|
||||
desc = "Onaka ga suite imasu."
|
||||
var/disgust_metabolism = 1
|
||||
|
||||
/obj/item/organ/stomach/on_life()
|
||||
var/mob/living/carbon/human/H = owner
|
||||
healing_factor = STANDARD_ORGAN_HEALING
|
||||
decay_factor = STANDARD_ORGAN_DECAY
|
||||
|
||||
if(istype(H))
|
||||
H.dna.species.handle_digestion(H)
|
||||
low_threshold_passed = "<span class='info'>Your stomach flashes with pain before subsiding. Food doesn't seem like a good idea right now.</span>"
|
||||
high_threshold_passed = "<span class='warning'>Your stomach flares up with constant pain- you can hardly stomach the idea of food right now!</span>"
|
||||
high_threshold_cleared = "<span class='info'>The pain in your stomach dies down for now, but food still seems unappealing.</span>"
|
||||
low_threshold_cleared = "<span class='info'>The last bouts of pain in your stomach have died out.</span>"
|
||||
|
||||
/obj/item/organ/stomach/on_life()
|
||||
..()
|
||||
var/datum/reagent/consumable/nutriment/Nutri
|
||||
if(ishuman(owner))
|
||||
var/mob/living/carbon/human/H = owner
|
||||
if(!(organ_flags & ORGAN_FAILING))
|
||||
H.dna.species.handle_digestion(H)
|
||||
handle_disgust(H)
|
||||
Nutri = locate(/datum/reagent/consumable/nutriment) in H.reagents.reagent_list
|
||||
|
||||
if(Nutri)
|
||||
if(prob((damage/40) * Nutri.volume * Nutri.volume))
|
||||
H.vomit(damage)
|
||||
to_chat(H, "<span class='warning'>Your stomach reels in pain as you're incapable of holding down all that food!</span>")
|
||||
|
||||
else if(Nutri && damage > high_threshold)
|
||||
if(prob((damage/10) * Nutri.volume * Nutri.volume))
|
||||
H.vomit(damage)
|
||||
to_chat(H, "<span class='warning'>Your stomach reels in pain as you're incapable of holding down all that food!</span>")
|
||||
|
||||
|
||||
else if(iscarbon(owner))
|
||||
var/mob/living/carbon/C = owner
|
||||
Nutri = locate(/datum/reagent/consumable/nutriment) in C.reagents.reagent_list
|
||||
|
||||
if(damage < low_threshold)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/organ/stomach/proc/handle_disgust(mob/living/carbon/human/H)
|
||||
if(H.disgust)
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
var/list/languages_possible
|
||||
var/say_mod = null
|
||||
var/taste_sensitivity = 15 // lower is more sensitive.
|
||||
var/maxHealth = TONGUE_MAX_HEALTH
|
||||
var/damage = 0
|
||||
maxHealth = TONGUE_MAX_HEALTH
|
||||
var/modifies_speech = FALSE
|
||||
var/static/list/languages_possible_base = typecacheof(list(
|
||||
/datum/language/common,
|
||||
@@ -24,6 +23,8 @@
|
||||
/datum/language/aphasia,
|
||||
/datum/language/slime,
|
||||
))
|
||||
healing_factor = STANDARD_ORGAN_HEALING*5 //Fast!!
|
||||
decay_factor = STANDARD_ORGAN_DECAY/2
|
||||
|
||||
/obj/item/organ/tongue/Initialize(mapload)
|
||||
. = ..()
|
||||
@@ -31,27 +32,34 @@
|
||||
|
||||
/obj/item/organ/tongue/proc/handle_speech(datum/source, list/speech_args)
|
||||
|
||||
/obj/item/organ/tongue/proc/adjustTongueLoss(mob/living/carbon/M, damage_mod)
|
||||
if (maxHealth == "alien")
|
||||
return
|
||||
if (maxHealth == "bone")
|
||||
var/target = M.get_bodypart(BODY_ZONE_HEAD)
|
||||
M.apply_damage(damage_mod, BURN, target)
|
||||
to_chat(M, "<span class='userdanger'>The drink burns your skull! Oof, your bones!</span>")
|
||||
return
|
||||
if(damage+damage_mod < 0)
|
||||
damage = 0
|
||||
/obj/item/organ/tongue/emp_act(severity)
|
||||
. = ..()
|
||||
if(. & EMP_PROTECT_SELF)
|
||||
return
|
||||
if(organ_flags & ORGAN_SYNTHETIC)
|
||||
var/errormessage = list("Runtime in tongue.dm, line 39: Undefined operation \"zapzap ow my tongue\"", "afhsjifksahgjkaslfhashfjsak", "-1.#IND", "Graham's number", "inside you all along", "awaiting at least 1 approving review before merging this taste request")
|
||||
owner.say("The pH is appropriately [pick(errormessage)].")
|
||||
|
||||
/obj/item/organ/tongue/applyOrganDamage(var/d, var/maximum = maxHealth)
|
||||
|
||||
if(!d) //Micro-optimization.
|
||||
return
|
||||
if(maximum < damage)
|
||||
return
|
||||
damage = CLAMP(damage + d, 0, maximum)
|
||||
var/mess = check_damage_thresholds(owner)
|
||||
prev_damage = damage
|
||||
if(mess && owner)
|
||||
to_chat(owner, mess)
|
||||
|
||||
damage += damage_mod
|
||||
if ((damage / maxHealth) > 1)
|
||||
to_chat(M, "<span class='userdanger'>Your tongue is singed beyond recognition, and disintegrates!</span>")
|
||||
to_chat(owner, "<span class='userdanger'>Your tongue is singed beyond recognition, and disintegrates!</span>")
|
||||
SSblackbox.record_feedback("tally", "fermi_chem", 1, "Tongues lost to Fermi")
|
||||
qdel(src)
|
||||
else if ((damage / maxHealth) > 0.85)
|
||||
to_chat(M, "<span class='warning'>Your tongue feels like it's about to fall out!.</span>")
|
||||
to_chat(owner, "<span class='warning'>Your tongue feels like it's about to fall out!.</span>")
|
||||
else if ((damage / maxHealth) > 0.5)
|
||||
to_chat(M, "<span class='notice'>Your tongue is really starting to hurt.</span>")
|
||||
to_chat(owner, "<span class='notice'>Your tongue is really starting to hurt.</span>")
|
||||
|
||||
|
||||
/obj/item/organ/tongue/Insert(mob/living/carbon/M, special = 0)
|
||||
@@ -168,7 +176,7 @@
|
||||
icon_state = "tonguexeno"
|
||||
say_mod = "hisses"
|
||||
taste_sensitivity = 10 // LIZARDS ARE ALIENS CONFIRMED
|
||||
maxHealth = "alien" //Their blood is acid, so, no, though a tongueless xeno might be funny
|
||||
maxHealth = 500 //They've a little mouth for a tongue, so it's pretty rhobust
|
||||
modifies_speech = TRUE // not really, they just hiss
|
||||
var/static/list/languages_possible_alien = typecacheof(list(
|
||||
/datum/language/xenocommon,
|
||||
@@ -189,9 +197,10 @@
|
||||
desc = "Apparently skeletons alter the sounds they produce through oscillation of their teeth, hence their characteristic rattling."
|
||||
icon_state = "tonguebone"
|
||||
say_mod = "rattles"
|
||||
organ_flags = ORGAN_NO_SPOIL
|
||||
attack_verb = list("bitten", "chattered", "chomped", "enamelled", "boned")
|
||||
taste_sensitivity = 101 // skeletons cannot taste anything
|
||||
maxHealth = "bone" //Take brute damage instead
|
||||
maxHealth = 75 //Take brute damage instead
|
||||
modifies_speech = TRUE
|
||||
var/chattering = FALSE
|
||||
var/phomeme_type = "sans"
|
||||
@@ -201,6 +210,16 @@
|
||||
. = ..()
|
||||
phomeme_type = pick(phomeme_types)
|
||||
|
||||
/obj/item/organ/tongue/bone/applyOrganDamage(var/d, var/maximum = maxHealth)
|
||||
if(d < 0)
|
||||
return
|
||||
if(!owner)
|
||||
return
|
||||
var/target = owner.get_bodypart(BODY_ZONE_HEAD)
|
||||
owner.apply_damage(d, BURN, target)
|
||||
to_chat(owner, "<span class='userdanger'>You feel your skull burning! Oof, your bones!</span>")
|
||||
return
|
||||
|
||||
/obj/item/organ/tongue/bone/handle_speech(datum/source, list/speech_args)
|
||||
if (chattering)
|
||||
chatter(speech_args[SPEECH_MESSAGE], phomeme_type, source)
|
||||
@@ -262,6 +281,7 @@
|
||||
icon_state = "tonguecybernetic"
|
||||
taste_sensitivity = 10
|
||||
maxHealth = 60 //It's robotic!
|
||||
organ_flags = ORGAN_SYNTHETIC
|
||||
|
||||
/obj/item/organ/tongue/cybernetic/handle_speech(datum/source, list/speech_args)
|
||||
speech_args[SPEECH_SPANS] |= SPAN_ROBOT
|
||||
@@ -271,3 +291,4 @@
|
||||
say_mod = "beeps"
|
||||
desc = "A voice synthesizer used by IPCs to smoothly interface with organic lifeforms."
|
||||
electronics_magic = FALSE
|
||||
organ_flags = ORGAN_SYNTHETIC
|
||||
|
||||
@@ -26,12 +26,14 @@
|
||||
zone = BODY_ZONE_HEAD
|
||||
slot = ORGAN_SLOT_ADAMANTINE_RESONATOR
|
||||
icon_state = "adamantine_resonator"
|
||||
decay_factor = 0
|
||||
|
||||
/obj/item/organ/vocal_cords/adamantine
|
||||
name = "adamantine vocal cords"
|
||||
desc = "When adamantine resonates, it causes all nearby pieces of adamantine to resonate as well. Adamantine golems use this to broadcast messages to nearby golems."
|
||||
actions_types = list(/datum/action/item_action/organ_action/use/adamantine_vocal_cords)
|
||||
icon_state = "adamantine_cords"
|
||||
decay_factor = 0
|
||||
|
||||
/datum/action/item_action/organ_action/use/adamantine_vocal_cords/Trigger()
|
||||
if(!IsAvailable())
|
||||
@@ -62,6 +64,7 @@
|
||||
var/cooldown_mod = 1
|
||||
var/base_multiplier = 1
|
||||
spans = list("colossus","yell")
|
||||
decay_factor = 0
|
||||
|
||||
/datum/action/item_action/organ_action/colossus
|
||||
name = "Voice of God"
|
||||
@@ -623,10 +626,6 @@
|
||||
/datum/action/item_action/organ_action/velvet
|
||||
name = "Velvet chords"
|
||||
var/obj/item/organ/vocal_cords/velvet/cords = null
|
||||
//icon_icon = 'icons/mob/screen_alert.dmi'
|
||||
//button_icon_state = "velvet_chords"
|
||||
//icon = 'icons/mob/screen_alert.dmi'
|
||||
//icon_state = "in_love"
|
||||
|
||||
/datum/action/item_action/organ_action/velvet/New()
|
||||
..()
|
||||
@@ -991,7 +990,7 @@
|
||||
if (HAS_TRAIT(H, TRAIT_DEAF))//How the heck you managed to get here I have no idea, but just in case!
|
||||
speaktrigger += "I can barely hear you! "
|
||||
//And the brain damage. And the brain damage. And the brain damage. And the brain damage. And the brain damage.
|
||||
switch(H.getBrainLoss())
|
||||
switch(H.getOrganLoss(ORGAN_SLOT_BRAIN))
|
||||
if(20 to 40)
|
||||
speaktrigger += "I have a mild head ache, "
|
||||
if(40 to 80)
|
||||
|
||||
Reference in New Issue
Block a user