mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 11:37:40 +01:00
this shit dosen't even compile yet...
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
target.blinded += 1.5
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/eyes/eyes = target.internal_organs_by_name["eyes"]
|
||||
var/obj/item/organ/internal/eyes/eyes = target.internal_organs_by_name["eyes"]
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\red [user]'s hand slips, slicing [target]'s eyes wth \the [tool]!" , \
|
||||
"\red Your hand slips, slicing [target]'s eyes wth \the [tool]!" )
|
||||
@@ -69,7 +69,7 @@
|
||||
target.op_stage.eyes = 2
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/eyes/eyes = target.internal_organs_by_name["eyes"]
|
||||
var/obj/item/organ/internal/eyes/eyes = target.internal_organs_by_name["eyes"]
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\red [user]'s hand slips, damaging [target]'s eyes with \the [tool]!", \
|
||||
"\red Your hand slips, damaging [target]'s eyes with \the [tool]!")
|
||||
@@ -100,7 +100,7 @@
|
||||
target.op_stage.eyes = 3
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/eyes/eyes = target.internal_organs_by_name["eyes"]
|
||||
var/obj/item/organ/internal/eyes/eyes = target.internal_organs_by_name["eyes"]
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\red [user]'s hand slips, stabbing \the [tool] into [target]'s eye!", \
|
||||
"\red Your hand slips, stabbing \the [tool] into [target]'s eye!")
|
||||
@@ -136,7 +136,7 @@
|
||||
target.op_stage.eyes = 0
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/eyes/eyes = target.internal_organs_by_name["eyes"]
|
||||
var/obj/item/organ/internal/eyes/eyes = target.internal_organs_by_name["eyes"]
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\red [user]'s hand slips, searing [target]'s eyes with \the [tool]!", \
|
||||
"\red Your hand slips, searing [target]'s eyes with \the [tool]!")
|
||||
|
||||
@@ -130,6 +130,7 @@
|
||||
affected.owner.custom_pain("You feel something rip in your [affected.name]!", 1)
|
||||
user.drop_item()
|
||||
affected.hidden = tool
|
||||
target.internal_organs += tool
|
||||
tool.loc = target
|
||||
affected.cavity = 0
|
||||
|
||||
|
||||
@@ -0,0 +1,364 @@
|
||||
/****************************************************
|
||||
BLOOD SYSTEM
|
||||
****************************************************/
|
||||
//Blood levels
|
||||
var/const/BLOOD_VOLUME_SAFE = 501
|
||||
var/const/BLOOD_VOLUME_OKAY = 336
|
||||
var/const/BLOOD_VOLUME_BAD = 224
|
||||
var/const/BLOOD_VOLUME_SURVIVE = 122
|
||||
|
||||
/mob/living/carbon/human/var/datum/reagents/vessel //Container for blood and BLOOD ONLY. Do not transfer other chems here.
|
||||
/mob/living/carbon/human/var/var/pale = 0 //Should affect how mob sprite is drawn, but currently doesn't.
|
||||
|
||||
//Initializes blood vessels
|
||||
/mob/living/carbon/human/proc/make_blood()
|
||||
|
||||
if(vessel)
|
||||
return
|
||||
|
||||
vessel = new/datum/reagents(600)
|
||||
vessel.my_atom = src
|
||||
|
||||
if(species && species.exotic_blood)
|
||||
vessel.add_reagent(species.exotic_blood,560)
|
||||
else
|
||||
vessel.add_reagent("blood",560)
|
||||
spawn(1)
|
||||
fixblood()
|
||||
|
||||
//Resets blood data
|
||||
/mob/living/carbon/human/proc/fixblood()
|
||||
for(var/datum/reagent/blood/B in vessel.reagent_list)
|
||||
if(B.id == "blood")
|
||||
B.data = list( "donor"=src,"viruses"=null,"blood_DNA"=dna.unique_enzymes,"blood_colour"= species.blood_color,"blood_type"=dna.b_type, \
|
||||
"resistances"=null,"trace_chem"=null, "virus2" = null, "antibodies" = null)
|
||||
B.color = B.data["blood_colour"]
|
||||
|
||||
// Takes care blood loss and regeneration
|
||||
/mob/living/carbon/human/proc/handle_blood()
|
||||
var/blood_volume
|
||||
if(species && species.flags & NO_BLOOD)
|
||||
return
|
||||
if(stat != DEAD && bodytemperature >= 170) //Dead or cryosleep people do not pump the blood.
|
||||
if(species.exotic_blood)
|
||||
blood_volume = round(vessel.get_reagent_amount(species.exotic_blood))
|
||||
if(blood_volume < 560 && blood_volume)
|
||||
var/datum/reagent/water/W = locate() in vessel.reagent_list //Grab some blood
|
||||
if(W) // Make sure there's some blood at all
|
||||
W.volume += 0.1 // regenerate blood VERY slowly
|
||||
if (reagents.has_reagent("nutriment")) //Getting food speeds it up
|
||||
W.volume += 0.4
|
||||
reagents.remove_reagent("nutriment", 0.1)
|
||||
else
|
||||
blood_volume = round(vessel.get_reagent_amount("blood"))
|
||||
//Blood regeneration if there is some space
|
||||
if(blood_volume < 560 && blood_volume)
|
||||
var/datum/reagent/blood/B = locate() in vessel.reagent_list //Grab some blood
|
||||
if(B) // Make sure there's some blood at all
|
||||
|
||||
if(src.mind) //Handles vampires "eating" blood that isn't their own.
|
||||
if(src.mind in ticker.mode.vampires)
|
||||
for(var/datum/reagent/blood/BL in vessel.reagent_list)
|
||||
if(src.nutrition >= 450)
|
||||
break //We don't want blood tranfusions making vampires fat.
|
||||
if(BL.data["donor"] != src)
|
||||
src.nutrition += (15 * REAGENTS_METABOLISM)
|
||||
BL.volume -= REAGENTS_METABOLISM
|
||||
if(BL.volume <= 0)
|
||||
qdel(BL)
|
||||
break //Only process one blood per tick, to maintain the same metabolism as nutriment for non-vampires.
|
||||
|
||||
if(B.data["donor"] != src) //If it's not theirs, then we look for theirs
|
||||
for(var/datum/reagent/blood/D in vessel.reagent_list)
|
||||
if(D.data["donor"] == src)
|
||||
B = D
|
||||
break
|
||||
|
||||
B.volume += 0.1 // regenerate blood VERY slowly
|
||||
if (reagents.has_reagent("nutriment")) //Getting food speeds it up
|
||||
B.volume += 0.4
|
||||
reagents.remove_reagent("nutriment", 0.1)
|
||||
if (reagents.has_reagent("iron")) //Hematogen candy anyone?
|
||||
B.volume += 0.8
|
||||
reagents.remove_reagent("iron", 0.1)
|
||||
if (reagents.has_reagent("salglu_solution")) //saline is good for blood regeneration
|
||||
if(prob(33))
|
||||
B.volume += 1.0
|
||||
|
||||
// Damaged heart virtually reduces the blood volume, as the blood isn't
|
||||
// being pumped properly anymore.
|
||||
var/obj/item/organ/internal/heart/heart = internal_organs_by_name["heart"]
|
||||
|
||||
if(heart)
|
||||
if(heart.damage > 1 && heart.damage < heart.min_bruised_damage)
|
||||
blood_volume *= 0.8
|
||||
else if(heart.damage >= heart.min_bruised_damage && heart.damage < heart.min_broken_damage)
|
||||
blood_volume *= 0.6
|
||||
else if(heart.damage >= heart.min_broken_damage && heart.damage < INFINITY)
|
||||
blood_volume *= 0.3
|
||||
|
||||
//Effects of bloodloss
|
||||
switch(blood_volume)
|
||||
if(BLOOD_VOLUME_SAFE to 10000)
|
||||
if(pale)
|
||||
pale = 0
|
||||
update_body()
|
||||
if(BLOOD_VOLUME_OKAY to BLOOD_VOLUME_SAFE)
|
||||
if(!pale)
|
||||
pale = 1
|
||||
update_body()
|
||||
var/word = pick("dizzy","woosey","faint")
|
||||
src << "\red You feel [word]"
|
||||
if(prob(1))
|
||||
var/word = pick("dizzy","woosey","faint")
|
||||
src << "\red You feel [word]"
|
||||
if(oxyloss < 20)
|
||||
oxyloss += 3
|
||||
if(BLOOD_VOLUME_BAD to BLOOD_VOLUME_OKAY)
|
||||
if(!pale)
|
||||
pale = 1
|
||||
update_body()
|
||||
eye_blurry += 6
|
||||
if(oxyloss < 50)
|
||||
oxyloss += 10
|
||||
oxyloss += 1
|
||||
if(prob(15))
|
||||
Paralyse(rand(1,3))
|
||||
var/word = pick("dizzy","woosey","faint")
|
||||
src << "\red You feel very [word]"
|
||||
if(BLOOD_VOLUME_SURVIVE to BLOOD_VOLUME_BAD)
|
||||
if(!pale)
|
||||
pale = 1
|
||||
update_body()
|
||||
if(oxyloss > 20)
|
||||
eye_blurry += 6
|
||||
oxyloss += 12
|
||||
if(prob(15))
|
||||
Paralyse(rand(1,3))
|
||||
var/word = pick("dizzy","woosey","faint")
|
||||
src << "\red You feel extremely [word]"
|
||||
if(0 to BLOOD_VOLUME_SURVIVE)
|
||||
// There currently is a strange bug here. If the mob is not below -100 health
|
||||
// when death() is called, apparently they will be just fine, and this way it'll
|
||||
// spam deathgasp. Adjusting toxloss ensures the mob will stay dead.
|
||||
toxloss += 300 // just to be safe!
|
||||
death()
|
||||
|
||||
// Without enough blood you slowly go hungry.
|
||||
if(blood_volume < BLOOD_VOLUME_SAFE)
|
||||
if(nutrition >= 300)
|
||||
nutrition -= 10
|
||||
else if(nutrition >= 200)
|
||||
nutrition -= 3
|
||||
|
||||
//Bleeding out
|
||||
var/blood_max = 0
|
||||
for(var/obj/item/organ/external/temp in organs)
|
||||
if(!(temp.status & ORGAN_BLEEDING) || temp.status & ORGAN_ROBOT)
|
||||
continue
|
||||
for(var/datum/wound/W in temp.wounds) if(W.bleeding())
|
||||
blood_max += W.damage / 4
|
||||
if (temp.open)
|
||||
blood_max += 2 //Yer stomach is cut open
|
||||
drip(blood_max)
|
||||
|
||||
//Makes a blood drop, leaking certain amount of blood from the mob
|
||||
/mob/living/carbon/human/proc/drip(var/amt as num)
|
||||
|
||||
if(species && species.flags & NO_BLOOD) //TODO: Make drips come from the reagents instead.
|
||||
return
|
||||
|
||||
if(!amt)
|
||||
return
|
||||
|
||||
var/amm = 0.1 * amt
|
||||
var/turf/T = get_turf(src)
|
||||
|
||||
if(src.species.exotic_blood)
|
||||
vessel.remove_reagent(species.exotic_blood,amm)
|
||||
vessel.reaction(T, TOUCH, amm)
|
||||
return
|
||||
|
||||
else
|
||||
vessel.remove_reagent("blood",amm)
|
||||
blood_splatter(src,src)
|
||||
|
||||
|
||||
/****************************************************
|
||||
BLOOD TRANSFERS
|
||||
****************************************************/
|
||||
|
||||
//Gets blood from mob to the container, preserving all data in it.
|
||||
/mob/living/carbon/proc/take_blood(obj/item/weapon/reagent_containers/container, var/amount)
|
||||
var/datum/reagent/B = get_blood(container.reagents)
|
||||
if(!B) B = new /datum/reagent/blood
|
||||
B.holder = container
|
||||
B.volume += amount
|
||||
|
||||
|
||||
|
||||
//set reagent data
|
||||
B.data["donor"] = src
|
||||
if (!B.data["virus2"])
|
||||
B.data["virus2"] = list()
|
||||
B.data["virus2"] |= virus_copylist(src.virus2)
|
||||
B.data["antibodies"] = src.antibodies
|
||||
B.data["blood_DNA"] = copytext(src.dna.unique_enzymes,1,0)
|
||||
B.data["blood_type"] = copytext(src.dna.b_type,1,0)
|
||||
|
||||
// Putting this here due to return shenanigans.
|
||||
if(istype(src,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = src
|
||||
B.data["blood_colour"] = H.species.blood_color
|
||||
B.color = B.data["blood_colour"]
|
||||
|
||||
var/list/temp_chem = list()
|
||||
for(var/datum/reagent/R in src.reagents.reagent_list)
|
||||
temp_chem += R.id
|
||||
temp_chem[R.id] = R.volume
|
||||
B.data["trace_chem"] = list2params(temp_chem)
|
||||
return B
|
||||
|
||||
//For humans, blood does not appear from blue, it comes from vessels.
|
||||
/mob/living/carbon/human/take_blood(obj/item/weapon/reagent_containers/container, var/amount)
|
||||
if(src.species.exotic_blood)
|
||||
if(vessel.get_reagent_amount(src.species.exotic_blood) < amount)
|
||||
return null
|
||||
var/datum/reagent/W = new /datum/reagent
|
||||
W.holder = container
|
||||
W.volume += amount
|
||||
var/list/temp_chem = list()
|
||||
for(var/datum/reagent/R in src.reagents.reagent_list)
|
||||
temp_chem += R.id
|
||||
temp_chem[R.id] = R.volume
|
||||
W.data["trace_chem"] = list2params(temp_chem)
|
||||
vessel.remove_reagent(src.species.exotic_blood,amount) // Removes blood if human
|
||||
return W
|
||||
if(species && species.flags & NO_BLOOD)
|
||||
return null
|
||||
else
|
||||
if(vessel.get_reagent_amount("blood") < amount)
|
||||
return null
|
||||
. = ..()
|
||||
vessel.remove_reagent("blood",amount) // Removes blood if human
|
||||
|
||||
//Transfers blood from container ot vessels
|
||||
/mob/living/carbon/proc/inject_blood(obj/item/weapon/reagent_containers/container, var/amount)
|
||||
var/datum/reagent/blood/injected = get_blood(container.reagents)
|
||||
if (!injected)
|
||||
return
|
||||
var/list/sniffles = virus_copylist(injected.data["virus2"])
|
||||
for(var/ID in sniffles)
|
||||
var/datum/disease2/disease/sniffle = sniffles[ID]
|
||||
infect_virus2(src,sniffle,1)
|
||||
if (injected.data["antibodies"] && prob(5))
|
||||
antibodies |= injected.data["antibodies"]
|
||||
var/list/chems = list()
|
||||
chems = params2list(injected.data["trace_chem"])
|
||||
for(var/C in chems)
|
||||
src.reagents.add_reagent(C, (text2num(chems[C]) / 560) * amount)//adds trace chemicals to owner's blood
|
||||
reagents.update_total()
|
||||
|
||||
container.reagents.remove_reagent("blood", amount)
|
||||
|
||||
//Transfers blood from container ot vessels, respecting blood types compatability.
|
||||
/mob/living/carbon/human/inject_blood(obj/item/weapon/reagent_containers/container, var/amount)
|
||||
|
||||
var/datum/reagent/blood/injected = get_blood(container.reagents)
|
||||
|
||||
if(species && species.flags & NO_BLOOD)
|
||||
reagents.add_reagent("blood", amount, injected.data)
|
||||
reagents.update_total()
|
||||
return
|
||||
|
||||
var/datum/reagent/blood/our = get_blood(vessel)
|
||||
|
||||
if (!injected || !our)
|
||||
return
|
||||
if(blood_incompatible(injected.data["blood_type"],our.data["blood_type"]) )
|
||||
reagents.add_reagent("toxin",amount * 0.5)
|
||||
reagents.update_total()
|
||||
else
|
||||
vessel.add_reagent("blood", amount, injected.data)
|
||||
vessel.update_total()
|
||||
..()
|
||||
|
||||
//Gets human's own blood.
|
||||
/mob/living/carbon/proc/get_blood(datum/reagents/container)
|
||||
var/datum/reagent/blood/res = locate() in container.reagent_list //Grab some blood
|
||||
if(res) // Make sure there's some blood at all
|
||||
if(res.data["donor"] != src) //If it's not theirs, then we look for theirs
|
||||
for(var/datum/reagent/blood/D in container.reagent_list)
|
||||
if(D.data["donor"] == src)
|
||||
return D
|
||||
return res
|
||||
|
||||
/proc/blood_incompatible(donor,receiver)
|
||||
|
||||
var/donor_antigen = copytext(donor,1,lentext(donor))
|
||||
var/receiver_antigen = copytext(receiver,1,lentext(receiver))
|
||||
var/donor_rh = findtext("+",donor)
|
||||
var/receiver_rh = findtext("+",receiver)
|
||||
|
||||
if(donor_rh && !receiver_rh) return 1
|
||||
switch(receiver_antigen)
|
||||
if("A")
|
||||
if(donor_antigen != "A" && donor_antigen != "O") return 1
|
||||
if("B")
|
||||
if(donor_antigen != "B" && donor_antigen != "O") return 1
|
||||
if("O")
|
||||
if(donor_antigen != "O") return 1
|
||||
//AB is a universal receiver.
|
||||
return 0
|
||||
|
||||
proc/blood_splatter(var/target,var/datum/reagent/blood/source,var/large)
|
||||
|
||||
var/obj/effect/decal/cleanable/blood/B
|
||||
var/decal_type = /obj/effect/decal/cleanable/blood/splatter
|
||||
var/turf/T = get_turf(target)
|
||||
|
||||
if(istype(source,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/M = source
|
||||
source = M.get_blood(M.vessel)
|
||||
|
||||
// Are we dripping or splattering?
|
||||
var/list/drips = list()
|
||||
// Only a certain number of drips (or one large splatter) can be on a given turf.
|
||||
for(var/obj/effect/decal/cleanable/blood/drip/drop in T)
|
||||
drips |= drop.drips
|
||||
qdel(drop)
|
||||
if(!large && drips.len < 3)
|
||||
decal_type = /obj/effect/decal/cleanable/blood/drip
|
||||
|
||||
// Find a blood decal or create a new one.
|
||||
B = locate(decal_type) in T
|
||||
if(!B)
|
||||
B = new decal_type(T)
|
||||
|
||||
var/obj/effect/decal/cleanable/blood/drip/drop = B
|
||||
if(istype(drop) && drips && drips.len && !large)
|
||||
drop.overlays |= drips
|
||||
drop.drips |= drips
|
||||
|
||||
// If there's no data to copy, call it quits here.
|
||||
if(!source)
|
||||
return B
|
||||
|
||||
// Update appearance.
|
||||
if(source.data["blood_colour"])
|
||||
B.basecolor = source.data["blood_colour"]
|
||||
B.update_icon()
|
||||
|
||||
// Update blood information.
|
||||
if(source.data["blood_DNA"])
|
||||
B.blood_DNA = list()
|
||||
if(source.data["blood_type"])
|
||||
B.blood_DNA[source.data["blood_DNA"]] = source.data["blood_type"]
|
||||
else
|
||||
B.blood_DNA[source.data["blood_DNA"]] = "O+"
|
||||
|
||||
// Update virus information.
|
||||
if(source.data["virus2"])
|
||||
B.virus2 = virus_copylist(source.data["virus2"])
|
||||
|
||||
return B
|
||||
@@ -0,0 +1,53 @@
|
||||
/obj/item/organ/internal/body_egg
|
||||
name = "body egg"
|
||||
desc = "All slimy and yuck."
|
||||
icon_state = "innards"
|
||||
origin_tech = "biotech=5"
|
||||
parent_organ = "chest"
|
||||
slot = "parasite_egg"
|
||||
|
||||
/obj/item/organ/internal/body_egg/on_find(mob/living/finder)
|
||||
..()
|
||||
finder << "<span class='warning'>You found an unknown alien organism in [owner]'s [parent_organ]!</span>"
|
||||
|
||||
/obj/item/organ/internal/body_egg/New(loc)
|
||||
if(iscarbon(loc))
|
||||
src.Insert(loc)
|
||||
return ..()
|
||||
|
||||
/obj/item/organ/internal/body_egg/Insert(var/mob/living/carbon/M, special = 0)
|
||||
..()
|
||||
owner.status_flags |= XENO_HOST
|
||||
processing_objects.Add(src)
|
||||
owner.med_hud_set_status()
|
||||
spawn(0)
|
||||
AddInfectionImages(owner)
|
||||
|
||||
/obj/item/organ/internal/body_egg/Remove(var/mob/living/carbon/M, special = 0)
|
||||
processing_objects.Remove(src)
|
||||
if(owner)
|
||||
owner.status_flags &= ~(XENO_HOST)
|
||||
owner.med_hud_set_status()
|
||||
spawn(0)
|
||||
RemoveInfectionImages(owner)
|
||||
..()
|
||||
|
||||
/obj/item/organ/internal/body_egg/process()
|
||||
if(!owner) return
|
||||
if(!(src in owner.internal_organs))
|
||||
Remove(owner)
|
||||
return
|
||||
egg_process()
|
||||
|
||||
/obj/item/organ/internal/body_egg/proc/egg_process()
|
||||
return
|
||||
|
||||
/obj/item/organ/internal/body_egg/proc/RefreshInfectionImage()
|
||||
RemoveInfectionImages()
|
||||
AddInfectionImages()
|
||||
|
||||
/obj/item/organ/internal/body_egg/proc/AddInfectionImages()
|
||||
return
|
||||
|
||||
/obj/item/organ/internal/body_egg/proc/RemoveInfectionImages()
|
||||
return
|
||||
@@ -0,0 +1,35 @@
|
||||
/mob/proc/get_int_organ(typepath) //int stands for internal
|
||||
return
|
||||
|
||||
/mob/proc/get_organs_zone(zone)
|
||||
return
|
||||
|
||||
/mob/proc/get_organ_slot(slot) //is it a brain, is it a brain_tumor?
|
||||
return
|
||||
|
||||
/mob/living/carbon/get_int_organ(typepath)
|
||||
return (locate(typepath) in internal_organs)
|
||||
|
||||
|
||||
/mob/living/carbon/get_organs_zone(zone, var/subzones = 0)
|
||||
var/list/returnorg = list()
|
||||
if(subzones)
|
||||
// Include subzones - groin for chest, eyes and mouth for head
|
||||
//Fethas note:We have check_zone, i may need to remove the below
|
||||
if(zone == "head")
|
||||
returnorg = get_organs_zone("eyes") + get_organs_zone("mouth")
|
||||
if(zone == "chest")
|
||||
returnorg = get_organs_zone("groin")
|
||||
|
||||
for(var/obj/item/organ/internal/O in internal_organs)
|
||||
if(parent_organ == O.parent_organ)
|
||||
returnorg += O
|
||||
return returnorg
|
||||
|
||||
/mob/living/carbon/get_organ_slot(slot)
|
||||
for(var/obj/item/organ/internal/O in internal_organs)
|
||||
if(slot == O.slot)
|
||||
return O
|
||||
|
||||
/proc/is_int_organ(atom/A)
|
||||
return istype(A, /obj/item/organ/internal)
|
||||
@@ -0,0 +1,290 @@
|
||||
var/list/organ_cache = list()
|
||||
|
||||
/obj/item/organ
|
||||
name = "organ"
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
var/dead_icon
|
||||
var/mob/living/carbon/owner = null
|
||||
var/status = 0
|
||||
var/vital //Lose a vital limb, die immediately.
|
||||
var/damage = 0 // amount of damage to the organ
|
||||
|
||||
var/min_bruised_damage = 10
|
||||
var/min_broken_damage = 30
|
||||
var/max_damage
|
||||
var/organ_tag = "organ"
|
||||
|
||||
var/parent_organ = "chest"
|
||||
var/robotic = 0 //For being a robot
|
||||
|
||||
var/list/datum/autopsy_data/autopsy_data = list()
|
||||
var/list/trace_chemicals = list() // traces of chemicals in the organ,
|
||||
// links chemical IDs to number of ticks for which they'll stay in the blood
|
||||
germ_level = 0
|
||||
var/datum/dna/dna
|
||||
var/datum/species/species
|
||||
|
||||
/obj/item/organ/Destroy()
|
||||
if(!owner)
|
||||
return ..()
|
||||
/*
|
||||
if(istype(owner, /mob/living/carbon))
|
||||
if((owner.internal_organs) && (src in owner.internal_organs))
|
||||
owner.internal_organs -= src
|
||||
if(istype(owner, /mob/living/carbon/human))
|
||||
if((owner.internal_organs_by_name) && (src in owner.internal_organs_by_name))
|
||||
owner.internal_organs_by_name -= src
|
||||
if((owner.organs) && (src in owner.organs))
|
||||
owner.organs -= src
|
||||
if((owner.organs_by_name) && (src in owner.organs_by_name))
|
||||
owner.organs_by_name -= src
|
||||
*/
|
||||
if(src in owner.contents)
|
||||
owner.contents -= src
|
||||
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/organ/proc/update_health()
|
||||
return
|
||||
|
||||
/obj/item/organ/New(var/mob/living/carbon/holder, var/internal)
|
||||
..(holder)
|
||||
create_reagents(5)
|
||||
if(!max_damage)
|
||||
max_damage = min_broken_damage * 2
|
||||
if(istype(holder))
|
||||
src.owner = holder
|
||||
species = all_species["Human"]
|
||||
if(holder.dna)
|
||||
dna = holder.dna.Clone()
|
||||
species = all_species[dna.species]
|
||||
else
|
||||
log_to_dd("[src] at [loc] spawned without a proper DNA.")
|
||||
var/mob/living/carbon/human/H = holder
|
||||
if(istype(H))
|
||||
if(internal)
|
||||
var/obj/item/organ/external/E = H.organs_by_name[src.parent_organ]
|
||||
if(E)
|
||||
if(E.internal_organs == null)
|
||||
E.internal_organs = list()
|
||||
E.internal_organs |= src
|
||||
if(dna)
|
||||
if(!blood_DNA)
|
||||
blood_DNA = list()
|
||||
blood_DNA[dna.unique_enzymes] = dna.b_type
|
||||
if(internal)
|
||||
holder.internal_organs |= src
|
||||
|
||||
/obj/item/organ/proc/set_dna(var/datum/dna/new_dna)
|
||||
if(new_dna)
|
||||
dna = new_dna.Clone()
|
||||
blood_DNA.Cut()
|
||||
blood_DNA[dna.unique_enzymes] = dna.b_type
|
||||
|
||||
/obj/item/organ/proc/die()
|
||||
if(status & ORGAN_ROBOT)
|
||||
return
|
||||
damage = max_damage
|
||||
status |= ORGAN_DEAD
|
||||
processing_objects -= src
|
||||
if(dead_icon)
|
||||
icon_state = dead_icon
|
||||
if(owner && vital)
|
||||
owner.death()
|
||||
|
||||
/obj/item/organ/process()
|
||||
if(loc != owner)
|
||||
owner = null
|
||||
|
||||
//dead already, no need for more processing
|
||||
if(status & ORGAN_DEAD)
|
||||
return
|
||||
|
||||
// Don't process if we're in a freezer, an MMI or a stasis bag. //TODO: ambient temperature?
|
||||
if(istype(loc,/obj/item/device/mmi) || istype(loc,/obj/item/bodybag/cryobag) || istype(loc,/obj/structure/closet/crate/freezer))
|
||||
return
|
||||
|
||||
//Process infections
|
||||
if ((status & ORGAN_ROBOT) || (owner && owner.species && (owner.species.flags & IS_PLANT)))
|
||||
germ_level = 0
|
||||
return
|
||||
|
||||
if(!owner)
|
||||
if(reagents)
|
||||
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in reagents.reagent_list
|
||||
if(B && prob(40))
|
||||
reagents.remove_reagent("blood",0.1)
|
||||
blood_splatter(src,B,1)
|
||||
|
||||
germ_level += rand(2,6)
|
||||
if(germ_level >= INFECTION_LEVEL_TWO)
|
||||
germ_level += rand(2,6)
|
||||
if(germ_level >= INFECTION_LEVEL_THREE)
|
||||
die()
|
||||
|
||||
if(damage >= max_damage)
|
||||
die()
|
||||
|
||||
else if(owner.bodytemperature >= 170) //cryo stops germs from moving and doing their bad stuffs
|
||||
//** Handle antibiotics and curing infections
|
||||
handle_antibiotics()
|
||||
handle_germ_effects()
|
||||
|
||||
//check if we've hit max_damage
|
||||
if(damage >= max_damage)
|
||||
die()
|
||||
|
||||
/obj/item/organ/examine(mob/user)
|
||||
..(user)
|
||||
if(status & ORGAN_DEAD)
|
||||
user << "<span class='notice'>The decay has set in.</span>"
|
||||
|
||||
/obj/item/organ/proc/handle_germ_effects()
|
||||
//** Handle the effects of infections
|
||||
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
|
||||
|
||||
if (germ_level > 0 && germ_level < INFECTION_LEVEL_ONE/2 && prob(30))
|
||||
germ_level--
|
||||
|
||||
if (germ_level >= INFECTION_LEVEL_ONE/2)
|
||||
//aiming for germ level to go from ambient to INFECTION_LEVEL_TWO in an average of 15 minutes
|
||||
if(antibiotics < 5 && prob(round(germ_level/6)))
|
||||
germ_level++
|
||||
|
||||
if(germ_level >= INFECTION_LEVEL_ONE)
|
||||
var/fever_temperature = (owner.species.heat_level_1 - owner.species.body_temperature - 5)* min(germ_level/INFECTION_LEVEL_TWO, 1) + owner.species.body_temperature
|
||||
owner.bodytemperature += between(0, (fever_temperature - T20C)/BODYTEMP_COLD_DIVISOR + 1, fever_temperature - owner.bodytemperature)
|
||||
|
||||
if (germ_level >= INFECTION_LEVEL_TWO)
|
||||
var/obj/item/organ/external/parent = owner.get_organ(parent_organ)
|
||||
//spread germs
|
||||
if (antibiotics < 5 && parent.germ_level < germ_level && ( parent.germ_level < INFECTION_LEVEL_ONE*2 || prob(30) ))
|
||||
parent.germ_level++
|
||||
|
||||
if (prob(3)) //about once every 30 seconds
|
||||
take_damage(1,silent=prob(30))
|
||||
|
||||
/obj/item/organ/proc/receive_chem(chemical as obj)
|
||||
return 0
|
||||
|
||||
/obj/item/organ/proc/rejuvenate()
|
||||
damage = 0
|
||||
|
||||
/obj/item/organ/proc/is_damaged()
|
||||
return damage > 0
|
||||
|
||||
/obj/item/organ/proc/is_bruised()
|
||||
return damage >= min_bruised_damage
|
||||
|
||||
/obj/item/organ/proc/is_broken()
|
||||
return (damage >= min_broken_damage || (status & ORGAN_CUT_AWAY) || ((status & ORGAN_BROKEN) && !(status & ORGAN_SPLINTED)))
|
||||
|
||||
//Germs
|
||||
/obj/item/organ/proc/handle_antibiotics()
|
||||
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
|
||||
|
||||
if (!germ_level || antibiotics < 5)
|
||||
return
|
||||
|
||||
if (germ_level < INFECTION_LEVEL_ONE)
|
||||
germ_level = 0 //cure instantly
|
||||
else if (germ_level < INFECTION_LEVEL_TWO)
|
||||
germ_level -= 6 //at germ_level == 500, this should cure the infection in a minute
|
||||
else
|
||||
germ_level -= 2 //at germ_level == 1000, this will cure the infection in 5 minutes
|
||||
|
||||
//Adds autopsy data for used_weapon.
|
||||
/obj/item/organ/proc/add_autopsy_data(var/used_weapon, var/damage)
|
||||
var/datum/autopsy_data/W = autopsy_data[used_weapon]
|
||||
if(!W)
|
||||
W = new()
|
||||
W.weapon = used_weapon
|
||||
autopsy_data[used_weapon] = W
|
||||
|
||||
W.hits += 1
|
||||
W.damage += damage
|
||||
W.time_inflicted = world.time
|
||||
|
||||
//Note: external organs have their own version of this proc
|
||||
/obj/item/organ/proc/take_damage(amount, var/silent=0)
|
||||
if(src.status & ORGAN_ROBOT)
|
||||
src.damage = between(0, src.damage + (amount * 0.8), max_damage)
|
||||
else
|
||||
src.damage = between(0, src.damage + amount, max_damage)
|
||||
|
||||
//only show this if the organ is not robotic
|
||||
if(owner && parent_organ && amount > 0)
|
||||
var/obj/item/organ/external/parent = owner.get_organ(parent_organ)
|
||||
if(parent && !silent)
|
||||
owner.custom_pain("Something inside your [parent.name] hurts a lot.", 1)
|
||||
|
||||
/obj/item/organ/proc/robotize() //Being used to make robutt hearts, etc
|
||||
robotic = 2
|
||||
src.status &= ~ORGAN_BROKEN
|
||||
src.status &= ~ORGAN_BLEEDING
|
||||
src.status &= ~ORGAN_SPLINTED
|
||||
src.status &= ~ORGAN_CUT_AWAY
|
||||
src.status &= ~ORGAN_ATTACHABLE
|
||||
src.status &= ~ORGAN_DESTROYED
|
||||
src.status |= ORGAN_ROBOT
|
||||
src.status |= ORGAN_ASSISTED
|
||||
|
||||
/obj/item/organ/proc/mechassist() //Used to add things like pacemakers, etc
|
||||
robotize()
|
||||
src.status &= ~ORGAN_ROBOT
|
||||
robotic = 1
|
||||
min_bruised_damage = 15
|
||||
min_broken_damage = 35
|
||||
|
||||
/obj/item/organ/emp_act(severity)
|
||||
if(!(status & ORGAN_ROBOT))
|
||||
return
|
||||
switch (severity)
|
||||
if (1.0)
|
||||
take_damage(0,20)
|
||||
return
|
||||
if (2.0)
|
||||
take_damage(0,7)
|
||||
return
|
||||
if(3.0)
|
||||
take_damage(0,3)
|
||||
|
||||
/obj/item/organ/proc/removed(var/mob/living/user)
|
||||
|
||||
if(!istype(owner))
|
||||
return
|
||||
|
||||
var/obj/item/organ/external/affected = owner.get_organ(parent_organ)
|
||||
if(affected) affected.internal_organs -= src
|
||||
|
||||
loc = get_turf(owner)
|
||||
processing_objects |= src
|
||||
var/datum/reagent/blood/organ_blood
|
||||
if(reagents) organ_blood = locate(/datum/reagent/blood) in reagents.reagent_list
|
||||
if(!organ_blood || !organ_blood.data["blood_DNA"])
|
||||
owner.vessel.trans_to(src, 5, 1, 1)
|
||||
|
||||
if(owner && vital)
|
||||
if(user)
|
||||
user.attack_log += "\[[time_stamp()]\]<font color='red'> removed a vital organ ([src]) from [key_name(owner)] (INTENT: [uppertext(user.a_intent)])</font>"
|
||||
owner.attack_log += "\[[time_stamp()]\]<font color='orange'> had a vital organ ([src]) removed by [key_name(user)] (INTENT: [uppertext(user.a_intent)])</font>"
|
||||
msg_admin_attack("[key_name_admin(user)] removed a vital organ ([src]) from [key_name_admin(owner)]")
|
||||
owner.death()
|
||||
owner = null
|
||||
|
||||
/obj/item/organ/proc/replaced(var/mob/living/carbon/human/target,var/obj/item/organ/external/affected)
|
||||
|
||||
if(!istype(target)) return
|
||||
|
||||
owner = target
|
||||
processing_objects -= src
|
||||
//target.internal_organs |= src
|
||||
affected.internal_organs |= src
|
||||
//target.internal_organs_by_name[organ_tag] = src
|
||||
src.loc = target
|
||||
if(robotic)
|
||||
status |= ORGAN_ROBOT
|
||||
|
||||
/obj/item/organ/proc/surgeryize()
|
||||
return
|
||||
@@ -0,0 +1,887 @@
|
||||
/****************************************************
|
||||
EXTERNAL ORGANS
|
||||
****************************************************/
|
||||
/obj/item/organ/external
|
||||
name = "external"
|
||||
min_broken_damage = 30
|
||||
max_damage = 0
|
||||
dir = SOUTH
|
||||
organ_tag = "limb"
|
||||
|
||||
var/brute_mod = 1
|
||||
var/burn_mod = 1
|
||||
|
||||
var/icon_name = null
|
||||
var/body_part = null
|
||||
var/icon_position = 0
|
||||
|
||||
var/model
|
||||
var/force_icon
|
||||
|
||||
var/damage_state = "00"
|
||||
var/brute_dam = 0
|
||||
var/burn_dam = 0
|
||||
var/max_size = 0
|
||||
var/last_dam = -1
|
||||
var/icon/mob_icon
|
||||
var/gendered_icon = 0
|
||||
var/limb_name
|
||||
var/disfigured = 0
|
||||
var/cannot_amputate
|
||||
var/cannot_break
|
||||
var/s_tone
|
||||
var/list/s_col = list()
|
||||
var/list/wounds = list()
|
||||
var/number_wounds = 0 // cache the number of wounds, which is NOT wounds.len!
|
||||
var/perma_injury = 0
|
||||
|
||||
|
||||
var/obj/item/organ/external/parent
|
||||
var/list/obj/item/organ/external/children
|
||||
|
||||
// Internal organs of this body part
|
||||
var/list/internal_organs = list()
|
||||
|
||||
var/damage_msg = "\red You feel an intense pain"
|
||||
var/broken_description
|
||||
|
||||
var/open = 0
|
||||
var/stage = 0
|
||||
var/cavity = 0
|
||||
var/sabotaged = 0 //If a prosthetic limb is emagged, it will detonate when it fails.
|
||||
var/encased // Needs to be opened with a saw to access the organs.
|
||||
|
||||
var/obj/item/hidden = null
|
||||
var/list/implants = list()
|
||||
|
||||
// how often wounds should be updated, a higher number means less often
|
||||
var/wound_update_accuracy = 1
|
||||
|
||||
var/amputation_point // Descriptive string used in amputation.
|
||||
var/can_grasp
|
||||
var/can_stand
|
||||
|
||||
/obj/item/organ/external/Destroy()
|
||||
if(parent && parent.children)
|
||||
parent.children -= src
|
||||
|
||||
if(children)
|
||||
for(var/obj/item/organ/external/C in children)
|
||||
qdel(C)
|
||||
|
||||
if(internal_organs)
|
||||
for(var/obj/item/organ/internal/O in internal_organs)
|
||||
qdel(O)
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/item/organ/external/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
switch(stage)
|
||||
if(0)
|
||||
if(istype(W,/obj/item/weapon/scalpel))
|
||||
user.visible_message("<span class='danger'><b>[user]</b> cuts [src] open with [W]!")
|
||||
stage++
|
||||
return
|
||||
if(1)
|
||||
if(istype(W,/obj/item/weapon/retractor))
|
||||
user.visible_message("<span class='danger'><b>[user]</b> cracks [src] open like an egg with [W]!")
|
||||
stage++
|
||||
return
|
||||
if(2)
|
||||
if(istype(W,/obj/item/weapon/hemostat))
|
||||
if(contents.len)
|
||||
var/obj/item/removing = pick(contents)
|
||||
removing.loc = get_turf(user.loc)
|
||||
var/obj/item/organ/O = removing
|
||||
if(istype(O))
|
||||
O.status |= ORGAN_CUT_AWAY
|
||||
O.removed(user)
|
||||
else if(!(user.l_hand && user.r_hand))
|
||||
user.put_in_hands(removing)
|
||||
user.visible_message("<span class='danger'><b>[user]</b> extracts [removing] from [src] with [W]!")
|
||||
else
|
||||
user.visible_message("<span class='danger'><b>[user]</b> fishes around fruitlessly in [src] with [W].")
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/organ/external/update_health()
|
||||
damage = min(max_damage, (brute_dam + burn_dam))
|
||||
return
|
||||
|
||||
|
||||
/obj/item/organ/external/New(var/mob/living/carbon/holder, var/internal)
|
||||
..()
|
||||
if(owner)
|
||||
replaced(owner)
|
||||
sync_colour_to_human(owner)
|
||||
spawn(1)
|
||||
get_icon()
|
||||
|
||||
/obj/item/organ/external/replaced(var/mob/living/carbon/human/target)
|
||||
owner = target
|
||||
status = status & ~ORGAN_DESTROYED
|
||||
if(istype(owner))
|
||||
owner.organs_by_name[limb_name] = src
|
||||
owner.organs |= src
|
||||
for(var/obj/item/organ/organ in src)
|
||||
organ.loc = owner
|
||||
organ.replaced(owner,src)
|
||||
|
||||
if(parent_organ)
|
||||
parent = owner.organs_by_name[src.parent_organ]
|
||||
if(parent)
|
||||
if(!parent.children)
|
||||
parent.children = list()
|
||||
parent.children.Add(src)
|
||||
|
||||
/obj/item/organ/external/robotize()
|
||||
..()
|
||||
//robot limbs take reduced damage
|
||||
brute_mod = 0.66
|
||||
burn_mod = 0.66
|
||||
// Robot parts also lack bones
|
||||
// This is so surgery isn't kaput, let's see how this does
|
||||
encased = null
|
||||
|
||||
/****************************************************
|
||||
DAMAGE PROCS
|
||||
****************************************************/
|
||||
|
||||
/obj/item/organ/external/take_damage(brute, burn, sharp, edge, used_weapon = null, list/forbidden_limbs = list())
|
||||
if((brute <= 0) && (burn <= 0))
|
||||
return 0
|
||||
|
||||
if(status & ORGAN_DESTROYED)
|
||||
return 0
|
||||
|
||||
brute *= brute_mod
|
||||
burn *= burn_mod
|
||||
|
||||
// High brute damage or sharp objects may damage internal organs
|
||||
if(internal_organs && (brute_dam >= max_damage || (((sharp && brute >= 5) || brute >= 10) && prob(5))))
|
||||
// Damage an internal organ
|
||||
if(internal_organs && internal_organs.len)
|
||||
var/obj/item/organ/internal/I = pick(internal_organs)
|
||||
I.take_damage(brute / 2)
|
||||
brute -= brute / 2
|
||||
|
||||
if(status & ORGAN_BROKEN && prob(40) && brute)
|
||||
owner.emote("scream") //getting hit on broken hand hurts
|
||||
if(used_weapon)
|
||||
add_autopsy_data("[used_weapon]", brute + burn)
|
||||
|
||||
var/can_cut = (prob(brute*2) || sharp) && !(status & ORGAN_ROBOT)
|
||||
// If the limbs can break, make sure we don't exceed the maximum damage a limb can take before breaking
|
||||
if((brute_dam + burn_dam + brute + burn) < max_damage || !config.limbs_can_break)
|
||||
if(brute)
|
||||
if(can_cut)
|
||||
createwound( CUT, brute )
|
||||
else
|
||||
createwound( BRUISE, brute )
|
||||
if(burn)
|
||||
createwound( BURN, burn )
|
||||
else
|
||||
//If we can't inflict the full amount of damage, spread the damage in other ways
|
||||
//How much damage can we actually cause?
|
||||
var/can_inflict = max_damage * config.organ_health_multiplier - (brute_dam + burn_dam)
|
||||
if(can_inflict)
|
||||
if (brute > 0)
|
||||
//Inflict all burte damage we can
|
||||
if(can_cut)
|
||||
createwound( CUT, min(brute,can_inflict) )
|
||||
else
|
||||
createwound( BRUISE, min(brute,can_inflict) )
|
||||
var/temp = can_inflict
|
||||
//How much mroe damage can we inflict
|
||||
can_inflict = max(0, can_inflict - brute)
|
||||
//How much brute damage is left to inflict
|
||||
brute = max(0, brute - temp)
|
||||
|
||||
if (burn > 0 && can_inflict)
|
||||
//Inflict all burn damage we can
|
||||
createwound(BURN, min(burn,can_inflict))
|
||||
//How much burn damage is left to inflict
|
||||
burn = max(0, burn - can_inflict)
|
||||
//If there are still hurties to dispense
|
||||
if (burn || brute)
|
||||
if (status & ORGAN_ROBOT && body_part != UPPER_TORSO && body_part != LOWER_TORSO)
|
||||
droplimb(1) //Robot limbs just kinda fail at full damage.
|
||||
else
|
||||
//List organs we can pass it to
|
||||
var/list/obj/item/organ/external/possible_points = list()
|
||||
if(parent)
|
||||
possible_points += parent
|
||||
if(children) for(var/organ in children)
|
||||
if(organ) possible_points += organ
|
||||
if(forbidden_limbs.len)
|
||||
possible_points -= forbidden_limbs
|
||||
if(possible_points.len)
|
||||
//And pass the pain around
|
||||
var/obj/item/organ/external/target = pick(possible_points)
|
||||
target.take_damage(brute, burn, sharp, edge, used_weapon, forbidden_limbs + src)
|
||||
|
||||
// sync the organ's damage with its wounds
|
||||
src.update_damages()
|
||||
var/mob/living/carbon/owner_old = owner //Need to update health, but need a reference in case the below check cuts off a limb.
|
||||
//If limb took enough damage, try to cut or tear it off
|
||||
if(owner && loc == owner)
|
||||
if(!cannot_amputate && config.limbs_can_break && (brute_dam) >= (max_damage * config.organ_health_multiplier))
|
||||
if(prob(brute / 2))
|
||||
if(edge)
|
||||
droplimb(0,DROPLIMB_EDGE)
|
||||
|
||||
if(owner_old) owner_old.updatehealth()
|
||||
return update_icon()
|
||||
|
||||
/obj/item/organ/external/proc/heal_damage(brute, burn, internal = 0, robo_repair = 0)
|
||||
if(status & ORGAN_ROBOT && !robo_repair)
|
||||
return
|
||||
|
||||
//Heal damage on the individual wounds
|
||||
for(var/datum/wound/W in wounds)
|
||||
if(brute == 0 && burn == 0)
|
||||
break
|
||||
|
||||
// heal brute damage
|
||||
if(W.damage_type == CUT || W.damage_type == BRUISE)
|
||||
brute = W.heal_damage(brute)
|
||||
else if(W.damage_type == BURN)
|
||||
burn = W.heal_damage(burn)
|
||||
|
||||
if(internal)
|
||||
status &= ~ORGAN_BROKEN
|
||||
perma_injury = 0
|
||||
|
||||
/*
|
||||
if((brute || burn) && children && children.len && (owner.species.flags & REGENERATES_LIMBS))
|
||||
var/obj/item/organ/external/stump/S = locate() in children
|
||||
if(S)
|
||||
//world << "Extra healing to go around ([brute+burn]) and [owner] needs a replacement limb."
|
||||
*/
|
||||
|
||||
//Sync the organ's damage with its wounds
|
||||
src.update_damages()
|
||||
owner.updatehealth()
|
||||
|
||||
var/result = update_icon()
|
||||
return result
|
||||
|
||||
/*
|
||||
This function completely restores a damaged organ to perfect condition.
|
||||
*/
|
||||
/obj/item/organ/external/rejuvenate()
|
||||
damage_state = "00"
|
||||
if(status & 128) //Robotic organs stay robotic. Fix because right click rejuvinate makes IPC's organs organic.
|
||||
status = 128
|
||||
else
|
||||
status = 0
|
||||
perma_injury = 0
|
||||
brute_dam = 0
|
||||
burn_dam = 0
|
||||
|
||||
// handle internal organs
|
||||
for(var/obj/item/organ/internal/current_organ in internal_organs)
|
||||
current_organ.rejuvenate()
|
||||
|
||||
|
||||
// remove embedded objects and drop them on the floor
|
||||
for(var/obj/implanted_object in implants)
|
||||
if(!istype(implanted_object,/obj/item/weapon/implant)) // We don't want to remove REAL implants. Just shrapnel etc.
|
||||
implanted_object.loc = owner.loc
|
||||
implants -= implanted_object
|
||||
|
||||
owner.updatehealth()
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/item/organ/external/proc/createwound(var/type = CUT, var/damage)
|
||||
if(damage == 0) return
|
||||
|
||||
//moved this before the open_wound check so that having many small wounds for example doesn't somehow protect you from taking internal damage
|
||||
//Possibly trigger an internal wound, too.
|
||||
var/local_damage = brute_dam + burn_dam + damage
|
||||
if(damage > 15 && type != BURN && local_damage > 30 && prob(damage) && !(status & ORGAN_ROBOT))
|
||||
var/datum/wound/internal_bleeding/I = new ()
|
||||
wounds += I
|
||||
owner.custom_pain("You feel something rip in your [name]!", 1)
|
||||
|
||||
// first check whether we can widen an existing wound
|
||||
if(wounds.len > 0 && prob(max(50+(number_wounds-1)*10,90)))
|
||||
if((type == CUT || type == BRUISE) && damage >= 5)
|
||||
//we need to make sure that the wound we are going to worsen is compatible with the type of damage...
|
||||
var/list/compatible_wounds = list()
|
||||
for (var/datum/wound/W in wounds)
|
||||
if (W.can_worsen(type, damage))
|
||||
compatible_wounds += W
|
||||
|
||||
if(compatible_wounds.len)
|
||||
var/datum/wound/W = pick(compatible_wounds)
|
||||
W.open_wound(damage)
|
||||
if(prob(25))
|
||||
if(status & ORGAN_ROBOT)
|
||||
owner.visible_message("<span class='alert'>The damage to [owner.name]'s [name] worsens.</span>",\
|
||||
"<span class='alert'>The damage to your [name] worsens.</span>",\
|
||||
"You hear the screech of abused metal.")
|
||||
else
|
||||
owner.visible_message("<span class='alert'>The wound on [owner.name]'s [name] widens with a nasty ripping noise.</span>",\
|
||||
"<span class='alert'>The wound on your [name] widens with a nasty ripping noise.</span>",\
|
||||
"You hear a nasty ripping noise, as if flesh is being torn apart.")
|
||||
return
|
||||
|
||||
//Creating wound
|
||||
var/wound_type = get_wound_type(type, damage)
|
||||
|
||||
if(wound_type)
|
||||
var/datum/wound/W = new wound_type(damage)
|
||||
|
||||
//Check whether we can add the wound to an existing wound
|
||||
for(var/datum/wound/other in wounds)
|
||||
if(other.can_merge(W))
|
||||
other.merge_wound(W)
|
||||
W = null // to signify that the wound was added
|
||||
break
|
||||
if(W)
|
||||
wounds += W
|
||||
|
||||
/****************************************************
|
||||
PROCESSING & UPDATING
|
||||
****************************************************/
|
||||
|
||||
//Determines if we even need to process this organ.
|
||||
|
||||
/obj/item/organ/external/proc/need_process()
|
||||
if(status & (ORGAN_CUT_AWAY|ORGAN_GAUZED|ORGAN_BLEEDING|ORGAN_BROKEN|ORGAN_DESTROYED|ORGAN_SPLINTED|ORGAN_DEAD|ORGAN_MUTATED))
|
||||
return 1
|
||||
if(brute_dam || burn_dam)
|
||||
return 1
|
||||
if(last_dam != brute_dam + burn_dam) // Process when we are fully healed up.
|
||||
last_dam = brute_dam + burn_dam
|
||||
return 1
|
||||
else
|
||||
last_dam = brute_dam + burn_dam
|
||||
if(germ_level)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/item/organ/external/process()
|
||||
if(owner)
|
||||
if(parent)
|
||||
if(parent.status & ORGAN_DESTROYED)
|
||||
status |= ORGAN_DESTROYED
|
||||
owner.update_body(1)
|
||||
return
|
||||
|
||||
// Process wounds, doing healing etc. Only do this every few ticks to save processing power
|
||||
if(owner.life_tick % wound_update_accuracy == 0)
|
||||
update_wounds()
|
||||
|
||||
//Chem traces slowly vanish
|
||||
if(owner.life_tick % 10 == 0)
|
||||
for(var/chemID in trace_chemicals)
|
||||
trace_chemicals[chemID] = trace_chemicals[chemID] - 1
|
||||
if(trace_chemicals[chemID] <= 0)
|
||||
trace_chemicals.Remove(chemID)
|
||||
|
||||
if(!(status & ORGAN_BROKEN))
|
||||
perma_injury = 0
|
||||
|
||||
//Infections
|
||||
update_germs()
|
||||
else
|
||||
..()
|
||||
|
||||
//Updating germ levels. Handles organ germ levels and necrosis.
|
||||
/*
|
||||
The INFECTION_LEVEL values defined in setup.dm control the time it takes to reach the different
|
||||
infection levels. Since infection growth is exponential, you can adjust the time it takes to get
|
||||
from one germ_level to another using the rough formula:
|
||||
|
||||
desired_germ_level = initial_germ_level*e^(desired_time_in_seconds/1000)
|
||||
|
||||
So if I wanted it to take an average of 15 minutes to get from level one (100) to level two
|
||||
I would set INFECTION_LEVEL_TWO to 100*e^(15*60/1000) = 245. Note that this is the average time,
|
||||
the actual time is dependent on RNG.
|
||||
|
||||
INFECTION_LEVEL_ONE below this germ level nothing happens, and the infection doesn't grow
|
||||
INFECTION_LEVEL_TWO above this germ level the infection will start to spread to internal and adjacent organs
|
||||
INFECTION_LEVEL_THREE above this germ level the player will take additional toxin damage per second, and will die in minutes without
|
||||
antitox. also, above this germ level you will need to overdose on spaceacillin to reduce the germ_level.
|
||||
|
||||
Note that amputating the affected organ does in fact remove the infection from the player's body.
|
||||
*/
|
||||
/obj/item/organ/external/proc/update_germs()
|
||||
|
||||
if(status & (ORGAN_ROBOT|ORGAN_DESTROYED) || (owner.species && owner.species.flags & IS_PLANT)) //Robotic limbs shouldn't be infected, nor should nonexistant limbs.
|
||||
germ_level = 0
|
||||
return
|
||||
|
||||
if(owner.bodytemperature >= 170) //cryo stops germs from moving and doing their bad stuffs
|
||||
//** Syncing germ levels with external wounds
|
||||
handle_germ_sync()
|
||||
|
||||
//** Handle antibiotics and curing infections
|
||||
handle_antibiotics()
|
||||
|
||||
//** Handle the effects of infections
|
||||
handle_germ_effects()
|
||||
|
||||
/obj/item/organ/external/proc/handle_germ_sync()
|
||||
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
|
||||
for(var/datum/wound/W in wounds)
|
||||
//Open wounds can become infected
|
||||
if (owner.germ_level > W.germ_level && W.infection_check())
|
||||
W.germ_level++
|
||||
|
||||
if (antibiotics < 5)
|
||||
for(var/datum/wound/W in wounds)
|
||||
//Infected wounds raise the organ's germ level
|
||||
if (W.germ_level > germ_level)
|
||||
germ_level++
|
||||
break //limit increase to a maximum of one per second
|
||||
|
||||
/obj/item/organ/external/handle_germ_effects()
|
||||
|
||||
if(germ_level < INFECTION_LEVEL_TWO)
|
||||
return ..()
|
||||
|
||||
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
|
||||
|
||||
if(germ_level >= INFECTION_LEVEL_TWO)
|
||||
//spread the infection to internal organs
|
||||
var/obj/item/organ/internal/target_organ = null //make internal organs become infected one at a time instead of all at once
|
||||
for (var/obj/item/organ/internal/I in internal_organs)
|
||||
if (I.germ_level > 0 && I.germ_level < min(germ_level, INFECTION_LEVEL_TWO)) //once the organ reaches whatever we can give it, or level two, switch to a different one
|
||||
if (!target_organ || I.germ_level > target_organ.germ_level) //choose the organ with the highest germ_level
|
||||
target_organ = I
|
||||
|
||||
if (!target_organ)
|
||||
//figure out which organs we can spread germs to and pick one at random
|
||||
var/list/candidate_organs = list()
|
||||
for (var/obj/item/organ/internal/I in internal_organs)
|
||||
if (I.germ_level < germ_level)
|
||||
candidate_organs |= I
|
||||
if (candidate_organs.len)
|
||||
target_organ = pick(candidate_organs)
|
||||
|
||||
if (target_organ)
|
||||
target_organ.germ_level++
|
||||
|
||||
//spread the infection to child and parent organs
|
||||
if (children)
|
||||
for (var/obj/item/organ/external/child in children)
|
||||
if (child.germ_level < germ_level && !(child.status & ORGAN_ROBOT))
|
||||
if (child.germ_level < INFECTION_LEVEL_ONE*2 || prob(30))
|
||||
child.germ_level++
|
||||
|
||||
if (parent)
|
||||
if (parent.germ_level < germ_level && !(parent.status & ORGAN_ROBOT))
|
||||
if (parent.germ_level < INFECTION_LEVEL_ONE*2 || prob(30))
|
||||
parent.germ_level++
|
||||
|
||||
if(germ_level >= INFECTION_LEVEL_THREE && antibiotics < 30) //overdosing is necessary to stop severe infections
|
||||
if (!(status & ORGAN_DEAD))
|
||||
status |= ORGAN_DEAD
|
||||
owner << "<span class='notice'>You can't feel your [name] anymore...</span>"
|
||||
owner.update_body(1)
|
||||
|
||||
germ_level++
|
||||
owner.adjustToxLoss(1)
|
||||
|
||||
//Updating wounds. Handles wound natural I had some free spachealing, internal bleedings and infections
|
||||
/obj/item/organ/external/proc/update_wounds()
|
||||
|
||||
if((status & ORGAN_ROBOT)) //Robotic limbs don't heal or get worse.
|
||||
return
|
||||
|
||||
for(var/datum/wound/W in wounds)
|
||||
// wounds can disappear after 10 minutes at the earliest
|
||||
if(W.damage <= 0 && W.created + 10 * 10 * 60 <= world.time)
|
||||
wounds -= W
|
||||
continue
|
||||
// let the GC handle the deletion of the wound
|
||||
|
||||
// Internal wounds get worse over time. Low temperatures (cryo) stop them.
|
||||
if(W.internal && !W.can_autoheal() && owner.bodytemperature >= 170)
|
||||
var/bicardose = owner.reagents.get_reagent_amount("styptic_powder")
|
||||
if(!bicardose) //styptic powder stops internal wounds from growing bigger with time, and also stop bleeding
|
||||
W.open_wound(0.1 * wound_update_accuracy)
|
||||
owner.vessel.remove_reagent("blood",0.05 * W.damage * wound_update_accuracy)
|
||||
|
||||
owner.vessel.remove_reagent("blood",0.02 * W.damage * wound_update_accuracy)
|
||||
if(prob(1 * wound_update_accuracy))
|
||||
owner.custom_pain("You feel a stabbing pain in your [name]!",1)
|
||||
|
||||
//overdose of styptic powder begins healing IB
|
||||
if(owner.reagents.get_reagent_amount("styptic_powder") >= 30)
|
||||
W.damage = max(0, W.damage - 0.2)
|
||||
|
||||
// slow healing
|
||||
var/heal_amt = 0
|
||||
|
||||
// if damage >= 50 AFTER treatment then it's probably too severe to heal within the timeframe of a round.
|
||||
if (W.can_autoheal() && W.wound_damage() < 50)
|
||||
heal_amt += 0.5
|
||||
|
||||
//we only update wounds once in [wound_update_accuracy] ticks so have to emulate realtime
|
||||
heal_amt = heal_amt * wound_update_accuracy
|
||||
//configurable regen speed woo, no-regen hardcore or instaheal hugbox, choose your destiny
|
||||
heal_amt = heal_amt * config.organ_regeneration_multiplier
|
||||
// amount of healing is spread over all the wounds
|
||||
heal_amt = heal_amt / (wounds.len + 1)
|
||||
// making it look prettier on scanners
|
||||
heal_amt = round(heal_amt,0.1)
|
||||
W.heal_damage(heal_amt)
|
||||
|
||||
// Salving also helps against infection
|
||||
if(W.germ_level > 0 && W.salved && prob(2))
|
||||
W.disinfected = 1
|
||||
W.germ_level = 0
|
||||
|
||||
// sync the organ's damage with its wounds
|
||||
src.update_damages()
|
||||
if (update_icon())
|
||||
owner.UpdateDamageIcon(1)
|
||||
|
||||
//Updates brute_damn and burn_damn from wound damages. Updates BLEEDING status.
|
||||
/obj/item/organ/external/proc/update_damages()
|
||||
number_wounds = 0
|
||||
brute_dam = 0
|
||||
burn_dam = 0
|
||||
status &= ~ORGAN_BLEEDING
|
||||
var/clamped = 0
|
||||
|
||||
var/mob/living/carbon/human/H
|
||||
if(istype(owner,/mob/living/carbon/human))
|
||||
H = owner
|
||||
|
||||
for(var/datum/wound/W in wounds)
|
||||
if(W.damage_type == CUT || W.damage_type == BRUISE)
|
||||
brute_dam += W.damage
|
||||
else if(W.damage_type == BURN)
|
||||
burn_dam += W.damage
|
||||
|
||||
if(!(status & ORGAN_ROBOT) && W.bleeding())
|
||||
W.bleed_timer--
|
||||
status |= ORGAN_BLEEDING
|
||||
|
||||
clamped |= W.clamped
|
||||
|
||||
number_wounds += W.amount
|
||||
|
||||
if (open && !clamped && (H && !(H.species.flags & NO_BLOOD)))
|
||||
status |= ORGAN_BLEEDING
|
||||
|
||||
//Bone fractures
|
||||
if(config.bones_can_break && brute_dam > min_broken_damage * config.organ_health_multiplier && !(status & ORGAN_ROBOT))
|
||||
src.fracture()
|
||||
|
||||
// new damage icon system
|
||||
// returns just the brute/burn damage code
|
||||
/obj/item/organ/external/proc/damage_state_text()
|
||||
if(status & ORGAN_DESTROYED)
|
||||
return "--"
|
||||
|
||||
var/tburn = 0
|
||||
var/tbrute = 0
|
||||
|
||||
if(burn_dam ==0)
|
||||
tburn =0
|
||||
else if (burn_dam < (max_damage * 0.25 / 2))
|
||||
tburn = 1
|
||||
else if (burn_dam < (max_damage * 0.75 / 2))
|
||||
tburn = 2
|
||||
else
|
||||
tburn = 3
|
||||
|
||||
if (brute_dam == 0)
|
||||
tbrute = 0
|
||||
else if (brute_dam < (max_damage * 0.25 / 2))
|
||||
tbrute = 1
|
||||
else if (brute_dam < (max_damage * 0.75 / 2))
|
||||
tbrute = 2
|
||||
else
|
||||
tbrute = 3
|
||||
return "[tbrute][tburn]"
|
||||
|
||||
/****************************************************
|
||||
DISMEMBERMENT
|
||||
****************************************************/
|
||||
|
||||
//Handles dismemberment
|
||||
/obj/item/organ/external/proc/droplimb(var/clean, var/disintegrate, var/ignore_children, var/nodamage)
|
||||
|
||||
if(cannot_amputate || !owner)
|
||||
return
|
||||
|
||||
if(!disintegrate)
|
||||
disintegrate = DROPLIMB_EDGE
|
||||
|
||||
switch(disintegrate)
|
||||
if(DROPLIMB_EDGE)
|
||||
if(!clean)
|
||||
var/gore_sound = "[(status & ORGAN_ROBOT) ? "tortured metal" : "ripping tendons and flesh"]"
|
||||
owner.visible_message(
|
||||
"<span class='danger'>\The [owner]'s [src.name] flies off in an arc!</span>",\
|
||||
"<span class='moderate'><b>Your [src.name] goes flying off!</b></span>",\
|
||||
"<span class='danger'>You hear a terrible sound of [gore_sound].</span>")
|
||||
if(DROPLIMB_BURN)
|
||||
var/gore = "[(status & ORGAN_ROBOT) ? "": " of burning flesh"]"
|
||||
owner.visible_message(
|
||||
"<span class='danger'>\The [owner]'s [src.name] flashes away into ashes!</span>",\
|
||||
"<span class='moderate'><b>Your [src.name] flashes away into ashes!</b></span>",\
|
||||
"<span class='danger'>You hear a crackling sound[gore].</span>")
|
||||
if(DROPLIMB_BLUNT)
|
||||
var/gore = "[(status & ORGAN_ROBOT) ? "": " in shower of gore"]"
|
||||
var/gore_sound = "[(status & ORGAN_ROBOT) ? "rending sound of tortured metal" : "sickening splatter of gore"]"
|
||||
owner.visible_message(
|
||||
"<span class='danger'>\The [owner]'s [src.name] explodes[gore]!</span>",\
|
||||
"<span class='moderate'><b>Your [src.name] explodes[gore]!</b></span>",\
|
||||
"<span class='danger'>You hear the [gore_sound].</span>")
|
||||
|
||||
var/mob/living/carbon/human/victim = owner //Keep a reference for post-removed().
|
||||
removed(null, ignore_children)
|
||||
victim.traumatic_shock += 30
|
||||
|
||||
wounds.Cut()
|
||||
if(parent && !nodamage)
|
||||
var/datum/wound/lost_limb/W = new (src, disintegrate, clean)
|
||||
parent.children -= src
|
||||
if(clean)
|
||||
parent.wounds |= W
|
||||
parent.update_damages()
|
||||
else
|
||||
var/obj/item/organ/external/stump/stump = new (victim, 0, src)
|
||||
if(status & ORGAN_ROBOT)
|
||||
stump.robotize()
|
||||
stump.wounds |= W
|
||||
victim.organs |= stump
|
||||
stump.update_damages()
|
||||
parent = null
|
||||
|
||||
spawn(1)
|
||||
if(victim)
|
||||
victim.updatehealth()
|
||||
victim.UpdateDamageIcon()
|
||||
victim.regenerate_icons()
|
||||
dir = 2
|
||||
|
||||
switch(disintegrate)
|
||||
if(DROPLIMB_EDGE)
|
||||
compile_icon()
|
||||
add_blood(victim)
|
||||
var/matrix/M = matrix()
|
||||
M.Turn(rand(180))
|
||||
src.transform = M
|
||||
if(!clean)
|
||||
// Throw limb around.
|
||||
if(src && istype(loc,/turf))
|
||||
throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),30)
|
||||
dir = 2
|
||||
return
|
||||
|
||||
/****************************************************
|
||||
HELPERS
|
||||
****************************************************/
|
||||
/obj/item/organ/external/proc/is_stump()
|
||||
return 0
|
||||
|
||||
/obj/item/organ/external/proc/release_restraints(var/mob/living/carbon/human/holder)
|
||||
if(!holder)
|
||||
holder = owner
|
||||
if(!holder)
|
||||
return
|
||||
if (holder.handcuffed && body_part in list(ARM_LEFT, ARM_RIGHT, HAND_LEFT, HAND_RIGHT))
|
||||
holder.visible_message(\
|
||||
"\The [holder.handcuffed.name] falls off of [holder.name].",\
|
||||
"\The [holder.handcuffed.name] falls off you.")
|
||||
holder.unEquip(holder.handcuffed)
|
||||
if (holder.legcuffed && body_part in list(FOOT_LEFT, FOOT_RIGHT, LEG_LEFT, LEG_RIGHT))
|
||||
holder.visible_message(\
|
||||
"\The [holder.legcuffed.name] falls off of [holder.name].",\
|
||||
"\The [holder.legcuffed.name] falls off you.")
|
||||
holder.unEquip(holder.legcuffed)
|
||||
|
||||
|
||||
/obj/item/organ/external/proc/bandage()
|
||||
var/rval = 0
|
||||
src.status &= ~ORGAN_BLEEDING
|
||||
for(var/datum/wound/W in wounds)
|
||||
if(W.internal) continue
|
||||
rval |= !W.bandaged
|
||||
W.bandaged = 1
|
||||
return rval
|
||||
|
||||
/obj/item/organ/external/proc/disinfect()
|
||||
var/rval = 0
|
||||
for(var/datum/wound/W in wounds)
|
||||
if(W.internal) continue
|
||||
rval |= !W.disinfected
|
||||
W.disinfected = 1
|
||||
W.germ_level = 0
|
||||
return rval
|
||||
|
||||
/obj/item/organ/external/proc/clamp()
|
||||
var/rval = 0
|
||||
src.status &= ~ORGAN_BLEEDING
|
||||
for(var/datum/wound/W in wounds)
|
||||
if(W.internal) continue
|
||||
rval |= !W.clamped
|
||||
W.clamped = 1
|
||||
return rval
|
||||
|
||||
/obj/item/organ/external/proc/salve()
|
||||
var/rval = 0
|
||||
for(var/datum/wound/W in wounds)
|
||||
rval |= !W.salved
|
||||
W.salved = 1
|
||||
return rval
|
||||
|
||||
/obj/item/organ/external/proc/fracture()
|
||||
if(status & ORGAN_ROBOT)
|
||||
return //ORGAN_BROKEN doesn't have the same meaning for robot limbs
|
||||
|
||||
if((status & ORGAN_BROKEN) || cannot_break)
|
||||
return
|
||||
if(owner)
|
||||
owner.visible_message(\
|
||||
"\red You hear a loud cracking sound coming from \the [owner].",\
|
||||
"\red <b>Something feels like it shattered in your [name]!</b>",\
|
||||
"You hear a sickening crack.")
|
||||
if(owner.species && !(owner.species.flags & NO_PAIN))
|
||||
owner.emote("scream")
|
||||
|
||||
status |= ORGAN_BROKEN
|
||||
broken_description = pick("broken","fracture","hairline fracture")
|
||||
perma_injury = brute_dam
|
||||
|
||||
// Fractures have a chance of getting you out of restraints
|
||||
if (prob(25))
|
||||
release_restraints()
|
||||
|
||||
/obj/item/organ/external/proc/mend_fracture()
|
||||
if(status & ORGAN_ROBOT)
|
||||
return 0 //ORGAN_BROKEN doesn't have the same meaning for robot limbs
|
||||
if(brute_dam > min_broken_damage * config.organ_health_multiplier)
|
||||
return 0 //will just immediately fracture again
|
||||
|
||||
status &= ~ORGAN_BROKEN
|
||||
return 1
|
||||
|
||||
/obj/item/organ/external/robotize(var/company)
|
||||
..()
|
||||
|
||||
if(company && istext(company))
|
||||
model = company
|
||||
var/datum/robolimb/R = all_robolimbs[company]
|
||||
if(R)
|
||||
force_icon = R.icon
|
||||
name = "[R.company] [initial(name)]"
|
||||
desc = "[R.desc]"
|
||||
|
||||
cannot_break = 1
|
||||
get_icon()
|
||||
for (var/obj/item/organ/external/T in children)
|
||||
if(T)
|
||||
T.robotize()
|
||||
|
||||
/obj/item/organ/external/proc/mutate()
|
||||
src.status |= ORGAN_MUTATED
|
||||
if(owner) owner.update_body()
|
||||
|
||||
/obj/item/organ/external/proc/unmutate()
|
||||
src.status &= ~ORGAN_MUTATED
|
||||
if(owner) owner.update_body()
|
||||
|
||||
/obj/item/organ/external/proc/get_damage() //returns total damage
|
||||
return max(brute_dam + burn_dam - perma_injury, perma_injury) //could use health?
|
||||
|
||||
/obj/item/organ/external/proc/has_infected_wound()
|
||||
for(var/datum/wound/W in wounds)
|
||||
if(W.germ_level > INFECTION_LEVEL_ONE)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/item/organ/external/proc/is_usable()
|
||||
if((status & ORGAN_ROBOT) && get_damage() >= max_damage) //robot limbs just become inoperable at max damage
|
||||
return
|
||||
return !(status & (ORGAN_DESTROYED|ORGAN_MUTATED|ORGAN_DEAD))
|
||||
|
||||
/obj/item/organ/external/proc/is_malfunctioning()
|
||||
return ((status & ORGAN_ROBOT) && (brute_dam + burn_dam) >= 10 && prob(brute_dam + burn_dam))
|
||||
|
||||
/obj/item/organ/external/proc/embed(var/obj/item/weapon/W, var/silent = 0)
|
||||
if(!owner || loc != owner)
|
||||
return
|
||||
if(!silent)
|
||||
owner.visible_message("<span class='danger'>\The [W] sticks in the wound!</span>")
|
||||
implants += W
|
||||
owner.embedded_flag = 1
|
||||
owner.verbs += /mob/proc/yank_out_object
|
||||
W.add_blood(owner)
|
||||
if(ismob(W.loc))
|
||||
var/mob/living/H = W.loc
|
||||
H.drop_item()
|
||||
W.loc = owner
|
||||
|
||||
/obj/item/organ/external/proc/open_enough_for_surgery()
|
||||
return (encased ? (open == 3) : (open == 2))
|
||||
|
||||
/obj/item/organ/external/removed(var/mob/living/user, var/ignore_children)
|
||||
|
||||
if(!owner)
|
||||
return
|
||||
var/is_robotic = status & ORGAN_ROBOT
|
||||
var/mob/living/carbon/human/victim = owner
|
||||
|
||||
..()
|
||||
|
||||
status |= ORGAN_DESTROYED
|
||||
victim.bad_external_organs -= src
|
||||
|
||||
for(var/implant in implants) //todo: check if this can be left alone
|
||||
qdel(implant)
|
||||
|
||||
// Attached organs also fly off.
|
||||
if(!ignore_children)
|
||||
for(var/obj/item/organ/external/O in children)
|
||||
O.removed()
|
||||
if(O)
|
||||
O.forceMove(src)
|
||||
|
||||
// Grab all the internal giblets too.
|
||||
for(var/obj/item/organ/organ in internal_organs)
|
||||
organ.removed()
|
||||
organ.forceMove(src)
|
||||
|
||||
release_restraints(victim)
|
||||
victim.organs -= src
|
||||
victim.organs_by_name[limb_name] = null // Remove from owner's vars.
|
||||
|
||||
//Robotic limbs explode if sabotaged.
|
||||
if(is_robotic && sabotaged)
|
||||
victim.visible_message(
|
||||
"<span class='danger'>\The [victim]'s [src.name] explodes violently!</span>",\
|
||||
"<span class='danger'>Your [src.name] explodes!</span>",\
|
||||
"<span class='danger'>You hear an explosion!</span>")
|
||||
explosion(get_turf(owner),-1,-1,2,3)
|
||||
var/datum/effect/system/spark_spread/spark_system = new /datum/effect/system/spark_spread()
|
||||
spark_system.set_up(5, 0, victim)
|
||||
spark_system.attach(owner)
|
||||
spark_system.start()
|
||||
spawn(10)
|
||||
qdel(spark_system)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/organ/external/proc/disfigure(var/type = "brute")
|
||||
if (disfigured)
|
||||
return
|
||||
if(owner)
|
||||
if(type == "brute")
|
||||
owner.visible_message("\red You hear a sickening cracking sound coming from \the [owner]'s [name].", \
|
||||
"\red <b>Your [name] becomes a mangled mess!</b>", \
|
||||
"\red You hear a sickening crack.")
|
||||
else
|
||||
owner.visible_message("\red \The [owner]'s [name] melts away, turning into mangled mess!", \
|
||||
"\red <b>Your [name] melts away!</b>", \
|
||||
"\red You hear a sickening sizzle.")
|
||||
disfigured = 1
|
||||
@@ -0,0 +1,137 @@
|
||||
var/global/list/limb_icon_cache = list()
|
||||
|
||||
/obj/item/organ/external/proc/compile_icon()
|
||||
overlays.Cut()
|
||||
// This is a kludge, only one icon has more than one generation of children though.
|
||||
for(var/obj/item/organ/external/organ in contents)
|
||||
if(organ.children && organ.children.len)
|
||||
for(var/obj/item/organ/external/child in organ.children)
|
||||
overlays += child.mob_icon
|
||||
overlays += organ.mob_icon
|
||||
|
||||
/obj/item/organ/external/proc/sync_colour_to_human(var/mob/living/carbon/human/human)
|
||||
s_tone = null
|
||||
s_col = null
|
||||
if(status & ORGAN_ROBOT && !(species && species.name == "Machine")) //machine people get skin color
|
||||
return
|
||||
if(species && human.species && species.name != human.species.name)
|
||||
return
|
||||
if(!isnull(human.s_tone) && (human.species.bodyflags & HAS_SKIN_TONE))
|
||||
s_tone = human.s_tone
|
||||
if(human.species.bodyflags & HAS_SKIN_COLOR)
|
||||
s_col = list(human.r_skin, human.g_skin, human.b_skin)
|
||||
|
||||
/obj/item/organ/external/proc/sync_colour_to_dna()
|
||||
s_tone = null
|
||||
s_col = null
|
||||
if(status & ORGAN_ROBOT)
|
||||
return
|
||||
if(!isnull(dna.GetUIValue(DNA_UI_SKIN_TONE)) && (species.flags & HAS_SKIN_TONE))
|
||||
s_tone = dna.GetUIValue(DNA_UI_SKIN_TONE)
|
||||
if(species.flags & HAS_SKIN_COLOR)
|
||||
s_col = list(dna.GetUIValue(DNA_UI_SKIN_R), dna.GetUIValue(DNA_UI_SKIN_G), dna.GetUIValue(DNA_UI_SKIN_B))
|
||||
|
||||
/obj/item/organ/external/head/sync_colour_to_human(var/mob/living/carbon/human/human)
|
||||
..()
|
||||
var/obj/item/organ/internal/eyes/eyes = owner.internal_organs_by_name["eyes"]
|
||||
if(eyes) eyes.update_colour()
|
||||
|
||||
/obj/item/organ/external/head/removed()
|
||||
get_icon()
|
||||
..()
|
||||
|
||||
/obj/item/organ/external/head/get_icon()
|
||||
|
||||
..()
|
||||
overlays.Cut()
|
||||
if(!owner)
|
||||
return
|
||||
|
||||
if(species.has_organ["eyes"])
|
||||
var/obj/item/organ/internal/eyes/eyes = owner.internal_organs_by_name["eyes"]
|
||||
if(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)
|
||||
else
|
||||
eyes_icon.Blend(rgb(128,0,0), ICON_ADD)
|
||||
mob_icon.Blend(eyes_icon, ICON_OVERLAY)
|
||||
overlays |= eyes_icon
|
||||
|
||||
if(owner.lip_style && (species && (species.flags & HAS_LIPS)))
|
||||
var/icon/lip_icon = new/icon('icons/mob/human_face.dmi', "lips_[owner.lip_style]_s")
|
||||
overlays |= lip_icon
|
||||
mob_icon.Blend(lip_icon, ICON_OVERLAY)
|
||||
|
||||
if(owner.f_style)
|
||||
var/datum/sprite_accessory/facial_hair_style = facial_hair_styles_list[owner.f_style]
|
||||
if(facial_hair_style && facial_hair_style.species_allowed && (species.name in facial_hair_style.species_allowed))
|
||||
var/icon/facial_s = new/icon("icon" = facial_hair_style.icon, "icon_state" = "[facial_hair_style.icon_state]_s")
|
||||
if(facial_hair_style.do_colouration)
|
||||
facial_s.Blend(rgb(owner.r_facial, owner.g_facial, owner.b_facial), ICON_ADD)
|
||||
overlays |= facial_s
|
||||
|
||||
if(owner.h_style && !(owner.head && (owner.head.flags & BLOCKHEADHAIR)))
|
||||
var/datum/sprite_accessory/hair_style = hair_styles_list[owner.h_style]
|
||||
if(hair_style && (species.name in hair_style.species_allowed))
|
||||
var/icon/hair_s = new/icon("icon" = hair_style.icon, "icon_state" = "[hair_style.icon_state]_s")
|
||||
if(hair_style.do_colouration)
|
||||
hair_s.Blend(rgb(owner.r_hair, owner.g_hair, owner.b_hair), ICON_ADD)
|
||||
overlays |= hair_s
|
||||
|
||||
return mob_icon
|
||||
|
||||
/obj/item/organ/external/proc/get_icon(var/skeletal)
|
||||
|
||||
var/gender
|
||||
if(force_icon)
|
||||
mob_icon = new /icon(force_icon, "[icon_name]")
|
||||
if(species && species.name == "Machine") //snowflake for IPC's, sorry.
|
||||
if(s_col && s_col.len >= 3)
|
||||
mob_icon.Blend(rgb(s_col[1], s_col[2], s_col[3]), ICON_ADD)
|
||||
else
|
||||
if(!dna)
|
||||
mob_icon = new /icon('icons/mob/human_races/r_human.dmi', "[icon_name][gendered_icon ? "_f" : ""]")
|
||||
else
|
||||
|
||||
if(gendered_icon)
|
||||
if(dna.GetUIState(DNA_UI_GENDER))
|
||||
gender = "f"
|
||||
else
|
||||
gender = "m"
|
||||
|
||||
if(skeletal)
|
||||
mob_icon = new /icon('icons/mob/human_races/r_skeleton.dmi', "[icon_name][gender ? "_[gender]" : ""]")
|
||||
else if(status & ORGAN_ROBOT)
|
||||
mob_icon = new /icon('icons/mob/human_races/robotic.dmi', "[icon_name][gender ? "_[gender]" : ""]")
|
||||
else
|
||||
if (status & ORGAN_MUTATED)
|
||||
mob_icon = new /icon(species.deform, "[icon_name][gender ? "_[gender]" : ""]")
|
||||
else
|
||||
mob_icon = new /icon(species.icobase, "[icon_name][gender ? "_[gender]" : ""]")
|
||||
|
||||
if(status & ORGAN_DEAD)
|
||||
mob_icon.ColorTone(rgb(10,50,0))
|
||||
mob_icon.SetIntensity(0.7)
|
||||
|
||||
if(!isnull(s_tone))
|
||||
if(s_tone >= 0)
|
||||
mob_icon.Blend(rgb(s_tone, s_tone, s_tone), ICON_ADD)
|
||||
else
|
||||
mob_icon.Blend(rgb(-s_tone, -s_tone, -s_tone), ICON_SUBTRACT)
|
||||
else if(s_col && s_col.len >= 3)
|
||||
mob_icon.Blend(rgb(s_col[1], s_col[2], s_col[3]), ICON_ADD)
|
||||
|
||||
dir = EAST
|
||||
icon = mob_icon
|
||||
|
||||
return mob_icon
|
||||
|
||||
// new damage icon system
|
||||
// adjusted to set damage_state to brute/burn code only (without r_name0 as before)
|
||||
/obj/item/organ/external/update_icon()
|
||||
var/n_is = damage_state_text()
|
||||
if (n_is != damage_state)
|
||||
damage_state = n_is
|
||||
return 1
|
||||
return 0
|
||||
@@ -0,0 +1,350 @@
|
||||
#define PROCESS_ACCURACY 10
|
||||
|
||||
/****************************************************
|
||||
INTERNAL ORGANS DEFINES
|
||||
****************************************************/
|
||||
/obj/item/organ/internal
|
||||
origin_tech = "biotech=2"
|
||||
force = 1
|
||||
w_class = 2
|
||||
throwforce = 0
|
||||
organ_tag = "guts"
|
||||
parent_organ = "chest" //aka the zone
|
||||
var/slot
|
||||
vital = 0
|
||||
var/organ_action_name = null
|
||||
|
||||
/obj/item/organ/internal/proc/Insert(mob/living/carbon/M, special = 0)//insert the thing into the slot
|
||||
if(!iscarbon(M) || owner == M)
|
||||
return
|
||||
|
||||
var/obj/item/organ/internal/replaced = M.get_organ_slot(slot)
|
||||
if(replaced)
|
||||
replaced.Remove(M, special = 1)
|
||||
|
||||
owner = M
|
||||
M.internal_organs |= src
|
||||
M.internal_organs_by_name[organ_tag] = src
|
||||
loc = null
|
||||
if(organ_action_name)
|
||||
action_button_name = organ_action_name
|
||||
|
||||
/obj/item/organ/internal/proc/Remove(mob/living/carbon/M, special = 0)
|
||||
owner = null
|
||||
if(M)
|
||||
M.internal_organs_by_name[organ_tag] = null
|
||||
M.internal_organs_by_name -= organ_tag
|
||||
M.internal_organs_by_name -= null
|
||||
M.internal_organs -= src
|
||||
|
||||
loc = get_turf(M)
|
||||
processing_objects |= src
|
||||
var/datum/reagent/blood/organ_blood
|
||||
if(reagents) organ_blood = locate(/datum/reagent/blood) in reagents.reagent_list
|
||||
if(!organ_blood || !organ_blood.data["blood_DNA"])
|
||||
M.vessel.trans_to(src, 5, 1, 1)
|
||||
|
||||
if(vital && !special)
|
||||
//if(user)
|
||||
// user.attack_log += "\[[time_stamp()]\]<font color='red'> removed a vital organ ([src]) from [key_name(M)] (INTENT: [uppertext(user.a_intent)])</font>"
|
||||
// M.attack_log += "\[[time_stamp()]\]<font color='orange'> had a vital organ ([src]) removed by [key_name(user)] (INTENT: [uppertext(user.a_intent)])</font>"
|
||||
// msg_admin_attack("[key_name_admin(user)] removed a vital organ ([src]) from [key_name_admin(M)]")
|
||||
M.death()
|
||||
|
||||
|
||||
if(organ_action_name)
|
||||
action_button_name = null
|
||||
|
||||
/obj/item/organ/internal/proc/on_find(mob/living/finder)
|
||||
return
|
||||
|
||||
/obj/item/organ/internal/proc/on_life()
|
||||
return
|
||||
|
||||
|
||||
/obj/item/organ/internal/proc/prepare_eat()
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/organ/S = new
|
||||
S.name = name
|
||||
S.desc = desc
|
||||
S.icon = icon
|
||||
S.icon_state = icon_state
|
||||
S.origin_tech = origin_tech
|
||||
S.w_class = w_class
|
||||
|
||||
return S
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/organ
|
||||
name = "appendix"
|
||||
icon_state = "appendix"
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
|
||||
reagents.add_reagent("nutriment",5)
|
||||
|
||||
|
||||
/obj/item/organ/internal/Destroy()
|
||||
if(owner)
|
||||
Remove(owner, 1)
|
||||
return
|
||||
|
||||
/obj/item/organ/internal/attack(mob/living/carbon/M, mob/user)
|
||||
if(robotic)
|
||||
return
|
||||
|
||||
if(M == user && ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/S = prepare_eat()
|
||||
if(S)
|
||||
H.unEquip()
|
||||
H.put_in_active_hand(S)
|
||||
if(fingerprints) S.fingerprints = fingerprints.Copy()
|
||||
if(fingerprintshidden) S.fingerprintshidden = fingerprintshidden.Copy()
|
||||
if(fingerprintslast) S.fingerprintslast = fingerprintslast
|
||||
S.attack(H, H)
|
||||
qdel(src)
|
||||
else
|
||||
..()
|
||||
|
||||
|
||||
///THE ORGANS
|
||||
|
||||
// Brain is defined in brain_item.dm.
|
||||
/obj/item/organ/internal/heart
|
||||
name = "heart"
|
||||
icon_state = "heart-on"
|
||||
organ_tag = "heart"
|
||||
parent_organ = "chest"
|
||||
slot = "heart"
|
||||
origin_tech = "biotech=3"
|
||||
vital = 1
|
||||
var/beating
|
||||
|
||||
/obj/item/organ/internal/heart/update_icon()
|
||||
if(beating)
|
||||
icon_state = "heart-on"
|
||||
else
|
||||
icon_state = "heart-off"
|
||||
|
||||
/obj/item/organ/internal/heart/Insert(mob/living/carbon/M, special = 0)
|
||||
..()
|
||||
beating = 1
|
||||
update_icon()
|
||||
|
||||
/obj/item/organ/internal/heart/Remove(mob/living/carbon/M, special = 0)
|
||||
..()
|
||||
spawn(120)
|
||||
beating = 0
|
||||
update_icon()
|
||||
|
||||
/obj/item/organ/internal/heart/prepare_eat()
|
||||
var/obj/S = ..()
|
||||
S.icon_state = "heart-off"
|
||||
return S
|
||||
|
||||
/obj/item/organ/internal/lungs
|
||||
name = "lungs"
|
||||
icon_state = "lungs"
|
||||
gender = PLURAL
|
||||
organ_tag = "lungs"
|
||||
parent_organ = "chest"
|
||||
slot = "lungs"
|
||||
origin_tech = "biotech=2"
|
||||
|
||||
/obj/item/organ/internal/lungs/process()///Fethas note, Should this be organ on life?
|
||||
..()
|
||||
//to_do per fethas: Could we handle some of the species breathing in here?
|
||||
|
||||
if(!owner)
|
||||
return
|
||||
|
||||
if (germ_level > INFECTION_LEVEL_ONE)
|
||||
if(prob(5))
|
||||
owner.emote("cough") //respitory tract infection
|
||||
|
||||
if(is_bruised())
|
||||
if(prob(2))
|
||||
spawn owner.custom_emote(1, "coughs up blood!")
|
||||
owner.drip(10)
|
||||
if(prob(4))
|
||||
spawn owner.custom_emote(1, "gasps for air!")
|
||||
owner.losebreath += 5
|
||||
|
||||
/obj/item/organ/internal/kidneys
|
||||
name = "kidneys"
|
||||
icon_state = "kidneys"
|
||||
gender = PLURAL
|
||||
organ_tag = "kidneys"
|
||||
parent_organ = "groin"
|
||||
slot = "kidneys"
|
||||
origin_tech = "biotech=2"
|
||||
|
||||
|
||||
/obj/item/organ/internal/kidneys/process()
|
||||
|
||||
..()
|
||||
|
||||
if(!owner)
|
||||
return
|
||||
|
||||
// Coffee is really bad for you with busted kidneys.
|
||||
// This should probably be expanded in some way, but fucked if I know
|
||||
// what else kidneys can process in our reagent list.
|
||||
var/datum/reagent/coffee = locate(/datum/reagent/drink/coffee) in owner.reagents.reagent_list
|
||||
if(coffee)
|
||||
if(is_bruised())
|
||||
owner.adjustToxLoss(0.1 * PROCESS_ACCURACY)
|
||||
else if(is_broken())
|
||||
owner.adjustToxLoss(0.3 * PROCESS_ACCURACY)
|
||||
|
||||
|
||||
/obj/item/organ/internal/eyes
|
||||
name = "eyeballs"
|
||||
icon_state = "eyes"
|
||||
gender = PLURAL
|
||||
organ_tag = "eyes"
|
||||
parent_organ = "head"
|
||||
slot = "eyes"
|
||||
origin_tech = "biotech=2"
|
||||
var/list/eye_colour = list(0,0,0)
|
||||
|
||||
/obj/item/organ/internal/eyes/proc/update_colour()
|
||||
if(!owner)
|
||||
return
|
||||
eye_colour = list(
|
||||
owner.r_eyes ? owner.r_eyes : 0,
|
||||
owner.g_eyes ? owner.g_eyes : 0,
|
||||
owner.b_eyes ? owner.b_eyes : 0
|
||||
)
|
||||
|
||||
/obj/item/organ/internal/eyes/Insert(mob/living/carbon/M, special = 0)
|
||||
..()
|
||||
// Apply our eye colour to the target.
|
||||
if(istype(M) && eye_colour)
|
||||
M.r_eyes = eye_colour[1]
|
||||
M.g_eyes = eye_colour[2]
|
||||
M.b_eyes = eye_colour[3]
|
||||
M.update_eyes()
|
||||
|
||||
|
||||
/obj/item/organ/internal/eyes/surgeryize()
|
||||
if(!owner)
|
||||
return
|
||||
owner.disabilities &= ~NEARSIGHTED
|
||||
owner.sdisabilities &= ~BLIND
|
||||
owner.eye_blurry = 0
|
||||
owner.eye_blind = 0
|
||||
|
||||
/obj/item/organ/internal/liver
|
||||
name = "liver"
|
||||
icon_state = "liver"
|
||||
organ_tag = "liver"
|
||||
parent_organ = "groin"
|
||||
slot = "liver"
|
||||
origin_tech = "biotech=1"
|
||||
|
||||
/obj/item/organ/internal/liver/process()
|
||||
|
||||
..()
|
||||
|
||||
if(!owner)
|
||||
return
|
||||
|
||||
if (germ_level > INFECTION_LEVEL_ONE)
|
||||
if(prob(1))
|
||||
owner << "\red Your skin itches."
|
||||
if (germ_level > INFECTION_LEVEL_TWO)
|
||||
if(prob(1))
|
||||
spawn owner.vomit()
|
||||
|
||||
if(owner.life_tick % PROCESS_ACCURACY == 0)
|
||||
|
||||
//High toxins levels are dangerous
|
||||
if(owner.getToxLoss() >= 60 && !owner.reagents.has_reagent("charcoal"))
|
||||
//Healthy liver suffers on its own
|
||||
if (src.damage < min_broken_damage)
|
||||
src.damage += 0.2 * PROCESS_ACCURACY
|
||||
//Damaged one shares the fun
|
||||
else
|
||||
var/obj/item/organ/O = pick(owner.internal_organs)
|
||||
if(O)
|
||||
O.damage += 0.2 * PROCESS_ACCURACY
|
||||
|
||||
//Detox can heal small amounts of damage
|
||||
if (src.damage && src.damage < src.min_bruised_damage && owner.reagents.has_reagent("charcoal"))
|
||||
src.damage -= 0.2 * PROCESS_ACCURACY
|
||||
|
||||
if(src.damage < 0)
|
||||
src.damage = 0
|
||||
|
||||
// Get the effectiveness of the liver.
|
||||
var/filter_effect = 3
|
||||
if(is_bruised())
|
||||
filter_effect -= 1
|
||||
if(is_broken())
|
||||
filter_effect -= 2
|
||||
|
||||
// Damaged liver means some chemicals are very dangerous
|
||||
if(src.damage >= src.min_bruised_damage)
|
||||
for(var/datum/reagent/R in owner.reagents.reagent_list)
|
||||
// Ethanol and all drinks are bad
|
||||
if(istype(R, /datum/reagent/ethanol))
|
||||
owner.adjustToxLoss(0.1 * PROCESS_ACCURACY)
|
||||
|
||||
// Can't cope with toxins at all
|
||||
for(var/toxin in list("toxin", "plasma", "sacid", "facid", "cyanide", "amanitin", "carpotoxin"))
|
||||
if(owner.reagents.has_reagent(toxin))
|
||||
owner.adjustToxLoss(0.3 * PROCESS_ACCURACY)
|
||||
|
||||
/obj/item/organ/internal/appendix
|
||||
name = "appendix"
|
||||
icon_state = "appendix"
|
||||
organ_tag = "appendix"
|
||||
parent_organ = "groin"
|
||||
slot = "appendix"
|
||||
origin_tech = "biotech=1"
|
||||
|
||||
/*
|
||||
/obj/item/organ/appendix/removed()
|
||||
|
||||
if(owner)
|
||||
var/inflamed = 0
|
||||
for(var/datum/disease/appendicitis/appendicitis in owner.viruses)
|
||||
inflamed = 1
|
||||
appendicitis.cure()
|
||||
owner.resistances += appendicitis
|
||||
if(inflamed)
|
||||
icon_state = "appendixinflamed"
|
||||
name = "inflamed appendix"
|
||||
..()
|
||||
*/
|
||||
|
||||
//shadowling brain tumor
|
||||
/obj/item/organ/internal/shadowtumor
|
||||
name = "black tumor"
|
||||
desc = "A tiny black mass with red tendrils trailing from it. It seems to shrivel in the light."
|
||||
icon_state = "blacktumor"
|
||||
origin_tech = "biotech=4"
|
||||
w_class = 1
|
||||
organ_tag = "blacktumor"
|
||||
parent_organ = "head"
|
||||
slot = "brain_tumor"
|
||||
health = 3
|
||||
|
||||
/obj/item/organ/internal/shadowtumor/New()
|
||||
..()
|
||||
processing_object.Add(src)
|
||||
|
||||
/obj/item/organ/internal/shadowtumor/Destroy()
|
||||
processing_object.Remove(src)
|
||||
..()
|
||||
|
||||
/obj/item/organ/internal/shadowtumor/process()
|
||||
if(isturf(loc))
|
||||
var/turf/T = loc
|
||||
var/light_count = T.get_lumcount()
|
||||
if(light_count > 4 && health > 0) //Die in the light
|
||||
health--
|
||||
else if(light_count < 2 && health < 3) //Heal in the dark
|
||||
health++
|
||||
if(health <= 0)
|
||||
visible_message("<span class='warning'>[src] collapses in on itself!</span>")
|
||||
qdel(src)
|
||||
@@ -0,0 +1,26 @@
|
||||
/obj/item/organ/external/stump
|
||||
name = "limb stump"
|
||||
icon_name = ""
|
||||
|
||||
/obj/item/organ/external/stump/New(var/mob/living/carbon/holder, var/internal, var/obj/item/organ/external/limb)
|
||||
if(istype(limb))
|
||||
limb_name = limb.limb_name
|
||||
body_part = limb.body_part
|
||||
amputation_point = limb.amputation_point
|
||||
parent_organ = limb.parent_organ
|
||||
wounds = limb.wounds
|
||||
..(holder, internal)
|
||||
if(istype(limb))
|
||||
max_damage = limb.max_damage
|
||||
if((limb.status & ORGAN_ROBOT) && (!parent || (parent.status & ORGAN_ROBOT)))
|
||||
robotize() //if both limb and the parent are robotic, the stump is robotic too
|
||||
|
||||
/obj/item/organ/external/stump/is_stump()
|
||||
return 1
|
||||
|
||||
/obj/item/organ/external/stump/removed()
|
||||
..()
|
||||
qdel(src)
|
||||
|
||||
/obj/item/organ/external/stump/is_usable()
|
||||
return 0
|
||||
@@ -0,0 +1,148 @@
|
||||
mob/proc/flash_pain()
|
||||
flick("pain",pain)
|
||||
|
||||
mob/var/list/pain_stored = list()
|
||||
mob/var/last_pain_message = ""
|
||||
mob/var/next_pain_time = 0
|
||||
|
||||
// partname is the name of a body part
|
||||
// amount is a num from 1 to 100
|
||||
mob/living/carbon/proc/pain(var/partname, var/amount, var/force, var/burning = 0)
|
||||
if(stat >= 2) return
|
||||
if(reagents.has_reagent("sal_acid"))
|
||||
return
|
||||
if(reagents.has_reagent("morphine"))
|
||||
return
|
||||
if(reagents.has_reagent("hydrocodone"))
|
||||
return
|
||||
if(analgesic)
|
||||
return
|
||||
if(world.time < next_pain_time && !force)
|
||||
return
|
||||
if(amount > 10 && istype(src,/mob/living/carbon/human))
|
||||
if(src:paralysis)
|
||||
src:paralysis = max(0, src:paralysis-round(amount/10))
|
||||
if(amount > 50 && prob(amount / 5))
|
||||
src:drop_item()
|
||||
var/msg
|
||||
if(burning)
|
||||
switch(amount)
|
||||
if(1 to 10)
|
||||
msg = "\red <b>Your [partname] burns.</b>"
|
||||
if(11 to 90)
|
||||
flash_weak_pain()
|
||||
msg = "\red <b><font size=2>Your [partname] burns badly!</font></b>"
|
||||
if(91 to 10000)
|
||||
flash_pain()
|
||||
msg = "\red <b><font size=3>OH GOD! Your [partname] is on fire!</font></b>"
|
||||
else
|
||||
switch(amount)
|
||||
if(1 to 10)
|
||||
msg = "<b>Your [partname] hurts.</b>"
|
||||
if(11 to 90)
|
||||
flash_weak_pain()
|
||||
msg = "<b><font size=2>Your [partname] hurts badly.</font></b>"
|
||||
if(91 to 10000)
|
||||
flash_pain()
|
||||
msg = "<b><font size=3>OH GOD! Your [partname] is hurting terribly!</font></b>"
|
||||
if(msg && (msg != last_pain_message || prob(10)))
|
||||
last_pain_message = msg
|
||||
src << msg
|
||||
next_pain_time = world.time + (100 - amount)
|
||||
|
||||
|
||||
// message is the custom message to be displayed
|
||||
// flash_strength is 0 for weak pain flash, 1 for strong pain flash
|
||||
mob/living/carbon/human/proc/custom_pain(var/message, var/flash_strength)
|
||||
if(stat >= 1) return
|
||||
|
||||
if(species && species.flags & NO_PAIN) return
|
||||
|
||||
if(reagents.has_reagent("morphine"))
|
||||
return
|
||||
if(reagents.has_reagent("hydrocodone"))
|
||||
return
|
||||
if(analgesic)
|
||||
return
|
||||
var/msg = "\red <b>[message]</b>"
|
||||
if(flash_strength >= 1)
|
||||
msg = "\red <font size=3><b>[message]</b></font>"
|
||||
|
||||
// Anti message spam checks
|
||||
if(msg && ((msg != last_pain_message) || (world.time >= next_pain_time)))
|
||||
last_pain_message = msg
|
||||
src << msg
|
||||
next_pain_time = world.time + 100
|
||||
|
||||
mob/living/carbon/human/proc/handle_pain()
|
||||
// not when sleeping
|
||||
|
||||
if(species && species.flags & NO_PAIN)
|
||||
//While synthetics don't feel pain, they will notice their gears gunking up with residue (toxins)
|
||||
if(isSynthetic())
|
||||
var/toxDamageMessage = null
|
||||
var/toxMessageProb = 1
|
||||
switch(getToxLoss())
|
||||
if(25 to 50)
|
||||
toxMessageProb = 1
|
||||
toxDamageMessage = "Your servos seem to be working harder."
|
||||
if(50 to 75)
|
||||
toxMessageProb = 2
|
||||
toxDamageMessage = "Your joints seem to stick randomly."
|
||||
if(75 to INFINITY)
|
||||
toxMessageProb = 5
|
||||
toxDamageMessage = "Your motors seem to slip; it really grinds your gears!"
|
||||
if(toxDamageMessage && prob(toxMessageProb))
|
||||
src.custom_pain(toxDamageMessage, getToxLoss() >= 15)
|
||||
return
|
||||
|
||||
if(stat >= 2) return
|
||||
if(reagents.has_reagent("morphine"))
|
||||
return
|
||||
if(reagents.has_reagent("hydrocodone"))
|
||||
return
|
||||
if(analgesic)
|
||||
return
|
||||
var/maxdam = 0
|
||||
var/obj/item/organ/external/damaged_organ = null
|
||||
for(var/obj/item/organ/external/E in organs)
|
||||
if(E.status & ORGAN_DEAD|ORGAN_ROBOT) continue
|
||||
var/dam = E.get_damage()
|
||||
// make the choice of the organ depend on damage,
|
||||
// but also sometimes use one of the less damaged ones
|
||||
if(dam > maxdam && (maxdam == 0 || prob(70)) )
|
||||
damaged_organ = E
|
||||
maxdam = dam
|
||||
if(damaged_organ)
|
||||
pain(damaged_organ.name, maxdam, 0)
|
||||
|
||||
|
||||
// Damage to internal organs hurts a lot.
|
||||
for(var/obj/item/organ/internal/I in internal_organs)
|
||||
if(istype(I, /obj/item/organ/internal/brain)) //the brain has no pain receptors, and brain damage is meant to be a stealthy damage type.
|
||||
continue
|
||||
if(I.damage > 2) if(prob(2))
|
||||
var/obj/item/organ/external/parent = get_organ(I.parent_organ)
|
||||
src.custom_pain("You feel a sharp pain in your [parent.name]", 1)
|
||||
|
||||
var/toxDamageMessage = null
|
||||
var/toxMessageProb = 1
|
||||
switch(getToxLoss())
|
||||
if(1 to 5)
|
||||
toxMessageProb = 1
|
||||
toxDamageMessage = "Your body stings slightly."
|
||||
if(6 to 10)
|
||||
toxMessageProb = 2
|
||||
toxDamageMessage = "Your whole body hurts a little."
|
||||
if(11 to 15)
|
||||
toxMessageProb = 2
|
||||
toxDamageMessage = "Your whole body hurts."
|
||||
if(15 to 25)
|
||||
toxMessageProb = 3
|
||||
toxDamageMessage = "Your whole body hurts badly."
|
||||
if(26 to INFINITY)
|
||||
toxMessageProb = 5
|
||||
toxDamageMessage = "Your body aches all over, it's driving you mad."
|
||||
|
||||
if(toxDamageMessage && prob(toxMessageProb))
|
||||
src.custom_pain(toxDamageMessage, getToxLoss() >= 15)
|
||||
@@ -0,0 +1,43 @@
|
||||
var/global/list/all_robolimbs = list()
|
||||
var/global/list/chargen_robolimbs = list()
|
||||
var/global/datum/robolimb/basic_robolimb
|
||||
|
||||
/proc/populate_robolimb_list()
|
||||
basic_robolimb = new()
|
||||
for(var/limb_type in typesof(/datum/robolimb))
|
||||
var/datum/robolimb/R = new limb_type()
|
||||
all_robolimbs[R.company] = R
|
||||
if(!R.unavailable_at_chargen)
|
||||
chargen_robolimbs[R.company] = R
|
||||
|
||||
/datum/robolimb
|
||||
var/company = "Unbranded" // Shown when selecting the limb.
|
||||
var/desc = "A generic unbranded robotic prosthesis." // Seen when examining a limb.
|
||||
var/icon = 'icons/mob/human_races/robotic.dmi' // Icon base to draw from.
|
||||
var/unavailable_at_chargen // If set, not available at chargen.
|
||||
|
||||
/datum/robolimb/bishop
|
||||
company = "Bishop Cybernetics"
|
||||
desc = "This limb has a white polymer casing with blue holo-displays."
|
||||
icon = 'icons/mob/human_races/cyberlimbs/bishop.dmi'
|
||||
|
||||
/datum/robolimb/hesphaistos
|
||||
company = "Hesphiastos Industries"
|
||||
desc = "This limb has a militaristic black and green casing with gold stripes."
|
||||
icon = 'icons/mob/human_races/cyberlimbs/hesphaistos.dmi'
|
||||
|
||||
/datum/robolimb/zenghu
|
||||
company = "Zeng-Hu Pharmaceuticals"
|
||||
desc = "This limb has a rubbery fleshtone covering with visible seams."
|
||||
icon = 'icons/mob/human_races/cyberlimbs/zenghu.dmi'
|
||||
|
||||
/datum/robolimb/xion
|
||||
company = "Xion Manufacturing Group"
|
||||
desc = "This limb has a minimalist black and red casing."
|
||||
icon = 'icons/mob/human_races/cyberlimbs/xion.dmi'
|
||||
|
||||
/datum/robolimb/ipc
|
||||
company = "Morpheus Cyberkinetics"
|
||||
desc = "This limb is simple and functional; no effort has been made to make it look human."
|
||||
icon = 'icons/mob/human_races/cyberlimbs/ipc.dmi'
|
||||
unavailable_at_chargen = 1
|
||||
@@ -0,0 +1,50 @@
|
||||
/obj/item/weapon/skeleton
|
||||
name ="skeleton"
|
||||
desc = "skeleton parent object."
|
||||
icon = 'icons/mob/human_races/r_skeleton.dmi'
|
||||
|
||||
|
||||
/obj/item/weapon/skeleton/head
|
||||
name = "skull"
|
||||
desc = "a skeleton skull, would make a nice paperweight."
|
||||
icon_state = "head"
|
||||
|
||||
/obj/item/weapon/skeleton/r_hand
|
||||
name = "skeleton right hand"
|
||||
desc = "a skeleton right hand."
|
||||
icon_state = "r_hand"
|
||||
|
||||
/obj/item/weapon/skeleton/r_arm
|
||||
name = "skeleton right arm"
|
||||
desc = "a skeleton right arm."
|
||||
icon_state = "r_arm"
|
||||
|
||||
/obj/item/weapon/skeleton/l_hand
|
||||
name = "skeleton left hand"
|
||||
desc = "a skeleton left hand."
|
||||
icon_state = "l_hand"
|
||||
|
||||
/obj/item/weapon/skeleton/l_arm
|
||||
name = "skeleton left arm"
|
||||
desc = "a skeleton left arm."
|
||||
icon_state = "l_arm"
|
||||
|
||||
/obj/item/weapon/skeleton/r_foot
|
||||
name = "skeleton right foot"
|
||||
desc = "a skeleton right foot."
|
||||
icon_state = "r_foot"
|
||||
|
||||
/obj/item/weapon/skeleton/r_leg
|
||||
name = "skeleton right leg"
|
||||
desc = "a skeleton right leg"
|
||||
icon_state = "r_leg"
|
||||
|
||||
/obj/item/weapon/skeleton/l_foot
|
||||
name = "skeleton left foot"
|
||||
desc = "a skeleton left foot"
|
||||
icon_state = "l_foot"
|
||||
|
||||
/obj/item/weapon/skeleton/l_leg
|
||||
name = "skeleton left leg"
|
||||
desc = "a skeleton left leg"
|
||||
icon_state = "l_leg"
|
||||
@@ -0,0 +1,215 @@
|
||||
/*/proc/spawn_diona_nymph_from_organ(var/obj/item/organ/organ)
|
||||
if(!istype(organ))
|
||||
return 0
|
||||
|
||||
//This is a terrible hack and I should be ashamed.
|
||||
var/datum/seed/diona = plant_controller.seeds["diona"]
|
||||
if(!diona)
|
||||
return 0
|
||||
|
||||
spawn(1) // So it has time to be thrown about by the gib() proc.
|
||||
var/mob/living/simple_animal/diona/D = new(get_turf(organ))
|
||||
var/datum/ghosttrap/plant/P = get_ghost_trap("living plant")
|
||||
P.request_player(D, "A diona nymph has split off from its gestalt. ")
|
||||
spawn(60)
|
||||
if(D)
|
||||
if(!D.ckey || !D.client)
|
||||
D.death()
|
||||
return 1 */
|
||||
|
||||
/obj/item/organ/external/diona
|
||||
name = "tendril"
|
||||
cannot_break = 1
|
||||
amputation_point = "branch"
|
||||
|
||||
/obj/item/organ/external/diona/chest
|
||||
name = "core trunk"
|
||||
limb_name = "chest"
|
||||
icon_name = "torso"
|
||||
max_damage = 200
|
||||
min_broken_damage = 50
|
||||
w_class = 5
|
||||
body_part = UPPER_TORSO
|
||||
vital = 1
|
||||
cannot_amputate = 1
|
||||
parent_organ = null
|
||||
|
||||
/obj/item/organ/external/diona/groin
|
||||
name = "fork"
|
||||
limb_name = "groin"
|
||||
icon_name = "groin"
|
||||
max_damage = 100
|
||||
min_broken_damage = 50
|
||||
w_class = 4
|
||||
body_part = LOWER_TORSO
|
||||
parent_organ = "chest"
|
||||
|
||||
/obj/item/organ/external/diona/arm
|
||||
name = "left upper tendril"
|
||||
limb_name = "l_arm"
|
||||
icon_name = "l_arm"
|
||||
max_damage = 35
|
||||
min_broken_damage = 20
|
||||
w_class = 3
|
||||
body_part = ARM_LEFT
|
||||
parent_organ = "chest"
|
||||
can_grasp = 1
|
||||
|
||||
/obj/item/organ/external/diona/arm/right
|
||||
name = "right upper tendril"
|
||||
limb_name = "r_arm"
|
||||
icon_name = "r_arm"
|
||||
body_part = ARM_RIGHT
|
||||
|
||||
/obj/item/organ/external/diona/leg
|
||||
name = "left lower tendril"
|
||||
limb_name = "l_leg"
|
||||
icon_name = "l_leg"
|
||||
max_damage = 35
|
||||
min_broken_damage = 20
|
||||
w_class = 3
|
||||
body_part = LEG_LEFT
|
||||
icon_position = LEFT
|
||||
parent_organ = "groin"
|
||||
can_stand = 1
|
||||
|
||||
/obj/item/organ/external/diona/leg/right
|
||||
name = "right lower tendril"
|
||||
limb_name = "r_leg"
|
||||
icon_name = "r_leg"
|
||||
body_part = LEG_RIGHT
|
||||
icon_position = RIGHT
|
||||
|
||||
/obj/item/organ/external/diona/foot
|
||||
name = "left foot"
|
||||
limb_name = "l_foot"
|
||||
icon_name = "l_foot"
|
||||
max_damage = 20
|
||||
min_broken_damage = 10
|
||||
w_class = 2
|
||||
body_part = FOOT_LEFT
|
||||
icon_position = LEFT
|
||||
parent_organ = "l_leg"
|
||||
can_stand = 1
|
||||
|
||||
/obj/item/organ/external/diona/foot/right
|
||||
name = "right foot"
|
||||
limb_name = "r_foot"
|
||||
icon_name = "r_foot"
|
||||
body_part = FOOT_RIGHT
|
||||
icon_position = RIGHT
|
||||
parent_organ = "r_leg"
|
||||
amputation_point = "right ankle"
|
||||
|
||||
/obj/item/organ/external/diona/hand
|
||||
name = "left grasper"
|
||||
limb_name = "l_hand"
|
||||
icon_name = "l_hand"
|
||||
max_damage = 30
|
||||
min_broken_damage = 15
|
||||
w_class = 2
|
||||
body_part = HAND_LEFT
|
||||
parent_organ = "l_arm"
|
||||
can_grasp = 1
|
||||
|
||||
/obj/item/organ/external/diona/hand/right
|
||||
name = "right grasper"
|
||||
limb_name = "r_hand"
|
||||
icon_name = "r_hand"
|
||||
body_part = HAND_RIGHT
|
||||
parent_organ = "r_arm"
|
||||
|
||||
/obj/item/organ/external/diona/head
|
||||
limb_name = "head"
|
||||
icon_name = "head"
|
||||
name = "head"
|
||||
max_damage = 50
|
||||
min_broken_damage = 25
|
||||
vital = 1
|
||||
w_class = 3
|
||||
body_part = HEAD
|
||||
parent_organ = "chest"
|
||||
var/can_intake_reagents = 1
|
||||
|
||||
/obj/item/organ/external/diona/head/removed()
|
||||
if(owner)
|
||||
owner.unEquip(owner.head)
|
||||
owner.unEquip(owner.l_ear)
|
||||
..()
|
||||
|
||||
//DIONA ORGANS.
|
||||
/* /obj/item/organ/external/diona/removed()
|
||||
var/mob/living/carbon/human/H = owner
|
||||
..()
|
||||
if(!istype(H) || !H.organs || !H.organs.len)
|
||||
H.death()
|
||||
if(prob(50) && spawn_diona_nymph_from_organ(src))
|
||||
qdel(src) */
|
||||
|
||||
/obj/item/organ/diona/process()
|
||||
return
|
||||
|
||||
/obj/item/organ/internal/diona/strata
|
||||
name = "neural strata"
|
||||
icon = 'icons/obj/objects.dmi'
|
||||
icon_state = "nymph"
|
||||
organ_tag = "special" // Turns into a nymph instantly, no transplanting possible.
|
||||
origin_tech = "biotech=3"
|
||||
parent_organ = "chest"
|
||||
slot = "heart"
|
||||
|
||||
/obj/item/organ/internal/diona/bladder
|
||||
name = "gas bladder"
|
||||
parent_organ = "head"
|
||||
icon = 'icons/obj/objects.dmi'
|
||||
icon_state = "nymph"
|
||||
organ_tag = "special" // Turns into a nymph instantly, no transplanting possible.
|
||||
origin_tech = "biotech=3"
|
||||
slot = "brain"
|
||||
|
||||
/obj/item/organ/internal/diona/polyp
|
||||
name = "polyp segment"
|
||||
icon = 'icons/obj/objects.dmi'
|
||||
icon_state = "nymph"
|
||||
organ_tag = "special" // Turns into a nymph instantly, no transplanting possible.
|
||||
origin_tech = "biotech=3"
|
||||
parent_organ = "groin"
|
||||
slot = "kidneys"
|
||||
|
||||
/obj/item/organ/internal/diona/ligament
|
||||
name = "anchoring ligament"
|
||||
icon = 'icons/obj/objects.dmi'
|
||||
icon_state = "nymph"
|
||||
organ_tag = "special" // Turns into a nymph instantly, no transplanting possible.
|
||||
origin_tech = "biotech=3"
|
||||
parent_organ = "groin"
|
||||
slot = "appendix"
|
||||
|
||||
/obj/item/organ/internal/diona/node
|
||||
name = "receptor node"
|
||||
organ_tag = "receptor node"
|
||||
icon = 'icons/mob/alien.dmi'
|
||||
icon_state = "claw"
|
||||
origin_tech = "biotech=3"
|
||||
parent_organ = "head"
|
||||
slot = "eyes"
|
||||
|
||||
//TODO:Make absorb rads on insert
|
||||
|
||||
/obj/item/organ/internal/diona/nutrients
|
||||
name = "nutrient vessel"
|
||||
parent_organ = "chest"
|
||||
organ_tag = "nutrient vessel"
|
||||
icon = 'icons/mob/alien.dmi'
|
||||
icon_state = "claw"
|
||||
slot = "nutri_vessel"
|
||||
|
||||
//TODO:Make absorb light on insert.
|
||||
|
||||
/*/obj/item/organ/diona/removed(var/mob/living/user)
|
||||
var/mob/living/carbon/human/H = owner
|
||||
..()
|
||||
if(!istype(H) || !H.organs || !H.organs.len)
|
||||
H.death()
|
||||
if(prob(50) && spawn_diona_nymph_from_organ(src))
|
||||
qdel(src) */
|
||||
@@ -0,0 +1,141 @@
|
||||
// IPC limbs.
|
||||
/obj/item/organ/external/head/ipc
|
||||
can_intake_reagents = 0
|
||||
vital = 0
|
||||
max_damage = 50 //made same as arm, since it is not vital
|
||||
min_broken_damage = 30
|
||||
encased = null
|
||||
|
||||
/obj/item/organ/external/head/ipc/New()
|
||||
robotize("Morpheus Cyberkinetics")
|
||||
..()
|
||||
|
||||
/obj/item/organ/external/chest/ipc
|
||||
encased = null
|
||||
|
||||
/obj/item/organ/external/chest/ipc/New()
|
||||
robotize("Morpheus Cyberkinetics")
|
||||
..()
|
||||
|
||||
/obj/item/organ/external/groin/ipc/New()
|
||||
robotize("Morpheus Cyberkinetics")
|
||||
..()
|
||||
|
||||
/obj/item/organ/external/arm/ipc/New()
|
||||
robotize("Morpheus Cyberkinetics")
|
||||
..()
|
||||
|
||||
/obj/item/organ/external/arm/right/ipc/New()
|
||||
robotize("Morpheus Cyberkinetics")
|
||||
..()
|
||||
|
||||
/obj/item/organ/external/leg/ipc/New()
|
||||
robotize("Morpheus Cyberkinetics")
|
||||
..()
|
||||
|
||||
/obj/item/organ/external/leg/right/ipc/New()
|
||||
robotize("Morpheus Cyberkinetics")
|
||||
..()
|
||||
|
||||
/obj/item/organ/external/foot/ipc/New()
|
||||
robotize("Morpheus Cyberkinetics")
|
||||
..()
|
||||
|
||||
/obj/item/organ/external/foot/right/ipc/New()
|
||||
robotize("Morpheus Cyberkinetics")
|
||||
..()
|
||||
|
||||
/obj/item/organ/external/hand/ipc/New()
|
||||
robotize("Morpheus Cyberkinetics")
|
||||
..()
|
||||
|
||||
/obj/item/organ/external/hand/right/ipc/New()
|
||||
robotize("Morpheus Cyberkinetics")
|
||||
..()
|
||||
|
||||
/obj/item/organ/internal/cell
|
||||
name = "microbattery"
|
||||
desc = "A small, powerful cell for use in fully prosthetic bodies."
|
||||
icon = 'icons/obj/power.dmi'
|
||||
icon_state = "scell"
|
||||
organ_tag = "cell"
|
||||
parent_organ = "chest"
|
||||
slot = "heart"
|
||||
vital = 1
|
||||
|
||||
/obj/item/organ/internal/cell/New()
|
||||
robotize()
|
||||
..()
|
||||
|
||||
/obj/item/organ/internal/cell/Insert()
|
||||
..()
|
||||
// This is very ghetto way of rebooting an IPC. TODO better way.
|
||||
if(owner && owner.stat == DEAD)
|
||||
owner.stat = CONSCIOUS
|
||||
owner.visible_message("<span class='danger'>\The [owner] twitches visibly!</span>")
|
||||
|
||||
/obj/item/organ/internal/optical_sensor
|
||||
name = "optical sensor"
|
||||
organ_tag = "optics"
|
||||
parent_organ = "head"
|
||||
icon = 'icons/obj/robot_component.dmi'
|
||||
icon_state = "camera"
|
||||
slot = "eyes"
|
||||
// dead_icon = "camera_broken"
|
||||
|
||||
/obj/item/organ/internal/optical_sensor/New()
|
||||
robotize()
|
||||
..()
|
||||
|
||||
// Used for an MMI or posibrain being installed into a human.
|
||||
/obj/item/organ/internal/mmi_holder
|
||||
name = "brain"
|
||||
organ_tag = "brain"
|
||||
parent_organ = "chest"
|
||||
vital = 1
|
||||
max_damage = 200
|
||||
slot = "brain"
|
||||
var/obj/item/device/mmi/stored_mmi
|
||||
|
||||
/obj/item/organ/internal/mmi_holder/proc/update_from_mmi()
|
||||
if(!stored_mmi)
|
||||
return
|
||||
name = stored_mmi.name
|
||||
desc = stored_mmi.desc
|
||||
icon = stored_mmi.icon
|
||||
icon_state = stored_mmi.icon_state
|
||||
|
||||
/obj/item/organ/internal/mmi_holder/Remove(var/mob/living/user)
|
||||
if(stored_mmi)
|
||||
stored_mmi.loc = get_turf(src)
|
||||
if(owner.mind)
|
||||
owner.mind.transfer_to(stored_mmi.brainmob)
|
||||
..()
|
||||
|
||||
var/mob/living/holder_mob = loc
|
||||
if(istype(holder_mob))
|
||||
holder_mob.unEquip(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/organ/internal/mmi_holder/New()
|
||||
..()
|
||||
// This is very ghetto way of rebooting an IPC. TODO better way.
|
||||
spawn(1)
|
||||
if(owner && owner.stat == DEAD)
|
||||
owner.stat = CONSCIOUS
|
||||
owner.visible_message("<span class='danger'>\The [owner] twitches visibly!</span>")
|
||||
|
||||
/obj/item/organ/internal/mmi_holder/posibrain/New()
|
||||
robotize()
|
||||
stored_mmi = new /obj/item/device/mmi/posibrain(src)
|
||||
..()
|
||||
spawn(1)
|
||||
if(owner)
|
||||
stored_mmi.name = "positronic brain ([owner.real_name])"
|
||||
stored_mmi.brainmob.real_name = owner.real_name
|
||||
stored_mmi.brainmob.name = stored_mmi.brainmob.real_name
|
||||
stored_mmi.icon_state = "posibrain-occupied"
|
||||
update_from_mmi()
|
||||
else
|
||||
stored_mmi.loc = get_turf(src)
|
||||
qdel(src)
|
||||
@@ -0,0 +1,65 @@
|
||||
//CORTICAL BORER ORGANS.
|
||||
/obj/item/organ/internal/borer
|
||||
name = "cortical borer"
|
||||
icon = 'icons/obj/objects.dmi'
|
||||
icon_state = "borer"
|
||||
parent_organ = "head"
|
||||
organ_tag = "brain"
|
||||
slot = "borer"
|
||||
vital = 1
|
||||
|
||||
/obj/item/organ/internal/borer/process()
|
||||
|
||||
// Borer husks regenerate health, feel no pain, and are resistant to stuns and brainloss.
|
||||
for(var/chem in list("saline", "sailcylic", "meth", "mannitol"))
|
||||
if(owner.reagents.get_reagent_amount(chem) < 3)
|
||||
owner.reagents.add_reagent(chem, 5)
|
||||
|
||||
// They're also super gross and ooze ichor.
|
||||
if(prob(5))
|
||||
var/mob/living/carbon/human/H = owner
|
||||
if(!istype(H))
|
||||
return
|
||||
|
||||
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in H.vessel.reagent_list
|
||||
blood_splatter(H,B,1)
|
||||
var/obj/effect/decal/cleanable/blood/splatter/goo = locate() in get_turf(owner)
|
||||
if(goo)
|
||||
goo.name = "husk ichor"
|
||||
goo.desc = "It's thick and stinks of decay."
|
||||
goo.basecolor = "#412464"
|
||||
goo.update_icon()
|
||||
|
||||
/obj/item/organ/internal/borer/Remove(var/mob/living/user)
|
||||
|
||||
..()
|
||||
|
||||
var/mob/living/simple_animal/borer/B = owner.has_brain_worms()
|
||||
if(B)
|
||||
B.leave_host()
|
||||
B.ckey = owner.ckey
|
||||
|
||||
spawn(0)
|
||||
qdel(src)
|
||||
|
||||
//VOX ORGANS.
|
||||
/obj/item/organ/internal/stack
|
||||
name = "cortical stack"
|
||||
icon_state = "brain-prosthetic"
|
||||
parent_organ = "head"
|
||||
organ_tag = "stack"
|
||||
slot = "brain"
|
||||
robotic = 2
|
||||
vital = 1
|
||||
var/backup_time = 0
|
||||
var/datum/mind/backup
|
||||
|
||||
/obj/item/organ/internal/stack/process()
|
||||
if(owner && owner.stat != 2 && !is_broken())
|
||||
backup_time = world.time
|
||||
if(owner.mind) backup = owner.mind
|
||||
|
||||
/obj/item/organ/internal/stack/vox
|
||||
name = "vox cortical stack"
|
||||
|
||||
/obj/item/organ/internal/stack/vox/stack
|
||||
@@ -0,0 +1,37 @@
|
||||
//NUCLEATION ORGAN
|
||||
/obj/item/organ/internal/nucleation
|
||||
name = "nucleation organ"
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
desc = "A crystalized human organ. /red It has a strangely iridescent glow."
|
||||
|
||||
/obj/item/organ/internal/nucleation/resonant_crystal
|
||||
name = "resonant crystal"
|
||||
icon_state = "resonant-crystal"
|
||||
organ_tag = "resonant crystal"
|
||||
parent_organ = "head"
|
||||
slot = "res_crystal"
|
||||
|
||||
/obj/item/organ/internal/nucleation/strange_crystal
|
||||
name = "strange crystal"
|
||||
icon_state = "strange-crystal"
|
||||
organ_tag = "strange crystal"
|
||||
parent_organ = "chest"
|
||||
slot = "heart"
|
||||
|
||||
|
||||
/obj/item/organ/internal/eyes/luminescent_crystal
|
||||
name = "luminescent eyes"
|
||||
icon_state = "crystal-eyes"
|
||||
organ_tag = "luminescent eyes"
|
||||
light_color = "#1C1C00"
|
||||
parent_organ = "head"
|
||||
slot = "eyes"
|
||||
|
||||
/obj/item/organ/internal/eyes/luminescent_crystal/New()
|
||||
set_light(2)
|
||||
|
||||
/obj/item/organ/internal/brain/crystal
|
||||
name = "crystalized brain"
|
||||
icon_state = "crystal-brain"
|
||||
organ_tag = "crystalized brain"
|
||||
slot = "brain"
|
||||
@@ -0,0 +1,157 @@
|
||||
/****************************************************
|
||||
ORGAN DEFINES
|
||||
****************************************************/
|
||||
|
||||
/obj/item/organ/external/chest
|
||||
name = "upper body"
|
||||
limb_name = "chest"
|
||||
icon_name = "torso"
|
||||
max_damage = 100
|
||||
min_broken_damage = 35
|
||||
w_class = 5
|
||||
body_part = UPPER_TORSO
|
||||
vital = 1
|
||||
amputation_point = "spine"
|
||||
gendered_icon = 1
|
||||
cannot_amputate = 1
|
||||
parent_organ = null
|
||||
encased = "ribcage"
|
||||
|
||||
/obj/item/organ/external/groin
|
||||
name = "lower body"
|
||||
limb_name = "groin"
|
||||
icon_name = "groin"
|
||||
max_damage = 100
|
||||
min_broken_damage = 35
|
||||
w_class = 4
|
||||
body_part = LOWER_TORSO
|
||||
vital = 1
|
||||
parent_organ = "chest"
|
||||
amputation_point = "lumbar"
|
||||
gendered_icon = 1
|
||||
|
||||
/obj/item/organ/external/arm
|
||||
limb_name = "l_arm"
|
||||
name = "left arm"
|
||||
icon_name = "l_arm"
|
||||
max_damage = 50
|
||||
min_broken_damage = 30
|
||||
w_class = 3
|
||||
body_part = ARM_LEFT
|
||||
parent_organ = "chest"
|
||||
amputation_point = "left shoulder"
|
||||
can_grasp = 1
|
||||
|
||||
/obj/item/organ/external/arm/right
|
||||
limb_name = "r_arm"
|
||||
name = "right arm"
|
||||
icon_name = "r_arm"
|
||||
body_part = ARM_RIGHT
|
||||
amputation_point = "right shoulder"
|
||||
|
||||
/obj/item/organ/external/leg
|
||||
limb_name = "l_leg"
|
||||
name = "left leg"
|
||||
icon_name = "l_leg"
|
||||
max_damage = 50
|
||||
min_broken_damage = 30
|
||||
w_class = 3
|
||||
body_part = LEG_LEFT
|
||||
icon_position = LEFT
|
||||
parent_organ = "groin"
|
||||
amputation_point = "left hip"
|
||||
can_stand = 1
|
||||
|
||||
/obj/item/organ/external/leg/right
|
||||
limb_name = "r_leg"
|
||||
name = "right leg"
|
||||
icon_name = "r_leg"
|
||||
body_part = LEG_RIGHT
|
||||
icon_position = RIGHT
|
||||
amputation_point = "right hip"
|
||||
|
||||
/obj/item/organ/external/foot
|
||||
limb_name = "l_foot"
|
||||
name = "left foot"
|
||||
icon_name = "l_foot"
|
||||
max_damage = 30
|
||||
min_broken_damage = 15
|
||||
w_class = 2
|
||||
body_part = FOOT_LEFT
|
||||
icon_position = LEFT
|
||||
parent_organ = "l_leg"
|
||||
amputation_point = "left ankle"
|
||||
can_stand = 1
|
||||
|
||||
/obj/item/organ/external/foot/removed()
|
||||
if(owner) owner.unEquip(owner.shoes)
|
||||
..()
|
||||
|
||||
/obj/item/organ/external/foot/right
|
||||
limb_name = "r_foot"
|
||||
name = "right foot"
|
||||
icon_name = "r_foot"
|
||||
body_part = FOOT_RIGHT
|
||||
icon_position = RIGHT
|
||||
parent_organ = "r_leg"
|
||||
amputation_point = "right ankle"
|
||||
|
||||
/obj/item/organ/external/hand
|
||||
limb_name = "l_hand"
|
||||
name = "left hand"
|
||||
icon_name = "l_hand"
|
||||
max_damage = 30
|
||||
min_broken_damage = 15
|
||||
w_class = 2
|
||||
body_part = HAND_LEFT
|
||||
parent_organ = "l_arm"
|
||||
amputation_point = "left wrist"
|
||||
can_grasp = 1
|
||||
|
||||
/obj/item/organ/external/hand/removed()
|
||||
owner.unEquip(owner.gloves)
|
||||
..()
|
||||
|
||||
/obj/item/organ/external/hand/right
|
||||
limb_name = "r_hand"
|
||||
name = "right hand"
|
||||
icon_name = "r_hand"
|
||||
body_part = HAND_RIGHT
|
||||
parent_organ = "r_arm"
|
||||
amputation_point = "right wrist"
|
||||
|
||||
/obj/item/organ/external/head
|
||||
limb_name = "head"
|
||||
icon_name = "head"
|
||||
name = "head"
|
||||
max_damage = 75
|
||||
min_broken_damage = 35
|
||||
w_class = 3
|
||||
body_part = HEAD
|
||||
vital = 1
|
||||
parent_organ = "chest"
|
||||
amputation_point = "neck"
|
||||
gendered_icon = 1
|
||||
encased = "skull"
|
||||
var/can_intake_reagents = 1
|
||||
|
||||
/obj/item/organ/external/head/removed()
|
||||
if(owner)
|
||||
name = "[owner.real_name]'s head"
|
||||
owner.unEquip(owner.glasses)
|
||||
owner.unEquip(owner.head)
|
||||
owner.unEquip(owner.l_ear)
|
||||
owner.unEquip(owner.r_ear)
|
||||
owner.unEquip(owner.wear_mask)
|
||||
spawn(1)
|
||||
owner.update_hair()
|
||||
..()
|
||||
|
||||
/obj/item/organ/external/head/take_damage(brute, burn, sharp, edge, used_weapon = null, list/forbidden_limbs = list())
|
||||
..(brute, burn, sharp, edge, used_weapon, forbidden_limbs)
|
||||
if (!disfigured)
|
||||
if (brute_dam > 40)
|
||||
if (prob(50))
|
||||
disfigure("brute")
|
||||
if (burn_dam > 40)
|
||||
disfigure("burn")
|
||||
@@ -0,0 +1,34 @@
|
||||
// Slime limbs.
|
||||
/obj/item/organ/external/chest/unbreakable
|
||||
cannot_break = 1
|
||||
|
||||
/obj/item/organ/external/groin/unbreakable
|
||||
cannot_break = 1
|
||||
|
||||
/obj/item/organ/external/arm/unbreakable
|
||||
cannot_break = 1
|
||||
|
||||
/obj/item/organ/external/arm/right/unbreakable
|
||||
cannot_break = 1
|
||||
|
||||
/obj/item/organ/external/leg/unbreakable
|
||||
cannot_break = 1
|
||||
|
||||
/obj/item/organ/external/leg/right/unbreakable
|
||||
cannot_break = 1
|
||||
|
||||
/obj/item/organ/external/foot/unbreakable
|
||||
cannot_break = 1
|
||||
|
||||
/obj/item/organ/external/foot/right/unbreakable
|
||||
cannot_break = 1
|
||||
|
||||
/obj/item/organ/external/hand/unbreakable
|
||||
cannot_break = 1
|
||||
|
||||
/obj/item/organ/external/hand/right/unbreakable
|
||||
cannot_break = 1
|
||||
|
||||
/obj/item/organ/external/head/unbreakable
|
||||
cannot_break = 1
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
//WRYN ORGAN
|
||||
/obj/item/organ/internal/wryn/hivenode
|
||||
name = "antennae"
|
||||
organ_tag = "antennae"
|
||||
icon = 'icons/mob/human_races/r_wryn.dmi'
|
||||
icon_state = "antennae"
|
||||
parent_organ = "head"
|
||||
slot = "hivenode"
|
||||
@@ -0,0 +1,158 @@
|
||||
/obj/item/organ/internal/xenos
|
||||
origin_tech = "biotech=5"
|
||||
icon_state = "xgibmid2"
|
||||
var/list/alien_powers = list()
|
||||
|
||||
/obj/item/organ/internal/xenos/New()
|
||||
for(var/A in alien_powers)
|
||||
if(ispath(A))
|
||||
alien_powers -= A
|
||||
alien_powers += new A(src)
|
||||
..()
|
||||
|
||||
///can be changed if xenos get an update..
|
||||
/obj/item/organ/internal/xenos/Insert(mob/living/carbon/M, special = 0)
|
||||
..()
|
||||
for(var/mob/living/carbon/alien/humanoid/verb/P in alien_powers)
|
||||
verbs += P
|
||||
|
||||
/obj/item/organ/internal/alien/Remove(mob/living/carbon/M, special = 0)
|
||||
for(var/mob/living/carbon/alien/humanoid/verb/P in alien_powers)
|
||||
verbs -= P
|
||||
|
||||
..()
|
||||
|
||||
/obj/item/organ/internal/xenos/prepare_eat()
|
||||
var/obj/S = ..()
|
||||
S.reagents.add_reagent("sacid", 10)
|
||||
return S
|
||||
|
||||
//XENOMORPH ORGANS
|
||||
|
||||
/obj/item/organ/internal/xenos/plasmavessel
|
||||
name = "plasma vessel"
|
||||
icon_state = "plasma"
|
||||
origin_tech = "biotech=5;plasmatech=2"
|
||||
w_class = 3
|
||||
parent_organ = "chest"
|
||||
slot = "plasmavessel"
|
||||
alien_powers = list(/mob/living/carbon/alien/humanoid/verb/plant, /mob/living/carbon/alien/humanoid/verb/transfer_plasma)
|
||||
|
||||
|
||||
var/stored_plasma = 0
|
||||
var/max_plasma = 500
|
||||
var/heal_rate = 5
|
||||
var/plasma_rate = 10
|
||||
|
||||
/obj/item/organ/internal/xenos/plasmavessel/prepare_eat()
|
||||
var/obj/S = ..()
|
||||
S.reagents.add_reagent("plasma", stored_plasma/10)
|
||||
return S
|
||||
|
||||
/obj/item/organ/internal/xenos/plasmavessel/queen
|
||||
name = "bloated plasma vessel"
|
||||
icon_state = "plasma_large"
|
||||
origin_tech = "biotech=6;plasma=3"
|
||||
stored_plasma = 200
|
||||
max_plasma = 500
|
||||
plasma_rate = 25
|
||||
|
||||
/obj/item/organ/internal/xenos/plasmavessel/drone
|
||||
name = "large plasma vessel"
|
||||
icon_state = "plasma_large"
|
||||
stored_plasma = 200
|
||||
max_plasma = 500
|
||||
|
||||
/obj/item/organ/internal/xenos/plasmavessel/sentinel
|
||||
stored_plasma = 100
|
||||
max_plasma = 250
|
||||
|
||||
/obj/item/organ/internal/xenos/plasmavessel/hunter
|
||||
name = "small plasma vessel"
|
||||
icon_state = "plasma_tiny"
|
||||
stored_plasma = 100
|
||||
max_plasma = 150
|
||||
alien_powers = list(/mob/living/carbon/alien/humanoid/verb/plant)
|
||||
|
||||
/obj/item/organ/internal/xenos/plasmavessel/larva
|
||||
name = "tiny plasma vessel"
|
||||
icon_state = "plasma_tiny"
|
||||
max_plasma = 100
|
||||
|
||||
|
||||
/obj/item/organ/internal/xenos/plasmavessel/on_life()
|
||||
//If there are alien weeds on the ground then heal if needed or give some plasma
|
||||
if(locate(/obj/structure/alien/weeds) in owner.loc)
|
||||
if(owner.health >= owner.maxHealth)
|
||||
owner.adjustPlasma(plasma_rate)
|
||||
else
|
||||
var/heal_amt = heal_rate
|
||||
if(!isalien(owner))
|
||||
heal_amt *= 0.2
|
||||
owner.adjustPlasma(plasma_rate*0.5)
|
||||
owner.adjustBruteLoss(-heal_amt)
|
||||
owner.adjustFireLoss(-heal_amt)
|
||||
owner.adjustOxyLoss(-heal_amt)
|
||||
owner.adjustCloneLoss(-heal_amt)
|
||||
|
||||
/obj/item/organ/internal/xenos/plasmavessel/Insert(mob/living/carbon/M, special = 0)
|
||||
..()
|
||||
if(isalien(M))
|
||||
var/mob/living/carbon/alien/A = M
|
||||
A.updatePlasmaDisplay()
|
||||
|
||||
/obj/item/organ/internal/alien/plasmavessel/Remove(mob/living/carbon/M, special = 0)
|
||||
..()
|
||||
if(isalien(M))
|
||||
var/mob/living/carbon/alien/A = M
|
||||
A.updatePlasmaDisplay()
|
||||
|
||||
|
||||
/obj/item/organ/internal/xenos/acidgland
|
||||
name = "acid gland"
|
||||
parent_organ = "head"
|
||||
slot = "acidgland"
|
||||
origin_tech = "biotech=5;materials=2;combat=2"
|
||||
alien_powers = list(/mob/living/carbon/alien/humanoid/proc/corrosive_acid)
|
||||
|
||||
|
||||
/obj/item/organ/internal/xenos/hivenode
|
||||
name = "hive node"
|
||||
parent_organ = "head"
|
||||
slot = "hivenode"
|
||||
origin_tech = "biotech=5;magnets=4;bluespace=3"
|
||||
w_class = 1
|
||||
alien_powers = list(/mob/living/carbon/alien/humanoid/verb/whisp)
|
||||
|
||||
/obj/item/organ/internal/xenos/hivenode/Insert(mob/living/carbon/M, special = 0)
|
||||
..()
|
||||
M.faction |= "alien"
|
||||
|
||||
/obj/item/organ/internal/xenos/hivenode/Remove(mob/living/carbon/M, special = 0)
|
||||
M.faction -= "alien"
|
||||
..()
|
||||
|
||||
/obj/item/organ/internal/xenos/neurotoxin
|
||||
name = "neurotoxin gland"
|
||||
icon_state = "neurotox"
|
||||
parent_organ = "head"
|
||||
slot = "neurotoxingland"
|
||||
origin_tech = "biotech=5;combat=5"
|
||||
alien_powers = list(/mob/living/carbon/alien/humanoid/proc/neurotoxin)
|
||||
|
||||
/obj/item/organ/internal/xenos/resinspinner
|
||||
name = "resin spinner"
|
||||
parent_organ = "head"
|
||||
icon_state = "stomach-x"
|
||||
slot = "resinspinner"
|
||||
origin_tech = "biotech=5;materials=4"
|
||||
alien_powers = list(/mob/living/carbon/alien/humanoid/proc/resin)
|
||||
|
||||
/obj/item/organ/internal/xenos/eggsac
|
||||
name = "egg sac"
|
||||
icon_state = "eggsac"
|
||||
parent_organ = "groin"
|
||||
slot = "eggsac"
|
||||
w_class = 4
|
||||
origin_tech = "biotech=8"
|
||||
alien_powers = list(/mob/living/carbon/alien/humanoid/queen/verb/lay_egg)
|
||||
@@ -0,0 +1,344 @@
|
||||
|
||||
/****************************************************
|
||||
WOUNDS
|
||||
****************************************************/
|
||||
/datum/wound
|
||||
// number representing the current stage
|
||||
var/current_stage = 0
|
||||
|
||||
// description of the wound
|
||||
var/desc = "wound" //default in case something borks
|
||||
|
||||
// amount of damage this wound causes
|
||||
var/damage = 0
|
||||
// ticks of bleeding left.
|
||||
var/bleed_timer = 0
|
||||
// amount of damage the current wound type requires(less means we need to apply the next healing stage)
|
||||
var/min_damage = 0
|
||||
|
||||
// is the wound bandaged?
|
||||
var/bandaged = 0
|
||||
// Similar to bandaged, but works differently
|
||||
var/clamped = 0
|
||||
// is the wound salved?
|
||||
var/salved = 0
|
||||
// is the wound disinfected?
|
||||
var/disinfected = 0
|
||||
var/created = 0
|
||||
// number of wounds of this type
|
||||
var/amount = 1
|
||||
// amount of germs in the wound
|
||||
var/germ_level = 0
|
||||
|
||||
/* These are defined by the wound type and should not be changed */
|
||||
|
||||
// stages such as "cut", "deep cut", etc.
|
||||
var/list/stages
|
||||
// internal wounds can only be fixed through surgery
|
||||
var/internal = 0
|
||||
// maximum stage at which bleeding should still happen. Beyond this stage bleeding is prevented.
|
||||
var/max_bleeding_stage = 0
|
||||
// one of CUT, BRUISE, BURN
|
||||
var/damage_type = CUT
|
||||
// whether this wound needs a bandage/salve to heal at all
|
||||
// the maximum amount of damage that this wound can have and still autoheal
|
||||
var/autoheal_cutoff = 15
|
||||
|
||||
|
||||
|
||||
|
||||
// helper lists
|
||||
var/tmp/list/desc_list = list()
|
||||
var/tmp/list/damage_list = list()
|
||||
|
||||
New(var/damage)
|
||||
|
||||
created = world.time
|
||||
|
||||
// reading from a list("stage" = damage) is pretty difficult, so build two separate
|
||||
// lists from them instead
|
||||
for(var/V in stages)
|
||||
desc_list += V
|
||||
damage_list += stages[V]
|
||||
|
||||
src.damage = damage
|
||||
|
||||
// initialize with the appropriate stage
|
||||
src.init_stage(damage)
|
||||
|
||||
bleed_timer += damage
|
||||
|
||||
// returns 1 if there's a next stage, 0 otherwise
|
||||
proc/init_stage(var/initial_damage)
|
||||
current_stage = stages.len
|
||||
|
||||
while(src.current_stage > 1 && src.damage_list[current_stage-1] <= initial_damage / src.amount)
|
||||
src.current_stage--
|
||||
|
||||
src.min_damage = damage_list[current_stage]
|
||||
src.desc = desc_list[current_stage]
|
||||
|
||||
// the amount of damage per wound
|
||||
proc/wound_damage()
|
||||
return src.damage / src.amount
|
||||
|
||||
proc/can_autoheal()
|
||||
if(src.wound_damage() <= autoheal_cutoff)
|
||||
return 1
|
||||
|
||||
return is_treated()
|
||||
|
||||
// checks whether the wound has been appropriately treated
|
||||
proc/is_treated()
|
||||
if(damage_type == BRUISE || damage_type == CUT)
|
||||
return bandaged
|
||||
else if(damage_type == BURN)
|
||||
return salved
|
||||
|
||||
// Checks whether other other can be merged into src.
|
||||
proc/can_merge(var/datum/wound/other)
|
||||
if (other.type != src.type) return 0
|
||||
if (other.current_stage != src.current_stage) return 0
|
||||
if (other.damage_type != src.damage_type) return 0
|
||||
if (!(other.can_autoheal()) != !(src.can_autoheal())) return 0
|
||||
if (!(other.bandaged) != !(src.bandaged)) return 0
|
||||
if (!(other.clamped) != !(src.clamped)) return 0
|
||||
if (!(other.salved) != !(src.salved)) return 0
|
||||
if (!(other.disinfected) != !(src.disinfected)) return 0
|
||||
//if (other.germ_level != src.germ_level) return 0
|
||||
return 1
|
||||
|
||||
proc/merge_wound(var/datum/wound/other)
|
||||
src.damage += other.damage
|
||||
src.amount += other.amount
|
||||
src.bleed_timer += other.bleed_timer
|
||||
src.germ_level = max(src.germ_level, other.germ_level)
|
||||
src.created = max(src.created, other.created) //take the newer created time
|
||||
|
||||
// checks if wound is considered open for external infections
|
||||
// untreated cuts (and bleeding bruises) and burns are possibly infectable, chance higher if wound is bigger
|
||||
proc/infection_check()
|
||||
if (damage < 10) //small cuts, tiny bruises, and moderate burns shouldn't be infectable.
|
||||
return 0
|
||||
if (is_treated() && damage < 25) //anything less than a flesh wound (or equivalent) isn't infectable if treated properly
|
||||
return 0
|
||||
if (disinfected)
|
||||
germ_level = 0 //reset this, just in case
|
||||
return 0
|
||||
|
||||
if (damage_type == BRUISE && !bleeding()) //bruises only infectable if bleeding
|
||||
return 0
|
||||
|
||||
var/dam_coef = round(damage/10)
|
||||
switch (damage_type)
|
||||
if (BRUISE)
|
||||
return prob(dam_coef*5)
|
||||
if (BURN)
|
||||
return prob(dam_coef*10)
|
||||
if (CUT)
|
||||
return prob(dam_coef*20)
|
||||
|
||||
return 0
|
||||
|
||||
// heal the given amount of damage, and if the given amount of damage was more
|
||||
// than what needed to be healed, return how much heal was left
|
||||
// set @heals_internal to also heal internal organ damage
|
||||
proc/heal_damage(amount, heals_internal = 0)
|
||||
if(src.internal && !heals_internal)
|
||||
// heal nothing
|
||||
return amount
|
||||
|
||||
var/healed_damage = min(src.damage, amount)
|
||||
amount -= healed_damage
|
||||
src.damage -= healed_damage
|
||||
|
||||
while(src.wound_damage() < damage_list[current_stage] && current_stage < src.desc_list.len)
|
||||
current_stage++
|
||||
desc = desc_list[current_stage]
|
||||
src.min_damage = damage_list[current_stage]
|
||||
|
||||
// return amount of healing still leftover, can be used for other wounds
|
||||
return amount
|
||||
|
||||
// opens the wound again
|
||||
proc/open_wound(damage)
|
||||
src.damage += damage
|
||||
bleed_timer += damage
|
||||
|
||||
while(src.current_stage > 1 && src.damage_list[current_stage-1] <= src.damage / src.amount)
|
||||
src.current_stage--
|
||||
|
||||
src.desc = desc_list[current_stage]
|
||||
src.min_damage = damage_list[current_stage]
|
||||
|
||||
// returns whether this wound can absorb the given amount of damage.
|
||||
// this will prevent large amounts of damage being trapped in less severe wound types
|
||||
proc/can_worsen(damage_type, damage)
|
||||
if (src.damage_type != damage_type)
|
||||
return 0 //incompatible damage types
|
||||
|
||||
if (src.amount > 1)
|
||||
return 0
|
||||
|
||||
//with 1.5*, a shallow cut will be able to carry at most 30 damage,
|
||||
//37.5 for a deep cut
|
||||
//52.5 for a flesh wound, etc.
|
||||
var/max_wound_damage = 1.5*src.damage_list[1]
|
||||
if (src.damage + damage > max_wound_damage)
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
proc/bleeding()
|
||||
if (src.internal)
|
||||
return 0 // internal wounds don't bleed in the sense of this function
|
||||
|
||||
if (current_stage > max_bleeding_stage)
|
||||
return 0
|
||||
|
||||
if (bandaged||clamped)
|
||||
return 0
|
||||
|
||||
if (wound_damage() <= 30 && bleed_timer <= 0)
|
||||
return 0 //Bleed timer has run out. Wounds with more than 30 damage don't stop bleeding on their own.
|
||||
|
||||
return (damage_type == BRUISE && wound_damage() >= 20 || damage_type == CUT && wound_damage() >= 5)
|
||||
|
||||
/** WOUND DEFINITIONS **/
|
||||
|
||||
//Note that the MINIMUM damage before a wound can be applied should correspond to
|
||||
//the damage amount for the stage with the same name as the wound.
|
||||
//e.g. /datum/wound/cut/deep should only be applied for 15 damage and up,
|
||||
//because in it's stages list, "deep cut" = 15.
|
||||
/proc/get_wound_type(var/type = CUT, var/damage)
|
||||
switch(type)
|
||||
if(CUT)
|
||||
switch(damage)
|
||||
if(70 to INFINITY)
|
||||
return /datum/wound/cut/massive
|
||||
if(60 to 70)
|
||||
return /datum/wound/cut/gaping_big
|
||||
if(50 to 60)
|
||||
return /datum/wound/cut/gaping
|
||||
if(25 to 50)
|
||||
return /datum/wound/cut/flesh
|
||||
if(15 to 25)
|
||||
return /datum/wound/cut/deep
|
||||
if(0 to 15)
|
||||
return /datum/wound/cut/small
|
||||
if(BRUISE)
|
||||
return /datum/wound/bruise
|
||||
if(BURN)
|
||||
switch(damage)
|
||||
if(50 to INFINITY)
|
||||
return /datum/wound/burn/carbonised
|
||||
if(40 to 50)
|
||||
return /datum/wound/burn/deep
|
||||
if(30 to 40)
|
||||
return /datum/wound/burn/severe
|
||||
if(15 to 30)
|
||||
return /datum/wound/burn/large
|
||||
if(0 to 15)
|
||||
return /datum/wound/burn/moderate
|
||||
return null //no wound
|
||||
|
||||
/** CUTS **/
|
||||
/datum/wound/cut/small
|
||||
// Minor cuts have max_bleeding_stage set to the stage that bears the wound type's name.
|
||||
// The major cut types have the max_bleeding_stage set to the clot stage (which is accordingly given the "blood soaked" descriptor).
|
||||
max_bleeding_stage = 3
|
||||
stages = list("ugly ripped cut" = 20, "ripped cut" = 10, "cut" = 5, "healing cut" = 2, "small scab" = 0)
|
||||
damage_type = CUT
|
||||
|
||||
/datum/wound/cut/deep
|
||||
max_bleeding_stage = 3
|
||||
stages = list("ugly deep ripped cut" = 25, "deep ripped cut" = 20, "deep cut" = 15, "clotted cut" = 8, "scab" = 2, "fresh skin" = 0)
|
||||
damage_type = CUT
|
||||
|
||||
/datum/wound/cut/flesh
|
||||
max_bleeding_stage = 4
|
||||
stages = list("ugly ripped flesh wound" = 35, "ugly flesh wound" = 30, "flesh wound" = 25, "blood soaked clot" = 15, "large scab" = 5, "fresh skin" = 0)
|
||||
damage_type = CUT
|
||||
|
||||
/datum/wound/cut/gaping
|
||||
max_bleeding_stage = 3
|
||||
stages = list("gaping wound" = 50, "large blood soaked clot" = 25, "blood soaked clot" = 15, "small angry scar" = 5, "small straight scar" = 0)
|
||||
damage_type = CUT
|
||||
|
||||
/datum/wound/cut/gaping_big
|
||||
max_bleeding_stage = 3
|
||||
stages = list("big gaping wound" = 60, "healing gaping wound" = 40, "large blood soaked clot" = 25, "large angry scar" = 10, "large straight scar" = 0)
|
||||
damage_type = CUT
|
||||
|
||||
datum/wound/cut/massive
|
||||
max_bleeding_stage = 3
|
||||
stages = list("massive wound" = 70, "massive healing wound" = 50, "massive blood soaked clot" = 25, "massive angry scar" = 10, "massive jagged scar" = 0)
|
||||
damage_type = CUT
|
||||
|
||||
/** BRUISES **/
|
||||
/datum/wound/bruise
|
||||
stages = list("monumental bruise" = 80, "huge bruise" = 50, "large bruise" = 30,
|
||||
"moderate bruise" = 20, "small bruise" = 10, "tiny bruise" = 5)
|
||||
max_bleeding_stage = 3 //only large bruise and above can bleed.
|
||||
autoheal_cutoff = 30
|
||||
damage_type = BRUISE
|
||||
|
||||
/** BURNS **/
|
||||
/datum/wound/burn/moderate
|
||||
stages = list("ripped burn" = 10, "moderate burn" = 5, "healing moderate burn" = 2, "fresh skin" = 0)
|
||||
damage_type = BURN
|
||||
|
||||
/datum/wound/burn/large
|
||||
stages = list("ripped large burn" = 20, "large burn" = 15, "healing large burn" = 5, "fresh skin" = 0)
|
||||
damage_type = BURN
|
||||
|
||||
/datum/wound/burn/severe
|
||||
stages = list("ripped severe burn" = 35, "severe burn" = 30, "healing severe burn" = 10, "burn scar" = 0)
|
||||
damage_type = BURN
|
||||
|
||||
/datum/wound/burn/deep
|
||||
stages = list("ripped deep burn" = 45, "deep burn" = 40, "healing deep burn" = 15, "large burn scar" = 0)
|
||||
damage_type = BURN
|
||||
|
||||
/datum/wound/burn/carbonised
|
||||
stages = list("carbonised area" = 50, "healing carbonised area" = 20, "massive burn scar" = 0)
|
||||
damage_type = BURN
|
||||
|
||||
/** INTERNAL BLEEDING **/
|
||||
/datum/wound/internal_bleeding
|
||||
internal = 1
|
||||
stages = list("severed artery" = 30, "cut artery" = 20, "damaged artery" = 10, "bruised artery" = 5)
|
||||
autoheal_cutoff = 5
|
||||
max_bleeding_stage = 4 //all stages bleed. It's called internal bleeding after all.
|
||||
|
||||
|
||||
/** EXTERNAL ORGAN LOSS **/
|
||||
/datum/wound/lost_limb
|
||||
|
||||
/datum/wound/lost_limb/New(var/obj/item/organ/external/lost_limb, var/losstype, var/clean)
|
||||
var/damage_amt = lost_limb.max_damage
|
||||
if(clean) damage_amt /= 2
|
||||
|
||||
switch(losstype)
|
||||
if(DROPLIMB_EDGE, DROPLIMB_BLUNT)
|
||||
damage_type = CUT
|
||||
max_bleeding_stage = 3 //clotted stump and above can bleed.
|
||||
stages = list(
|
||||
"ripped stump" = damage_amt*1.3,
|
||||
"bloody stump" = damage_amt,
|
||||
"clotted stump" = damage_amt*0.5,
|
||||
"scarred stump" = 0
|
||||
)
|
||||
if(DROPLIMB_BURN)
|
||||
damage_type = BURN
|
||||
stages = list(
|
||||
"ripped charred stump" = damage_amt*1.3,
|
||||
"charred stump" = damage_amt,
|
||||
"scarred stump" = damage_amt*0.5,
|
||||
"scarred stump" = 0
|
||||
)
|
||||
|
||||
..(damage_amt)
|
||||
|
||||
/datum/wound/lost_limb/can_merge(var/datum/wound/other)
|
||||
return 0 //cannot be merged
|
||||
@@ -45,6 +45,7 @@
|
||||
user.visible_message("<span class='notice'>[user] carefully extracts the tumor from [target]'s brain!</span>", \
|
||||
"<span class='notice'>You extract the black tumor from [target]'s [braincase]. It quickly shrivels and burns away.</span>")
|
||||
ticker.mode.remove_thrall(target.mind,0)
|
||||
new /obj/item/organ/internal/shadowtumor(get_turf(target))
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/braincase = target.named_organ_parent("brain")
|
||||
@@ -72,9 +73,10 @@
|
||||
|
||||
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/embryo = 0
|
||||
for(var/obj/item/alien_embryo/A in target)
|
||||
var/obj/item/organ/internal/body_egg/alien_embryo/A = target.get_int_organ(/obj/item/organ/internal/body_egg/alien_embryo)
|
||||
if(A)
|
||||
embryo = 1
|
||||
break
|
||||
//break
|
||||
|
||||
if (!hasorgans(target))
|
||||
return
|
||||
@@ -92,8 +94,32 @@
|
||||
user.visible_message("\red [user] rips the larva out of [target]'s ribcage!",
|
||||
"You rip the larva out of [target]'s ribcage!")
|
||||
|
||||
for(var/obj/item/alien_embryo/A in target)
|
||||
A.loc = A.loc.loc
|
||||
var/obj/item/organ/internal/body_egg/alien_embryo/A = target.get_int_organ(/obj/item/organ/internal/body_egg/alien_embryo)
|
||||
if(A)
|
||||
user << "<span class='notice'>You found an unknown alien organism in [target]'s chest!</span>"
|
||||
if(A.stage < 4)
|
||||
user << "It's small and weak, barely the size of a foetus."
|
||||
else
|
||||
user << "It's grown quite large, and writhes slightly as you look at it."
|
||||
if(prob(10))
|
||||
A.AttemptGrow()
|
||||
|
||||
A.Remove(target)
|
||||
A.loc = get_turf(target)
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
|
||||
if (!hasorgans(target))
|
||||
return
|
||||
|
||||
var/obj/item/organ/internal/body_egg/alien_embryo/A = target.get_int_organ(/obj/item/organ/internal/body_egg/alien_embryo)
|
||||
if(A)
|
||||
if(prob(50))
|
||||
A.AttemptGrow(0)
|
||||
user.visible_message("<span class='warning'>[user] accidentally pokes the xenomorph in [target]!</span>", "<span class='warning'>You accidentally poke the xenomorph in [target]!</span>")
|
||||
else
|
||||
target.adjustOxyLoss(30)
|
||||
user.visible_message("<span class='warning'>[user] accidentally pokes [target] in the lungs!</span>", "<span class='warning'>You accidentally poke [target] in the lungs!</span>")
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
@@ -116,7 +142,7 @@
|
||||
if(!affected)
|
||||
return
|
||||
var/is_organ_damaged = 0
|
||||
for(var/obj/item/organ/I in affected.internal_organs)
|
||||
for(var/obj/item/organ/internal/I in affected.internal_organs)
|
||||
if(I.damage > 0 && I.robotic < 2)
|
||||
is_organ_damaged = 1
|
||||
break
|
||||
@@ -133,7 +159,7 @@
|
||||
return
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
|
||||
for(var/obj/item/organ/I in affected.internal_organs)
|
||||
for(var/obj/item/organ/internal/I in affected.internal_organs)
|
||||
if(I && I.damage > 0)
|
||||
if(I.robotic < 2)
|
||||
user.visible_message("[user] starts treating damage to [target]'s [I.name] with [tool_name].", \
|
||||
@@ -153,7 +179,7 @@
|
||||
return
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
|
||||
for(var/obj/item/organ/I in affected.internal_organs)
|
||||
for(var/obj/item/organ/internal/I in affected.internal_organs)
|
||||
if(I)
|
||||
I.surgeryize()
|
||||
if(I && I.damage > 0)
|
||||
@@ -180,7 +206,7 @@
|
||||
target.adjustToxLoss(10)
|
||||
affected.createwound(CUT, 5)
|
||||
|
||||
for(var/obj/item/organ/I in affected.internal_organs)
|
||||
for(var/obj/item/organ/internal/I in affected.internal_organs)
|
||||
if(I && I.damage > 0)
|
||||
I.take_damage(dam_amt,0)
|
||||
|
||||
@@ -209,7 +235,7 @@
|
||||
|
||||
var/list/attached_organs = list()
|
||||
for(var/organ in target.internal_organs_by_name)
|
||||
var/obj/item/organ/I = target.internal_organs_by_name[organ]
|
||||
var/obj/item/organ/internal/I = target.internal_organs_by_name[organ]
|
||||
if(I && !(I.status & ORGAN_CUT_AWAY) && I.parent_organ == target_zone)
|
||||
attached_organs |= organ
|
||||
|
||||
@@ -234,7 +260,7 @@
|
||||
user.visible_message("\blue [user] has separated [target]'s [target.op_stage.current_organ] with \the [tool]." , \
|
||||
"\blue You have separated [target]'s [target.op_stage.current_organ] with \the [tool].")
|
||||
|
||||
var/obj/item/organ/I = target.internal_organs_by_name[target.op_stage.current_organ]
|
||||
var/obj/item/organ/internal/I = target.internal_organs_by_name[target.op_stage.current_organ]
|
||||
if(I && istype(I))
|
||||
I.status |= ORGAN_CUT_AWAY
|
||||
|
||||
@@ -264,7 +290,7 @@
|
||||
|
||||
var/list/removable_organs = list()
|
||||
for(var/organ in target.internal_organs_by_name)
|
||||
var/obj/item/organ/I = target.internal_organs_by_name[organ]
|
||||
var/obj/item/organ/internal/I = target.internal_organs_by_name[organ]
|
||||
if((I.status & ORGAN_CUT_AWAY) && I.parent_organ == target_zone)
|
||||
removable_organs |= organ
|
||||
|
||||
@@ -287,9 +313,10 @@
|
||||
|
||||
// Extract the organ!
|
||||
if(target.op_stage.current_organ)
|
||||
var/obj/item/organ/O = target.internal_organs_by_name[target.op_stage.current_organ]
|
||||
var/obj/item/organ/internal/O = target.internal_organs_by_name[target.op_stage.current_organ]
|
||||
if(O && istype(O))
|
||||
O.removed(user)
|
||||
O.Remove(user)
|
||||
O.loc = get_turf(target)
|
||||
target.op_stage.current_organ = null
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
@@ -300,7 +327,7 @@
|
||||
|
||||
/datum/surgery_step/internal/replace_organ
|
||||
allowed_tools = list(
|
||||
/obj/item/organ = 100
|
||||
/obj/item/organ/internal = 100
|
||||
)
|
||||
|
||||
min_duration = 60
|
||||
@@ -308,7 +335,7 @@
|
||||
|
||||
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
|
||||
var/obj/item/organ/O = tool
|
||||
var/obj/item/organ/internal/O = tool
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if(!affected) return
|
||||
var/organ_compatible
|
||||
@@ -366,14 +393,14 @@
|
||||
user.visible_message("\blue [user] has transplanted \the [tool] into [target]'s [affected.name].", \
|
||||
"\blue You have transplanted \the [tool] into [target]'s [affected.name].")
|
||||
user.drop_item(tool)
|
||||
var/obj/item/organ/O = tool
|
||||
var/obj/item/organ/internal/O = tool
|
||||
if(istype(O))
|
||||
O.replaced(target,affected)
|
||||
O.Insert(target)
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("\red [user]'s hand slips, damaging \the [tool]!", \
|
||||
"\red Your hand slips, damaging \the [tool]!")
|
||||
var/obj/item/organ/I = tool
|
||||
var/obj/item/organ/internal/I = tool
|
||||
if(istype(I))
|
||||
I.take_damage(rand(3,5),0)
|
||||
|
||||
@@ -395,7 +422,7 @@
|
||||
|
||||
var/list/removable_organs = list()
|
||||
for(var/organ in target.internal_organs_by_name)
|
||||
var/obj/item/organ/I = target.internal_organs_by_name[organ]
|
||||
var/obj/item/organ/internal/I = target.internal_organs_by_name[organ]
|
||||
if(I && (I.status & ORGAN_CUT_AWAY) && !(I.status & ORGAN_ROBOT) && I.parent_organ == target_zone)
|
||||
removable_organs |= organ
|
||||
|
||||
@@ -416,7 +443,7 @@
|
||||
user.visible_message("\blue [user] has reattached [target]'s [target.op_stage.current_organ] with \the [tool]." , \
|
||||
"\blue You have reattached [target]'s [target.op_stage.current_organ] with \the [tool].")
|
||||
|
||||
var/obj/item/organ/I = target.internal_organs_by_name[target.op_stage.current_organ]
|
||||
var/obj/item/organ/internal/I = target.internal_organs_by_name[target.op_stage.current_organ]
|
||||
if(I && istype(I))
|
||||
I.status &= ~ORGAN_CUT_AWAY
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if(!affected) return
|
||||
var/is_organ_damaged = 0
|
||||
for(var/obj/item/organ/I in affected.internal_organs)
|
||||
for(var/obj/item/organ/internal/I in affected.internal_organs)
|
||||
if(I.damage > 0 && I.robotic >= 2)
|
||||
is_organ_damaged = 1
|
||||
break
|
||||
@@ -232,7 +232,7 @@
|
||||
return
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
|
||||
for(var/obj/item/organ/I in affected.internal_organs)
|
||||
for(var/obj/item/organ/internal/I in affected.internal_organs)
|
||||
if(I && I.damage > 0)
|
||||
if(I.robotic >= 2)
|
||||
user.visible_message("[user] starts mending the damage to [target]'s [I.name]'s mechanisms.", \
|
||||
@@ -247,7 +247,7 @@
|
||||
return
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
|
||||
for(var/obj/item/organ/I in affected.internal_organs)
|
||||
for(var/obj/item/organ/internal/I in affected.internal_organs)
|
||||
|
||||
if(I && I.damage > 0)
|
||||
if(I.robotic >= 2)
|
||||
@@ -267,7 +267,7 @@
|
||||
target.adjustToxLoss(5)
|
||||
affected.createwound(CUT, 5)
|
||||
|
||||
for(var/obj/item/organ/I in affected.internal_organs)
|
||||
for(var/obj/item/organ/internal/I in affected.internal_organs)
|
||||
if(I)
|
||||
I.take_damage(rand(3,5),0)
|
||||
|
||||
@@ -292,7 +292,7 @@
|
||||
|
||||
var/list/attached_organs = list()
|
||||
for(var/organ in target.internal_organs_by_name)
|
||||
var/obj/item/organ/I = target.internal_organs_by_name[organ]
|
||||
var/obj/item/organ/internal/I = target.internal_organs_by_name[organ]
|
||||
if(I && !(I.status & ORGAN_CUT_AWAY) && I.parent_organ == target_zone)
|
||||
attached_organs |= organ
|
||||
|
||||
@@ -313,7 +313,7 @@
|
||||
user.visible_message("\blue [user] has decoupled [target]'s [target.op_stage.current_organ] with \the [tool]." , \
|
||||
"\blue You have decoupled [target]'s [target.op_stage.current_organ] with \the [tool].")
|
||||
|
||||
var/obj/item/organ/I = target.internal_organs_by_name[target.op_stage.current_organ]
|
||||
var/obj/item/organ/internal/I = target.internal_organs_by_name[target.op_stage.current_organ]
|
||||
if(I && istype(I))
|
||||
I.status |= ORGAN_CUT_AWAY
|
||||
|
||||
@@ -341,7 +341,7 @@
|
||||
|
||||
var/list/removable_organs = list()
|
||||
for(var/organ in target.internal_organs_by_name)
|
||||
var/obj/item/organ/I = target.internal_organs_by_name[organ]
|
||||
var/obj/item/organ/internal/I = target.internal_organs_by_name[organ]
|
||||
if(I && (I.status & ORGAN_CUT_AWAY) && (I.status & ORGAN_ROBOT) && I.parent_organ == target_zone)
|
||||
removable_organs |= organ
|
||||
|
||||
@@ -361,7 +361,7 @@
|
||||
user.visible_message("\blue [user] has reattached [target]'s [target.op_stage.current_organ] with \the [tool]." , \
|
||||
"\blue You have reattached [target]'s [target.op_stage.current_organ] with \the [tool].")
|
||||
|
||||
var/obj/item/organ/I = target.internal_organs_by_name[target.op_stage.current_organ]
|
||||
var/obj/item/organ/internal/I = target.internal_organs_by_name[target.op_stage.current_organ]
|
||||
if(I && istype(I))
|
||||
I.status &= ~ORGAN_CUT_AWAY
|
||||
|
||||
@@ -424,7 +424,7 @@
|
||||
"\blue You have installed \the [tool] into [target]'s [affected.name].")
|
||||
|
||||
var/obj/item/device/mmi/M = tool
|
||||
var/obj/item/organ/mmi_holder/holder = new(target, 1)
|
||||
var/obj/item/organ/internal/mmi_holder/holder = new(target, 1)
|
||||
if (istype(M, /obj/item/device/mmi/posibrain))
|
||||
holder.robotize()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user