mirror of
https://github.com/Aurorastation/Aurora-Old.git
synced 2026-08-29 15:46:26 +01:00
Organ code
Updates organ code to match new Baystation.
This commit is contained in:
@@ -330,12 +330,8 @@ proc/blood_splatter(var/target,var/datum/reagent/blood/source,var/large)
|
||||
else
|
||||
B.blood_DNA[source.data["blood_DNA"]] = "O+"
|
||||
|
||||
// Update virus information. //Looks like this is out of date.
|
||||
//for(var/datum/disease/D in source.data["viruses"])
|
||||
// var/datum/disease/new_virus = D.Copy(1)
|
||||
// source.viruses += new_virus
|
||||
// new_virus.holder = B
|
||||
// Update virus information.
|
||||
if(source.data["virus2"])
|
||||
B.virus2 = virus_copylist(source.data["virus2"])
|
||||
|
||||
return B
|
||||
return B
|
||||
|
||||
@@ -58,8 +58,8 @@
|
||||
|
||||
// Takes care of organ related updates, such as broken and missing limbs
|
||||
/mob/living/carbon/human/proc/handle_organs()
|
||||
|
||||
number_wounds = 0
|
||||
var/leg_tally = 2
|
||||
var/force_process = 0
|
||||
var/damage_this_tick = getBruteLoss() + getFireLoss() + getToxLoss()
|
||||
if(damage_this_tick > last_dam)
|
||||
@@ -74,6 +74,9 @@
|
||||
for(var/datum/organ/internal/I in internal_organs)
|
||||
I.process()
|
||||
|
||||
//losing a limb stops it from processing, so this has to be done separately
|
||||
handle_stance()
|
||||
|
||||
if(!force_process && !bad_external_organs.len)
|
||||
return
|
||||
|
||||
@@ -100,23 +103,37 @@
|
||||
if (W.infection_check())
|
||||
W.germ_level += 1
|
||||
|
||||
if(E.name in list("l_leg","l_foot","r_leg","r_foot") && !lying)
|
||||
if (!E.is_usable() || E.is_malfunctioning() || (E.is_broken() && !(E.status & ORGAN_SPLINTED)))
|
||||
leg_tally-- // let it fail even if just foot&leg
|
||||
/mob/living/carbon/human/proc/handle_stance()
|
||||
// Don't need to process any of this if they aren't standing anyways
|
||||
// unless their stance is damaged, and we want to check if they should stay down
|
||||
if (!stance_damage && (lying || resting) && (life_tick % 4) == 0)
|
||||
return
|
||||
|
||||
stance_damage = 0
|
||||
|
||||
// Buckled to a bed/chair. Stance damage is forced to 0 since they're sitting on something solid
|
||||
if (istype(buckled, /obj/structure/stool/bed))
|
||||
return
|
||||
|
||||
for (var/organ in list("l_leg","l_foot","r_leg","r_foot"))
|
||||
var/datum/organ/external/E = organs_by_name[organ]
|
||||
if (E.status & ORGAN_DESTROYED)
|
||||
stance_damage += 2 // let it fail even if just foot&leg
|
||||
else if (E.is_malfunctioning() || (E.is_broken() && !(E.status & ORGAN_SPLINTED)) || !E.is_usable())
|
||||
stance_damage += 1
|
||||
|
||||
// Canes and crutches help you stand (if the latter is ever added)
|
||||
// One cane mitigates a broken leg+foot, or a missing foot.
|
||||
// Two canes are needed for a lost leg. If you are missing both legs, canes aren't gonna help you.
|
||||
if (istype(l_hand, /obj/item/weapon/cane))
|
||||
stance_damage -= 2
|
||||
if (istype(l_hand, /obj/item/weapon/cane))
|
||||
stance_damage -= 2
|
||||
|
||||
// standing is poor
|
||||
if(leg_tally <= 0 && !paralysis && !(lying || resting) && prob(5))
|
||||
if(species && species.flags & NO_PAIN)
|
||||
emote("scream")
|
||||
emote("collapse")
|
||||
paralysis = 10
|
||||
|
||||
//Check arms and legs for existence
|
||||
can_stand = 2 //can stand on both legs
|
||||
var/datum/organ/external/E = organs_by_name["l_foot"]
|
||||
if(E.status & ORGAN_DESTROYED)
|
||||
can_stand--
|
||||
|
||||
E = organs_by_name["r_foot"]
|
||||
if(E.status & ORGAN_DESTROYED)
|
||||
can_stand--
|
||||
if(stance_damage >= 4 || (stance_damage >= 2 && prob(5)))
|
||||
if(!(lying || resting))
|
||||
if(species && !(species.flags & NO_PAIN))
|
||||
emote("scream")
|
||||
custom_emote(1, "collapses!")
|
||||
Weaken(5) //can't emote while weakened, apparently.
|
||||
@@ -39,6 +39,7 @@
|
||||
|
||||
/obj/item/organ/diona/removed(var/mob/living/target,var/mob/living/user)
|
||||
|
||||
..()
|
||||
var/mob/living/carbon/human/H = target
|
||||
if(!istype(target))
|
||||
del(src)
|
||||
@@ -51,10 +52,10 @@
|
||||
if(!diona)
|
||||
del(src)
|
||||
|
||||
var/mob/living/carbon/alien/diona/D = new(get_turf(src))
|
||||
diona.request_player(D)
|
||||
|
||||
del(src)
|
||||
spawn(1) // So it has time to be thrown about by the gib() proc.
|
||||
var/mob/living/carbon/alien/diona/D = new(get_turf(src))
|
||||
diona.request_player(D)
|
||||
del(src)
|
||||
|
||||
// These are different to the standard diona organs as they have a purpose in other
|
||||
// species (absorbing radiation and light respectively)
|
||||
|
||||
@@ -32,8 +32,6 @@
|
||||
var/damage_msg = "\red You feel an intense pain"
|
||||
var/broken_description
|
||||
|
||||
// var/vital //Lose a vital limb, die immediately.
|
||||
// var/status = 0
|
||||
var/open = 0
|
||||
var/stage = 0
|
||||
var/cavity = 0
|
||||
@@ -100,7 +98,8 @@
|
||||
brute -= brute / 2
|
||||
|
||||
if(status & ORGAN_BROKEN && prob(40) && brute)
|
||||
owner.emote("scream") //getting hit on broken hand hurts
|
||||
if (!(owner.species && (owner.species.flags & NO_PAIN)))
|
||||
owner.emote("scream") //getting hit on broken hand hurts
|
||||
if(used_weapon)
|
||||
add_autopsy_data("[used_weapon]", brute + burn)
|
||||
|
||||
@@ -138,9 +137,9 @@
|
||||
burn = max(0, burn - can_inflict)
|
||||
//If there are still hurties to dispense
|
||||
if (burn || brute)
|
||||
// if (status & ORGAN_ROBOT)
|
||||
// droplimb(1) //Robot limbs just kinda fail at full damage. //this is breaking things okay
|
||||
if (burn || brute)//else this was formerly an else. double iffing because nobody wants to fix that much spacing
|
||||
if (status & ORGAN_ROBOT)
|
||||
droplimb(1) //Robot limbs just kinda fail at full damage.
|
||||
else
|
||||
//List organs we can pass it to
|
||||
var/list/datum/organ/external/possible_points = list()
|
||||
if(parent)
|
||||
@@ -160,7 +159,7 @@
|
||||
//If limb took enough damage, try to cut or tear it off
|
||||
if(body_part != UPPER_TORSO && body_part != LOWER_TORSO) //as hilarious as it is, getting hit on the chest too much shouldn't effectively gib you.
|
||||
if(config.limbs_can_break && brute_dam >= max_damage * config.organ_health_multiplier)
|
||||
if( (edge && prob(5 * brute)) || (brute > 20 && prob(2 * brute)) )
|
||||
if( (edge && prob(5 * brute)) || (brute > 20 && prob(brute)) )
|
||||
droplimb(1)
|
||||
return
|
||||
|
||||
@@ -498,10 +497,11 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
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(!W.internal) //so IB doesn't count towards crit/paincrit
|
||||
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() && (H && !(H.species.flags & NO_BLOOD)))
|
||||
W.bleed_timer--
|
||||
@@ -563,7 +563,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
O.setAmputatedTree()
|
||||
|
||||
//Handles dismemberment
|
||||
/datum/organ/external/proc/droplimb(var/override = 0,var/no_explode = 0)
|
||||
/datum/organ/external/proc/droplimb(var/override = 0,var/no_explode = 0,var/amputation=0)
|
||||
if(destspawn) return
|
||||
if(override)
|
||||
status |= ORGAN_DESTROYED
|
||||
@@ -580,9 +580,13 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
|
||||
germ_level = 0
|
||||
|
||||
// If any organs are attached to this, destroy them
|
||||
for(var/datum/organ/external/O in children)
|
||||
O.droplimb(1, no_explode, amputation)
|
||||
|
||||
//Replace all wounds on that arm with one wound on parent organ.
|
||||
wounds.Cut()
|
||||
if (parent)
|
||||
if (parent && !amputation)
|
||||
var/datum/wound/W
|
||||
if(max_damage < 50)
|
||||
W = new/datum/wound/lost_limb/small(max_damage)
|
||||
@@ -592,22 +596,12 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
parent.update_damages()
|
||||
update_damages()
|
||||
|
||||
// If any organs are attached to this, destroy them
|
||||
for(var/datum/organ/external/O in children)
|
||||
O.droplimb(1)
|
||||
|
||||
var/obj/organ //Dropped limb object
|
||||
var/list/dropped_items
|
||||
switch(body_part)
|
||||
if(HEAD)
|
||||
if(owner.species.flags & IS_SYNTHETIC)
|
||||
organ= new /obj/item/weapon/organ/head/posi(owner.loc, owner)
|
||||
else
|
||||
organ= new /obj/item/weapon/organ/head(owner.loc, owner)
|
||||
owner.u_equip(owner.glasses)
|
||||
owner.u_equip(owner.head)
|
||||
owner.u_equip(owner.l_ear)
|
||||
owner.u_equip(owner.r_ear)
|
||||
owner.u_equip(owner.wear_mask)
|
||||
organ = new /obj/item/weapon/organ/head(owner.loc, owner)
|
||||
dropped_items = list(owner.glasses, owner.head, owner.l_ear, owner.r_ear, owner.wear_mask)
|
||||
if(ARM_RIGHT)
|
||||
if(status & ORGAN_ROBOT)
|
||||
organ = new /obj/item/robot_parts/r_arm(owner.loc)
|
||||
@@ -631,26 +625,29 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
if(HAND_RIGHT)
|
||||
if(!(status & ORGAN_ROBOT))
|
||||
organ= new /obj/item/weapon/organ/r_hand(owner.loc, owner)
|
||||
owner.u_equip(owner.gloves)
|
||||
dropped_items = list(owner.gloves) //should probably make it so that you can still wear gloves if you have one hand
|
||||
if(HAND_LEFT)
|
||||
if(!(status & ORGAN_ROBOT))
|
||||
organ= new /obj/item/weapon/organ/l_hand(owner.loc, owner)
|
||||
owner.u_equip(owner.gloves)
|
||||
dropped_items = list(owner.gloves)
|
||||
if(FOOT_RIGHT)
|
||||
if(!(status & ORGAN_ROBOT))
|
||||
organ= new /obj/item/weapon/organ/r_foot/(owner.loc, owner)
|
||||
owner.u_equip(owner.shoes)
|
||||
dropped_items = list(owner.shoes)
|
||||
if(FOOT_LEFT)
|
||||
if(!(status & ORGAN_ROBOT))
|
||||
organ = new /obj/item/weapon/organ/l_foot(owner.loc, owner)
|
||||
owner.u_equip(owner.shoes)
|
||||
dropped_items = list(owner.shoes)
|
||||
if(dropped_items)
|
||||
for(var/obj/O in dropped_items)
|
||||
owner.remove_from_mob(O)
|
||||
|
||||
destspawn = 1
|
||||
//Robotic limbs explode if sabotaged.
|
||||
if(status & ORGAN_ROBOT && !no_explode && sabotaged)
|
||||
owner.visible_message("\red \The [owner]'s [display_name] explodes violently!",\
|
||||
"\red <b>Your [display_name] explodes!</b>",\
|
||||
"You hear an explosion followed by a scream!")
|
||||
"You hear an explosion!")
|
||||
explosion(get_turf(owner),-1,-1,2,3)
|
||||
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
|
||||
spark_system.set_up(5, 0, owner)
|
||||
@@ -663,10 +660,9 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
"<span class='moderate'><b>Your [display_name] goes flying off!</b></span>",\
|
||||
"You hear a terrible sound of ripping tendons and flesh.")
|
||||
|
||||
if(organ)
|
||||
//Throw organs around
|
||||
var/lol = pick(cardinal)
|
||||
step(organ,lol)
|
||||
//Throw organs around
|
||||
if(istype(owner.loc,/turf) && organ)
|
||||
step(organ,pick(cardinal))
|
||||
|
||||
owner.update_body(1)
|
||||
|
||||
@@ -769,6 +765,15 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
suit.supporting_limbs |= src
|
||||
return
|
||||
|
||||
/datum/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
|
||||
|
||||
/datum/organ/external/proc/robotize()
|
||||
src.status &= ~ORGAN_BROKEN
|
||||
src.status &= ~ORGAN_BLEEDING
|
||||
@@ -816,7 +821,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
return ((status & ORGAN_BROKEN) && !(status & ORGAN_SPLINTED))
|
||||
|
||||
/datum/organ/external/proc/is_malfunctioning()
|
||||
return ((status & ORGAN_ROBOT) && prob(brute_dam + burn_dam - 11))
|
||||
return ((status & ORGAN_ROBOT) && prob(brute_dam + burn_dam))
|
||||
|
||||
//for arms and hands
|
||||
/datum/organ/external/proc/process_grasp(var/obj/item/c_hand, var/hand_name)
|
||||
@@ -825,8 +830,8 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
|
||||
if(is_broken())
|
||||
owner.u_equip(c_hand)
|
||||
var/emote_scream = pick("screams in pain and", "lets out a sharp cry and", "cries out and")
|
||||
owner.emote("me", 1, "[(owner.species && owner.species.flags & NO_PAIN) ? "" : emote_scream ] drops what they were holding in their [hand_name]!")
|
||||
var/emote_scream = pick("screams in pain and ", "lets out a sharp cry and ", "cries out and ")
|
||||
owner.emote("me", 1, "[(owner.species && owner.species.flags & NO_PAIN) ? "" : emote_scream ]drops what they were holding in their [hand_name]!")
|
||||
if(is_malfunctioning())
|
||||
owner.u_equip(c_hand)
|
||||
owner.emote("me", 1, "drops what they were holding, their [hand_name] malfunctioning!")
|
||||
@@ -1005,6 +1010,8 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
|
||||
obj/item/weapon/organ
|
||||
icon = 'icons/mob/human_races/r_human.dmi'
|
||||
var/op_stage = 0
|
||||
var/list/organs_internal = list()
|
||||
|
||||
obj/item/weapon/organ/New(loc, mob/living/carbon/human/H)
|
||||
..(loc)
|
||||
@@ -1015,9 +1022,18 @@ obj/item/weapon/organ/New(loc, mob/living/carbon/human/H)
|
||||
blood_DNA = list()
|
||||
blood_DNA[H.dna.unique_enzymes] = H.dna.b_type
|
||||
|
||||
//Forming icon for the limb
|
||||
// Transferring over organs from the host.
|
||||
for(var/datum/organ/internal/I in H.internal_organs)
|
||||
if(I.parent_organ != name)
|
||||
continue
|
||||
var/obj/item/organ/current_organ = I.remove()
|
||||
current_organ.removed(H)
|
||||
current_organ.loc = src
|
||||
if(current_organ.organ_data)
|
||||
organs_internal |= current_organ.organ_data
|
||||
|
||||
//Setting base icon for this mob's race
|
||||
// Forming icon for the limb
|
||||
// Setting base icon for this mob's race
|
||||
var/icon/base
|
||||
if(H.species && H.species.icobase)
|
||||
base = icon(H.species.icobase)
|
||||
@@ -1038,7 +1054,7 @@ obj/item/weapon/organ/New(loc, mob/living/carbon/human/H)
|
||||
base.Blend(rgb(H.r_skin, H.g_skin, H.b_skin), ICON_ADD)
|
||||
|
||||
icon = base
|
||||
dir = SOUTH
|
||||
set_dir(SOUTH)
|
||||
src.transform = turn(src.transform, rand(70,130))
|
||||
|
||||
|
||||
@@ -1101,81 +1117,34 @@ obj/item/weapon/organ/head/New(loc, mob/living/carbon/human/H)
|
||||
hair.Blend(rgb(H.r_hair, H.g_hair, H.b_hair), ICON_ADD)
|
||||
|
||||
overlays.Add(hair) //icon.Blend(hair, ICON_OVERLAY)
|
||||
spawn(5)
|
||||
if(brainmob && brainmob.client)
|
||||
brainmob.client.screen.len = null //clear the hud
|
||||
|
||||
//if(ishuman(H))
|
||||
// if(H.gender == FEMALE)
|
||||
// H.icon_state = "head_f"
|
||||
// H.overlays += H.generate_head_icon()
|
||||
transfer_identity(H)
|
||||
|
||||
name = "[H.real_name]'s head"
|
||||
|
||||
H.regenerate_icons()
|
||||
|
||||
brainmob.stat = 2
|
||||
brainmob.death()
|
||||
|
||||
obj/item/weapon/organ/head/proc/transfer_identity(var/mob/living/carbon/human/H)//Same deal as the regular brain proc. Used for human-->head
|
||||
brainmob = new(src)
|
||||
brainmob.name = H.real_name
|
||||
brainmob.real_name = H.real_name
|
||||
brainmob.dna = H.dna.Clone()
|
||||
if(H.mind)
|
||||
H.mind.transfer_to(brainmob)
|
||||
brainmob.container = src
|
||||
|
||||
obj/item/weapon/organ/head/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W,/obj/item/weapon/scalpel))
|
||||
switch(brain_op_stage)
|
||||
if(0)
|
||||
for(var/mob/O in (oviewers(brainmob) - user))
|
||||
O.show_message("\red [brainmob] is beginning to have \his head cut open with [W] by [user].", 1)
|
||||
brainmob << "\red [user] begins to cut open your head with [W]!"
|
||||
user << "\red You cut [brainmob]'s head open with [W]!"
|
||||
|
||||
brain_op_stage = 1
|
||||
|
||||
if(2)
|
||||
for(var/mob/O in (oviewers(brainmob) - user))
|
||||
O.show_message("\red [brainmob] is having \his connections to the brain delicately severed with [W] by [user].", 1)
|
||||
brainmob << "\red [user] begins to cut open your head with [W]!"
|
||||
user << "\red You cut [brainmob]'s head open with [W]!"
|
||||
|
||||
brain_op_stage = 3.0
|
||||
else
|
||||
..()
|
||||
else if(istype(W,/obj/item/weapon/circular_saw))
|
||||
switch(brain_op_stage)
|
||||
if(1)
|
||||
for(var/mob/O in (oviewers(brainmob) - user))
|
||||
O.show_message("\red [brainmob] has \his head sawed open with [W] by [user].", 1)
|
||||
brainmob << "\red [user] begins to saw open your head with [W]!"
|
||||
user << "\red You saw [brainmob]'s head open with [W]!"
|
||||
|
||||
brain_op_stage = 2
|
||||
if(3)
|
||||
for(var/mob/O in (oviewers(brainmob) - user))
|
||||
O.show_message("\red [brainmob] has \his spine's connection to the brain severed with [W] by [user].", 1)
|
||||
brainmob << "\red [user] severs your brain's connection to the spine with [W]!"
|
||||
user << "\red You sever [brainmob]'s brain's connection to the spine with [W]!"
|
||||
|
||||
user.attack_log += "\[[time_stamp()]\]<font color='red'> Debrained [brainmob.name] ([brainmob.ckey]) with [W.name] (INTENT: [uppertext(user.a_intent)])</font>"
|
||||
brainmob.attack_log += "\[[time_stamp()]\]<font color='orange'> Debrained by [user.name] ([user.ckey]) with [W.name] (INTENT: [uppertext(user.a_intent)])</font>"
|
||||
msg_admin_attack("[key_name_admin(user)] debrained [key_name_admin(brainmob)] (INTENT: [uppertext(user.a_intent)]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
|
||||
|
||||
//TODO: ORGAN REMOVAL UPDATE.
|
||||
if(istype(src,/obj/item/weapon/organ/head/posi))
|
||||
var/obj/item/device/mmi/posibrain/B = new(loc)
|
||||
B.transfer_identity(brainmob)
|
||||
obj/item/weapon/organ/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
switch(op_stage)
|
||||
if(0)
|
||||
if(istype(W,/obj/item/weapon/scalpel))
|
||||
user.visible_message("<span class='danger'><b>[user]</b> cuts [src] open with [W]!")
|
||||
op_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]!")
|
||||
op_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)
|
||||
if(!(user.l_hand && user.r_hand))
|
||||
user.put_in_hands(removing)
|
||||
if(istype(removing,/obj/item/organ))
|
||||
var/obj/item/organ/removed_organ = removing
|
||||
organs_internal -= removed_organ.organ_data
|
||||
user.visible_message("<span class='danger'><b>[user]</b> extracts [removing] from [src] with [W]!")
|
||||
else
|
||||
var/obj/item/organ/brain/B = new(loc)
|
||||
B.transfer_identity(brainmob)
|
||||
|
||||
brain_op_stage = 4.0
|
||||
else
|
||||
..()
|
||||
else
|
||||
..()
|
||||
user.visible_message("<span class='danger'><b>[user]</b> fishes around fruitlessly in [src] with [W].")
|
||||
return
|
||||
..()
|
||||
@@ -16,6 +16,7 @@
|
||||
var/rejecting // Is this organ already being rejected?
|
||||
var/obj/item/organ/organ_holder // If not in a body, held in this item.
|
||||
var/list/transplant_data
|
||||
|
||||
/datum/organ/internal/proc/rejuvenate()
|
||||
damage=0
|
||||
|
||||
@@ -40,8 +41,8 @@
|
||||
E.internal_organs |= src
|
||||
|
||||
/datum/organ/internal/process()
|
||||
//Process infections
|
||||
|
||||
//Process infections
|
||||
if (robotic >= 2 || (owner.species && owner.species.flags & IS_PLANT)) //TODO make robotic internal and external organs separate types of organ instead of a flag
|
||||
germ_level = 0
|
||||
return
|
||||
@@ -172,7 +173,9 @@
|
||||
removed_type = /obj/item/organ/liver
|
||||
|
||||
process()
|
||||
|
||||
..()
|
||||
|
||||
if (germ_level > INFECTION_LEVEL_ONE)
|
||||
if(prob(1))
|
||||
owner << "\red Your skin itches."
|
||||
@@ -271,7 +274,13 @@
|
||||
|
||||
if(!removed_type) return 0
|
||||
|
||||
var/obj/item/organ/removed_organ = new removed_type(get_turf(user))
|
||||
var/turf/target_loc
|
||||
if(user)
|
||||
target_loc = get_turf(user)
|
||||
else
|
||||
target_loc = get_turf(owner)
|
||||
|
||||
var/obj/item/organ/removed_organ = new removed_type(target_loc)
|
||||
|
||||
if(istype(removed_organ))
|
||||
removed_organ.organ_data = src
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
/obj/item/organ/proc/update()
|
||||
|
||||
if(!organ_data)
|
||||
organ_data = new /datum/organ/internal()
|
||||
organ_data = new organ_type()
|
||||
|
||||
if(robotic)
|
||||
organ_data.robotic = robotic
|
||||
@@ -93,6 +93,7 @@
|
||||
organ_tag = "heart"
|
||||
fresh = 6 // Juicy.
|
||||
dead_icon = "heart-off"
|
||||
organ_type = /datum/organ/internal/heart
|
||||
|
||||
/obj/item/organ/lungs
|
||||
name = "lungs"
|
||||
@@ -101,6 +102,7 @@
|
||||
prosthetic_name = "gas exchange system"
|
||||
prosthetic_icon = "lungs-prosthetic"
|
||||
organ_tag = "lungs"
|
||||
organ_type = /datum/organ/internal/lungs
|
||||
|
||||
/obj/item/organ/kidneys
|
||||
name = "kidneys"
|
||||
@@ -109,6 +111,7 @@
|
||||
prosthetic_name = "prosthetic kidneys"
|
||||
prosthetic_icon = "kidneys-prosthetic"
|
||||
organ_tag = "kidneys"
|
||||
organ_type = /datum/organ/internal/kidney
|
||||
|
||||
/obj/item/organ/eyes
|
||||
name = "eyeballs"
|
||||
@@ -117,7 +120,7 @@
|
||||
prosthetic_name = "visual prosthesis"
|
||||
prosthetic_icon = "eyes-prosthetic"
|
||||
organ_tag = "eyes"
|
||||
|
||||
organ_type = /datum/organ/internal/eyes
|
||||
var/eye_colour
|
||||
|
||||
/obj/item/organ/liver
|
||||
@@ -126,11 +129,13 @@
|
||||
prosthetic_name = "toxin filter"
|
||||
prosthetic_icon = "liver-prosthetic"
|
||||
organ_tag = "liver"
|
||||
organ_type = /datum/organ/internal/liver
|
||||
|
||||
/obj/item/organ/appendix
|
||||
name = "appendix"
|
||||
icon_state = "appendix"
|
||||
organ_tag = "appendix"
|
||||
organ_type = /datum/organ/internal/appendix
|
||||
|
||||
//These are here so they can be printed out via the fabricator.
|
||||
/obj/item/organ/heart/prosthetic
|
||||
@@ -151,15 +156,28 @@
|
||||
/obj/item/organ/appendix
|
||||
name = "appendix"
|
||||
|
||||
/obj/item/organ/proc/removed(var/mob/living/target,var/mob/living/user)
|
||||
/obj/item/organ/proc/removed(var/mob/living/carbon/human/target,var/mob/living/user)
|
||||
|
||||
if(!target || !user)
|
||||
if(!istype(target) || !organ_data)
|
||||
return
|
||||
|
||||
if(organ_data.vital)
|
||||
target.internal_organs_by_name[organ_tag] = null
|
||||
target.internal_organs_by_name -= organ_tag
|
||||
target.internal_organs -= organ_data
|
||||
|
||||
var/datum/organ/external/affected = target.get_organ(organ_data.parent_organ)
|
||||
affected.internal_organs -= organ_data
|
||||
|
||||
loc = target.loc
|
||||
organ_data.rejecting = null
|
||||
var/datum/reagent/blood/organ_blood = locate(/datum/reagent/blood) in reagents.reagent_list
|
||||
if(!organ_blood || !organ_blood.data["blood_DNA"])
|
||||
target.vessel.trans_to(src, 5, 1, 1)
|
||||
|
||||
if(target && user && organ_data.vital)
|
||||
user.attack_log += "\[[time_stamp()]\]<font color='red'> removed a vital organ ([src]) from [target.name] ([target.ckey]) (INTENT: [uppertext(user.a_intent)])</font>"
|
||||
target.attack_log += "\[[time_stamp()]\]<font color='orange'> had a vital organ ([src]) removed by [user.name] ([user.ckey]) (INTENT: [uppertext(user.a_intent)])</font>"
|
||||
msg_admin_attack("[key_name_admin(user)] removed a vital organ ([src]) from [key_name_admin(target)] (INTENT: [uppertext(user.a_intent)]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
|
||||
msg_admin_attack("[user.name] ([user.ckey]) removed a vital organ ([src]) from [target.name] ([target.ckey]) (INTENT: [uppertext(user.a_intent)]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
|
||||
target.death()
|
||||
|
||||
/obj/item/organ/appendix/removed(var/mob/living/target,var/mob/living/user)
|
||||
@@ -196,18 +214,40 @@
|
||||
H.b_eyes = 0
|
||||
H.update_body()
|
||||
|
||||
/obj/item/organ/proc/replaced(var/mob/living/target)
|
||||
return
|
||||
/obj/item/organ/proc/replaced(var/mob/living/carbon/human/target,var/datum/organ/external/affected)
|
||||
|
||||
/obj/item/organ/eyes/replaced(var/mob/living/target)
|
||||
if(!istype(target)) return
|
||||
|
||||
var/datum/reagent/blood/transplant_blood = locate(/datum/reagent/blood) in reagents.reagent_list
|
||||
if(!transplant_blood)
|
||||
organ_data.transplant_data = list()
|
||||
organ_data.transplant_data["species"] = target.species.name
|
||||
organ_data.transplant_data["blood_type"] = target.dna.b_type
|
||||
organ_data.transplant_data["blood_DNA"] = target.dna.unique_enzymes
|
||||
else
|
||||
organ_data.transplant_data = list()
|
||||
organ_data.transplant_data["species"] = transplant_blood.data["species"]
|
||||
organ_data.transplant_data["blood_type"] = transplant_blood.data["blood_type"]
|
||||
organ_data.transplant_data["blood_DNA"] = transplant_blood.data["blood_DNA"]
|
||||
|
||||
organ_data.organ_holder = null
|
||||
organ_data.owner = target
|
||||
target.internal_organs |= organ_data
|
||||
affected.internal_organs |= organ_data
|
||||
target.internal_organs_by_name[organ_tag] = organ_data
|
||||
organ_data.status |= ORGAN_CUT_AWAY
|
||||
|
||||
del(src)
|
||||
|
||||
/obj/item/organ/eyes/replaced(var/mob/living/carbon/human/target)
|
||||
|
||||
// Apply our eye colour to the target.
|
||||
var/mob/living/carbon/human/H = target
|
||||
if(istype(H) && eye_colour)
|
||||
H.r_eyes = eye_colour[1]
|
||||
H.g_eyes = eye_colour[2]
|
||||
H.b_eyes = eye_colour[3]
|
||||
H.update_body()
|
||||
if(istype(target) && eye_colour)
|
||||
target.r_eyes = eye_colour[1]
|
||||
target.g_eyes = eye_colour[2]
|
||||
target.b_eyes = eye_colour[3]
|
||||
target.update_body()
|
||||
..()
|
||||
|
||||
/obj/item/organ/proc/bitten(mob/user)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user