This commit is contained in:
shellspeed1
2019-10-14 18:46:06 -07:00
parent 345e69a718
commit 470ec5d62b
114 changed files with 2124 additions and 592 deletions
+4 -4
View File
@@ -513,12 +513,12 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
log_combat(user, M, "attacked", "[src.name]", "(INTENT: [uppertext(user.a_intent)])")
M.adjust_blurriness(3)
M.adjust_eye_damage(rand(2,4))
var/obj/item/organ/eyes/eyes = M.getorganslot(ORGAN_SLOT_EYES)
if (!eyes)
return
if(eyes.eye_damage >= 10)
M.adjust_blurriness(3)
eyes.applyOrganDamage(rand(2,4))
if(eyes.damage >= 10)
M.adjust_blurriness(15)
if(M.stat != DEAD)
to_chat(M, "<span class='danger'>Your eyes start to bleed profusely!</span>")
@@ -532,7 +532,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
M.adjust_blurriness(10)
M.Unconscious(20)
M.Knockdown(40)
if (prob(eyes.eye_damage - 10 + 1))
if (prob(eyes.damage - 10 + 1))
M.become_blind(EYE_DAMAGE)
to_chat(M, "<span class='danger'>You go blind!</span>")
+7 -6
View File
@@ -17,26 +17,27 @@
/obj/item/organ/body_egg/Insert(var/mob/living/carbon/M, special = 0)
..()
ADD_TRAIT(owner, TRAIT_XENO_HOST, TRAIT_GENERIC)
START_PROCESSING(SSobj, src)
owner.med_hud_set_status()
INVOKE_ASYNC(src, .proc/AddInfectionImages, owner)
/obj/item/organ/body_egg/Remove(var/mob/living/carbon/M, special = 0)
STOP_PROCESSING(SSobj, src)
if(owner)
REMOVE_TRAIT(owner, TRAIT_XENO_HOST, TRAIT_GENERIC)
owner.med_hud_set_status()
INVOKE_ASYNC(src, .proc/RemoveInfectionImages, owner)
..()
/obj/item/organ/body_egg/process()
/obj/item/organ/body_egg/on_death()
. = ..()
if(!owner)
return
if(!(src in owner.internal_organs))
Remove(owner)
return
egg_process()
/obj/item/organ/body_egg/on_life()
. = ..()
egg_process()
/obj/item/organ/body_egg/proc/egg_process()
return
@@ -407,6 +407,7 @@
/obj/machinery/smartfridge/food = "food",
/obj/machinery/smartfridge/drinks = "drinks",
/obj/machinery/smartfridge/extract = "slimes",
/obj/machinery/smartfridge/organ = "organs",
/obj/machinery/smartfridge/chemistry = "chems",
/obj/machinery/smartfridge/chemistry/virology = "viruses",
/obj/machinery/smartfridge/disks = "disks")
+39 -18
View File
@@ -140,12 +140,10 @@
return ..()
/obj/item/defibrillator/emag_act(mob/user)
if(safety)
safety = FALSE
to_chat(user, "<span class='warning'>You silently disable [src]'s safety protocols with the cryptographic sequencer.</span>")
else
safety = TRUE
to_chat(user, "<span class='notice'>You silently enable [src]'s safety protocols with the cryptographic sequencer.</span>")
. = ..()
safety = !safety
to_chat(user, "<span class='warning'>You silently [safety ? "enable" : "disable"] [src]'s safety protocols with the cryptographic sequencer.</span>")
return TRUE
/obj/item/defibrillator/emp_act(severity)
. = ..()
@@ -442,9 +440,20 @@
do_help(H, user)
/obj/item/twohanded/shockpaddles/proc/can_defib(mob/living/carbon/H)
/obj/item/twohanded/shockpaddles/proc/can_defib(mob/living/carbon/H) //Our code here is different than tg, if it breaks in testing; BUG_PROBABLE_CAUSE
var/obj/item/organ/heart = H.getorgan(/obj/item/organ/heart)
if(H.suiciding || H.hellbound || HAS_TRAIT(H, TRAIT_HUSK))
return
if((world.time - H.timeofdeath) > tlimit)
return
if((H.getBruteLoss() >= MAX_REVIVE_BRUTE_DAMAGE) || (H.getFireLoss() >= MAX_REVIVE_FIRE_DAMAGE))
return
if(!heart || (heart.organ_flags & ORGAN_FAILING))
return
var/obj/item/organ/brain/BR = H.getorgan(/obj/item/organ/brain)
return (!H.suiciding && !(HAS_TRAIT(H, TRAIT_NOCLONE)) && !H.hellbound && ((world.time - H.timeofdeath) < tlimit) && (H.getBruteLoss() < 180) && (H.getFireLoss() < 180) && H.getorgan(/obj/item/organ/heart) && BR && !BR.damaged_brain)
if(QDELETED(BR) || BR.brain_death || (BR.organ_flags & ORGAN_FAILING) || H.suiciding)
return
return TRUE
/obj/item/twohanded/shockpaddles/proc/shock_touching(dmg, mob/H)
if(req_defib)
@@ -559,14 +568,12 @@
if(do_after(user, primetimer, target = H)) //beginning to place the paddles on patient's chest to allow some time for people to move away to stop the process
user.visible_message("<span class='notice'>[user] places [src] on [H]'s chest.</span>", "<span class='warning'>You place [src] on [H]'s chest.</span>")
playsound(src, 'sound/machines/defib_charge.ogg', 75, 0)
var/tplus = world.time - H.timeofdeath
// past this much time the patient is unrecoverable
// (in deciseconds)
// brain damage starts setting in on the patient after
// some time left rotting
// patients rot when they are killed, and die when they are dead
var/tplus = world.time - H.timeofdeath //length of time spent dead
var/tloss = deathtimer
var/total_burn = 0
var/total_brute = 0
var/obj/item/organ/heart = H.getorgan(/obj/item/organ/heart)
if(do_after(user, primetimer2, target = H)) //placed on chest and short delay to shock for dramatic effect, revive time is 5sec total
for(var/obj/item/carried_item in H.contents)
if(istype(carried_item, /obj/item/clothing/suit/space))
@@ -591,16 +598,26 @@
failed = "<span class='warning'>[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Patient's soul appears to be on another plane of existence. Further attempts futile.</span>"
else if (tplus > tlimit)
failed = "<span class='warning'>[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Body has decayed for too long. Further attempts futile.</span>"
else if (!H.getorgan(/obj/item/organ/heart))
else if (!heart)
failed = "<span class='warning'>[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Patient's heart is missing.</span>"
else if (heart.organ_flags & ORGAN_FAILING)
failed = "<span class='warning'>[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Patient's heart too damaged.</span>"
else if(total_burn >= 180 || total_brute >= 180)
failed = "<span class='warning'>[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Severe tissue damage makes recovery of patient impossible via defibrillator. Further attempts futile.</span>"
else if(H.get_ghost())
failed = "<span class='warning'>[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - No activity in patient's brain. Further attempts may be successful.</span>"
else
var/obj/item/organ/brain/BR = H.getorgan(/obj/item/organ/brain)
if(!BR || BR.damaged_brain)
failed = "<span class='warning'>[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Patient's brain is missing or damaged beyond point of no return. Further attempts futile.</span>"
if(BR) //BUG_PROBABLE_CAUSE - slight difference between us and tg
if(BR.organ_flags & ORGAN_FAILING)
failed = "<span class='warning'>[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Patient's brain tissue is damaged making recovery of patient impossible via defibrillator. Further attempts futile.</span>"
if(BR.brain_death)
failed = "<span class='warning'>[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Patient's brain damaged beyond point of no return. Further attempts futile.</span>"
if(H.suiciding || BR.brainmob?.suiciding)
failed = "<span class='warning'>[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - No intelligence pattern can be detected in patient's brain. Further attempts futile.</span>"
else
failed = "<span class='warning'>[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Patient's brain is missing. Further attempts futile.</span>"
if(failed)
user.visible_message(failed)
@@ -625,7 +642,7 @@
H.Jitter(100)
SEND_SIGNAL(H, COMSIG_LIVING_MINOR_SHOCK)
if(tplus > tloss)
H.adjustBrainLoss( max(0, min(99, ((tlimit - tplus) / tlimit * 100))), 150)
H.adjustOrganLoss(ORGAN_SLOT_BRAIN, max(0, min(99, ((tlimit - tplus) / tlimit * 100))), 150)
log_combat(user, H, "revived", defib)
if(req_defib)
if(defib.healdisk)
@@ -643,7 +660,11 @@
playsound(src, 'sound/machines/defib_failed.ogg', 50, 0)
else if(H.undergoing_cardiac_arrest())
H.set_heartattack(FALSE)
user.visible_message("<span class='notice'>[req_defib ? "[defib]" : "[src]"] pings: Patient's heart is now beating again.</span>")
if(!(heart.organ_flags & ORGAN_FAILING))
H.set_heartattack(FALSE)
user.visible_message("<span class='notice'>[req_defib ? "[defib]" : "[src]"] pings: Patient's heart is now beating again.</span>")
else
user.visible_message("<span class='warning'>[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed, heart damage detected.</span>")
playsound(src, 'sound/machines/defib_zap.ogg', 50, 1, -1)
@@ -211,7 +211,7 @@
data["occupant"]["toxLoss"] = mob_occupant.getToxLoss()
data["occupant"]["fireLoss"] = mob_occupant.getFireLoss()
data["occupant"]["cloneLoss"] = mob_occupant.getCloneLoss()
data["occupant"]["brainLoss"] = mob_occupant.getBrainLoss()
data["occupant"]["brainLoss"] = mob_occupant.getOrganLoss(ORGAN_SLOT_BRAIN)
data["occupant"]["reagents"] = list()
if(mob_occupant.reagents.reagent_list.len)
for(var/datum/reagent/R in mob_occupant.reagents.reagent_list)
+88 -17
View File
@@ -135,7 +135,7 @@ SLIME SCANNER
var/mob/living/carbon/human/H = M
if(H.undergoing_cardiac_arrest() && H.stat != DEAD)
to_chat(user, "<span class='danger'>Subject suffering from heart attack: Apply defibrillation or other electric shock immediately!</span>")
if(H.undergoing_liver_failure() && H.stat != DEAD)
if(H.undergoing_liver_failure() && H.stat != DEAD) //might be depreciated BUG_PROBABLE_CAUSE
to_chat(user, "<span class='danger'>Subject is suffering from liver failure: Apply Corazone and begin a liver transplant immediately!</span>")
var/msg = "<span class='info'>*---------*\nAnalyzing results for [M]:\n\tOverall status: [mob_status]\n"
@@ -157,12 +157,8 @@ SLIME SCANNER
msg += "\t<span class='alert'>Subject appears to have [M.getCloneLoss() > 30 ? "Severe" : "Minor"] cellular damage.</span>\n"
if(advanced)
msg += "\t<span class='info'>Cellular Damage Level: [M.getCloneLoss()].</span>\n"
if (M.getBrainLoss() >= 200 || !M.getorgan(/obj/item/organ/brain))
msg += "\t<span class='alert'>Subject's brain function is non-existent.</span>\n"
else if (M.getBrainLoss() >= 120)
msg += "\t<span class='alert'>Severe brain damage detected. Subject likely to have mental traumas.</span>\n"
else if (M.getBrainLoss() >= 45)
msg += "\t<span class='alert'>Brain damage detected.</span>\n"
if (!M.getorgan(/obj/item/organ/brain))
to_chat(user, "\t<span class='alert'>Subject lacks a brain.</span>") //Unsure how this won't proc for 50% of the cit playerbase (This is a joke everyone on cit a cute.)
if(ishuman(M) && advanced) // Should I make this not advanced?
var/mob/living/carbon/human/H = M
var/obj/item/organ/liver/L = H.getorganslot("liver")
@@ -194,6 +190,14 @@ SLIME SCANNER
if(Br.cached_size>5)
msg += "\t<span class='info'>Subject has a sizeable bosom with a [Br.size] cup.</span>\n"
if (M.getOrganLoss(ORGAN_SLOT_BRAIN) >= 200 || !M.getorgan(/obj/item/organ/brain))
msg += "\t<span class='alert'>Subject's brain function is non-existent.</span>\n"
else if (M.getOrganLoss(ORGAN_SLOT_BRAIN) >= 120)
msg += "\t<span class='alert'>Severe brain damage detected. Subject likely to have mental traumas.</span>\n"
else if (M.getOrganLoss(ORGAN_SLOT_BRAIN) >= 45)
msg += "\t<span class='alert'>Brain damage detected.</span>\n"
if(iscarbon(M))
var/mob/living/carbon/C = M
if(LAZYLEN(C.get_traumas()))
var/list/trauma_text = list()
@@ -212,11 +216,10 @@ SLIME SCANNER
if(C.roundstart_quirks.len)
msg += "\t<span class='info'>Subject has the following physiological traits: [C.get_trait_string()].</span>\n"
if(advanced)
msg += "\t<span class='info'>Brain Activity Level: [(200 - M.getBrainLoss())/2]%.</span>\n"
msg += "\t<span class='info'>Brain Activity Level: [(200 - M.getOrganLoss(ORGAN_SLOT_BRAIN))/2]%.</span>\n"
if(M.radiation)
msg += "\t<span class='alert'>Subject is irradiated.</span>\n"
if(advanced)
msg += "\t<span class='info'>Radiation Level: [M.radiation]%.</span>\n"
msg += "\t<span class='info'>Radiation Level: [M.radiation] rad</span>\n"
if(advanced && M.hallucinating())
msg += "\t<span class='info'>Subject is hallucinating.</span>\n"
@@ -247,11 +250,11 @@ SLIME SCANNER
healthy = FALSE
msg += "\t<span class='alert'>Subject is deaf.</span>\n"
else
if(ears.ear_damage)
msg += "\t<span class='alert'>Subject has [ears.ear_damage > UNHEALING_EAR_DAMAGE? "permanent ": "temporary "]hearing damage.</span>\n"
if(ears.damage)
to_chat(user, "\t<span class='alert'>Subject has [ears.damage > ears.maxHealth ? "permanent ": "temporary "]hearing damage.</span>")
healthy = FALSE
if(ears.deaf)
msg += "\t<span class='alert'>Subject is [ears.ear_damage > UNHEALING_EAR_DAMAGE ? "permanently ": "temporarily "] deaf.</span>\n"
to_chat(user, "\t<span class='alert'>Subject is [ears.damage > ears.maxHealth ? "permanently ": "temporarily "] deaf.</span>")
healthy = FALSE
if(healthy)
msg += "\t<span class='info'>Healthy.</span>\n"
@@ -267,13 +270,13 @@ SLIME SCANNER
if(HAS_TRAIT(C, TRAIT_NEARSIGHT))
msg += "\t<span class='alert'>Subject is nearsighted.</span>\n"
healthy = FALSE
if(eyes.eye_damage > 30)
if(eyes.damage > 30)
msg += "\t<span class='alert'>Subject has severe eye damage.</span>\n"
healthy = FALSE
else if(eyes.eye_damage > 20)
else if(eyes.damage > 20)
msg += "\t<span class='alert'>Subject has significant eye damage.</span>\n"
healthy = FALSE
else if(eyes.eye_damage)
else if(eyes.damage)
msg += "\t<span class='alert'>Subject has minor eye damage.</span>\n"
healthy = FALSE
if(healthy)
@@ -297,6 +300,59 @@ SLIME SCANNER
for(var/obj/item/bodypart/org in damaged)
msg += "\t\t<span class='info'>[capitalize(org.name)]: [(org.brute_dam > 0) ? "<font color='red'>[org.brute_dam]</font></span>" : "<font color='red'>0</font>"]-[(org.burn_dam > 0) ? "<font color='#FF8000'>[org.burn_dam]</font>" : "<font color='#FF8000'>0</font>"]\n"
//Organ damages report
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/minor_damage
var/major_damage
var/max_damage
var/report_organs = FALSE
//Piece together the lists to be reported
for(var/O in H.internal_organs)
var/obj/item/organ/organ = O
if(organ.organ_flags & ORGAN_FAILING)
report_organs = TRUE //if we report one organ, we report all organs, even if the lists are empty, just for consistency
if(max_damage)
max_damage += ", " //prelude the organ if we've already reported an organ
max_damage += organ.name //this just slaps the organ name into the string of text
else
max_damage = "\t<span class='alert'>Non-Functional Organs: " //our initial statement
max_damage += organ.name
else if(organ.damage > organ.high_threshold)
report_organs = TRUE
if(major_damage)
major_damage += ", "
major_damage += organ.name
else
major_damage = "\t<span class='info'>Severely Damaged Organs: "
major_damage += organ.name
else if(organ.damage > organ.low_threshold)
report_organs = TRUE
if(minor_damage)
minor_damage += ", "
minor_damage += organ.name
else
minor_damage = "\t<span class='info'>Mildly Damaged Organs: "
minor_damage += organ.name
if(report_organs) //we either finish the list, or set it to be empty if no organs were reported in that category
if(!max_damage)
max_damage = "\t<span class='alert'>Non-Functional Organs: </span>"
else
max_damage += "</span>"
if(!major_damage)
major_damage = "\t<span class='info'>Severely Damaged Organs: </span>"
else
major_damage += "</span>"
if(!minor_damage)
minor_damage = "\t<span class='info'>Mildly Damaged Organs: </span>"
else
minor_damage += "</span>"
msg += "[minor_damage]"
msg += "[major_damage]"
msg += "[max_damage]"
// Species and body temperature
if(ishuman(M))
@@ -385,7 +441,7 @@ SLIME SCANNER
if(M.reagents.reagent_list.len)
var/list/datum/reagent/reagents = list()
for(var/datum/reagent/R in M.reagents.reagent_list)
if(R.invisible)
if(R.chemical_flags & REAGENT_INVISIBLE)
continue
reagents += R
@@ -404,6 +460,21 @@ SLIME SCANNER
msg += "<span class='danger'>[R.name]</span>\n"
else
msg += "<span class='notice'>Subject is not addicted to any reagents.</span>\n"
if(M.reagents.has_reagent("fermiTox"))
var/datum/reagent/fermiTox = M.reagents.has_reagent("fermiTox")
switch(fermiTox.volume)
if(5 to 10)
msg += "<span class='notice'>Subject contains a low amount of toxic isomers.</span>\n"
if(10 to 25)
msg += "<span class='danger'>Subject contains toxic isomers.</span>\n"
if(25 to 50)
msg += "<span class='danger'>Subject contains a substantial amount of toxic isomers.</span>\n"
if(50 to 95)
msg += "<span class='danger'>Subject contains a high amount of toxic isomers.</span>\n"
if(95 to INFINITY)
msg += "<span class='danger'>Subject contains a extremely dangerous amount of toxic isomers.</span>\n"
msg += "*---------*</span>"
to_chat(user, msg)
+1 -1
View File
@@ -254,7 +254,7 @@
to_chat(user, "<span class='warning'>The MMI indicates that their mind is currently inactive; it might change!</span>")
return
if(BM.stat == DEAD || (M.brain && M.brain.damaged_brain))
if(BM.stat == DEAD || (M.brain && M.brain.organ_flags & ORGAN_FAILING))
to_chat(user, "<span class='warning'>Sticking a dead brain into the frame would sort of defeat the purpose!</span>")
return
+1 -1
View File
@@ -140,7 +140,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "bible",
else if(iscarbon(M))
var/mob/living/carbon/C = M
if(!istype(C.head, /obj/item/clothing/head))
C.adjustBrainLoss(10, 80)
C.adjustOrganLoss(ORGAN_SLOT_BRAIN, 10, 80)
to_chat(C, "<span class='danger'>You feel dumber.</span>")
if(smack)
+1 -1
View File
@@ -304,7 +304,7 @@
var/obj/item/bodypart/head/myhead = user.get_bodypart(BODY_ZONE_HEAD)//stole from chainsaw code
var/obj/item/organ/brain/B = user.getorganslot(ORGAN_SLOT_BRAIN)
B.vital = FALSE//this cant possibly be a good idea
B.organ_flags &= ~ORGAN_VITAL //this cant possibly be a good idea
var/randdir
for(var/i in 1 to 24)//like a headless chicken!
if(user.is_holding(src))
@@ -2,6 +2,24 @@
icon_state = "freezer"
var/jones = FALSE
/obj/structure/closet/secure_closet/freezer/Destroy()
recursive_organ_check(src)
..()
/obj/structure/closet/secure_closet/freezer/Initialize()
..()
recursive_organ_check(src)
/obj/structure/closet/secure_closet/freezer/open(mob/living/user)
if(opened || !can_open(user)) //dupe check just so we don't let the organs decay when someone fails to open the locker
return FALSE
recursive_organ_check(src)
return ..()
/obj/structure/closet/secure_closet/freezer/close(mob/living/user)
if(..()) //if we actually closed the locker
recursive_organ_check(src)
/obj/structure/closet/secure_closet/freezer/ex_act()
if(!jones)
jones = TRUE
+4
View File
@@ -31,6 +31,7 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an
/obj/structure/bodycontainer/Initialize()
. = ..()
GLOB.bodycontainers += src
recursive_organ_check(src)
/obj/structure/bodycontainer/Destroy()
GLOB.bodycontainers -= src
@@ -101,6 +102,7 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an
/obj/structure/bodycontainer/deconstruct(disassembled = TRUE)
new /obj/item/stack/sheet/metal (loc, 5)
recursive_organ_check(src)
qdel(src)
/obj/structure/bodycontainer/container_resist(mob/living/user)
@@ -120,6 +122,7 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an
open()
/obj/structure/bodycontainer/proc/open()
recursive_organ_check(src)
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
playsound(src, 'sound/effects/roll.ogg', 5, 1)
var/turf/T = get_step(src, dir)
@@ -134,6 +137,7 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an
for(var/atom/movable/AM in connected.loc)
if(!AM.anchored || AM == connected)
AM.forceMove(src)
recursive_organ_check(src)
update_icon()
/obj/structure/bodycontainer/get_remote_view_fullscreens(mob/user)