From e0f23aead5d9c4713cde19d1131c07c643e3f004 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 11 Mar 2015 21:17:51 +1030 Subject: [PATCH 01/11] Collapsed all organs into one object type. Added more interesting amputation. Added dislocation. WIP. --- baystation12.dme | 2 +- code/ZAS/Phoron.dm | 2 +- code/_onclick/item_attack.dm | 8 +- code/datums/datacore.dm | 2 +- code/datums/datumvars.dm | 11 +- code/datums/diseases/appendicitis.dm | 2 +- code/datums/mind.dm | 4 +- code/game/gamemodes/calamity/calamity.dm | 2 +- .../gamemodes/changeling/changeling_powers.dm | 2 +- code/game/gamemodes/cult/cult_items.dm | 2 +- code/game/gamemodes/cult/runes.dm | 18 +- code/game/gamemodes/heist/heist.dm | 6 +- code/game/gamemodes/objective.dm | 4 +- code/game/jobs/job_controller.dm | 4 +- code/game/machinery/adv_med.dm | 6 +- code/game/machinery/doors/airlock.dm | 2 +- code/game/machinery/flasher.dm | 2 +- code/game/machinery/kitchen/gibber.dm | 2 +- code/game/machinery/suit_storage_unit.dm | 2 +- code/game/mecha/combat/combat.dm | 2 +- code/game/objects/effects/aliens.dm | 4 +- .../effects/decals/Cleanable/humans.dm | 4 +- code/game/objects/items.dm | 6 +- code/game/objects/items/devices/PDA/PDA.dm | 2 +- code/game/objects/items/devices/scanners.dm | 8 +- code/game/objects/items/stacks/medical.dm | 12 +- code/game/objects/items/stacks/nanopaste.dm | 2 +- code/game/objects/items/weapons/autopsy.dm | 4 +- .../items/weapons/grenades/flashbang.dm | 2 +- code/game/objects/items/weapons/handcuffs.dm | 2 +- .../objects/items/weapons/implants/implant.dm | 14 +- .../items/weapons/implants/implanter.dm | 2 +- .../objects/items/weapons/melee/energy.dm | 2 +- code/game/objects/items/weapons/shards.dm | 2 +- .../objects/items/weapons/storage/bible.dm | 2 +- code/game/objects/items/weapons/stunbaton.dm | 4 +- .../objects/items/weapons/teleportation.dm | 2 +- code/game/objects/items/weapons/tools.dm | 4 +- code/game/objects/structures.dm | 2 +- code/game/objects/structures/extinguisher.dm | 2 +- code/game/objects/structures/mineral_doors.dm | 2 +- .../stool_bed_chair_nest/alien_nests.dm | 4 +- code/game/objects/structures/watercloset.dm | 2 +- code/modules/admin/topic.dm | 2 +- code/modules/assembly/mousetrap.dm | 2 +- code/modules/client/preferences.dm | 6 +- .../modules/clothing/spacesuits/spacesuits.dm | 4 +- code/modules/genetics/side_effects.dm | 4 +- code/modules/hydroponics/seed.dm | 2 +- code/modules/mob/language/outsider.dm | 2 +- .../mob/living/carbon/alien/larva/larva.dm | 2 +- .../mob/living/carbon/brain/brain_item.dm | 9 - code/modules/mob/living/carbon/carbon.dm | 8 +- code/modules/mob/living/carbon/human/death.dm | 8 +- .../mob/living/carbon/human/examine.dm | 4 +- code/modules/mob/living/carbon/human/human.dm | 93 +++- .../living/carbon/human/human_attackhand.dm | 22 +- .../mob/living/carbon/human/human_damage.dm | 58 +-- .../mob/living/carbon/human/human_defense.dm | 28 +- .../mob/living/carbon/human/human_movement.dm | 4 +- .../mob/living/carbon/human/human_organs.dm | 93 ++++ .../mob/living/carbon/human/inventory.dm | 6 +- code/modules/mob/living/carbon/human/life.dm | 12 +- .../carbon/human/species/outsider/vox.dm | 14 +- .../living/carbon/human/species/species.dm | 44 +- .../carbon/human/species/species_attack.dm | 2 +- .../carbon/human/species/station/golem.dm | 2 +- .../carbon/human/species/station/slime.dm | 2 +- .../carbon/human/species/station/station.dm | 12 +- .../human/species/xenomorphs/alien_embryo.dm | 6 +- .../species/xenomorphs/alien_facehugger.dm | 4 +- .../human/species/xenomorphs/alien_powers.dm | 8 +- .../human/species/xenomorphs/alien_species.dm | 68 +-- .../mob/living/carbon/human/unarmed_attack.dm | 14 +- .../mob/living/carbon/human/update_icons.dm | 18 +- code/modules/mob/living/carbon/shock.dm | 2 +- code/modules/mob/living/living.dm | 4 +- .../mob/living/silicon/robot/analyzer.dm | 2 +- .../mob/living/simple_animal/borer/borer.dm | 2 +- .../simple_animal/borer/borer_powers.dm | 10 +- .../mob/living/simple_animal/hostile/bear.dm | 2 +- .../mob/living/simple_animal/parrot.dm | 2 +- code/modules/mob/mob.dm | 6 +- code/modules/mob/mob_helpers.dm | 6 +- code/modules/mob/mob_movement.dm | 4 +- code/modules/organs/blood.dm | 4 +- code/modules/organs/organ.dm | 364 +++++++++++---- code/modules/organs/organ_alien.dm | 57 +-- code/modules/organs/organ_external.dm | 339 +++++++------- code/modules/organs/organ_internal.dm | 416 +++++++----------- code/modules/organs/organ_objects.dm | 270 ------------ code/modules/organs/pain.dm | 8 +- code/modules/paperwork/paperbin.dm | 2 +- code/modules/power/cable.dm | 2 +- code/modules/reagents/Chemistry-Reagents.dm | 14 +- .../reagent_containers/food/drinks/bottle.dm | 2 +- .../reagent_containers/food/snacks.dm | 4 +- .../reagents/reagent_containers/syringes.dm | 4 +- .../artifact/effects/unknown_effect_heal.dm | 2 +- code/modules/surgery/bones.dm | 32 +- code/modules/surgery/brainrepair.dm | 12 +- code/modules/surgery/encased.dm | 32 +- code/modules/surgery/eye.dm | 22 +- code/modules/surgery/face.dm | 12 +- code/modules/surgery/generic.dm | 70 +-- code/modules/surgery/headreattach.dm | 28 +- code/modules/surgery/implant.dm | 38 +- code/modules/surgery/organs_internal.dm | 66 +-- code/modules/surgery/other.dm | 24 +- code/modules/surgery/robolimbs.dm | 34 +- code/modules/surgery/surgery.dm | 4 +- code/modules/virus2/effect.dm | 18 +- code/modules/virus2/helpers.dm | 6 +- code/setup.dm | 1 + maps/exodus-2.dmm | 2 +- 115 files changed, 1295 insertions(+), 1372 deletions(-) create mode 100644 code/modules/mob/living/carbon/human/human_organs.dm delete mode 100644 code/modules/organs/organ_objects.dm diff --git a/baystation12.dme b/baystation12.dme index 51ebc82859..8e70625dfa 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1108,6 +1108,7 @@ #include "code\modules\mob\living\carbon\human\human_defense.dm" #include "code\modules\mob\living\carbon\human\human_defines.dm" #include "code\modules\mob\living\carbon\human\human_movement.dm" +#include "code\modules\mob\living\carbon\human\human_organs.dm" #include "code\modules\mob\living\carbon\human\human_powers.dm" #include "code\modules\mob\living\carbon\human\human_species.dm" #include "code\modules\mob\living\carbon\human\inventory.dm" @@ -1268,7 +1269,6 @@ #include "code\modules\organs\organ_alien.dm" #include "code\modules\organs\organ_external.dm" #include "code\modules\organs\organ_internal.dm" -#include "code\modules\organs\organ_objects.dm" #include "code\modules\organs\pain.dm" #include "code\modules\organs\wound.dm" #include "code\modules\overmap\_defines.dm" diff --git a/code/ZAS/Phoron.dm b/code/ZAS/Phoron.dm index 6cd983732b..391f5b719a 100644 --- a/code/ZAS/Phoron.dm +++ b/code/ZAS/Phoron.dm @@ -120,7 +120,7 @@ obj/var/contaminated = 0 if(!species.has_organ["eyes"]) return - var/datum/organ/internal/eyes/E = internal_organs_by_name["eyes"] + var/obj/item/organ/eyes/E = internal_organs_by_name["eyes"] if(E) if(prob(20)) src << "\red Your eyes burn!" E.damage += 2.5 diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index a81c6f30fa..52b6fe9424 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -41,6 +41,12 @@ // TODO: needs to be refactored into a mob/living level attacked_by() proc. ~Z if(istype(M, /mob/living/carbon/human)) var/mob/living/carbon/human/H = M + + // Handle striking to cripple. + if(user.a_intent == "disarm" && H.attack_joint(src, user, def_zone)) + add_fingerprint(user) + return 1 + var/hit = H.attacked_by(src, user, def_zone) if(hit && hitsound) playsound(loc, hitsound, 50, 1, -1) @@ -50,7 +56,7 @@ user.visible_message("[M] has been [pick(attack_verb)] with [src] by [user]!") else user.visible_message("[M] has been attacked with [src] by [user]!") - + if (hitsound) playsound(loc, hitsound, 50, 1, -1) switch(damtype) diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index 2e3d2cc544..8cde01cdf3 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -155,7 +155,7 @@ proc/get_id_photo(var/mob/living/carbon/human/H) temp = new /icon(icobase, "head_[g]") preview_icon.Blend(temp, ICON_OVERLAY) - for(var/datum/organ/external/E in H.organs) + for(var/obj/item/organ/external/E in H.organs) if(E.status & ORGAN_CUT_AWAY || E.status & ORGAN_DESTROYED) continue temp = new /icon(icobase, "[E.name]") if(E.status & ORGAN_ROBOT) diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index 49863e8c4b..9ed08890a8 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -865,7 +865,7 @@ client usr << "This can only be done to instances of type /mob/living/carbon" return - var/new_organ = input("Please choose an organ to add.","Organ",null) as null|anything in typesof(/datum/organ/internal)-/datum/organ/internal + var/new_organ = input("Please choose an organ to add.","Organ",null) as null|anything in typesof(/obj/item/organ)-/obj/item/organ if(!new_organ) return if(!M) @@ -878,7 +878,7 @@ client if(istype(M,/mob/living/carbon/human)) var/mob/living/carbon/human/H = M - var/datum/organ/internal/I = new new_organ(H) + var/obj/item/organ/I = new new_organ(H) var/organ_slot = input(usr, "Which slot do you want the organ to go in ('default' for default)?") as text|null @@ -888,12 +888,7 @@ client if(organ_slot != "default") organ_slot = sanitize(copytext(organ_slot,1,MAX_MESSAGE_LEN)) else - if(I.removed_type) - var/obj/item/organ/O = new I.removed_type() - organ_slot = O.organ_tag - del(O) - else - organ_slot = "unknown organ" + organ_slot = "unknown organ" if(H.internal_organs_by_name[organ_slot]) usr << "[H] already has an organ in that slot." diff --git a/code/datums/diseases/appendicitis.dm b/code/datums/diseases/appendicitis.dm index 8ab0f1b491..37a2adecb6 100644 --- a/code/datums/diseases/appendicitis.dm +++ b/code/datums/diseases/appendicitis.dm @@ -46,7 +46,7 @@ H << "\red Your abdomen is a world of pain!" H.Weaken(10) - var/datum/organ/external/groin = H.get_organ("groin") + var/obj/item/organ/external/groin = H.get_organ("groin") var/datum/wound/W = new /datum/wound/internal_bleeding(20) H.adjustToxLoss(25) groin.wounds += W diff --git a/code/datums/mind.dm b/code/datums/mind.dm index de544cc9ae..4d4c02dcc1 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -72,7 +72,7 @@ datum/mind current.remove_changeling_powers() current.verbs -= /datum/changeling/proc/EvolutionMenu current.mind = null - + nanomanager.user_transferred(current, new_character) // transfer active NanoUI instances to new user if(new_character.mind) //remove any mind currently in our new body's mind variable new_character.mind.current = null @@ -505,7 +505,7 @@ datum/mind switch(href_list["implant"]) if("remove") for(var/obj/item/weapon/implant/loyalty/I in H.contents) - for(var/datum/organ/external/organs in H.organs) + for(var/obj/item/organ/external/organs in H.organs) if(I in organs.implants) I.Del() break diff --git a/code/game/gamemodes/calamity/calamity.dm b/code/game/gamemodes/calamity/calamity.dm index 53cd72d447..0fe735a09e 100644 --- a/code/game/gamemodes/calamity/calamity.dm +++ b/code/game/gamemodes/calamity/calamity.dm @@ -417,7 +417,7 @@ B.host_brain.name = target_host.name B.host_brain.real_name = target_host.real_name - var/datum/organ/external/head = target_host.get_organ("head") + var/obj/item/organ/external/head = target_host.get_organ("head") head.implants += B if(!config.objectives_disabled) diff --git a/code/game/gamemodes/changeling/changeling_powers.dm b/code/game/gamemodes/changeling/changeling_powers.dm index 8d15141df1..9984da310c 100644 --- a/code/game/gamemodes/changeling/changeling_powers.dm +++ b/code/game/gamemodes/changeling/changeling_powers.dm @@ -173,7 +173,7 @@ src << "We stab [T] with the proboscis." src.visible_message("[src] stabs [T] with the proboscis!") T << "You feel a sharp stabbing pain!" - var/datum/organ/external/affecting = T.get_organ(src.zone_sel.selecting) + var/obj/item/organ/external/affecting = T.get_organ(src.zone_sel.selecting) if(affecting.take_damage(39,0,1,0,"large organic needle")) T:UpdateDamageIcon() diff --git a/code/game/gamemodes/cult/cult_items.dm b/code/game/gamemodes/cult/cult_items.dm index 51f77c2cc0..f2f5f96de7 100644 --- a/code/game/gamemodes/cult/cult_items.dm +++ b/code/game/gamemodes/cult/cult_items.dm @@ -17,7 +17,7 @@ user.Paralyse(5) user << "\red An unexplicable force powerfully repels the sword from [target]!" var/organ = ((user.hand ? "l_":"r_") + "arm") - var/datum/organ/external/affecting = user.get_organ(organ) + var/obj/item/organ/external/affecting = user.get_organ(organ) if(affecting.take_damage(rand(force/2, force))) //random amount of damage between half of the blade's force and the full force of the blade. user.UpdateDamageIcon() return diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 21c0b8e78b..e701ddce35 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -104,16 +104,16 @@ var/list/sacrificed = list() if(!iscultist(M) && M.stat < DEAD && !(M in converting)) target = M break - + if(!target) //didn't find any new targets if(!converting.len) fizzle() else usr << "You sense that the power of the dark one is already working away at them." return - + usr.say("Mah[pick("'","`")]weyh pleggh at e'ntrath!") - + converting |= target var/list/waiting_for_input = list(target = 0) //need to box this up in order to be able to reset it again from inside spawn, apparently var/initial_message = 0 @@ -123,7 +123,7 @@ var/list/sacrificed = list() if(target.getFireLoss() < 100) target.hallucination = min(target.hallucination, 500) return 0 - + target.take_overall_damage(0, rand(5, 20)) // You dirty resister cannot handle the damage to your mind. Easily. - even cultists who accept right away should experience some effects // Resist messages go! if(initial_message) //don't do this stuff right away, only if they resist or hesitate. @@ -139,7 +139,7 @@ var/list/sacrificed = list() target << "Your mind turns to ash as the burning flames engulf your very soul and images of an unspeakable horror begin to bombard the last remnants of mental resistance." //broken mind - 5000 may seem like a lot I wanted the effect to really stand out for maxiumum losing-your-mind-spooky //hallucination is reduced when the step off as well, provided they haven't hit the last stage... - target.hallucination += 5000 + target.hallucination += 5000 target.apply_effect(10, STUTTER) target.adjustBrainLoss(1) if(100 to INFINITY) @@ -156,12 +156,12 @@ var/list/sacrificed = list() if(!waiting_for_input[target]) //so we don't spam them with dialogs if they hesitate waiting_for_input[target] = 1 - + if(!is_convertable_to_cult(target.mind) || jobban_isbanned(target, "cultist"))//putting jobban check here because is_convertable uses mind as argument //waiting_for_input ensures this is only shown once, so they basically auto-resist from here on out. They still need to find a way to get off the freaking rune if they don't want to burn to death, though. target << "Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root." - target << "And you were able to force it out of your mind. You now know the truth, there's something horrible out there, stop it and its minions at all costs." - + target << "And you were able to force it out of your mind. You now know the truth, there's something horrible out there, stop it and its minions at all costs." + else spawn() var/choice = alert(target,"Do you want to join the cult?","Submit to Nar'Sie","Resist","Submit") waiting_for_input[target] = 0 @@ -172,7 +172,7 @@ var/list/sacrificed = list() target << "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back." converting -= target target.hallucination = 0 //sudden clarity - + sleep(100) //proc once every 10 seconds return 1 diff --git a/code/game/gamemodes/heist/heist.dm b/code/game/gamemodes/heist/heist.dm index 8157acc1a0..2166025cb3 100644 --- a/code/game/gamemodes/heist/heist.dm +++ b/code/game/gamemodes/heist/heist.dm @@ -111,7 +111,7 @@ var/global/list/obj/cortical_stacks = list() //Stacks for 'leave nobody behind' vox.h_style = "Short Vox Quills" vox.f_style = "Shaved" - for(var/datum/organ/external/limb in vox.organs) + for(var/obj/item/organ/external/limb in vox.organs) limb.status &= ~(ORGAN_DESTROYED | ORGAN_ROBOT) // Keep track of their stack. @@ -126,8 +126,8 @@ var/global/list/obj/cortical_stacks = list() //Stacks for 'leave nobody behind' if(cortical_stacks.len == 0) return 0 - for(var/datum/organ/internal/stack/vox/stack in cortical_stacks) - if(stack.organ_holder && get_area(stack.organ_holder) != locate(/area/shuttle/vox/station)) + for(var/obj/item/organ/stack/vox/stack in cortical_stacks) + if(stack && get_area(stack) != locate(/area/shuttle/vox/station)) return 0 return 1 diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 83fc1a9a85..64859854ae 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -456,7 +456,7 @@ datum/objective/harm return 0 var/mob/living/carbon/human/H = target.current - for(var/datum/organ/external/E in H.organs) + for(var/obj/item/organ/external/E in H.organs) if(E.status & ORGAN_BROKEN) already_completed = 1 return 1 @@ -464,7 +464,7 @@ datum/objective/harm already_completed = 1 return 1 - var/datum/organ/external/head/head = H.get_organ("head") + var/obj/item/organ/external/head/head = H.get_organ("head") if(head.disfigured) return 1 return 0 diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index f6ec2ad87d..360245ccf1 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -514,8 +514,8 @@ var/global/datum/controller/occupations/job_master H.internals.icon_state = "internal1" if(istype(H)) //give humans wheelchairs, if they need them. - var/datum/organ/external/l_foot = H.get_organ("l_foot") - var/datum/organ/external/r_foot = H.get_organ("r_foot") + var/obj/item/organ/external/l_foot = H.get_organ("l_foot") + var/obj/item/organ/external/r_foot = H.get_organ("r_foot") if((!l_foot || l_foot.status & ORGAN_DESTROYED) && (!r_foot || r_foot.status & ORGAN_DESTROYED)) var/obj/structure/bed/chair/wheelchair/W = new /obj/structure/bed/chair/wheelchair(H.loc) H.buckled = W diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index 98ebc5a626..25f977e1a7 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -346,7 +346,7 @@ dat += "Other Wounds" dat += "" - for(var/datum/organ/external/e in occ["external_organs"]) + for(var/obj/item/organ/external/e in occ["external_organs"]) var/AN = "" var/open = "" var/infected = "" @@ -362,7 +362,7 @@ for(var/datum/wound/W in e.wounds) if(W.internal) internal_bleeding = "
Internal bleeding" break - if(istype(e, /datum/organ/external/chest) && occ["lung_ruptured"]) + if(istype(e, /obj/item/organ/external/chest) && occ["lung_ruptured"]) lung_ruptured = "Lung ruptured:" if(e.status & ORGAN_SPLINTED) splint = "Splinted:" @@ -409,7 +409,7 @@ dat += "[e.display_name]--Not Found" dat += "" - for(var/datum/organ/internal/i in occ["internal_organs"]) + for(var/obj/item/organ/i in occ["internal_organs"]) var/mech = "" if(i.robotic == 1) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 41e88ae741..cce9a1af0d 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -593,7 +593,7 @@ About the new airlock wires panel: playsound(src.loc, 'sound/effects/bang.ogg', 25, 1) if(!istype(H.head, /obj/item/clothing/head/helmet)) visible_message("\red [user] headbutts the airlock.") - var/datum/organ/external/affecting = H.get_organ("head") + var/obj/item/organ/external/affecting = H.get_organ("head") H.Stun(8) H.Weaken(5) if(affecting.take_damage(10, 0)) diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm index 2ebefc8625..05279b2c2c 100644 --- a/code/game/machinery/flasher.dm +++ b/code/game/machinery/flasher.dm @@ -80,7 +80,7 @@ O.Weaken(strength) if (istype(O, /mob/living/carbon/human)) var/mob/living/carbon/human/H = O - var/datum/organ/internal/eyes/E = H.internal_organs_by_name["eyes"] + var/obj/item/organ/eyes/E = H.internal_organs_by_name["eyes"] if (E && (E.damage > E.min_bruised_damage && prob(E.damage + 50))) flick("e_flash", O:flash) E.damage += rand(1, 5) diff --git a/code/game/machinery/kitchen/gibber.dm b/code/game/machinery/kitchen/gibber.dm index 52c1bdc380..14f8ef007e 100644 --- a/code/game/machinery/kitchen/gibber.dm +++ b/code/game/machinery/kitchen/gibber.dm @@ -229,7 +229,7 @@ for (var/obj/thing in contents) // Todo: unify limbs and internal organs // There's a chance that the gibber will fail to destroy some evidence. - if((istype(thing,/obj/item/weapon/organ) || istype(thing,/obj/item/organ)) && prob(80)) + if((istype(thing,/obj/item/organ) || istype(thing,/obj/item/organ)) && prob(80)) del(thing) continue thing.loc = get_turf(thing) // Drop it onto the turf for throwing. diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm index f8ae293bba..42124ef516 100644 --- a/code/game/machinery/suit_storage_unit.dm +++ b/code/game/machinery/suit_storage_unit.dm @@ -331,7 +331,7 @@ sleep(50) if(src.OCCUPANT) OCCUPANT.radiation += 50 - var/datum/organ/internal/diona/nutrients/rad_organ = locate() in OCCUPANT.internal_organs + var/obj/item/organ/diona/nutrients/rad_organ = locate() in OCCUPANT.internal_organs if (!rad_organ) if(src.issuperUV) var/burndamage = rand(28,35) diff --git a/code/game/mecha/combat/combat.dm b/code/game/mecha/combat/combat.dm index f75bd01ac4..6aee97814a 100644 --- a/code/game/mecha/combat/combat.dm +++ b/code/game/mecha/combat/combat.dm @@ -41,7 +41,7 @@ var/mob/living/carbon/human/H = target // if (M.health <= 0) return - var/datum/organ/external/temp = H.get_organ(pick("chest", "chest", "chest", "head")) + var/obj/item/organ/external/temp = H.get_organ(pick("chest", "chest", "chest", "head")) if(temp) var/update = 0 switch(damtype) diff --git a/code/game/objects/effects/aliens.dm b/code/game/objects/effects/aliens.dm index cdc7b26bbf..840d779510 100644 --- a/code/game/objects/effects/aliens.dm +++ b/code/game/objects/effects/aliens.dm @@ -113,7 +113,7 @@ // Aliens can get straight through these. if(istype(usr,/mob/living/carbon)) var/mob/living/carbon/M = usr - if(locate(/datum/organ/internal/xenos/hivenode) in M.internal_organs) + if(locate(/obj/item/organ/xenos/hivenode) in M.internal_organs) for(var/mob/O in oviewers(src)) O.show_message("\red [usr] strokes the [name] and it melts away!", 1) health = 0 @@ -355,7 +355,7 @@ Alien plants should do something if theres a lot of poison /obj/effect/alien/egg/attack_hand(user as mob) var/mob/living/carbon/M = user - if(!istype(M) || !(locate(/datum/organ/internal/xenos/hivenode) in M.internal_organs)) + if(!istype(M) || !(locate(/obj/item/organ/xenos/hivenode) in M.internal_organs)) return attack_hand(user) switch(status) diff --git a/code/game/objects/effects/decals/Cleanable/humans.dm b/code/game/objects/effects/decals/Cleanable/humans.dm index db86bf36a1..c6b3137806 100644 --- a/code/game/objects/effects/decals/Cleanable/humans.dm +++ b/code/game/objects/effects/decals/Cleanable/humans.dm @@ -51,8 +51,8 @@ var/global/list/image/splatter_cache=list() if(amount < 1) return - var/datum/organ/external/l_foot = perp.get_organ("l_foot") - var/datum/organ/external/r_foot = perp.get_organ("r_foot") + var/obj/item/organ/external/l_foot = perp.get_organ("l_foot") + var/obj/item/organ/external/r_foot = perp.get_organ("r_foot") var/hasfeet = 1 if((!l_foot || l_foot.status & ORGAN_DESTROYED) && (!r_foot || r_foot.status & ORGAN_DESTROYED)) hasfeet = 0 diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 8879eeb2b7..66d39e0868 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -119,7 +119,7 @@ /obj/item/attack_hand(mob/user as mob) if (!user) return if (hasorgans(user)) - var/datum/organ/external/temp = user:organs_by_name["r_hand"] + var/obj/item/organ/external/temp = user:organs_by_name["r_hand"] if (user.hand) temp = user:organs_by_name["l_hand"] if(temp && !temp.is_usable()) @@ -535,7 +535,7 @@ if(istype(M, /mob/living/carbon/human)) - var/datum/organ/internal/eyes/eyes = H.internal_organs_by_name["eyes"] + var/obj/item/organ/eyes/eyes = H.internal_organs_by_name["eyes"] if(M != user) for(var/mob/O in (viewers(M) - user - M)) @@ -563,7 +563,7 @@ if (eyes.damage >= eyes.min_broken_damage) if(M.stat != 2) M << "\red You go blind!" - var/datum/organ/external/affecting = M:get_organ("head") + var/obj/item/organ/external/affecting = M:get_organ("head") if(affecting.take_damage(7)) M:UpdateDamageIcon() else diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index 2825045fb2..c687014771 100755 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -1206,7 +1206,7 @@ var/global/list/obj/item/device/pda/PDAs = list() var/list/damaged = H.get_damaged_organs(1,1) user.show_message("\blue Localized Damage, Brute/Burn:",1) if(length(damaged)>0) - for(var/datum/organ/external/org in damaged) + for(var/obj/item/organ/external/org in damaged) user.show_message(text("\blue \t []: []\blue-[]",capitalize(org.display_name),(org.brute_dam > 0)?"\red [org.brute_dam]":0,(org.burn_dam > 0)?"\red [org.burn_dam]":0),1) else user.show_message("\blue \t Limbs are OK.",1) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index e0731443d5..ca8df7a48e 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -123,7 +123,7 @@ REAGENT SCANNER var/list/damaged = H.get_damaged_organs(1,1) user.show_message("\blue Localized Damage, Brute/Burn:",1) if(length(damaged)>0) - for(var/datum/organ/external/org in damaged) + for(var/obj/item/organ/external/org in damaged) user.show_message(text("\blue \t []: [][]\blue - []", \ "[capitalize(org.display_name)][org.status & ORGAN_ROBOT ? "(Cybernetic)" : ""]", \ (org.brute_dam > 0) ? "\red [org.brute_dam]" :0, \ @@ -180,7 +180,7 @@ REAGENT SCANNER if(ishuman(M)) var/mob/living/carbon/human/H = M for(var/name in H.organs_by_name) - var/datum/organ/external/e = H.organs_by_name[name] + var/obj/item/organ/external/e = H.organs_by_name[name] var/limb = e.display_name if(e.status & ORGAN_BROKEN) if(((e.name == "l_arm") || (e.name == "r_arm") || (e.name == "l_leg") || (e.name == "r_leg")) && (!(e.status & ORGAN_SPLINTED))) @@ -189,11 +189,11 @@ REAGENT SCANNER user << "\red Infected wound detected in subject [limb]. Disinfection recommended." for(var/name in H.organs_by_name) - var/datum/organ/external/e = H.organs_by_name[name] + var/obj/item/organ/external/e = H.organs_by_name[name] if(e.status & ORGAN_BROKEN) user.show_message(text("\red Bone fractures detected. Advanced scanner required for location."), 1) break - for(var/datum/organ/external/e in H.organs) + for(var/obj/item/organ/external/e in H.organs) for(var/datum/wound/W in e.wounds) if(W.internal) user.show_message(text("\red Internal bleeding detected. Advanced scanner required for location."), 1) break diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm index cdd385cd65..da9c5122b3 100644 --- a/code/game/objects/items/stacks/medical.dm +++ b/code/game/objects/items/stacks/medical.dm @@ -23,7 +23,7 @@ if (istype(M, /mob/living/carbon/human)) var/mob/living/carbon/human/H = M - var/datum/organ/external/affecting = H.get_organ(user.zone_sel.selecting) + var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting) if(affecting.display_name == "head") if(H.head && istype(H.head,/obj/item/clothing/head/helmet/space)) @@ -63,7 +63,7 @@ if (istype(M, /mob/living/carbon/human)) var/mob/living/carbon/human/H = M - var/datum/organ/external/affecting = H.get_organ(user.zone_sel.selecting) + var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting) if(affecting.open == 0) if(!affecting.bandage()) @@ -106,7 +106,7 @@ if (istype(M, /mob/living/carbon/human)) var/mob/living/carbon/human/H = M - var/datum/organ/external/affecting = H.get_organ(user.zone_sel.selecting) + var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting) if(affecting.open == 0) if(!affecting.salve()) @@ -154,7 +154,7 @@ if (istype(M, /mob/living/carbon/human)) var/mob/living/carbon/human/H = M - var/datum/organ/external/affecting = H.get_organ(user.zone_sel.selecting) + var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting) if(affecting.open == 0) var/bandaged = affecting.bandage() @@ -202,7 +202,7 @@ if (istype(M, /mob/living/carbon/human)) var/mob/living/carbon/human/H = M - var/datum/organ/external/affecting = H.get_organ(user.zone_sel.selecting) + var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting) if(affecting.open == 0) if(!affecting.salve()) @@ -233,7 +233,7 @@ if (istype(M, /mob/living/carbon/human)) var/mob/living/carbon/human/H = M - var/datum/organ/external/affecting = H.get_organ(user.zone_sel.selecting) + var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting) var/limb = affecting.display_name if(!((affecting.name == "l_arm") || (affecting.name == "r_arm") || (affecting.name == "l_leg") || (affecting.name == "r_leg"))) user << "\red You can't apply a splint there!" diff --git a/code/game/objects/items/stacks/nanopaste.dm b/code/game/objects/items/stacks/nanopaste.dm index 798c6c0511..2e422ea1a9 100644 --- a/code/game/objects/items/stacks/nanopaste.dm +++ b/code/game/objects/items/stacks/nanopaste.dm @@ -25,7 +25,7 @@ if (istype(M,/mob/living/carbon/human)) //Repairing robolimbs var/mob/living/carbon/human/H = M - var/datum/organ/external/S = H.get_organ(user.zone_sel.selecting) + var/obj/item/organ/external/S = H.get_organ(user.zone_sel.selecting) if(S.open == 1) if (S && (S.status & ORGAN_ROBOT)) diff --git a/code/game/objects/items/weapons/autopsy.dm b/code/game/objects/items/weapons/autopsy.dm index d78c7d4093..1ecbedae7d 100644 --- a/code/game/objects/items/weapons/autopsy.dm +++ b/code/game/objects/items/weapons/autopsy.dm @@ -37,7 +37,7 @@ W.time_inflicted = time_inflicted return W -/obj/item/weapon/autopsy_scanner/proc/add_data(var/datum/organ/external/O) +/obj/item/weapon/autopsy_scanner/proc/add_data(var/obj/item/organ/external/O) if(!O.autopsy_data.len && !O.trace_chemicals.len) return for(var/V in O.autopsy_data) @@ -191,7 +191,7 @@ src.timeofdeath = M.timeofdeath - var/datum/organ/external/S = M.get_organ(user.zone_sel.selecting) + var/obj/item/organ/external/S = M.get_organ(user.zone_sel.selecting) if(!S) usr << "You can't scan this body part." return diff --git a/code/game/objects/items/weapons/grenades/flashbang.dm b/code/game/objects/items/weapons/grenades/flashbang.dm index bda28f83b1..03d8ccdffc 100644 --- a/code/game/objects/items/weapons/grenades/flashbang.dm +++ b/code/game/objects/items/weapons/grenades/flashbang.dm @@ -84,7 +84,7 @@ //This really should be in mob not every check if(ishuman(M)) var/mob/living/carbon/human/H = M - var/datum/organ/internal/eyes/E = H.internal_organs_by_name["eyes"] + var/obj/item/organ/eyes/E = H.internal_organs_by_name["eyes"] if (E && E.damage >= E.min_bruised_damage) M << "\red Your eyes start to burn badly!" if(!banglet && !(istype(src , /obj/item/weapon/grenade/flashbang/clusterbang))) diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm index 5ed83d086b..8317689c78 100644 --- a/code/game/objects/items/weapons/handcuffs.dm +++ b/code/game/objects/items/weapons/handcuffs.dm @@ -93,7 +93,7 @@ var/last_chew = 0 if (H.wear_mask) return if (istype(H.wear_suit, /obj/item/clothing/suit/straight_jacket)) return - var/datum/organ/external/O = H.organs_by_name[H.hand?"l_hand":"r_hand"] + var/obj/item/organ/external/O = H.organs_by_name[H.hand?"l_hand":"r_hand"] if (!O) return var/s = "\red [H.name] chews on \his [O.display_name]!" diff --git a/code/game/objects/items/weapons/implants/implant.dm b/code/game/objects/items/weapons/implants/implant.dm index c45ed4eac8..b5a2ec4b0e 100644 --- a/code/game/objects/items/weapons/implants/implant.dm +++ b/code/game/objects/items/weapons/implants/implant.dm @@ -8,7 +8,7 @@ icon_state = "implant" var/implanted = null var/mob/imp_in = null - var/datum/organ/external/part = null + var/obj/item/organ/external/part = null item_color = "b" var/allow_reagents = 0 var/malfunction = 0 @@ -174,9 +174,9 @@ Implant Specifics:
"} imp_in.visible_message("\red Something beeps inside [imp_in][part ? "'s [part.display_name]" : ""]!") playsound(loc, 'sound/items/countdown.ogg', 75, 1, -3) sleep(25) - if (istype(part,/datum/organ/external/chest) || \ - istype(part,/datum/organ/external/groin) || \ - istype(part,/datum/organ/external/head)) + if (istype(part,/obj/item/organ/external/chest) || \ + istype(part,/obj/item/organ/external/groin) || \ + istype(part,/obj/item/organ/external/head)) part.createwound(BRUISE, 60) //mangle them instead explosion(get_turf(imp_in), -1, -1, 2, 3) del(src) @@ -242,9 +242,9 @@ Implant Specifics:
"} if (ishuman(imp_in) && part) //No tearing off these parts since it's pretty much killing //and you can't replace groins - if (istype(part,/datum/organ/external/chest) || \ - istype(part,/datum/organ/external/groin) || \ - istype(part,/datum/organ/external/head)) + if (istype(part,/obj/item/organ/external/chest) || \ + istype(part,/obj/item/organ/external/groin) || \ + istype(part,/obj/item/organ/external/head)) part.createwound(BRUISE, 60) //mangle them instead else part.droplimb(1) diff --git a/code/game/objects/items/weapons/implants/implanter.dm b/code/game/objects/items/weapons/implants/implanter.dm index 6d6e5ad4cb..b274c9aeb5 100644 --- a/code/game/objects/items/weapons/implants/implanter.dm +++ b/code/game/objects/items/weapons/implants/implanter.dm @@ -43,7 +43,7 @@ src.imp.implanted = 1 if (ishuman(M)) var/mob/living/carbon/human/H = M - var/datum/organ/external/affected = H.get_organ(user.zone_sel.selecting) + var/obj/item/organ/external/affected = H.get_organ(user.zone_sel.selecting) affected.implants += src.imp imp.part = affected diff --git a/code/game/objects/items/weapons/melee/energy.dm b/code/game/objects/items/weapons/melee/energy.dm index 1b1d5b04f3..f04c3452a9 100644 --- a/code/game/objects/items/weapons/melee/energy.dm +++ b/code/game/objects/items/weapons/melee/energy.dm @@ -207,7 +207,7 @@ if(istype(loc,/mob/living)) var/mob/living/carbon/human/host = loc if(istype(host)) - for(var/datum/organ/external/organ in host.organs) + for(var/obj/item/organ/external/organ in host.organs) for(var/obj/item/O in organ.implants) if(O == src) organ.implants -= src diff --git a/code/game/objects/items/weapons/shards.dm b/code/game/objects/items/weapons/shards.dm index a4fc0081c2..6b48653a6a 100644 --- a/code/game/objects/items/weapons/shards.dm +++ b/code/game/objects/items/weapons/shards.dm @@ -80,7 +80,7 @@ return if( !H.shoes && ( !H.wear_suit || !(H.wear_suit.body_parts_covered & FEET) ) ) - var/datum/organ/external/affecting = H.get_organ(pick("l_foot", "r_foot")) + var/obj/item/organ/external/affecting = H.get_organ(pick("l_foot", "r_foot")) if(affecting.status & ORGAN_ROBOT) return if(affecting.take_damage(5, 0)) diff --git a/code/game/objects/items/weapons/storage/bible.dm b/code/game/objects/items/weapons/storage/bible.dm index 822b986488..ee23889052 100644 --- a/code/game/objects/items/weapons/storage/bible.dm +++ b/code/game/objects/items/weapons/storage/bible.dm @@ -26,7 +26,7 @@ if(ishuman(M)) var/mob/living/carbon/human/H = M var/heal_amt = 10 - for(var/datum/organ/external/affecting in H.organs) + for(var/obj/item/organ/external/affecting in H.organs) if(affecting.heal_damage(heal_amt, heal_amt)) H.UpdateDamageIcon() return diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm index 62890d849c..ee3617bc55 100644 --- a/code/game/objects/items/weapons/stunbaton.dm +++ b/code/game/objects/items/weapons/stunbaton.dm @@ -53,7 +53,7 @@ /obj/item/weapon/melee/baton/examine(mob/user) if(!..(user, 1)) return - + if(bcell) user <<"The baton is [round(bcell.percent())]% charged." if(!bcell) @@ -133,7 +133,7 @@ return 0 var/mob/living/carbon/human/H = L - var/datum/organ/external/affecting = H.get_organ(target_zone) + var/obj/item/organ/external/affecting = H.get_organ(target_zone) if (affecting) if(!status) L.visible_message("[L] has been prodded in the [affecting.display_name] with [src] by [user]. Luckily it was off.") diff --git a/code/game/objects/items/weapons/teleportation.dm b/code/game/objects/items/weapons/teleportation.dm index d8c811d2f6..20d96676ed 100644 --- a/code/game/objects/items/weapons/teleportation.dm +++ b/code/game/objects/items/weapons/teleportation.dm @@ -79,7 +79,7 @@ Frequency: src.temp += "Extranneous Signals:
" for (var/obj/item/weapon/implant/tracking/W in world) - if (!W.implanted || !(istype(W.loc,/datum/organ/external) || ismob(W.loc))) + if (!W.implanted || !(istype(W.loc,/obj/item/organ/external) || ismob(W.loc))) continue else var/mob/M = W.loc diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm index ee56415be7..4310e7ff75 100644 --- a/code/game/objects/items/weapons/tools.dm +++ b/code/game/objects/items/weapons/tools.dm @@ -362,7 +362,7 @@ var/safety = user:eyecheck() if(istype(user, /mob/living/carbon/human)) var/mob/living/carbon/human/H = user - var/datum/organ/internal/eyes/E = H.internal_organs_by_name["eyes"] + var/obj/item/organ/eyes/E = H.internal_organs_by_name["eyes"] if(!E) return if(H.species.flags & IS_SYNTHETIC) @@ -457,7 +457,7 @@ if(hasorgans(M)) - var/datum/organ/external/S = M:organs_by_name[user.zone_sel.selecting] + var/obj/item/organ/external/S = M:organs_by_name[user.zone_sel.selecting] if (!S) return if(!(S.status & ORGAN_ROBOT) || user.a_intent != "help") diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index a23bb65cf8..2a998998fa 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -133,7 +133,7 @@ M.adjustBruteLoss(damage) return - var/datum/organ/external/affecting + var/obj/item/organ/external/affecting switch(pick(list("ankle","wrist","head","knee","elbow"))) if("ankle") diff --git a/code/game/objects/structures/extinguisher.dm b/code/game/objects/structures/extinguisher.dm index 40ba963efd..6e049c8fdd 100644 --- a/code/game/objects/structures/extinguisher.dm +++ b/code/game/objects/structures/extinguisher.dm @@ -32,7 +32,7 @@ if(isrobot(user)) return if (hasorgans(user)) - var/datum/organ/external/temp = user:organs_by_name["r_hand"] + var/obj/item/organ/external/temp = user:organs_by_name["r_hand"] if (user.hand) temp = user:organs_by_name["l_hand"] if(temp && !temp.is_usable()) diff --git a/code/game/objects/structures/mineral_doors.dm b/code/game/objects/structures/mineral_doors.dm index 47d9f7289b..8ce25ddb67 100644 --- a/code/game/objects/structures/mineral_doors.dm +++ b/code/game/objects/structures/mineral_doors.dm @@ -249,7 +249,7 @@ TryToSwitchState(atom/user) var/mob/living/carbon/M = user - if(istype(M) && locate(/datum/organ/internal/xenos/hivenode) in M.internal_organs) + if(istype(M) && locate(/obj/item/organ/xenos/hivenode) in M.internal_organs) return ..() Open() diff --git a/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm b/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm index 489e81a739..fad0c3d0bd 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm @@ -45,10 +45,10 @@ var/mob/living/carbon/xenos = user var/mob/living/carbon/victim = M - if(istype(victim) && locate(/datum/organ/internal/xenos/hivenode) in victim.internal_organs) + if(istype(victim) && locate(/obj/item/organ/xenos/hivenode) in victim.internal_organs) return - if(istype(xenos) && !(locate(/datum/organ/internal/xenos/hivenode) in xenos.internal_organs)) + if(istype(xenos) && !(locate(/obj/item/organ/xenos/hivenode) in xenos.internal_organs)) return if(M == usr) diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index e77f1e602c..9d802a6454 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -347,7 +347,7 @@ /obj/structure/sink/attack_hand(mob/user as mob) if (hasorgans(user)) - var/datum/organ/external/temp = user:organs_by_name["r_hand"] + var/obj/item/organ/external/temp = user:organs_by_name["r_hand"] if (user.hand) temp = user:organs_by_name["l_hand"] if(temp && !temp.is_usable()) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 1f98e4ee3a..86101c774b 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1976,7 +1976,7 @@ if(!security) //strip their stuff before they teleport into a cell :downs: for(var/obj/item/weapon/W in H) - if(istype(W, /datum/organ/external)) + if(istype(W, /obj/item/organ/external)) continue //don't strip organs H.u_equip(W) diff --git a/code/modules/assembly/mousetrap.dm b/code/modules/assembly/mousetrap.dm index 7f7c3fe8e9..676ee17cd1 100644 --- a/code/modules/assembly/mousetrap.dm +++ b/code/modules/assembly/mousetrap.dm @@ -23,7 +23,7 @@ proc/triggered(mob/target as mob, var/type = "feet") if(!armed) return - var/datum/organ/external/affecting = null + var/obj/item/organ/external/affecting = null if(ishuman(target)) var/mob/living/carbon/human/H = target switch(type) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index bb5154797c..3e646980b9 100755 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1690,7 +1690,7 @@ datum/preferences for(var/name in organ_data) var/status = organ_data[name] - var/datum/organ/external/O = character.organs_by_name[name] + var/obj/item/organ/external/O = character.organs_by_name[name] if(O) if(status == "amputated") O.amputated = 1 @@ -1699,12 +1699,12 @@ datum/preferences else if(status == "cyborg") O.status |= ORGAN_ROBOT else - var/datum/organ/internal/I = character.internal_organs_by_name[name] + var/obj/item/organ/I = character.internal_organs_by_name[name] if(I) if(status == "assisted") I.mechassist() else if(status == "mechanical") - I.mechanize() + I.robotize() character.underwear = underwear diff --git a/code/modules/clothing/spacesuits/spacesuits.dm b/code/modules/clothing/spacesuits/spacesuits.dm index 7bf622b539..a597ffab99 100644 --- a/code/modules/clothing/spacesuits/spacesuits.dm +++ b/code/modules/clothing/spacesuits/spacesuits.dm @@ -76,7 +76,7 @@ // Some space suits are equipped with reactive membranes that support // broken limbs - at the time of writing, only the ninja suit, but // I can see it being useful for other suits as we expand them. ~ Z -// The actual splinting occurs in /datum/organ/external/proc/fracture() +// The actual splinting occurs in /obj/item/organ/external/proc/fracture() /obj/item/clothing/suit/space/proc/check_limb_support(var/mob/living/carbon/human/user) // If this isn't set, then we don't need to care. @@ -87,7 +87,7 @@ return // Otherwise, remove the splints. - for(var/datum/organ/external/E in supporting_limbs) + for(var/obj/item/organ/external/E in supporting_limbs) E.status &= ~ ORGAN_SPLINTED user << "The suit stops supporting your [E.display_name]." supporting_limbs = list() diff --git a/code/modules/genetics/side_effects.dm b/code/modules/genetics/side_effects.dm index e82bb3457f..f516b609ff 100644 --- a/code/modules/genetics/side_effects.dm +++ b/code/modules/genetics/side_effects.dm @@ -26,7 +26,7 @@ finish(mob/living/carbon/human/H) if(!H.reagents.has_reagent("dexalin")) for(var/organ_name in list("chest","l_arm","r_arm","r_leg","l_leg","head","groin")) - var/datum/organ/external/E = H.get_organ(organ_name) + var/obj/item/organ/external/E = H.get_organ(organ_name) E.take_damage(0, 5, 0) /datum/genetics/side_effect/bone_snap @@ -42,7 +42,7 @@ finish(mob/living/carbon/human/H) if(!H.reagents.has_reagent("bicaridine")) var/organ_name = pick("chest","l_arm","r_arm","r_leg","l_leg","head","groin") - var/datum/organ/external/E = H.get_organ(organ_name) + var/obj/item/organ/external/E = H.get_organ(organ_name) E.take_damage(20, 0, 0) E.fracture() diff --git a/code/modules/hydroponics/seed.dm b/code/modules/hydroponics/seed.dm index 59911fc30c..5a80ebb231 100644 --- a/code/modules/hydroponics/seed.dm +++ b/code/modules/hydroponics/seed.dm @@ -110,7 +110,7 @@ if(!target_limb) target_limb = pick("l_foot","r_foot","l_leg","r_leg","l_hand","r_hand","l_arm", "r_arm","head","chest","groin") - var/datum/organ/external/affecting = target.get_organ(target_limb) + var/obj/item/organ/external/affecting = target.get_organ(target_limb) var/damage = 0 if(get_trait(TRAIT_CARNIVOROUS)) diff --git a/code/modules/mob/language/outsider.dm b/code/modules/mob/language/outsider.dm index c03cb9a9d1..73653cbe7f 100644 --- a/code/modules/mob/language/outsider.dm +++ b/code/modules/mob/language/outsider.dm @@ -24,7 +24,7 @@ var/mob/living/carbon/M = other if(!istype(M)) return 1 - if(locate(/datum/organ/internal/xenos/hivenode) in M.internal_organs) + if(locate(/obj/item/organ/xenos/hivenode) in M.internal_organs) return 1 return 0 diff --git a/code/modules/mob/living/carbon/alien/larva/larva.dm b/code/modules/mob/living/carbon/alien/larva/larva.dm index 2369cb9fe5..5cdb3a2ddb 100644 --- a/code/modules/mob/living/carbon/alien/larva/larva.dm +++ b/code/modules/mob/living/carbon/alien/larva/larva.dm @@ -11,4 +11,4 @@ /mob/living/carbon/alien/larva/New() ..() add_language("Xenomorph") //Bonus language. - internal_organs += new /datum/organ/internal/xenos/hivenode(src) \ No newline at end of file + internal_organs += new /obj/item/organ/xenos/hivenode(src) \ No newline at end of file diff --git a/code/modules/mob/living/carbon/brain/brain_item.dm b/code/modules/mob/living/carbon/brain/brain_item.dm index 6ec6b4fce4..a240225846 100644 --- a/code/modules/mob/living/carbon/brain/brain_item.dm +++ b/code/modules/mob/living/carbon/brain/brain_item.dm @@ -10,11 +10,6 @@ throw_range = 5 origin_tech = "biotech=3" attack_verb = list("attacked", "slapped", "whacked") - prosthetic_name = "cyberbrain" - prosthetic_icon = "brain-prosthetic" - organ_tag = "brain" - organ_type = /datum/organ/internal/brain - var/mob/living/carbon/brain/brainmob = null /obj/item/organ/brain/xeno @@ -78,8 +73,6 @@ /obj/item/organ/brain/slime name = "slime core" desc = "A complex, organic knot of jelly and crystalline particles." - prosthetic_name = null - prosthetic_icon = null robotic = 2 icon = 'icons/mob/slimes.dmi' icon_state = "green slime extract" @@ -87,8 +80,6 @@ /obj/item/organ/brain/golem name = "chem" desc = "A tightly furled roll of paper, covered with indecipherable runes." - prosthetic_name = null - prosthetic_icon = null robotic = 2 icon = 'icons/obj/wizard.dmi' icon_state = "scroll" \ No newline at end of file diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 464fb3a055..ebdfd61e01 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -33,8 +33,8 @@ if(istype(src, /mob/living/carbon/human)) var/mob/living/carbon/human/H = src var/organ = H.get_organ("chest") - if (istype(organ, /datum/organ/external)) - var/datum/organ/external/temp = organ + if (istype(organ, /obj/item/organ/external)) + var/obj/item/organ/external/temp = organ if(temp.take_damage(d, 0)) H.UpdateDamageIcon() H.updatehealth() @@ -64,7 +64,7 @@ /mob/living/carbon/attack_hand(mob/M as mob) if(!istype(M, /mob/living/carbon)) return if (hasorgans(M)) - var/datum/organ/external/temp = M:organs_by_name["r_hand"] + var/obj/item/organ/external/temp = M:organs_by_name["r_hand"] if (M.hand) temp = M:organs_by_name["l_hand"] if(temp && !temp.is_usable()) @@ -158,7 +158,7 @@ "\blue You check yourself for injuries." \ ) - for(var/datum/organ/external/org in H.organs) + for(var/obj/item/organ/external/org in H.organs) var/status = "" var/brutedamage = org.brute_dam var/burndamage = org.burn_dam diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index 41140f2d3c..a0ff8da745 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -1,14 +1,14 @@ /mob/living/carbon/human/gib() - for(var/datum/organ/internal/I in internal_organs) + for(var/obj/item/organ/I in internal_organs) var/obj/item/organ/current_organ = I.remove() if(current_organ) if(istype(loc,/turf)) current_organ.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),30) current_organ.removed(src) - for(var/datum/organ/external/E in src.organs) - if(istype(E, /datum/organ/external/chest)) + for(var/obj/item/organ/external/E in src.organs) + if(istype(E, /obj/item/organ/external/chest)) continue // Only make the limb drop if it's not too damaged if(prob(100 - E.get_damage())) @@ -38,7 +38,7 @@ if(species) species.handle_death(src) //Handle brain slugs. - var/datum/organ/external/head = get_organ("head") + var/obj/item/organ/external/head = get_organ("head") var/mob/living/simple_animal/borer/B for(var/I in head.implants) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 277f88c809..75bc37c8fe 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -198,7 +198,7 @@ //splints for(var/organ in list("l_leg","r_leg","l_arm","r_arm")) - var/datum/organ/external/o = get_organ(organ) + var/obj/item/organ/external/o = get_organ(organ) if(o && o.status & ORGAN_SPLINTED) msg += "[t_He] [t_has] a splint on [t_his] [o.display_name]!\n" @@ -251,7 +251,7 @@ var/list/wound_flavor_text = list() var/list/is_destroyed = list() var/list/is_bleeding = list() - for(var/datum/organ/external/temp in organs) + for(var/obj/item/organ/external/temp in organs) if(temp) if(temp.status & ORGAN_DESTROYED) is_destroyed["[temp.display_name]"] = 1 diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index b95fbaf15c..e2a7c70fcc 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -65,7 +65,7 @@ stat("Tank Pressure", internal.air_contents.return_pressure()) stat("Distribution Pressure", internal.distribute_pressure) - var/datum/organ/internal/xenos/plasmavessel/P = internal_organs_by_name["plasma vessel"] + var/obj/item/organ/xenos/plasmavessel/P = internal_organs_by_name["plasma vessel"] if(P) stat(null, "Phoron Stored: [P.stored_plasma]/[P.max_plasma]") @@ -129,7 +129,7 @@ var/update = 0 // focus most of the blast on one organ - var/datum/organ/external/take_blast = pick(organs) + var/obj/item/organ/external/take_blast = pick(organs) update |= take_blast.take_damage(b_loss * 0.9, f_loss * 0.9, used_weapon = "Explosive blast") // distribute the remaining 10% on all limbs equally @@ -138,7 +138,7 @@ var/weapon_message = "Explosive Blast" - for(var/datum/organ/external/temp in organs) + for(var/obj/item/organ/external/temp in organs) switch(temp.name) if("head") update |= temp.take_damage(b_loss * 0.2, f_loss * 0.2, used_weapon = weapon_message) @@ -167,7 +167,7 @@ if(stat == 2) return show_message("\red The blob attacks you!") var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg") - var/datum/organ/external/affecting = get_organ(ran_zone(dam_zone)) + var/obj/item/organ/external/affecting = get_organ(ran_zone(dam_zone)) apply_damage(rand(30,40), BRUTE, affecting, run_armor_check(affecting, "melee")) return @@ -176,7 +176,7 @@ if ((M.client && !( M.blinded ))) M.show_message("\red [src] has been hit by [O]", 1) if (health > 0) - var/datum/organ/external/affecting = get_organ(pick("chest", "chest", "chest", "head")) + var/obj/item/organ/external/affecting = get_organ(pick("chest", "chest", "chest", "head")) if(!affecting) return if (istype(O, /obj/effect/immovablerod)) if(affecting.take_damage(101, 0)) @@ -193,14 +193,14 @@ var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(M) L.imp_in = M L.implanted = 1 - var/datum/organ/external/affected = M.organs_by_name["head"] + var/obj/item/organ/external/affected = M.organs_by_name["head"] affected.implants += L L.part = affected /mob/living/carbon/human/proc/is_loyalty_implanted(mob/living/carbon/human/M) for(var/L in M.contents) if(istype(L, /obj/item/weapon/implant/loyalty)) - for(var/datum/organ/external/O in M.organs) + for(var/obj/item/organ/external/O in M.organs) if(L in O.implants) return 1 return 0 @@ -325,7 +325,7 @@ //Returns "Unknown" if facially disfigured and real_name if not. Useful for setting name when polyacided or when updating a human's name variable /mob/living/carbon/human/proc/get_face_name() - var/datum/organ/external/head/head = get_organ("head") + var/obj/item/organ/external/head/head = get_organ("head") if( !head || head.disfigured || (head.status & ORGAN_DESTROYED) || !real_name || (HUSK in mutations) ) //disfigured. use id-name if possible return "Unknown" return real_name @@ -356,7 +356,7 @@ if (!def_zone) def_zone = pick("l_hand", "r_hand") - var/datum/organ/external/affected_organ = get_organ(check_zone(def_zone)) + var/obj/item/organ/external/affected_organ = get_organ(check_zone(def_zone)) var/siemens_coeff = base_siemens_coeff * get_siemens_coefficient_organ(affected_organ) return ..(shock_damage, source, siemens_coeff, def_zone) @@ -682,7 +682,7 @@ return 2 if(internal_organs_by_name["eyes"]) // Eyes are fucked, not a 'weak point'. - var/datum/organ/internal/I = internal_organs_by_name["eyes"] + var/obj/item/organ/I = internal_organs_by_name["eyes"] if(I.status & ORGAN_CUT_AWAY) return 2 else @@ -927,7 +927,7 @@ germ_level += n /mob/living/carbon/human/revive() - for (var/datum/organ/external/O in organs) + for (var/obj/item/organ/external/O in organs) O.status &= ~ORGAN_BROKEN O.status &= ~ORGAN_BLEEDING O.status &= ~ORGAN_SPLINTED @@ -939,7 +939,7 @@ O.wounds.Cut() O.heal_damage(1000,1000,1,1) - var/datum/organ/external/head/h = organs_by_name["head"] + var/obj/item/organ/external/head/h = organs_by_name["head"] h.disfigured = 0 if(species && !(species.flags & NO_BLOOD)) @@ -958,7 +958,7 @@ H.brainmob.mind.transfer_to(src) del(H) - for(var/datum/organ/internal/I in internal_organs) + for(var/obj/item/organ/I in internal_organs) I.damage = 0 for (var/datum/disease/virus in viruses) @@ -973,11 +973,11 @@ ..() /mob/living/carbon/human/proc/is_lung_ruptured() - var/datum/organ/internal/lungs/L = internal_organs_by_name["lungs"] + var/obj/item/organ/lungs/L = internal_organs_by_name["lungs"] return L && L.is_bruised() /mob/living/carbon/human/proc/rupture_lung() - var/datum/organ/internal/lungs/L = internal_organs_by_name["lungs"] + var/obj/item/organ/lungs/L = internal_organs_by_name["lungs"] if(L && !L.is_bruised()) src.custom_pain("You feel a stabbing pain in your chest!", 1) @@ -1038,7 +1038,7 @@ /mob/living/carbon/human/get_visible_implants(var/class = 0) var/list/visible_implants = list() - for(var/datum/organ/external/organ in src.organs) + for(var/obj/item/organ/external/organ in src.organs) for(var/obj/item/weapon/O in organ.implants) if(!istype(O,/obj/item/weapon/implant) && (O.w_class > class) && !istype(O,/obj/item/weapon/shard/shrapnel)) visible_implants += O @@ -1047,7 +1047,7 @@ /mob/living/carbon/human/proc/handle_embedded_objects() - for(var/datum/organ/external/organ in src.organs) + for(var/obj/item/organ/external/organ in src.organs) if(organ.status & ORGAN_SPLINTED) //Splints prevent movement. continue for(var/obj/item/weapon/O in organ.implants) @@ -1293,14 +1293,14 @@ /mob/living/carbon/human/has_brain() if(internal_organs_by_name["brain"]) - var/datum/organ/internal/brain = internal_organs_by_name["brain"] + var/obj/item/organ/brain = internal_organs_by_name["brain"] if(brain && istype(brain)) return 1 return 0 /mob/living/carbon/human/has_eyes() if(internal_organs_by_name["eyes"]) - var/datum/organ/internal/eyes = internal_organs_by_name["eyes"] + var/obj/item/organ/eyes = internal_organs_by_name["eyes"] if(eyes && istype(eyes) && !eyes.status & ORGAN_CUT_AWAY) return 1 return 0 @@ -1309,3 +1309,58 @@ if((species.flags & NO_SLIP) || (shoes && (shoes.flags & NOSLIP))) return 0 ..(slipped_on,stun_duration) + +/mob/living/carbon/human/proc/undislocate() + set category = "Object" + set name = "Undislocate Joint" + set desc = "Pop a joint back into place. Extremely painful." + set src in view(1) + + if(!isliving(usr) || usr.next_move > world.time) + return + usr.next_move = world.time + 20 + + if(usr.stat > 0) + usr << "You are unconcious and cannot do that!" + return + + if(usr.restrained()) + usr << "You are restrained and cannot do that!" + return + + var/mob/S = src + var/mob/U = usr + var/self = null + + if(S == U) + self = 1 // Removing object from yourself. + + var/list/limbs = list() + for(var/limb in organs_by_name) + var/obj/item/organ/external/current_limb = organs_by_name[limb] + if(current_limb.dislocated == 2) + limbs |= limb + + var/choice = input(src,"Which joint do you wish to relocate?") as null|anything in limbs + + if(!choice) + return + + var/obj/item/organ/external/current_limb = organs_by_name[choice] + + if(self) + src << "You brace yourself to relocate your [current_limb.joint]..." + else + U << "You begin to relocate [S]'s [current_limb.joint]..." + + if(!do_after(U, 30)) + return + if(!choice || !current_limb || !S || !U) + return + + if(self) + src << "You pop your [current_limb.joint] back in!" + else + U << "You pop [S]'s [current_limb.joint] back in!" + S << "[U] pops your [current_limb.joint] back in!" + current_limb.undislocate() diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index 23f90946bc..7fb1fc6058 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -2,7 +2,7 @@ var/mob/living/carbon/human/H = M if(istype(H)) - var/datum/organ/external/temp = H.organs_by_name["r_hand"] + var/obj/item/organ/external/temp = H.organs_by_name["r_hand"] if(H.hand) temp = H.organs_by_name["l_hand"] if(temp && !temp.is_usable()) @@ -24,7 +24,7 @@ playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1) visible_message("\red [H] has attempted to punch [src]!") return 0 - var/datum/organ/external/affecting = get_organ(ran_zone(H.zone_sel.selecting)) + var/obj/item/organ/external/affecting = get_organ(ran_zone(H.zone_sel.selecting)) var/armor_block = run_armor_check(affecting, "melee") if(HULK in H.mutations) @@ -98,7 +98,7 @@ var/block = 0 var/accurate = 0 var/hit_zone = H.zone_sel.selecting - var/datum/organ/external/affecting = get_organ(hit_zone) + var/obj/item/organ/external/affecting = get_organ(hit_zone) switch(src.a_intent) if("help") @@ -208,7 +208,7 @@ if(w_uniform) w_uniform.add_fingerprint(M) - var/datum/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting)) + var/obj/item/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting)) if(istype(r_hand,/obj/item/weapon/gun) || istype(l_hand,/obj/item/weapon/gun)) var/obj/item/weapon/gun/W = null @@ -291,8 +291,20 @@ src.visible_message("[user] has [attack_message] [src]!") var/dam_zone = pick("head", "chest", "l_arm", "r_arm", "l_leg", "r_leg", "groin") - var/datum/organ/external/affecting = get_organ(ran_zone(dam_zone)) + var/obj/item/organ/external/affecting = get_organ(ran_zone(dam_zone)) var/armor_block = run_armor_check(affecting, "melee") apply_damage(damage, BRUTE, affecting, armor_block) updatehealth() return 1 + +/mob/living/carbon/human/proc/attack_joint(var/obj/item/W, var/mob/living/user, var/def_zone) + + var/obj/item/organ/external/organ = get_organ(check_zone(def_zone)) + if(!organ || organ.is_dislocated() || organ.dislocated == -1) //Cannot dislocate this organ. + return 0 + + user.visible_message("[src] has been [pick(W.attack_verb)] in \the [organ] with \the [W] by [user]!") + if(prob(W.force)) + user.visible_message("[src]'s [organ.joint] [pick("gives way","caves in","crumbles","collapses")] with a grisly crunch!") + organ.dislocate() + return 1 diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index 561659a27a..41f6b0681f 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -7,7 +7,7 @@ return var/total_burn = 0 var/total_brute = 0 - for(var/datum/organ/external/O in organs) //hardcoded to streamline things a bit + for(var/obj/item/organ/external/O in organs) //hardcoded to streamline things a bit total_brute += O.brute_dam total_burn += O.burn_dam @@ -27,7 +27,7 @@ if(status_flags & GODMODE) return 0 //godmode if(species && species.has_organ["brain"]) - var/datum/organ/internal/brain/sponge = internal_organs_by_name["brain"] + var/obj/item/organ/brain/sponge = internal_organs_by_name["brain"] if(sponge) sponge.take_damage(amount) sponge.damage = min(max(brainloss, 0),(maxHealth*2)) @@ -42,7 +42,7 @@ if(status_flags & GODMODE) return 0 //godmode if(species && species.has_organ["brain"]) - var/datum/organ/internal/brain/sponge = internal_organs_by_name["brain"] + var/obj/item/organ/brain/sponge = internal_organs_by_name["brain"] if(sponge) sponge.damage = min(max(amount, 0),(maxHealth*2)) brainloss = sponge.damage @@ -56,7 +56,7 @@ if(status_flags & GODMODE) return 0 //godmode if(species && species.has_organ["brain"]) - var/datum/organ/internal/brain/sponge = internal_organs_by_name["brain"] + var/obj/item/organ/brain/sponge = internal_organs_by_name["brain"] if(sponge) brainloss = min(sponge.damage,maxHealth*2) else @@ -68,13 +68,13 @@ //These procs fetch a cumulative total damage from all organs /mob/living/carbon/human/getBruteLoss() var/amount = 0 - for(var/datum/organ/external/O in organs) + for(var/obj/item/organ/external/O in organs) amount += O.brute_dam return amount /mob/living/carbon/human/getFireLoss() var/amount = 0 - for(var/datum/organ/external/O in organs) + for(var/obj/item/organ/external/O in organs) amount += O.burn_dam return amount @@ -104,7 +104,7 @@ amount = amount*species.brute_mod if (organ_name in organs_by_name) - var/datum/organ/external/O = get_organ(organ_name) + var/obj/item/organ/external/O = get_organ(organ_name) if(amount > 0) O.take_damage(amount, 0, sharp=is_sharp(damage_source), edge=has_edge(damage_source), used_weapon=damage_source) @@ -119,7 +119,7 @@ amount = amount*species.burn_mod if (organ_name in organs_by_name) - var/datum/organ/external/O = get_organ(organ_name) + var/obj/item/organ/external/O = get_organ(organ_name) if(amount > 0) O.take_damage(0, amount, sharp=is_sharp(damage_source), edge=has_edge(damage_source), used_weapon=damage_source) @@ -163,25 +163,25 @@ var/mut_prob = min(80, getCloneLoss()+10) if (amount > 0) if (prob(mut_prob)) - var/list/datum/organ/external/candidates = list() - for (var/datum/organ/external/O in organs) + var/list/obj/item/organ/external/candidates = list() + for (var/obj/item/organ/external/O in organs) if(!(O.status & ORGAN_MUTATED)) candidates |= O if (candidates.len) - var/datum/organ/external/O = pick(candidates) + var/obj/item/organ/external/O = pick(candidates) O.mutate() src << "Something is not right with your [O.display_name]..." return else if (prob(heal_prob)) - for (var/datum/organ/external/O in organs) + for (var/obj/item/organ/external/O in organs) if (O.status & ORGAN_MUTATED) O.unmutate() src << "Your [O.display_name] is shaped normally again." return if (getCloneLoss() < 1) - for (var/datum/organ/external/O in organs) + for (var/obj/item/organ/external/O in organs) if (O.status & ORGAN_MUTATED) O.unmutate() src << "Your [O.display_name] is shaped normally again." @@ -226,16 +226,16 @@ //Returns a list of damaged organs /mob/living/carbon/human/proc/get_damaged_organs(var/brute, var/burn) - var/list/datum/organ/external/parts = list() - for(var/datum/organ/external/O in organs) + var/list/obj/item/organ/external/parts = list() + for(var/obj/item/organ/external/O in organs) if((brute && O.brute_dam) || (burn && O.burn_dam)) parts += O return parts //Returns a list of damageable organs /mob/living/carbon/human/proc/get_damageable_organs() - var/list/datum/organ/external/parts = list() - for(var/datum/organ/external/O in organs) + var/list/obj/item/organ/external/parts = list() + for(var/obj/item/organ/external/O in organs) if(O.brute_dam + O.burn_dam < O.max_damage) parts += O return parts @@ -244,9 +244,9 @@ //It automatically updates damage overlays if necesary //It automatically updates health status /mob/living/carbon/human/heal_organ_damage(var/brute, var/burn) - var/list/datum/organ/external/parts = get_damaged_organs(brute,burn) + var/list/obj/item/organ/external/parts = get_damaged_organs(brute,burn) if(!parts.len) return - var/datum/organ/external/picked = pick(parts) + var/obj/item/organ/external/picked = pick(parts) if(picked.heal_damage(brute,burn)) UpdateDamageIcon() BITSET(hud_updateflag, HEALTH_HUD) @@ -260,9 +260,9 @@ In most cases it makes more sense to use apply_damage() instead! And make sure t //It automatically updates damage overlays if necesary //It automatically updates health status /mob/living/carbon/human/take_organ_damage(var/brute, var/burn, var/sharp = 0, var/edge = 0) - var/list/datum/organ/external/parts = get_damageable_organs() + var/list/obj/item/organ/external/parts = get_damageable_organs() if(!parts.len) return - var/datum/organ/external/picked = pick(parts) + var/obj/item/organ/external/picked = pick(parts) if(picked.take_damage(brute,burn,sharp,edge)) UpdateDamageIcon() BITSET(hud_updateflag, HEALTH_HUD) @@ -272,11 +272,11 @@ In most cases it makes more sense to use apply_damage() instead! And make sure t //Heal MANY external organs, in random order /mob/living/carbon/human/heal_overall_damage(var/brute, var/burn) - var/list/datum/organ/external/parts = get_damaged_organs(brute,burn) + var/list/obj/item/organ/external/parts = get_damaged_organs(brute,burn) var/update = 0 while(parts.len && (brute>0 || burn>0) ) - var/datum/organ/external/picked = pick(parts) + var/obj/item/organ/external/picked = pick(parts) var/brute_was = picked.brute_dam var/burn_was = picked.burn_dam @@ -295,10 +295,10 @@ In most cases it makes more sense to use apply_damage() instead! And make sure t // damage MANY external organs, in random order /mob/living/carbon/human/take_overall_damage(var/brute, var/burn, var/sharp = 0, var/edge = 0, var/used_weapon = null) if(status_flags & GODMODE) return //godmode - var/list/datum/organ/external/parts = get_damageable_organs() + var/list/obj/item/organ/external/parts = get_damageable_organs() var/update = 0 while(parts.len && (brute>0 || burn>0) ) - var/datum/organ/external/picked = pick(parts) + var/obj/item/organ/external/picked = pick(parts) var/brute_was = picked.brute_dam var/burn_was = picked.burn_dam @@ -328,12 +328,12 @@ This function restores the subjects blood to max. This function restores all organs. */ /mob/living/carbon/human/restore_all_organs() - for(var/datum/organ/external/current_organ in organs) + for(var/obj/item/organ/external/current_organ in organs) current_organ.rejuvenate() /mob/living/carbon/human/proc/HealDamage(zone, brute, burn) - var/datum/organ/external/E = get_organ(zone) - if(istype(E, /datum/organ/external)) + var/obj/item/organ/external/E = get_organ(zone) + if(istype(E, /obj/item/organ/external)) if (E.heal_damage(brute, burn)) UpdateDamageIcon() BITSET(hud_updateflag, HEALTH_HUD) @@ -366,7 +366,7 @@ This function restores all organs. if(blocked >= 2) return 0 - var/datum/organ/external/organ = null + var/obj/item/organ/external/organ = null if(isorgan(def_zone)) organ = def_zone else diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 83076373e4..d9eb35c80a 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -10,7 +10,7 @@ emp_act /mob/living/carbon/human/bullet_act(var/obj/item/projectile/P, var/def_zone) - var/datum/organ/external/organ = get_organ(check_zone(def_zone)) + var/obj/item/organ/external/organ = get_organ(check_zone(def_zone)) //Shields if(check_shields(P.damage, "the [P.name]")) @@ -50,7 +50,7 @@ emp_act return (..(P , def_zone)) /mob/living/carbon/human/stun_effect_act(var/stun_amount, var/agony_amount, var/def_zone) - var/datum/organ/external/affected = get_organ(check_zone(def_zone)) + var/obj/item/organ/external/affected = get_organ(check_zone(def_zone)) var/siemens_coeff = get_siemens_coefficient_organ(affected) stun_amount *= siemens_coeff agony_amount *= siemens_coeff @@ -84,21 +84,21 @@ emp_act if(def_zone) if(isorgan(def_zone)) return getarmor_organ(def_zone, type) - var/datum/organ/external/affecting = get_organ(def_zone) + var/obj/item/organ/external/affecting = get_organ(def_zone) return getarmor_organ(affecting, type) //If a specific bodypart is targetted, check how that bodypart is protected and return the value. //If you don't specify a bodypart, it checks ALL your bodyparts for protection, and averages out the values for(var/organ_name in organs_by_name) if (organ_name in organ_rel_size) - var/datum/organ/external/organ = organs_by_name[organ_name] + var/obj/item/organ/external/organ = organs_by_name[organ_name] var/weight = organ_rel_size[organ_name] armorval += getarmor_organ(organ, type) * weight total += weight return (armorval/max(total, 1)) //this proc returns the Siemens coefficient of electrical resistivity for a particular external organ. -/mob/living/carbon/human/proc/get_siemens_coefficient_organ(var/datum/organ/external/def_zone) +/mob/living/carbon/human/proc/get_siemens_coefficient_organ(var/obj/item/organ/external/def_zone) if (!def_zone) return 1.0 @@ -112,7 +112,7 @@ emp_act return siemens_coefficient //this proc returns the armour value for a particular external organ. -/mob/living/carbon/human/proc/getarmor_organ(var/datum/organ/external/def_zone, var/type) +/mob/living/carbon/human/proc/getarmor_organ(var/obj/item/organ/external/def_zone, var/type) if(!type) return 0 var/protection = 0 var/list/protective_gear = list(head, wear_mask, wear_suit, w_uniform, gloves, shoes) @@ -167,10 +167,10 @@ emp_act for(var/obj/O in src) if(!O) continue O.emp_act(severity) - for(var/datum/organ/external/O in organs) + for(var/obj/item/organ/external/O in organs) if(O.status & ORGAN_DESTROYED) continue O.emp_act(severity) - for(var/datum/organ/internal/I in O.internal_organs) + for(var/obj/item/organ/I in O.internal_organs) if(I.robotic == 0) continue I.emp_act(severity) ..() @@ -188,7 +188,7 @@ emp_act visible_message("\red [user] misses [src] with \the [I]!") return 0 - var/datum/organ/external/affecting = get_organ(target_zone) + var/obj/item/organ/external/affecting = get_organ(target_zone) if (!affecting) return 0 if(affecting.status & ORGAN_DESTROYED) @@ -330,7 +330,7 @@ emp_act if ((O.thrower != src) && check_shields(throw_damage, "[O]")) return - var/datum/organ/external/affecting = get_organ(zone) + var/obj/item/organ/external/affecting = get_organ(zone) var/hit_area = affecting.display_name src.visible_message("\red [src] has been hit in the [hit_area] by [O].") @@ -372,13 +372,13 @@ emp_act var/obj/item/I = O mass = I.w_class/THROWNOBJ_KNOCKBACK_DIVISOR var/momentum = speed*mass - + if(O.throw_source && momentum >= THROWNOBJ_KNOCKBACK_SPEED) var/dir = get_dir(O.throw_source, src) visible_message("\red [src] staggers under the impact!","\red You stagger under the impact!") src.throw_at(get_edge_target_turf(src,dir),1,momentum) - + if(!O || !src) return if(O.loc == src && O.sharp) //Projectile is embedded and suitable for pinning. @@ -392,8 +392,8 @@ emp_act /mob/living/carbon/human/embed(var/obj/O, var/def_zone=null) if(!def_zone) ..() - - var/datum/organ/external/affecting = get_organ(def_zone) + + var/obj/item/organ/external/affecting = get_organ(def_zone) if(affecting) affecting.embed(O) diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 155492a36b..749903dc2a 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -28,7 +28,7 @@ if(istype(buckled, /obj/structure/bed/chair/wheelchair)) for(var/organ_name in list("l_hand","r_hand","l_arm","r_arm")) - var/datum/organ/external/E = get_organ(organ_name) + var/obj/item/organ/external/E = get_organ(organ_name) if(!E || (E.status & ORGAN_DESTROYED)) tally += 4 if(E.status & ORGAN_SPLINTED) @@ -40,7 +40,7 @@ tally += shoes.slowdown for(var/organ_name in list("l_foot","r_foot","l_leg","r_leg")) - var/datum/organ/external/E = get_organ(organ_name) + var/obj/item/organ/external/E = get_organ(organ_name) if(!E || (E.status & ORGAN_DESTROYED)) tally += 4 if(E.status & ORGAN_SPLINTED) diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm new file mode 100644 index 0000000000..b377e6f46e --- /dev/null +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -0,0 +1,93 @@ +/mob/living/carbon/var/list/internal_organs = list() +/mob/living/carbon/human/var/list/organs = list() +/mob/living/carbon/human/var/list/organs_by_name = list() // map organ names to organs +/mob/living/carbon/human/var/list/internal_organs_by_name = list() // so internal organs have less ickiness too + +// Takes care of organ related updates, such as broken and missing limbs +/mob/living/carbon/human/proc/handle_organs() + + number_wounds = 0 + var/force_process = 0 + var/damage_this_tick = getBruteLoss() + getFireLoss() + getToxLoss() + if(damage_this_tick > last_dam) + force_process = 1 + last_dam = damage_this_tick + if(force_process) + bad_external_organs.Cut() + for(var/obj/item/organ/external/Ex in organs) + bad_external_organs += Ex + + //processing internal organs is pretty cheap, do that first. + for(var/obj/item/organ/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 + + for(var/obj/item/organ/external/E in bad_external_organs) + if(!E) + continue + if(!E.need_process()) + bad_external_organs -= E + continue + else + E.process() + number_wounds += E.number_wounds + + if (!lying && world.time - l_move_time < 15) + //Moving around with fractured ribs won't do you any good + if (E.is_broken() && E.internal_organs && prob(15)) + var/obj/item/organ/I = pick(E.internal_organs) + custom_pain("You feel broken bones moving in your [E.display_name]!", 1) + I.take_damage(rand(3,5)) + + //Moving makes open wounds get infected much faster + if (E.wounds.len) + for(var/datum/wound/W in E.wounds) + if (W.infection_check()) + W.germ_level += 1 + +/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/bed)) + return + + for (var/organ in list("l_leg","l_foot","r_leg","r_foot")) + var/obj/item/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(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. + +//Handles chem traces +/mob/living/carbon/human/proc/handle_trace_chems() + //New are added for reagents to random organs. + for(var/datum/reagent/A in reagents.reagent_list) + var/obj/item/organ/O = pick(organs) + O.trace_chemicals[A.name] = 100 \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index 44b212694e..fc6485c6f7 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -39,7 +39,7 @@ This saves us from having to call add_fingerprint() any time something is put in /mob/living/carbon/human/proc/has_organ(name) - var/datum/organ/external/O = organs_by_name[name] + var/obj/item/organ/external/O = organs_by_name[name] return (O && !(O.status & ORGAN_DESTROYED) ) @@ -411,7 +411,7 @@ This saves us from having to call add_fingerprint() any time something is put in if("splints") var/count = 0 for(var/organ in list("l_leg","r_leg","l_arm","r_arm")) - var/datum/organ/external/o = target.organs_by_name[organ] + var/obj/item/organ/external/o = target.organs_by_name[organ] if(o.status & ORGAN_SPLINTED) count = 1 break @@ -699,7 +699,7 @@ It can still be worn/put on as normal. if(can_reach_splints) for(var/organ in list("l_leg","r_leg","l_arm","r_arm")) - var/datum/organ/external/o = target.get_organ(organ) + var/obj/item/organ/external/o = target.get_organ(organ) if (o && o.status & ORGAN_SPLINTED) var/obj/item/W = new /obj/item/stack/medical/splint(amount=1) o.status &= ~ORGAN_SPLINTED diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 8a8621a8b7..6c742da3d3 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -273,7 +273,7 @@ radiation = Clamp(radiation,0,100) if (radiation) - var/datum/organ/internal/diona/nutrients/rad_organ = locate() in internal_organs + var/obj/item/organ/diona/nutrients/rad_organ = locate() in internal_organs if(rad_organ && !rad_organ.is_broken()) var/rads = radiation/25 radiation -= rads @@ -320,11 +320,11 @@ adjustToxLoss(damage * RADIATION_SPEED_COEFFICIENT) updatehealth() if(organs.len) - var/datum/organ/external/O = pick(organs) + var/obj/item/organ/external/O = pick(organs) if(istype(O)) O.add_autopsy_data("Radiation Poisoning", damage) /** breathing **/ - + handle_chemical_smoke(var/datum/gas_mixture/environment) if(wear_mask && (wear_mask.flags & BLOCK_GAS_SMOKE_EFFECT)) return @@ -385,7 +385,7 @@ // Lung damage increases the minimum safe pressure. if(species.has_organ["lungs"]) - var/datum/organ/internal/lungs/L = internal_organs_by_name["lungs"] + var/obj/item/organ/lungs/L = internal_organs_by_name["lungs"] if(!L) safe_pressure_min = INFINITY //No lungs, how are you breathing? else if(L.is_broken()) @@ -868,7 +868,7 @@ if(status_flags & GODMODE) return 0 //godmode - var/datum/organ/internal/diona/node/light_organ = locate() in internal_organs + var/obj/item/organ/diona/node/light_organ = locate() in internal_organs if(light_organ && !light_organ.is_broken()) var/light_amount = 0 //how much light there is in the place, affects receiving nutrition and healing if(isturf(loc)) //else, there's considered to be no light @@ -1495,7 +1495,7 @@ if(pulse == PULSE_NONE || !species.has_organ["heart"]) return - var/datum/organ/internal/heart/H = internal_organs_by_name["heart"] + var/obj/item/organ/heart/H = internal_organs_by_name["heart"] if(!H || H.robotic >=2 ) return diff --git a/code/modules/mob/living/carbon/human/species/outsider/vox.dm b/code/modules/mob/living/carbon/human/species/outsider/vox.dm index bf007450e3..e3f10cf92e 100644 --- a/code/modules/mob/living/carbon/human/species/outsider/vox.dm +++ b/code/modules/mob/living/carbon/human/species/outsider/vox.dm @@ -42,13 +42,13 @@ ) has_organ = list( - "heart" = /datum/organ/internal/heart, - "lungs" = /datum/organ/internal/lungs, - "liver" = /datum/organ/internal/liver, - "kidneys" = /datum/organ/internal/kidney, - "brain" = /datum/organ/internal/brain, - "eyes" = /datum/organ/internal/eyes, - "stack" = /datum/organ/internal/stack/vox + "heart" = /obj/item/organ/heart, + "lungs" = /obj/item/organ/lungs, + "liver" = /obj/item/organ/liver, + "kidneys" = /obj/item/organ/kidney, + "brain" = /obj/item/organ/brain, + "eyes" = /obj/item/organ/eyes, + "stack" = /obj/item/organ/stack/vox ) /datum/species/vox/get_random_name(var/gender) diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index ea4f9f9d41..5816052692 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -95,13 +95,13 @@ var/rarity_value = 1 // Relative rarity/collector value for this species. // Determines the organs that the species spawns with and var/list/has_organ = list( // which required-organ checks are conducted. - "heart" = /datum/organ/internal/heart, - "lungs" = /datum/organ/internal/lungs, - "liver" = /datum/organ/internal/liver, - "kidneys" = /datum/organ/internal/kidney, - "brain" = /datum/organ/internal/brain, - "appendix" = /datum/organ/internal/appendix, - "eyes" = /datum/organ/internal/eyes + "heart" = /obj/item/organ/heart, + "lungs" = /obj/item/organ/lungs, + "liver" = /obj/item/organ/liver, + "kidneys" = /obj/item/organ/kidney, + "brain" = /obj/item/organ/brain, + "appendix" = /obj/item/organ/appendix, + "eyes" = /obj/item/organ/eyes ) /datum/species/New() @@ -153,17 +153,17 @@ H.internal_organs_by_name = list() //This is a basic humanoid limb setup. - H.organs_by_name["chest"] = new/datum/organ/external/chest() - H.organs_by_name["groin"] = new/datum/organ/external/groin(H.organs_by_name["chest"]) - H.organs_by_name["head"] = new/datum/organ/external/head(H.organs_by_name["chest"]) - H.organs_by_name["l_arm"] = new/datum/organ/external/l_arm(H.organs_by_name["chest"]) - H.organs_by_name["r_arm"] = new/datum/organ/external/r_arm(H.organs_by_name["chest"]) - H.organs_by_name["r_leg"] = new/datum/organ/external/r_leg(H.organs_by_name["groin"]) - H.organs_by_name["l_leg"] = new/datum/organ/external/l_leg(H.organs_by_name["groin"]) - H.organs_by_name["l_hand"] = new/datum/organ/external/l_hand(H.organs_by_name["l_arm"]) - H.organs_by_name["r_hand"] = new/datum/organ/external/r_hand(H.organs_by_name["r_arm"]) - H.organs_by_name["l_foot"] = new/datum/organ/external/l_foot(H.organs_by_name["l_leg"]) - H.organs_by_name["r_foot"] = new/datum/organ/external/r_foot(H.organs_by_name["r_leg"]) + H.organs_by_name["chest"] = new/obj/item/organ/external/chest() + H.organs_by_name["groin"] = new/obj/item/organ/external/groin(H.organs_by_name["chest"]) + H.organs_by_name["head"] = new/obj/item/organ/external/head(H.organs_by_name["chest"]) + H.organs_by_name["l_arm"] = new/obj/item/organ/external/l_arm(H.organs_by_name["chest"]) + H.organs_by_name["r_arm"] = new/obj/item/organ/external/r_arm(H.organs_by_name["chest"]) + H.organs_by_name["r_leg"] = new/obj/item/organ/external/r_leg(H.organs_by_name["groin"]) + H.organs_by_name["l_leg"] = new/obj/item/organ/external/l_leg(H.organs_by_name["groin"]) + H.organs_by_name["l_hand"] = new/obj/item/organ/external/l_hand(H.organs_by_name["l_arm"]) + H.organs_by_name["r_hand"] = new/obj/item/organ/external/r_hand(H.organs_by_name["r_arm"]) + H.organs_by_name["l_foot"] = new/obj/item/organ/external/l_foot(H.organs_by_name["l_leg"]) + H.organs_by_name["r_foot"] = new/obj/item/organ/external/r_foot(H.organs_by_name["r_leg"]) for(var/organ in has_organ) var/organ_type = has_organ[organ] @@ -172,15 +172,15 @@ for(var/name in H.organs_by_name) H.organs += H.organs_by_name[name] - for(var/datum/organ/external/O in H.organs) + for(var/obj/item/organ/external/O in H.organs) O.owner = H if(flags & IS_SYNTHETIC) - for(var/datum/organ/external/E in H.organs) + for(var/obj/item/organ/external/E in H.organs) if(E.status & ORGAN_CUT_AWAY || E.status & ORGAN_DESTROYED) continue E.status |= ORGAN_ROBOT - for(var/datum/organ/internal/I in H.internal_organs) - I.mechanize() + for(var/obj/item/organ/I in H.internal_organs) + I.robotize() /datum/species/proc/hug(var/mob/living/carbon/human/H,var/mob/living/target) diff --git a/code/modules/mob/living/carbon/human/species/species_attack.dm b/code/modules/mob/living/carbon/human/species/species_attack.dm index bb922b905b..76f87ea10c 100644 --- a/code/modules/mob/living/carbon/human/species/species_attack.dm +++ b/code/modules/mob/living/carbon/human/species/species_attack.dm @@ -22,7 +22,7 @@ /datum/unarmed_attack/claws/show_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage) var/skill = user.skills["combat"] - var/datum/organ/external/affecting = target.get_organ(zone) + var/obj/item/organ/external/affecting = target.get_organ(zone) if(!skill) skill = 1 attack_damage = Clamp(attack_damage, 1, 5) diff --git a/code/modules/mob/living/carbon/human/species/station/golem.dm b/code/modules/mob/living/carbon/human/species/station/golem.dm index 7d7b364f5d..b4c4321e7d 100644 --- a/code/modules/mob/living/carbon/human/species/station/golem.dm +++ b/code/modules/mob/living/carbon/human/species/station/golem.dm @@ -17,7 +17,7 @@ flesh_color = "#137E8F" has_organ = list( - "brain" = /datum/organ/internal/brain/golem + "brain" = /obj/item/organ/brain/golem ) death_message = "becomes completely motionless..." diff --git a/code/modules/mob/living/carbon/human/species/station/slime.dm b/code/modules/mob/living/carbon/human/species/station/slime.dm index d573558143..d31b18c4dc 100644 --- a/code/modules/mob/living/carbon/human/species/station/slime.dm +++ b/code/modules/mob/living/carbon/human/species/station/slime.dm @@ -18,7 +18,7 @@ death_message = "rapidly loses cohesion, splattering across the ground..." has_organ = list( - "brain" = /datum/organ/internal/brain/slime + "brain" = /obj/item/organ/brain/slime ) breath_type = null diff --git a/code/modules/mob/living/carbon/human/species/station/station.dm b/code/modules/mob/living/carbon/human/species/station/station.dm index bc46cf9c45..26613b9cf7 100644 --- a/code/modules/mob/living/carbon/human/species/station/station.dm +++ b/code/modules/mob/living/carbon/human/species/station/station.dm @@ -145,12 +145,12 @@ water and other radiation." has_organ = list( - "nutrient channel" = /datum/organ/internal/diona/nutrients, - "neural strata" = /datum/organ/internal/diona/strata, - "response node" = /datum/organ/internal/diona/node, - "gas bladder" = /datum/organ/internal/diona/bladder, - "polyp segment" = /datum/organ/internal/diona/polyp, - "anchoring ligament" = /datum/organ/internal/diona/ligament + "nutrient channel" = /obj/item/organ/diona/nutrients, + "neural strata" = /obj/item/organ/diona/strata, + "response node" = /obj/item/organ/diona/node, + "gas bladder" = /obj/item/organ/diona/bladder, + "polyp segment" = /obj/item/organ/diona/polyp, + "anchoring ligament" = /obj/item/organ/diona/ligament ) warning_low_pressure = 50 diff --git a/code/modules/mob/living/carbon/human/species/xenomorphs/alien_embryo.dm b/code/modules/mob/living/carbon/human/species/xenomorphs/alien_embryo.dm index 4bdddc2ca6..093025189b 100644 --- a/code/modules/mob/living/carbon/human/species/xenomorphs/alien_embryo.dm +++ b/code/modules/mob/living/carbon/human/species/xenomorphs/alien_embryo.dm @@ -108,7 +108,7 @@ Des: Removes all infection images from aliens and places an infection image on a for(var/mob/living/carbon/alien in player_list) - if(!locate(/datum/organ/internal/xenos/hivenode) in alien.internal_organs) + if(!locate(/obj/item/organ/xenos/hivenode) in alien.internal_organs) continue if(alien.client) @@ -130,7 +130,7 @@ Des: Checks if the passed mob (C) is infected with the alien egg, then gives eac for(var/mob/living/carbon/alien in player_list) - if(!locate(/datum/organ/internal/xenos/hivenode) in alien.internal_organs) + if(!locate(/obj/item/organ/xenos/hivenode) in alien.internal_organs) continue if(alien.client) @@ -149,7 +149,7 @@ Des: Removes the alien infection image from all aliens in the world located in p for(var/mob/living/carbon/alien in player_list) - if(!locate(/datum/organ/internal/xenos/hivenode) in alien.internal_organs) + if(!locate(/obj/item/organ/xenos/hivenode) in alien.internal_organs) continue if(alien.client) diff --git a/code/modules/mob/living/carbon/human/species/xenomorphs/alien_facehugger.dm b/code/modules/mob/living/carbon/human/species/xenomorphs/alien_facehugger.dm index c7c7fcc903..6fbdfa8ddb 100644 --- a/code/modules/mob/living/carbon/human/species/xenomorphs/alien_facehugger.dm +++ b/code/modules/mob/living/carbon/human/species/xenomorphs/alien_facehugger.dm @@ -108,7 +108,7 @@ var/const/MAX_ACTIVE_TIME = 400 return var/mob/living/carbon/C = M - if(istype(C) && locate(/datum/organ/internal/xenos/hivenode) in C.internal_organs) + if(istype(C) && locate(/obj/item/organ/xenos/hivenode) in C.internal_organs) return @@ -228,7 +228,7 @@ var/const/MAX_ACTIVE_TIME = 400 return 0 var/mob/living/carbon/C = M - if(istype(C) && locate(/datum/organ/internal/xenos/hivenode) in C.internal_organs) + if(istype(C) && locate(/obj/item/organ/xenos/hivenode) in C.internal_organs) return 0 if(ishuman(C)) diff --git a/code/modules/mob/living/carbon/human/species/xenomorphs/alien_powers.dm b/code/modules/mob/living/carbon/human/species/xenomorphs/alien_powers.dm index 2fc44af935..caea1ae7a8 100644 --- a/code/modules/mob/living/carbon/human/species/xenomorphs/alien_powers.dm +++ b/code/modules/mob/living/carbon/human/species/xenomorphs/alien_powers.dm @@ -11,7 +11,7 @@ /mob/living/carbon/human/proc/gain_plasma(var/amount) - var/datum/organ/internal/xenos/plasmavessel/I = internal_organs_by_name["plasma vessel"] + var/obj/item/organ/xenos/plasmavessel/I = internal_organs_by_name["plasma vessel"] if(!istype(I)) return if(amount) @@ -20,13 +20,13 @@ /mob/living/carbon/human/proc/check_alien_ability(var/cost,var/needs_foundation,var/needs_organ) - var/datum/organ/internal/xenos/plasmavessel/P = internal_organs_by_name["plasma vessel"] + var/obj/item/organ/xenos/plasmavessel/P = internal_organs_by_name["plasma vessel"] if(!istype(P)) src << "Your plasma vessel has been removed!" return if(needs_organ) - var/datum/organ/internal/I = internal_organs_by_name[needs_organ] + var/obj/item/organ/I = internal_organs_by_name[needs_organ] if(!I) src << "Your [needs_organ] has been removed!" return @@ -62,7 +62,7 @@ src << "You need to be closer." return - var/datum/organ/internal/xenos/plasmavessel/I = M.internal_organs_by_name["plasma vessel"] + var/obj/item/organ/xenos/plasmavessel/I = M.internal_organs_by_name["plasma vessel"] if(!istype(I)) src << "Their plasma vessel is missing." return diff --git a/code/modules/mob/living/carbon/human/species/xenomorphs/alien_species.dm b/code/modules/mob/living/carbon/human/species/xenomorphs/alien_species.dm index 15cf1ce728..3a76a0c19c 100644 --- a/code/modules/mob/living/carbon/human/species/xenomorphs/alien_species.dm +++ b/code/modules/mob/living/carbon/human/species/xenomorphs/alien_species.dm @@ -43,11 +43,11 @@ poison_type = null has_organ = list( - "heart" = /datum/organ/internal/heart, - "brain" = /datum/organ/internal/brain/xeno, - "plasma vessel" = /datum/organ/internal/xenos/plasmavessel, - "hive node" = /datum/organ/internal/xenos/hivenode, - "nutrient vessel" = /datum/organ/internal/diona/nutrients + "heart" = /obj/item/organ/heart, + "brain" = /obj/item/organ/brain/xeno, + "plasma vessel" = /obj/item/organ/xenos/plasmavessel, + "hive node" = /obj/item/organ/xenos/hivenode, + "nutrient vessel" = /obj/item/organ/diona/nutrients ) var/alien_number = 0 @@ -87,7 +87,7 @@ if(environment.gas["phoron"] > 0 || locate(/obj/effect/alien/weeds) in T) if(!regenerate(H)) - var/datum/organ/internal/xenos/plasmavessel/P = H.internal_organs_by_name["plasma vessel"] + var/obj/item/organ/xenos/plasmavessel/P = H.internal_organs_by_name["plasma vessel"] P.stored_plasma += weeds_plasma_rate P.stored_plasma = min(max(P.stored_plasma,0),P.max_plasma) ..() @@ -110,7 +110,7 @@ return 1 //next internal organs - for(var/datum/organ/internal/I in H.internal_organs) + for(var/obj/item/organ/I in H.internal_organs) if(I.damage > 0) I.damage = max(I.damage - heal_rate, 0) if (prob(5)) @@ -118,7 +118,7 @@ return 1 //next mend broken bones, approx 10 ticks each - for(var/datum/organ/external/E in H.bad_external_organs) + for(var/obj/item/organ/external/E in H.bad_external_organs) if (E.status & ORGAN_BROKEN) if (prob(mend_prob)) if (E.mend_fracture()) @@ -147,13 +147,13 @@ deform = 'icons/mob/human_races/xenos/r_xenos_drone.dmi' has_organ = list( - "heart" = /datum/organ/internal/heart, - "brain" = /datum/organ/internal/brain/xeno, - "plasma vessel" = /datum/organ/internal/xenos/plasmavessel/queen, - "acid gland" = /datum/organ/internal/xenos/acidgland, - "hive node" = /datum/organ/internal/xenos/hivenode, - "resin spinner" = /datum/organ/internal/xenos/resinspinner, - "nutrient vessel" = /datum/organ/internal/diona/nutrients + "heart" = /obj/item/organ/heart, + "brain" = /obj/item/organ/brain/xeno, + "plasma vessel" = /obj/item/organ/xenos/plasmavessel/queen, + "acid gland" = /obj/item/organ/xenos/acidgland, + "hive node" = /obj/item/organ/xenos/hivenode, + "resin spinner" = /obj/item/organ/xenos/resinspinner, + "nutrient vessel" = /obj/item/organ/diona/nutrients ) inherent_verbs = list( @@ -186,11 +186,11 @@ deform = 'icons/mob/human_races/xenos/r_xenos_hunter.dmi' has_organ = list( - "heart" = /datum/organ/internal/heart, - "brain" = /datum/organ/internal/brain/xeno, - "plasma vessel" = /datum/organ/internal/xenos/plasmavessel/hunter, - "hive node" = /datum/organ/internal/xenos/hivenode, - "nutrient vessel" = /datum/organ/internal/diona/nutrients + "heart" = /obj/item/organ/heart, + "brain" = /obj/item/organ/brain/xeno, + "plasma vessel" = /obj/item/organ/xenos/plasmavessel/hunter, + "hive node" = /obj/item/organ/xenos/hivenode, + "nutrient vessel" = /obj/item/organ/diona/nutrients ) inherent_verbs = list( @@ -214,12 +214,12 @@ deform = 'icons/mob/human_races/xenos/r_xenos_sentinel.dmi' has_organ = list( - "heart" = /datum/organ/internal/heart, - "brain" = /datum/organ/internal/brain/xeno, - "plasma vessel" = /datum/organ/internal/xenos/plasmavessel/sentinel, - "acid gland" = /datum/organ/internal/xenos/acidgland, - "hive node" = /datum/organ/internal/xenos/hivenode, - "nutrient vessel" = /datum/organ/internal/diona/nutrients + "heart" = /obj/item/organ/heart, + "brain" = /obj/item/organ/brain/xeno, + "plasma vessel" = /obj/item/organ/xenos/plasmavessel/sentinel, + "acid gland" = /obj/item/organ/xenos/acidgland, + "hive node" = /obj/item/organ/xenos/hivenode, + "nutrient vessel" = /obj/item/organ/diona/nutrients ) inherent_verbs = list( @@ -246,14 +246,14 @@ deform = 'icons/mob/human_races/xenos/r_xenos_queen.dmi' has_organ = list( - "heart" = /datum/organ/internal/heart, - "brain" = /datum/organ/internal/brain/xeno, - "egg sac" = /datum/organ/internal/xenos/eggsac, - "plasma vessel" = /datum/organ/internal/xenos/plasmavessel/queen, - "acid gland" = /datum/organ/internal/xenos/acidgland, - "hive node" = /datum/organ/internal/xenos/hivenode, - "resin spinner" = /datum/organ/internal/xenos/resinspinner, - "nutrient vessel" = /datum/organ/internal/diona/nutrients + "heart" = /obj/item/organ/heart, + "brain" = /obj/item/organ/brain/xeno, + "egg sac" = /obj/item/organ/xenos/eggsac, + "plasma vessel" = /obj/item/organ/xenos/plasmavessel/queen, + "acid gland" = /obj/item/organ/xenos/acidgland, + "hive node" = /obj/item/organ/xenos/hivenode, + "resin spinner" = /obj/item/organ/xenos/resinspinner, + "nutrient vessel" = /obj/item/organ/diona/nutrients ) inherent_verbs = list( diff --git a/code/modules/mob/living/carbon/human/unarmed_attack.dm b/code/modules/mob/living/carbon/human/unarmed_attack.dm index d033e70610..4ae6b2f1a6 100644 --- a/code/modules/mob/living/carbon/human/unarmed_attack.dm +++ b/code/modules/mob/living/carbon/human/unarmed_attack.dm @@ -14,7 +14,7 @@ return 0 // Check if they have a functioning hand. - var/datum/organ/external/E = user.organs_by_name["l_hand"] + var/obj/item/organ/external/E = user.organs_by_name["l_hand"] if(E && !(E.status & ORGAN_DESTROYED)) return 1 @@ -74,7 +74,7 @@ target.apply_effect(3, WEAKEN, armour) /datum/unarmed_attack/proc/show_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage) - var/datum/organ/external/affecting = target.get_organ(zone) + var/obj/item/organ/external/affecting = target.get_organ(zone) user.visible_message("[user] [pick(attack_verb)] [target] in the [affecting.display_name]!") playsound(user.loc, attack_sound, 25, 1, -1) @@ -100,7 +100,7 @@ damage = 0 /datum/unarmed_attack/punch/show_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage) - var/datum/organ/external/affecting = target.get_organ(zone) + var/obj/item/organ/external/affecting = target.get_organ(zone) var/organ = affecting.display_name attack_damage = Clamp(attack_damage, 1, 5) // We expect damage input of 1 to 5 for this proc. But we leave this check juuust in case. @@ -154,7 +154,7 @@ if(!(zone in list("l_leg", "r_leg", "l_foot", "r_foot", "groin"))) return 0 - var/datum/organ/external/E = user.organs_by_name["l_foot"] + var/obj/item/organ/external/E = user.organs_by_name["l_foot"] if(E && !(E.status & ORGAN_DESTROYED)) return 1 @@ -171,7 +171,7 @@ return damage + (shoes ? shoes.force : 0) /datum/unarmed_attack/kick/show_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage) - var/datum/organ/external/affecting = target.get_organ(zone) + var/obj/item/organ/external/affecting = target.get_organ(zone) var/organ = affecting.display_name attack_damage = Clamp(attack_damage, 1, 5) @@ -198,7 +198,7 @@ if (!user.lying && (target.lying || (zone in list("l_foot", "r_foot")))) if(target.grabbed_by == user && target.lying) return 0 - var/datum/organ/external/E = user.organs_by_name["l_foot"] + var/obj/item/organ/external/E = user.organs_by_name["l_foot"] if(E && !(E.status & ORGAN_DESTROYED)) return 1 @@ -213,7 +213,7 @@ return damage + (shoes ? shoes.force : 0) /datum/unarmed_attack/stomp/show_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage) - var/datum/organ/external/affecting = target.get_organ(zone) + var/obj/item/organ/external/affecting = target.get_organ(zone) var/organ = affecting.display_name var/obj/item/clothing/shoes = user.shoes diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 15ad0b6bfd..d59dba9559 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -191,7 +191,7 @@ proc/get_damage_icon_part(damage_state, body_part) // first check whether something actually changed about damage appearance var/damage_appearance = "" - for(var/datum/organ/external/O in organs) + for(var/obj/item/organ/external/O in organs) if(O.status & ORGAN_DESTROYED) damage_appearance += "d" else damage_appearance += O.damage_state @@ -207,7 +207,7 @@ proc/get_damage_icon_part(damage_state, body_part) var/image/standing_image = new /image("icon" = standing) // blend the individual damage states with our icons - for(var/datum/organ/external/O in organs) + for(var/obj/item/organ/external/O in organs) if(!(O.status & ORGAN_DESTROYED)) O.update_icon() if(O.damage_state == "00") continue @@ -245,9 +245,9 @@ proc/get_damage_icon_part(damage_state, body_part) stand_icon = new(species.icon_template ? species.icon_template : 'icons/mob/human.dmi',"blank") var/icon_key = "[species.race_key][g][s_tone]" - for(var/datum/organ/external/part in organs) + for(var/obj/item/organ/external/part in organs) - if(istype(part,/datum/organ/external/head) && !(part.status & ORGAN_DESTROYED)) + if(istype(part,/obj/item/organ/external/head) && !(part.status & ORGAN_DESTROYED)) has_head = 1 if(part.status & ORGAN_DESTROYED) @@ -276,21 +276,21 @@ proc/get_damage_icon_part(damage_state, body_part) //Robotic limbs are handled in get_icon() so all we worry about are missing or dead limbs. //No icon stored, so we need to start with a basic one. - var/datum/organ/external/chest = get_organ("chest") + var/obj/item/organ/external/chest = get_organ("chest") base_icon = chest.get_icon(race_icon,deform_icon,g) if(chest.status & ORGAN_DEAD) base_icon.ColorTone(necrosis_color_mod) base_icon.SetIntensity(0.7) - for(var/datum/organ/external/part in organs) + for(var/obj/item/organ/external/part in organs) var/icon/temp //Hold the bodypart icon for processing. if(part.status & ORGAN_DESTROYED) continue - if (istype(part, /datum/organ/external/groin) || istype(part, /datum/organ/external/head)) + if (istype(part, /obj/item/organ/external/groin) || istype(part, /obj/item/organ/external/head)) temp = part.get_icon(race_icon,deform_icon,g) else temp = part.get_icon(race_icon,deform_icon) @@ -394,7 +394,7 @@ proc/get_damage_icon_part(damage_state, body_part) //Reset our hair overlays_standing[HAIR_LAYER] = null - var/datum/organ/external/head/head_organ = get_organ("head") + var/obj/item/organ/external/head/head_organ = get_organ("head") if( !head_organ || (head_organ.status & ORGAN_DESTROYED) ) if(update_icons) update_icons() return @@ -927,7 +927,7 @@ proc/get_damage_icon_part(damage_state, body_part) /mob/living/carbon/human/proc/update_surgery(var/update_icons=1) overlays_standing[SURGERY_LEVEL] = null var/image/total = new - for(var/datum/organ/external/E in organs) + for(var/obj/item/organ/external/E in organs) if(E.open) var/image/I = image("icon"='icons/mob/surgery.dmi', "icon_state"="[E.name][round(E.open)]", "layer"=-SURGERY_LEVEL) total.overlays += I diff --git a/code/modules/mob/living/carbon/shock.dm b/code/modules/mob/living/carbon/shock.dm index b76b7a49b7..d9b926be64 100644 --- a/code/modules/mob/living/carbon/shock.dm +++ b/code/modules/mob/living/carbon/shock.dm @@ -35,7 +35,7 @@ // broken or ripped off organs will add quite a bit of pain if(istype(src,/mob/living/carbon/human)) var/mob/living/carbon/human/M = src - for(var/datum/organ/external/organ in M.organs) + for(var/obj/item/organ/external/organ in M.organs) if (!organ) continue if((organ.status & ORGAN_DESTROYED) && !organ.amputated) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 419532d4b2..17c7ebab30 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -53,7 +53,7 @@ var/mob/living/carbon/human/H = src //make this damage method divide the damage to be done among all the body parts, then burn each body part for that much damage. will have better effect then just randomly picking a body part var/divided_damage = (burn_amount)/(H.organs.len) var/extradam = 0 //added to when organ is at max dam - for(var/datum/organ/external/affecting in H.organs) + for(var/obj/item/organ/external/affecting in H.organs) if(!affecting) continue if(affecting.take_damage(0, divided_damage+extradam)) //TODO: fix the extradam stuff. Or, ebtter yet...rewrite this entire proc ~Carn H.UpdateDamageIcon() @@ -230,7 +230,7 @@ var/t = shooter:zone_sel.selecting if ((t in list( "eyes", "mouth" ))) t = "head" - var/datum/organ/external/def_zone = ran_zone(t) + var/obj/item/organ/external/def_zone = ran_zone(t) return def_zone diff --git a/code/modules/mob/living/silicon/robot/analyzer.dm b/code/modules/mob/living/silicon/robot/analyzer.dm index 0f84806a1f..7aabd28977 100644 --- a/code/modules/mob/living/silicon/robot/analyzer.dm +++ b/code/modules/mob/living/silicon/robot/analyzer.dm @@ -65,7 +65,7 @@ var/list/damaged = H.get_damaged_organs(1,1) user.show_message("\blue Localized Damage, Brute/Electronics:",1) if(length(damaged)>0) - for(var/datum/organ/external/org in damaged) + for(var/obj/item/organ/external/org in damaged) user.show_message(text("\blue \t []: [] - []", \ capitalize(org.display_name), \ (org.brute_dam > 0) ? "\red [org.brute_dam]" :0, \ diff --git a/code/modules/mob/living/simple_animal/borer/borer.dm b/code/modules/mob/living/simple_animal/borer/borer.dm index 43aa9a9d68..b36fd5a181 100644 --- a/code/modules/mob/living/simple_animal/borer/borer.dm +++ b/code/modules/mob/living/simple_animal/borer/borer.dm @@ -102,7 +102,7 @@ if(istype(host,/mob/living/carbon/human)) var/mob/living/carbon/human/H = host - var/datum/organ/external/head = H.get_organ("head") + var/obj/item/organ/external/head = H.get_organ("head") head.implants -= src controlling = 0 diff --git a/code/modules/mob/living/simple_animal/borer/borer_powers.dm b/code/modules/mob/living/simple_animal/borer/borer_powers.dm index 59f6aed6f0..2437b0155e 100644 --- a/code/modules/mob/living/simple_animal/borer/borer_powers.dm +++ b/code/modules/mob/living/simple_animal/borer/borer_powers.dm @@ -69,7 +69,7 @@ if(istype(M,/mob/living/carbon/human)) var/mob/living/carbon/human/H = M - var/datum/organ/external/E = H.organs_by_name["head"] + var/obj/item/organ/external/E = H.organs_by_name["head"] if(!E || (E.status & ORGAN_DESTROYED)) src << "\The [H] does not have a head!" @@ -115,12 +115,12 @@ if(istype(M,/mob/living/carbon/human)) var/mob/living/carbon/human/H = M - var/datum/organ/internal/I = H.internal_organs_by_name["brain"] + var/obj/item/organ/I = H.internal_organs_by_name["brain"] if(!I) // No brain organ, so the borer moves in and replaces it permanently. replace_brain() else // If they're in normally, implant removal can get them out. - var/datum/organ/external/head = H.get_organ("head") + var/obj/item/organ/external/head = H.get_organ("head") head.implants += src return @@ -183,11 +183,11 @@ H.ChangeToHusk() - var/datum/organ/internal/borer/B = new(H) + var/obj/item/organ/borer/B = new(H) H.internal_organs_by_name["brain"] = B H.internal_organs |= B - var/datum/organ/external/affecting = H.get_organ("head") + var/obj/item/organ/external/affecting = H.get_organ("head") affecting.implants -= src var/s2h_id = src.computer_id diff --git a/code/modules/mob/living/simple_animal/hostile/bear.dm b/code/modules/mob/living/simple_animal/hostile/bear.dm index 5bc3d41afc..73de95acee 100644 --- a/code/modules/mob/living/simple_animal/hostile/bear.dm +++ b/code/modules/mob/living/simple_animal/hostile/bear.dm @@ -134,7 +134,7 @@ if(ishuman(target_mob)) var/mob/living/carbon/human/H = target_mob var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg") - var/datum/organ/external/affecting = H.get_organ(ran_zone(dam_zone)) + var/obj/item/organ/external/affecting = H.get_organ(ran_zone(dam_zone)) H.apply_damage(damage, BRUTE, affecting, H.run_armor_check(affecting, "melee"), sharp=1, edge=1) return H else if(isliving(target_mob)) diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index 7790f9ecd8..8fb148f719 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -475,7 +475,7 @@ if(ishuman(parrot_interest)) var/mob/living/carbon/human/H = parrot_interest - var/datum/organ/external/affecting = H.get_organ(ran_zone(pick(parrot_dam_zone))) + var/obj/item/organ/external/affecting = H.get_organ(ran_zone(pick(parrot_dam_zone))) H.apply_damage(damage, BRUTE, affecting, H.run_armor_check(affecting, "melee"), sharp=1) visible_emote(pick("pecks [H]'s [affecting].", "cuts [H]'s [affecting] with its talons.")) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 61959ab49c..5bfeff91e9 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -592,7 +592,7 @@ var/list/slot_equipment_priority = list( \ var/mob/living/carbon/human/H = src if(H.health - H.halloss <= config.health_threshold_softcrit) for(var/name in H.organs_by_name) - var/datum/organ/external/e = H.organs_by_name[name] + var/obj/item/organ/external/e = H.organs_by_name[name] if(H.lying) if(((e.status & ORGAN_BROKEN && !(e.status & ORGAN_SPLINTED)) || e.status & ORGAN_BLEEDING) && (H.getBruteLoss() + H.getFireLoss() >= 100)) return 1 @@ -1084,9 +1084,9 @@ mob/proc/yank_out_object() if(ishuman(src)) var/mob/living/carbon/human/H = src - var/datum/organ/external/affected + var/obj/item/organ/external/affected - for(var/datum/organ/external/organ in H.organs) //Grab the organ holding the implant. + for(var/obj/item/organ/external/organ in H.organs) //Grab the organ holding the implant. for(var/obj/item/O in organ.implants) if(O == selection) affected = organ diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 18aefb2dc7..09c8b8c8c0 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -85,7 +85,7 @@ /mob/living/silicon/isSilicon() return 1 - + /mob/proc/isAI() return 0 @@ -118,7 +118,7 @@ proc/isobserver(A) return 0 proc/isorgan(A) - if(istype(A, /datum/organ/external)) + if(istype(A, /obj/item/organ/external)) return 1 return 0 @@ -149,7 +149,7 @@ proc/hassensorlevel(A, var/level) var/obj/item/clothing/under/U = H.w_uniform return U.sensor_mode >= level return 0 - + proc/getsensorlevel(A) var/mob/living/carbon/human/H = A if(istype(H) && istype(H.w_uniform, /obj/item/clothing/under)) diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index cdfde01107..464a4a3087 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -289,8 +289,8 @@ else if(istype(mob.buckled, /obj/structure/bed/chair/wheelchair)) if(ishuman(mob.buckled)) var/mob/living/carbon/human/driver = mob.buckled - var/datum/organ/external/l_hand = driver.get_organ("l_hand") - var/datum/organ/external/r_hand = driver.get_organ("r_hand") + var/obj/item/organ/external/l_hand = driver.get_organ("l_hand") + var/obj/item/organ/external/r_hand = driver.get_organ("r_hand") if((!l_hand || (l_hand.status & ORGAN_DESTROYED)) && (!r_hand || (r_hand.status & ORGAN_DESTROYED))) return // No hands to drive your chair? Tough luck! //drunk wheelchair driving diff --git a/code/modules/organs/blood.dm b/code/modules/organs/blood.dm index b04d631046..3fcea82c77 100644 --- a/code/modules/organs/blood.dm +++ b/code/modules/organs/blood.dm @@ -65,7 +65,7 @@ var/const/BLOOD_VOLUME_SURVIVE = 122 // Damaged heart virtually reduces the blood volume, as the blood isn't // being pumped properly anymore. if(species && species.has_organ["heart"]) - var/datum/organ/internal/heart/heart = internal_organs_by_name["heart"] + var/obj/item/organ/heart/heart = internal_organs_by_name["heart"] if(!heart) blood_volume = 0 @@ -127,7 +127,7 @@ var/const/BLOOD_VOLUME_SURVIVE = 122 //Bleeding out var/blood_max = 0 - for(var/datum/organ/external/temp in organs) + 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()) diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index 495ce2762c..f807ee0d1d 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -1,26 +1,152 @@ -/datum/organ - var/name = "organ" +var/list/organ_cache = list() + +/obj/item/organ + name = "organ" var/mob/living/carbon/human/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/rejecting // Is this organ already being rejected? + + var/list/transplant_data 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/germ_level = 0 // INTERNAL germs inside the organ, this is BAD if it's greater than INFECTION_LEVEL_ONE +/obj/item/organ/New(var/newloc, var/mob/living/carbon/holder) + ..(newloc) - proc/process() - return 0 + create_reagents(5) - proc/receive_chem(chemical as obj) - return 0 + if(!max_damage) max_damage = min_broken_damage * 2 -/datum/organ/proc/get_icon(var/icon/race_icon, var/icon/deform_icon) - return icon('icons/mob/human.dmi',"blank") + if(istype(holder)) + + holder.internal_organs |= src + src.owner = holder + + var/mob/living/carbon/human/H = holder + if(istype(H)) + var/obj/item/organ/external/E = H.organs_by_name[src.parent_organ] + if(E.internal_organs == null) + E.internal_organs = list() + E.internal_organs |= src + +/obj/item/organ/proc/die() + name = "dead [initial(name)]" + health = 0 + processing_objects -= src + //TODO: Grey out the icon state. + //TODO: Inject an organ with peridaxon to make it alive again. + +/obj/item/organ/process() + + // 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 (robotic >= 2 || (owner.species && owner.species.flags & IS_PLANT)) + germ_level = 0 + return + + if(!owner) + 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) + + health -= rand(1,3) + if(health <= 0) + die() + else if(owner.bodytemperature >= 170) //cryo stops germs from moving and doing their bad stuffs + //** Handle antibiotics and curing infections + handle_antibiotics() + handle_rejection() + handle_germ_effects() + +/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/handle_rejection() + // Process unsuitable transplants. TODO: consider some kind of + // immunosuppressant that changes transplant data to make it match. + if(transplant_data) + if(!rejecting && prob(20) && owner.dna && blood_incompatible(transplant_data["blood_type"],owner.dna.b_type,owner.species,transplant_data["species"])) + rejecting = 1 + else + rejecting++ //Rejection severity increases over time. + if(rejecting % 10 == 0) //Only fire every ten rejection ticks. + switch(rejecting) + if(1 to 50) + take_damage(1) + if(51 to 200) + owner.reagents.add_reagent("toxin", 1) + take_damage(1) + if(201 to 500) + take_damage(rand(2,3)) + owner.reagents.add_reagent("toxin", 2) + if(501 to INFINITY) + take_damage(4) + owner.reagents.add_reagent("toxin", rand(3,5)) + +/obj/item/organ/proc/receive_chem(chemical as obj) + return 0 + +/obj/item/organ/proc/get_icon(var/image/supplied) + var/key = "internal-[icon_state]" + var/image/I + if(organ_cache[key]) + I = organ_cache[key] + else + I = image(icon, "[icon_state]") + return I + +/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 -/datum/organ/proc/handle_antibiotics() +/obj/item/organ/proc/handle_antibiotics() var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin") if (!germ_level || antibiotics < 5) @@ -33,15 +159,8 @@ else germ_level -= 2 //at germ_level == 1000, this will cure the infection in 5 minutes -//Handles chem traces -/mob/living/carbon/human/proc/handle_trace_chems() - //New are added for reagents to random organs. - for(var/datum/reagent/A in reagents.reagent_list) - var/datum/organ/O = pick(organs) - O.trace_chemicals[A.name] = 100 - //Adds autopsy data for used_weapon. -/datum/organ/proc/add_autopsy_data(var/used_weapon, var/damage) +/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() @@ -52,88 +171,153 @@ W.damage += damage W.time_inflicted = world.time -/mob/living/carbon/human/var/list/organs = list() -/mob/living/carbon/human/var/list/organs_by_name = list() // map organ names to organs -/mob/living/carbon/human/var/list/internal_organs_by_name = list() // so internal organs have less ickiness too +/obj/item/organ/proc/take_damage(amount, var/silent=0) + if(src.robotic == 2) + src.damage += (amount * 0.8) + else + src.damage += amount -// Takes care of organ related updates, such as broken and missing limbs -/mob/living/carbon/human/proc/handle_organs() + var/obj/item/organ/external/parent = owner.get_organ(parent_organ) + if (!silent) + owner.custom_pain("Something inside your [parent.display_name] hurts a lot.", 1) - number_wounds = 0 - var/force_process = 0 - var/damage_this_tick = getBruteLoss() + getFireLoss() + getToxLoss() - if(damage_this_tick > last_dam) - force_process = 1 - last_dam = damage_this_tick - if(force_process) - bad_external_organs.Cut() - for(var/datum/organ/external/Ex in organs) - bad_external_organs += Ex +/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 - //processing internal organs is pretty cheap, do that first. - for(var/datum/organ/internal/I in internal_organs) - I.process() +/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 - //losing a limb stops it from processing, so this has to be done separately - handle_stance() +/obj/item/organ/emp_act(severity) + switch(robotic) + if(0) + return + if(1) + switch (severity) + if (1.0) + take_damage(20,0) + return + if (2.0) + take_damage(7,0) + return + if(3.0) + take_damage(3,0) + return + if(2) + switch (severity) + if (1.0) + take_damage(40,0) + return + if (2.0) + take_damage(15,0) + return + if(3.0) + take_damage(10,0) + return - if(!force_process && !bad_external_organs.len) +/obj/item/organ/proc/removed(var/mob/living/carbon/human/target,var/mob/living/user) + + if(!istype(target)) return - for(var/datum/organ/external/E in bad_external_organs) - if(!E) - continue - if(!E.need_process()) - bad_external_organs -= E - continue - else - E.process() - number_wounds += E.number_wounds + target.internal_organs_by_name[organ_tag] = null + target.internal_organs_by_name -= organ_tag + target.internal_organs -= src - if (!lying && world.time - l_move_time < 15) - //Moving around with fractured ribs won't do you any good - if (E.is_broken() && E.internal_organs && prob(15)) - var/datum/organ/internal/I = pick(E.internal_organs) - custom_pain("You feel broken bones moving in your [E.display_name]!", 1) - I.take_damage(rand(3,5)) + var/obj/item/organ/external/affected = target.get_organ(parent_organ) + affected.internal_organs -= src - //Moving makes open wounds get infected much faster - if (E.wounds.len) - for(var/datum/wound/W in E.wounds) - if (W.infection_check()) - W.germ_level += 1 + loc = target.loc + 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) -/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/bed)) + if(target && user && vital) + user.attack_log += "\[[time_stamp()]\] removed a vital organ ([src]) from [target.name] ([target.ckey]) (INTENT: [uppertext(user.a_intent)])" + target.attack_log += "\[[time_stamp()]\] had a vital organ ([src]) removed by [user.name] ([user.ckey]) (INTENT: [uppertext(user.a_intent)])" + msg_admin_attack("[user.name] ([user.ckey]) removed a vital organ ([src]) from [target.name] ([target.ckey]) (INTENT: [uppertext(user.a_intent)]) (JMP)") + target.death() + +/obj/item/organ/proc/replaced(var/mob/living/carbon/human/target,var/obj/item/organ/external/affected) + + if(!istype(target)) return + + var/datum/reagent/blood/transplant_blood = locate(/datum/reagent/blood) in reagents.reagent_list + transplant_data = list() + if(!transplant_blood) + transplant_data["species"] = target.species.name + transplant_data["blood_type"] = target.dna.b_type + transplant_data["blood_DNA"] = target.dna.unique_enzymes + else + transplant_data["species"] = transplant_blood.data["species"] + transplant_data["blood_type"] = transplant_blood.data["blood_type"] + transplant_data["blood_DNA"] = transplant_blood.data["blood_DNA"] + + owner = target + target.internal_organs |= src + affected.internal_organs |= src + target.internal_organs_by_name[organ_tag] = src + status |= ORGAN_CUT_AWAY + + del(src) + +/obj/item/organ/eyes/replaced(var/mob/living/carbon/human/target) + + // Apply our eye colour to the target. + 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) + + if(robotic) 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 + user << "\blue You take an experimental bite out of \the [src]." + var/datum/reagent/blood/B = locate(/datum/reagent/blood) in reagents.reagent_list + blood_splatter(src,B,1) - // standing is poor - 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. \ No newline at end of file + + user.drop_from_inventory(src) + var/obj/item/weapon/reagent_containers/food/snacks/organ/O = new(get_turf(src)) + O.name = name + O.icon_state = icon_state + + // Pass over the blood. + reagents.trans_to(O, reagents.total_volume) + + if(fingerprints) O.fingerprints = fingerprints.Copy() + if(fingerprintshidden) O.fingerprintshidden = fingerprintshidden.Copy() + if(fingerprintslast) O.fingerprintslast = fingerprintslast + + user.put_in_active_hand(O) + del(src) + +/obj/item/organ/attack_self(mob/user as mob) + + // Convert it to an edible form, yum yum. + if(!robotic && user.a_intent == "help" && user.zone_sel.selecting == "mouth") + bitten(user) + return + +/obj/item/organ/proc/remove(var/mob/user) + if(user) + src.loc = get_turf(user) + else + src.loc = get_turf(owner) + return src diff --git a/code/modules/organs/organ_alien.dm b/code/modules/organs/organ_alien.dm index 4a36d23659..c8fd93ea78 100644 --- a/code/modules/organs/organ_alien.dm +++ b/code/modules/organs/organ_alien.dm @@ -1,35 +1,30 @@ //DIONA ORGANS. -/datum/organ/internal/diona - removed_type = /obj/item/organ/diona - -/datum/organ/internal/diona/process() +/obj/item/organ/diona/process() return -/datum/organ/internal/diona/strata +/obj/item/organ/diona/strata name = "neural strata" parent_organ = "chest" -/datum/organ/internal/diona/bladder +/obj/item/organ/diona/bladder name = "gas bladder" parent_organ = "head" -/datum/organ/internal/diona/polyp +/obj/item/organ/diona/polyp name = "polyp segment" parent_organ = "groin" -/datum/organ/internal/diona/ligament +/obj/item/organ/diona/ligament name = "anchoring ligament" parent_organ = "groin" -/datum/organ/internal/diona/node +/obj/item/organ/diona/node name = "receptor node" parent_organ = "head" - removed_type = /obj/item/organ/diona/node -/datum/organ/internal/diona/nutrients +/obj/item/organ/diona/nutrients name = "nutrient vessel" parent_organ = "chest" - removed_type = /obj/item/organ/diona/nutrients /obj/item/organ/diona name = "diona nymph" @@ -78,13 +73,12 @@ return //CORTICAL BORER ORGANS. -/datum/organ/internal/borer +/obj/item/organ/borer name = "cortical borer" parent_organ = "head" - removed_type = /obj/item/organ/borer vital = 1 -/datum/organ/internal/borer/process() +/obj/item/organ/borer/process() // Borer husks regenerate health, feel no pain, and are resistant to stuns and brainloss. for(var/chem in list("tricordrazine","tramadol","hyperzine","alkysine")) @@ -126,46 +120,41 @@ del(src) //XENOMORPH ORGANS -/datum/organ/internal/xenos/eggsac +/obj/item/organ/xenos/eggsac name = "egg sac" parent_organ = "groin" - removed_type = /obj/item/organ/xenos/eggsac -/datum/organ/internal/xenos/plasmavessel +/obj/item/organ/xenos/plasmavessel name = "plasma vessel" parent_organ = "chest" - removed_type = /obj/item/organ/xenos/plasmavessel var/stored_plasma = 0 var/max_plasma = 500 -/datum/organ/internal/xenos/plasmavessel/queen +/obj/item/organ/xenos/plasmavessel/queen name = "bloated plasma vessel" stored_plasma = 200 max_plasma = 500 -/datum/organ/internal/xenos/plasmavessel/sentinel +/obj/item/organ/xenos/plasmavessel/sentinel stored_plasma = 100 max_plasma = 250 -/datum/organ/internal/xenos/plasmavessel/hunter +/obj/item/organ/xenos/plasmavessel/hunter name = "tiny plasma vessel" stored_plasma = 100 max_plasma = 150 -/datum/organ/internal/xenos/acidgland +/obj/item/organ/xenos/acidgland name = "acid gland" parent_organ = "head" - removed_type = /obj/item/organ/xenos/acidgland -/datum/organ/internal/xenos/hivenode +/obj/item/organ/xenos/hivenode name = "hive node" parent_organ = "chest" - removed_type = /obj/item/organ/xenos/hivenode -/datum/organ/internal/xenos/resinspinner +/obj/item/organ/xenos/resinspinner name = "resin spinner" parent_organ = "head" - removed_type = /obj/item/organ/xenos/resinspinner /obj/item/organ/xenos name = "xeno organ" @@ -198,32 +187,28 @@ organ_tag = "resin spinner" //VOX ORGANS. -/datum/organ/internal/stack +/obj/item/organ/stack name = "cortical stack" - removed_type = /obj/item/organ/stack parent_organ = "head" robotic = 2 vital = 1 var/backup_time = 0 var/datum/mind/backup -/datum/organ/internal/stack/process() +/obj/item/organ/stack/process() if(owner && owner.stat != 2 && !is_broken()) backup_time = world.time if(owner.mind) backup = owner.mind -/datum/organ/internal/stack/vox - removed_type = /obj/item/organ/stack/vox +/obj/item/organ/stack/vox -/datum/organ/internal/stack/vox/stack +/obj/item/organ/stack/vox/stack /obj/item/organ/stack name = "cortical stack" icon_state = "brain-prosthetic" organ_tag = "stack" robotic = 2 - prosthetic_name = null - prosthetic_icon = null /obj/item/organ/stack/vox name = "vox cortical stack" \ No newline at end of file diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 4dcc006df6..f5a81f5531 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -1,7 +1,7 @@ /**************************************************** EXTERNAL ORGANS ****************************************************/ -/datum/organ/external +/obj/item/organ/external name = "external" var/icon_name = null var/body_part = null @@ -10,7 +10,6 @@ var/damage_state = "00" var/brute_dam = 0 var/burn_dam = 0 - var/max_damage = 0 var/max_size = 0 var/last_dam = -1 @@ -21,13 +20,12 @@ var/tmp/perma_injury = 0 var/tmp/destspawn = 0 //Has it spawned the broken limb? var/tmp/amputated = 0 //Whether this has been cleanly amputated, thus causing no pain - var/min_broken_damage = 30 - var/datum/organ/external/parent - var/list/datum/organ/external/children + var/obj/item/organ/external/parent + var/list/obj/item/organ/external/children // Internal organs of this body part - var/list/datum/organ/internal/internal_organs + var/list/obj/item/organ/internal_organs var/damage_msg = "\red You feel an intense pain" var/broken_description @@ -44,8 +42,14 @@ // how often wounds should be updated, a higher number means less often var/wound_update_accuracy = 1 + var/joint = "joint" // Descriptive string used in dislocation. + var/amputation_point // Descriptive string used in amputation. + var/dislocated = 0 // If you target a joint, you can dislocate the limb, causing temporary damage to the organ. -/datum/organ/external/New(var/datum/organ/external/P) + min_broken_damage = 30 + max_damage = 0 + +/obj/item/organ/external/New(var/newloc, var/mob/living/carbon/holder, var/obj/item/organ/external/P) if(P) parent = P if(!parent.children) @@ -57,20 +61,7 @@ DAMAGE PROCS ****************************************************/ -/datum/organ/external/proc/emp_act(severity) - if(!(status & ORGAN_ROBOT)) //meatbags do not care about EMP - return - var/probability = 30 - var/damage = 15 - if(severity == 2) - probability = 1 - damage = 3 - if(prob(probability)) - droplimb(1) - else - take_damage(damage, 0, 1, 1, used_weapon = "EMP") - -/datum/organ/external/proc/take_damage(brute, burn, sharp, edge, used_weapon = null, list/forbidden_limbs = list()) +/obj/item/organ/external/take_damage(brute, burn, sharp, edge, used_weapon = null, list/forbidden_limbs = list()) if((brute <= 0) && (burn <= 0)) return 0 @@ -93,7 +84,7 @@ // High brute damage or sharp objects may damage internal organs if(internal_organs && ( (sharp && brute >= 5) || brute >= 10) && prob(5)) // Damage an internal organ - var/datum/organ/internal/I = pick(internal_organs) + var/obj/item/organ/I = pick(internal_organs) I.take_damage(brute / 2) brute -= brute / 2 @@ -141,7 +132,7 @@ 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() + var/list/obj/item/organ/external/possible_points = list() if(parent) possible_points += parent if(children) @@ -150,7 +141,7 @@ possible_points -= forbidden_limbs if(possible_points.len) //And pass the pain around - var/datum/organ/external/target = pick(possible_points) + 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 @@ -168,7 +159,7 @@ var/result = update_icon() return result -/datum/organ/external/proc/heal_damage(brute, burn, internal = 0, robo_repair = 0) +/obj/item/organ/external/proc/heal_damage(brute, burn, internal = 0, robo_repair = 0) if(status & ORGAN_ROBOT && !robo_repair) return @@ -197,7 +188,7 @@ /* This function completely restores a damaged organ to perfect condition. */ -/datum/organ/external/proc/rejuvenate() +/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 @@ -211,7 +202,7 @@ This function completely restores a damaged organ to perfect condition. number_wounds = 0 // handle internal organs - for(var/datum/organ/internal/current_organ in internal_organs) + for(var/obj/item/organ/current_organ in internal_organs) current_organ.rejuvenate() // remove embedded objects and drop them on the floor @@ -223,7 +214,7 @@ This function completely restores a damaged organ to perfect condition. owner.updatehealth() -/datum/organ/external/proc/createwound(var/type = CUT, var/damage) +/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 (because of the return) @@ -274,7 +265,7 @@ This function completely restores a damaged organ to perfect condition. //Determines if we even need to process this organ. -/datum/organ/external/proc/need_process() +/obj/item/organ/external/proc/need_process() if(destspawn) //Missing limb is missing return 0 if(status && status != ORGAN_ROBOT) // If it's robotic, that's fine it will have a status. @@ -290,7 +281,7 @@ This function completely restores a damaged organ to perfect condition. return 1 return 0 -/datum/organ/external/process() +/obj/item/organ/external/process() //Dismemberment if(status & ORGAN_DESTROYED) if(!destspawn && config.limbs_can_break) @@ -341,7 +332,7 @@ INFECTION_LEVEL_THREE above this germ level the player will take additional toxi Note that amputating the affected organ does in fact remove the infection from the player's body. */ -/datum/organ/external/proc/update_germs() +/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 @@ -357,7 +348,7 @@ Note that amputating the affected organ does in fact remove the infection from t //** Handle the effects of infections handle_germ_effects() -/datum/organ/external/proc/handle_germ_sync() +/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 @@ -371,29 +362,17 @@ Note that amputating the affected organ does in fact remove the infection from t germ_level++ break //limit increase to a maximum of one per second -/datum/organ/external/proc/handle_germ_effects() +/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 > 0 && germ_level < INFECTION_LEVEL_ONE && prob(60)) //this could be an else clause, but it looks cleaner this way - germ_level-- //since germ_level increases at a rate of 1 per second with dirty wounds, prob(60) should give us about 5 minutes before level one. - - if(germ_level >= INFECTION_LEVEL_ONE) - //having an infection raises your body temperature - var/fever_temperature = (owner.species.heat_level_1 - owner.species.body_temperature - 5)* min(germ_level/INFECTION_LEVEL_TWO, 1) + owner.species.body_temperature - //need to make sure we raise temperature fast enough to get around environmental cooling preventing us from reaching fever_temperature - owner.bodytemperature += between(0, (fever_temperature - T20C)/BODYTEMP_COLD_DIVISOR + 1, fever_temperature - owner.bodytemperature) - - if(prob(round(germ_level/10))) - if (antibiotics < 5) - germ_level++ - - if (prob(10)) //adjust this to tweak how fast people take toxin damage from infections - owner.adjustToxLoss(1) - - if(germ_level >= INFECTION_LEVEL_TWO && antibiotics < 5) + if(germ_level >= INFECTION_LEVEL_TWO) //spread the infection to internal organs - var/datum/organ/internal/target_organ = null //make internal organs become infected one at a time instead of all at once - for (var/datum/organ/internal/I in internal_organs) + var/obj/item/organ/target_organ = null //make internal organs become infected one at a time instead of all at once + for (var/obj/item/organ/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 @@ -401,7 +380,7 @@ Note that amputating the affected organ does in fact remove the infection from t if (!target_organ) //figure out which organs we can spread germs to and pick one at random var/list/candidate_organs = list() - for (var/datum/organ/internal/I in internal_organs) + for (var/obj/item/organ/I in internal_organs) if (I.germ_level < germ_level) candidate_organs += I if (candidate_organs.len) @@ -412,7 +391,7 @@ Note that amputating the affected organ does in fact remove the infection from t //spread the infection to child and parent organs if (children) - for (var/datum/organ/external/child in 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++ @@ -432,7 +411,7 @@ Note that amputating the affected organ does in fact remove the infection from t owner.adjustToxLoss(1) //Updating wounds. Handles wound natural I had some free spachealing, internal bleedings and infections -/datum/organ/external/proc/update_wounds() +/obj/item/organ/external/proc/update_wounds() if((status & ORGAN_ROBOT)) //Robotic limbs don't heal or get worse. return @@ -485,7 +464,7 @@ Note that amputating the affected organ does in fact remove the infection from t owner.UpdateDamageIcon(1) //Updates brute_damn and burn_damn from wound damages. Updates BLEEDING status. -/datum/organ/external/proc/update_damages() +/obj/item/organ/external/proc/update_damages() number_wounds = 0 brute_dam = 0 burn_dam = 0 @@ -517,7 +496,7 @@ Note that amputating the affected organ does in fact remove the infection from t // new damage icon system // adjusted to set damage_state to brute/burn code only (without r_name0 as before) -/datum/organ/external/proc/update_icon() +/obj/item/organ/external/update_icon() var/n_is = damage_state_text() if (n_is != damage_state) damage_state = n_is @@ -526,7 +505,7 @@ Note that amputating the affected organ does in fact remove the infection from t // new damage icon system // returns just the brute/burn damage code -/datum/organ/external/proc/damage_state_text() +/obj/item/organ/external/proc/damage_state_text() if(status & ORGAN_DESTROYED) return "--" @@ -557,13 +536,13 @@ Note that amputating the affected organ does in fact remove the infection from t ****************************************************/ //Recursive setting of all child organs to amputated -/datum/organ/external/proc/setAmputatedTree() - for(var/datum/organ/external/O in children) +/obj/item/organ/external/proc/setAmputatedTree() + for(var/obj/item/organ/external/O in children) O.amputated=amputated O.setAmputatedTree() //Handles dismemberment -/datum/organ/external/proc/droplimb(var/override = 0,var/no_explode = 0,var/amputation=0) +/obj/item/organ/external/proc/droplimb(var/override = 0,var/no_explode = 0,var/amputation=0) if(destspawn) return if(override) status |= ORGAN_DESTROYED @@ -581,7 +560,7 @@ 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) + for(var/obj/item/organ/external/O in children) O.droplimb(1, no_explode, amputation) //Replace all wounds on that arm with one wound on parent organ. @@ -596,53 +575,37 @@ Note that amputating the affected organ does in fact remove the infection from t parent.update_damages() update_damages() - var/obj/organ //Dropped limb object var/list/dropped_items switch(body_part) if(HEAD) - 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) - else - organ= new /obj/item/weapon/organ/r_arm(owner.loc, owner) - if(ARM_LEFT) - if(status & ORGAN_ROBOT) - organ= new /obj/item/robot_parts/l_arm(owner.loc) - else - organ= new /obj/item/weapon/organ/l_arm(owner.loc, owner) - if(LEG_RIGHT) - if(status & ORGAN_ROBOT) - organ = new /obj/item/robot_parts/r_leg(owner.loc) - else - organ= new /obj/item/weapon/organ/r_leg(owner.loc, owner) - if(LEG_LEFT) - if(status & ORGAN_ROBOT) - organ = new /obj/item/robot_parts/l_leg(owner.loc) - else - organ= new /obj/item/weapon/organ/l_leg(owner.loc, owner) if(HAND_RIGHT) - if(!(status & ORGAN_ROBOT)) - organ= new /obj/item/weapon/organ/r_hand(owner.loc, owner) 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) dropped_items = list(owner.gloves) if(FOOT_RIGHT) - if(!(status & ORGAN_ROBOT)) - organ= new /obj/item/weapon/organ/r_foot/(owner.loc, owner) dropped_items = list(owner.shoes) if(FOOT_LEFT) - if(!(status & ORGAN_ROBOT)) - organ = new /obj/item/weapon/organ/l_foot(owner.loc, owner) dropped_items = list(owner.shoes) + if(dropped_items) for(var/obj/O in dropped_items) owner.remove_from_mob(O) + removed(owner) destspawn = 1 + owner.visible_message("\red [owner.name]'s [display_name] flies off in an arc.",\ + "Your [display_name] goes flying off!",\ + "You hear a terrible sound of ripping tendons and flesh.") + //Throw organs around + if(istype(owner.loc,/turf)) + step(src,pick(cardinal)) + owner.update_body(1) + // OK so maybe your limb just flew off, but if it was attached to a pair of cuffs then hooray! Freedom! + release_restraints() + if(vital) + owner.death() + //Robotic limbs explode if sabotaged. if(status & ORGAN_ROBOT && !no_explode && sabotaged) owner.visible_message("\red \The [owner]'s [display_name] explodes violently!",\ @@ -655,28 +618,14 @@ Note that amputating the affected organ does in fact remove the infection from t spark_system.start() spawn(10) del(spark_system) + del(src) - owner.visible_message("\red [owner.name]'s [display_name] flies off in an arc.",\ - "Your [display_name] goes flying off!",\ - "You hear a terrible sound of ripping tendons and flesh.") - - //Throw organs around - if(istype(owner.loc,/turf) && organ) - step(organ,pick(cardinal)) - - owner.update_body(1) - - // OK so maybe your limb just flew off, but if it was attached to a pair of cuffs then hooray! Freedom! - release_restraints() - - if(vital) - owner.death() /**************************************************** HELPERS ****************************************************/ -/datum/organ/external/proc/release_restraints() +/obj/item/organ/external/proc/release_restraints() if (owner.handcuffed && body_part in list(ARM_LEFT, ARM_RIGHT, HAND_LEFT, HAND_RIGHT)) owner.visible_message(\ "\The [owner.handcuffed.name] falls off of [owner.name].",\ @@ -691,7 +640,7 @@ Note that amputating the affected organ does in fact remove the infection from t owner.drop_from_inventory(owner.legcuffed) -/datum/organ/external/proc/bandage() +/obj/item/organ/external/proc/bandage() var/rval = 0 src.status &= ~ORGAN_BLEEDING for(var/datum/wound/W in wounds) @@ -700,7 +649,7 @@ Note that amputating the affected organ does in fact remove the infection from t W.bandaged = 1 return rval -/datum/organ/external/proc/disinfect() +/obj/item/organ/external/proc/disinfect() var/rval = 0 for(var/datum/wound/W in wounds) if(W.internal) continue @@ -709,7 +658,7 @@ Note that amputating the affected organ does in fact remove the infection from t W.germ_level = 0 return rval -/datum/organ/external/proc/clamp() +/obj/item/organ/external/proc/clamp() var/rval = 0 src.status &= ~ORGAN_BLEEDING for(var/datum/wound/W in wounds) @@ -718,14 +667,14 @@ Note that amputating the affected organ does in fact remove the infection from t W.clamped = 1 return rval -/datum/organ/external/proc/salve() +/obj/item/organ/external/proc/salve() var/rval = 0 for(var/datum/wound/W in wounds) rval |= !W.salved W.salved = 1 return rval -/datum/organ/external/proc/fracture() +/obj/item/organ/external/proc/fracture() if(status & ORGAN_BROKEN) return @@ -765,7 +714,7 @@ 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() +/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) @@ -774,37 +723,31 @@ Note that amputating the affected organ does in fact remove the infection from t status &= ~ORGAN_BROKEN return 1 -/datum/organ/external/proc/robotize() - 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 +/obj/item/organ/external/robotize() + ..() src.destspawn = 0 - for (var/datum/organ/external/T in children) + for (var/obj/item/organ/external/T in children) if(T) T.robotize() -/datum/organ/external/proc/mutate() +/obj/item/organ/external/proc/mutate() src.status |= ORGAN_MUTATED owner.update_body() -/datum/organ/external/proc/unmutate() +/obj/item/organ/external/proc/unmutate() src.status &= ~ORGAN_MUTATED owner.update_body() -/datum/organ/external/proc/get_damage() //returns total damage +/obj/item/organ/external/proc/get_damage() //returns total damage return max(brute_dam + burn_dam - perma_injury, perma_injury) //could use health? -/datum/organ/external/proc/has_infected_wound() +/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 -/datum/organ/external/get_icon(var/icon/race_icon, var/icon/deform_icon,gender="") +/obj/item/organ/external/get_icon(var/icon/race_icon, var/icon/deform_icon,gender="") if (status & ORGAN_ROBOT && !(owner.species && owner.species.flags & IS_SYNTHETIC)) return new /icon('icons/mob/human_races/robotic.dmi', "[icon_name][gender ? "_[gender]" : ""]") @@ -814,17 +757,14 @@ Note that amputating the affected organ does in fact remove the infection from t return new /icon(race_icon, "[icon_name][gender ? "_[gender]" : ""]") -/datum/organ/external/proc/is_usable() +/obj/item/organ/external/proc/is_usable() return !(status & (ORGAN_DESTROYED|ORGAN_MUTATED|ORGAN_DEAD)) -/datum/organ/external/proc/is_broken() - return ((status & ORGAN_BROKEN) && !(status & ORGAN_SPLINTED)) - -/datum/organ/external/proc/is_malfunctioning() +/obj/item/organ/external/proc/is_malfunctioning() 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) +/obj/item/organ/external/proc/process_grasp(var/obj/item/c_hand, var/hand_name) if (!c_hand) return @@ -842,7 +782,7 @@ Note that amputating the affected organ does in fact remove the infection from t spawn(10) del(spark_system) -/datum/organ/external/proc/embed(var/obj/item/weapon/W, var/silent = 0) +/obj/item/organ/external/proc/embed(var/obj/item/weapon/W, var/silent = 0) if(!silent) owner.visible_message("\The [W] sticks in the wound!") implants += W @@ -858,7 +798,7 @@ Note that amputating the affected organ does in fact remove the infection from t ORGAN DEFINES ****************************************************/ -/datum/organ/external/chest +/obj/item/organ/external/chest name = "chest" icon_name = "torso" display_name = "chest" @@ -867,8 +807,11 @@ Note that amputating the affected organ does in fact remove the infection from t body_part = UPPER_TORSO vital = 1 encased = "ribcage" + amputation_point = "spines" + joint = "neck" + dislocated = -1 -/datum/organ/external/groin +/obj/item/organ/external/groin name = "groin" icon_name = "groin" display_name = "groin" @@ -876,20 +819,25 @@ Note that amputating the affected organ does in fact remove the infection from t min_broken_damage = 30 body_part = LOWER_TORSO vital = 1 + amputation_point = "lumbar" + joint = "hip" + dislocated = -1 -/datum/organ/external/l_arm +/obj/item/organ/external/l_arm name = "l_arm" display_name = "left arm" icon_name = "l_arm" max_damage = 50 min_broken_damage = 20 body_part = ARM_LEFT + joint = "left elbow" + amputation_point = "left shoulder" - process() - ..() - process_grasp(owner.l_hand, "left hand") +/obj/item/organ/external/l_arm/process() + ..() + process_grasp(owner.l_hand, "left hand") -/datum/organ/external/l_leg +/obj/item/organ/external/l_leg name = "l_leg" display_name = "left leg" icon_name = "l_leg" @@ -897,20 +845,24 @@ Note that amputating the affected organ does in fact remove the infection from t min_broken_damage = 20 body_part = LEG_LEFT icon_position = LEFT + joint = "left knee" + amputation_point = "left hip" -/datum/organ/external/r_arm +/obj/item/organ/external/r_arm name = "r_arm" display_name = "right arm" icon_name = "r_arm" max_damage = 50 min_broken_damage = 20 body_part = ARM_RIGHT + joint = "right elbow" + amputation_point = "right shoulder" - process() +/obj/item/organ/external/r_arm/process() ..() process_grasp(owner.r_hand, "right hand") -/datum/organ/external/r_leg +/obj/item/organ/external/r_leg name = "r_leg" display_name = "right leg" icon_name = "r_leg" @@ -918,8 +870,10 @@ Note that amputating the affected organ does in fact remove the infection from t min_broken_damage = 20 body_part = LEG_RIGHT icon_position = RIGHT + joint = "right knee" + amputation_point = "right hip" -/datum/organ/external/l_foot +/obj/item/organ/external/l_foot name = "l_foot" display_name = "left foot" icon_name = "l_foot" @@ -927,8 +881,9 @@ Note that amputating the affected organ does in fact remove the infection from t min_broken_damage = 15 body_part = FOOT_LEFT icon_position = LEFT + amputation_point = "left ankle" -/datum/organ/external/r_foot +/obj/item/organ/external/r_foot name = "r_foot" display_name = "right foot" icon_name = "r_foot" @@ -936,32 +891,35 @@ Note that amputating the affected organ does in fact remove the infection from t min_broken_damage = 15 body_part = FOOT_RIGHT icon_position = RIGHT + amputation_point = "right ankle" -/datum/organ/external/r_hand +/obj/item/organ/external/r_hand name = "r_hand" display_name = "right hand" icon_name = "r_hand" max_damage = 30 min_broken_damage = 15 body_part = HAND_RIGHT + amputation_point = "right wrist" - process() - ..() - process_grasp(owner.r_hand, "right hand") +/obj/item/organ/external/r_hand/process() + ..() + process_grasp(owner.r_hand, "right hand") -/datum/organ/external/l_hand +/obj/item/organ/external/l_hand name = "l_hand" display_name = "left hand" icon_name = "l_hand" max_damage = 30 min_broken_damage = 15 body_part = HAND_LEFT + amputation_point = "left wrist" - process() - ..() - process_grasp(owner.l_hand, "left hand") +/obj/item/organ/external/l_hand/process() + ..() + process_grasp(owner.l_hand, "left hand") -/datum/organ/external/head +/obj/item/organ/external/head name = "head" icon_name = "head" display_name = "head" @@ -971,8 +929,10 @@ Note that amputating the affected organ does in fact remove the infection from t var/disfigured = 0 vital = 1 encased = "skull" + joint = "jaw" + amputation_point = "neck" -/datum/organ/external/head/get_icon(var/icon/race_icon, var/icon/deform_icon) +/obj/item/organ/external/head/get_icon(var/icon/race_icon, var/icon/deform_icon) if (!owner) return ..() var/g = "m" @@ -982,7 +942,7 @@ Note that amputating the affected organ does in fact remove the infection from t else . = new /icon(race_icon, "[icon_name]_[g]") -/datum/organ/external/head/take_damage(brute, burn, sharp, edge, used_weapon = null, list/forbidden_limbs = list()) +/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) @@ -991,7 +951,7 @@ Note that amputating the affected organ does in fact remove the infection from t if (burn_dam > 40) disfigure("burn") -/datum/organ/external/head/proc/disfigure(var/type = "brute") +/obj/item/organ/external/head/proc/disfigure(var/type = "brute") if (disfigured) return if(type == "brute") @@ -1008,12 +968,12 @@ Note that amputating the affected organ does in fact remove the infection from t EXTERNAL ORGAN ITEMS ****************************************************/ -obj/item/weapon/organ +/obj/item/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) +/obj/item/organ/New(loc, mob/living/carbon/human/H) ..(loc) if(!istype(H)) return @@ -1023,14 +983,13 @@ obj/item/weapon/organ/New(loc, mob/living/carbon/human/H) blood_DNA[H.dna.unique_enzymes] = H.dna.b_type // Transferring over organs from the host. - for(var/datum/organ/internal/I in H.internal_organs) + for(var/obj/item/organ/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 + organs_internal |= current_organ // Forming icon for the limb // Setting base icon for this mob's race @@ -1062,35 +1021,35 @@ obj/item/weapon/organ/New(loc, mob/living/carbon/human/H) EXTERNAL ORGAN ITEMS DEFINES ****************************************************/ -obj/item/weapon/organ/l_arm +/obj/item/organ/l_arm name = "left arm" icon_state = "l_arm" -obj/item/weapon/organ/l_foot +/obj/item/organ/l_foot name = "left foot" icon_state = "l_foot" -obj/item/weapon/organ/l_hand +/obj/item/organ/l_hand name = "left hand" icon_state = "l_hand" -obj/item/weapon/organ/l_leg +/obj/item/organ/l_leg name = "left leg" icon_state = "l_leg" -obj/item/weapon/organ/r_arm +/obj/item/organ/r_arm name = "right arm" icon_state = "r_arm" -obj/item/weapon/organ/r_foot +/obj/item/organ/r_foot name = "right foot" icon_state = "r_foot" -obj/item/weapon/organ/r_hand +/obj/item/organ/r_hand name = "right hand" icon_state = "r_hand" -obj/item/weapon/organ/r_leg +/obj/item/organ/r_leg name = "right leg" icon_state = "r_leg" -obj/item/weapon/organ/head +/obj/item/organ/head name = "head" icon_state = "head_m" -obj/item/weapon/organ/head/New(loc, mob/living/carbon/human/H) +/obj/item/organ/head/New(loc, mob/living/carbon/human/H) if(istype(H)) src.icon_state = H.gender == MALE? "head_m" : "head_f" ..() @@ -1116,7 +1075,7 @@ obj/item/weapon/organ/head/New(loc, mob/living/carbon/human/H) name = "[H.real_name]'s head" H.regenerate_icons() -obj/item/weapon/organ/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/organ/attackby(obj/item/weapon/W as obj, mob/user as mob) switch(op_stage) if(0) if(istype(W,/obj/item/weapon/scalpel)) @@ -1137,9 +1096,35 @@ obj/item/weapon/organ/attackby(obj/item/weapon/W as obj, mob/user as mob) user.put_in_hands(removing) if(istype(removing,/obj/item/organ)) var/obj/item/organ/removed_organ = removing - organs_internal -= removed_organ.organ_data + organs_internal -= removed_organ user.visible_message("[user] extracts [removing] from [src] with [W]!") else user.visible_message("[user] fishes around fruitlessly in [src] with [W].") return - ..() \ No newline at end of file + ..() + +/obj/item/organ/external/proc/is_dislocated() + if(dislocated) + return 1 + if(parent) + return parent.is_dislocated() + return 0 + +/obj/item/organ/external/proc/dislocate(var/primary) + if(dislocated != -1) + if(primary) + dislocated = 2 + else + dislocated = 1 + if(children && children.len) + for(var/obj/item/organ/external/child in children) + child.dislocate() + +/obj/item/organ/external/proc/undislocate() + if(dislocated != -1) + dislocated = 0 + if(children && children.len) + for(var/obj/item/organ/external/child in children) + child.undislocate() + if(owner) + owner.shock_stage += 20 diff --git a/code/modules/organs/organ_internal.dm b/code/modules/organs/organ_internal.dm index b6154242b9..8f32f51bc4 100644 --- a/code/modules/organs/organ_internal.dm +++ b/code/modules/organs/organ_internal.dm @@ -1,296 +1,182 @@ #define PROCESS_ACCURACY 10 -/**************************************************** - INTERNAL ORGANS -****************************************************/ - -/mob/living/carbon/var/list/internal_organs = list() - -/datum/organ/internal - var/damage = 0 // amount of damage to the organ - var/min_bruised_damage = 10 - var/min_broken_damage = 30 - var/parent_organ = "chest" - var/robotic = 0 //For being a robot - var/removed_type //When removed, forms this object. - 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 - -/datum/organ/internal/proc/is_bruised() - return damage >= min_bruised_damage - -/datum/organ/internal/proc/is_broken() - return damage >= min_broken_damage || status & ORGAN_CUT_AWAY - -/datum/organ/internal/New(mob/living/carbon/M) - ..() - if(M && istype(M)) - - M.internal_organs |= src - src.owner = M - - var/mob/living/carbon/human/H = M - if(istype(H)) - var/datum/organ/external/E = H.organs_by_name[src.parent_organ] - if(E.internal_organs == null) - E.internal_organs = list() - E.internal_organs |= src - -/datum/organ/internal/process() - - //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 - - if(owner.bodytemperature >= 170) //cryo stops germs from moving and doing their bad stuffs - //** Handle antibiotics and curing infections - handle_antibiotics() - - //** 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_TWO) - var/datum/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)) - - // Process unsuitable transplants. TODO: consider some kind of - // immunosuppressant that changes transplant data to make it match. - if(transplant_data) - if(!rejecting && prob(20) && owner.dna && blood_incompatible(transplant_data["blood_type"],owner.dna.b_type,owner.species,transplant_data["species"])) - rejecting = 1 - else - rejecting++ //Rejection severity increases over time. - if(rejecting % 10 == 0) //Only fire every ten rejection ticks. - switch(rejecting) - if(1 to 50) - take_damage(1) - if(51 to 200) - owner.reagents.add_reagent("toxin", 1) - take_damage(1) - if(201 to 500) - take_damage(rand(2,3)) - owner.reagents.add_reagent("toxin", 2) - if(501 to INFINITY) - take_damage(4) - owner.reagents.add_reagent("toxin", rand(3,5)) - -/datum/organ/internal/proc/take_damage(amount, var/silent=0) - if(src.robotic == 2) - src.damage += (amount * 0.8) - else - src.damage += amount - - var/datum/organ/external/parent = owner.get_organ(parent_organ) - if (!silent) - owner.custom_pain("Something inside your [parent.display_name] hurts a lot.", 1) - -/datum/organ/internal/proc/emp_act(severity) - switch(robotic) - if(0) - return - if(1) - switch (severity) - if (1.0) - take_damage(20,0) - return - if (2.0) - take_damage(7,0) - return - if(3.0) - take_damage(3,0) - return - if(2) - switch (severity) - if (1.0) - take_damage(40,0) - return - if (2.0) - take_damage(15,0) - return - if(3.0) - take_damage(10,0) - return - -/datum/organ/internal/proc/mechanize() //Being used to make robutt hearts, etc - robotic = 2 - -/datum/organ/internal/proc/mechassist() //Used to add things like pacemakers, etc - robotic = 1 - min_bruised_damage = 15 - min_broken_damage = 35 - /**************************************************** INTERNAL ORGANS DEFINES ****************************************************/ -/datum/organ/internal/heart // This is not set to vital because death immediately occurs in blood.dm if it is removed. + +// Brain is defined in brain_item.dm. +/obj/item/organ/heart name = "heart" + icon_state = "heart-on" + organ_tag = "heart" parent_organ = "chest" - removed_type = /obj/item/organ/heart -/datum/organ/internal/lungs +/obj/item/organ/lungs name = "lungs" + icon_state = "lungs" + gender = PLURAL + organ_tag = "lungs" parent_organ = "chest" - removed_type = /obj/item/organ/lungs - process() - ..() - if (germ_level > INFECTION_LEVEL_ONE) - if(prob(5)) - owner.emote("cough") //respitory tract infection +/obj/item/organ/lungs/process() + ..() - if(is_bruised()) - if(prob(2)) - spawn owner.emote("me", 1, "coughs up blood!") - owner.drip(10) - if(prob(4)) - spawn owner.emote("me", 1, "gasps for air!") - owner.losebreath += 15 + if(!owner) + return -/datum/organ/internal/liver - name = "liver" - parent_organ = "chest" - removed_type = /obj/item/organ/liver + if (germ_level > INFECTION_LEVEL_ONE) + if(prob(5)) + owner.emote("cough") //respitory tract infection - process() + if(is_bruised()) + if(prob(2)) + spawn owner.emote("me", 1, "coughs up blood!") + owner.drip(10) + if(prob(4)) + spawn owner.emote("me", 1, "gasps for air!") + owner.losebreath += 15 - ..() - - 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("anti_toxin")) - //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/datum/organ/internal/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("anti_toxin")) - 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 - - // Do some reagent filtering/processing. - for(var/datum/reagent/R in owner.reagents.reagent_list) - // Damaged liver means some chemicals are very dangerous - // The liver is also responsible for clearing out alcohol and toxins. - // Ethanol and all drinks are bad.K - if(istype(R, /datum/reagent/ethanol)) - if(filter_effect < 3) - owner.adjustToxLoss(0.1 * PROCESS_ACCURACY) - owner.reagents.remove_reagent(R.id, R.custom_metabolism*filter_effect) - // Can't cope with toxins at all - else if(istype(R, /datum/reagent/toxin)) - if(filter_effect < 3) - owner.adjustToxLoss(0.3 * PROCESS_ACCURACY) - owner.reagents.remove_reagent(R.id, ALCOHOL_METABOLISM*filter_effect) - -/datum/organ/internal/kidney +/obj/item/organ/kidneys name = "kidneys" + icon_state = "kidneys" + gender = PLURAL + organ_tag = "kidneys" parent_organ = "groin" - removed_type = /obj/item/organ/kidneys - process() +/obj/item/organ/kidney/process() - ..() + ..() - // 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) + if(!owner) + return -/datum/organ/internal/brain - name = "brain" - parent_organ = "head" - removed_type = /obj/item/organ/brain - vital = 1 - -/datum/organ/internal/brain/xeno - removed_type = /obj/item/organ/brain/xeno - -/datum/organ/internal/brain/golem - name = "golem chem" - removed_type = /obj/item/organ/brain/golem - -/datum/organ/internal/brain/slime - name = "slime core" - removed_type = /obj/item/organ/brain/slime - -/datum/organ/internal/eyes - name = "eyes" - parent_organ = "head" - removed_type = /obj/item/organ/eyes - - process() //Eye damage replaces the old eye_stat var. - ..() + // 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.eye_blurry = 20 + owner.adjustToxLoss(0.1 * PROCESS_ACCURACY) + else if(is_broken()) + owner.adjustToxLoss(0.3 * PROCESS_ACCURACY) + + +/obj/item/organ/eyes + name = "eyeballs" + icon_state = "eyes" + gender = PLURAL + organ_tag = "eyes" + parent_organ = "head" + var/eye_colour + +/obj/item/organ/eyes/process() //Eye damage replaces the old eye_stat var. + ..() + if(!owner) + return + if(is_bruised()) + owner.eye_blurry = 20 + if(is_broken()) + owner.eye_blind = 20 + +/obj/item/organ/eyes/removed(var/mob/living/target,var/mob/living/user) + + if(!eye_colour) + eye_colour = list(0,0,0) + + ..() //Make sure target is set so we can steal their eye colour for later. + var/mob/living/carbon/human/H = target + if(istype(H)) + eye_colour = list( + H.r_eyes ? H.r_eyes : 0, + H.g_eyes ? H.g_eyes : 0, + H.b_eyes ? H.b_eyes : 0 + ) + + // Leave bloody red pits behind! + H.r_eyes = 128 + H.g_eyes = 0 + H.b_eyes = 0 + H.update_body() + + +/obj/item/organ/liver + name = "liver" + icon_state = "liver" + organ_tag = "liver" + parent_organ = "chest" + +/obj/item/organ/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("anti_toxin")) + //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("anti_toxin")) + 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()) - owner.eye_blind = 20 + filter_effect -= 2 -/datum/organ/internal/appendix + // Do some reagent filtering/processing. + for(var/datum/reagent/R in owner.reagents.reagent_list) + // Damaged liver means some chemicals are very dangerous + // The liver is also responsible for clearing out alcohol and toxins. + // Ethanol and all drinks are bad.K + if(istype(R, /datum/reagent/ethanol)) + if(filter_effect < 3) + owner.adjustToxLoss(0.1 * PROCESS_ACCURACY) + owner.reagents.remove_reagent(R.id, R.custom_metabolism*filter_effect) + // Can't cope with toxins at all + else if(istype(R, /datum/reagent/toxin)) + if(filter_effect < 3) + owner.adjustToxLoss(0.3 * PROCESS_ACCURACY) + owner.reagents.remove_reagent(R.id, ALCOHOL_METABOLISM*filter_effect) + +/obj/item/organ/appendix name = "appendix" + icon_state = "appendix" parent_organ = "groin" - removed_type = /obj/item/organ/appendix -/datum/organ/internal/proc/remove(var/mob/user) +/obj/item/organ/appendix/removed(var/mob/living/target,var/mob/living/user) - if(!removed_type) return 0 + ..() - var/turf/target_loc - if(user) - target_loc = get_turf(user) - else - target_loc = get_turf(owner) + var/inflamed = 0 + for(var/datum/disease/appendicitis/appendicitis in target.viruses) + inflamed = 1 + appendicitis.cure() + target.resistances += appendicitis - var/obj/item/organ/removed_organ = new removed_type(target_loc) - - if(istype(removed_organ)) - removed_organ.organ_data = src - removed_organ.update() - organ_holder = removed_organ - - return removed_organ \ No newline at end of file + if(inflamed) + icon_state = "appendixinflamed" + name = "inflamed appendix" \ No newline at end of file diff --git a/code/modules/organs/organ_objects.dm b/code/modules/organs/organ_objects.dm deleted file mode 100644 index 610e702ad1..0000000000 --- a/code/modules/organs/organ_objects.dm +++ /dev/null @@ -1,270 +0,0 @@ -/obj/item/organ - name = "organ" - desc = "It looks like it probably just plopped out." - icon = 'icons/obj/surgery.dmi' - icon_state = "appendix" - - health = 100 // Process() ticks before death. - - var/fresh = 3 // Squirts of blood left in it. - var/dead_icon // Icon used when the organ dies. - var/robotic // Is the limb prosthetic? - var/organ_tag // What slot does it go in? - var/organ_type = /datum/organ/internal // Used to spawn the relevant organ data when produced via a machine or spawn(). - var/datum/organ/internal/organ_data // Stores info when removed. - var/prosthetic_name = "prosthetic organ" // Flavour string for robotic organ. - var/prosthetic_icon // Icon for robotic organ. - -/obj/item/organ/attack_self(mob/user as mob) - - // Convert it to an edible form, yum yum. - if(!robotic && user.a_intent == "help" && user.zone_sel.selecting == "mouth") - bitten(user) - return - -/obj/item/organ/New() - ..() - create_reagents(5) - if(!robotic) - processing_objects += src - spawn(1) - update() - -/obj/item/organ/Del() - if(!robotic) processing_objects -= src - ..() - -/obj/item/organ/process() - - if(robotic) - processing_objects -= src - 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 - - if(fresh && prob(40)) - fresh-- - var/datum/reagent/blood/B = locate(/datum/reagent/blood) in reagents.reagent_list - blood_splatter(src,B,1) - - health -= rand(1,3) - if(health <= 0) - die() - -/obj/item/organ/proc/die() - name = "dead [initial(name)]" - if(dead_icon) icon_state = dead_icon - health = 0 - processing_objects -= src - //TODO: Grey out the icon state. - //TODO: Inject an organ with peridaxon to make it alive again. - -/obj/item/organ/proc/roboticize() - - robotic = (organ_data && organ_data.robotic) ? organ_data.robotic : 1 - - if(prosthetic_name) - name = prosthetic_name - - if(prosthetic_icon) - icon_state = prosthetic_icon - else - //TODO: convert to greyscale. - -/obj/item/organ/proc/update() - - if(!organ_data) - organ_data = new /datum/organ/internal() - - if(robotic) - organ_data.robotic = robotic - - if(organ_data.robotic >= 2) - roboticize() - -// Brain is defined in brain_item.dm. -/obj/item/organ/heart - name = "heart" - icon_state = "heart-on" - prosthetic_name = "circulatory pump" - prosthetic_icon = "heart-prosthetic" - organ_tag = "heart" - fresh = 6 // Juicy. - dead_icon = "heart-off" - -/obj/item/organ/lungs - name = "lungs" - icon_state = "lungs" - gender = PLURAL - prosthetic_name = "gas exchange system" - prosthetic_icon = "lungs-prosthetic" - organ_tag = "lungs" - -/obj/item/organ/kidneys - name = "kidneys" - icon_state = "kidneys" - gender = PLURAL - prosthetic_name = "prosthetic kidneys" - prosthetic_icon = "kidneys-prosthetic" - organ_tag = "kidneys" - -/obj/item/organ/eyes - name = "eyeballs" - icon_state = "eyes" - gender = PLURAL - prosthetic_name = "visual prosthesis" - prosthetic_icon = "eyes-prosthetic" - organ_tag = "eyes" - - var/eye_colour - -/obj/item/organ/liver - name = "liver" - icon_state = "liver" - prosthetic_name = "toxin filter" - prosthetic_icon = "liver-prosthetic" - organ_tag = "liver" - -/obj/item/organ/appendix - name = "appendix" - icon_state = "appendix" - organ_tag = "appendix" - -//These are here so they can be printed out via the fabricator. -/obj/item/organ/heart/prosthetic - robotic = 2 - -/obj/item/organ/lungs/prosthetic - robotic = 2 - -/obj/item/organ/kidneys/prosthetic - robotic = 2 - -/obj/item/organ/eyes/prosthetic - robotic = 2 - -/obj/item/organ/liver/prosthetic - robotic = 2 - -/obj/item/organ/appendix - name = "appendix" - -/obj/item/organ/proc/removed(var/mob/living/carbon/human/target,var/mob/living/user) - - if(!istype(target) || !organ_data) - return - - 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()]\] removed a vital organ ([src]) from [target.name] ([target.ckey]) (INTENT: [uppertext(user.a_intent)])" - target.attack_log += "\[[time_stamp()]\] had a vital organ ([src]) removed by [user.name] ([user.ckey]) (INTENT: [uppertext(user.a_intent)])" - msg_admin_attack("[user.name] ([user.ckey]) removed a vital organ ([src]) from [target.name] ([target.ckey]) (INTENT: [uppertext(user.a_intent)]) (JMP)") - target.death() - -/obj/item/organ/appendix/removed(var/mob/living/target,var/mob/living/user) - - ..() - - var/inflamed = 0 - for(var/datum/disease/appendicitis/appendicitis in target.viruses) - inflamed = 1 - appendicitis.cure() - target.resistances += appendicitis - - if(inflamed) - icon_state = "appendixinflamed" - name = "inflamed appendix" - -/obj/item/organ/eyes/removed(var/mob/living/target,var/mob/living/user) - - if(!eye_colour) - eye_colour = list(0,0,0) - - ..() //Make sure target is set so we can steal their eye colour for later. - var/mob/living/carbon/human/H = target - if(istype(H)) - eye_colour = list( - H.r_eyes ? H.r_eyes : 0, - H.g_eyes ? H.g_eyes : 0, - H.b_eyes ? H.b_eyes : 0 - ) - - // Leave bloody red pits behind! - H.r_eyes = 128 - H.g_eyes = 0 - H.b_eyes = 0 - H.update_body() - -/obj/item/organ/proc/replaced(var/mob/living/carbon/human/target,var/datum/organ/external/affected) - - 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. - 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) - - if(robotic) - return - - user << "\blue You take an experimental bite out of \the [src]." - var/datum/reagent/blood/B = locate(/datum/reagent/blood) in reagents.reagent_list - blood_splatter(src,B,1) - - - user.drop_from_inventory(src) - var/obj/item/weapon/reagent_containers/food/snacks/organ/O = new(get_turf(src)) - O.name = name - O.icon_state = dead_icon ? dead_icon : icon_state - - // Pass over the blood. - reagents.trans_to(O, reagents.total_volume) - - if(fingerprints) O.fingerprints = fingerprints.Copy() - if(fingerprintshidden) O.fingerprintshidden = fingerprintshidden.Copy() - if(fingerprintslast) O.fingerprintslast = fingerprintslast - - user.put_in_active_hand(O) - del(src) \ No newline at end of file diff --git a/code/modules/organs/pain.dm b/code/modules/organs/pain.dm index 49cc2073df..c1521650af 100644 --- a/code/modules/organs/pain.dm +++ b/code/modules/organs/pain.dm @@ -87,8 +87,8 @@ mob/living/carbon/human/proc/handle_pain() if(analgesic) return var/maxdam = 0 - var/datum/organ/external/damaged_organ = null - for(var/datum/organ/external/E in organs) + var/obj/item/organ/external/damaged_organ = null + for(var/obj/item/organ/external/E in organs) // amputated limbs don't cause pain if(E.amputated) continue if(E.status & ORGAN_DEAD) continue @@ -102,9 +102,9 @@ mob/living/carbon/human/proc/handle_pain() pain(damaged_organ.display_name, maxdam, 0) // Damage to internal organs hurts a lot. - for(var/datum/organ/internal/I in internal_organs) + for(var/obj/item/organ/I in internal_organs) if(I.damage > 2) if(prob(2)) - var/datum/organ/external/parent = get_organ(I.parent_organ) + var/obj/item/organ/external/parent = get_organ(I.parent_organ) src.custom_pain("You feel a sharp pain in your [parent.display_name]", 1) var/toxDamageMessage = null diff --git a/code/modules/paperwork/paperbin.dm b/code/modules/paperwork/paperbin.dm index 43ed04b0d0..c52dc3080f 100644 --- a/code/modules/paperwork/paperbin.dm +++ b/code/modules/paperwork/paperbin.dm @@ -23,7 +23,7 @@ /obj/item/weapon/paper_bin/attack_hand(mob/user as mob) if (hasorgans(user)) - var/datum/organ/external/temp = user:organs_by_name["r_hand"] + var/obj/item/organ/external/temp = user:organs_by_name["r_hand"] if (user.hand) temp = user:organs_by_name["l_hand"] if(temp && !temp.is_usable()) diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 4c0d9dfbf7..480058f9a9 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -516,7 +516,7 @@ obj/structure/cable/proc/cableColor(var/colorC) /obj/item/stack/cable_coil/attack(mob/M as mob, mob/user as mob) if(istype(M,/mob/living/carbon/human)) var/mob/living/carbon/human/H = M - var/datum/organ/external/S = H.get_organ(user.zone_sel.selecting) + var/obj/item/organ/external/S = H.get_organ(user.zone_sel.selecting) if(!(S.status & ORGAN_ROBOT) || user.a_intent != "help") return ..() diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index 4f08f6f0c3..5f29b8ded6 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -676,7 +676,7 @@ datum if(prob(50)) M.radiation += 50 // curing it that way may kill you instead var/absorbed - var/datum/organ/internal/diona/nutrients/rad_organ = locate() in C.internal_organs + var/obj/item/organ/diona/nutrients/rad_organ = locate() in C.internal_organs if(rad_organ && !rad_organ.is_broken()) absorbed = 1 if(!absorbed) @@ -1290,7 +1290,7 @@ datum M.eye_blind = max(M.eye_blind-5 , 0) if(ishuman(M)) var/mob/living/carbon/human/H = M - var/datum/organ/internal/eyes/E = H.internal_organs_by_name["eyes"] + var/obj/item/organ/eyes/E = H.internal_organs_by_name["eyes"] if(E && istype(E)) if(E.damage > 0) E.damage = max(E.damage - 1, 0) @@ -1312,7 +1312,7 @@ datum var/mob/living/carbon/human/H = M //Peridaxon heals only non-robotic organs - for(var/datum/organ/internal/I in H.internal_organs) + for(var/obj/item/organ/I in H.internal_organs) if((I.damage > 0) && (I.robotic != 2)) I.damage = max(I.damage - 0.20, 0) ..() @@ -2074,7 +2074,7 @@ datum if(!M.unacidable) if(istype(M, /mob/living/carbon/human) && volume >= 10) var/mob/living/carbon/human/H = M - var/datum/organ/external/affecting = H.get_organ("head") + var/obj/item/organ/external/affecting = H.get_organ("head") if(affecting) if(affecting.take_damage(4*toxpwr, 2*toxpwr)) H.UpdateDamageIcon() @@ -3349,7 +3349,7 @@ datum M:drowsyness = max(M:drowsyness, 30) if(ishuman(M)) var/mob/living/carbon/human/H = M - var/datum/organ/internal/liver/L = H.internal_organs_by_name["liver"] + var/obj/item/organ/liver/L = H.internal_organs_by_name["liver"] if (!L) H.adjustToxLoss(5) else if(istype(L)) @@ -3671,13 +3671,13 @@ datum if(prob(30)) M.adjustToxLoss(2) if(prob(5)) if(ishuman(M)) var/mob/living/carbon/human/H = M - var/datum/organ/internal/heart/L = H.internal_organs_by_name["heart"] + var/obj/item/organ/heart/L = H.internal_organs_by_name["heart"] if (L && istype(L)) L.take_damage(5, 0) if (300 to INFINITY) if(ishuman(M)) var/mob/living/carbon/human/H = M - var/datum/organ/internal/heart/L = H.internal_organs_by_name["heart"] + var/obj/item/organ/heart/L = H.internal_organs_by_name["heart"] if (L && istype(L)) L.take_damage(100, 0) holder.remove_reagent(src.id, FOOD_METABOLISM) diff --git a/code/modules/reagents/reagent_containers/food/drinks/bottle.dm b/code/modules/reagents/reagent_containers/food/drinks/bottle.dm index 52a4ba12ba..f5269c949e 100644 --- a/code/modules/reagents/reagent_containers/food/drinks/bottle.dm +++ b/code/modules/reagents/reagent_containers/food/drinks/bottle.dm @@ -43,7 +43,7 @@ force = 15 //Smashing bottles over someoen's head hurts. - var/datum/organ/external/affecting = user.zone_sel.selecting //Find what the player is aiming at + var/obj/item/organ/external/affecting = user.zone_sel.selecting //Find what the player is aiming at var/armor_block = 0 //Get the target's armour values for normal attack damage. var/armor_duration = 0 //The more force the bottle has, the longer the duration. diff --git a/code/modules/reagents/reagent_containers/food/snacks.dm b/code/modules/reagents/reagent_containers/food/snacks.dm index 9ab669b4bb..15758bc676 100644 --- a/code/modules/reagents/reagent_containers/food/snacks.dm +++ b/code/modules/reagents/reagent_containers/food/snacks.dm @@ -1574,9 +1574,9 @@ surprise.transform *= 0.6 surprise.add_blood(M) var/mob/living/carbon/human/H = M - var/datum/organ/external/E = H.get_organ("chest") + var/obj/item/organ/external/E = H.get_organ("chest") E.fracture() - for (var/datum/organ/internal/I in E.internal_organs) + for (var/obj/item/organ/I in E.internal_organs) I.take_damage(rand(I.min_bruised_damage, I.min_broken_damage+1)) if (!E.hidden && prob(60)) //set it snuggly diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index 8aa34a7dca..e802cdeffb 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -235,7 +235,7 @@ if(istype(target, /mob/living/carbon/human)) var/target_zone = ran_zone(check_zone(user.zone_sel.selecting, target)) - var/datum/organ/external/affecting = target:get_organ(target_zone) + var/obj/item/organ/external/affecting = target:get_organ(target_zone) if (!affecting) return @@ -270,7 +270,7 @@ var/syringestab_amount_transferred = rand(0, (reagents.total_volume - 5)) //nerfed by popular demand src.reagents.trans_to(target, syringestab_amount_transferred) src.break_syringe(target, user) - + proc/break_syringe(mob/living/carbon/target, mob/living/carbon/user) src.desc += " It is broken." src.mode = SYRINGE_BROKEN diff --git a/code/modules/research/xenoarchaeology/artifact/effects/unknown_effect_heal.dm b/code/modules/research/xenoarchaeology/artifact/effects/unknown_effect_heal.dm index d1d3937c97..5a6e8a46db 100644 --- a/code/modules/research/xenoarchaeology/artifact/effects/unknown_effect_heal.dm +++ b/code/modules/research/xenoarchaeology/artifact/effects/unknown_effect_heal.dm @@ -13,7 +13,7 @@ if(ishuman(toucher)) var/mob/living/carbon/human/H = toucher - for(var/datum/organ/external/affecting in H.organs) + for(var/obj/item/organ/external/affecting in H.organs) if(affecting && istype(affecting)) affecting.heal_damage(25 * weakness, 25 * weakness) //H:heal_organ_damage(25, 25) diff --git a/code/modules/surgery/bones.dm b/code/modules/surgery/bones.dm index 605b1503d5..d48c39a80a 100644 --- a/code/modules/surgery/bones.dm +++ b/code/modules/surgery/bones.dm @@ -17,11 +17,11 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if (!hasorgans(target)) return 0 - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return affected.open >= 2 && affected.stage == 0 begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) if (affected.stage == 0) user.visible_message("[user] starts applying medication to the damaged bones in [target]'s [affected.display_name] with \the [tool]." , \ "You start applying medication to the damaged bones in [target]'s [affected.display_name] with \the [tool].") @@ -29,13 +29,13 @@ ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\blue [user] applies some [tool] to [target]'s bone in [affected.display_name]", \ "\blue You apply some [tool] to [target]'s bone in [affected.display_name] with \the [tool].") affected.stage = 1 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\red [user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.display_name]!" , \ "\red Your hand slips, smearing [tool] in the incision in [target]'s [affected.display_name]!") @@ -51,18 +51,18 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if (!hasorgans(target)) return 0 - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return affected.name != "head" && affected.open >= 2 && affected.stage == 1 begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] is beginning to set the bone in [target]'s [affected.display_name] in place with \the [tool]." , \ "You are beginning to set the bone in [target]'s [affected.display_name] in place with \the [tool].") target.custom_pain("The pain in your [affected.display_name] is going to make you pass out!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) if (affected.status & ORGAN_BROKEN) user.visible_message("\blue [user] sets the bone in [target]'s [affected.display_name] in place with \the [tool].", \ "\blue You set the bone in [target]'s [affected.display_name] in place with \the [tool].") @@ -73,7 +73,7 @@ affected.fracture() fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\red [user]'s hand slips, damaging the bone in [target]'s [affected.display_name] with \the [tool]!" , \ "\red Your hand slips, damaging the bone in [target]'s [affected.display_name] with \the [tool]!") affected.createwound(BRUISE, 5) @@ -90,7 +90,7 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if (!hasorgans(target)) return 0 - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return affected.name == "head" && affected.open >= 2 && affected.stage == 1 begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -99,16 +99,16 @@ ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\blue [user] sets [target]'s skull with \the [tool]." , \ "\blue You set [target]'s skull with \the [tool].") affected.stage = 2 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\red [user]'s hand slips, damaging [target]'s face with \the [tool]!" , \ "\red Your hand slips, damaging [target]'s face with \the [tool]!") - var/datum/organ/external/head/h = affected + var/obj/item/organ/external/head/h = affected h.createwound(BRUISE, 10) h.disfigured = 1 @@ -126,17 +126,17 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if (!hasorgans(target)) return 0 - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return affected.open >= 2 && affected.stage == 2 begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] starts to finish mending the damaged bones in [target]'s [affected.display_name] with \the [tool].", \ "You start to finish mending the damaged bones in [target]'s [affected.display_name] with \the [tool].") ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\blue [user] has mended the damaged bones in [target]'s [affected.display_name] with \the [tool]." , \ "\blue You have mended the damaged bones in [target]'s [affected.display_name] with \the [tool]." ) affected.status &= ~ORGAN_BROKEN @@ -145,6 +145,6 @@ affected.perma_injury = 0 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\red [user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.display_name]!" , \ "\red Your hand slips, smearing [tool] in the incision in [target]'s [affected.display_name]!") \ No newline at end of file diff --git a/code/modules/surgery/brainrepair.dm b/code/modules/surgery/brainrepair.dm index 85b5dd8dd3..626866a2c5 100644 --- a/code/modules/surgery/brainrepair.dm +++ b/code/modules/surgery/brainrepair.dm @@ -14,8 +14,8 @@ max_duration = 100 can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) - var/datum/organ/internal/brain/sponge = target.internal_organs_by_name["brain"] + var/obj/item/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/brain/sponge = target.internal_organs_by_name["brain"] return (sponge && sponge.damage > 0 && sponge.damage <= 20) && affected.open == 3 begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -26,7 +26,7 @@ end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) user.visible_message("\blue [user] takes out all the bone chips in [target]'s brain with \the [tool].", \ "\blue You take out all the bone chips in [target]'s brain with \the [tool].") - var/datum/organ/internal/brain/sponge = target.internal_organs_by_name["brain"] + var/obj/item/organ/brain/sponge = target.internal_organs_by_name["brain"] if (sponge) sponge.damage = 0 @@ -46,8 +46,8 @@ max_duration = 110 can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) - var/datum/organ/internal/brain/sponge = target.internal_organs_by_name["brain"] + var/obj/item/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/brain/sponge = target.internal_organs_by_name["brain"] return (sponge && sponge.damage > 20) && affected.open == 3 begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -58,7 +58,7 @@ end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) user.visible_message("\blue [user] mends hematoma in [target]'s brain with \the [tool].", \ "\blue You mend hematoma in [target]'s brain with \the [tool].") - var/datum/organ/internal/brain/sponge = target.internal_organs_by_name["brain"] + var/obj/item/organ/brain/sponge = target.internal_organs_by_name["brain"] if (sponge) sponge.damage = 20 diff --git a/code/modules/surgery/encased.dm b/code/modules/surgery/encased.dm index 72cff7ab3d..288d756aa6 100644 --- a/code/modules/surgery/encased.dm +++ b/code/modules/surgery/encased.dm @@ -11,7 +11,7 @@ if (!hasorgans(target)) return 0 - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return affected.encased && affected.open >= 2 @@ -27,14 +27,14 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if (!hasorgans(target)) return - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return ..() && affected.open == 2 begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if (!hasorgans(target)) return - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] begins to cut through [target]'s [affected.encased] with \the [tool].", \ "You begin to cut through [target]'s [affected.encased] with \the [tool].") @@ -45,7 +45,7 @@ if (!hasorgans(target)) return - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\blue [user] has cut [target]'s [affected.encased] open with \the [tool].", \ "\blue You have cut [target]'s [affected.encased] open with \the [tool].") @@ -55,7 +55,7 @@ if (!hasorgans(target)) return - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\red [user]'s hand slips, cracking [target]'s [affected.encased] with \the [tool]!" , \ "\red Your hand slips, cracking [target]'s [affected.encased] with \the [tool]!" ) @@ -76,14 +76,14 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if (!hasorgans(target)) return - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return ..() && affected.open == 2.5 begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if (!hasorgans(target)) return - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) var/msg = "[user] starts to force open the [affected.encased] in [target]'s [affected.display_name] with \the [tool]." var/self_msg = "You start to force open the [affected.encased] in [target]'s [affected.display_name] with \the [tool]." @@ -95,7 +95,7 @@ if (!hasorgans(target)) return - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) var/msg = "\blue [user] forces open [target]'s [affected.encased] with \the [tool]." var/self_msg = "\blue You force open [target]'s [affected.encased] with \the [tool]." @@ -111,7 +111,7 @@ if (!hasorgans(target)) return - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) var/msg = "\red [user]'s hand slips, cracking [target]'s [affected.encased]!" var/self_msg = "\red Your hand slips, cracking [target]'s [affected.encased]!" @@ -133,14 +133,14 @@ if (!hasorgans(target)) return - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return ..() && affected.open == 3 begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if (!hasorgans(target)) return - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) var/msg = "[user] starts bending [target]'s [affected.encased] back into place with \the [tool]." var/self_msg = "You start bending [target]'s [affected.encased] back into place with \the [tool]." @@ -152,7 +152,7 @@ if (!hasorgans(target)) return - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) var/msg = "\blue [user] bends [target]'s [affected.encased] back into place with \the [tool]." var/self_msg = "\blue You bend [target]'s [affected.encased] back into place with \the [tool]." @@ -164,7 +164,7 @@ if (!hasorgans(target)) return - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) var/msg = "\red [user]'s hand slips, bending [target]'s [affected.encased] the wrong way!" var/self_msg = "\red Your hand slips, bending [target]'s [affected.encased] the wrong way!" @@ -190,14 +190,14 @@ if (!hasorgans(target)) return - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return ..() && affected.open == 2.5 begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if (!hasorgans(target)) return - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) var/msg = "[user] starts applying \the [tool] to [target]'s [affected.encased]." var/self_msg = "You start applying \the [tool] to [target]'s [affected.encased]." @@ -209,7 +209,7 @@ if (!hasorgans(target)) return - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) var/msg = "\blue [user] applied \the [tool] to [target]'s [affected.encased]." var/self_msg = "\blue You applied \the [tool] to [target]'s [affected.encased]." diff --git a/code/modules/surgery/eye.dm b/code/modules/surgery/eye.dm index 81170afc39..edc1c54c67 100644 --- a/code/modules/surgery/eye.dm +++ b/code/modules/surgery/eye.dm @@ -9,11 +9,11 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if (!hasorgans(target)) return 0 - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) if (!affected) return 0 - var/datum/organ/internal/eyes = target.internal_organs_by_name["eyes"] + var/obj/item/organ/eyes = target.internal_organs_by_name["eyes"] return target_zone == "eyes" && eyes @@ -42,8 +42,8 @@ target.blinded += 1.5 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/internal/eyes/eyes = target.internal_organs_by_name["eyes"] - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/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]!" ) affected.createwound(CUT, 10) @@ -72,8 +72,8 @@ target.op_stage.eyes = 2 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/internal/eyes/eyes = target.internal_organs_by_name["eyes"] - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/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]!") target.apply_damage(10, BRUTE, affected) @@ -103,8 +103,8 @@ target.op_stage.eyes = 3 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/internal/eyes/eyes = target.internal_organs_by_name["eyes"] - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/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!") target.apply_damage(10, BRUTE, affected, sharp=1) @@ -129,7 +129,7 @@ "You are beginning to cauterize the incision around [target]'s eyes with \the [tool].") end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/internal/eyes/eyes = target.internal_organs_by_name["eyes"] + var/obj/item/organ/eyes/eyes = target.internal_organs_by_name["eyes"] user.visible_message("\blue [user] cauterizes the incision around [target]'s eyes with \the [tool].", \ "\blue You cauterize the incision around [target]'s eyes with \the [tool].") if (target.op_stage.eyes == 3) @@ -139,8 +139,8 @@ target.op_stage.eyes = 0 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/internal/eyes/eyes = target.internal_organs_by_name["eyes"] - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/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]!") target.apply_damage(5, BURN, affected) diff --git a/code/modules/surgery/face.dm b/code/modules/surgery/face.dm index b5b22659f4..e25291eba5 100644 --- a/code/modules/surgery/face.dm +++ b/code/modules/surgery/face.dm @@ -9,7 +9,7 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if (!hasorgans(target)) return 0 - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) if (!affected) return 0 return target_zone == "mouth" @@ -38,7 +38,7 @@ target.op_stage.face = 1 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\red [user]'s hand slips, slicing [target]'s throat wth \the [tool]!" , \ "\red Your hand slips, slicing [target]'s throat wth \the [tool]!" ) affected.createwound(CUT, 60) @@ -95,7 +95,7 @@ target.op_stage.face = 3 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\red [user]'s hand slips, tearing skin on [target]'s face with \the [tool]!", \ "\red Your hand slips, tearing skin on [target]'s face with \the [tool]!") target.apply_damage(10, BRUTE, affected, sharp=1, sharp=1) @@ -120,18 +120,18 @@ ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\blue [user] cauterizes the incision on [target]'s face and neck with \the [tool].", \ "\blue You cauterize the incision on [target]'s face and neck with \the [tool].") affected.open = 0 affected.status &= ~ORGAN_BLEEDING if (target.op_stage.face == 3) - var/datum/organ/external/head/h = affected + var/obj/item/organ/external/head/h = affected h.disfigured = 0 target.op_stage.face = 0 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\red [user]'s hand slips, leaving a small burn on [target]'s face with \the [tool]!", \ "\red Your hand slips, leaving a small burn on [target]'s face with \the [tool]!") target.apply_damage(4, BURN, affected) \ No newline at end of file diff --git a/code/modules/surgery/generic.dm b/code/modules/surgery/generic.dm index b7a4bfa61c..0586fbc505 100644 --- a/code/modules/surgery/generic.dm +++ b/code/modules/surgery/generic.dm @@ -12,7 +12,7 @@ return 0 if (!hasorgans(target)) return 0 - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) if (affected == null) return 0 if (affected.status & ORGAN_DESTROYED) @@ -36,18 +36,18 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return affected.open == 0 && target_zone != "mouth" begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] starts the bloodless incision on [target]'s [affected.display_name] with \the [tool].", \ "You start the bloodless incision on [target]'s [affected.display_name] with \the [tool].") target.custom_pain("You feel a horrible, searing pain in your [affected.display_name]!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\blue [user] has made a bloodless incision on [target]'s [affected.display_name] with \the [tool].", \ "\blue You have made a bloodless incision on [target]'s [affected.display_name] with \the [tool].",) //Could be cleaner ... @@ -61,7 +61,7 @@ spread_germs_to_organ(affected, user) fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\red [user]'s hand slips as the blade sputters, searing a long gash in [target]'s [affected.display_name] with \the [tool]!", \ "\red Your hand slips as the blade sputters, searing a long gash in [target]'s [affected.display_name] with \the [tool]!") affected.createwound(CUT, 7.5) @@ -77,18 +77,18 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return affected.open == 0 && target_zone != "mouth" begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] starts to construct a prepared incision on and within [target]'s [affected.display_name] with \the [tool].", \ "You start to construct a prepared incision on and within [target]'s [affected.display_name] with \the [tool].") target.custom_pain("You feel a horrible, searing pain in your [affected.display_name] as it is pushed apart!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\blue [user] has constructed a prepared incision on and within [target]'s [affected.display_name] with \the [tool].", \ "\blue You have constructed a prepared incision on and within [target]'s [affected.display_name] with \the [tool].",) affected.open = 1 @@ -101,7 +101,7 @@ affected.open = 2 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\red [user]'s hand jolts as the system sparks, ripping a gruesome hole in [target]'s [affected.display_name] with \the [tool]!", \ "\red Your hand jolts as the system sparks, ripping a gruesome hole in [target]'s [affected.display_name] with \the [tool]!") affected.createwound(CUT, 20) @@ -119,18 +119,18 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return affected.open == 0 && target_zone != "mouth" begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] starts the incision on [target]'s [affected.display_name] with \the [tool].", \ "You start the incision on [target]'s [affected.display_name] with \the [tool].") target.custom_pain("You feel a horrible pain as if from a sharp knife in your [affected.display_name]!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\blue [user] has made an incision on [target]'s [affected.display_name] with \the [tool].", \ "\blue You have made an incision on [target]'s [affected.display_name] with \the [tool].",) affected.open = 1 @@ -141,7 +141,7 @@ affected.createwound(CUT, 1) fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\red [user]'s hand slips, slicing open [target]'s [affected.display_name] in the wrong place with \the [tool]!", \ "\red Your hand slips, slicing open [target]'s [affected.display_name] in the wrong place with \the [tool]!") affected.createwound(CUT, 10) @@ -158,25 +158,25 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return affected.open && (affected.status & ORGAN_BLEEDING) begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] starts clamping bleeders in [target]'s [affected.display_name] with \the [tool].", \ "You start clamping bleeders in [target]'s [affected.display_name] with \the [tool].") target.custom_pain("The pain in your [affected.display_name] is maddening!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\blue [user] clamps bleeders in [target]'s [affected.display_name] with \the [tool].", \ "\blue You clamp bleeders in [target]'s [affected.display_name] with \the [tool].") affected.clamp() spread_germs_to_organ(affected, user) fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\red [user]'s hand slips, tearing blood vessals and causing massive bleeding in [target]'s [affected.display_name] with \the [tool]!", \ "\red Your hand slips, tearing blood vessels and causing massive bleeding in [target]'s [affected.display_name] with \the [tool]!",) affected.createwound(CUT, 10) @@ -193,11 +193,11 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return affected.open == 1 //&& !(affected.status & ORGAN_BLEEDING) begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) var/msg = "[user] starts to pry open the incision on [target]'s [affected.display_name] with \the [tool]." var/self_msg = "You start to pry open the incision on [target]'s [affected.display_name] with \the [tool]." if (target_zone == "chest") @@ -211,7 +211,7 @@ ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) var/msg = "\blue [user] keeps the incision open on [target]'s [affected.display_name] with \the [tool]." var/self_msg = "\blue You keep the incision open on [target]'s [affected.display_name] with \the [tool]." if (target_zone == "chest") @@ -224,7 +224,7 @@ affected.open = 2 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) var/msg = "\red [user]'s hand slips, tearing the edges of the incision on [target]'s [affected.display_name] with \the [tool]!" var/self_msg = "\red Your hand slips, tearing the edges of the incision on [target]'s [affected.display_name] with \the [tool]!" if (target_zone == "chest") @@ -249,18 +249,18 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return affected.open && target_zone != "mouth" begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] is beginning to cauterize the incision on [target]'s [affected.display_name] with \the [tool]." , \ "You are beginning to cauterize the incision on [target]'s [affected.display_name] with \the [tool].") target.custom_pain("Your [affected.display_name] is being burned!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\blue [user] cauterizes the incision on [target]'s [affected.display_name] with \the [tool].", \ "\blue You cauterize the incision on [target]'s [affected.display_name] with \the [tool].") affected.open = 0 @@ -268,12 +268,12 @@ affected.status &= ~ORGAN_BLEEDING fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\red [user]'s hand slips, leaving a small burn on [target]'s [affected.display_name] with \the [tool]!", \ "\red Your hand slips, leaving a small burn on [target]'s [affected.display_name] with \the [tool]!") target.apply_damage(3, BURN, affected) -/datum/surgery_step/generic/cut_limb +/datum/surgery_step/generic/amputate allowed_tools = list( /obj/item/weapon/circular_saw = 100, \ /obj/item/weapon/hatchet = 75 @@ -287,7 +287,7 @@ return 0 if (!hasorgans(target)) return 0 - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) if (affected == null) return 0 if (affected.status & ORGAN_DESTROYED) @@ -295,20 +295,20 @@ return target_zone != "chest" && target_zone != "groin" && target_zone != "head" begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) - user.visible_message("[user] is beginning to cut off [target]'s [affected.display_name] with \the [tool]." , \ - "You are beginning to cut off [target]'s [affected.display_name] with \the [tool].") - target.custom_pain("Your [affected.display_name] is being ripped apart!",1) + var/obj/item/organ/external/affected = target.get_organ(target_zone) + user.visible_message("[user] is beginning to amputate [target]'s [affected.display_name] with \the [tool]." , \ + "You are beginning to cut through [target]'s [affected.amputation_point] with \the [tool].") + target.custom_pain("Your [affected.amputation_point] is being ripped apart!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\blue [user] cuts off [target]'s [affected.display_name] with \the [tool].", \ - "\blue You cut off [target]'s [affected.display_name] with \the [tool].") + var/obj/item/organ/external/affected = target.get_organ(target_zone) + user.visible_message("\blue [user] amputates [target]'s [affected.display_name] with \the [tool].", \ + "\blue You amputate [target]'s [affected.display_name] with \the [tool].") affected.droplimb(1,1,1) fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\red [user]'s hand slips, sawwing through the bone in [target]'s [affected.display_name] with \the [tool]!", \ "\red Your hand slips, sawwing through the bone in [target]'s [affected.display_name] with \the [tool]!") affected.createwound(CUT, 30) diff --git a/code/modules/surgery/headreattach.dm b/code/modules/surgery/headreattach.dm index 85a56a754e..5d3a83ada9 100644 --- a/code/modules/surgery/headreattach.dm +++ b/code/modules/surgery/headreattach.dm @@ -6,7 +6,7 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if (!hasorgans(target)) return 0 - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) if (!affected) return 0 if (!(affected.status & ORGAN_DESTROYED)) @@ -29,7 +29,7 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return !(affected.status & ORGAN_CUT_AWAY) begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -38,13 +38,13 @@ ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\blue [user] peels back tattered flesh where [target]'s head used to be with \the [tool].", \ "\blue You peel back tattered flesh where [target]'s head used to be with \the [tool].") affected.status |= ORGAN_CUT_AWAY fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) if (affected.parent) affected = affected.parent user.visible_message("\red [user]'s hand slips, ripping [target]'s [affected.display_name] open!", \ @@ -63,11 +63,11 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return affected.status & ORGAN_CUT_AWAY && target.op_stage.head_reattach == 0 && !(affected.status & ORGAN_ATTACHABLE) begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] is beginning to reshape [target]'s esophagal and vocal region with \the [tool].", \ "You start to reshape [target]'s [affected.display_name] esophagal and vocal region with \the [tool].") ..() @@ -78,7 +78,7 @@ target.op_stage.head_reattach = 1 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) if (affected.parent) affected = affected.parent user.visible_message("\red [user]'s hand slips, further rending flesh on [target]'s neck!", \ @@ -109,7 +109,7 @@ target.op_stage.head_reattach = 2 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) if (affected.parent) affected = affected.parent user.visible_message("\red [user]'s hand slips, ripping apart flesh on [target]'s neck!", \ @@ -137,7 +137,7 @@ ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\blue [user] has finished adjusting the area around [target]'s neck with \the [tool].", \ "\blue You have finished adjusting the area around [target]'s neck with \the [tool].") target.op_stage.head_reattach = 0 @@ -147,7 +147,7 @@ affected.open = 0 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) if (affected.parent) affected = affected.parent user.visible_message("\red [user]'s hand slips, searing [target]'s neck!", \ @@ -156,7 +156,7 @@ /datum/surgery_step/head/attach - allowed_tools = list(/obj/item/weapon/organ/head = 100) + allowed_tools = list(/obj/item/organ/head = 100) can_infect = 0 min_duration = 80 @@ -164,7 +164,7 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) - var/datum/organ/external/head = target.get_organ(target_zone) + var/obj/item/organ/external/head = target.get_organ(target_zone) return head.status & ORGAN_ATTACHABLE begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -172,7 +172,7 @@ "You start attaching [tool] to [target]'s reshaped neck.") end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\blue [user] has attached [target]'s head to the body.", \ "\blue You have attached [target]'s head to the body.") affected.status = 0 @@ -188,7 +188,7 @@ del(tool) fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\red [user]'s hand slips, damaging connectors on [target]'s neck!", \ "\red Your hand slips, damaging connectors on [target]'s neck!") target.apply_damage(10, BRUTE, affected, sharp=1) diff --git a/code/modules/surgery/implant.dm b/code/modules/surgery/implant.dm index 9a8c77e480..801bc10cc3 100644 --- a/code/modules/surgery/implant.dm +++ b/code/modules/surgery/implant.dm @@ -9,10 +9,10 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(!hasorgans(target)) return 0 - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return affected.open == (affected.encased ? 3 : 2) && !(affected.status & ORGAN_BLEEDING) - proc/get_max_wclass(datum/organ/external/affected) + proc/get_max_wclass(var/obj/item/organ/external/affected) switch (affected.name) if ("head") return 1 @@ -22,7 +22,7 @@ return 2 return 0 - proc/get_cavity(datum/organ/external/affected) + proc/get_cavity(var/obj/item/organ/external/affected) switch (affected.name) if ("head") return "cranial" @@ -44,11 +44,11 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return !affected.cavity && !affected.hidden begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] starts making some space inside [target]'s [get_cavity(affected)] cavity with \the [tool].", \ "You start making some space inside [target]'s [get_cavity(affected)] cavity with \the [tool]." ) target.custom_pain("The pain in your chest is living hell!",1) @@ -56,12 +56,12 @@ ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/chest/affected = target.get_organ(target_zone) + var/obj/item/organ/external/chest/affected = target.get_organ(target_zone) user.visible_message("\blue [user] makes some space inside [target]'s [get_cavity(affected)] cavity with \the [tool].", \ "\blue You make some space inside [target]'s [get_cavity(affected)] cavity with \the [tool]." ) fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/chest/affected = target.get_organ(target_zone) + var/obj/item/organ/external/chest/affected = target.get_organ(target_zone) user.visible_message("\red [user]'s hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!", \ "\red Your hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!") affected.createwound(CUT, 20) @@ -80,11 +80,11 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return affected.cavity begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] starts mending [target]'s [get_cavity(affected)] cavity wall with \the [tool].", \ "You start mending [target]'s [get_cavity(affected)] cavity wall with \the [tool]." ) target.custom_pain("The pain in your chest is living hell!",1) @@ -92,12 +92,12 @@ ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/chest/affected = target.get_organ(target_zone) + var/obj/item/organ/external/chest/affected = target.get_organ(target_zone) user.visible_message("\blue [user] mends [target]'s [get_cavity(affected)] cavity walls with \the [tool].", \ "\blue You mend [target]'s [get_cavity(affected)] cavity walls with \the [tool]." ) fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/chest/affected = target.get_organ(target_zone) + var/obj/item/organ/external/chest/affected = target.get_organ(target_zone) user.visible_message("\red [user]'s hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!", \ "\red Your hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!") affected.createwound(CUT, 20) @@ -111,18 +111,18 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return !istype(user,/mob/living/silicon/robot) && !affected.hidden && affected.cavity && tool.w_class <= get_max_wclass(affected) begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] starts putting \the [tool] inside [target]'s [get_cavity(affected)] cavity.", \ "You start putting \the [tool] inside [target]'s [get_cavity(affected)] cavity." ) target.custom_pain("The pain in your chest is living hell!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/chest/affected = target.get_organ(target_zone) + var/obj/item/organ/external/chest/affected = target.get_organ(target_zone) user.visible_message("\blue [user] puts \the [tool] inside [target]'s [get_cavity(affected)] cavity.", \ "\blue You put \the [tool] inside [target]'s [get_cavity(affected)] cavity." ) @@ -137,7 +137,7 @@ affected.cavity = 0 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/chest/affected = target.get_organ(target_zone) + var/obj/item/organ/external/chest/affected = target.get_organ(target_zone) user.visible_message("\red [user]'s hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!", \ "\red Your hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!") affected.createwound(CUT, 20) @@ -157,18 +157,18 @@ max_duration = 100 can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/internal/brain/sponge = target.internal_organs_by_name["brain"] + var/obj/item/organ/brain/sponge = target.internal_organs_by_name["brain"] return ..() && (!sponge || !sponge.damage) begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] starts poking around inside the incision on [target]'s [affected.display_name] with \the [tool].", \ "You start poking around inside the incision on [target]'s [affected.display_name] with \the [tool]" ) target.custom_pain("The pain in your chest is living hell!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/chest/affected = target.get_organ(target_zone) + var/obj/item/organ/external/chest/affected = target.get_organ(target_zone) var/find_prob = 0 @@ -223,7 +223,7 @@ "\blue You could not find anything inside [target]'s [affected.display_name]." ) fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/chest/affected = target.get_organ(target_zone) + var/obj/item/organ/external/chest/affected = target.get_organ(target_zone) user.visible_message("\red [user]'s hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!", \ "\red Your hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!") affected.createwound(CUT, 20) diff --git a/code/modules/surgery/organs_internal.dm b/code/modules/surgery/organs_internal.dm index c6e27d1e04..bd8204fca4 100644 --- a/code/modules/surgery/organs_internal.dm +++ b/code/modules/surgery/organs_internal.dm @@ -9,7 +9,7 @@ if (!hasorgans(target)) return 0 - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return affected.open == (affected.encased ? 3 : 2) ////////////////////////////////////////////////////////////////// @@ -34,7 +34,7 @@ if (!hasorgans(target)) return - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return ..() && embryo && affected.open == 3 && target_zone == "chest" begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -69,10 +69,10 @@ if (!hasorgans(target)) return - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) var/is_organ_damaged = 0 - for(var/datum/organ/internal/I in affected.internal_organs) + for(var/obj/item/organ/I in affected.internal_organs) if(I.damage > 0) is_organ_damaged = 1 break @@ -90,9 +90,9 @@ if (!hasorgans(target)) return - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) - for(var/datum/organ/internal/I in affected.internal_organs) + for(var/obj/item/organ/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].", \ @@ -113,9 +113,9 @@ if (!hasorgans(target)) return - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) - for(var/datum/organ/internal/I in affected.internal_organs) + for(var/obj/item/organ/I in affected.internal_organs) if(I && I.damage > 0) if(I.robotic < 2) user.visible_message("\blue [user] treats damage to [target]'s [I.name] with [tool_name].", \ @@ -126,7 +126,7 @@ if (!hasorgans(target)) return - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\red [user]'s hand slips, getting mess and tearing the inside of [target]'s [affected.display_name] with \the [tool]!", \ "\red Your hand slips, getting mess and tearing the inside of [target]'s [affected.display_name] with \the [tool]!") @@ -143,7 +143,7 @@ target.adjustToxLoss(10) affected.createwound(CUT, 5) - for(var/datum/organ/internal/I in affected.internal_organs) + for(var/obj/item/organ/I in affected.internal_organs) if(I && I.damage > 0) I.take_damage(dam_amt,0) @@ -161,10 +161,10 @@ if (!hasorgans(target)) return - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) var/is_organ_damaged = 0 - for(var/datum/organ/internal/I in affected.internal_organs) + for(var/obj/item/organ/I in affected.internal_organs) if(I.damage > 0 && I.robotic >= 2) is_organ_damaged = 1 break @@ -174,9 +174,9 @@ if (!hasorgans(target)) return - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) - for(var/datum/organ/internal/I in affected.internal_organs) + for(var/obj/item/organ/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.", \ @@ -189,9 +189,9 @@ if (!hasorgans(target)) return - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) - for(var/datum/organ/internal/I in affected.internal_organs) + for(var/obj/item/organ/I in affected.internal_organs) if(I && I.damage > 0) if(I.robotic >= 2) @@ -203,7 +203,7 @@ if (!hasorgans(target)) return - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\red [user]'s hand slips, gumming up the mechanisms inside of [target]'s [affected.display_name] with \the [tool]!", \ "\red Your hand slips, gumming up the mechanisms inside of [target]'s [affected.display_name] with \the [tool]!") @@ -211,7 +211,7 @@ target.adjustToxLoss(5) affected.createwound(CUT, 5) - for(var/datum/organ/internal/I in affected.internal_organs) + for(var/obj/item/organ/I in affected.internal_organs) if(I) I.take_damage(rand(3,5),0) @@ -236,7 +236,7 @@ var/list/attached_organs = list() for(var/organ in target.internal_organs_by_name) - var/datum/organ/internal/I = target.internal_organs_by_name[organ] + var/obj/item/organ/I = target.internal_organs_by_name[organ] if(!I.status && I.parent_organ == target_zone) attached_organs |= organ @@ -250,7 +250,7 @@ begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] starts to separate [target]'s [target.op_stage.current_organ] with \the [tool].", \ "You start to separate [target]'s [target.op_stage.current_organ] with \the [tool]." ) @@ -261,12 +261,12 @@ 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/datum/organ/internal/I = target.internal_organs_by_name[target.op_stage.current_organ] + var/obj/item/organ/I = target.internal_organs_by_name[target.op_stage.current_organ] if(I && istype(I)) I.status |= ORGAN_CUT_AWAY fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\red [user]'s hand slips, slicing an artery inside [target]'s [affected.display_name] with \the [tool]!", \ "\red Your hand slips, slicing an artery inside [target]'s [affected.display_name] with \the [tool]!") affected.createwound(CUT, rand(30,50), 1) @@ -291,7 +291,7 @@ var/list/removable_organs = list() for(var/organ in target.internal_organs_by_name) - var/datum/organ/internal/I = target.internal_organs_by_name[organ] + var/obj/item/organ/I = target.internal_organs_by_name[organ] if(I.status & ORGAN_CUT_AWAY && I.parent_organ == target_zone) removable_organs |= organ @@ -314,7 +314,7 @@ // Extract the organ! if(target.op_stage.current_organ) - var/datum/organ/internal/I = target.internal_organs_by_name[target.op_stage.current_organ] + var/obj/item/organ/I = target.internal_organs_by_name[target.op_stage.current_organ] var/obj/item/organ/O if(I && istype(I)) O = I.remove(user) @@ -323,7 +323,7 @@ target.op_stage.current_organ = null fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\red [user]'s hand slips, damaging the flesh in [target]'s [affected.display_name] with \the [tool]!", \ "\red Your hand slips, damaging the flesh in [target]'s [affected.display_name] with \the [tool]!") affected.createwound(BRUISE, 20) @@ -339,7 +339,7 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/O = tool - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) var/organ_compatible var/organ_missing @@ -367,7 +367,7 @@ user << "\red \The [target] already has [o_a][O.organ_tag]." return 2 - if(O.organ_data && affected.name == O.organ_data.parent_organ) + if(O && affected.name == O.parent_organ) organ_compatible = 1 else user << "\red \The [O.organ_tag] [o_do] normally go in \the [affected.display_name]." @@ -379,14 +379,14 @@ return ..() && organ_missing && organ_compatible begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] starts transplanting \the [tool] into [target]'s [affected.display_name].", \ "You start transplanting \the [tool] into [target]'s [affected.display_name].") target.custom_pain("Someone's rooting around in your [affected.display_name]!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\blue [user] has transplanted \the [tool] into [target]'s [affected.display_name].", \ "\blue You have transplanted \the [tool] into [target]'s [affected.display_name].") user.drop_item(tool) @@ -399,7 +399,7 @@ "\red Your hand slips, damaging \the [tool]!") var/obj/item/organ/I = tool if(istype(I)) - I.organ_data.take_damage(rand(3,5),0) + I.take_damage(rand(3,5),0) /datum/surgery_step/internal/attach_organ allowed_tools = list( @@ -419,7 +419,7 @@ var/list/removable_organs = list() for(var/organ in target.internal_organs_by_name) - var/datum/organ/internal/I = target.internal_organs_by_name[organ] + var/obj/item/organ/I = target.internal_organs_by_name[organ] if(I.status & ORGAN_CUT_AWAY && I.parent_organ == target_zone) removable_organs |= organ @@ -440,12 +440,12 @@ 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/datum/organ/internal/I = target.internal_organs_by_name[target.op_stage.current_organ] + var/obj/item/organ/I = target.internal_organs_by_name[target.op_stage.current_organ] if(I && istype(I)) I.status &= ~ORGAN_CUT_AWAY fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\red [user]'s hand slips, damaging the flesh in [target]'s [affected.display_name] with \the [tool]!", \ "\red Your hand slips, damaging the flesh in [target]'s [affected.display_name] with \the [tool]!") affected.createwound(BRUISE, 20) diff --git a/code/modules/surgery/other.dm b/code/modules/surgery/other.dm index c954c16de6..5b3519d46f 100644 --- a/code/modules/surgery/other.dm +++ b/code/modules/surgery/other.dm @@ -20,7 +20,7 @@ if(!hasorgans(target)) return 0 - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) var/internal_bleeding = 0 for(var/datum/wound/W in affected.wounds) if(W.internal) @@ -30,14 +30,14 @@ return affected.open >= 2 && internal_bleeding begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] starts patching the damaged vein in [target]'s [affected.display_name] with \the [tool]." , \ "You start patching the damaged vein in [target]'s [affected.display_name] with \the [tool].") target.custom_pain("The pain in [affected.display_name] is unbearable!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\blue [user] has patched the damaged vein in [target]'s [affected.display_name] with \the [tool].", \ "\blue You have patched the damaged vein in [target]'s [affected.display_name] with \the [tool].") @@ -47,7 +47,7 @@ if (ishuman(user) && prob(40)) user:bloody_hands(target, 0) fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\red [user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.display_name]!" , \ "\red Your hand slips, smearing [tool] in the incision in [target]'s [affected.display_name]!") affected.take_damage(5, 0) @@ -73,25 +73,25 @@ if (target_zone == "mouth" || target_zone == "eyes") return 0 - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return affected.open >= 2 && (affected.status & ORGAN_DEAD) begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] starts cutting away necrotic tissue in [target]'s [affected.display_name] with \the [tool]." , \ "You start cutting away necrotic tissue in [target]'s [affected.display_name] with \the [tool].") target.custom_pain("The pain in [affected.display_name] is unbearable!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\blue [user] has cut away necrotic tissue in [target]'s [affected.display_name] with \the [tool].", \ "\blue You have cut away necrotic tissue in [target]'s [affected.display_name] with \the [tool].") affected.open = 3 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\red [user]'s hand slips, slicing an artery inside [target]'s [affected.display_name] with \the [tool]!", \ "\red Your hand slips, slicing an artery inside [target]'s [affected.display_name] with \the [tool]!") affected.createwound(CUT, 20, 1) @@ -126,18 +126,18 @@ if (target_zone == "mouth" || target_zone == "eyes") return 0 - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return affected.open == 3 && (affected.status & ORGAN_DEAD) begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] starts applying medication to the affected tissue in [target]'s [affected.display_name] with \the [tool]." , \ "You start applying medication to the affected tissue in [target]'s [affected.display_name] with \the [tool].") target.custom_pain("Something in your [affected.display_name] is causing you a lot of pain!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) if (!istype(tool, /obj/item/weapon/reagent_containers)) return @@ -155,7 +155,7 @@ "\blue You apply [trans] units of the solution to affected tissue in [target]'s [affected.display_name] with \the [tool].") fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) if (!istype(tool, /obj/item/weapon/reagent_containers)) return diff --git a/code/modules/surgery/robolimbs.dm b/code/modules/surgery/robolimbs.dm index 7e768bfa06..8b9f3be6d9 100644 --- a/code/modules/surgery/robolimbs.dm +++ b/code/modules/surgery/robolimbs.dm @@ -8,7 +8,7 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if (!hasorgans(target)) return 0 - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) if (!affected) return 0 if (!(affected.status & ORGAN_DESTROYED)) @@ -31,23 +31,23 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return !(affected.status & ORGAN_CUT_AWAY) begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] starts cutting away flesh where [target]'s [affected.display_name] used to be with \the [tool].", \ "You start cutting away flesh where [target]'s [affected.display_name] used to be with \the [tool].") ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\blue [user] cuts away flesh where [target]'s [affected.display_name] used to be with \the [tool].", \ "\blue You cut away flesh where [target]'s [affected.display_name] used to be with \the [tool].") affected.status |= ORGAN_CUT_AWAY fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) if (affected.parent) affected = affected.parent user.visible_message("\red [user]'s hand slips, cutting [target]'s [affected.display_name] open!", \ @@ -66,23 +66,23 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return affected.status & ORGAN_CUT_AWAY && affected.open < 3 && !(affected.status & ORGAN_ATTACHABLE) begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] is beginning to reposition flesh and nerve endings where where [target]'s [affected.display_name] used to be with [tool].", \ "You start repositioning flesh and nerve endings where [target]'s [affected.display_name] used to be with [tool].") ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\blue [user] has finished repositioning flesh and nerve endings where [target]'s [affected.display_name] used to be with [tool].", \ "\blue You have finished repositioning flesh and nerve endings where [target]'s [affected.display_name] used to be with [tool].") affected.open = 3 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) if (affected.parent) affected = affected.parent user.visible_message("\red [user]'s hand slips, tearing flesh on [target]'s [affected.display_name]!", \ @@ -103,17 +103,17 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return affected.open == 3 begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] starts adjusting the area around [target]'s [affected.display_name] with \the [tool].", \ "You start adjusting the area around [target]'s [affected.display_name] with \the [tool].") ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\blue [user] has finished adjusting the area around [target]'s [affected.display_name] with \the [tool].", \ "\blue You have finished adjusting the area around [target]'s [affected.display_name] with \the [tool].") affected.status |= ORGAN_ATTACHABLE @@ -122,7 +122,7 @@ affected.open = 0 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) if (affected.parent) affected = affected.parent user.visible_message("\red [user]'s hand slips, searing [target]'s [affected.display_name]!", \ @@ -142,17 +142,17 @@ if (p.part) if (!(target_zone in p.part)) return 0 - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) return affected.status & ORGAN_ATTACHABLE begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] starts attaching \the [tool] where [target]'s [affected.display_name] used to be.", \ "You start attaching \the [tool] where [target]'s [affected.display_name] used to be.") end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/robot_parts/L = tool - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\blue [user] has attached \the [tool] where [target]'s [affected.display_name] used to be.", \ "\blue You have attached \the [tool] where [target]'s [affected.display_name] used to be.") affected.germ_level = 0 @@ -167,7 +167,7 @@ del(tool) fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\red [user]'s hand slips, damaging connectors on [target]'s [affected.display_name]!", \ "\red Your hand slips, damaging connectors on [target]'s [affected.display_name]!") target.apply_damage(10, BRUTE, affected, sharp=1) diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index a4e6cfdc6f..2bfa689de0 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -49,7 +49,7 @@ // does stuff to begin the step, usually just printing messages. Moved germs transfering and bloodying here too proc/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/datum/organ/external/affected = target.get_organ(target_zone) + var/obj/item/organ/external/affected = target.get_organ(target_zone) if (can_infect && affected) spread_germs_to_organ(affected, user) if (ishuman(user) && prob(60)) @@ -68,7 +68,7 @@ proc/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) return null -proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user) +proc/spread_germs_to_organ(var/obj/item/organ/external/E, var/mob/living/carbon/human/user) if(!istype(user) || !istype(E)) return var/germ_level = user.germ_level diff --git a/code/modules/virus2/effect.dm b/code/modules/virus2/effect.dm index 8b6d9f30e8..5d6abc3e97 100644 --- a/code/modules/virus2/effect.dm +++ b/code/modules/virus2/effect.dm @@ -79,7 +79,7 @@ mob.adjustBruteLoss(10*multiplier) if(istype(mob, /mob/living/carbon/human)) var/mob/living/carbon/human/H = mob - var/datum/organ/external/O = pick(H.organs) + var/obj/item/organ/external/O = pick(H.organs) if(prob(25)) mob << "Your [O.display_name] feels as if it might fall off!" if(prob(10)) @@ -153,11 +153,11 @@ if(istype(mob, /mob/living/carbon/human)) var/mob/living/carbon/human/H = mob var/organ = pick(list("r_arm","l_arm","r_leg","r_leg")) - var/datum/organ/external/E = H.organs_by_name[organ] + var/obj/item/organ/external/E = H.organs_by_name[organ] if (!(E.status & ORGAN_DEAD)) E.status |= ORGAN_DEAD H << "You can't feel your [E.display_name] anymore..." - for (var/datum/organ/external/C in E.children) + for (var/obj/item/organ/external/C in E.children) C.status |= ORGAN_DEAD H.update_body(1) mob.adjustToxLoss(15*multiplier) @@ -165,9 +165,9 @@ deactivate(var/mob/living/carbon/mob,var/multiplier) if(istype(mob, /mob/living/carbon/human)) var/mob/living/carbon/human/H = mob - for (var/datum/organ/external/E in H.organs) + for (var/obj/item/organ/external/E in H.organs) E.status &= ~ORGAN_DEAD - for (var/datum/organ/external/C in E.children) + for (var/obj/item/organ/external/C in E.children) C.status &= ~ORGAN_DEAD H.update_body(1) @@ -178,7 +178,7 @@ activate(var/mob/living/carbon/mob,var/multiplier) if(istype(mob, /mob/living/carbon/human)) var/mob/living/carbon/human/H = mob - for (var/datum/organ/external/E in H.organs) + for (var/obj/item/organ/external/E in H.organs) if (E.status & ORGAN_BROKEN && prob(30)) E.status ^= ORGAN_BROKEN var/heal_amt = -5*multiplier @@ -199,13 +199,13 @@ activate(var/mob/living/carbon/mob,var/multiplier) if(istype(mob, /mob/living/carbon/human)) var/mob/living/carbon/human/H = mob - for (var/datum/organ/external/E in H.organs) + for (var/obj/item/organ/external/E in H.organs) E.min_broken_damage = max(5, E.min_broken_damage - 30) deactivate(var/mob/living/carbon/mob,var/multiplier) if(istype(mob, /mob/living/carbon/human)) var/mob/living/carbon/human/H = mob - for (var/datum/organ/external/E in H.organs) + for (var/obj/item/organ/external/E in H.organs) E.min_broken_damage = initial(E.min_broken_damage) ////////////////////////STAGE 3///////////////////////////////// @@ -237,7 +237,7 @@ activate(var/mob/living/carbon/mob,var/multiplier) if(istype(mob, /mob/living/carbon/human)) var/mob/living/carbon/human/H = mob - var/datum/organ/internal/brain/B = H.internal_organs_by_name["brain"] + var/obj/item/organ/brain/B = H.internal_organs_by_name["brain"] if (B && B.damage < B.min_broken_damage) B.take_damage(5) else diff --git a/code/modules/virus2/helpers.dm b/code/modules/virus2/helpers.dm index feb7aec6a6..2cac255104 100644 --- a/code/modules/virus2/helpers.dm +++ b/code/modules/virus2/helpers.dm @@ -110,14 +110,14 @@ proc/airborne_can_reach(turf/source, turf/target) //Infects mob M with random lesser disease, if he doesn't have one /proc/infect_mob_random_lesser(var/mob/living/carbon/M) var/datum/disease2/disease/D = new /datum/disease2/disease - + D.makerandom(1) infect_mob(M, D) //Infects mob M with random greated disease, if he doesn't have one /proc/infect_mob_random_greater(var/mob/living/carbon/M) var/datum/disease2/disease/D = new /datum/disease2/disease - + D.makerandom(2) infect_mob(M, D) @@ -158,7 +158,7 @@ proc/airborne_can_reach(turf/source, turf/target) if (ishuman(victim)) var/mob/living/carbon/human/H = victim - var/datum/organ/external/select_area = H.get_organ(src.zone_sel.selecting) + var/obj/item/organ/external/select_area = H.get_organ(src.zone_sel.selecting) var/list/clothes = list(H.head, H.wear_mask, H.wear_suit, H.w_uniform, H.gloves, H.shoes) for(var/obj/item/clothing/C in clothes) if(C && istype(C)) diff --git a/code/setup.dm b/code/setup.dm index ff2091ee60..732ee0607c 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -503,6 +503,7 @@ #define SALVED 512 #define ORGAN_DEAD 1024 #define ORGAN_MUTATED 2048 +#define ORGAN_ASSISTED 4096 // Admin permissions. Please don't edit these values without speaking to Errorage first. ~Carn #define R_BUILDMODE 1 diff --git a/maps/exodus-2.dmm b/maps/exodus-2.dmm index be4103f780..beb5bbfeaa 100644 --- a/maps/exodus-2.dmm +++ b/maps/exodus-2.dmm @@ -1908,7 +1908,7 @@ "KJ" = (/obj/item/weapon/caution,/turf/unsimulated/floor{icon_state = "freezerfloor"; dir = 2},/area/wizard_station) "KK" = (/obj/item/weapon/kitchenknife/ritual,/turf/unsimulated/floor{icon_state = "freezerfloor"; dir = 2},/area/wizard_station) "KL" = (/obj/item/weapon/screwdriver{pixel_y = 15},/turf/simulated/shuttle/floor4/vox,/area/shuttle/vox/station) -"KM" = (/obj/item/weapon/organ/r_arm,/turf/simulated/shuttle/floor4/vox,/area/shuttle/vox/station) +"KM" = (/obj/item/organ/external/r_arm,/turf/simulated/shuttle/floor4/vox,/area/shuttle/vox/station) "KN" = (/obj/machinery/atmospherics/pipe/tank/nitrogen{dir = 1; initialize_directions = 1; start_pressure = 493.6},/turf/simulated/shuttle/floor4/vox,/area/shuttle/vox/station) "KO" = (/obj/machinery/portable_atmospherics/canister/phoron,/turf/simulated/shuttle/floor4/vox,/area/shuttle/vox/station) "KP" = (/obj/machinery/portable_atmospherics/canister/nitrogen,/turf/simulated/shuttle/floor4/vox,/area/shuttle/vox/station) From a63b9b4e73834935a3c8fc5bb038bc475cac8f13 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Tue, 24 Mar 2015 15:01:20 +1030 Subject: [PATCH 02/11] Beginning to port over new icon update from limbs branch. WIP --- baystation12.dme | 1 + code/game/machinery/bioprinter.dm | 2 +- code/game/objects/items.dm | 11 +- code/game/objects/structures/extinguisher.dm | 7 +- code/game/objects/structures/watercloset.dm | 5 +- code/modules/client/preferences.dm | 1 - code/modules/mob/living/carbon/carbon.dm | 11 +- code/modules/mob/living/carbon/human/human.dm | 1 - .../living/carbon/human/species/species.dm | 24 +- .../mob/living/carbon/human/update_icons.dm | 58 +- code/modules/mob/mob_helpers.dm | 2 +- code/modules/organs/organ.dm | 35 +- code/modules/organs/organ_external.dm | 644 ++++++++---------- code/modules/organs/organ_icon.dm | 106 +++ code/modules/organs/organ_internal.dm | 2 +- code/modules/paperwork/paperbin.dm | 9 +- code/modules/surgery/headreattach.dm | 3 +- 17 files changed, 466 insertions(+), 456 deletions(-) create mode 100644 code/modules/organs/organ_icon.dm diff --git a/baystation12.dme b/baystation12.dme index a19ffbe162..5955d6a228 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1275,6 +1275,7 @@ #include "code\modules\organs\organ.dm" #include "code\modules\organs\organ_alien.dm" #include "code\modules\organs\organ_external.dm" +#include "code\modules\organs\organ_icon.dm" #include "code\modules\organs\organ_internal.dm" #include "code\modules\organs\pain.dm" #include "code\modules\organs\wound.dm" diff --git a/code/game/machinery/bioprinter.dm b/code/game/machinery/bioprinter.dm index f590e7fd26..48c0edb984 100644 --- a/code/game/machinery/bioprinter.dm +++ b/code/game/machinery/bioprinter.dm @@ -50,7 +50,7 @@ O.transplant_data["blood_type"] = loaded_dna["blood_type"] O.transplant_data["blood_DNA"] = loaded_dna["blood_DNA"] - visible_message("The bioprinter spits out a new organ.") + visible_message("The bioprinter spits out a new organ.") else user << "There is not enough matter in the printer." diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 66d39e0868..e8b2773c7e 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -119,9 +119,10 @@ /obj/item/attack_hand(mob/user as mob) if (!user) return if (hasorgans(user)) - var/obj/item/organ/external/temp = user:organs_by_name["r_hand"] + var/mob/living/carbon/human/H = user + var/obj/item/organ/external/temp = H.organs_by_name["r_hand"] if (user.hand) - temp = user:organs_by_name["l_hand"] + temp = H.organs_by_name["l_hand"] if(temp && !temp.is_usable()) user << "You try to move your [temp.display_name], but cannot!" return @@ -533,11 +534,11 @@ M.adjustBruteLoss(10) */ - if(istype(M, /mob/living/carbon/human)) + if(istype(H)) var/obj/item/organ/eyes/eyes = H.internal_organs_by_name["eyes"] - if(M != user) + if(H != user) for(var/mob/O in (viewers(M) - user - M)) O.show_message("\red [M] has been stabbed in the eye with [src] by [user].", 1) M << "\red [user] stabs you in the eye with [src]!" @@ -563,7 +564,7 @@ if (eyes.damage >= eyes.min_broken_damage) if(M.stat != 2) M << "\red You go blind!" - var/obj/item/organ/external/affecting = M:get_organ("head") + var/obj/item/organ/external/affecting = H.get_organ("head") if(affecting.take_damage(7)) M:UpdateDamageIcon() else diff --git a/code/game/objects/structures/extinguisher.dm b/code/game/objects/structures/extinguisher.dm index 6e049c8fdd..b9135176f8 100644 --- a/code/game/objects/structures/extinguisher.dm +++ b/code/game/objects/structures/extinguisher.dm @@ -31,10 +31,11 @@ /obj/structure/extinguisher_cabinet/attack_hand(mob/user) if(isrobot(user)) return - if (hasorgans(user)) - var/obj/item/organ/external/temp = user:organs_by_name["r_hand"] + if (ishuman(user)) + var/mob/living/carbon/human/H = user + var/obj/item/organ/external/temp = H.organs_by_name["r_hand"] if (user.hand) - temp = user:organs_by_name["l_hand"] + temp = H.organs_by_name["l_hand"] if(temp && !temp.is_usable()) user << "You try to move your [temp.display_name], but cannot!" return diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 9d802a6454..778f5bc65b 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -346,8 +346,9 @@ var/busy = 0 //Something's being washed at the moment /obj/structure/sink/attack_hand(mob/user as mob) - if (hasorgans(user)) - var/obj/item/organ/external/temp = user:organs_by_name["r_hand"] + if (ishuman(user)) + var/mob/living/carbon/human/H = user + var/obj/item/organ/external/temp = H.organs_by_name["r_hand"] if (user.hand) temp = user:organs_by_name["l_hand"] if(temp && !temp.is_usable()) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 4e23b64570..d0d2ee9065 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1695,7 +1695,6 @@ datum/preferences if(status == "amputated") O.amputated = 1 O.status |= ORGAN_DESTROYED - O.destspawn = 1 else if(status == "cyborg") O.status |= ORGAN_ROBOT else diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 95e8828a3d..3f08ce3bc1 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -60,12 +60,13 @@ /mob/living/carbon/attack_hand(mob/M as mob) if(!istype(M, /mob/living/carbon)) return - if (hasorgans(M)) - var/obj/item/organ/external/temp = M:organs_by_name["r_hand"] - if (M.hand) - temp = M:organs_by_name["l_hand"] + if (ishuman(M)) + var/mob/living/carbon/human/H = M + var/obj/item/organ/external/temp = H.organs_by_name["r_hand"] + if (H.hand) + temp = H.organs_by_name["l_hand"] if(temp && !temp.is_usable()) - M << "\red You can't use your [temp.display_name]" + H << "\red You can't use your [temp.display_name]" return for(var/datum/disease/D in viruses) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 4d45ff93db..731548d6f4 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -936,7 +936,6 @@ O.status &= ~ORGAN_ATTACHABLE if (!O.amputated) O.status &= ~ORGAN_DESTROYED - O.destspawn = 0 O.wounds.Cut() O.heal_damage(1000,1000,1,1) diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index aa68f3470f..45a3f258f8 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -154,21 +154,21 @@ H.internal_organs_by_name = list() //This is a basic humanoid limb setup. - H.organs_by_name["chest"] = new/obj/item/organ/external/chest() - H.organs_by_name["groin"] = new/obj/item/organ/external/groin(H.organs_by_name["chest"]) - H.organs_by_name["head"] = new/obj/item/organ/external/head(H.organs_by_name["chest"]) - H.organs_by_name["l_arm"] = new/obj/item/organ/external/l_arm(H.organs_by_name["chest"]) - H.organs_by_name["r_arm"] = new/obj/item/organ/external/r_arm(H.organs_by_name["chest"]) - H.organs_by_name["r_leg"] = new/obj/item/organ/external/r_leg(H.organs_by_name["groin"]) - H.organs_by_name["l_leg"] = new/obj/item/organ/external/l_leg(H.organs_by_name["groin"]) - H.organs_by_name["l_hand"] = new/obj/item/organ/external/l_hand(H.organs_by_name["l_arm"]) - H.organs_by_name["r_hand"] = new/obj/item/organ/external/r_hand(H.organs_by_name["r_arm"]) - H.organs_by_name["l_foot"] = new/obj/item/organ/external/l_foot(H.organs_by_name["l_leg"]) - H.organs_by_name["r_foot"] = new/obj/item/organ/external/r_foot(H.organs_by_name["r_leg"]) + H.organs_by_name["chest"] = new/obj/item/organ/external/chest(null,H) + H.organs_by_name["groin"] = new/obj/item/organ/external/groin(H.organs_by_name["chest"],H) + H.organs_by_name["head"] = new/obj/item/organ/external/head(H.organs_by_name["chest"],H) + H.organs_by_name["l_arm"] = new/obj/item/organ/external/arm(H.organs_by_name["chest"],H) + H.organs_by_name["r_arm"] = new/obj/item/organ/external/arm/right(H.organs_by_name["chest"],H) + H.organs_by_name["r_leg"] = new/obj/item/organ/external/leg(H.organs_by_name["groin"],H) + H.organs_by_name["l_leg"] = new/obj/item/organ/external/leg/right(H.organs_by_name["groin"],H) + H.organs_by_name["l_hand"] = new/obj/item/organ/external/hand(H.organs_by_name["l_arm"],H) + H.organs_by_name["r_hand"] = new/obj/item/organ/external/hand/right(H.organs_by_name["r_arm"],H) + H.organs_by_name["l_foot"] = new/obj/item/organ/external/foot(H.organs_by_name["l_leg"],H) + H.organs_by_name["r_foot"] = new/obj/item/organ/external/foot/right(H.organs_by_name["r_leg"],H) for(var/organ in has_organ) var/organ_type = has_organ[organ] - H.internal_organs_by_name[organ] = new organ_type(H) + H.internal_organs_by_name[organ] = new organ_type(H,H,1) for(var/name in H.organs_by_name) H.organs += H.organs_by_name[name] diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index d59dba9559..16a1210b75 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -225,7 +225,6 @@ proc/get_damage_icon_part(damage_state, body_part) var/husk_color_mod = rgb(96,88,80) var/hulk_color_mod = rgb(48,224,40) - var/necrosis_color_mod = rgb(10,50,0) var/husk = (HUSK in src.mutations) var/fat = (FAT in src.mutations) @@ -233,7 +232,6 @@ proc/get_damage_icon_part(damage_state, body_part) var/skeleton = (SKELETON in src.mutations) var/g = (gender == FEMALE ? "f" : "m") - var/has_head = 0 //CACHING: Generate an index key from visible bodyparts. //0 = destroyed, 1 = normal, 2 = robotic, 3 = necrotic. @@ -241,7 +239,6 @@ proc/get_damage_icon_part(damage_state, body_part) //Create a new, blank icon for our mob to use. if(stand_icon) del(stand_icon) - stand_icon = new(species.icon_template ? species.icon_template : 'icons/mob/human.dmi',"blank") var/icon_key = "[species.race_key][g][s_tone]" @@ -270,34 +267,15 @@ proc/get_damage_icon_part(damage_state, body_part) else - //BEGIN CACHED ICON GENERATION. - var/race_icon = (skeleton ? 'icons/mob/human_races/r_skeleton.dmi' : species.icobase) - var/deform_icon = (skeleton ? 'icons/mob/human_races/r_skeleton.dmi' : species.icobase) - + //BEGIN CACHED ICON GENERATION. //Robotic limbs are handled in get_icon() so all we worry about are missing or dead limbs. //No icon stored, so we need to start with a basic one. var/obj/item/organ/external/chest = get_organ("chest") - base_icon = chest.get_icon(race_icon,deform_icon,g) - - if(chest.status & ORGAN_DEAD) - base_icon.ColorTone(necrosis_color_mod) - base_icon.SetIntensity(0.7) + base_icon = chest.get_icon() for(var/obj/item/organ/external/part in organs) - var/icon/temp //Hold the bodypart icon for processing. - - if(part.status & ORGAN_DESTROYED) - continue - - if (istype(part, /obj/item/organ/external/groin) || istype(part, /obj/item/organ/external/head)) - temp = part.get_icon(race_icon,deform_icon,g) - else - temp = part.get_icon(race_icon,deform_icon) - - if(part.status & ORGAN_DEAD) - temp.ColorTone(necrosis_color_mod) - temp.SetIntensity(0.7) + var/icon/temp = part.get_icon(skeleton) //That part makes left and right legs drawn topmost and lowermost when human looks WEST or EAST //And no change in rendering for other parts (they icon_position is 0, so goes to 'else' part) @@ -338,44 +316,16 @@ proc/get_damage_icon_part(damage_state, body_part) //Handle husk overlay. if(husk) var/icon/mask = new(base_icon) - var/icon/husk_over = new(race_icon,"overlay_husk") + var/icon/husk_over = new(species.icobase,"overlay_husk") mask.MapColors(0,0,0,1, 0,0,0,1, 0,0,0,1, 0,0,0,1, 0,0,0,0) husk_over.Blend(mask, ICON_ADD) base_icon.Blend(husk_over, ICON_OVERLAY) - - //Skin tone. - if(!husk && !hulk) - if(species.flags & HAS_SKIN_TONE) - if(s_tone >= 0) - base_icon.Blend(rgb(s_tone, s_tone, s_tone), ICON_ADD) - else - base_icon.Blend(rgb(-s_tone, -s_tone, -s_tone), ICON_SUBTRACT) - human_icon_cache[icon_key] = base_icon - //log_debug("Generated new cached mob icon ([icon_key] \icon[human_icon_cache[icon_key]]) for [src]. [human_icon_cache.len] cached mob icons.") - //END CACHED ICON GENERATION. - stand_icon.Blend(base_icon,ICON_OVERLAY) - //Skin colour. Not in cache because highly variable (and relatively benign). - if (species.flags & HAS_SKIN_COLOR) - stand_icon.Blend(rgb(r_skin, g_skin, b_skin), ICON_ADD) - - if(has_head) - //Eyes - if(!skeleton) - var/icon/eyes = new/icon('icons/mob/human_face.dmi', species.eyes) - if (species.flags & HAS_EYE_COLOR) - eyes.Blend(rgb(r_eyes, g_eyes, b_eyes), ICON_ADD) - stand_icon.Blend(eyes, ICON_OVERLAY) - - //Mouth (lipstick!) - if(lip_style && (species && species.flags & HAS_LIPS)) //skeletons are allowed to wear lipstick no matter what you think, agouri. - stand_icon.Blend(new/icon('icons/mob/human_face.dmi', "lips_[lip_style]_s"), ICON_OVERLAY) - //Underwear if(underwear && species.flags & HAS_UNDERWEAR) stand_icon.Blend(new /icon('icons/mob/human.dmi', underwear), ICON_OVERLAY) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index ab3b2c009f..f88c8072be 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -138,7 +138,7 @@ proc/isnewplayer(A) return 1 return 0 -proc/hasorgans(A) +proc/hasorgans(A) // Fucking really?? return ishuman(A) proc/iscuffed(A) diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index f807ee0d1d..1ba5ed1558 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -22,7 +22,10 @@ var/list/organ_cache = list() // links chemical IDs to number of ticks for which they'll stay in the blood germ_level = 0 -/obj/item/organ/New(var/newloc, var/mob/living/carbon/holder) +/obj/item/organ/proc/update_health() + return + +/obj/item/organ/New(var/newloc, var/mob/living/carbon/holder, var/internal) ..(newloc) create_reagents(5) @@ -31,15 +34,23 @@ var/list/organ_cache = list() if(istype(holder)) - holder.internal_organs |= src + if(internal) + holder.internal_organs |= src src.owner = holder var/mob/living/carbon/human/H = holder if(istype(H)) + + if(H.dna) + if(!blood_DNA) + blood_DNA = list() + blood_DNA[H.dna.unique_enzymes] = H.dna.b_type + var/obj/item/organ/external/E = H.organs_by_name[src.parent_organ] - if(E.internal_organs == null) - E.internal_organs = list() - E.internal_organs |= src + if(E) + if(E.internal_organs == null) + E.internal_organs = list() + E.internal_organs |= src /obj/item/organ/proc/die() name = "dead [initial(name)]" @@ -55,10 +66,13 @@ var/list/organ_cache = list() return //Process infections - if (robotic >= 2 || (owner.species && owner.species.flags & IS_PLANT)) + if (robotic >= 2 || (owner && owner.species && (owner.species.flags & IS_PLANT))) germ_level = 0 return + if(loc != owner) + owner = null + if(!owner) var/datum/reagent/blood/B = locate(/datum/reagent/blood) in reagents.reagent_list if(B && prob(40)) @@ -124,15 +138,6 @@ var/list/organ_cache = list() /obj/item/organ/proc/receive_chem(chemical as obj) return 0 -/obj/item/organ/proc/get_icon(var/image/supplied) - var/key = "internal-[icon_state]" - var/image/I - if(organ_cache[key]) - I = organ_cache[key] - else - I = image(icon, "[icon_state]") - return I - /obj/item/organ/proc/rejuvenate() damage = 0 diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index f5a81f5531..90c71e3522 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -12,13 +12,16 @@ 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 = 1 var/display_name var/list/wounds = list() var/number_wounds = 0 // cache the number of wounds, which is NOT wounds.len! var/tmp/perma_injury = 0 - var/tmp/destspawn = 0 //Has it spawned the broken limb? var/tmp/amputated = 0 //Whether this has been cleanly amputated, thus causing no pain var/obj/item/organ/external/parent @@ -49,6 +52,62 @@ min_broken_damage = 30 max_damage = 0 +/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("[user] cuts [src] open with [W]!") + stage++ + return + if(1) + if(istype(W,/obj/item/weapon/retractor)) + user.visible_message("[user] 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) + if(!(user.l_hand && user.r_hand)) + user.put_in_hands(removing) + user.visible_message("[user] extracts [removing] from [src] with [W]!") + else + user.visible_message("[user] fishes around fruitlessly in [src] with [W].") + return + ..() + +/obj/item/organ/external/proc/is_dislocated() + if(dislocated) + return 1 + if(parent) + return parent.is_dislocated() + return 0 + +/obj/item/organ/external/proc/dislocate(var/primary) + if(dislocated != -1) + if(primary) + dislocated = 2 + else + dislocated = 1 + if(children && children.len) + for(var/obj/item/organ/external/child in children) + child.dislocate() + +/obj/item/organ/external/proc/undislocate() + if(dislocated != -1) + dislocated = 0 + if(children && children.len) + for(var/obj/item/organ/external/child in children) + child.undislocate() + if(owner) + owner.shock_stage += 20 + +/obj/item/organ/external/update_health() + damage = min(max_damage, (brute_dam + burn_dam)) + return + + /obj/item/organ/external/New(var/newloc, var/mob/living/carbon/holder, var/obj/item/organ/external/P) if(P) parent = P @@ -266,8 +325,6 @@ This function completely restores a damaged organ to perfect condition. //Determines if we even need to process this organ. /obj/item/organ/external/proc/need_process() - if(destspawn) //Missing limb is missing - return 0 if(status && status != ORGAN_ROBOT) // If it's robotic, that's fine it will have a status. return 1 if(brute_dam || burn_dam) @@ -282,36 +339,40 @@ This function completely restores a damaged organ to perfect condition. return 0 /obj/item/organ/external/process() - //Dismemberment - if(status & ORGAN_DESTROYED) - if(!destspawn && config.limbs_can_break) - droplimb() - return - if(parent) - if(parent.status & ORGAN_DESTROYED) - status |= ORGAN_DESTROYED - owner.update_body(1) + if(owner) + //Dismemberment + if(status & ORGAN_DESTROYED) + if(config.limbs_can_break) + droplimb() return + 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() + // 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) + //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) - //Bone fracurtes - if(config.bones_can_break && brute_dam > min_broken_damage * config.organ_health_multiplier && !(status & ORGAN_ROBOT)) - src.fracture() - if(!(status & ORGAN_BROKEN)) - perma_injury = 0 + //Bone fractures + if(config.bones_can_break && brute_dam > min_broken_damage * config.organ_health_multiplier && !(status & ORGAN_ROBOT)) + src.fracture() - //Infections - update_germs() + if(!(status & ORGAN_BROKEN)) + perma_injury = 0 + + //Infections + update_germs() + else + ..() //Updating germ levels. Handles organ germ levels and necrosis. /* @@ -543,88 +604,50 @@ Note that amputating the affected organ does in fact remove the infection from t //Handles dismemberment /obj/item/organ/external/proc/droplimb(var/override = 0,var/no_explode = 0,var/amputation=0) - if(destspawn) return - if(override) - status |= ORGAN_DESTROYED + if(status & ORGAN_DESTROYED) if(body_part == UPPER_TORSO) return - src.status &= ~ORGAN_BROKEN - src.status &= ~ORGAN_BLEEDING - src.status &= ~ORGAN_SPLINTED - src.status &= ~ORGAN_DEAD - for(var/implant in implants) - del(implant) + //if(clean) //todo - germ_level = 0 + owner.visible_message( + "\The [owner]'s [src.name] flies off in an arc!",\ + "Your [src.name] goes flying off!",\ + "You hear a terrible sound of ripping tendons and flesh.") - // If any organs are attached to this, destroy them - for(var/obj/item/organ/external/O in children) - O.droplimb(1, no_explode, amputation) + if(parent) + parent.children -= src + src.removed(owner) - //Replace all wounds on that arm with one wound on parent organ. - wounds.Cut() - if (parent && !amputation) - var/datum/wound/W - if(max_damage < 50) - W = new/datum/wound/lost_limb/small(max_damage) - else - W = new/datum/wound/lost_limb(max_damage) - parent.wounds += W - parent.update_damages() - update_damages() + if(parent) + spawn(1) + parent.take_damage(20,0,50,0) // Leave a bloody stump to remember us by. + parent.update_health() + parent = null - var/list/dropped_items - switch(body_part) - if(HEAD) - dropped_items = list(owner.glasses, owner.head, owner.l_ear, owner.r_ear, owner.wear_mask) - if(HAND_RIGHT) - dropped_items = list(owner.gloves) //should probably make it so that you can still wear gloves if you have one hand - if(HAND_LEFT) - dropped_items = list(owner.gloves) - if(FOOT_RIGHT) - dropped_items = list(owner.shoes) - if(FOOT_LEFT) - dropped_items = list(owner.shoes) + update_health() + owner.update_body() + compile_icon() - if(dropped_items) - for(var/obj/O in dropped_items) - owner.remove_from_mob(O) + add_blood(owner) - removed(owner) - destspawn = 1 - owner.visible_message("\red [owner.name]'s [display_name] flies off in an arc.",\ - "Your [display_name] goes flying off!",\ - "You hear a terrible sound of ripping tendons and flesh.") - //Throw organs around - if(istype(owner.loc,/turf)) - step(src,pick(cardinal)) - owner.update_body(1) - // OK so maybe your limb just flew off, but if it was attached to a pair of cuffs then hooray! Freedom! - release_restraints() - if(vital) - owner.death() - - //Robotic limbs explode if sabotaged. - if(status & ORGAN_ROBOT && !no_explode && sabotaged) - owner.visible_message("\red \The [owner]'s [display_name] explodes violently!",\ - "\red Your [display_name] explodes!",\ - "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) - spark_system.attach(owner) - spark_system.start() - spawn(10) - del(spark_system) - del(src) + var/matrix/M = matrix() + M.Turn(rand(180)) + src.transform = M + // Throw limb around. + if(src && istype(loc,/turf)) + throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),30) /**************************************************** HELPERS ****************************************************/ +/obj/item/organ/replaced() + get_icon() + return ..() + /obj/item/organ/external/proc/release_restraints() if (owner.handcuffed && body_part in list(ARM_LEFT, ARM_RIGHT, HAND_LEFT, HAND_RIGHT)) owner.visible_message(\ @@ -725,7 +748,6 @@ Note that amputating the affected organ does in fact remove the infection from t /obj/item/organ/external/robotize() ..() - src.destspawn = 0 for (var/obj/item/organ/external/T in children) if(T) T.robotize() @@ -747,16 +769,6 @@ Note that amputating the affected organ does in fact remove the infection from t return 1 return 0 -/obj/item/organ/external/get_icon(var/icon/race_icon, var/icon/deform_icon,gender="") - if (status & ORGAN_ROBOT && !(owner.species && owner.species.flags & IS_SYNTHETIC)) - return new /icon('icons/mob/human_races/robotic.dmi', "[icon_name][gender ? "_[gender]" : ""]") - - if (status & ORGAN_MUTATED) - return new /icon(deform_icon, "[icon_name][gender ? "_[gender]" : ""]") - - return new /icon(race_icon, "[icon_name][gender ? "_[gender]" : ""]") - - /obj/item/organ/external/proc/is_usable() return !(status & (ORGAN_DESTROYED|ORGAN_MUTATED|ORGAN_DEAD)) @@ -794,153 +806,211 @@ Note that amputating the affected organ does in fact remove the infection from t H.drop_item() W.loc = owner +/obj/item/organ/external/removed(var/mob/living/user) + + var/is_robotic = status & ORGAN_ROBOT + ..() + + status |= ORGAN_DESTROYED + owner.bad_external_organs -= src + + for(var/implant in implants) //todo: check if this can be left alone + del(implant) + + wounds.Cut() //todo: wound on the parent organ + + // Attached organs also fly off. + for(var/obj/item/organ/external/O in children) + O.removed(owner) + O.loc = src //TODO: generate entire limb icons from contents. + + // Grab all the internal giblets too. + for(var/obj/item/organ/organ in internal_organs) + organ.removed(user) + organ.loc = src + + release_restraints() + owner.organs -= src + owner.organs_by_name[limb_name] = null // Remove from owner's vars. + + //Robotic limbs explode if sabotaged. + if(is_robotic) + owner.visible_message( + "\The [owner]'s [src.name] explodes violently!",\ + "Your [src.name] explodes!",\ + "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) + spark_system.attach(owner) + spark_system.start() + spawn(10) + del(spark_system) + del(src) + + /**************************************************** ORGAN DEFINES ****************************************************/ /obj/item/organ/external/chest - name = "chest" + name = "upper body" + limb_name = "chest" icon_name = "torso" - display_name = "chest" - max_damage = 75 - min_broken_damage = 40 + health = 75 + min_broken_damage = 35 body_part = UPPER_TORSO vital = 1 - encased = "ribcage" - amputation_point = "spines" + amputation_point = "spine" joint = "neck" dislocated = -1 + gendered_icon = 1 /obj/item/organ/external/groin - name = "groin" + name = "lower body" + limb_name = "groin" icon_name = "groin" - display_name = "groin" - max_damage = 50 - min_broken_damage = 30 + health = 50 + min_broken_damage = 20 body_part = LOWER_TORSO vital = 1 + parent_organ = "chest" amputation_point = "lumbar" joint = "hip" dislocated = -1 + gendered_icon = 1 -/obj/item/organ/external/l_arm - name = "l_arm" - display_name = "left arm" +/obj/item/organ/external/arm + limb_name = "l_arm" + name = "left arm" icon_name = "l_arm" - max_damage = 50 - min_broken_damage = 20 + health = 50 + min_broken_damage = 30 body_part = ARM_LEFT + parent_organ = "chest" joint = "left elbow" amputation_point = "left shoulder" -/obj/item/organ/external/l_arm/process() +/obj/item/organ/external/arm/process() ..() - process_grasp(owner.l_hand, "left hand") + if(owner) process_grasp(owner.l_hand, "left hand") -/obj/item/organ/external/l_leg - name = "l_leg" - display_name = "left leg" - icon_name = "l_leg" - max_damage = 50 - min_broken_damage = 20 - body_part = LEG_LEFT - icon_position = LEFT - joint = "left knee" - amputation_point = "left hip" - -/obj/item/organ/external/r_arm - name = "r_arm" - display_name = "right arm" +/obj/item/organ/external/arm/right + limb_name = "r_arm" + name = "right arm" icon_name = "r_arm" - max_damage = 50 - min_broken_damage = 20 + health = 50 + min_broken_damage = 30 body_part = ARM_RIGHT + parent_organ = "chest" joint = "right elbow" amputation_point = "right shoulder" -/obj/item/organ/external/r_arm/process() - ..() - process_grasp(owner.r_hand, "right hand") +/obj/item/organ/external/arm/right/process() + ..() + if(owner) process_grasp(owner.r_hand, "right hand") -/obj/item/organ/external/r_leg - name = "r_leg" - display_name = "right leg" +/obj/item/organ/external/leg + limb_name = "l_leg" + name = "left leg" + icon_name = "l_leg" + health = 50 + min_broken_damage = 30 + body_part = LEG_LEFT + icon_position = LEFT + parent_organ = "groin" + joint = "left knee" + amputation_point = "left hip" + +/obj/item/organ/external/leg/right + limb_name = "r_leg" + name = "right leg" icon_name = "r_leg" - max_damage = 50 - min_broken_damage = 20 body_part = LEG_RIGHT icon_position = RIGHT + parent_organ = "groin" joint = "right knee" amputation_point = "right hip" -/obj/item/organ/external/l_foot - name = "l_foot" - display_name = "left foot" +/obj/item/organ/external/foot + limb_name = "l_foot" + name = "left foot" icon_name = "l_foot" - max_damage = 30 + health = 30 min_broken_damage = 15 body_part = FOOT_LEFT icon_position = LEFT + parent_organ = "l_leg" + joint = "left ankle" amputation_point = "left ankle" -/obj/item/organ/external/r_foot - name = "r_foot" - display_name = "right foot" +/obj/item/organ/external/foot/removed() + if(owner) owner.u_equip(owner.shoes) + ..() + +/obj/item/organ/external/foot/right + limb_name = "r_foot" + name = "right foot" icon_name = "r_foot" - max_damage = 30 - min_broken_damage = 15 body_part = FOOT_RIGHT icon_position = RIGHT + parent_organ = "r_leg" + joint = "right ankle" amputation_point = "right ankle" -/obj/item/organ/external/r_hand - name = "r_hand" - display_name = "right hand" - icon_name = "r_hand" - max_damage = 30 - min_broken_damage = 15 - body_part = HAND_RIGHT - amputation_point = "right wrist" - -/obj/item/organ/external/r_hand/process() - ..() - process_grasp(owner.r_hand, "right hand") - -/obj/item/organ/external/l_hand - name = "l_hand" - display_name = "left hand" +/obj/item/organ/external/hand + limb_name = "l_hand" + name = "left hand" icon_name = "l_hand" - max_damage = 30 + health = 30 min_broken_damage = 15 body_part = HAND_LEFT + parent_organ = "l_arm" + joint = "left wrist" amputation_point = "left wrist" -/obj/item/organ/external/l_hand/process() +/obj/item/organ/external/hand/process() ..() - process_grasp(owner.l_hand, "left hand") + if(owner) process_grasp(owner.l_hand, "left hand") + +/obj/item/organ/external/hand/removed() + owner.u_equip(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" + joint = "right wrist" + amputation_point = "right wrist" + +/obj/item/organ/external/hand/right/process() + ..() + if(owner) process_grasp(owner.r_hand, "right hand") /obj/item/organ/external/head - name = "head" + limb_name = "head" icon_name = "head" - display_name = "head" - max_damage = 75 - min_broken_damage = 40 + name = "head" + health = 75 + min_broken_damage = 35 body_part = HEAD - var/disfigured = 0 vital = 1 - encased = "skull" + parent_organ = "chest" joint = "jaw" amputation_point = "neck" + gendered_icon = 1 -/obj/item/organ/external/head/get_icon(var/icon/race_icon, var/icon/deform_icon) - if (!owner) - return ..() - var/g = "m" - if(owner.gender == FEMALE) g = "f" - if (status & ORGAN_MUTATED) - . = new /icon(deform_icon, "[icon_name]_[g]") - else - . = new /icon(race_icon, "[icon_name]_[g]") +/obj/item/organ/external/head/removed() + if(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) + ..() /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) @@ -951,180 +1021,56 @@ Note that amputating the affected organ does in fact remove the infection from t if (burn_dam > 40) disfigure("burn") -/obj/item/organ/external/head/proc/disfigure(var/type = "brute") +/obj/item/organ/external/proc/disfigure(var/type = "brute") if (disfigured) return if(type == "brute") - owner.visible_message("\red You hear a sickening cracking sound coming from \the [owner]'s face.", \ - "\red Your face becomes unrecognizible mangled mess!", \ + owner.visible_message("\red You hear a sickening cracking sound coming from \the [owner]'s [name].", \ + "\red Your [name] becomes a mangled mess!", \ "\red You hear a sickening crack.") else - owner.visible_message("\red [owner]'s face melts away, turning into mangled mess!", \ - "\red Your face melts off!", \ + owner.visible_message("\red \The [owner]'s [name] melts away, turning into mangled mess!", \ + "\red Your [name] melts away!", \ "\red You hear a sickening sizzle.") disfigured = 1 -/**************************************************** - EXTERNAL ORGAN ITEMS -****************************************************/ +// Prosthetics. +/obj/item/organ/external/leg/robot + status = ORGAN_ROBOT + dislocated = -1 -/obj/item/organ - icon = 'icons/mob/human_races/r_human.dmi' - var/op_stage = 0 - var/list/organs_internal = list() +/obj/item/organ/external/leg/right/robot + status = ORGAN_ROBOT + dislocated = -1 -/obj/item/organ/New(loc, mob/living/carbon/human/H) - ..(loc) - if(!istype(H)) - return - if(H.dna) - if(!blood_DNA) - blood_DNA = list() - blood_DNA[H.dna.unique_enzymes] = H.dna.b_type +/obj/item/organ/external/foot/robot + status = ORGAN_ROBOT + dislocated = -1 - // Transferring over organs from the host. - for(var/obj/item/organ/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 - organs_internal |= current_organ +/obj/item/organ/external/foot/right/robot + status = ORGAN_ROBOT + dislocated = -1 - // 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) - else - base = icon('icons/mob/human_races/r_human.dmi') +/obj/item/organ/external/arm/robot + status = ORGAN_ROBOT + dislocated = -1 - if(base) - //Changing limb's skin tone to match owner - if(!H.species || H.species.flags & HAS_SKIN_TONE) - if (H.s_tone >= 0) - base.Blend(rgb(H.s_tone, H.s_tone, H.s_tone), ICON_ADD) - else - base.Blend(rgb(-H.s_tone, -H.s_tone, -H.s_tone), ICON_SUBTRACT) +/obj/item/organ/external/arm/right/robot + status = ORGAN_ROBOT + dislocated = -1 - if(base) - //Changing limb's skin color to match owner - if(!H.species || H.species.flags & HAS_SKIN_COLOR) - base.Blend(rgb(H.r_skin, H.g_skin, H.b_skin), ICON_ADD) +/obj/item/organ/external/hand/robot + status = ORGAN_ROBOT + dislocated = -1 - icon = base - set_dir(SOUTH) - src.transform = turn(src.transform, rand(70,130)) +/obj/item/organ/external/hand/right/robot + status = ORGAN_ROBOT + dislocated = -1 +/obj/item/organ/external/head/robot + status = ORGAN_ROBOT + dislocated = -1 -/**************************************************** - EXTERNAL ORGAN ITEMS DEFINES -****************************************************/ - -/obj/item/organ/l_arm - name = "left arm" - icon_state = "l_arm" -/obj/item/organ/l_foot - name = "left foot" - icon_state = "l_foot" -/obj/item/organ/l_hand - name = "left hand" - icon_state = "l_hand" -/obj/item/organ/l_leg - name = "left leg" - icon_state = "l_leg" -/obj/item/organ/r_arm - name = "right arm" - icon_state = "r_arm" -/obj/item/organ/r_foot - name = "right foot" - icon_state = "r_foot" -/obj/item/organ/r_hand - name = "right hand" - icon_state = "r_hand" -/obj/item/organ/r_leg - name = "right leg" - icon_state = "r_leg" -/obj/item/organ/head - name = "head" - icon_state = "head_m" - -/obj/item/organ/head/New(loc, mob/living/carbon/human/H) - if(istype(H)) - src.icon_state = H.gender == MALE? "head_m" : "head_f" - ..() - //Add (facial) hair. - if(H.f_style) - var/datum/sprite_accessory/facial_hair_style = facial_hair_styles_list[H.f_style] - if(facial_hair_style) - var/icon/facial = new/icon("icon" = facial_hair_style.icon, "icon_state" = "[facial_hair_style.icon_state]_s") - if(facial_hair_style.do_colouration) - facial.Blend(rgb(H.r_facial, H.g_facial, H.b_facial), ICON_ADD) - - overlays.Add(facial) // icon.Blend(facial, ICON_OVERLAY) - - if(H.h_style && !(H.head && (H.head.flags & BLOCKHEADHAIR))) - var/datum/sprite_accessory/hair_style = hair_styles_list[H.h_style] - if(hair_style) - var/icon/hair = new/icon("icon" = hair_style.icon, "icon_state" = "[hair_style.icon_state]_s") - if(hair_style.do_colouration) - hair.Blend(rgb(H.r_hair, H.g_hair, H.b_hair), ICON_ADD) - - overlays.Add(hair) //icon.Blend(hair, ICON_OVERLAY) - - name = "[H.real_name]'s head" - H.regenerate_icons() - -/obj/item/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("[user] cuts [src] open with [W]!") - op_stage++ - return - if(1) - if(istype(W,/obj/item/weapon/retractor)) - user.visible_message("[user] 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 - user.visible_message("[user] extracts [removing] from [src] with [W]!") - else - user.visible_message("[user] fishes around fruitlessly in [src] with [W].") - return - ..() - -/obj/item/organ/external/proc/is_dislocated() - if(dislocated) - return 1 - if(parent) - return parent.is_dislocated() - return 0 - -/obj/item/organ/external/proc/dislocate(var/primary) - if(dislocated != -1) - if(primary) - dislocated = 2 - else - dislocated = 1 - if(children && children.len) - for(var/obj/item/organ/external/child in children) - child.dislocate() - -/obj/item/organ/external/proc/undislocate() - if(dislocated != -1) - dislocated = 0 - if(children && children.len) - for(var/obj/item/organ/external/child in children) - child.undislocate() - if(owner) - owner.shock_stage += 20 +/obj/item/organ/external/chest/robot + status = ORGAN_ROBOT + dislocated = -1 diff --git a/code/modules/organs/organ_icon.dm b/code/modules/organs/organ_icon.dm new file mode 100644 index 0000000000..3970eaf1bc --- /dev/null +++ b/code/modules/organs/organ_icon.dm @@ -0,0 +1,106 @@ +var/global/list/limb_icon_cache = list() + +/obj/item/organ/proc/get_icon(var/image/supplied) + var/key = "internal-[icon_state]" + var/image/I + if(organ_cache[key]) + I = organ_cache[key] + else + I = image(icon, "[icon_state]") + return I + +/obj/item/organ/external/proc/compile_icon() + overlays.Cut() + get_icon() + // 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.get_icon() + overlays += organ.get_icon() + +/obj/item/organ/external/get_icon(var/skeletal) + + if(!owner) + mob_icon = new /icon('icons/mob/human_races/r_human.dmi', "[icon_name][gendered_icon ? "_f" : ""]") + else + + var/gender + if(gendered_icon) + if(owner.gender == FEMALE) + gender = "f" + else + gender = "m" + + //TODO: cache these icons + if(skeletal) + mob_icon = new /icon('icons/mob/human_races/r_skeleton.dmi', "[icon_name][gender ? "_[gender]" : ""]") + else if (status & ORGAN_ROBOT && !(owner.species && owner.species.flags & IS_SYNTHETIC)) + mob_icon = new /icon('icons/mob/human_races/robotic.dmi', "[icon_name][gender ? "_[gender]" : ""]") + else + if (status & ORGAN_MUTATED) + mob_icon = new /icon(owner.species.deform, "[icon_name][gender ? "_[gender]" : ""]") + else + mob_icon = new /icon(owner.species.icobase, "[icon_name][gender ? "_[gender]" : ""]") + + if(status & ORGAN_DEAD) + mob_icon.ColorTone(rgb(10,50,0)) + mob_icon.SetIntensity(0.7) + + if(owner.species.flags & HAS_SKIN_TONE) + if(owner.s_tone >= 0) + mob_icon.Blend(rgb(owner.s_tone, owner.s_tone, owner.s_tone), ICON_ADD) + else + mob_icon.Blend(rgb(-owner.s_tone, -owner.s_tone, -owner.s_tone), ICON_SUBTRACT) + else if(owner.species.flags & HAS_SKIN_COLOR) + mob_icon.Blend(rgb(owner.r_skin, owner.g_skin, owner.b_skin), ICON_ADD) + + icon = mob_icon + dir = EAST + return icon + +/obj/item/organ/external/head/get_icon(var/skeletal) + + if(skeletal || !owner) + return + + ..() + + if(owner.species.has_organ["eyes"]) + var/obj/item/organ/eyes/eyes = owner.internal_organs_by_name["eyes"] + if(eyes && owner.species.eyes) + var/icon/eyes_icon = new/icon('icons/mob/human_face.dmi', owner.species.eyes) + eyes_icon.Blend(rgb(eyes.eye_colour[1], eyes.eye_colour[2], eyes.eye_colour[3]), ICON_ADD) + mob_icon.Blend(eyes_icon, ICON_OVERLAY) + + if(owner.lip_style && (owner.species && owner.species.flags & HAS_LIPS)) + mob_icon.Blend(new/icon('icons/mob/human_face.dmi', "lips_[owner.lip_style]_s"), ICON_OVERLAY) + + if(owner.f_style) + var/datum/sprite_accessory/facial_hair_style = facial_hair_styles_list[owner.f_style] + if(facial_hair_style) + var/icon/facial = new/icon("icon" = facial_hair_style.icon, "icon_state" = "[facial_hair_style.icon_state]_s") + if(facial_hair_style.do_colouration) + facial.Blend(rgb(owner.r_facial, owner.g_facial, owner.b_facial), ICON_ADD) + mob_icon.Blend(facial, ICON_OVERLAY) + + 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) + var/icon/hair = new/icon("icon" = hair_style.icon, "icon_state" = "[hair_style.icon_state]_s") + if(hair_style.do_colouration) + hair.Blend(rgb(owner.r_hair, owner.g_hair, owner.b_hair), ICON_ADD) + + mob_icon.Blend(hair, ICON_OVERLAY) + + icon = mob_icon + return 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 diff --git a/code/modules/organs/organ_internal.dm b/code/modules/organs/organ_internal.dm index 8f32f51bc4..f39485200f 100644 --- a/code/modules/organs/organ_internal.dm +++ b/code/modules/organs/organ_internal.dm @@ -68,7 +68,7 @@ gender = PLURAL organ_tag = "eyes" parent_organ = "head" - var/eye_colour + var/list/eye_colour /obj/item/organ/eyes/process() //Eye damage replaces the old eye_stat var. ..() diff --git a/code/modules/paperwork/paperbin.dm b/code/modules/paperwork/paperbin.dm index c52dc3080f..7a89f12508 100644 --- a/code/modules/paperwork/paperbin.dm +++ b/code/modules/paperwork/paperbin.dm @@ -22,10 +22,11 @@ return /obj/item/weapon/paper_bin/attack_hand(mob/user as mob) - if (hasorgans(user)) - var/obj/item/organ/external/temp = user:organs_by_name["r_hand"] - if (user.hand) - temp = user:organs_by_name["l_hand"] + if(ishuman(user)) + var/mob/living/carbon/human/H = user + var/obj/item/organ/external/temp = H.organs_by_name["r_hand"] + if (H.hand) + temp = H.organs_by_name["l_hand"] if(temp && !temp.is_usable()) user << "You try to move your [temp.display_name], but cannot!" return diff --git a/code/modules/surgery/headreattach.dm b/code/modules/surgery/headreattach.dm index 5d3a83ada9..28759cbc73 100644 --- a/code/modules/surgery/headreattach.dm +++ b/code/modules/surgery/headreattach.dm @@ -156,7 +156,7 @@ /datum/surgery_step/head/attach - allowed_tools = list(/obj/item/organ/head = 100) + allowed_tools = list(/obj/item/organ/external/head = 100) can_infect = 0 min_duration = 80 @@ -177,7 +177,6 @@ "\blue You have attached [target]'s head to the body.") affected.status = 0 affected.amputated = 0 - affected.destspawn = 0 target.update_body() target.updatehealth() target.UpdateDamageIcon() From f017764e64f8b2914994b08932aff1c300968d3e Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 25 Mar 2015 00:55:16 +1030 Subject: [PATCH 03/11] More work on adjusting/tweaking/fixing the limb port to make it functional. --- code/modules/mob/living/carbon/human/death.dm | 8 ++--- .../mob/living/carbon/human/human_organs.dm | 9 ++--- .../living/carbon/human/species/species.dm | 5 ++- code/modules/mob/mob.dm | 2 +- code/modules/organs/organ.dm | 35 ++++++++----------- code/modules/organs/organ_alien.dm | 6 ++-- code/modules/organs/organ_external.dm | 10 +++--- .../projectiles/guns/launcher/crossbow.dm | 6 ++-- code/modules/surgery/organs_internal.dm | 9 ++--- 9 files changed, 41 insertions(+), 49 deletions(-) diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index 4ab5c0b37c..3db0610781 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -1,11 +1,9 @@ /mob/living/carbon/human/gib() for(var/obj/item/organ/I in internal_organs) - var/obj/item/organ/current_organ = I.remove() - if(current_organ) - if(istype(loc,/turf)) - current_organ.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),30) - current_organ.removed(src) + I.removed() + if(istype(loc,/turf)) + I.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),30) for(var/obj/item/organ/external/E in src.organs) if(istype(E, /obj/item/organ/external/chest)) diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index b377e6f46e..7f1b796bed 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -64,10 +64,11 @@ for (var/organ in list("l_leg","l_foot","r_leg","r_foot")) var/obj/item/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 + if(E) + 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. diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 6a3dd71d19..d53710d395 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -142,7 +142,10 @@ /datum/species/proc/create_organs(var/mob/living/carbon/human/H) //Handles creation of mob organs. - //Trying to work out why species changes aren't fixing organs properly. + for(var/obj/item/organ/organ in H.contents) + if((organ in H.organs) || (organ in H.internal_organs)) + del(organ) + if(H.organs) H.organs.Cut() if(H.internal_organs) H.internal_organs.Cut() if(H.organs_by_name) H.organs_by_name.Cut() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 5978d0df53..399b1ce5ca 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -593,7 +593,7 @@ var/list/slot_equipment_priority = list( \ if(H.health - H.halloss <= config.health_threshold_softcrit) for(var/name in H.organs_by_name) var/obj/item/organ/external/e = H.organs_by_name[name] - if(H.lying) + if(e && H.lying) if(((e.status & ORGAN_BROKEN && !(e.status & ORGAN_SPLINTED)) || e.status & ORGAN_BLEEDING) && (H.getBruteLoss() + H.getFireLoss() >= 100)) return 1 break diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index b0f79ce602..9562fcb41d 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -226,29 +226,29 @@ var/list/organ_cache = list() take_damage(10,0) return -/obj/item/organ/proc/removed(var/mob/living/carbon/human/target,var/mob/living/user) +/obj/item/organ/proc/removed(var/mob/living/user) - if(!istype(target)) + if(!istype(owner)) return - target.internal_organs_by_name[organ_tag] = null - target.internal_organs_by_name -= organ_tag - target.internal_organs -= src + owner.internal_organs_by_name[organ_tag] = null + owner.internal_organs_by_name -= organ_tag + owner.internal_organs -= src - var/obj/item/organ/external/affected = target.get_organ(parent_organ) - affected.internal_organs -= src + var/obj/item/organ/external/affected = owner.get_organ(parent_organ) + if(affected) affected.internal_organs -= src - loc = target.loc + loc = owner.loc 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) + owner.vessel.trans_to(src, 5, 1, 1) - if(target && user && vital) - user.attack_log += "\[[time_stamp()]\] removed a vital organ ([src]) from [target.name] ([target.ckey]) (INTENT: [uppertext(user.a_intent)])" - target.attack_log += "\[[time_stamp()]\] had a vital organ ([src]) removed by [user.name] ([user.ckey]) (INTENT: [uppertext(user.a_intent)])" - msg_admin_attack("[user.name] ([user.ckey]) removed a vital organ ([src]) from [target.name] ([target.ckey]) (INTENT: [uppertext(user.a_intent)]) (JMP)") - target.death() + if(owner && user && vital) + user.attack_log += "\[[time_stamp()]\] removed a vital organ ([src]) from [owner.name] ([owner.ckey]) (INTENT: [uppertext(user.a_intent)])" + owner.attack_log += "\[[time_stamp()]\] had a vital organ ([src]) removed by [user.name] ([user.ckey]) (INTENT: [uppertext(user.a_intent)])" + msg_admin_attack("[user.name] ([user.ckey]) removed a vital organ ([src]) from [owner.name] ([owner.ckey]) (INTENT: [uppertext(user.a_intent)]) (JMP)") + owner.death() /obj/item/organ/proc/replaced(var/mob/living/carbon/human/target,var/obj/item/organ/external/affected) @@ -314,10 +314,3 @@ var/list/organ_cache = list() if(!robotic && user.a_intent == "help" && user.zone_sel.selecting == "mouth") bitten(user) return - -/obj/item/organ/proc/remove(var/mob/user) - if(user) - src.loc = get_turf(user) - else - src.loc = get_turf(owner) - return src diff --git a/code/modules/organs/organ_alien.dm b/code/modules/organs/organ_alien.dm index c8fd93ea78..e5f91c6b41 100644 --- a/code/modules/organs/organ_alien.dm +++ b/code/modules/organs/organ_alien.dm @@ -107,14 +107,14 @@ organ_tag = "brain" desc = "A disgusting space slug." -/obj/item/organ/borer/removed(var/mob/living/target,var/mob/living/user) +/obj/item/organ/borer/removed(var/mob/living/user) ..() - var/mob/living/simple_animal/borer/B = target.has_brain_worms() + var/mob/living/simple_animal/borer/B = owner.has_brain_worms() if(B) B.leave_host() - B.ckey = target.ckey + B.ckey = owner.ckey spawn(0) del(src) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 6e1b7c5c34..e5ba05eef2 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -28,7 +28,7 @@ var/list/obj/item/organ/external/children // Internal organs of this body part - var/list/obj/item/organ/internal_organs + var/list/internal_organs = list() var/damage_msg = "\red You feel an intense pain" var/broken_description @@ -620,7 +620,7 @@ Note that amputating the affected organ does in fact remove the infection from t if(parent) parent.children -= src - src.removed(owner) + src.removed() if(parent) spawn(1) @@ -808,7 +808,7 @@ Note that amputating the affected organ does in fact remove the infection from t H.drop_item() W.loc = owner -/obj/item/organ/external/removed(var/mob/living/user) +/obj/item/organ/external/removed() var/is_robotic = status & ORGAN_ROBOT ..() @@ -823,12 +823,12 @@ Note that amputating the affected organ does in fact remove the infection from t // Attached organs also fly off. for(var/obj/item/organ/external/O in children) - O.removed(owner) + O.removed() O.loc = src //TODO: generate entire limb icons from contents. // Grab all the internal giblets too. for(var/obj/item/organ/organ in internal_organs) - organ.removed(user) + organ.removed() organ.loc = src release_restraints() diff --git a/code/modules/projectiles/guns/launcher/crossbow.dm b/code/modules/projectiles/guns/launcher/crossbow.dm index 860169d7b2..917d3c338e 100644 --- a/code/modules/projectiles/guns/launcher/crossbow.dm +++ b/code/modules/projectiles/guns/launcher/crossbow.dm @@ -105,14 +105,14 @@ current_user = user user.visible_message("[user] begins to draw back the string of [src].","You begin to draw back the string of [src].") tension = 1 - + while(bolt && tension && current_user == user) if(!do_after(user, 25)) //crossbow strings don't just magically pull back on their own. user.visible_message("[usr] stops drawing and relaxes the string of [src].","You stop drawing back and relax the string of [src].") tension = 0 icon_state = "crossbow" return - + tension++ icon_state = "crossbow-drawn" @@ -120,7 +120,7 @@ tension = max_tension usr << "[src] clunks as you draw the string to its maximum tension!" return - + user.visible_message("[usr] draws back the string of [src]!","You continue drawing back the string of [src]!") /obj/item/weapon/gun/launcher/crossbow/proc/increase_tension(var/mob/user as mob) diff --git a/code/modules/surgery/organs_internal.dm b/code/modules/surgery/organs_internal.dm index 6057e06a7f..8107a0548a 100644 --- a/code/modules/surgery/organs_internal.dm +++ b/code/modules/surgery/organs_internal.dm @@ -304,12 +304,9 @@ // Extract the organ! if(target.op_stage.current_organ) - var/obj/item/organ/I = target.internal_organs_by_name[target.op_stage.current_organ] - var/obj/item/organ/O - if(I && istype(I)) - O = I.remove(user) - if(O && istype(O)) - O.removed(target,user) + var/obj/item/organ/O = target.internal_organs_by_name[target.op_stage.current_organ] + if(O && istype(O)) + O.removed(user) target.op_stage.current_organ = null fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) From 97112c8a4c65238fcdf2d2d2500964bf168cd30a Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 25 Mar 2015 13:24:28 +1030 Subject: [PATCH 04/11] Replaced display_name with name, worked on severing limbs and damage propagation. --- baystation12.dme | 1 + code/game/antagonist/alien/borer.dm | 2 +- code/game/gamemodes/objective.dm | 10 +- code/game/machinery/adv_med.dm | 4 +- code/game/objects/items.dm | 2 +- code/game/objects/items/devices/PDA/PDA.dm | 2 +- code/game/objects/items/devices/scanners.dm | 4 +- code/game/objects/items/stacks/medical.dm | 52 ++++---- code/game/objects/items/stacks/nanopaste.dm | 4 +- code/game/objects/items/weapons/autopsy.dm | 6 +- code/game/objects/items/weapons/handcuffs.dm | 4 +- .../objects/items/weapons/implants/implant.dm | 10 +- code/game/objects/items/weapons/stunbaton.dm | 4 +- code/game/objects/items/weapons/tools.dm | 2 +- code/game/objects/structures.dm | 2 +- code/game/objects/structures/extinguisher.dm | 2 +- code/game/objects/structures/watercloset.dm | 2 +- code/modules/client/preferences.dm | 9 +- .../modules/clothing/spacesuits/spacesuits.dm | 2 +- code/modules/hydroponics/seed.dm | 4 +- .../mob/living/carbon/brain/brain_item.dm | 9 +- code/modules/mob/living/carbon/carbon.dm | 4 +- code/modules/mob/living/carbon/human/death.dm | 9 +- .../mob/living/carbon/human/examine.dm | 34 +++--- code/modules/mob/living/carbon/human/human.dm | 8 +- .../living/carbon/human/human_attackhand.dm | 10 +- .../mob/living/carbon/human/human_damage.dm | 6 +- .../mob/living/carbon/human/human_defense.dm | 22 ++-- .../mob/living/carbon/human/human_organs.dm | 2 +- .../living/carbon/human/species/species.dm | 28 +++-- .../carbon/human/species/species_attack.dm | 8 +- .../human/species/xenomorphs/alien_species.dm | 2 +- .../mob/living/carbon/human/unarmed_attack.dm | 8 +- code/modules/mob/living/carbon/shock.dm | 2 +- .../mob/living/silicon/robot/analyzer.dm | 2 +- code/modules/organs/organ.dm | 11 +- code/modules/organs/organ_external.dm | 114 ++++++++---------- code/modules/organs/organ_icon.dm | 2 + code/modules/organs/organ_internal.dm | 6 +- code/modules/organs/organ_stump.dm | 35 ++++++ code/modules/organs/pain.dm | 5 +- code/modules/paperwork/paperbin.dm | 2 +- code/modules/power/cable.dm | 2 +- .../reagents/reagent_containers/syringes.dm | 9 +- code/modules/surgery/bones.dm | 44 +++---- code/modules/surgery/encased.dm | 12 +- code/modules/surgery/generic.dm | 98 +++++++-------- code/modules/surgery/headreattach.dm | 11 +- code/modules/surgery/implant.dm | 40 +++--- code/modules/surgery/organs_internal.dm | 38 +++--- code/modules/surgery/other.dm | 42 +++---- code/modules/surgery/robolimbs.dm | 50 ++++---- code/modules/virus2/effect.dm | 6 +- 53 files changed, 420 insertions(+), 389 deletions(-) create mode 100644 code/modules/organs/organ_stump.dm diff --git a/baystation12.dme b/baystation12.dme index 5955d6a228..786b36daa8 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1277,6 +1277,7 @@ #include "code\modules\organs\organ_external.dm" #include "code\modules\organs\organ_icon.dm" #include "code\modules\organs\organ_internal.dm" +#include "code\modules\organs\organ_stump.dm" #include "code\modules\organs\pain.dm" #include "code\modules\organs\wound.dm" #include "code\modules\overmap\_defines.dm" diff --git a/code/game/antagonist/alien/borer.dm b/code/game/antagonist/alien/borer.dm index 6f227c3ce0..9fe4226e5b 100644 --- a/code/game/antagonist/alien/borer.dm +++ b/code/game/antagonist/alien/borer.dm @@ -28,7 +28,7 @@ var/datum/antagonist/xenos/borer/borers borer.host_brain.name = host.name borer.host_brain.real_name = host.real_name var/obj/item/organ/external/head = host.get_organ("head") - head.implants += borer + if(head) head.implants += borer /datum/antagonist/xenos/borer/proc/get_hosts() var/list/possible_hosts = list() diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index b8ddcdedee..eb9256eee0 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -457,10 +457,14 @@ datum/objective/harm var/mob/living/carbon/human/H = target.current for(var/obj/item/organ/external/E in H.organs) if(E.status & ORGAN_BROKEN) - already_completed = 1 return 1 - if(E.status & ORGAN_DESTROYED && !E.amputated) - already_completed = 1 + for(var/limb_type in H.species.has_limbs) //todo check prefs for robotic limbs and amputations. + var/found + for(var/obj/item/organ/external/E in H.organs) + if(limb_type == E.type) + found = 1 + break + if(!found) return 1 var/obj/item/organ/external/head/head = H.get_organ("head") diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index 25f977e1a7..51e1ec7510 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -404,9 +404,9 @@ if(!AN && !open && !infected & !imp) AN = "None:" if(!(e.status & ORGAN_DESTROYED)) - dat += "[e.display_name][e.burn_dam][e.brute_dam][robot][bled][AN][splint][open][infected][imp][internal_bleeding][lung_ruptured]" + dat += "[e.name][e.burn_dam][e.brute_dam][robot][bled][AN][splint][open][infected][imp][internal_bleeding][lung_ruptured]" else - dat += "[e.display_name]--Not Found" + dat += "[e.name]--Not Found" dat += "" for(var/obj/item/organ/i in occ["internal_organs"]) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index e8b2773c7e..57b77d4890 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -124,7 +124,7 @@ if (user.hand) temp = H.organs_by_name["l_hand"] if(temp && !temp.is_usable()) - user << "You try to move your [temp.display_name], but cannot!" + user << "You try to move your [temp.name], but cannot!" return if (istype(src.loc, /obj/item/weapon/storage)) diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index c687014771..5687d896d1 100755 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -1207,7 +1207,7 @@ var/global/list/obj/item/device/pda/PDAs = list() user.show_message("\blue Localized Damage, Brute/Burn:",1) if(length(damaged)>0) for(var/obj/item/organ/external/org in damaged) - user.show_message(text("\blue \t []: []\blue-[]",capitalize(org.display_name),(org.brute_dam > 0)?"\red [org.brute_dam]":0,(org.burn_dam > 0)?"\red [org.burn_dam]":0),1) + user.show_message(text("\blue \t []: []\blue-[]",capitalize(org.name),(org.brute_dam > 0)?"\red [org.brute_dam]":0,(org.burn_dam > 0)?"\red [org.burn_dam]":0),1) else user.show_message("\blue \t Limbs are OK.",1) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index ca8df7a48e..4b95f1bdf8 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -125,7 +125,7 @@ REAGENT SCANNER if(length(damaged)>0) for(var/obj/item/organ/external/org in damaged) user.show_message(text("\blue \t []: [][]\blue - []", \ - "[capitalize(org.display_name)][org.status & ORGAN_ROBOT ? "(Cybernetic)" : ""]", \ + "[capitalize(org.name)][org.status & ORGAN_ROBOT ? "(Cybernetic)" : ""]", \ (org.brute_dam > 0) ? "\red [org.brute_dam]" :0, \ (org.status & ORGAN_BLEEDING)?"\red \[Bleeding\]":"\t", \ (org.burn_dam > 0) ? "[org.burn_dam]" :0),1) @@ -181,7 +181,7 @@ REAGENT SCANNER var/mob/living/carbon/human/H = M for(var/name in H.organs_by_name) var/obj/item/organ/external/e = H.organs_by_name[name] - var/limb = e.display_name + var/limb = e.name if(e.status & ORGAN_BROKEN) if(((e.name == "l_arm") || (e.name == "r_arm") || (e.name == "l_leg") || (e.name == "r_leg")) && (!(e.status & ORGAN_SPLINTED))) user << "\red Unsecured fracture in subject [limb]. Splinting recommended for transport." diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm index 1a2fe3459a..3a8d8f25eb 100644 --- a/code/game/objects/items/stacks/medical.dm +++ b/code/game/objects/items/stacks/medical.dm @@ -25,7 +25,7 @@ var/mob/living/carbon/human/H = M var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting) - if(affecting.display_name == "head") + if(affecting.name == "head") if(H.head && istype(H.head,/obj/item/clothing/head/helmet/space)) user << "\red You can't apply [src] through [H.head]!" return 1 @@ -67,29 +67,29 @@ if(affecting.open == 0) if(!affecting.bandage()) - user << "\red The wounds on [M]'s [affecting.display_name] have already been bandaged." + user << "\red The wounds on [M]'s [affecting.name] have already been bandaged." return 1 else for (var/datum/wound/W in affecting.wounds) if (W.internal) continue if (W.current_stage <= W.max_bleeding_stage) - user.visible_message( "\blue [user] bandages [W.desc] on [M]'s [affecting.display_name].", \ - "\blue You bandage [W.desc] on [M]'s [affecting.display_name]." ) + user.visible_message( "\blue [user] bandages [W.desc] on [M]'s [affecting.name].", \ + "\blue You bandage [W.desc] on [M]'s [affecting.name]." ) //H.add_side_effect("Itch") else if (istype(W,/datum/wound/bruise)) - user.visible_message( "\blue [user] places bruise patch over [W.desc] on [M]'s [affecting.display_name].", \ - "\blue You place bruise patch over [W.desc] on [M]'s [affecting.display_name]." ) + user.visible_message( "\blue [user] places bruise patch over [W.desc] on [M]'s [affecting.name].", \ + "\blue You place bruise patch over [W.desc] on [M]'s [affecting.name]." ) else - user.visible_message( "\blue [user] places bandaid over [W.desc] on [M]'s [affecting.display_name].", \ - "\blue You place bandaid over [W.desc] on [M]'s [affecting.display_name]." ) + user.visible_message( "\blue [user] places bandaid over [W.desc] on [M]'s [affecting.name].", \ + "\blue You place bandaid over [W.desc] on [M]'s [affecting.name]." ) use(1) else if (can_operate(H)) //Checks if mob is lying down on table for surgery if (do_surgery(H,user,src)) return else - user << "The [affecting.display_name] is cut open, you'll need more than a bandage!" + user << "The [affecting.name] is cut open, you'll need more than a bandage!" /obj/item/stack/medical/ointment name = "ointment" @@ -110,18 +110,18 @@ if(affecting.open == 0) if(!affecting.salve()) - user << "\red The wounds on [M]'s [affecting.display_name] have already been salved." + user << "\red The wounds on [M]'s [affecting.name] have already been salved." return 1 else - user.visible_message( "\blue [user] salves wounds on [M]'s [affecting.display_name].", \ - "\blue You salve wounds on [M]'s [affecting.display_name]." ) + user.visible_message( "\blue [user] salves wounds on [M]'s [affecting.name].", \ + "\blue You salve wounds on [M]'s [affecting.name]." ) use(1) else if (can_operate(H)) //Checks if mob is lying down on table for surgery if (do_surgery(H,user,src)) return else - user << "The [affecting.display_name] is cut open, you'll need more than a bandage!" + user << "The [affecting.name] is cut open, you'll need more than a bandage!" /obj/item/stack/medical/advanced/bruise_pack name = "advanced trauma kit" @@ -144,22 +144,22 @@ var/disinfected = affecting.disinfect() if(!(bandaged || disinfected)) - user << "\red The wounds on [M]'s [affecting.display_name] have already been treated." + user << "\red The wounds on [M]'s [affecting.name] have already been treated." return 1 else for (var/datum/wound/W in affecting.wounds) if (W.internal) continue if (W.current_stage <= W.max_bleeding_stage) - user.visible_message( "\blue [user] cleans [W.desc] on [M]'s [affecting.display_name] and seals edges with bioglue.", \ - "\blue You clean and seal [W.desc] on [M]'s [affecting.display_name]." ) + user.visible_message( "\blue [user] cleans [W.desc] on [M]'s [affecting.name] and seals edges with bioglue.", \ + "\blue You clean and seal [W.desc] on [M]'s [affecting.name]." ) //H.add_side_effect("Itch") else if (istype(W,/datum/wound/bruise)) - user.visible_message( "\blue [user] places medicine patch over [W.desc] on [M]'s [affecting.display_name].", \ - "\blue You place medicine patch over [W.desc] on [M]'s [affecting.display_name]." ) + user.visible_message( "\blue [user] places medicine patch over [W.desc] on [M]'s [affecting.name].", \ + "\blue You place medicine patch over [W.desc] on [M]'s [affecting.name]." ) else - user.visible_message( "\blue [user] smears some bioglue over [W.desc] on [M]'s [affecting.display_name].", \ - "\blue You smear some bioglue over [W.desc] on [M]'s [affecting.display_name]." ) + user.visible_message( "\blue [user] smears some bioglue over [W.desc] on [M]'s [affecting.name].", \ + "\blue You smear some bioglue over [W.desc] on [M]'s [affecting.name]." ) if (bandaged) affecting.heal_damage(heal_brute,0) use(1) @@ -168,7 +168,7 @@ if (do_surgery(H,user,src)) return else - user << "The [affecting.display_name] is cut open, you'll need more than a bandage!" + user << "The [affecting.name] is cut open, you'll need more than a bandage!" /obj/item/stack/medical/advanced/ointment name = "advanced burn kit" @@ -189,11 +189,11 @@ if(affecting.open == 0) if(!affecting.salve()) - user << "\red The wounds on [M]'s [affecting.display_name] have already been salved." + user << "\red The wounds on [M]'s [affecting.name] have already been salved." return 1 else - user.visible_message( "\blue [user] covers wounds on [M]'s [affecting.display_name] with regenerative membrane.", \ - "\blue You cover wounds on [M]'s [affecting.display_name] with regenerative membrane." ) + user.visible_message( "\blue [user] covers wounds on [M]'s [affecting.name] with regenerative membrane.", \ + "\blue You cover wounds on [M]'s [affecting.name] with regenerative membrane." ) affecting.heal_damage(0,heal_burn) use(1) else @@ -201,7 +201,7 @@ if (do_surgery(H,user,src)) return else - user << "The [affecting.display_name] is cut open, you'll need more than a bandage!" + user << "The [affecting.name] is cut open, you'll need more than a bandage!" /obj/item/stack/medical/splint name = "medical splints" @@ -217,7 +217,7 @@ if (istype(M, /mob/living/carbon/human)) var/mob/living/carbon/human/H = M var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting) - var/limb = affecting.display_name + var/limb = affecting.name if(!((affecting.name == "l_arm") || (affecting.name == "r_arm") || (affecting.name == "l_leg") || (affecting.name == "r_leg"))) user << "\red You can't apply a splint there!" return diff --git a/code/game/objects/items/stacks/nanopaste.dm b/code/game/objects/items/stacks/nanopaste.dm index 2e422ea1a9..f85bc336be 100644 --- a/code/game/objects/items/stacks/nanopaste.dm +++ b/code/game/objects/items/stacks/nanopaste.dm @@ -33,8 +33,8 @@ S.heal_damage(15, 15, robo_repair = 1) H.updatehealth() use(1) - user.visible_message("\The [user] applies some nanite paste at[user != M ? " \the [M]'s" : " \the"][S.display_name] with \the [src].",\ - "You apply some nanite paste at [user == M ? "your" : "[M]'s"] [S.display_name].") + user.visible_message("\The [user] applies some nanite paste at[user != M ? " \the [M]'s" : " \the"][S.name] with \the [src].",\ + "You apply some nanite paste at [user == M ? "your" : "[M]'s"] [S.name].") else user << "Nothing to fix here." else diff --git a/code/game/objects/items/weapons/autopsy.dm b/code/game/objects/items/weapons/autopsy.dm index 1ecbedae7d..dc6787a73b 100644 --- a/code/game/objects/items/weapons/autopsy.dm +++ b/code/game/objects/items/weapons/autopsy.dm @@ -64,9 +64,9 @@ if(!D.organs_scanned[O.name]) if(D.organ_names == "") - D.organ_names = O.display_name + D.organ_names = O.name else - D.organ_names += ", [O.display_name]" + D.organ_names += ", [O.name]" del D.organs_scanned[O.name] D.organs_scanned[O.name] = W.copy() @@ -199,7 +199,7 @@ usr << "You have to cut the limb open first!" return for(var/mob/O in viewers(M)) - O.show_message("\red [user.name] scans the wounds on [M.name]'s [S.display_name] with \the [src.name]", 1) + O.show_message("\red [user.name] scans the wounds on [M.name]'s [S.name] with \the [src.name]", 1) src.add_data(S) diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm index 8317689c78..86ba9cf811 100644 --- a/code/game/objects/items/weapons/handcuffs.dm +++ b/code/game/objects/items/weapons/handcuffs.dm @@ -96,8 +96,8 @@ var/last_chew = 0 var/obj/item/organ/external/O = H.organs_by_name[H.hand?"l_hand":"r_hand"] if (!O) return - var/s = "\red [H.name] chews on \his [O.display_name]!" - H.visible_message(s, "\red You chew on your [O.display_name]!") + var/s = "\red [H.name] chews on \his [O.name]!" + H.visible_message(s, "\red You chew on your [O.name]!") H.attack_log += text("\[[time_stamp()]\] [s] ([H.ckey])") log_attack("[s] ([H.ckey])") diff --git a/code/game/objects/items/weapons/implants/implant.dm b/code/game/objects/items/weapons/implants/implant.dm index 3d97ff93b2..10c4bb722f 100644 --- a/code/game/objects/items/weapons/implants/implant.dm +++ b/code/game/objects/items/weapons/implants/implant.dm @@ -35,7 +35,7 @@ return 0 proc/meltdown() //breaks it down, making implant unrecongizible - imp_in << "\red You feel something melting inside [part ? "your [part.display_name]" : "you"]!" + imp_in << "\red You feel something melting inside [part ? "your [part.name]" : "you"]!" if (part) part.take_damage(burn = 15, used_weapon = "Electronics meltdown") else @@ -171,7 +171,7 @@ Implant Specifics:
"} if(ishuman(imp_in)) if (elevel == "Localized Limb") if(part) //For some reason, small_boom() didn't work. So have this bit of working copypaste. - imp_in.visible_message("\red Something beeps inside [imp_in][part ? "'s [part.display_name]" : ""]!") + imp_in.visible_message("\red Something beeps inside [imp_in][part ? "'s [part.name]" : ""]!") playsound(loc, 'sound/items/countdown.ogg', 75, 1, -3) sleep(25) if (istype(part,/obj/item/organ/external/chest) || \ @@ -182,7 +182,7 @@ Implant Specifics:
"} del(src) else explosion(get_turf(imp_in), -1, -1, 2, 3) - part.droplimb(1) + part.droplimb() del(src) if (elevel == "Destroy Body") explosion(get_turf(T), -1, 0, 1, 6) @@ -236,7 +236,7 @@ Implant Specifics:
"} proc/small_boom() if (ishuman(imp_in) && part) - imp_in.visible_message("\red Something beeps inside [imp_in][part ? "'s [part.display_name]" : ""]!") + imp_in.visible_message("\red Something beeps inside [imp_in][part ? "'s [part.name]" : ""]!") playsound(loc, 'sound/items/countdown.ogg', 75, 1, -3) spawn(25) if (ishuman(imp_in) && part) @@ -247,7 +247,7 @@ Implant Specifics:
"} istype(part,/obj/item/organ/external/head)) part.createwound(BRUISE, 60) //mangle them instead else - part.droplimb(1) + part.droplimb() explosion(get_turf(imp_in), -1, -1, 2, 3) del(src) diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm index ee3617bc55..28c421b100 100644 --- a/code/game/objects/items/weapons/stunbaton.dm +++ b/code/game/objects/items/weapons/stunbaton.dm @@ -136,10 +136,10 @@ var/obj/item/organ/external/affecting = H.get_organ(target_zone) if (affecting) if(!status) - L.visible_message("[L] has been prodded in the [affecting.display_name] with [src] by [user]. Luckily it was off.") + L.visible_message("[L] has been prodded in the [affecting.name] with [src] by [user]. Luckily it was off.") return 1 else - H.visible_message("[L] has been prodded in the [affecting.display_name] with [src] by [user]!") + H.visible_message("[L] has been prodded in the [affecting.name] with [src] by [user]!") else if(!status) L.visible_message("[L] has been prodded with [src] by [user]. Luckily it was off.") diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm index 4310e7ff75..4967a4bee0 100644 --- a/code/game/objects/items/weapons/tools.dm +++ b/code/game/objects/items/weapons/tools.dm @@ -472,7 +472,7 @@ if(S.brute_dam) S.heal_damage(15,0,0,1) - user.visible_message("\red \The [user] patches some dents on \the [M]'s [S.display_name] with \the [src].") + user.visible_message("\red \The [user] patches some dents on \the [M]'s [S.name] with \the [src].") return else user << "Nothing to fix!" diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index 2a998998fa..900baea3f3 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -148,7 +148,7 @@ affecting = H.get_organ("head") if(affecting) - M << "You land heavily on your [affecting.display_name]!" + M << "You land heavily on your [affecting.name]!" affecting.take_damage(damage, 0) if(affecting.parent) affecting.parent.add_autopsy_data("Misadventure", damage) diff --git a/code/game/objects/structures/extinguisher.dm b/code/game/objects/structures/extinguisher.dm index b9135176f8..4ee9b728a6 100644 --- a/code/game/objects/structures/extinguisher.dm +++ b/code/game/objects/structures/extinguisher.dm @@ -37,7 +37,7 @@ if (user.hand) temp = H.organs_by_name["l_hand"] if(temp && !temp.is_usable()) - user << "You try to move your [temp.display_name], but cannot!" + user << "You try to move your [temp.name], but cannot!" return if(has_extinguisher) user.put_in_hands(has_extinguisher) diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 778f5bc65b..5aa52bb73f 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -352,7 +352,7 @@ if (user.hand) temp = user:organs_by_name["l_hand"] if(temp && !temp.is_usable()) - user << "You try to move your [temp.display_name], but cannot!" + user << "You try to move your [temp.name], but cannot!" return if(isrobot(user) || isAI(user)) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index d0d2ee9065..ae3efc0e71 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1693,8 +1693,13 @@ datum/preferences var/obj/item/organ/external/O = character.organs_by_name[name] if(O) if(status == "amputated") - O.amputated = 1 - O.status |= ORGAN_DESTROYED + character.organs_by_name[O.limb_name] = null + character.organs -= O + if(O.children) // This might need to become recursive. + for(var/obj/item/organ/external/child in O.children) + character.organs_by_name[child.limb_name] = null + character.organs -= child + else if(status == "cyborg") O.status |= ORGAN_ROBOT else diff --git a/code/modules/clothing/spacesuits/spacesuits.dm b/code/modules/clothing/spacesuits/spacesuits.dm index a597ffab99..15c4a68308 100644 --- a/code/modules/clothing/spacesuits/spacesuits.dm +++ b/code/modules/clothing/spacesuits/spacesuits.dm @@ -89,5 +89,5 @@ // Otherwise, remove the splints. for(var/obj/item/organ/external/E in supporting_limbs) E.status &= ~ ORGAN_SPLINTED - user << "The suit stops supporting your [E.display_name]." + user << "The suit stops supporting your [E.name]." supporting_limbs = list() diff --git a/code/modules/hydroponics/seed.dm b/code/modules/hydroponics/seed.dm index 8809849adb..6734510a5b 100644 --- a/code/modules/hydroponics/seed.dm +++ b/code/modules/hydroponics/seed.dm @@ -116,13 +116,13 @@ if(get_trait(TRAIT_CARNIVOROUS)) if(get_trait(TRAIT_CARNIVOROUS) == 2) if(affecting) - target << "\The [fruit]'s thorns pierce your [affecting.display_name] greedily!" + target << "\The [fruit]'s thorns pierce your [affecting.name] greedily!" else target << "\The [fruit]'s thorns pierce your flesh greedily!" damage = get_trait(TRAIT_POTENCY)/2 else if(affecting) - target << "\The [fruit]'s thorns dig deeply into your [affecting.display_name]!" + target << "\The [fruit]'s thorns dig deeply into your [affecting.name]!" else target << "\The [fruit]'s thorns dig deeply into your flesh!" damage = get_trait(TRAIT_POTENCY)/5 diff --git a/code/modules/mob/living/carbon/brain/brain_item.dm b/code/modules/mob/living/carbon/brain/brain_item.dm index a240225846..d2aa61e635 100644 --- a/code/modules/mob/living/carbon/brain/brain_item.dm +++ b/code/modules/mob/living/carbon/brain/brain_item.dm @@ -44,19 +44,18 @@ else user << "This one seems particularly lifeless. Perhaps it will regain some of its luster later.." -/obj/item/organ/brain/removed(var/mob/living/target,var/mob/living/user) +/obj/item/organ/brain/removed(var/mob/living/user) ..() - var/mob/living/simple_animal/borer/borer = target.has_brain_worms() + var/mob/living/simple_animal/borer/borer = owner.has_brain_worms() if(borer) borer.detatch() //Should remove borer if the brain is removed - RR - var/mob/living/carbon/human/H = target var/obj/item/organ/brain/B = src - if(istype(B) && istype(H)) - B.transfer_identity(target) + if(istype(B) && istype(owner)) + B.transfer_identity(owner) /obj/item/organ/brain/replaced(var/mob/living/target) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 3f08ce3bc1..8a8c2f8454 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -66,7 +66,7 @@ if (H.hand) temp = H.organs_by_name["l_hand"] if(temp && !temp.is_usable()) - H << "\red You can't use your [temp.display_name]" + H << "\red You can't use your [temp.name]" return for(var/datum/disease/D in viruses) @@ -187,7 +187,7 @@ status = "weirdly shapen." if(status == "") status = "OK" - src.show_message(text("\t []My [] is [].",status=="OK"?"\blue ":"\red ",org.display_name,status),1) + src.show_message(text("\t []My [] is [].",status=="OK"?"\blue ":"\red ",org.name,status),1) if((SKELETON in H.mutations) && (!H.w_uniform) && (!H.wear_suit)) H.play_xylophone() else if (on_fire) diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index 3db0610781..7be42b5a51 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -6,12 +6,11 @@ I.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),30) for(var/obj/item/organ/external/E in src.organs) - if(istype(E, /obj/item/organ/external/chest)) + if(E.cannot_amputate) + E.removed() + del(E) continue - // Only make the limb drop if it's not too damaged - if(prob(100 - E.get_damage())) - // Override the current limb status and don't cause an explosion - E.droplimb(1,1) + E.droplimb() ..(species.gibbed_anim) gibs(loc, viruses, dna, null, species.flesh_color, species.blood_color) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index f7437565c7..fecda9cc0a 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -200,7 +200,7 @@ for(var/organ in list("l_leg","r_leg","l_arm","r_arm")) var/obj/item/organ/external/o = get_organ(organ) if(o && o.status & ORGAN_SPLINTED) - msg += "[t_He] [t_has] a splint on [t_his] [o.display_name]!\n" + msg += "[t_He] [t_has] a splint on [t_his] [o.name]!\n" if(suiciding) msg += "[t_He] appears to have commited suicide... there is no hope of recovery.\n" @@ -254,30 +254,30 @@ for(var/obj/item/organ/external/temp in organs) if(temp) if(temp.status & ORGAN_DESTROYED) - is_destroyed["[temp.display_name]"] = 1 - wound_flavor_text["[temp.display_name]"] = "[t_He] is missing [t_his] [temp.display_name].\n" + is_destroyed["[temp.name]"] = 1 + wound_flavor_text["[temp.name]"] = "[t_He] is missing [t_his] [temp.name].\n" continue if(temp.status & ORGAN_ROBOT) if(!(temp.brute_dam + temp.burn_dam)) if(!species.flags & IS_SYNTHETIC) - wound_flavor_text["[temp.display_name]"] = "[t_He] has a robot [temp.display_name]!\n" + wound_flavor_text["[temp.name]"] = "[t_He] has a robot [temp.name]!\n" continue else - wound_flavor_text["[temp.display_name]"] = "[t_He] has a robot [temp.display_name]. It has" + wound_flavor_text["[temp.name]"] = "[t_He] has a robot [temp.name]. It has" if(temp.brute_dam) switch(temp.brute_dam) if(0 to 20) - wound_flavor_text["[temp.display_name]"] += " some dents" + wound_flavor_text["[temp.name]"] += " some dents" if(21 to INFINITY) - wound_flavor_text["[temp.display_name]"] += pick(" a lot of dents"," severe denting") + wound_flavor_text["[temp.name]"] += pick(" a lot of dents"," severe denting") if(temp.brute_dam && temp.burn_dam) - wound_flavor_text["[temp.display_name]"] += " and" + wound_flavor_text["[temp.name]"] += " and" if(temp.burn_dam) switch(temp.burn_dam) if(0 to 20) - wound_flavor_text["[temp.display_name]"] += " some burns" + wound_flavor_text["[temp.name]"] += " some burns" if(21 to INFINITY) - wound_flavor_text["[temp.display_name]"] += pick(" a lot of burns"," severe melting") - if(wound_flavor_text["[temp.display_name]"]) - wound_flavor_text["[temp.display_name]"] += "!\n" + wound_flavor_text["[temp.name]"] += pick(" a lot of burns"," severe melting") + if(wound_flavor_text["[temp.name]"]) + wound_flavor_text["[temp.name]"] += "!\n" else if(temp.wounds.len > 0) var/list/wound_descriptors = list() for(var/datum/wound/W in temp.wounds) @@ -325,14 +325,14 @@ else if(flavor_text.len > 1 && text > 1) flavor_text_string += "," flavor_text_string += flavor_text[text] - flavor_text_string += " on [t_his] [temp.display_name].
" - wound_flavor_text["[temp.display_name]"] = flavor_text_string + flavor_text_string += " on [t_his] [temp.name].

" + wound_flavor_text["[temp.name]"] = flavor_text_string else - wound_flavor_text["[temp.display_name]"] = "" + wound_flavor_text["[temp.name]"] = "" if(temp.status & ORGAN_BLEEDING) - is_bleeding["[temp.display_name]"] = 1 + is_bleeding["[temp.name]"] = 1 else - wound_flavor_text["[temp.display_name]"] = "" + wound_flavor_text["[temp.name]"] = "" //Handles the text strings being added to the actual description. //If they have something that covers the limb, and it is not missing, put flavortext. If it is covered but bleeding, add other flavortext. diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 31670bcd0d..767d25c26b 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -938,8 +938,6 @@ O.status &= ~ORGAN_SPLINTED O.status &= ~ORGAN_CUT_AWAY O.status &= ~ORGAN_ATTACHABLE - if (!O.amputated) - O.status &= ~ORGAN_DESTROYED O.wounds.Cut() O.heal_damage(1000,1000,1,1) @@ -1060,11 +1058,11 @@ var/msg = null switch(rand(1,3)) if(1) - msg ="A spike of pain jolts your [organ.display_name] as you bump [O] inside." + msg ="A spike of pain jolts your [organ.name] as you bump [O] inside." if(2) - msg ="Your movement jostles [O] in your [organ.display_name] painfully." + msg ="Your movement jostles [O] in your [organ.name] painfully." if(3) - msg ="[O] in your [organ.display_name] twists painfully as you move." + msg ="[O] in your [organ.name] twists painfully as you move." src << msg organ.take_damage(rand(1,3), 0, 0) diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index 7fb1fc6058..cb2e1aec47 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -5,8 +5,8 @@ var/obj/item/organ/external/temp = H.organs_by_name["r_hand"] if(H.hand) temp = H.organs_by_name["l_hand"] - if(temp && !temp.is_usable()) - H << "\red You can't use your [temp.display_name]." + if(!temp || !temp.is_usable()) + H << "\red You can't use your hand." return ..() @@ -100,6 +100,10 @@ var/hit_zone = H.zone_sel.selecting var/obj/item/organ/external/affecting = get_organ(hit_zone) + if(!affecting || affecting.status & ORGAN_DESTROYED) + M << "They are missing that limb!" + return + switch(src.a_intent) if("help") // We didn't see this coming, so we get the full blow @@ -157,7 +161,7 @@ miss_type = 1 if(!miss_type && block) - attack_message = "[H] went for [src]'s [affecting.display_name] but was blocked!" + attack_message = "[H] went for [src]'s [affecting.name] but was blocked!" miss_type = 2 // See what attack they use diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index 41f6b0681f..4eaf4e4560 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -170,21 +170,21 @@ if (candidates.len) var/obj/item/organ/external/O = pick(candidates) O.mutate() - src << "Something is not right with your [O.display_name]..." + src << "Something is not right with your [O.name]..." return else if (prob(heal_prob)) for (var/obj/item/organ/external/O in organs) if (O.status & ORGAN_MUTATED) O.unmutate() - src << "Your [O.display_name] is shaped normally again." + src << "Your [O.name] is shaped normally again." return if (getCloneLoss() < 1) for (var/obj/item/organ/external/O in organs) if (O.status & ORGAN_MUTATED) O.unmutate() - src << "Your [O.display_name] is shaped normally again." + src << "Your [O.name] is shaped normally again." BITSET(hud_updateflag, HEALTH_HUD) // Defined here solely to take species flags into account without having to recast at mob/living level. diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 088a369c53..7f002de788 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -70,10 +70,10 @@ emp_act u_equip(c_hand) if (affected.status & ORGAN_ROBOT) - emote("me", 1, "drops what they were holding, their [affected.display_name] malfunctioning!") + emote("me", 1, "drops what they were holding, their [affected.name] malfunctioning!") else var/emote_scream = pick("screams in pain and ", "lets out a sharp cry and ", "cries out and ") - emote("me", 1, "[(species && species.flags & NO_PAIN) ? "" : emote_scream ]drops what they were holding in their [affected.display_name]!") + emote("me", 1, "[(species && species.flags & NO_PAIN) ? "" : emote_scream ]drops what they were holding in their [affected.name]!") ..(stun_amount, agony_amount, def_zone) @@ -189,12 +189,12 @@ emp_act return 0 var/obj/item/organ/external/affecting = get_organ(target_zone) - if (!affecting) - return 0 - if(affecting.status & ORGAN_DESTROYED) - user << "What [affecting.display_name]?" - return 0 - var/hit_area = affecting.display_name + + if (!affecting || affecting.status & ORGAN_DESTROYED || istype(affecting, /obj/item/organ/external/stump)) + user << "They are missing that limb!" + return + + var/hit_area = affecting.name if((user != src) && check_shields(I.force, "the [I.name]")) return 0 @@ -204,9 +204,9 @@ emp_act user << "\red That limb isn't robotic." return if(affecting.sabotaged) - user << "\red [src]'s [affecting.display_name] is already sabotaged!" + user << "\red [src]'s [affecting.name] is already sabotaged!" else - user << "\red You sneakily slide [I] into the dataport on [src]'s [affecting.display_name] and short out the safeties." + user << "\red You sneakily slide [I] into the dataport on [src]'s [affecting.name] and short out the safeties." var/obj/item/weapon/card/emag/emag = I emag.uses-- affecting.sabotaged = 1 @@ -328,7 +328,7 @@ emp_act return var/obj/item/organ/external/affecting = get_organ(zone) - var/hit_area = affecting.display_name + var/hit_area = affecting.name src.visible_message("\red [src] has been hit in the [hit_area] by [O].") var/armor = run_armor_check(affecting, "melee", "Your armor has protected your [hit_area].", "Your armor has softened hit to your [hit_area].") //I guess "melee" is the best fit here diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index 7f1b796bed..0255a23d37 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -41,7 +41,7 @@ //Moving around with fractured ribs won't do you any good if (E.is_broken() && E.internal_organs && prob(15)) var/obj/item/organ/I = pick(E.internal_organs) - custom_pain("You feel broken bones moving in your [E.display_name]!", 1) + custom_pain("You feel broken bones moving in your [E.name]!", 1) I.take_damage(rand(3,5)) //Moving makes open wounds get infected much faster diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index d53710d395..45fae61460 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -105,6 +105,20 @@ "eyes" = /obj/item/organ/eyes ) + var/list/has_limbs = list( + /obj/item/organ/external/chest, + /obj/item/organ/external/groin, + /obj/item/organ/external/head, + /obj/item/organ/external/arm, + /obj/item/organ/external/arm/right, + /obj/item/organ/external/leg, + /obj/item/organ/external/leg/right, + /obj/item/organ/external/hand, + /obj/item/organ/external/hand/right, + /obj/item/organ/external/foot, + /obj/item/organ/external/foot/right + ) + /datum/species/New() if(hud_type) hud = new hud_type() @@ -156,18 +170,8 @@ H.organs_by_name = list() H.internal_organs_by_name = list() - //This is a basic humanoid limb setup. - H.organs_by_name["chest"] = new/obj/item/organ/external/chest(H) - H.organs_by_name["groin"] = new/obj/item/organ/external/groin(H) - H.organs_by_name["head"] = new/obj/item/organ/external/head(H) - H.organs_by_name["l_arm"] = new/obj/item/organ/external/arm(H) - H.organs_by_name["r_arm"] = new/obj/item/organ/external/arm/right(H) - H.organs_by_name["r_leg"] = new/obj/item/organ/external/leg(H) - H.organs_by_name["l_leg"] = new/obj/item/organ/external/leg/right(H) - H.organs_by_name["l_hand"] = new/obj/item/organ/external/hand(H) - H.organs_by_name["r_hand"] = new/obj/item/organ/external/hand/right(H) - H.organs_by_name["l_foot"] = new/obj/item/organ/external/foot(H) - H.organs_by_name["r_foot"] = new/obj/item/organ/external/foot/right(H) + for(var/limb_type in has_limbs) + new limb_type(H) for(var/organ in has_organ) var/organ_type = has_organ[organ] diff --git a/code/modules/mob/living/carbon/human/species/species_attack.dm b/code/modules/mob/living/carbon/human/species/species_attack.dm index 76f87ea10c..c3312b9a7a 100644 --- a/code/modules/mob/living/carbon/human/species/species_attack.dm +++ b/code/modules/mob/living/carbon/human/species/species_attack.dm @@ -28,7 +28,7 @@ attack_damage = Clamp(attack_damage, 1, 5) if(target == user) - user.visible_message("[user] [pick(attack_verb)] \himself in the [affecting.display_name]!") + user.visible_message("[user] [pick(attack_verb)] \himself in the [affecting.name]!") return 0 switch(zone) @@ -47,9 +47,9 @@ else // ----- BODY ----- // switch(attack_damage) - if(1 to 2) user.visible_message("[user] scratched [target]'s [affecting.display_name]!") - if(3 to 4) user.visible_message("[user] [pick(attack_verb)] [pick("", "", "the side of")] [target]'s [affecting.display_name]!") - if(5) user.visible_message("[user] tears \his [pick(attack_noun)] [pick("deep into", "into", "across")] [target]'s [affecting.display_name]!") + if(1 to 2) user.visible_message("[user] scratched [target]'s [affecting.name]!") + if(3 to 4) user.visible_message("[user] [pick(attack_verb)] [pick("", "", "the side of")] [target]'s [affecting.name]!") + if(5) user.visible_message("[user] tears \his [pick(attack_noun)] [pick("deep into", "into", "across")] [target]'s [affecting.name]!") /datum/unarmed_attack/claws/strong attack_verb = list("slashed") diff --git a/code/modules/mob/living/carbon/human/species/xenomorphs/alien_species.dm b/code/modules/mob/living/carbon/human/species/xenomorphs/alien_species.dm index 94987c005c..b55ea779fe 100644 --- a/code/modules/mob/living/carbon/human/species/xenomorphs/alien_species.dm +++ b/code/modules/mob/living/carbon/human/species/xenomorphs/alien_species.dm @@ -124,7 +124,7 @@ if (E.status & ORGAN_BROKEN) if (prob(mend_prob)) if (E.mend_fracture()) - H << "You feel something mend itself inside your [E.display_name]." + H << "You feel something mend itself inside your [E.name]." return 1 return 0 diff --git a/code/modules/mob/living/carbon/human/unarmed_attack.dm b/code/modules/mob/living/carbon/human/unarmed_attack.dm index 4ae6b2f1a6..148baf6618 100644 --- a/code/modules/mob/living/carbon/human/unarmed_attack.dm +++ b/code/modules/mob/living/carbon/human/unarmed_attack.dm @@ -75,7 +75,7 @@ /datum/unarmed_attack/proc/show_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage) var/obj/item/organ/external/affecting = target.get_organ(zone) - user.visible_message("[user] [pick(attack_verb)] [target] in the [affecting.display_name]!") + user.visible_message("[user] [pick(attack_verb)] [target] in the [affecting.name]!") playsound(user.loc, attack_sound, 25, 1, -1) /datum/unarmed_attack/bite @@ -101,7 +101,7 @@ /datum/unarmed_attack/punch/show_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage) var/obj/item/organ/external/affecting = target.get_organ(zone) - var/organ = affecting.display_name + var/organ = affecting.name attack_damage = Clamp(attack_damage, 1, 5) // We expect damage input of 1 to 5 for this proc. But we leave this check juuust in case. @@ -172,7 +172,7 @@ /datum/unarmed_attack/kick/show_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage) var/obj/item/organ/external/affecting = target.get_organ(zone) - var/organ = affecting.display_name + var/organ = affecting.name attack_damage = Clamp(attack_damage, 1, 5) @@ -214,7 +214,7 @@ /datum/unarmed_attack/stomp/show_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage) var/obj/item/organ/external/affecting = target.get_organ(zone) - var/organ = affecting.display_name + var/organ = affecting.name var/obj/item/clothing/shoes = user.shoes attack_damage = Clamp(attack_damage, 1, 5) diff --git a/code/modules/mob/living/carbon/shock.dm b/code/modules/mob/living/carbon/shock.dm index d9b926be64..e0115d81ba 100644 --- a/code/modules/mob/living/carbon/shock.dm +++ b/code/modules/mob/living/carbon/shock.dm @@ -38,7 +38,7 @@ for(var/obj/item/organ/external/organ in M.organs) if (!organ) continue - if((organ.status & ORGAN_DESTROYED) && !organ.amputated) + if(istype(organ, /obj/item/organ/external/stump)) src.traumatic_shock += 60 else if(organ.status & ORGAN_BROKEN || organ.open) src.traumatic_shock += 30 diff --git a/code/modules/mob/living/silicon/robot/analyzer.dm b/code/modules/mob/living/silicon/robot/analyzer.dm index 7aabd28977..cb86e52302 100644 --- a/code/modules/mob/living/silicon/robot/analyzer.dm +++ b/code/modules/mob/living/silicon/robot/analyzer.dm @@ -67,7 +67,7 @@ if(length(damaged)>0) for(var/obj/item/organ/external/org in damaged) user.show_message(text("\blue \t []: [] - []", \ - capitalize(org.display_name), \ + capitalize(org.name), \ (org.brute_dam > 0) ? "\red [org.brute_dam]" :0, \ (org.burn_dam > 0) ? "[org.burn_dam]" :0),1) else diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index 9562fcb41d..206b030a03 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -179,7 +179,7 @@ var/list/organ_cache = list() var/obj/item/organ/external/parent = owner.get_organ(parent_organ) if (!silent) - owner.custom_pain("Something inside your [parent.display_name] hurts a lot.", 1) + 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 @@ -244,10 +244,11 @@ var/list/organ_cache = list() if(!organ_blood || !organ_blood.data["blood_DNA"]) owner.vessel.trans_to(src, 5, 1, 1) - if(owner && user && vital) - user.attack_log += "\[[time_stamp()]\] removed a vital organ ([src]) from [owner.name] ([owner.ckey]) (INTENT: [uppertext(user.a_intent)])" - owner.attack_log += "\[[time_stamp()]\] had a vital organ ([src]) removed by [user.name] ([user.ckey]) (INTENT: [uppertext(user.a_intent)])" - msg_admin_attack("[user.name] ([user.ckey]) removed a vital organ ([src]) from [owner.name] ([owner.ckey]) (INTENT: [uppertext(user.a_intent)]) (JMP)") + if(owner && vital) + if(user) + user.attack_log += "\[[time_stamp()]\] removed a vital organ ([src]) from [owner.name] ([owner.ckey]) (INTENT: [uppertext(user.a_intent)])" + owner.attack_log += "\[[time_stamp()]\] had a vital organ ([src]) removed by [user.name] ([user.ckey]) (INTENT: [uppertext(user.a_intent)])" + msg_admin_attack("[user.name] ([user.ckey]) removed a vital organ ([src]) from [owner.name] ([owner.ckey]) (INTENT: [uppertext(user.a_intent)]) (JMP)") owner.death() /obj/item/organ/proc/replaced(var/mob/living/carbon/human/target,var/obj/item/organ/external/affected) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index e5ba05eef2..e7d5b0b5e7 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -13,16 +13,16 @@ var/max_size = 0 var/last_dam = -1 var/icon/mob_icon + var/icon/item_icon var/gendered_icon = 0 var/limb_name var/disfigured = 1 + var/cannot_amputate - var/display_name var/list/wounds = list() var/number_wounds = 0 // cache the number of wounds, which is NOT wounds.len! - var/tmp/perma_injury = 0 - var/tmp/amputated = 0 //Whether this has been cleanly amputated, thus causing no pain + var/perma_injury = 0 var/obj/item/organ/external/parent var/list/obj/item/organ/external/children @@ -110,13 +110,16 @@ /obj/item/organ/external/New(var/mob/living/carbon/holder, var/internal) ..() - if(owner && parent_organ && istype(owner, /mob/living/carbon/human)) + if(owner) var/mob/living/carbon/human/H = owner - var/obj/item/organ/external/parent = H.organs_by_name[src.parent_organ] - if(parent) - if(!parent.children) - parent.children = list() - parent.children.Add(src) + if(istype(H)) + H.organs_by_name[limb_name] = src + if(parent_organ) + parent = H.organs_by_name[src.parent_organ] + if(parent) + if(!parent.children) + parent.children = list() + parent.children.Add(src) /**************************************************** DAMAGE PROCS @@ -143,11 +146,12 @@ burn *= bumod //~2/3 damage for ROBOLIMBS // High brute damage or sharp objects may damage internal organs - if(internal_organs && ( (sharp && brute >= 5) || brute >= 10) && prob(5)) + if(internal_organs && ((brute_dam >= max_damage) || (sharp && brute >= 5) || brute >= 10) && prob(5)) // Damage an internal organ - var/obj/item/organ/I = pick(internal_organs) - I.take_damage(brute / 2) - brute -= brute / 2 + if(internal_organs && internal_organs.len) + var/obj/item/organ/I = pick(internal_organs) + I.take_damage(brute / 2) + brute -= brute / 2 if(status & ORGAN_BROKEN && prob(40) && brute) if (!(owner.species && (owner.species.flags & NO_PAIN))) @@ -190,29 +194,18 @@ //If there are still hurties to dispense if (burn || brute) if (status & ORGAN_ROBOT) - droplimb(1) //Robot limbs just kinda fail at full damage. + droplimb() //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) - possible_points += children - 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) + owner.shock_stage += brute+burn // sync the organ's damage with its wounds src.update_damages() //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(body_part != UPPER_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(brute)) ) - droplimb(1) + droplimb() return owner.updatehealth() @@ -284,7 +277,7 @@ This function completely restores a damaged organ to perfect condition. if(damage > 15 && type != BURN && local_damage > 30 && prob(damage) && !(status & ORGAN_ROBOT)) var/datum/wound/internal_bleeding/I = new (min(damage - 15, 15)) wounds += I - owner.custom_pain("You feel something rip in your [display_name]!", 1) + 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))) @@ -300,8 +293,8 @@ This function completely restores a damaged organ to perfect condition. W.open_wound(damage) if(prob(25)) //maybe have a separate message for BRUISE type damage? - owner.visible_message("\red The wound on [owner.name]'s [display_name] widens with a nasty ripping noise.",\ - "\red The wound on your [display_name] widens with a nasty ripping noise.",\ + owner.visible_message("\red The wound on [owner.name]'s [name] widens with a nasty ripping noise.",\ + "\red The wound on your [name] widens with a nasty ripping noise.",\ "You hear a nasty ripping noise, as if flesh is being torn apart.") return @@ -467,7 +460,7 @@ Note that amputating the affected organ does in fact remove the infection from t if(germ_level >= INFECTION_LEVEL_THREE && antibiotics < 30) //overdosing is necessary to stop severe infections if (!(status & ORGAN_DEAD)) status |= ORGAN_DEAD - owner << "You can't feel your [display_name] anymore..." + owner << "You can't feel your [name] anymore..." owner.update_body(1) germ_level++ @@ -497,7 +490,7 @@ Note that amputating the affected organ does in fact remove the infection from t owner.vessel.remove_reagent("blood", wound_update_accuracy * W.damage/40) //line should possibly be moved to handle_blood, so all the bleeding stuff is in one place. if(prob(1 * wound_update_accuracy)) - owner.custom_pain("You feel a stabbing pain in your [display_name]!",1) + owner.custom_pain("You feel a stabbing pain in your [name]!",1) // slow healing var/heal_amt = 0 @@ -598,35 +591,25 @@ Note that amputating the affected organ does in fact remove the infection from t DISMEMBERMENT ****************************************************/ -//Recursive setting of all child organs to amputated -/obj/item/organ/external/proc/setAmputatedTree() - for(var/obj/item/organ/external/O in children) - O.amputated=amputated - O.setAmputatedTree() - //Handles dismemberment -/obj/item/organ/external/proc/droplimb(var/override = 0,var/no_explode = 0,var/amputation=0) +/obj/item/organ/external/proc/droplimb(var/clean) - if(status & ORGAN_DESTROYED) - if(body_part == UPPER_TORSO) - return + if(cannot_amputate) + return - //if(clean) //todo + if(!clean) + owner.visible_message( + "\The [owner]'s [src.name] flies off in an arc!",\ + "Your [src.name] goes flying off!",\ + "You hear a terrible sound of ripping tendons and flesh.") - owner.visible_message( - "\The [owner]'s [src.name] flies off in an arc!",\ - "Your [src.name] goes flying off!",\ - "You hear a terrible sound of ripping tendons and flesh.") - - if(parent) - parent.children -= src src.removed() if(parent) - spawn(1) - parent.take_damage(20,0,50,0) // Leave a bloody stump to remember us by. - parent.update_health() - parent = null + parent.children -= src + if(!clean) + new /obj/item/organ/external/stump(owner, 0, src) + parent = null update_health() owner.update_body() @@ -638,16 +621,18 @@ Note that amputating the affected organ does in fact remove the infection from t M.Turn(rand(180)) src.transform = M - // Throw limb around. - if(src && istype(loc,/turf)) - throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),30) + if(!clean) + // Throw limb around. + if(src && istype(loc,/turf)) + throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),30) /**************************************************** HELPERS ****************************************************/ -/obj/item/organ/replaced() +/obj/item/organ/external/replaced() get_icon() + icon = mob_icon return ..() /obj/item/organ/external/proc/release_restraints() @@ -706,7 +691,7 @@ Note that amputating the affected organ does in fact remove the infection from t owner.visible_message(\ "\red You hear a loud cracking sound coming from \the [owner].",\ - "\red Something feels like it shattered in your [display_name]!",\ + "\red Something feels like it shattered in your [name]!",\ "You hear a sickening crack.") if(owner.species && !(owner.species.flags & NO_PAIN)) @@ -734,7 +719,7 @@ Note that amputating the affected organ does in fact remove the infection from t if(isnull(suit.supporting_limbs)) return - owner << "You feel \the [suit] constrict about your [display_name], supporting it." + owner << "You feel \the [suit] constrict about your [name], supporting it." status |= ORGAN_SPLINTED suit.supporting_limbs |= src return @@ -816,15 +801,15 @@ Note that amputating the affected organ does in fact remove the infection from t status |= ORGAN_DESTROYED owner.bad_external_organs -= src + icon = item_icon + for(var/implant in implants) //todo: check if this can be left alone del(implant) - wounds.Cut() //todo: wound on the parent organ - // Attached organs also fly off. for(var/obj/item/organ/external/O in children) O.removed() - O.loc = src //TODO: generate entire limb icons from contents. + O.loc = src // Grab all the internal giblets too. for(var/obj/item/organ/organ in internal_organs) @@ -867,6 +852,7 @@ Note that amputating the affected organ does in fact remove the infection from t joint = "neck" dislocated = -1 gendered_icon = 1 + cannot_amputate = 1 /obj/item/organ/external/groin name = "lower body" diff --git a/code/modules/organs/organ_icon.dm b/code/modules/organs/organ_icon.dm index f25d497739..7fbdf3bf1d 100644 --- a/code/modules/organs/organ_icon.dm +++ b/code/modules/organs/organ_icon.dm @@ -56,7 +56,9 @@ var/global/list/limb_icon_cache = list() mob_icon.Blend(rgb(owner.r_skin, owner.g_skin, owner.b_skin), ICON_ADD) dir = EAST + item_icon = icon(mob_icon,icon_state,SOUTH) icon = mob_icon + return mob_icon /obj/item/organ/external/head/get_icon(var/skeletal) diff --git a/code/modules/organs/organ_internal.dm b/code/modules/organs/organ_internal.dm index 62eace6392..c552631abf 100644 --- a/code/modules/organs/organ_internal.dm +++ b/code/modules/organs/organ_internal.dm @@ -176,15 +176,15 @@ icon_state = "appendix" parent_organ = "groin" -/obj/item/organ/appendix/removed(var/mob/living/target,var/mob/living/user) +/obj/item/organ/appendix/removed() ..() var/inflamed = 0 - for(var/datum/disease/appendicitis/appendicitis in target.viruses) + for(var/datum/disease/appendicitis/appendicitis in owner.viruses) inflamed = 1 appendicitis.cure() - target.resistances += appendicitis + owner.resistances += appendicitis if(inflamed) icon_state = "appendixinflamed" diff --git a/code/modules/organs/organ_stump.dm b/code/modules/organs/organ_stump.dm new file mode 100644 index 0000000000..1a673b84e5 --- /dev/null +++ b/code/modules/organs/organ_stump.dm @@ -0,0 +1,35 @@ +/obj/item/organ/external/stump + name = "limb stump" + icon_name = "" + dislocated = -1 + cannot_amputate = 1 + +/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 + joint = limb.joint + parent_organ = limb.parent_organ + wounds = limb.wounds + ..(holder, internal) + if(istype(limb)) + max_damage = limb.max_damage + +/obj/item/organ/external/stump/process() + damage = max_damage + +/obj/item/organ/external/stump/handle_rejection() + return + +/obj/item/organ/external/stump/rejuvenate() + return + +/obj/item/organ/external/stump/is_damaged() + return 1 + +/obj/item/organ/external/stump/is_bruised() + return 1 + +/obj/item/organ/external/stump/is_broken() + return 1 diff --git a/code/modules/organs/pain.dm b/code/modules/organs/pain.dm index c1521650af..e500125a2c 100644 --- a/code/modules/organs/pain.dm +++ b/code/modules/organs/pain.dm @@ -90,7 +90,6 @@ mob/living/carbon/human/proc/handle_pain() var/obj/item/organ/external/damaged_organ = null for(var/obj/item/organ/external/E in organs) // amputated limbs don't cause pain - if(E.amputated) continue if(E.status & ORGAN_DEAD) continue var/dam = E.get_damage() // make the choice of the organ depend on damage, @@ -99,13 +98,13 @@ mob/living/carbon/human/proc/handle_pain() damaged_organ = E maxdam = dam if(damaged_organ) - pain(damaged_organ.display_name, maxdam, 0) + pain(damaged_organ.name, maxdam, 0) // Damage to internal organs hurts a lot. for(var/obj/item/organ/I in internal_organs) 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.display_name]", 1) + src.custom_pain("You feel a sharp pain in your [parent.name]", 1) var/toxDamageMessage = null var/toxMessageProb = 1 diff --git a/code/modules/paperwork/paperbin.dm b/code/modules/paperwork/paperbin.dm index 7a89f12508..a2219b262a 100644 --- a/code/modules/paperwork/paperbin.dm +++ b/code/modules/paperwork/paperbin.dm @@ -28,7 +28,7 @@ if (H.hand) temp = H.organs_by_name["l_hand"] if(temp && !temp.is_usable()) - user << "You try to move your [temp.display_name], but cannot!" + user << "You try to move your [temp.name], but cannot!" return var/response = "" if(!papers.len > 0) diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 175dc4f1e6..f652ebe9ec 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -527,7 +527,7 @@ obj/structure/cable/proc/cableColor(var/colorC) if(S.burn_dam > 0 && use(1)) S.heal_damage(0,15,0,1) - user.visible_message("\red \The [user] repairs some burn damage on \the [M]'s [S.display_name] with \the [src].") + user.visible_message("\red \The [user] repairs some burn damage on \the [M]'s [S.name] with \the [src].") return else user << "Nothing to fix!" diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index e802cdeffb..2e68c80d98 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -237,12 +237,11 @@ var/target_zone = ran_zone(check_zone(user.zone_sel.selecting, target)) var/obj/item/organ/external/affecting = target:get_organ(target_zone) - if (!affecting) + if (!affecting || affecting.status & ORGAN_DESTROYED || istype(affecting, /obj/item/organ/external/stump)) + user << "They are missing that limb!" return - if(affecting.status & ORGAN_DESTROYED) - user << "What [affecting.display_name]?" - return - var/hit_area = affecting.display_name + + var/hit_area = affecting.name var/mob/living/carbon/human/H = target if((user != target) && H.check_shields(7, "the [src.name]")) diff --git a/code/modules/surgery/bones.dm b/code/modules/surgery/bones.dm index d48c39a80a..cb7af6267b 100644 --- a/code/modules/surgery/bones.dm +++ b/code/modules/surgery/bones.dm @@ -23,21 +23,21 @@ begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) if (affected.stage == 0) - user.visible_message("[user] starts applying medication to the damaged bones in [target]'s [affected.display_name] with \the [tool]." , \ - "You start applying medication to the damaged bones in [target]'s [affected.display_name] with \the [tool].") - target.custom_pain("Something in your [affected.display_name] is causing you a lot of pain!",1) + user.visible_message("[user] starts applying medication to the damaged bones in [target]'s [affected.name] with \the [tool]." , \ + "You start applying medication to the damaged bones in [target]'s [affected.name] with \the [tool].") + target.custom_pain("Something in your [affected.name] is causing you a lot of pain!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\blue [user] applies some [tool] to [target]'s bone in [affected.display_name]", \ - "\blue You apply some [tool] to [target]'s bone in [affected.display_name] with \the [tool].") + user.visible_message("\blue [user] applies some [tool] to [target]'s bone in [affected.name]", \ + "\blue You apply some [tool] to [target]'s bone in [affected.name] with \the [tool].") affected.stage = 1 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\red [user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.display_name]!" , \ - "\red Your hand slips, smearing [tool] in the incision in [target]'s [affected.display_name]!") + user.visible_message("\red [user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.name]!" , \ + "\red Your hand slips, smearing [tool] in the incision in [target]'s [affected.name]!") /datum/surgery_step/set_bone allowed_tools = list( @@ -56,26 +56,26 @@ begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("[user] is beginning to set the bone in [target]'s [affected.display_name] in place with \the [tool]." , \ - "You are beginning to set the bone in [target]'s [affected.display_name] in place with \the [tool].") - target.custom_pain("The pain in your [affected.display_name] is going to make you pass out!",1) + user.visible_message("[user] is beginning to set the bone in [target]'s [affected.name] in place with \the [tool]." , \ + "You are beginning to set the bone in [target]'s [affected.name] in place with \the [tool].") + target.custom_pain("The pain in your [affected.name] is going to make you pass out!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) if (affected.status & ORGAN_BROKEN) - user.visible_message("\blue [user] sets the bone in [target]'s [affected.display_name] in place with \the [tool].", \ - "\blue You set the bone in [target]'s [affected.display_name] in place with \the [tool].") + user.visible_message("\blue [user] sets the bone in [target]'s [affected.name] in place with \the [tool].", \ + "\blue You set the bone in [target]'s [affected.name] in place with \the [tool].") affected.stage = 2 else - user.visible_message("\blue [user] sets the bone in [target]'s [affected.display_name]\red in the WRONG place with \the [tool].", \ - "\blue You set the bone in [target]'s [affected.display_name]\red in the WRONG place with \the [tool].") + user.visible_message("\blue [user] sets the bone in [target]'s [affected.name]\red in the WRONG place with \the [tool].", \ + "\blue You set the bone in [target]'s [affected.name]\red in the WRONG place with \the [tool].") affected.fracture() fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\red [user]'s hand slips, damaging the bone in [target]'s [affected.display_name] with \the [tool]!" , \ - "\red Your hand slips, damaging the bone in [target]'s [affected.display_name] with \the [tool]!") + user.visible_message("\red [user]'s hand slips, damaging the bone in [target]'s [affected.name] with \the [tool]!" , \ + "\red Your hand slips, damaging the bone in [target]'s [affected.name] with \the [tool]!") affected.createwound(BRUISE, 5) /datum/surgery_step/mend_skull @@ -131,14 +131,14 @@ begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("[user] starts to finish mending the damaged bones in [target]'s [affected.display_name] with \the [tool].", \ - "You start to finish mending the damaged bones in [target]'s [affected.display_name] with \the [tool].") + user.visible_message("[user] starts to finish mending the damaged bones in [target]'s [affected.name] with \the [tool].", \ + "You start to finish mending the damaged bones in [target]'s [affected.name] with \the [tool].") ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\blue [user] has mended the damaged bones in [target]'s [affected.display_name] with \the [tool]." , \ - "\blue You have mended the damaged bones in [target]'s [affected.display_name] with \the [tool]." ) + user.visible_message("\blue [user] has mended the damaged bones in [target]'s [affected.name] with \the [tool]." , \ + "\blue You have mended the damaged bones in [target]'s [affected.name] with \the [tool]." ) affected.status &= ~ORGAN_BROKEN affected.status &= ~ORGAN_SPLINTED affected.stage = 0 @@ -146,5 +146,5 @@ fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\red [user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.display_name]!" , \ - "\red Your hand slips, smearing [tool] in the incision in [target]'s [affected.display_name]!") \ No newline at end of file + user.visible_message("\red [user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.name]!" , \ + "\red Your hand slips, smearing [tool] in the incision in [target]'s [affected.name]!") \ No newline at end of file diff --git a/code/modules/surgery/encased.dm b/code/modules/surgery/encased.dm index 288d756aa6..1d5597a7c3 100644 --- a/code/modules/surgery/encased.dm +++ b/code/modules/surgery/encased.dm @@ -38,7 +38,7 @@ user.visible_message("[user] begins to cut through [target]'s [affected.encased] with \the [tool].", \ "You begin to cut through [target]'s [affected.encased] with \the [tool].") - target.custom_pain("Something hurts horribly in your [affected.display_name]!",1) + target.custom_pain("Something hurts horribly in your [affected.name]!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -85,10 +85,10 @@ return var/obj/item/organ/external/affected = target.get_organ(target_zone) - var/msg = "[user] starts to force open the [affected.encased] in [target]'s [affected.display_name] with \the [tool]." - var/self_msg = "You start to force open the [affected.encased] in [target]'s [affected.display_name] with \the [tool]." + var/msg = "[user] starts to force open the [affected.encased] in [target]'s [affected.name] with \the [tool]." + var/self_msg = "You start to force open the [affected.encased] in [target]'s [affected.name] with \the [tool]." user.visible_message(msg, self_msg) - target.custom_pain("Something hurts horribly in your [affected.display_name]!",1) + target.custom_pain("Something hurts horribly in your [affected.name]!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -145,7 +145,7 @@ var/msg = "[user] starts bending [target]'s [affected.encased] back into place with \the [tool]." var/self_msg = "You start bending [target]'s [affected.encased] back into place with \the [tool]." user.visible_message(msg, self_msg) - target.custom_pain("Something hurts horribly in your [affected.display_name]!",1) + target.custom_pain("Something hurts horribly in your [affected.name]!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -202,7 +202,7 @@ var/msg = "[user] starts applying \the [tool] to [target]'s [affected.encased]." var/self_msg = "You start applying \the [tool] to [target]'s [affected.encased]." user.visible_message(msg, self_msg) - target.custom_pain("Something hurts horribly in your [affected.display_name]!",1) + target.custom_pain("Something hurts horribly in your [affected.name]!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) diff --git a/code/modules/surgery/generic.dm b/code/modules/surgery/generic.dm index 0586fbc505..d8057fa26b 100644 --- a/code/modules/surgery/generic.dm +++ b/code/modules/surgery/generic.dm @@ -41,15 +41,15 @@ begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("[user] starts the bloodless incision on [target]'s [affected.display_name] with \the [tool].", \ - "You start the bloodless incision on [target]'s [affected.display_name] with \the [tool].") - target.custom_pain("You feel a horrible, searing pain in your [affected.display_name]!",1) + user.visible_message("[user] starts the bloodless incision on [target]'s [affected.name] with \the [tool].", \ + "You start the bloodless incision on [target]'s [affected.name] with \the [tool].") + target.custom_pain("You feel a horrible, searing pain in your [affected.name]!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\blue [user] has made a bloodless incision on [target]'s [affected.display_name] with \the [tool].", \ - "\blue You have made a bloodless incision on [target]'s [affected.display_name] with \the [tool].",) + user.visible_message("\blue [user] has made a bloodless incision on [target]'s [affected.name] with \the [tool].", \ + "\blue You have made a bloodless incision on [target]'s [affected.name] with \the [tool].",) //Could be cleaner ... affected.open = 1 @@ -62,8 +62,8 @@ fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\red [user]'s hand slips as the blade sputters, searing a long gash in [target]'s [affected.display_name] with \the [tool]!", \ - "\red Your hand slips as the blade sputters, searing a long gash in [target]'s [affected.display_name] with \the [tool]!") + user.visible_message("\red [user]'s hand slips as the blade sputters, searing a long gash in [target]'s [affected.name] with \the [tool]!", \ + "\red Your hand slips as the blade sputters, searing a long gash in [target]'s [affected.name] with \the [tool]!") affected.createwound(CUT, 7.5) affected.createwound(BURN, 12.5) @@ -82,15 +82,15 @@ begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("[user] starts to construct a prepared incision on and within [target]'s [affected.display_name] with \the [tool].", \ - "You start to construct a prepared incision on and within [target]'s [affected.display_name] with \the [tool].") - target.custom_pain("You feel a horrible, searing pain in your [affected.display_name] as it is pushed apart!",1) + user.visible_message("[user] starts to construct a prepared incision on and within [target]'s [affected.name] with \the [tool].", \ + "You start to construct a prepared incision on and within [target]'s [affected.name] with \the [tool].") + target.custom_pain("You feel a horrible, searing pain in your [affected.name] as it is pushed apart!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\blue [user] has constructed a prepared incision on and within [target]'s [affected.display_name] with \the [tool].", \ - "\blue You have constructed a prepared incision on and within [target]'s [affected.display_name] with \the [tool].",) + user.visible_message("\blue [user] has constructed a prepared incision on and within [target]'s [affected.name] with \the [tool].", \ + "\blue You have constructed a prepared incision on and within [target]'s [affected.name] with \the [tool].",) affected.open = 1 if(istype(target) && !(target.species.flags & NO_BLOOD)) @@ -102,8 +102,8 @@ fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\red [user]'s hand jolts as the system sparks, ripping a gruesome hole in [target]'s [affected.display_name] with \the [tool]!", \ - "\red Your hand jolts as the system sparks, ripping a gruesome hole in [target]'s [affected.display_name] with \the [tool]!") + user.visible_message("\red [user]'s hand jolts as the system sparks, ripping a gruesome hole in [target]'s [affected.name] with \the [tool]!", \ + "\red Your hand jolts as the system sparks, ripping a gruesome hole in [target]'s [affected.name] with \the [tool]!") affected.createwound(CUT, 20) affected.createwound(BURN, 15) @@ -124,15 +124,15 @@ begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("[user] starts the incision on [target]'s [affected.display_name] with \the [tool].", \ - "You start the incision on [target]'s [affected.display_name] with \the [tool].") - target.custom_pain("You feel a horrible pain as if from a sharp knife in your [affected.display_name]!",1) + user.visible_message("[user] starts the incision on [target]'s [affected.name] with \the [tool].", \ + "You start the incision on [target]'s [affected.name] with \the [tool].") + target.custom_pain("You feel a horrible pain as if from a sharp knife in your [affected.name]!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\blue [user] has made an incision on [target]'s [affected.display_name] with \the [tool].", \ - "\blue You have made an incision on [target]'s [affected.display_name] with \the [tool].",) + user.visible_message("\blue [user] has made an incision on [target]'s [affected.name] with \the [tool].", \ + "\blue You have made an incision on [target]'s [affected.name] with \the [tool].",) affected.open = 1 if(istype(target) && !(target.species.flags & NO_BLOOD)) @@ -142,8 +142,8 @@ fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\red [user]'s hand slips, slicing open [target]'s [affected.display_name] in the wrong place with \the [tool]!", \ - "\red Your hand slips, slicing open [target]'s [affected.display_name] in the wrong place with \the [tool]!") + user.visible_message("\red [user]'s hand slips, slicing open [target]'s [affected.name] in the wrong place with \the [tool]!", \ + "\red Your hand slips, slicing open [target]'s [affected.name] in the wrong place with \the [tool]!") affected.createwound(CUT, 10) /datum/surgery_step/generic/clamp_bleeders @@ -163,22 +163,22 @@ begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("[user] starts clamping bleeders in [target]'s [affected.display_name] with \the [tool].", \ - "You start clamping bleeders in [target]'s [affected.display_name] with \the [tool].") - target.custom_pain("The pain in your [affected.display_name] is maddening!",1) + user.visible_message("[user] starts clamping bleeders in [target]'s [affected.name] with \the [tool].", \ + "You start clamping bleeders in [target]'s [affected.name] with \the [tool].") + target.custom_pain("The pain in your [affected.name] is maddening!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\blue [user] clamps bleeders in [target]'s [affected.display_name] with \the [tool].", \ - "\blue You clamp bleeders in [target]'s [affected.display_name] with \the [tool].") + user.visible_message("\blue [user] clamps bleeders in [target]'s [affected.name] with \the [tool].", \ + "\blue You clamp bleeders in [target]'s [affected.name] with \the [tool].") affected.clamp() spread_germs_to_organ(affected, user) fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\red [user]'s hand slips, tearing blood vessals and causing massive bleeding in [target]'s [affected.display_name] with \the [tool]!", \ - "\red Your hand slips, tearing blood vessels and causing massive bleeding in [target]'s [affected.display_name] with \the [tool]!",) + user.visible_message("\red [user]'s hand slips, tearing blood vessals and causing massive bleeding in [target]'s [affected.name] with \the [tool]!", \ + "\red Your hand slips, tearing blood vessels and causing massive bleeding in [target]'s [affected.name] with \the [tool]!",) affected.createwound(CUT, 10) /datum/surgery_step/generic/retract_skin @@ -198,8 +198,8 @@ begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - var/msg = "[user] starts to pry open the incision on [target]'s [affected.display_name] with \the [tool]." - var/self_msg = "You start to pry open the incision on [target]'s [affected.display_name] with \the [tool]." + var/msg = "[user] starts to pry open the incision on [target]'s [affected.name] with \the [tool]." + var/self_msg = "You start to pry open the incision on [target]'s [affected.name] with \the [tool]." if (target_zone == "chest") msg = "[user] starts to separate the ribcage and rearrange the organs in [target]'s torso with \the [tool]." self_msg = "You start to separate the ribcage and rearrange the organs in [target]'s torso with \the [tool]." @@ -207,13 +207,13 @@ msg = "[user] starts to pry open the incision and rearrange the organs in [target]'s lower abdomen with \the [tool]." self_msg = "You start to pry open the incision and rearrange the organs in [target]'s lower abdomen with \the [tool]." user.visible_message(msg, self_msg) - target.custom_pain("It feels like the skin on your [affected.display_name] is on fire!",1) + target.custom_pain("It feels like the skin on your [affected.name] is on fire!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - var/msg = "\blue [user] keeps the incision open on [target]'s [affected.display_name] with \the [tool]." - var/self_msg = "\blue You keep the incision open on [target]'s [affected.display_name] with \the [tool]." + var/msg = "\blue [user] keeps the incision open on [target]'s [affected.name] with \the [tool]." + var/self_msg = "\blue You keep the incision open on [target]'s [affected.name] with \the [tool]." if (target_zone == "chest") msg = "\blue [user] keeps the ribcage open on [target]'s torso with \the [tool]." self_msg = "\blue You keep the ribcage open on [target]'s torso with \the [tool]." @@ -225,8 +225,8 @@ fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - var/msg = "\red [user]'s hand slips, tearing the edges of the incision on [target]'s [affected.display_name] with \the [tool]!" - var/self_msg = "\red Your hand slips, tearing the edges of the incision on [target]'s [affected.display_name] with \the [tool]!" + var/msg = "\red [user]'s hand slips, tearing the edges of the incision on [target]'s [affected.name] with \the [tool]!" + var/self_msg = "\red Your hand slips, tearing the edges of the incision on [target]'s [affected.name] with \the [tool]!" if (target_zone == "chest") msg = "\red [user]'s hand slips, damaging several organs in [target]'s torso with \the [tool]!" self_msg = "\red Your hand slips, damaging several organs in [target]'s torso with \the [tool]!" @@ -254,23 +254,23 @@ begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("[user] is beginning to cauterize the incision on [target]'s [affected.display_name] with \the [tool]." , \ - "You are beginning to cauterize the incision on [target]'s [affected.display_name] with \the [tool].") - target.custom_pain("Your [affected.display_name] is being burned!",1) + user.visible_message("[user] is beginning to cauterize the incision on [target]'s [affected.name] with \the [tool]." , \ + "You are beginning to cauterize the incision on [target]'s [affected.name] with \the [tool].") + target.custom_pain("Your [affected.name] is being burned!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\blue [user] cauterizes the incision on [target]'s [affected.display_name] with \the [tool].", \ - "\blue You cauterize the incision on [target]'s [affected.display_name] with \the [tool].") + user.visible_message("\blue [user] cauterizes the incision on [target]'s [affected.name] with \the [tool].", \ + "\blue You cauterize the incision on [target]'s [affected.name] with \the [tool].") affected.open = 0 affected.germ_level = 0 affected.status &= ~ORGAN_BLEEDING fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\red [user]'s hand slips, leaving a small burn on [target]'s [affected.display_name] with \the [tool]!", \ - "\red Your hand slips, leaving a small burn on [target]'s [affected.display_name] with \the [tool]!") + user.visible_message("\red [user]'s hand slips, leaving a small burn on [target]'s [affected.name] with \the [tool]!", \ + "\red Your hand slips, leaving a small burn on [target]'s [affected.name] with \the [tool]!") target.apply_damage(3, BURN, affected) /datum/surgery_step/generic/amputate @@ -292,24 +292,24 @@ return 0 if (affected.status & ORGAN_DESTROYED) return 0 - return target_zone != "chest" && target_zone != "groin" && target_zone != "head" + return !affected.cannot_amputate begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("[user] is beginning to amputate [target]'s [affected.display_name] with \the [tool]." , \ + user.visible_message("[user] is beginning to amputate [target]'s [affected.name] with \the [tool]." , \ "You are beginning to cut through [target]'s [affected.amputation_point] with \the [tool].") target.custom_pain("Your [affected.amputation_point] is being ripped apart!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\blue [user] amputates [target]'s [affected.display_name] with \the [tool].", \ - "\blue You amputate [target]'s [affected.display_name] with \the [tool].") - affected.droplimb(1,1,1) + user.visible_message("\blue [user] amputates [target]'s [affected.name] at the [affected.amputation_point] with \the [tool].", \ + "\blue You amputate [target]'s [affected.name] with \the [tool].") + affected.droplimb(1) fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\red [user]'s hand slips, sawwing through the bone in [target]'s [affected.display_name] with \the [tool]!", \ - "\red Your hand slips, sawwing through the bone in [target]'s [affected.display_name] with \the [tool]!") + user.visible_message("\red [user]'s hand slips, sawing through the bone in [target]'s [affected.name] with \the [tool]!", \ + "\red Your hand slips, sawwing through the bone in [target]'s [affected.name] with \the [tool]!") affected.createwound(CUT, 30) affected.fracture() diff --git a/code/modules/surgery/headreattach.dm b/code/modules/surgery/headreattach.dm index 28759cbc73..0039ed6a55 100644 --- a/code/modules/surgery/headreattach.dm +++ b/code/modules/surgery/headreattach.dm @@ -47,8 +47,8 @@ var/obj/item/organ/external/affected = target.get_organ(target_zone) if (affected.parent) affected = affected.parent - user.visible_message("\red [user]'s hand slips, ripping [target]'s [affected.display_name] open!", \ - "\red Your hand slips, ripping [target]'s [affected.display_name] open!") + user.visible_message("\red [user]'s hand slips, ripping [target]'s [affected.name] open!", \ + "\red Your hand slips, ripping [target]'s [affected.name] open!") affected.createwound(CUT, 10) @@ -69,7 +69,7 @@ begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] is beginning to reshape [target]'s esophagal and vocal region with \the [tool].", \ - "You start to reshape [target]'s [affected.display_name] esophagal and vocal region with \the [tool].") + "You start to reshape [target]'s [affected.name] esophagal and vocal region with \the [tool].") ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -142,8 +142,6 @@ "\blue You have finished adjusting the area around [target]'s neck with \the [tool].") target.op_stage.head_reattach = 0 affected.status |= ORGAN_ATTACHABLE - affected.amputated = 1 - affected.setAmputatedTree() affected.open = 0 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -151,7 +149,7 @@ if (affected.parent) affected = affected.parent user.visible_message("\red [user]'s hand slips, searing [target]'s neck!", \ - "\red Your hand slips, searing [target]'s [affected.display_name]!") + "\red Your hand slips, searing [target]'s [affected.name]!") target.apply_damage(10, BURN, affected) @@ -176,7 +174,6 @@ user.visible_message("\blue [user] has attached [target]'s head to the body.", \ "\blue You have attached [target]'s head to the body.") affected.status = 0 - affected.amputated = 0 target.update_body() target.updatehealth() target.UpdateDamageIcon() diff --git a/code/modules/surgery/implant.dm b/code/modules/surgery/implant.dm index 801bc10cc3..61a70fde53 100644 --- a/code/modules/surgery/implant.dm +++ b/code/modules/surgery/implant.dm @@ -62,8 +62,8 @@ fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/chest/affected = target.get_organ(target_zone) - user.visible_message("\red [user]'s hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!", \ - "\red Your hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!") + user.visible_message("\red [user]'s hand slips, scraping tissue inside [target]'s [affected.name] with \the [tool]!", \ + "\red Your hand slips, scraping tissue inside [target]'s [affected.name] with \the [tool]!") affected.createwound(CUT, 20) /datum/surgery_step/cavity/close_space @@ -98,8 +98,8 @@ fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/chest/affected = target.get_organ(target_zone) - user.visible_message("\red [user]'s hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!", \ - "\red Your hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!") + user.visible_message("\red [user]'s hand slips, scraping tissue inside [target]'s [affected.name] with \the [tool]!", \ + "\red Your hand slips, scraping tissue inside [target]'s [affected.name] with \the [tool]!") affected.createwound(CUT, 20) /datum/surgery_step/cavity/place_item @@ -130,7 +130,7 @@ user << "\red You tear some blood vessels trying to fit such a big object in this cavity." var/datum/wound/internal_bleeding/I = new (10) affected.wounds += I - affected.owner.custom_pain("You feel something rip in your [affected.display_name]!", 1) + affected.owner.custom_pain("You feel something rip in your [affected.name]!", 1) user.drop_item() affected.hidden = tool tool.loc = target @@ -138,8 +138,8 @@ fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/chest/affected = target.get_organ(target_zone) - user.visible_message("\red [user]'s hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!", \ - "\red Your hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!") + user.visible_message("\red [user]'s hand slips, scraping tissue inside [target]'s [affected.name] with \the [tool]!", \ + "\red Your hand slips, scraping tissue inside [target]'s [affected.name] with \the [tool]!") affected.createwound(CUT, 20) ////////////////////////////////////////////////////////////////// @@ -162,8 +162,8 @@ begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("[user] starts poking around inside the incision on [target]'s [affected.display_name] with \the [tool].", \ - "You start poking around inside the incision on [target]'s [affected.display_name] with \the [tool]" ) + user.visible_message("[user] starts poking around inside the incision on [target]'s [affected.name] with \the [tool].", \ + "You start poking around inside the incision on [target]'s [affected.name] with \the [tool]" ) target.custom_pain("The pain in your chest is living hell!",1) ..() @@ -186,8 +186,8 @@ find_prob +=50 if (prob(find_prob)) - user.visible_message("\blue [user] takes something out of incision on [target]'s [affected.display_name] with \the [tool].", \ - "\blue You take [obj] out of incision on [target]'s [affected.display_name]s with \the [tool]." ) + user.visible_message("\blue [user] takes something out of incision on [target]'s [affected.name] with \the [tool].", \ + "\blue You take [obj] out of incision on [target]'s [affected.name]s with \the [tool]." ) affected.implants -= obj BITSET(target.hud_updateflag, IMPLOYAL_HUD) @@ -206,11 +206,11 @@ imp.imp_in = null imp.implanted = 0 else - user.visible_message("\blue [user] removes \the [tool] from [target]'s [affected.display_name].", \ - "\blue There's something inside [target]'s [affected.display_name], but you just missed it this time." ) + user.visible_message("\blue [user] removes \the [tool] from [target]'s [affected.name].", \ + "\blue There's something inside [target]'s [affected.name], but you just missed it this time." ) else if (affected.hidden) - user.visible_message("\blue [user] takes something out of incision on [target]'s [affected.display_name] with \the [tool].", \ - "\blue You take something out of incision on [target]'s [affected.display_name]s with \the [tool]." ) + user.visible_message("\blue [user] takes something out of incision on [target]'s [affected.name] with \the [tool].", \ + "\blue You take something out of incision on [target]'s [affected.name]s with \the [tool]." ) affected.hidden.loc = get_turf(target) if(!affected.hidden.blood_DNA) affected.hidden.blood_DNA = list() @@ -219,20 +219,20 @@ affected.hidden = null else - user.visible_message("\blue [user] could not find anything inside [target]'s [affected.display_name], and pulls \the [tool] out.", \ - "\blue You could not find anything inside [target]'s [affected.display_name]." ) + user.visible_message("\blue [user] could not find anything inside [target]'s [affected.name], and pulls \the [tool] out.", \ + "\blue You could not find anything inside [target]'s [affected.name]." ) fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/chest/affected = target.get_organ(target_zone) - user.visible_message("\red [user]'s hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!", \ - "\red Your hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!") + user.visible_message("\red [user]'s hand slips, scraping tissue inside [target]'s [affected.name] with \the [tool]!", \ + "\red Your hand slips, scraping tissue inside [target]'s [affected.name] with \the [tool]!") affected.createwound(CUT, 20) if (affected.implants.len) var/fail_prob = 10 fail_prob += 100 - tool_quality(tool) if (prob(fail_prob)) var/obj/item/weapon/implant/imp = affected.implants[1] - user.visible_message("\red Something beeps inside [target]'s [affected.display_name]!") + user.visible_message("\red Something beeps inside [target]'s [affected.name]!") playsound(imp.loc, 'sound/items/countdown.ogg', 75, 1, -3) spawn(25) imp.activate() diff --git a/code/modules/surgery/organs_internal.dm b/code/modules/surgery/organs_internal.dm index 8107a0548a..56dfcd4ae4 100644 --- a/code/modules/surgery/organs_internal.dm +++ b/code/modules/surgery/organs_internal.dm @@ -94,7 +94,7 @@ user.visible_message("[user] starts treating damage to [target]'s [I.name] with [tool_name].", \ "You start treating damage to [target]'s [I.name] with [tool_name]." ) - target.custom_pain("The pain in your [affected.display_name] is living hell!",1) + target.custom_pain("The pain in your [affected.name] is living hell!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -121,8 +121,8 @@ return var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\red [user]'s hand slips, getting mess and tearing the inside of [target]'s [affected.display_name] with \the [tool]!", \ - "\red Your hand slips, getting mess and tearing the inside of [target]'s [affected.display_name] with \the [tool]!") + user.visible_message("\red [user]'s hand slips, getting mess and tearing the inside of [target]'s [affected.name] with \the [tool]!", \ + "\red Your hand slips, getting mess and tearing the inside of [target]'s [affected.name] with \the [tool]!") var/dam_amt = 2 if (istype(tool, /obj/item/stack/medical/advanced/bruise_pack)) @@ -172,7 +172,7 @@ user.visible_message("[user] starts mending the damage to [target]'s [I.name]'s mechanisms.", \ "You start mending the damage to [target]'s [I.name]'s mechanisms." ) - target.custom_pain("The pain in your [affected.display_name] is living hell!",1) + target.custom_pain("The pain in your [affected.name] is living hell!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -195,8 +195,8 @@ return var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\red [user]'s hand slips, gumming up the mechanisms inside of [target]'s [affected.display_name] with \the [tool]!", \ - "\red Your hand slips, gumming up the mechanisms inside of [target]'s [affected.display_name] with \the [tool]!") + user.visible_message("\red [user]'s hand slips, gumming up the mechanisms inside of [target]'s [affected.name] with \the [tool]!", \ + "\red Your hand slips, gumming up the mechanisms inside of [target]'s [affected.name] with \the [tool]!") target.adjustToxLoss(5) affected.createwound(CUT, 5) @@ -244,7 +244,7 @@ user.visible_message("[user] starts to separate [target]'s [target.op_stage.current_organ] with \the [tool].", \ "You start to separate [target]'s [target.op_stage.current_organ] with \the [tool]." ) - target.custom_pain("The pain in your [affected.display_name] is living hell!",1) + target.custom_pain("The pain in your [affected.name] is living hell!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -257,8 +257,8 @@ fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\red [user]'s hand slips, slicing an artery inside [target]'s [affected.display_name] with \the [tool]!", \ - "\red Your hand slips, slicing an artery inside [target]'s [affected.display_name] with \the [tool]!") + user.visible_message("\red [user]'s hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!", \ + "\red Your hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!") affected.createwound(CUT, rand(30,50), 1) /datum/surgery_step/internal/remove_organ @@ -311,8 +311,8 @@ fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\red [user]'s hand slips, damaging the flesh in [target]'s [affected.display_name] with \the [tool]!", \ - "\red Your hand slips, damaging the flesh in [target]'s [affected.display_name] with \the [tool]!") + user.visible_message("\red [user]'s hand slips, damaging the flesh in [target]'s [affected.name] with \the [tool]!", \ + "\red Your hand slips, damaging the flesh in [target]'s [affected.name] with \the [tool]!") affected.createwound(BRUISE, 20) /datum/surgery_step/internal/replace_organ @@ -357,7 +357,7 @@ if(O && affected.name == O.parent_organ) organ_compatible = 1 else - user << "\red \The [O.organ_tag] [o_do] normally go in \the [affected.display_name]." + user << "\red \The [O.organ_tag] [o_do] normally go in \the [affected.name]." return 2 else user << "\red You're pretty sure [target.species.name_plural] don't normally have [o_a][O.organ_tag]." @@ -367,15 +367,15 @@ begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("[user] starts transplanting \the [tool] into [target]'s [affected.display_name].", \ - "You start transplanting \the [tool] into [target]'s [affected.display_name].") - target.custom_pain("Someone's rooting around in your [affected.display_name]!",1) + user.visible_message("[user] starts transplanting \the [tool] into [target]'s [affected.name].", \ + "You start transplanting \the [tool] into [target]'s [affected.name].") + target.custom_pain("Someone's rooting around in your [affected.name]!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\blue [user] has transplanted \the [tool] into [target]'s [affected.display_name].", \ - "\blue You have transplanted \the [tool] into [target]'s [affected.display_name].") + 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 if(istype(O)) @@ -433,8 +433,8 @@ fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\red [user]'s hand slips, damaging the flesh in [target]'s [affected.display_name] with \the [tool]!", \ - "\red Your hand slips, damaging the flesh in [target]'s [affected.display_name] with \the [tool]!") + user.visible_message("\red [user]'s hand slips, damaging the flesh in [target]'s [affected.name] with \the [tool]!", \ + "\red Your hand slips, damaging the flesh in [target]'s [affected.name] with \the [tool]!") affected.createwound(BRUISE, 20) ////////////////////////////////////////////////////////////////// diff --git a/code/modules/surgery/other.dm b/code/modules/surgery/other.dm index 5b3519d46f..92b28b3fca 100644 --- a/code/modules/surgery/other.dm +++ b/code/modules/surgery/other.dm @@ -31,15 +31,15 @@ begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("[user] starts patching the damaged vein in [target]'s [affected.display_name] with \the [tool]." , \ - "You start patching the damaged vein in [target]'s [affected.display_name] with \the [tool].") - target.custom_pain("The pain in [affected.display_name] is unbearable!",1) + user.visible_message("[user] starts patching the damaged vein in [target]'s [affected.name] with \the [tool]." , \ + "You start patching the damaged vein in [target]'s [affected.name] with \the [tool].") + target.custom_pain("The pain in [affected.name] is unbearable!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\blue [user] has patched the damaged vein in [target]'s [affected.display_name] with \the [tool].", \ - "\blue You have patched the damaged vein in [target]'s [affected.display_name] with \the [tool].") + user.visible_message("\blue [user] has patched the damaged vein in [target]'s [affected.name] with \the [tool].", \ + "\blue You have patched the damaged vein in [target]'s [affected.name] with \the [tool].") for(var/datum/wound/W in affected.wounds) if(W.internal) affected.wounds -= W @@ -48,8 +48,8 @@ fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\red [user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.display_name]!" , \ - "\red Your hand slips, smearing [tool] in the incision in [target]'s [affected.display_name]!") + user.visible_message("\red [user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.name]!" , \ + "\red Your hand slips, smearing [tool] in the incision in [target]'s [affected.name]!") affected.take_damage(5, 0) /datum/surgery_step/fix_dead_tissue //Debridement @@ -79,21 +79,21 @@ begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("[user] starts cutting away necrotic tissue in [target]'s [affected.display_name] with \the [tool]." , \ - "You start cutting away necrotic tissue in [target]'s [affected.display_name] with \the [tool].") - target.custom_pain("The pain in [affected.display_name] is unbearable!",1) + user.visible_message("[user] starts cutting away necrotic tissue in [target]'s [affected.name] with \the [tool]." , \ + "You start cutting away necrotic tissue in [target]'s [affected.name] with \the [tool].") + target.custom_pain("The pain in [affected.name] is unbearable!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\blue [user] has cut away necrotic tissue in [target]'s [affected.display_name] with \the [tool].", \ - "\blue You have cut away necrotic tissue in [target]'s [affected.display_name] with \the [tool].") + user.visible_message("\blue [user] has cut away necrotic tissue in [target]'s [affected.name] with \the [tool].", \ + "\blue You have cut away necrotic tissue in [target]'s [affected.name] with \the [tool].") affected.open = 3 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\red [user]'s hand slips, slicing an artery inside [target]'s [affected.display_name] with \the [tool]!", \ - "\red Your hand slips, slicing an artery inside [target]'s [affected.display_name] with \the [tool]!") + user.visible_message("\red [user]'s hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!", \ + "\red Your hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!") affected.createwound(CUT, 20, 1) /datum/surgery_step/treat_necrosis @@ -131,9 +131,9 @@ begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("[user] starts applying medication to the affected tissue in [target]'s [affected.display_name] with \the [tool]." , \ - "You start applying medication to the affected tissue in [target]'s [affected.display_name] with \the [tool].") - target.custom_pain("Something in your [affected.display_name] is causing you a lot of pain!",1) + user.visible_message("[user] starts applying medication to the affected tissue in [target]'s [affected.name] with \the [tool]." , \ + "You start applying medication to the affected tissue in [target]'s [affected.name] with \the [tool].") + target.custom_pain("Something in your [affected.name] is causing you a lot of pain!",1) ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -151,8 +151,8 @@ if(container.reagents.has_reagent("peridaxon")) affected.status &= ~ORGAN_DEAD - user.visible_message("\blue [user] applies [trans] units of the solution to affected tissue in [target]'s [affected.display_name]", \ - "\blue You apply [trans] units of the solution to affected tissue in [target]'s [affected.display_name] with \the [tool].") + user.visible_message("\blue [user] applies [trans] units of the solution to affected tissue in [target]'s [affected.name]", \ + "\blue You apply [trans] units of the solution to affected tissue in [target]'s [affected.name] with \the [tool].") fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -165,8 +165,8 @@ var/trans = container.reagents.trans_to(target, container.amount_per_transfer_from_this) container.reagents.reaction(target, INGEST) //technically it's contact, but the reagents are being applied to internal tissue - user.visible_message("\red [user]'s hand slips, applying [trans] units of the solution to the wrong place in [target]'s [affected.display_name] with the [tool]!" , \ - "\red Your hand slips, applying [trans] units of the solution to the wrong place in [target]'s [affected.display_name] with the [tool]!") + user.visible_message("\red [user]'s hand slips, applying [trans] units of the solution to the wrong place in [target]'s [affected.name] with the [tool]!" , \ + "\red Your hand slips, applying [trans] units of the solution to the wrong place in [target]'s [affected.name] with the [tool]!") //no damage or anything, just wastes medicine diff --git a/code/modules/surgery/robolimbs.dm b/code/modules/surgery/robolimbs.dm index 8b9f3be6d9..d4e5127bdc 100644 --- a/code/modules/surgery/robolimbs.dm +++ b/code/modules/surgery/robolimbs.dm @@ -36,22 +36,22 @@ begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("[user] starts cutting away flesh where [target]'s [affected.display_name] used to be with \the [tool].", \ - "You start cutting away flesh where [target]'s [affected.display_name] used to be with \the [tool].") + user.visible_message("[user] starts cutting away flesh where [target]'s [affected.name] used to be with \the [tool].", \ + "You start cutting away flesh where [target]'s [affected.name] used to be with \the [tool].") ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\blue [user] cuts away flesh where [target]'s [affected.display_name] used to be with \the [tool].", \ - "\blue You cut away flesh where [target]'s [affected.display_name] used to be with \the [tool].") + user.visible_message("\blue [user] cuts away flesh where [target]'s [affected.name] used to be with \the [tool].", \ + "\blue You cut away flesh where [target]'s [affected.name] used to be with \the [tool].") affected.status |= ORGAN_CUT_AWAY fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) if (affected.parent) affected = affected.parent - user.visible_message("\red [user]'s hand slips, cutting [target]'s [affected.display_name] open!", \ - "\red Your hand slips, cutting [target]'s [affected.display_name] open!") + user.visible_message("\red [user]'s hand slips, cutting [target]'s [affected.name] open!", \ + "\red Your hand slips, cutting [target]'s [affected.name] open!") affected.createwound(CUT, 10) @@ -71,22 +71,22 @@ begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("[user] is beginning to reposition flesh and nerve endings where where [target]'s [affected.display_name] used to be with [tool].", \ - "You start repositioning flesh and nerve endings where [target]'s [affected.display_name] used to be with [tool].") + user.visible_message("[user] is beginning to reposition flesh and nerve endings where where [target]'s [affected.name] used to be with [tool].", \ + "You start repositioning flesh and nerve endings where [target]'s [affected.name] used to be with [tool].") ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\blue [user] has finished repositioning flesh and nerve endings where [target]'s [affected.display_name] used to be with [tool].", \ - "\blue You have finished repositioning flesh and nerve endings where [target]'s [affected.display_name] used to be with [tool].") + user.visible_message("\blue [user] has finished repositioning flesh and nerve endings where [target]'s [affected.name] used to be with [tool].", \ + "\blue You have finished repositioning flesh and nerve endings where [target]'s [affected.name] used to be with [tool].") affected.open = 3 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) if (affected.parent) affected = affected.parent - user.visible_message("\red [user]'s hand slips, tearing flesh on [target]'s [affected.display_name]!", \ - "\red Your hand slips, tearing flesh on [target]'s [affected.display_name]!") + user.visible_message("\red [user]'s hand slips, tearing flesh on [target]'s [affected.name]!", \ + "\red Your hand slips, tearing flesh on [target]'s [affected.name]!") target.apply_damage(10, BRUTE, affected, sharp=1) @@ -108,25 +108,23 @@ begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("[user] starts adjusting the area around [target]'s [affected.display_name] with \the [tool].", \ - "You start adjusting the area around [target]'s [affected.display_name] with \the [tool].") + user.visible_message("[user] starts adjusting the area around [target]'s [affected.name] with \the [tool].", \ + "You start adjusting the area around [target]'s [affected.name] with \the [tool].") ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\blue [user] has finished adjusting the area around [target]'s [affected.display_name] with \the [tool].", \ - "\blue You have finished adjusting the area around [target]'s [affected.display_name] with \the [tool].") + user.visible_message("\blue [user] has finished adjusting the area around [target]'s [affected.name] with \the [tool].", \ + "\blue You have finished adjusting the area around [target]'s [affected.name] with \the [tool].") affected.status |= ORGAN_ATTACHABLE - affected.amputated = 1 - affected.setAmputatedTree() affected.open = 0 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) if (affected.parent) affected = affected.parent - user.visible_message("\red [user]'s hand slips, searing [target]'s [affected.display_name]!", \ - "\red Your hand slips, searing [target]'s [affected.display_name]!") + user.visible_message("\red [user]'s hand slips, searing [target]'s [affected.name]!", \ + "\red Your hand slips, searing [target]'s [affected.name]!") target.apply_damage(10, BURN, affected) @@ -147,14 +145,14 @@ begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("[user] starts attaching \the [tool] where [target]'s [affected.display_name] used to be.", \ - "You start attaching \the [tool] where [target]'s [affected.display_name] used to be.") + user.visible_message("[user] starts attaching \the [tool] where [target]'s [affected.name] used to be.", \ + "You start attaching \the [tool] where [target]'s [affected.name] used to be.") end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/robot_parts/L = tool var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\blue [user] has attached \the [tool] where [target]'s [affected.display_name] used to be.", \ - "\blue You have attached \the [tool] where [target]'s [affected.display_name] used to be.") + user.visible_message("\blue [user] has attached \the [tool] where [target]'s [affected.name] used to be.", \ + "\blue You have attached \the [tool] where [target]'s [affected.name] used to be.") affected.germ_level = 0 affected.robotize() if(L.sabotaged) @@ -168,6 +166,6 @@ fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\red [user]'s hand slips, damaging connectors on [target]'s [affected.display_name]!", \ - "\red Your hand slips, damaging connectors on [target]'s [affected.display_name]!") + user.visible_message("\red [user]'s hand slips, damaging connectors on [target]'s [affected.name]!", \ + "\red Your hand slips, damaging connectors on [target]'s [affected.name]!") target.apply_damage(10, BRUTE, affected, sharp=1) diff --git a/code/modules/virus2/effect.dm b/code/modules/virus2/effect.dm index 5d6abc3e97..3153bd4f9b 100644 --- a/code/modules/virus2/effect.dm +++ b/code/modules/virus2/effect.dm @@ -81,11 +81,11 @@ var/mob/living/carbon/human/H = mob var/obj/item/organ/external/O = pick(H.organs) if(prob(25)) - mob << "Your [O.display_name] feels as if it might fall off!" + mob << "Your [O.name] feels as if it might fall off!" if(prob(10)) spawn(50) if(O) - O.droplimb(1) + O.droplimb() else if(prob(75)) mob << "Your whole body feels like it might fall apart!" @@ -156,7 +156,7 @@ var/obj/item/organ/external/E = H.organs_by_name[organ] if (!(E.status & ORGAN_DEAD)) E.status |= ORGAN_DEAD - H << "You can't feel your [E.display_name] anymore..." + H << "You can't feel your [E.name] anymore..." for (var/obj/item/organ/external/C in E.children) C.status |= ORGAN_DEAD H.update_body(1) From 9c92d3851acce7dfc10a7e463aa7f8b1bd39b907 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 25 Mar 2015 23:11:00 +1030 Subject: [PATCH 05/11] Got various kinds of limb loss plus dislocation working. --- code/_onclick/item_attack.dm | 15 ++-- code/game/objects/items/weapons/twohanded.dm | 2 +- code/modules/hydroponics/trays/tray_tools.dm | 2 +- .../living/carbon/human/human_attackhand.dm | 19 ++-- .../mob/living/carbon/human/human_defense.dm | 77 ++++++++-------- .../mob/living/carbon/human/human_organs.dm | 2 +- .../living/carbon/human/species/species.dm | 1 + code/modules/organs/organ_external.dm | 87 +++++++++++++------ code/modules/organs/organ_icon.dm | 4 +- 9 files changed, 128 insertions(+), 81 deletions(-) diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 52b6fe9424..1d68fb54e8 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -43,14 +43,15 @@ var/mob/living/carbon/human/H = M // Handle striking to cripple. - if(user.a_intent == "disarm" && H.attack_joint(src, user, def_zone)) - add_fingerprint(user) - return 1 - - var/hit = H.attacked_by(src, user, def_zone) - if(hit && hitsound) + var/dislocation_str + if(user.a_intent == "disarm") + dislocation_str = H.attack_joint(src, user, def_zone) + if(H.attacked_by(src, user, def_zone) && hitsound) playsound(loc, hitsound, 50, 1, -1) - return hit + spawn(1) //ugh I hate this but I don't want to root through human attack procs to print it after this call resolves. + if(dislocation_str) user.visible_message("[dislocation_str]") + return 1 + return 0 else if(attack_verb.len) user.visible_message("[M] has been [pick(attack_verb)] with [src] by [user]!") diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm index 2ccd78d361..5367f39c97 100644 --- a/code/game/objects/items/weapons/twohanded.dm +++ b/code/game/objects/items/weapons/twohanded.dm @@ -218,7 +218,7 @@ throw_speed = 3 throw_range = 7 throwforce = 7 - attack_verb = list("smashed", "beaten", "slammed", "smacked", "striked", "battered", "bonked") + attack_verb = list("smashed", "beaten", "slammed", "smacked", "struck", "battered", "bonked") hitsound = 'sound/weapons/genhit3.ogg' force_wielded = 23 diff --git a/code/modules/hydroponics/trays/tray_tools.dm b/code/modules/hydroponics/trays/tray_tools.dm index 67d630119a..10f5961da7 100644 --- a/code/modules/hydroponics/trays/tray_tools.dm +++ b/code/modules/hydroponics/trays/tray_tools.dm @@ -226,7 +226,7 @@ icon_state = "hatchet" flags = CONDUCT force = 12.0 - w_class = 2.0 + w_class = 3.0 throwforce = 15.0 throw_speed = 4 throw_range = 4 diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index cb2e1aec47..f666ab6a0b 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -302,13 +302,16 @@ return 1 /mob/living/carbon/human/proc/attack_joint(var/obj/item/W, var/mob/living/user, var/def_zone) - - var/obj/item/organ/external/organ = get_organ(check_zone(def_zone)) - if(!organ || organ.is_dislocated() || organ.dislocated == -1) //Cannot dislocate this organ. - return 0 - - user.visible_message("[src] has been [pick(W.attack_verb)] in \the [organ] with \the [W] by [user]!") + var/target_zone = def_zone? check_zone(def_zone) : get_zone_with_miss_chance(user.zone_sel.selecting, src) + if(user == src) // Attacking yourself can't miss + target_zone = user.zone_sel.selecting + if(!target_zone) + return null + var/obj/item/organ/external/organ = get_organ(check_zone(target_zone)) + if(!organ || organ.is_dislocated() || organ.dislocated == -1) + return null + var/dislocation_str if(prob(W.force)) - user.visible_message("[src]'s [organ.joint] [pick("gives way","caves in","crumbles","collapses")] with a grisly crunch!") + dislocation_str = "[src]'s [organ.joint] [pick("gives way","caves in","crumbles","collapses")] with a grisly crunch!" organ.dislocate() - return 1 + return dislocation_str diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 7f002de788..bfc7756e4f 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -11,6 +11,8 @@ emp_act /mob/living/carbon/human/bullet_act(var/obj/item/projectile/P, var/def_zone) var/obj/item/organ/external/organ = get_organ(check_zone(def_zone)) + if(!organ) + return //Shields if(check_shields(P.damage, "the [P.name]")) @@ -85,16 +87,18 @@ emp_act if(isorgan(def_zone)) return getarmor_organ(def_zone, type) var/obj/item/organ/external/affecting = get_organ(def_zone) - return getarmor_organ(affecting, type) + if(affecting) + return getarmor_organ(affecting, type) //If a specific bodypart is targetted, check how that bodypart is protected and return the value. //If you don't specify a bodypart, it checks ALL your bodyparts for protection, and averages out the values for(var/organ_name in organs_by_name) if (organ_name in organ_rel_size) var/obj/item/organ/external/organ = organs_by_name[organ_name] - var/weight = organ_rel_size[organ_name] - armorval += getarmor_organ(organ, type) * weight - total += weight + if(organ) + var/weight = organ_rel_size[organ_name] + armorval += getarmor_organ(organ, type) * weight + total += weight return (armorval/max(total, 1)) //this proc returns the Siemens coefficient of electrical resistivity for a particular external organ. @@ -113,13 +117,13 @@ emp_act //this proc returns the armour value for a particular external organ. /mob/living/carbon/human/proc/getarmor_organ(var/obj/item/organ/external/def_zone, var/type) - if(!type) return 0 + if(!type || !def_zone) return 0 var/protection = 0 var/list/protective_gear = list(head, wear_mask, wear_suit, w_uniform, gloves, shoes) for(var/gear in protective_gear) if(gear && istype(gear ,/obj/item/clothing)) var/obj/item/clothing/C = gear - if(C.body_parts_covered & def_zone.body_part) + if(istype(C) && C.body_parts_covered & def_zone.body_part) protection += C.armor[type] return protection @@ -186,7 +190,7 @@ emp_act target_zone = user.zone_sel.selecting if(!target_zone) visible_message("\red [user] misses [src] with \the [I]!") - return 0 + return 1 var/obj/item/organ/external/affecting = get_organ(target_zone) @@ -194,9 +198,11 @@ emp_act user << "They are missing that limb!" return + var/effective_force = I.force + if(user.a_intent == "disarm") effective_force = round(I.force/2) var/hit_area = affecting.name - if((user != src) && check_shields(I.force, "the [I.name]")) + if((user != src) && check_shields(effective_force, "the [I.name]")) return 0 if(istype(I,/obj/item/weapon/card/emag)) @@ -224,14 +230,14 @@ emp_act weapon_sharp = 0 weapon_edge = 0 - if(armor >= 2) return 0 - if(!I.force) return 0 - var/Iforce = I.force //to avoid runtimes on the forcesay checks at the bottom. Some items might delete themselves if you drop them. (stunning yourself, ninja swords) + if(armor >= 2) return 0 + if(!effective_force) return 0 + var/Iforce = effective_force //to avoid runtimes on the forcesay checks at the bottom. Some items might delete themselves if you drop them. (stunning yourself, ninja swords) - apply_damage(I.force, I.damtype, affecting, armor, sharp=weapon_sharp, edge=weapon_edge, used_weapon=I) + apply_damage(effective_force, I.damtype, affecting, armor, sharp=weapon_sharp, edge=weapon_edge, used_weapon=I) var/bloody = 0 - if(((I.damtype == BRUTE) || (I.damtype == HALLOSS)) && prob(25 + (I.force * 2))) + if(((I.damtype == BRUTE) || (I.damtype == HALLOSS)) && prob(25 + (effective_force * 2))) I.add_blood(src) //Make the weapon bloody, not the person. // if(user.hand) user.update_inv_l_hand() //updates the attacker's overlay for the (now bloodied) weapon // else user.update_inv_r_hand() //removed because weapons don't have on-mob blood overlays @@ -246,36 +252,37 @@ emp_act H.bloody_body(src) H.bloody_hands(src) - switch(hit_area) - if("head")//Harder to score a stun but if you do it lasts a bit longer - if(prob(I.force)) - apply_effect(20, PARALYZE, armor) - visible_message("\red [src] has been knocked unconscious!") - if(bloody)//Apply blood - if(wear_mask) - wear_mask.add_blood(src) - update_inv_wear_mask(0) - if(head) - head.add_blood(src) - update_inv_head(0) - if(glasses && prob(33)) - glasses.add_blood(src) - update_inv_glasses(0) + if(!stat) + switch(hit_area) + if("head")//Harder to score a stun but if you do it lasts a bit longer + if(prob(effective_force)) + apply_effect(20, PARALYZE, armor) + visible_message("\red [src] has been knocked unconscious!") + if(bloody)//Apply blood + if(wear_mask) + wear_mask.add_blood(src) + update_inv_wear_mask(0) + if(head) + head.add_blood(src) + update_inv_head(0) + if(glasses && prob(33)) + glasses.add_blood(src) + update_inv_glasses(0) - if("chest")//Easier to score a stun but lasts less time - if(prob((I.force + 10))) - apply_effect(6, WEAKEN, armor) - visible_message("\red [src] has been knocked down!") + if("chest")//Easier to score a stun but lasts less time + if(prob((effective_force + 10))) + apply_effect(6, WEAKEN, armor) + visible_message("\red [src] has been knocked down!") - if(bloody) - bloody_body(src) + if(bloody) + bloody_body(src) if(Iforce > 10 || Iforce >= 5 && prob(33)) forcesay(hit_appends) //forcesay checks stat already //Melee weapon embedded object code. if (I && I.damtype == BRUTE && !I.anchored && !I.is_robot_module()) - var/damage = I.force + var/damage = effective_force if (armor) damage /= armor+1 diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index 0255a23d37..fb9955b481 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -39,7 +39,7 @@ if (!lying && world.time - l_move_time < 15) //Moving around with fractured ribs won't do you any good - if (E.is_broken() && E.internal_organs && prob(15)) + if (E.is_broken() && E.internal_organs && E.internal_organs.len && prob(15)) var/obj/item/organ/I = pick(E.internal_organs) custom_pain("You feel broken bones moving in your [E.name]!", 1) I.take_damage(rand(3,5)) diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 45fae61460..a04bfdebdc 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -41,6 +41,7 @@ // Death vars. var/gibber_type = /obj/effect/gibspawner/human + var/single_gib_type = /obj/effect/decal/cleanable/blood/gibs var/remains_type = /obj/effect/decal/remains/xeno var/gibbed_anim = "gibbed-h" var/dusted_anim = "dust-h" diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index e7d5b0b5e7..602f353ee6 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -13,7 +13,6 @@ var/max_size = 0 var/last_dam = -1 var/icon/mob_icon - var/icon/item_icon var/gendered_icon = 0 var/limb_name var/disfigured = 1 @@ -51,6 +50,7 @@ min_broken_damage = 30 max_damage = 0 + dir = SOUTH /obj/item/organ/external/attackby(obj/item/weapon/W as obj, mob/user as mob) switch(stage) @@ -78,7 +78,7 @@ ..() /obj/item/organ/external/proc/is_dislocated() - if(dislocated) + if(dislocated > 0) return 1 if(parent) return parent.is_dislocated() @@ -202,11 +202,18 @@ src.update_damages() //If limb took enough damage, try to cut or tear it off - if(body_part != UPPER_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(brute)) ) - droplimb() - return + if(!cannot_amputate && config.limbs_can_break && (brute_dam + burn_dam) >= (max_damage * config.organ_health_multiplier)) + if((sharp || edge) && used_weapon) + if(istype(used_weapon,/obj/item)) + var/obj/item/W = used_weapon + if(W.w_class >= 3) droplimb() + return + if(brute >= 23 && prob(brute)) // Wooden baseball bat in both hands == 23 + droplimb(0,2) + return + if(burn >= 20) // Most laser rifle shots. + droplimb(0,1) + return owner.updatehealth() @@ -592,16 +599,31 @@ Note that amputating the affected organ does in fact remove the infection from t ****************************************************/ //Handles dismemberment -/obj/item/organ/external/proc/droplimb(var/clean) +/obj/item/organ/external/proc/droplimb(var/clean, var/disintegrate) - if(cannot_amputate) + if(cannot_amputate || !owner) return - if(!clean) - owner.visible_message( - "\The [owner]'s [src.name] flies off in an arc!",\ - "Your [src.name] goes flying off!",\ - "You hear a terrible sound of ripping tendons and flesh.") + if(!disintegrate) + disintegrate = 0 + + switch(disintegrate) + if(0) + if(!clean) + owner.visible_message( + "\The [owner]'s [src.name] flies off in an arc!",\ + "Your [src.name] goes flying off!",\ + "You hear a terrible sound of ripping tendons and flesh.") + if(1) + owner.visible_message( + "\The [owner]'s [src.name] flashes away into ashes!",\ + "Your [src.name] flashes away into ashes!",\ + "You hear the crackling sound of burning flesh.") + if(2) + owner.visible_message( + "\The [owner]'s [src.name] explodes in a shower of gore!",\ + "Your [src.name] explodes in a shower of gore!",\ + "You hear the sickening splatter of gore.") src.removed() @@ -613,18 +635,30 @@ Note that amputating the affected organ does in fact remove the infection from t update_health() owner.update_body() - compile_icon() - add_blood(owner) - - 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) + switch(disintegrate) + if(0) + compile_icon() + add_blood(owner) + 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) + return + if(1) + new /obj/effect/decal/cleanable/ash(get_turf(owner)) + if(2) + var/obj/effect/decal/cleanable/blood/gibs/gore = new owner.species.single_gib_type(get_turf(owner)) + if(owner.species.flesh_color) + gore.fleshcolor = owner.species.flesh_color + if(owner.species.blood_color) + gore.basecolor = owner.species.blood_color + gore.update_icon() + gore.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),30) + del(src) /**************************************************** HELPERS @@ -801,8 +835,6 @@ Note that amputating the affected organ does in fact remove the infection from t status |= ORGAN_DESTROYED owner.bad_external_organs -= src - icon = item_icon - for(var/implant in implants) //todo: check if this can be left alone del(implant) @@ -853,6 +885,7 @@ Note that amputating the affected organ does in fact remove the infection from t dislocated = -1 gendered_icon = 1 cannot_amputate = 1 + parent_organ = null /obj/item/organ/external/groin name = "lower body" diff --git a/code/modules/organs/organ_icon.dm b/code/modules/organs/organ_icon.dm index 7fbdf3bf1d..9361ec3f4a 100644 --- a/code/modules/organs/organ_icon.dm +++ b/code/modules/organs/organ_icon.dm @@ -1,5 +1,8 @@ var/global/list/limb_icon_cache = list() +/obj/item/organ/external/set_dir() + return + /obj/item/organ/proc/get_icon(var/image/supplied) var/key = "internal-[icon_state]" var/image/I @@ -56,7 +59,6 @@ var/global/list/limb_icon_cache = list() mob_icon.Blend(rgb(owner.r_skin, owner.g_skin, owner.b_skin), ICON_ADD) dir = EAST - item_icon = icon(mob_icon,icon_state,SOUTH) icon = mob_icon return mob_icon From bb2cd41c8cb2a3549a5c7b47b2101bcd4591c1c9 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Thu, 26 Mar 2015 00:40:40 +1030 Subject: [PATCH 06/11] Fixed up gibbing and organ icons. --- code/modules/mob/living/carbon/human/death.dm | 8 +++----- code/modules/organs/organ.dm | 2 ++ code/modules/organs/organ_external.dm | 19 +++++++++++++------ code/modules/organs/organ_icon.dm | 11 +---------- 4 files changed, 19 insertions(+), 21 deletions(-) diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index 7be42b5a51..65fa5c522e 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -6,11 +6,9 @@ I.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),30) for(var/obj/item/organ/external/E in src.organs) - if(E.cannot_amputate) - E.removed() - del(E) - continue - E.droplimb() + E.droplimb(0,0,1) + + sleep(1) ..(species.gibbed_anim) gibs(loc, viruses, dna, null, species.flesh_color, species.blood_color) diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index 206b030a03..5d307fffcf 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -2,6 +2,8 @@ var/list/organ_cache = list() /obj/item/organ name = "organ" + icon = 'icons/obj/surgery.dmi' + var/mob/living/carbon/human/owner = null var/status = 0 var/vital //Lose a vital limb, die immediately. diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 602f353ee6..5b86cfffdc 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -599,7 +599,7 @@ Note that amputating the affected organ does in fact remove the infection from t ****************************************************/ //Handles dismemberment -/obj/item/organ/external/proc/droplimb(var/clean, var/disintegrate) +/obj/item/organ/external/proc/droplimb(var/clean, var/disintegrate, var/ignore_children) if(cannot_amputate || !owner) return @@ -625,7 +625,7 @@ Note that amputating the affected organ does in fact remove the infection from t "Your [src.name] explodes in a shower of gore!",\ "You hear the sickening splatter of gore.") - src.removed() + src.removed(null, ignore_children) if(parent) parent.children -= src @@ -658,6 +658,12 @@ Note that amputating the affected organ does in fact remove the infection from t gore.basecolor = owner.species.blood_color gore.update_icon() gore.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),30) + + for(var/obj/item/organ/I in internal_organs) + I.removed() + if(istype(loc,/turf)) + I.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),30) + del(src) /**************************************************** @@ -827,7 +833,7 @@ Note that amputating the affected organ does in fact remove the infection from t H.drop_item() W.loc = owner -/obj/item/organ/external/removed() +/obj/item/organ/external/removed(var/mob/living/user, var/ignore_children) var/is_robotic = status & ORGAN_ROBOT ..() @@ -839,9 +845,10 @@ Note that amputating the affected organ does in fact remove the infection from t del(implant) // Attached organs also fly off. - for(var/obj/item/organ/external/O in children) - O.removed() - O.loc = src + if(!ignore_children) + for(var/obj/item/organ/external/O in children) + O.removed() + O.loc = src // Grab all the internal giblets too. for(var/obj/item/organ/organ in internal_organs) diff --git a/code/modules/organs/organ_icon.dm b/code/modules/organs/organ_icon.dm index 9361ec3f4a..be11eec925 100644 --- a/code/modules/organs/organ_icon.dm +++ b/code/modules/organs/organ_icon.dm @@ -3,15 +3,6 @@ var/global/list/limb_icon_cache = list() /obj/item/organ/external/set_dir() return -/obj/item/organ/proc/get_icon(var/image/supplied) - var/key = "internal-[icon_state]" - var/image/I - if(organ_cache[key]) - I = organ_cache[key] - else - I = image(icon, "[icon_state]") - return I - /obj/item/organ/external/proc/compile_icon() overlays.Cut() get_icon() @@ -22,7 +13,7 @@ var/global/list/limb_icon_cache = list() overlays += child.get_icon() overlays += organ.get_icon() -/obj/item/organ/external/get_icon(var/skeletal) +/obj/item/organ/external/proc/get_icon(var/skeletal) if(!owner) mob_icon = new /icon('icons/mob/human_races/r_human.dmi', "[icon_name][gendered_icon ? "_f" : ""]") From 139edb4f9b9c796e9d63604288d351135a33406e Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Thu, 26 Mar 2015 23:24:56 +1030 Subject: [PATCH 07/11] Fixed up some boilerplate. --- code/game/dna/dna2_helpers.dm | 4 +--- code/game/gamemodes/cult/runes.dm | 8 +------- code/modules/admin/admin_verbs.dm | 4 +--- code/modules/mob/living/carbon/human/appearance.dm | 5 +---- code/modules/mob/living/carbon/human/human.dm | 5 +---- code/modules/mob/living/carbon/human/human_organs.dm | 6 ++++++ 6 files changed, 11 insertions(+), 21 deletions(-) diff --git a/code/game/dna/dna2_helpers.dm b/code/game/dna/dna2_helpers.dm index 5b56cbfa43..9bfdf9f0b6 100644 --- a/code/game/dna/dna2_helpers.dm +++ b/code/game/dna/dna2_helpers.dm @@ -146,9 +146,7 @@ H.r_eyes = dna.GetUIValueRange(DNA_UI_EYES_R, 255) H.g_eyes = dna.GetUIValueRange(DNA_UI_EYES_G, 255) H.b_eyes = dna.GetUIValueRange(DNA_UI_EYES_B, 255) - if(H.internal_organs_by_name["eyes"]) - var/obj/item/organ/eyes/eyes = H.internal_organs_by_name["eyes"] - eyes.eye_colour = list(H.r_eyes,H.g_eyes,H.b_eyes) + H.update_eyes() H.s_tone = 35 - dna.GetUIValueRange(DNA_UI_SKIN_TONE, 220) // Value can be negative. diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 6275b5d8f7..14fb2c5ef2 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -433,15 +433,9 @@ var/list/sacrificed = list() D.b_eyes = 200 D.r_eyes = 200 D.g_eyes = 200 - if(D.internal_organs_by_name["eyes"]) - var/obj/item/organ/eyes/eyes = D.internal_organs_by_name["eyes"] - eyes.eye_colour = list(D.r_eyes,D.g_eyes,D.b_eyes) - - + D.update_eyes() D.underwear = 0 - D.key = ghost.key - cult.add_antagonist(D.mind) if(!chose_name) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 975dd6b070..bdbd1f4c3e 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -801,9 +801,7 @@ var/list/admin_verbs_mentor = list( M.r_eyes = hex2num(copytext(new_eyes, 2, 4)) M.g_eyes = hex2num(copytext(new_eyes, 4, 6)) M.b_eyes = hex2num(copytext(new_eyes, 6, 8)) - if(M.internal_organs_by_name["eyes"]) - var/obj/item/organ/eyes/eyes = M.internal_organs_by_name["eyes"] - eyes.eye_colour = list(M.r_eyes,M.g_eyes,M.b_eyes) + M.update_eyes() var/new_skin = input("Please select body color. This is for Tajaran, Unathi, and Skrell only!", "Character Generation") as color if(new_skin) diff --git a/code/modules/mob/living/carbon/human/appearance.dm b/code/modules/mob/living/carbon/human/appearance.dm index 4db5fa19f4..311942ca02 100644 --- a/code/modules/mob/living/carbon/human/appearance.dm +++ b/code/modules/mob/living/carbon/human/appearance.dm @@ -83,10 +83,7 @@ g_eyes = green b_eyes = blue - if(internal_organs_by_name["eyes"]) - var/obj/item/organ/eyes/eyes = internal_organs_by_name["eyes"] - eyes.eye_colour = list(r_eyes,g_eyes,b_eyes) - + update_eyes() update_body() return 1 diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 767d25c26b..5dcea4ef40 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -801,10 +801,7 @@ r_eyes = hex2num(copytext(new_eyes, 2, 4)) g_eyes = hex2num(copytext(new_eyes, 4, 6)) b_eyes = hex2num(copytext(new_eyes, 6, 8)) - if(internal_organs_by_name["eyes"]) - var/obj/item/organ/eyes/eyes = internal_organs_by_name["eyes"] - eyes.eye_colour = list(r_eyes,g_eyes,b_eyes) - + update_eyes() var/new_tone = input("Please select skin tone level: 1-220 (1=albino, 35=caucasian, 150=black, 220='very' black)", "Character Generation", "[35-s_tone]") as text diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index fb9955b481..4ce8e62f17 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -1,3 +1,9 @@ +/mob/living/carbon/human/proc/update_eyes() + if(internal_organs_by_name["eyes"]) + var/obj/item/organ/eyes/eyes = internal_organs_by_name["eyes"] + eyes.eye_colour = list(r_eyes,g_eyes,b_eyes) + regenerate_icons() + /mob/living/carbon/var/list/internal_organs = list() /mob/living/carbon/human/var/list/organs = list() /mob/living/carbon/human/var/list/organs_by_name = list() // map organ names to organs From c5d42f3a4b00ad308ba4a49b277560cee7837fe5 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Fri, 27 Mar 2015 17:51:10 +1030 Subject: [PATCH 08/11] More work on severing, improvements to yank-out-object. --- code/datums/datacore.dm | 1 - code/game/objects/items/devices/scanners.dm | 2 + .../objects/items/weapons/storage/bible.dm | 70 ------------------- .../mob/living/carbon/human/human_damage.dm | 8 +-- .../mob/living/carbon/human/update_icons.dm | 9 +-- code/modules/mob/mob.dm | 2 + code/modules/organs/organ_external.dm | 17 ++++- code/modules/organs/organ_stump.dm | 20 +----- code/modules/organs/pain.dm | 1 - 9 files changed, 27 insertions(+), 103 deletions(-) diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index 8cde01cdf3..8db17e447e 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -156,7 +156,6 @@ proc/get_id_photo(var/mob/living/carbon/human/H) preview_icon.Blend(temp, ICON_OVERLAY) for(var/obj/item/organ/external/E in H.organs) - if(E.status & ORGAN_CUT_AWAY || E.status & ORGAN_DESTROYED) continue temp = new /icon(icobase, "[E.name]") if(E.status & ORGAN_ROBOT) temp.MapColors(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0)) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 4b95f1bdf8..1a646d3fe1 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -181,6 +181,8 @@ REAGENT SCANNER var/mob/living/carbon/human/H = M for(var/name in H.organs_by_name) var/obj/item/organ/external/e = H.organs_by_name[name] + if(!e) + continue var/limb = e.name if(e.status & ORGAN_BROKEN) if(((e.name == "l_arm") || (e.name == "r_arm") || (e.name == "l_leg") || (e.name == "r_leg")) && (!(e.status & ORGAN_SPLINTED))) diff --git a/code/game/objects/items/weapons/storage/bible.dm b/code/game/objects/items/weapons/storage/bible.dm index ee23889052..626ed7aba2 100644 --- a/code/game/objects/items/weapons/storage/bible.dm +++ b/code/game/objects/items/weapons/storage/bible.dm @@ -20,79 +20,9 @@ new /obj/item/weapon/spacecash(src) new /obj/item/weapon/spacecash(src) new /obj/item/weapon/spacecash(src) -//BS12 EDIT -/* // All cult functionality moved to Null Rod -/obj/item/weapon/storage/bible/proc/bless(mob/living/carbon/M as mob) - if(ishuman(M)) - var/mob/living/carbon/human/H = M - var/heal_amt = 10 - for(var/obj/item/organ/external/affecting in H.organs) - if(affecting.heal_damage(heal_amt, heal_amt)) - H.UpdateDamageIcon() - return -/obj/item/weapon/storage/bible/attack(mob/living/M as mob, mob/living/user as mob) - - var/chaplain = 0 - if(user.mind && (user.mind.assigned_role == "Chaplain")) - chaplain = 1 - - - M.attack_log += text("\[[time_stamp()]\] Has been attacked with [src.name] by [user.name] ([user.ckey])") - user.attack_log += text("\[[time_stamp()]\] Used the [src.name] to attack [M.name] ([M.ckey])") - - log_attack("[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])") - - if (!(istype(user, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey") - user << "\red You don't have the dexterity to do this!" - return - if(!chaplain) - user << "\red The book sizzles in your hands." - user.take_organ_damage(0,10) - return - - if ((CLUMSY in user.mutations) && prob(50)) - user << "\red The [src] slips out of your hand and hits your head." - user.take_organ_damage(10) - user.Paralyse(20) - return - -// if(..() == BLOCKED) -// return - - if (M.stat !=2) - if(M.mind && (M.mind.assigned_role == "Chaplain")) - user << "\red You can't heal yourself!" - return - /*if((M.mind in ticker.mode.cult) && (prob(20))) - M << "\red The power of [src.deity_name] clears your mind of heresy!" - user << "\red You see how [M]'s eyes become clear, the cult no longer holds control over him!" - ticker.mode.remove_cultist(M.mind)*/ - if ((istype(M, /mob/living/carbon/human) && prob(60))) - bless(M) - for(var/mob/O in viewers(M, null)) - O.show_message(text("\red [] heals [] with the power of [src.deity_name]!", user, M), 1) - M << "\red May the power of [src.deity_name] compel you to be healed!" - playsound(src.loc, "punch", 25, 1, -1) - else - if(ishuman(M) && !istype(M:head, /obj/item/clothing/head/helmet)) - M.adjustBrainLoss(10) - M << "\red You feel dumber." - for(var/mob/O in viewers(M, null)) - O.show_message(text("\red [] beats [] over the head with []!", user, M, src), 1) - playsound(src.loc, "punch", 25, 1, -1) - else if(M.stat == 2) - for(var/mob/O in viewers(M, null)) - O.show_message(text("\red [] smacks []'s lifeless corpse with [].", user, M, src), 1) - playsound(src.loc, "punch", 25, 1, -1) - return -*/ /obj/item/weapon/storage/bible/afterattack(atom/A, mob/user as mob, proximity) if(!proximity) return -/* if (istype(A, /turf/simulated/floor)) - user << "\blue You hit the floor with the bible." - if(user.mind && (user.mind.assigned_role == "Chaplain")) - call(/obj/effect/rune/proc/revealrunes)(src)*/ if(user.mind && (user.mind.assigned_role == "Chaplain")) if(A.reagents && A.reagents.has_reagent("water")) //blesses all the water in the holder user << "\blue You bless [A]." diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index 4eaf4e4560..e96e526077 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -5,11 +5,11 @@ health = maxHealth stat = CONSCIOUS return - var/total_burn = 0 - var/total_brute = 0 + var/total_burn = 0 + var/total_brute = 0 for(var/obj/item/organ/external/O in organs) //hardcoded to streamline things a bit - total_brute += O.brute_dam - total_burn += O.burn_dam + total_brute += O.brute_dam + total_burn += O.burn_dam var/oxy_l = ((species.flags & NO_BREATHE) ? 0 : getOxyLoss()) var/tox_l = ((species.flags & NO_POISON) ? 0 : getToxLoss()) diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 392e3553a2..1fefc65085 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -254,16 +254,9 @@ var/global/list/damage_icon_parts = list() var/icon/base_icon if(human_icon_cache[icon_key]) - //Icon is cached, use existing icon. base_icon = human_icon_cache[icon_key] - - //log_debug("Retrieved cached mob icon ([icon_key] \icon[human_icon_cache[icon_key]]) for [src].") - else - //BEGIN CACHED ICON GENERATION. - //Robotic limbs are handled in get_icon() so all we worry about are missing or dead limbs. - //No icon stored, so we need to start with a basic one. var/obj/item/organ/external/chest = get_organ("chest") base_icon = chest.get_icon() @@ -296,7 +289,7 @@ var/global/list/damage_icon_parts = list() base_icon.MapColors(rgb(tone[1],0,0),rgb(0,tone[2],0),rgb(0,0,tone[3])) //Handle husk overlay. - if(husk && ("overlay_husk" in icon_states(race_icon))) + if(husk && ("overlay_husk" in icon_states(species.icobase))) var/icon/mask = new(base_icon) var/icon/husk_over = new(species.icobase,"overlay_husk") mask.MapColors(0,0,0,1, 0,0,0,1, 0,0,0,1, 0,0,0,1, 0,0,0,0) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 399b1ce5ca..1129991cfe 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1140,6 +1140,8 @@ mob/proc/yank_out_object() human_user.bloody_hands(H) selection.loc = get_turf(src) + if(!(U.l_hand && U.r_hand)) + U.put_in_hands(selection) for(var/obj/item/weapon/O in pinned) if(O == selection) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 5b86cfffdc..7884a98a10 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -627,14 +627,27 @@ Note that amputating the affected organ does in fact remove the infection from t src.removed(null, ignore_children) + wounds.Cut() if(parent) + var/datum/wound/W + if(max_damage < 50) + W = new/datum/wound/lost_limb/small(max_damage) + else + W = new/datum/wound/lost_limb(max_damage) parent.children -= src - if(!clean) - new /obj/item/organ/external/stump(owner, 0, src) + if(clean) + parent.wounds |= W + parent.update_damages() + else + var/obj/item/organ/external/stump/stump = new (owner, 0, src) + stump.wounds |= W + owner.organs |= stump + stump.update_damages() parent = null update_health() owner.update_body() + dir = SOUTH switch(disintegrate) if(0) diff --git a/code/modules/organs/organ_stump.dm b/code/modules/organs/organ_stump.dm index 1a673b84e5..caf8718269 100644 --- a/code/modules/organs/organ_stump.dm +++ b/code/modules/organs/organ_stump.dm @@ -16,20 +16,6 @@ if(istype(limb)) max_damage = limb.max_damage -/obj/item/organ/external/stump/process() - damage = max_damage - -/obj/item/organ/external/stump/handle_rejection() - return - -/obj/item/organ/external/stump/rejuvenate() - return - -/obj/item/organ/external/stump/is_damaged() - return 1 - -/obj/item/organ/external/stump/is_bruised() - return 1 - -/obj/item/organ/external/stump/is_broken() - return 1 +/obj/item/organ/external/stump/removed() + ..() + del(src) diff --git a/code/modules/organs/pain.dm b/code/modules/organs/pain.dm index e500125a2c..31cb0c4e43 100644 --- a/code/modules/organs/pain.dm +++ b/code/modules/organs/pain.dm @@ -89,7 +89,6 @@ mob/living/carbon/human/proc/handle_pain() var/maxdam = 0 var/obj/item/organ/external/damaged_organ = null for(var/obj/item/organ/external/E in organs) - // amputated limbs don't cause pain if(E.status & ORGAN_DEAD) continue var/dam = E.get_damage() // make the choice of the organ depend on damage, From 8f242740a8f1de8b75830a074d51f97c3c18c234 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Fri, 27 Mar 2015 23:24:16 +1030 Subject: [PATCH 09/11] Added Techhead's cyberlimbs under datum system. Added limbs to dionaea. Working on robotic limbs. --- baystation12.dme | 1 + code/datums/datacore.dm | 5 +- code/game/gamemodes/objective.dm | 4 +- code/game/mecha/mech_fabricator.dm | 16 +- code/game/objects/items/robot/robot_parts.dm | 38 ++- .../objects/items/weapons/melee/energy.dm | 2 + code/game/objects/items/weapons/twohanded.dm | 14 +- code/game/objects/structures/watercloset.dm | 2 +- code/modules/client/preferences.dm | 25 +- code/modules/client/preferences_savefile.dm | 3 + code/modules/mining/mine_items.dm | 2 + .../mob/living/carbon/alien/larva/larva.dm | 2 +- .../mob/living/carbon/human/examine.dm | 19 +- code/modules/mob/living/carbon/human/human.dm | 2 +- .../mob/living/carbon/human/human_defense.dm | 2 +- .../mob/living/carbon/human/human_organs.dm | 57 ++++- .../living/carbon/human/species/species.dm | 31 +-- .../carbon/human/species/station/station.dm | 17 +- .../mob/living/carbon/human/update_icons.dm | 8 +- code/modules/mob/living/carbon/shock.dm | 2 - code/modules/mob/mob.dm | 2 +- .../mob/new_player/preferences_setup.dm | 11 +- code/modules/organs/organ_alien.dm | 158 ++++++++++-- code/modules/organs/organ_external.dm | 235 ++++++++---------- code/modules/organs/organ_icon.dm | 68 ++--- code/modules/organs/organ_stump.dm | 3 + code/modules/organs/robolimbs.dm | 37 +++ .../reagents/reagent_containers/syringes.dm | 2 +- code/modules/surgery/bones.dm | 8 +- code/modules/surgery/brainrepair.dm | 2 + code/modules/surgery/encased.dm | 10 +- code/modules/surgery/generic.dm | 12 +- code/modules/surgery/headreattach.dm | 176 +------------ code/modules/surgery/implant.dm | 8 +- code/modules/surgery/organs_internal.dm | 11 +- code/modules/surgery/other.dm | 6 +- code/modules/surgery/robolimbs.dm | 158 ++---------- code/setup.dm | 33 +-- code/world.dm | 22 +- icons/mob/human_races/cyberlimbs/bishop.dmi | Bin 0 -> 950 bytes .../human_races/cyberlimbs/hesphaistos.dmi | Bin 0 -> 935 bytes icons/mob/human_races/cyberlimbs/xion.dmi | Bin 0 -> 901 bytes icons/mob/human_races/cyberlimbs/zenghu.dmi | Bin 0 -> 853 bytes icons/mob/human_races/r_diona.dmi | Bin 2907 -> 2719 bytes 44 files changed, 604 insertions(+), 610 deletions(-) create mode 100644 code/modules/organs/robolimbs.dm create mode 100644 icons/mob/human_races/cyberlimbs/bishop.dmi create mode 100644 icons/mob/human_races/cyberlimbs/hesphaistos.dmi create mode 100644 icons/mob/human_races/cyberlimbs/xion.dmi create mode 100644 icons/mob/human_races/cyberlimbs/zenghu.dmi diff --git a/baystation12.dme b/baystation12.dme index 1dec758ca8..98412bb048 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1274,6 +1274,7 @@ #include "code\modules\organs\organ_internal.dm" #include "code\modules\organs\organ_stump.dm" #include "code\modules\organs\pain.dm" +#include "code\modules\organs\robolimbs.dm" #include "code\modules\organs\wound.dm" #include "code\modules\overmap\_defines.dm" #include "code\modules\overmap\sectors.dm" diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index 8db17e447e..5fc86c420a 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -156,10 +156,7 @@ proc/get_id_photo(var/mob/living/carbon/human/H) preview_icon.Blend(temp, ICON_OVERLAY) for(var/obj/item/organ/external/E in H.organs) - temp = new /icon(icobase, "[E.name]") - if(E.status & ORGAN_ROBOT) - temp.MapColors(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0)) - preview_icon.Blend(temp, ICON_OVERLAY) + preview_icon.Blend(E.get_icon(), ICON_OVERLAY) //Tail if(H.species.tail) diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index d83c6d2005..42c7cad925 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -458,7 +458,9 @@ datum/objective/harm for(var/obj/item/organ/external/E in H.organs) if(E.status & ORGAN_BROKEN) return 1 - for(var/limb_type in H.species.has_limbs) //todo check prefs for robotic limbs and amputations. + for(var/limb_tag in H.species.has_limbs) //todo check prefs for robotic limbs and amputations. + var/list/organ_data = H.species.has_limbs[limb_tag] + var/limb_type = organ_data["path"] var/found for(var/obj/item/organ/external/E in H.organs) if(limb_type == E.type) diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm index 87b8375bbb..f000499ffd 100644 --- a/code/game/mecha/mech_fabricator.dm +++ b/code/game/mecha/mech_fabricator.dm @@ -13,6 +13,7 @@ idle_power_usage = 20 active_power_usage = 5000 req_access = list(access_robotics) + var/current_manufacturer var/time_coeff = 1.5 //can be upgraded with research var/resource_coeff = 1.5 //can be upgraded with research var/list/resources = list( @@ -143,6 +144,7 @@ /obj/machinery/mecha_part_fabricator/New() ..() + component_parts = list() component_parts += new /obj/item/weapon/circuitboard/mechfab(src) component_parts += new /obj/item/weapon/stock_parts/matter_bin(src) @@ -165,6 +167,9 @@ */ return +/obj/machinery/mecha_part_fabricator/initialize() + current_manufacturer = basic_robolimb.company + /obj/machinery/mecha_part_fabricator/RefreshParts() var/T = 0 for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts) @@ -361,7 +366,11 @@ if( !(locate(part, src.contents)) || !(part.vars.Find("construction_time")) || !(part.vars.Find("construction_cost")) ) // these 3 are the current requirements for an object being buildable by the mech_fabricator return - src.being_built = new part.type(src) + if(current_manufacturer) + src.being_built = new part.type(src, current_manufacturer) + else + src.being_built = new part.type(src, basic_robolimb.company) + src.desc = "It's building [src.being_built]." src.remove_resources(part) src.overlays += "fab-active" @@ -562,7 +571,7 @@ switch(screen) if("main") left_part = output_available_resources()+"
" - left_part += "Sync with R&D servers
" + left_part += "Sync with R&D servers | Set manufacturer ([current_manufacturer])
" for(var/part_set in part_sets) left_part += "[part_set] - \[Add all parts to queue\]
" if("parts") @@ -623,6 +632,9 @@ return var/datum/topic_input/filter = new /datum/topic_input(href,href_list) + if(href_list["set_manufacturer"]) + var/choice = input(usr, "Which manufacturer do you wish to use for this fabricator?") as null|anything in all_robolimbs + if(choice) current_manufacturer = choice if(href_list["part_set"]) var/tpart_set = filter.getStr("part_set") if(tpart_set) diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index cfd50c37d5..4e6bc7d69d 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -7,43 +7,65 @@ slot_flags = SLOT_BELT var/construction_time = 100 var/list/construction_cost = list("metal"=20000,"glass"=5000) - var/list/part = null + var/list/part = null // Order of args is important for installing robolimbs. var/sabotaged = 0 //Emagging limbs can have repercussions when installed as prosthetics. + var/model_info + dir = SOUTH + +/obj/item/robot_parts/set_dir() + return + +/obj/item/robot_parts/New(var/newloc, var/model) + ..(newloc) + if(model_info && model) + model_info = model + var/datum/robolimb/R = all_robolimbs[model] + if(R) + name = "[R.company] [initial(name)]" + desc = "[R.desc]" + if(icon_state in icon_states(R.icon)) + icon = R.icon + else + name = "robot [initial(name)]" /obj/item/robot_parts/l_arm - name = "robot left arm" + name = "left arm" desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case." icon_state = "l_arm" construction_time = 200 construction_cost = list("metal"=18000) part = list("l_arm","l_hand") + model_info = 1 /obj/item/robot_parts/r_arm - name = "robot right arm" + name = "right arm" desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case." icon_state = "r_arm" construction_time = 200 construction_cost = list("metal"=18000) part = list("r_arm","r_hand") + model_info = 1 /obj/item/robot_parts/l_leg - name = "robot left leg" + name = "left leg" desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case." icon_state = "l_leg" construction_time = 200 construction_cost = list("metal"=15000) part = list("l_leg","l_foot") + model_info = 1 /obj/item/robot_parts/r_leg - name = "robot right leg" + name = "right leg" desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case." icon_state = "r_leg" construction_time = 200 construction_cost = list("metal"=15000) part = list("r_leg","r_foot") + model_info = 1 /obj/item/robot_parts/chest - name = "robot torso" + name = "torso" desc = "A heavily reinforced case containing cyborg logic boards, with space for a standard power cell." icon_state = "chest" construction_time = 350 @@ -52,7 +74,7 @@ var/obj/item/weapon/cell/cell = null /obj/item/robot_parts/head - name = "robot head" + name = "head" desc = "A standard reinforced braincase, with spine-plugged neural socket and sensor gimbals." icon_state = "head" construction_time = 350 @@ -61,7 +83,7 @@ var/obj/item/device/flash/flash2 = null /obj/item/robot_parts/robot_suit - name = "robot endoskeleton" + name = "endoskeleton" desc = "A complex metal backbone with standard limb sockets and pseudomuscle anchors." icon_state = "robo_suit" construction_time = 500 diff --git a/code/game/objects/items/weapons/melee/energy.dm b/code/game/objects/items/weapons/melee/energy.dm index f04c3452a9..f04be5d33a 100644 --- a/code/game/objects/items/weapons/melee/energy.dm +++ b/code/game/objects/items/weapons/melee/energy.dm @@ -111,6 +111,8 @@ w_class = 2 flags = NOSHIELD | NOBLOODY origin_tech = "magnets=3;syndicate=4" + sharp = 1 + edge = 1 /obj/item/weapon/melee/energy/sword/dropped(var/mob/user) ..() diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm index 00e8fe925d..bce7eabe9d 100644 --- a/code/game/objects/items/weapons/twohanded.dm +++ b/code/game/objects/items/weapons/twohanded.dm @@ -128,12 +128,12 @@ base_icon = "fireaxe" name = "fire axe" desc = "Truly, the weapon of a madman. Who would think to fight fire with an axe?" - force = 10 + force = 15 sharp = 1 edge = 1 w_class = 4.0 slot_flags = SLOT_BACK - force_wielded = 40 + force_wielded = 30 attack_verb = list("attacked", "chopped", "cleaved", "torn", "cut") /obj/item/weapon/twohanded/fireaxe/afterattack(atom/A as mob|obj|turf|area, mob/user as mob, proximity) @@ -198,7 +198,7 @@ base_icon = "spearglass" name = "spear" desc = "A haphazardly-constructed yet still deadly weapon of ancient design." - force = 14 + force = 10 w_class = 4.0 slot_flags = SLOT_BACK force_wielded = 22 // Was 13, Buffed - RR @@ -219,13 +219,13 @@ sharp = 0 edge = 0 w_class = 3 - force = 15 + force = 10 throw_speed = 3 throw_range = 7 throwforce = 7 attack_verb = list("smashed", "beaten", "slammed", "smacked", "struck", "battered", "bonked") hitsound = 'sound/weapons/genhit3.ogg' - force_wielded = 23 + force_wielded = 20 /obj/item/weapon/twohanded/baseballbat/metal name = "metal bat" @@ -233,6 +233,6 @@ icon_state = "metalbat0" base_icon = "metalbat" item_state = "metalbat" - force = 18 + force = 15 w_class = 3.0 - force_wielded = 27 \ No newline at end of file + force_wielded = 25 \ No newline at end of file diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 5aa52bb73f..62f3ef60c1 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -350,7 +350,7 @@ var/mob/living/carbon/human/H = user var/obj/item/organ/external/temp = H.organs_by_name["r_hand"] if (user.hand) - temp = user:organs_by_name["l_hand"] + temp = H.organs_by_name["l_hand"] if(temp && !temp.is_usable()) user << "You try to move your [temp.name], but cannot!" return diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index ae3efc0e71..55c31eaa15 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -111,6 +111,7 @@ datum/preferences // maps each organ to either null(intact), "cyborg" or "amputated" // will probably not be able to do this for head and torso ;) var/list/organ_data = list() + var/list/rlimb_data = list() var/list/player_alt_titles = new() // the default name of a job like "Medical Doctor" var/list/flavor_texts = list() @@ -344,7 +345,12 @@ datum/preferences ++ind if(ind > 1) dat += ", " - dat += "\tMechanical [organ_name] prothesis" + var/datum/robolimb/R + if(rlimb_data[name] && all_robolimbs[rlimb_data[name]]) + R = all_robolimbs[rlimb_data[name]] + else + R = basic_robolimb + dat += "\t[R.company] [organ_name] prothesis" else if(status == "amputated") ++ind if(ind > 1) @@ -629,6 +635,8 @@ datum/preferences dat += "
Has a plantlike physiology." if(current_species.flags & IS_SYNTHETIC) dat += "
Is machine-based." + if(current_species.flags & REGENERATES_LIMBS) + dat += "
Has a plantlike physiology." dat += "" dat += "" dat += "

" @@ -1449,15 +1457,25 @@ datum/preferences switch(new_state) if("Normal") organ_data[limb] = null + rlimb_data[limb] = null if(third_limb) organ_data[third_limb] = null + rlimb_data[third_limb] = null if("Amputated") organ_data[limb] = "amputated" + rlimb_data[limb] = null if(second_limb) organ_data[second_limb] = "amputated" + rlimb_data[second_limb] = null + if("Prothesis") + var/choice = input(user, "Which manufacturer do you wish to use for this limb?") as null|anything in chargen_robolimbs + if(!choice) + return + rlimb_data[limb] = choice organ_data[limb] = "cyborg" if(second_limb) + organ_data[second_limb] = choice organ_data[second_limb] = "cyborg" if(third_limb && organ_data[third_limb] == "amputated") organ_data[third_limb] = null @@ -1701,7 +1719,10 @@ datum/preferences character.organs -= child else if(status == "cyborg") - O.status |= ORGAN_ROBOT + if(rlimb_data[name]) + O.robotize(rlimb_data[name]) + else + O.robotize() else var/obj/item/organ/I = character.internal_organs_by_name[name] if(I) diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 76b25c9659..547a67e6ac 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -170,6 +170,7 @@ S["skills"] >> skills S["skill_specialization"] >> skill_specialization S["organ_data"] >> organ_data + S["rlimb_data"] >> rlimb_data S["gear"] >> gear S["home_system"] >> home_system S["citizenship"] >> citizenship @@ -240,6 +241,7 @@ if(isnull(disabilities)) disabilities = 0 if(!player_alt_titles) player_alt_titles = new() if(!organ_data) src.organ_data = list() + if(!rlimb_data) src.rlimb_data = list() if(!gear) src.gear = list() //if(!skin_style) skin_style = "Default" @@ -324,6 +326,7 @@ S["skills"] << skills S["skill_specialization"] << skill_specialization S["organ_data"] << organ_data + S["rlimb_data"] << rlimb_data S["gear"] << gear S["home_system"] << home_system S["citizenship"] << citizenship diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm index a3b601ebce..698815d0a9 100644 --- a/code/modules/mining/mine_items.dm +++ b/code/modules/mining/mine_items.dm @@ -118,6 +118,8 @@ origin_tech = "materials=4;phorontech=3;engineering=3" desc = "A rock cutter that uses bursts of hot plasma. You could use it to cut limbs off of xenos! Or, you know, mine stuff." drill_verb = "cutting" + sharp = 1 + edge = 1 /obj/item/weapon/pickaxe/diamond name = "diamond pickaxe" diff --git a/code/modules/mob/living/carbon/alien/larva/larva.dm b/code/modules/mob/living/carbon/alien/larva/larva.dm index 5cdb3a2ddb..548eee230b 100644 --- a/code/modules/mob/living/carbon/alien/larva/larva.dm +++ b/code/modules/mob/living/carbon/alien/larva/larva.dm @@ -11,4 +11,4 @@ /mob/living/carbon/alien/larva/New() ..() add_language("Xenomorph") //Bonus language. - internal_organs += new /obj/item/organ/xenos/hivenode(src) \ No newline at end of file + internal_organs |= new /obj/item/organ/xenos/hivenode(src) \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 318fc37343..965870f97e 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -251,12 +251,23 @@ var/list/wound_flavor_text = list() var/list/is_destroyed = list() var/list/is_bleeding = list() + + for(var/organ_tag in species.has_limbs) + + var/list/organ_data = species.has_limbs[organ_tag] + var/organ_descriptor = organ_data["descriptor"] + is_destroyed["[organ_data["descriptor"]]"] = 1 + + var/obj/item/organ/external/E = organs_by_name[organ_tag] + if(!E) + wound_flavor_text["[organ_descriptor]"] = "[t_He] is missing [t_his] [organ_descriptor].\n" + else if(E.is_stump()) + wound_flavor_text["[organ_descriptor]"] = "[t_He] has a stump where [t_his] [organ_descriptor] should be.\n" + else + continue + for(var/obj/item/organ/external/temp in organs) if(temp) - if(temp.status & ORGAN_DESTROYED) - is_destroyed["[temp.name]"] = 1 - wound_flavor_text["[temp.name]"] = "[t_He] is missing [t_his] [temp.name].\n" - continue if(temp.status & ORGAN_ROBOT) if(!(temp.brute_dam + temp.burn_dam)) if(!species.flags & IS_SYNTHETIC) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 5dcea4ef40..a934629420 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1337,7 +1337,7 @@ var/list/limbs = list() for(var/limb in organs_by_name) var/obj/item/organ/external/current_limb = organs_by_name[limb] - if(current_limb.dislocated == 2) + if(current_limb && current_limb.dislocated == 2) limbs |= limb var/choice = input(src,"Which joint do you wish to relocate?") as null|anything in limbs diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index bfc7756e4f..300b7ce184 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -194,7 +194,7 @@ emp_act var/obj/item/organ/external/affecting = get_organ(target_zone) - if (!affecting || affecting.status & ORGAN_DESTROYED || istype(affecting, /obj/item/organ/external/stump)) + if (!affecting || (affecting.status & ORGAN_DESTROYED) || affecting.is_stump()) user << "They are missing that limb!" return diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index 4ce8e62f17..3c0f9e011c 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -21,14 +21,14 @@ if(force_process) bad_external_organs.Cut() for(var/obj/item/organ/external/Ex in organs) - bad_external_organs += Ex + bad_external_organs |= Ex //processing internal organs is pretty cheap, do that first. for(var/obj/item/organ/I in internal_organs) I.process() - //losing a limb stops it from processing, so this has to be done separately handle_stance() + handle_grasp() if(!force_process && !bad_external_organs.len) return @@ -68,20 +68,21 @@ if (istype(buckled, /obj/structure/bed)) return - for (var/organ in list("l_leg","l_foot","r_leg","r_foot")) - var/obj/item/organ/external/E = organs_by_name[organ] - if(E) - 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 + for(var/limb_tag in list("l_leg","r_leg","l_foot","r_foot")) + var/obj/item/organ/external/E = organs_by_name[limb_tag] + if(!E) + stance_damage += 2 + else 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)) + if (l_hand && istype(l_hand, /obj/item/weapon/cane)) stance_damage -= 2 - if (istype(l_hand, /obj/item/weapon/cane)) + if (r_hand && istype(r_hand, /obj/item/weapon/cane)) stance_damage -= 2 // standing is poor @@ -92,6 +93,40 @@ custom_emote(1, "collapses!") Weaken(5) //can't emote while weakened, apparently. +/mob/living/carbon/human/proc/handle_grasp() + + if(!l_hand && !r_hand) + return + + for (var/obj/item/organ/external/E in organs) + if(!E || !E.can_grasp || (E.status & ORGAN_SPLINTED)) + continue + + if(E.is_broken()) + if(E.body_part == HAND_LEFT) + u_equip(l_hand) + else + u_equip(r_hand) + + var/emote_scream = pick("screams in pain and ", "lets out a sharp cry and ", "cries out and ") + emote("me", 1, "[(species.flags & NO_PAIN) ? "" : emote_scream ]drops what they were holding in their [E.name]!") + + else if(E.is_malfunctioning()) + + if(E.body_part == HAND_LEFT) + u_equip(l_hand) + else + u_equip(r_hand) + + emote("me", 1, "drops what they were holding, their [E.name] malfunctioning!") + + var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread() + spark_system.set_up(5, 0, src) + spark_system.attach(src) + spark_system.start() + spawn(10) + del(spark_system) + //Handles chem traces /mob/living/carbon/human/proc/handle_trace_chems() //New are added for reagents to random organs. diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 949063fd70..f6b2ebc73f 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -117,17 +117,17 @@ ) var/list/has_limbs = list( - /obj/item/organ/external/chest, - /obj/item/organ/external/groin, - /obj/item/organ/external/head, - /obj/item/organ/external/arm, - /obj/item/organ/external/arm/right, - /obj/item/organ/external/leg, - /obj/item/organ/external/leg/right, - /obj/item/organ/external/hand, - /obj/item/organ/external/hand/right, - /obj/item/organ/external/foot, - /obj/item/organ/external/foot/right + "chest" = list("path" = /obj/item/organ/external/chest), + "groin" = list("path" = /obj/item/organ/external/groin), + "head" = list("path" = /obj/item/organ/external/head), + "l_arm" = list("path" = /obj/item/organ/external/arm), + "r_arm" = list("path" = /obj/item/organ/external/arm/right), + "l_leg" = list("path" = /obj/item/organ/external/leg), + "r_leg" = list("path" = /obj/item/organ/external/leg/right), + "l_hand" = list("path" = /obj/item/organ/external/hand), + "r_hand" = list("path" = /obj/item/organ/external/hand/right), + "l_foot" = list("path" = /obj/item/organ/external/foot), + "r_foot" = list("path" = /obj/item/organ/external/foot/right) ) /datum/species/New() @@ -182,14 +182,17 @@ H.internal_organs_by_name = list() for(var/limb_type in has_limbs) - new limb_type(H) + var/list/organ_data = has_limbs[limb_type] + var/limb_path = organ_data["path"] + var/obj/item/organ/O = new limb_path(H) + organ_data["descriptor"] = O.name for(var/organ in has_organ) var/organ_type = has_organ[organ] H.internal_organs_by_name[organ] = new organ_type(H,1) for(var/name in H.organs_by_name) - H.organs += H.organs_by_name[name] + H.organs |= H.organs_by_name[name] for(var/obj/item/organ/external/O in H.organs) O.owner = H @@ -197,7 +200,7 @@ if(flags & IS_SYNTHETIC) for(var/obj/item/organ/external/E in H.organs) if(E.status & ORGAN_CUT_AWAY || E.status & ORGAN_DESTROYED) continue - E.status |= ORGAN_ROBOT + E.robotize() for(var/obj/item/organ/I in H.internal_organs) I.robotize() diff --git a/code/modules/mob/living/carbon/human/species/station/station.dm b/code/modules/mob/living/carbon/human/species/station/station.dm index e4f5e75c41..62907752aa 100644 --- a/code/modules/mob/living/carbon/human/species/station/station.dm +++ b/code/modules/mob/living/carbon/human/species/station/station.dm @@ -135,6 +135,7 @@ rarity_value = 3 hud_type = /datum/hud_data/diona siemens_coefficient = 0.3 + eyes = "blank_eyes" blurb = "Commonly referred to (erroneously) as 'plant people', the Dionaea are a strange space-dwelling collective \ species hailing from Epsilon Ursae Minoris. Each 'diona' is a cluster of numerous cat-sized organisms called nymphs; \ @@ -153,6 +154,20 @@ "anchoring ligament" = /obj/item/organ/diona/ligament ) + has_limbs = list( + "chest" = list("path" = /obj/item/organ/external/diona/chest), + "groin" = list("path" = /obj/item/organ/external/diona/groin), + "head" = list("path" = /obj/item/organ/external/diona/head), + "l_arm" = list("path" = /obj/item/organ/external/diona/arm), + "r_arm" = list("path" = /obj/item/organ/external/diona/arm/right), + "l_leg" = list("path" = /obj/item/organ/external/diona/leg), + "r_leg" = list("path" = /obj/item/organ/external/diona/leg/right), + "l_hand" = list("path" = /obj/item/organ/external/diona/hand), + "r_hand" = list("path" = /obj/item/organ/external/diona/hand/right), + "l_foot" = list("path" = /obj/item/organ/external/diona/foot), + "r_foot" = list("path" = /obj/item/organ/external/diona/foot/right) + ) + warning_low_pressure = 50 hazard_low_pressure = -1 @@ -166,7 +181,7 @@ body_temperature = T0C + 15 //make the plant people have a bit lower body temperature, why not - flags = CAN_JOIN | IS_WHITELISTED | NO_BREATHE | NO_SCAN | IS_PLANT | NO_BLOOD | NO_PAIN | NO_SLIP | HAS_EYE_COLOR + flags = CAN_JOIN | IS_WHITELISTED | NO_BREATHE | NO_SCAN | IS_PLANT | NO_BLOOD | NO_PAIN | NO_SLIP | REGENERATES_LIMBS blood_color = "#004400" flesh_color = "#907E4A" diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 1fefc65085..71a87099a2 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -183,6 +183,8 @@ var/global/list/damage_icon_parts = list() var/damage_appearance = "" for(var/obj/item/organ/external/O in organs) + if(O.is_stump()) + continue if(O.status & ORGAN_DESTROYED) damage_appearance += "d" else damage_appearance += O.damage_state @@ -199,6 +201,8 @@ var/global/list/damage_icon_parts = list() // blend the individual damage states with our icons for(var/obj/item/organ/external/O in organs) + if(O.is_stump()) + continue if(!(O.status & ORGAN_DESTROYED)) O.update_icon() if(O.damage_state == "00") continue @@ -241,10 +245,10 @@ var/global/list/damage_icon_parts = list() var/icon_key = "[species.race_key][g][s_tone]" for(var/obj/item/organ/external/part in organs) - if(part.status & ORGAN_DESTROYED) + if(part.is_stump() || (part.status & ORGAN_DESTROYED)) icon_key = "[icon_key]0" else if(part.status & ORGAN_ROBOT) - icon_key = "[icon_key]2" + icon_key = "[icon_key]2[part.model ? "-[part.model]": ""]" else if(part.status & ORGAN_DEAD) icon_key = "[icon_key]3" else diff --git a/code/modules/mob/living/carbon/shock.dm b/code/modules/mob/living/carbon/shock.dm index e0115d81ba..a83e76ef76 100644 --- a/code/modules/mob/living/carbon/shock.dm +++ b/code/modules/mob/living/carbon/shock.dm @@ -38,8 +38,6 @@ for(var/obj/item/organ/external/organ in M.organs) if (!organ) continue - if(istype(organ, /obj/item/organ/external/stump)) - src.traumatic_shock += 60 else if(organ.status & ORGAN_BROKEN || organ.open) src.traumatic_shock += 30 if(organ.status & ORGAN_SPLINTED) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 1129991cfe..1a42255272 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1104,7 +1104,7 @@ mob/proc/yank_out_object() else U << "You attempt to get a good grip on [selection] in [S]'s body." - if(!do_after(U, 80)) + if(!do_after(U, 30)) return if(!selection || !S || !U) return diff --git a/code/modules/mob/new_player/preferences_setup.dm b/code/modules/mob/new_player/preferences_setup.dm index d25b66210e..ea87e5984b 100644 --- a/code/modules/mob/new_player/preferences_setup.dm +++ b/code/modules/mob/new_player/preferences_setup.dm @@ -200,12 +200,13 @@ datum/preferences for(var/name in list("r_arm","r_hand","r_leg","r_foot","l_leg","l_foot","l_arm","l_hand")) if(organ_data[name] == "amputated") continue - - var/icon/temp = new /icon(icobase, "[name]") if(organ_data[name] == "cyborg") - temp.MapColors(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0)) - - preview_icon.Blend(temp, ICON_OVERLAY) + var/datum/robolimb/R + if(rlimb_data[name]) R = all_robolimbs[rlimb_data[name]] + if(!R) R = basic_robolimb + preview_icon.Blend(icon(R.icon, "[name]"), ICON_OVERLAY) // This doesn't check gendered_icon. Not an issue while only limbs can be robotic. + continue + preview_icon.Blend(new /icon(icobase, "[name]"), ICON_OVERLAY) //Tail if(current_species && (current_species.tail)) diff --git a/code/modules/organs/organ_alien.dm b/code/modules/organs/organ_alien.dm index e5f91c6b41..d326e2ade4 100644 --- a/code/modules/organs/organ_alien.dm +++ b/code/modules/organs/organ_alien.dm @@ -1,4 +1,143 @@ +/proc/spawn_diona_nymph_from_organ(var/obj/item/organ/organ) + if(!istype(organ)) + return + + //This is a terrible hack and I should be ashamed. + var/datum/seed/diona = plant_controller.seeds["diona"] + if(!diona) + 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(organ)) + diona.request_player(D) + del(organ) + +/obj/item/organ/external/diona + name = "tendril" + cannot_break = 1 + amputation_point = "branch" + joint = "structural ligament" + dislocated = -1 + +/obj/item/organ/external/diona/chest + name = "core trunk" + limb_name = "chest" + icon_name = "torso" + health = 200 + min_broken_damage = 50 + 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" + health = 100 + min_broken_damage = 50 + 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" + health = 35 + min_broken_damage = 20 + 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" + health = 35 + min_broken_damage = 20 + 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" + health = 20 + min_broken_damage = 10 + 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" + joint = "right ankle" + amputation_point = "right ankle" + +/obj/item/organ/external/diona/hand + name = "left grasper" + limb_name = "l_hand" + icon_name = "l_hand" + health = 30 + min_broken_damage = 15 + 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" + health = 50 + min_broken_damage = 25 + body_part = HEAD + parent_organ = "chest" + +/obj/item/organ/external/diona/head/removed() + if(owner) + owner.u_equip(owner.head) + owner.u_equip(owner.l_ear) + ..() + //DIONA ORGANS. +/obj/item/organ/external/diona/removed() + ..() + if(!istype(owner)) + del(src) + + if(!owner.organs.len) + owner.death() + + if(prob(50)) + spawn_diona_nymph_from_organ(src) + /obj/item/organ/diona/process() return @@ -32,25 +171,16 @@ icon_state = "nymph" organ_tag = "special" // Turns into a nymph instantly, no transplanting possible. -/obj/item/organ/diona/removed(var/mob/living/target,var/mob/living/user) +/obj/item/organ/diona/removed(var/mob/living/user) ..() - var/mob/living/carbon/human/H = target - if(!istype(target)) + if(!istype(owner)) del(src) - if(!H.internal_organs.len) - H.death() + if(!owner.internal_organs.len) + owner.death() - //This is a terrible hack and I should be ashamed. - var/datum/seed/diona = plant_controller.seeds["diona"] - if(!diona) - 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) + spawn_diona_nymph_from_organ(src) // These are different to the standard diona organs as they have a purpose in other // species (absorbing radiation and light respectively) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 7884a98a10..0bb6d89f31 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -7,6 +7,9 @@ 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 @@ -17,10 +20,11 @@ var/limb_name var/disfigured = 1 var/cannot_amputate - + var/cannot_break + var/s_tone + var/list/s_col 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 @@ -47,6 +51,8 @@ var/joint = "joint" // Descriptive string used in dislocation. var/amputation_point // Descriptive string used in amputation. var/dislocated = 0 // If you target a joint, you can dislocate the limb, causing temporary damage to the organ. + var/can_grasp + var/can_stand min_broken_damage = 30 max_damage = 0 @@ -90,6 +96,7 @@ dislocated = 2 else dislocated = 1 + owner.verbs |= /mob/living/carbon/human/proc/undislocate if(children && children.len) for(var/obj/item/organ/external/child in children) child.dislocate() @@ -111,15 +118,24 @@ /obj/item/organ/external/New(var/mob/living/carbon/holder, var/internal) ..() if(owner) - var/mob/living/carbon/human/H = owner - if(istype(H)) - H.organs_by_name[limb_name] = src - if(parent_organ) - parent = H.organs_by_name[src.parent_organ] - if(parent) - if(!parent.children) - parent.children = list() - parent.children.Add(src) + replaced(owner) + sync_colour_to_human(owner) + +/obj/item/organ/external/replaced(var/mob/living/carbon/human/target) + owner = target + 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) /**************************************************** DAMAGE PROCS @@ -193,32 +209,31 @@ burn = max(0, burn - can_inflict) //If there are still hurties to dispense if (burn || brute) - if (status & ORGAN_ROBOT) - droplimb() //Robot limbs just kinda fail at full damage. - else - owner.shock_stage += brute+burn + owner.shock_stage += brute+burn // sync the organ's damage with its wounds src.update_damages() - //If limb took enough damage, try to cut or tear it off - if(!cannot_amputate && config.limbs_can_break && (brute_dam + burn_dam) >= (max_damage * config.organ_health_multiplier)) - if((sharp || edge) && used_weapon) - if(istype(used_weapon,/obj/item)) - var/obj/item/W = used_weapon - if(W.w_class >= 3) droplimb() - return - if(brute >= 23 && prob(brute)) // Wooden baseball bat in both hands == 23 - droplimb(0,2) - return - if(burn >= 20) // Most laser rifle shots. - droplimb(0,1) - return - owner.updatehealth() - var/result = update_icon() - return result + + //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 + burn_dam) >= (max_damage * config.organ_health_multiplier)) + var/threshold = max_damage/3 + if((burn >= threshold) && prob(burn)) + droplimb(0,1) + return result + if(prob(brute)) + if(brute >= threshold) + if((sharp || edge) && used_weapon) + if(istype(used_weapon,/obj/item)) + var/obj/item/W = used_weapon + if(W.w_class >= 3) + droplimb() + return result + droplimb(0,2) + return result /obj/item/organ/external/proc/heal_damage(brute, burn, internal = 0, robo_repair = 0) if(status & ORGAN_ROBOT && !robo_repair) @@ -239,6 +254,11 @@ 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() @@ -445,7 +465,7 @@ Note that amputating the affected organ does in fact remove the infection from t var/list/candidate_organs = list() for (var/obj/item/organ/I in internal_organs) if (I.germ_level < germ_level) - candidate_organs += I + candidate_organs |= I if (candidate_organs.len) target_organ = pick(candidate_organs) @@ -626,6 +646,7 @@ Note that amputating the affected organ does in fact remove the infection from t "You hear the sickening splatter of gore.") src.removed(null, ignore_children) + owner.traumatic_shock += 60 wounds.Cut() if(parent) @@ -645,9 +666,11 @@ Note that amputating the affected organ does in fact remove the infection from t stump.update_damages() parent = null - update_health() - owner.update_body() - dir = SOUTH + spawn(1) + owner.update_body() + owner.updatehealth() + owner.UpdateDamageIcon() + dir = 2 switch(disintegrate) if(0) @@ -660,6 +683,7 @@ Note that amputating the affected organ does in fact remove the infection from t // Throw limb around. if(src && istype(loc,/turf)) throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),30) + dir = 2 return if(1) new /obj/effect/decal/cleanable/ash(get_turf(owner)) @@ -683,6 +707,9 @@ Note that amputating the affected organ does in fact remove the infection from t HELPERS ****************************************************/ +/obj/item/organ/external/proc/is_stump() + return 0 + /obj/item/organ/external/replaced() get_icon() icon = mob_icon @@ -739,7 +766,7 @@ Note that amputating the affected organ does in fact remove the infection from t /obj/item/organ/external/proc/fracture() - if(status & ORGAN_BROKEN) + if((status & ORGAN_BROKEN) || cannot_break) return owner.visible_message(\ @@ -786,8 +813,20 @@ Note that amputating the affected organ does in fact remove the infection from t status &= ~ORGAN_BROKEN return 1 -/obj/item/organ/external/robotize() +/obj/item/organ/external/robotize(var/company) ..() + + if(company) + model = company + var/datum/robolimb/R = all_robolimbs[company] + if(R) + force_icon = R.icon + name = "[R.company] [initial(name)]" + desc = "[R.desc]" + + dislocated = -1 + cannot_break = 1 + get_icon() for (var/obj/item/organ/external/T in children) if(T) T.robotize() @@ -813,28 +852,11 @@ Note that amputating the affected organ does in fact remove the infection from t return !(status & (ORGAN_DESTROYED|ORGAN_MUTATED|ORGAN_DEAD)) /obj/item/organ/external/proc/is_malfunctioning() - return ((status & ORGAN_ROBOT) && prob(brute_dam + burn_dam)) - -//for arms and hands -/obj/item/organ/external/proc/process_grasp(var/obj/item/c_hand, var/hand_name) - if (!c_hand) - return - - 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]!") - if(is_malfunctioning()) - owner.u_equip(c_hand) - owner.emote("me", 1, "drops what they were holding, their [hand_name] malfunctioning!") - var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread() - spark_system.set_up(5, 0, owner) - spark_system.attach(owner) - spark_system.start() - spawn(10) - del(spark_system) + 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(loc != owner) + return if(!silent) owner.visible_message("\The [W] sticks in the wound!") implants += W @@ -861,7 +883,8 @@ Note that amputating the affected organ does in fact remove the infection from t if(!ignore_children) for(var/obj/item/organ/external/O in children) O.removed() - O.loc = src + if(O) + O.loc = src // Grab all the internal giblets too. for(var/obj/item/organ/organ in internal_organs) @@ -887,6 +910,18 @@ Note that amputating the affected organ does in fact remove the infection from t del(spark_system) del(src) +/obj/item/organ/external/proc/disfigure(var/type = "brute") + if (disfigured) + return + if(type == "brute") + owner.visible_message("\red You hear a sickening cracking sound coming from \the [owner]'s [name].", \ + "\red Your [name] becomes a mangled mess!", \ + "\red You hear a sickening crack.") + else + owner.visible_message("\red \The [owner]'s [name] melts away, turning into mangled mess!", \ + "\red Your [name] melts away!", \ + "\red You hear a sickening sizzle.") + disfigured = 1 /**************************************************** ORGAN DEFINES @@ -896,7 +931,7 @@ Note that amputating the affected organ does in fact remove the infection from t name = "upper body" limb_name = "chest" icon_name = "torso" - health = 75 + health = 100 min_broken_damage = 35 body_part = UPPER_TORSO vital = 1 @@ -911,8 +946,8 @@ Note that amputating the affected organ does in fact remove the infection from t name = "lower body" limb_name = "groin" icon_name = "groin" - health = 50 - min_broken_damage = 20 + health = 100 + min_broken_damage = 35 body_part = LOWER_TORSO vital = 1 parent_organ = "chest" @@ -931,26 +966,16 @@ Note that amputating the affected organ does in fact remove the infection from t parent_organ = "chest" joint = "left elbow" amputation_point = "left shoulder" - -/obj/item/organ/external/arm/process() - ..() - if(owner) process_grasp(owner.l_hand, "left hand") + can_grasp = 1 /obj/item/organ/external/arm/right limb_name = "r_arm" name = "right arm" icon_name = "r_arm" - health = 50 - min_broken_damage = 30 body_part = ARM_RIGHT - parent_organ = "chest" joint = "right elbow" amputation_point = "right shoulder" -/obj/item/organ/external/arm/right/process() - ..() - if(owner) process_grasp(owner.r_hand, "right hand") - /obj/item/organ/external/leg limb_name = "l_leg" name = "left leg" @@ -962,6 +987,7 @@ Note that amputating the affected organ does in fact remove the infection from t parent_organ = "groin" joint = "left knee" amputation_point = "left hip" + can_stand = 1 /obj/item/organ/external/leg/right limb_name = "r_leg" @@ -969,7 +995,6 @@ Note that amputating the affected organ does in fact remove the infection from t icon_name = "r_leg" body_part = LEG_RIGHT icon_position = RIGHT - parent_organ = "groin" joint = "right knee" amputation_point = "right hip" @@ -984,6 +1009,7 @@ Note that amputating the affected organ does in fact remove the infection from t parent_organ = "l_leg" joint = "left ankle" amputation_point = "left ankle" + can_stand = 1 /obj/item/organ/external/foot/removed() if(owner) owner.u_equip(owner.shoes) @@ -1009,10 +1035,7 @@ Note that amputating the affected organ does in fact remove the infection from t parent_organ = "l_arm" joint = "left wrist" amputation_point = "left wrist" - -/obj/item/organ/external/hand/process() - ..() - if(owner) process_grasp(owner.l_hand, "left hand") + can_grasp = 1 /obj/item/organ/external/hand/removed() owner.u_equip(owner.gloves) @@ -1027,10 +1050,6 @@ Note that amputating the affected organ does in fact remove the infection from t joint = "right wrist" amputation_point = "right wrist" -/obj/item/organ/external/hand/right/process() - ..() - if(owner) process_grasp(owner.r_hand, "right hand") - /obj/item/organ/external/head limb_name = "head" icon_name = "head" @@ -1061,57 +1080,3 @@ Note that amputating the affected organ does in fact remove the infection from t disfigure("brute") if (burn_dam > 40) disfigure("burn") - -/obj/item/organ/external/proc/disfigure(var/type = "brute") - if (disfigured) - return - if(type == "brute") - owner.visible_message("\red You hear a sickening cracking sound coming from \the [owner]'s [name].", \ - "\red Your [name] becomes a mangled mess!", \ - "\red You hear a sickening crack.") - else - owner.visible_message("\red \The [owner]'s [name] melts away, turning into mangled mess!", \ - "\red Your [name] melts away!", \ - "\red You hear a sickening sizzle.") - disfigured = 1 - -// Prosthetics. -/obj/item/organ/external/leg/robot - status = ORGAN_ROBOT - dislocated = -1 - -/obj/item/organ/external/leg/right/robot - status = ORGAN_ROBOT - dislocated = -1 - -/obj/item/organ/external/foot/robot - status = ORGAN_ROBOT - dislocated = -1 - -/obj/item/organ/external/foot/right/robot - status = ORGAN_ROBOT - dislocated = -1 - -/obj/item/organ/external/arm/robot - status = ORGAN_ROBOT - dislocated = -1 - -/obj/item/organ/external/arm/right/robot - status = ORGAN_ROBOT - dislocated = -1 - -/obj/item/organ/external/hand/robot - status = ORGAN_ROBOT - dislocated = -1 - -/obj/item/organ/external/hand/right/robot - status = ORGAN_ROBOT - dislocated = -1 - -/obj/item/organ/external/head/robot - status = ORGAN_ROBOT - dislocated = -1 - -/obj/item/organ/external/chest/robot - status = ORGAN_ROBOT - dislocated = -1 diff --git a/code/modules/organs/organ_icon.dm b/code/modules/organs/organ_icon.dm index be11eec925..d5b6bf2a4e 100644 --- a/code/modules/organs/organ_icon.dm +++ b/code/modules/organs/organ_icon.dm @@ -13,41 +13,51 @@ var/global/list/limb_icon_cache = list() overlays += child.get_icon() overlays += organ.get_icon() +/obj/item/organ/external/proc/sync_colour_to_human(var/mob/living/carbon/human/human) + s_tone = null + s_col = null + if(human.s_tone && (human.species.flags & HAS_SKIN_TONE)) + s_tone = human.s_tone + if(human.species.flags & HAS_SKIN_COLOR) + s_col = list(human.r_skin, human.g_skin, human.b_skin) + /obj/item/organ/external/proc/get_icon(var/skeletal) - if(!owner) - mob_icon = new /icon('icons/mob/human_races/r_human.dmi', "[icon_name][gendered_icon ? "_f" : ""]") + var/gender + if(force_icon) + mob_icon = new /icon(force_icon, "[icon_name]") else - - var/gender - if(gendered_icon) - if(owner.gender == FEMALE) - gender = "f" - else - gender = "m" - - //TODO: cache these icons - if(skeletal) - mob_icon = new /icon('icons/mob/human_races/r_skeleton.dmi', "[icon_name][gender ? "_[gender]" : ""]") - else if ((status & ORGAN_ROBOT) && !(owner.species && owner.species.flags & IS_SYNTHETIC)) - mob_icon = new /icon('icons/mob/human_races/robotic.dmi', "[icon_name][gender ? "_[gender]" : ""]") + if(!owner) + mob_icon = new /icon('icons/mob/human_races/r_human.dmi', "[icon_name][gendered_icon ? "_f" : ""]") else - if (status & ORGAN_MUTATED) - mob_icon = new /icon(owner.species.deform, "[icon_name][gender ? "_[gender]" : ""]") - else - mob_icon = new /icon(owner.species.icobase, "[icon_name][gender ? "_[gender]" : ""]") - if(status & ORGAN_DEAD) - mob_icon.ColorTone(rgb(10,50,0)) - mob_icon.SetIntensity(0.7) - - if(owner.species.flags & HAS_SKIN_TONE) - if(owner.s_tone >= 0) - mob_icon.Blend(rgb(owner.s_tone, owner.s_tone, owner.s_tone), ICON_ADD) + if(gendered_icon) + if(owner.gender == FEMALE) + gender = "f" else - mob_icon.Blend(rgb(-owner.s_tone, -owner.s_tone, -owner.s_tone), ICON_SUBTRACT) - else if(owner.species.flags & HAS_SKIN_COLOR) - mob_icon.Blend(rgb(owner.r_skin, owner.g_skin, owner.b_skin), ICON_ADD) + gender = "m" + + if(skeletal) + mob_icon = new /icon('icons/mob/human_races/r_skeleton.dmi', "[icon_name][gender ? "_[gender]" : ""]") + else if ((status & ORGAN_ROBOT) && !(owner.species && owner.species.flags & IS_SYNTHETIC)) + mob_icon = new /icon('icons/mob/human_races/robotic.dmi', "[icon_name][gender ? "_[gender]" : ""]") + else + if (status & ORGAN_MUTATED) + mob_icon = new /icon(owner.species.deform, "[icon_name][gender ? "_[gender]" : ""]") + else + mob_icon = new /icon(owner.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 diff --git a/code/modules/organs/organ_stump.dm b/code/modules/organs/organ_stump.dm index caf8718269..c08363e10b 100644 --- a/code/modules/organs/organ_stump.dm +++ b/code/modules/organs/organ_stump.dm @@ -16,6 +16,9 @@ if(istype(limb)) max_damage = limb.max_damage +/obj/item/organ/external/stump/is_stump() + return 1 + /obj/item/organ/external/stump/removed() ..() del(src) diff --git a/code/modules/organs/robolimbs.dm b/code/modules/organs/robolimbs.dm new file mode 100644 index 0000000000..8d19d60b49 --- /dev/null +++ b/code/modules/organs/robolimbs.dm @@ -0,0 +1,37 @@ +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' diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index 2e68c80d98..1f964ba9b6 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -237,7 +237,7 @@ var/target_zone = ran_zone(check_zone(user.zone_sel.selecting, target)) var/obj/item/organ/external/affecting = target:get_organ(target_zone) - if (!affecting || affecting.status & ORGAN_DESTROYED || istype(affecting, /obj/item/organ/external/stump)) + if (!affecting || (affecting.status & ORGAN_DESTROYED) || affecting.is_stump()) user << "They are missing that limb!" return diff --git a/code/modules/surgery/bones.dm b/code/modules/surgery/bones.dm index cb7af6267b..b2ccbb1003 100644 --- a/code/modules/surgery/bones.dm +++ b/code/modules/surgery/bones.dm @@ -18,7 +18,7 @@ if (!hasorgans(target)) return 0 var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected.open >= 2 && affected.stage == 0 + return affected && affected.open >= 2 && affected.stage == 0 begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -52,7 +52,7 @@ if (!hasorgans(target)) return 0 var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected.name != "head" && affected.open >= 2 && affected.stage == 1 + return affected && affected.name != "head" && affected.open >= 2 && affected.stage == 1 begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -91,7 +91,7 @@ if (!hasorgans(target)) return 0 var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected.name == "head" && affected.open >= 2 && affected.stage == 1 + return affected && affected.name == "head" && affected.open >= 2 && affected.stage == 1 begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) user.visible_message("[user] is beginning to piece together [target]'s skull with \the [tool]." , \ @@ -127,7 +127,7 @@ if (!hasorgans(target)) return 0 var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected.open >= 2 && affected.stage == 2 + return affected && affected.open >= 2 && affected.stage == 2 begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) diff --git a/code/modules/surgery/brainrepair.dm b/code/modules/surgery/brainrepair.dm index 626866a2c5..60fdffe31d 100644 --- a/code/modules/surgery/brainrepair.dm +++ b/code/modules/surgery/brainrepair.dm @@ -15,6 +15,7 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) + if(!affected) return var/obj/item/organ/brain/sponge = target.internal_organs_by_name["brain"] return (sponge && sponge.damage > 0 && sponge.damage <= 20) && affected.open == 3 @@ -47,6 +48,7 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) + if(!affected) return var/obj/item/organ/brain/sponge = target.internal_organs_by_name["brain"] return (sponge && sponge.damage > 20) && affected.open == 3 diff --git a/code/modules/surgery/encased.dm b/code/modules/surgery/encased.dm index 1d5597a7c3..fedf5bbc1c 100644 --- a/code/modules/surgery/encased.dm +++ b/code/modules/surgery/encased.dm @@ -12,7 +12,7 @@ return 0 var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected.encased && affected.open >= 2 + return affected && affected.encased && affected.open >= 2 /datum/surgery_step/open_encased/saw @@ -28,7 +28,7 @@ if (!hasorgans(target)) return var/obj/item/organ/external/affected = target.get_organ(target_zone) - return ..() && affected.open == 2 + return ..() && affected && affected.open == 2 begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -77,7 +77,7 @@ if (!hasorgans(target)) return var/obj/item/organ/external/affected = target.get_organ(target_zone) - return ..() && affected.open == 2.5 + return ..() && affected && affected.open == 2.5 begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -134,7 +134,7 @@ if (!hasorgans(target)) return var/obj/item/organ/external/affected = target.get_organ(target_zone) - return ..() && affected.open == 3 + return ..() && affected && affected.open == 3 begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -191,7 +191,7 @@ if (!hasorgans(target)) return var/obj/item/organ/external/affected = target.get_organ(target_zone) - return ..() && affected.open == 2.5 + return ..() && affected && affected.open == 2.5 begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) diff --git a/code/modules/surgery/generic.dm b/code/modules/surgery/generic.dm index d8057fa26b..ca4a7dafe4 100644 --- a/code/modules/surgery/generic.dm +++ b/code/modules/surgery/generic.dm @@ -37,7 +37,7 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected.open == 0 && target_zone != "mouth" + return affected && affected.open == 0 && target_zone != "mouth" begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -78,7 +78,7 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected.open == 0 && target_zone != "mouth" + return affected && affected.open == 0 && target_zone != "mouth" begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -120,7 +120,7 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected.open == 0 && target_zone != "mouth" + return affected && affected.open == 0 && target_zone != "mouth" begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -159,7 +159,7 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected.open && (affected.status & ORGAN_BLEEDING) + return affected && affected.open && (affected.status & ORGAN_BLEEDING) begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -194,7 +194,7 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected.open == 1 //&& !(affected.status & ORGAN_BLEEDING) + return affected && affected.open == 1 //&& !(affected.status & ORGAN_BLEEDING) begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -250,7 +250,7 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected.open && target_zone != "mouth" + return affected && affected.open && target_zone != "mouth" begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) diff --git a/code/modules/surgery/headreattach.dm b/code/modules/surgery/headreattach.dm index 0039ed6a55..9957ee8b78 100644 --- a/code/modules/surgery/headreattach.dm +++ b/code/modules/surgery/headreattach.dm @@ -1,159 +1,5 @@ //This is an uguu head restoration surgery TOTALLY not yoinked from chinsky's limb reattacher - - -/datum/surgery_step/head/ - can_infect = 0 - can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - if (!hasorgans(target)) - return 0 - var/obj/item/organ/external/affected = target.get_organ(target_zone) - if (!affected) - return 0 - if (!(affected.status & ORGAN_DESTROYED)) - return 0 - if (affected.parent) - if (affected.parent.status & ORGAN_DESTROYED) - return 0 - return affected.name == "head" - - -/datum/surgery_step/head/peel - allowed_tools = list( - /obj/item/weapon/retractor = 100, \ - /obj/item/weapon/crowbar = 75, \ - /obj/item/weapon/kitchen/utensil/fork = 50, \ - ) - - min_duration = 80 - max_duration = 100 - - can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - if(..()) - var/obj/item/organ/external/affected = target.get_organ(target_zone) - return !(affected.status & ORGAN_CUT_AWAY) - - begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - user.visible_message("[user] starts peeling back tattered flesh where [target]'s head used to be with \the [tool].", \ - "You start peeling back tattered flesh where [target]'s head used to be with \the [tool].") - ..() - - end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\blue [user] peels back tattered flesh where [target]'s head used to be with \the [tool].", \ - "\blue You peel back tattered flesh where [target]'s head used to be with \the [tool].") - affected.status |= ORGAN_CUT_AWAY - - fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/obj/item/organ/external/affected = target.get_organ(target_zone) - if (affected.parent) - affected = affected.parent - user.visible_message("\red [user]'s hand slips, ripping [target]'s [affected.name] open!", \ - "\red Your hand slips, ripping [target]'s [affected.name] open!") - affected.createwound(CUT, 10) - - -/datum/surgery_step/head/shape - allowed_tools = list( - /obj/item/weapon/FixOVein = 100, \ - /obj/item/stack/cable_coil = 75, \ - /obj/item/device/assembly/mousetrap = 10) //ok chinsky - - min_duration = 80 - max_duration = 100 - - can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - if(..()) - var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected.status & ORGAN_CUT_AWAY && target.op_stage.head_reattach == 0 && !(affected.status & ORGAN_ATTACHABLE) - - begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("[user] is beginning to reshape [target]'s esophagal and vocal region with \the [tool].", \ - "You start to reshape [target]'s [affected.name] esophagal and vocal region with \the [tool].") - ..() - - end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - user.visible_message("\blue [user] has finished repositioning flesh and tissue to something anatomically recognizable where [target]'s head used to be with \the [tool].", \ - "\blue You have finished repositioning flesh and tissue to something anatomically recognizable where [target]'s head used to be with \the [tool].") - target.op_stage.head_reattach = 1 - - fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/obj/item/organ/external/affected = target.get_organ(target_zone) - if (affected.parent) - affected = affected.parent - user.visible_message("\red [user]'s hand slips, further rending flesh on [target]'s neck!", \ - "\red Your hand slips, further rending flesh on [target]'s neck!") - target.apply_damage(10, BRUTE, affected) - -/datum/surgery_step/head/suture - allowed_tools = list( - /obj/item/weapon/hemostat = 100, \ - /obj/item/stack/cable_coil = 60, \ - /obj/item/weapon/FixOVein = 80) - - min_duration = 80 - max_duration = 100 - - can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - if(..()) - return target.op_stage.head_reattach == 1 - - begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - user.visible_message("[user] is stapling and suturing flesh into place in [target]'s esophagal and vocal region with \the [tool].", \ - "You start to staple and suture flesh into place in [target]'s esophagal and vocal region with \the [tool].") - ..() - - end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - user.visible_message("\blue [user] has finished stapling [target]'s neck into place with \the [tool].", \ - "\blue You have finished stapling [target]'s neck into place with \the [tool].") - target.op_stage.head_reattach = 2 - - fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/obj/item/organ/external/affected = target.get_organ(target_zone) - if (affected.parent) - affected = affected.parent - user.visible_message("\red [user]'s hand slips, ripping apart flesh on [target]'s neck!", \ - "\red Your hand slips, ripping apart flesh on [target]'s neck!") - target.apply_damage(10, BRUTE, affected) - -/datum/surgery_step/head/prepare - allowed_tools = list( - /obj/item/weapon/cautery = 100, \ - /obj/item/clothing/mask/smokable/cigarette = 75, \ - /obj/item/weapon/flame/lighter = 50, \ - /obj/item/weapon/weldingtool = 25 - ) - - min_duration = 60 - max_duration = 70 - - can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - if(..()) - return target.op_stage.head_reattach == 2 - - begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - user.visible_message("[user] starts adjusting area around [target]'s neck with \the [tool].", \ - "You start adjusting area around [target]'s neck with \the [tool].") - ..() - - end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\blue [user] has finished adjusting the area around [target]'s neck with \the [tool].", \ - "\blue You have finished adjusting the area around [target]'s neck with \the [tool].") - target.op_stage.head_reattach = 0 - affected.status |= ORGAN_ATTACHABLE - affected.open = 0 - - fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/obj/item/organ/external/affected = target.get_organ(target_zone) - if (affected.parent) - affected = affected.parent - user.visible_message("\red [user]'s hand slips, searing [target]'s neck!", \ - "\red Your hand slips, searing [target]'s [affected.name]!") - target.apply_damage(10, BURN, affected) - - -/datum/surgery_step/head/attach +/datum/surgery_step/attach_head/ allowed_tools = list(/obj/item/organ/external/head = 100) can_infect = 0 @@ -163,28 +9,24 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) var/obj/item/organ/external/head = target.get_organ(target_zone) - return head.status & ORGAN_ATTACHABLE + return !head && target_zone == "head" begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) user.visible_message("[user] starts attaching [tool] to [target]'s reshaped neck.", \ "You start attaching [tool] to [target]'s reshaped neck.") end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("\blue [user] has attached [target]'s head to the body.", \ "\blue You have attached [target]'s head to the body.") - affected.status = 0 + var/obj/item/organ/external/head = tool + head.loc = target + head.replaced(target) + head.status = 0 target.update_body() target.updatehealth() target.UpdateDamageIcon() - for(var/obj/item/organ/replacing_organ in tool) - replacing_organ.loc = get_turf(tool) - replacing_organ.replaced(target,affected) - del(replacing_organ) //Just in case. - del(tool) fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\red [user]'s hand slips, damaging connectors on [target]'s neck!", \ - "\red Your hand slips, damaging connectors on [target]'s neck!") - target.apply_damage(10, BRUTE, affected, sharp=1) + user.visible_message("\red [user]'s hand slips, damaging [target]'s neck!", \ + "\red Your hand slips, damaging [target]'s neck!") + target.apply_damage(10, BRUTE, null, sharp=1) diff --git a/code/modules/surgery/implant.dm b/code/modules/surgery/implant.dm index 61a70fde53..df394fcd43 100644 --- a/code/modules/surgery/implant.dm +++ b/code/modules/surgery/implant.dm @@ -10,7 +10,7 @@ if(!hasorgans(target)) return 0 var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected.open == (affected.encased ? 3 : 2) && !(affected.status & ORGAN_BLEEDING) + return affected && affected.open == (affected.encased ? 3 : 2) && !(affected.status & ORGAN_BLEEDING) proc/get_max_wclass(var/obj/item/organ/external/affected) switch (affected.name) @@ -45,7 +45,7 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) var/obj/item/organ/external/affected = target.get_organ(target_zone) - return !affected.cavity && !affected.hidden + return affected && !affected.cavity && !affected.hidden begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -81,7 +81,7 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected.cavity + return affected && affected.cavity begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -112,7 +112,7 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) var/obj/item/organ/external/affected = target.get_organ(target_zone) - return !istype(user,/mob/living/silicon/robot) && !affected.hidden && affected.cavity && tool.w_class <= get_max_wclass(affected) + return affected && !istype(user,/mob/living/silicon/robot) && !affected.hidden && affected.cavity && tool.w_class <= get_max_wclass(affected) begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) diff --git a/code/modules/surgery/organs_internal.dm b/code/modules/surgery/organs_internal.dm index 56dfcd4ae4..cbfea6912e 100644 --- a/code/modules/surgery/organs_internal.dm +++ b/code/modules/surgery/organs_internal.dm @@ -10,7 +10,7 @@ return 0 var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected.open == (affected.encased ? 3 : 2) + return affected && affected.open == (affected.encased ? 3 : 2) ////////////////////////////////////////////////////////////////// // ALIEN EMBRYO SURGERY // @@ -35,7 +35,7 @@ if (!hasorgans(target)) return var/obj/item/organ/external/affected = target.get_organ(target_zone) - return ..() && embryo && affected.open == 3 && target_zone == "chest" + return ..() && affected && embryo && affected.open == 3 && target_zone == "chest" begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/msg = "[user] starts to pull something out from [target]'s ribcage with \the [tool]." @@ -69,7 +69,8 @@ if (!hasorgans(target)) return 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) if(I.damage > 0) @@ -152,7 +153,7 @@ if (!hasorgans(target)) return 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) if(I.damage > 0 && I.robotic >= 2) @@ -327,7 +328,7 @@ var/obj/item/organ/O = tool var/obj/item/organ/external/affected = target.get_organ(target_zone) - + if(!affected) return var/organ_compatible var/organ_missing diff --git a/code/modules/surgery/other.dm b/code/modules/surgery/other.dm index 92b28b3fca..56418b70c8 100644 --- a/code/modules/surgery/other.dm +++ b/code/modules/surgery/other.dm @@ -21,7 +21,7 @@ return 0 var/obj/item/organ/external/affected = target.get_organ(target_zone) - + if(!affected) return var/internal_bleeding = 0 for(var/datum/wound/W in affected.wounds) if(W.internal) internal_bleeding = 1 @@ -75,7 +75,7 @@ var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected.open >= 2 && (affected.status & ORGAN_DEAD) + return affected && affected.open >= 2 && (affected.status & ORGAN_DEAD) begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -127,7 +127,7 @@ return 0 var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected.open == 3 && (affected.status & ORGAN_DEAD) + return affected && affected.open == 3 && (affected.status & ORGAN_DEAD) begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) diff --git a/code/modules/surgery/robolimbs.dm b/code/modules/surgery/robolimbs.dm index d4e5127bdc..5b524288f9 100644 --- a/code/modules/surgery/robolimbs.dm +++ b/code/modules/surgery/robolimbs.dm @@ -9,124 +9,10 @@ if (!hasorgans(target)) return 0 var/obj/item/organ/external/affected = target.get_organ(target_zone) - if (!affected) + if (affected) return 0 - if (!(affected.status & ORGAN_DESTROYED)) - return 0 - if (affected.parent) - if (affected.parent.status & ORGAN_DESTROYED) - return 0 - return affected.name != "head" - - -/datum/surgery_step/limb/cut - allowed_tools = list( - /obj/item/weapon/scalpel = 100, \ - /obj/item/weapon/kitchenknife = 75, \ - /obj/item/weapon/shard = 50, \ - ) - - min_duration = 80 - max_duration = 100 - - can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - if(..()) - var/obj/item/organ/external/affected = target.get_organ(target_zone) - return !(affected.status & ORGAN_CUT_AWAY) - - begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("[user] starts cutting away flesh where [target]'s [affected.name] used to be with \the [tool].", \ - "You start cutting away flesh where [target]'s [affected.name] used to be with \the [tool].") - ..() - - end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\blue [user] cuts away flesh where [target]'s [affected.name] used to be with \the [tool].", \ - "\blue You cut away flesh where [target]'s [affected.name] used to be with \the [tool].") - affected.status |= ORGAN_CUT_AWAY - - fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/obj/item/organ/external/affected = target.get_organ(target_zone) - if (affected.parent) - affected = affected.parent - user.visible_message("\red [user]'s hand slips, cutting [target]'s [affected.name] open!", \ - "\red Your hand slips, cutting [target]'s [affected.name] open!") - affected.createwound(CUT, 10) - - -/datum/surgery_step/limb/mend - allowed_tools = list( - /obj/item/weapon/retractor = 100, \ - /obj/item/weapon/crowbar = 75, \ - /obj/item/weapon/kitchen/utensil/fork = 50) - - min_duration = 80 - max_duration = 100 - - can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - if(..()) - var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected.status & ORGAN_CUT_AWAY && affected.open < 3 && !(affected.status & ORGAN_ATTACHABLE) - - begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("[user] is beginning to reposition flesh and nerve endings where where [target]'s [affected.name] used to be with [tool].", \ - "You start repositioning flesh and nerve endings where [target]'s [affected.name] used to be with [tool].") - ..() - - end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\blue [user] has finished repositioning flesh and nerve endings where [target]'s [affected.name] used to be with [tool].", \ - "\blue You have finished repositioning flesh and nerve endings where [target]'s [affected.name] used to be with [tool].") - affected.open = 3 - - fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/obj/item/organ/external/affected = target.get_organ(target_zone) - if (affected.parent) - affected = affected.parent - user.visible_message("\red [user]'s hand slips, tearing flesh on [target]'s [affected.name]!", \ - "\red Your hand slips, tearing flesh on [target]'s [affected.name]!") - target.apply_damage(10, BRUTE, affected, sharp=1) - - -/datum/surgery_step/limb/prepare - allowed_tools = list( - /obj/item/weapon/cautery = 100, \ - /obj/item/clothing/mask/smokable/cigarette = 75, \ - /obj/item/weapon/flame/lighter = 50, \ - /obj/item/weapon/weldingtool = 25 - ) - - min_duration = 60 - max_duration = 70 - - can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - if(..()) - var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected.open == 3 - - begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("[user] starts adjusting the area around [target]'s [affected.name] with \the [tool].", \ - "You start adjusting the area around [target]'s [affected.name] with \the [tool].") - ..() - - end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\blue [user] has finished adjusting the area around [target]'s [affected.name] with \the [tool].", \ - "\blue You have finished adjusting the area around [target]'s [affected.name] with \the [tool].") - affected.status |= ORGAN_ATTACHABLE - affected.open = 0 - - fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/obj/item/organ/external/affected = target.get_organ(target_zone) - if (affected.parent) - affected = affected.parent - user.visible_message("\red [user]'s hand slips, searing [target]'s [affected.name]!", \ - "\red Your hand slips, searing [target]'s [affected.name]!") - target.apply_damage(10, BURN, affected) - + var/list/organ_data = target.species.has_limbs["[target_zone]"] + return !isnull(organ_data) && !(target_zone in list("head","groin","chest")) /datum/surgery_step/limb/attach allowed_tools = list(/obj/item/robot_parts = 100) @@ -140,32 +26,34 @@ if (p.part) if (!(target_zone in p.part)) return 0 - var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected.status & ORGAN_ATTACHABLE + return isnull(target.get_organ(target_zone)) begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("[user] starts attaching \the [tool] where [target]'s [affected.name] used to be.", \ - "You start attaching \the [tool] where [target]'s [affected.name] used to be.") + user.visible_message("[user] starts attaching \the [tool] to [target].", \ + "You start attaching \the [tool] to [target].") end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/robot_parts/L = tool - var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\blue [user] has attached \the [tool] where [target]'s [affected.name] used to be.", \ - "\blue You have attached \the [tool] where [target]'s [affected.name] used to be.") - affected.germ_level = 0 - affected.robotize() - if(L.sabotaged) - affected.sabotaged = 1 - else - affected.sabotaged = 0 + user.visible_message("\blue [user] has attached \the [tool] to [target].", \ + "\blue You have attached \the [tool] to [target].") + + if(L.part) + for(var/part_name in L.part) + if(!isnull(target.get_organ(part_name))) continue + var/list/organ_data = target.species.has_limbs["[target_zone]"] + var/new_limb_type = organ_data["path"] + var/obj/item/organ/external/new_limb = new new_limb_type(target) + new_limb.robotize(L.model_info) + if(L.sabotaged) + new_limb.sabotaged = 1 + target.update_body() target.updatehealth() target.UpdateDamageIcon() + del(tool) fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/obj/item/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\red [user]'s hand slips, damaging connectors on [target]'s [affected.name]!", \ - "\red Your hand slips, damaging connectors on [target]'s [affected.name]!") - target.apply_damage(10, BRUTE, affected, sharp=1) + user.visible_message("\red [user]'s hand slips, damaging [target]'s flesh!", \ + "\red Your hand slips, damaging [target]'s flesh!") + target.apply_damage(10, BRUTE, null, sharp=1) diff --git a/code/setup.dm b/code/setup.dm index d0334a2c9e..e922ade4b8 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -618,22 +618,23 @@ var/list/be_special_flags = list( #define GETPULSE_TOOL 1 // More accurate. (med scanner, sleeper, etc.) // Species flags. -#define NO_BLOOD 1 // Vessel var is not filled with blood, cannot bleed out. -#define NO_BREATHE 2 // Cannot suffocate or take oxygen loss. -#define NO_SCAN 4 // Cannot be scanned in a DNA machine/genome-stolen. -#define NO_PAIN 8 // Cannot suffer halloss/recieves deceptive health indicator. -#define NO_SLIP 16 // Cannot fall over. -#define NO_POISON 32 // Cannot not suffer toxloss. -#define HAS_SKIN_TONE 64 // Skin tone selectable in chargen. (0-255) -#define HAS_SKIN_COLOR 128 // Skin colour selectable in chargen. (RGB) -#define HAS_LIPS 256 // Lips are drawn onto the mob icon. (lipstick) -#define HAS_UNDERWEAR 512 // Underwear is drawn onto the mob icon. -#define IS_PLANT 1024 // Is a treeperson. -#define IS_WHITELISTED 2048 // Must be whitelisted to play. -#define IS_SYNTHETIC 4096 // Is a machine race. -#define HAS_EYE_COLOR 8192 // Eye colour selectable in chargen. (RGB) -#define CAN_JOIN 16384 // Species is selectable in chargen. -#define IS_RESTRICTED 32768 // Is not a core/normally playable species. (castes, mutantraces) +#define NO_BLOOD 1 // Vessel var is not filled with blood, cannot bleed out. +#define NO_BREATHE 2 // Cannot suffocate or take oxygen loss. +#define NO_SCAN 4 // Cannot be scanned in a DNA machine/genome-stolen. +#define NO_PAIN 8 // Cannot suffer halloss/recieves deceptive health indicator. +#define NO_SLIP 16 // Cannot fall over. +#define NO_POISON 32 // Cannot not suffer toxloss. +#define HAS_SKIN_TONE 64 // Skin tone selectable in chargen. (0-255) +#define HAS_SKIN_COLOR 128 // Skin colour selectable in chargen. (RGB) +#define HAS_LIPS 256 // Lips are drawn onto the mob icon. (lipstick) +#define HAS_UNDERWEAR 512 // Underwear is drawn onto the mob icon. +#define IS_PLANT 1024 // Is a treeperson. +#define IS_WHITELISTED 2048 // Must be whitelisted to play. +#define IS_SYNTHETIC 4096 // Is a machine race. +#define HAS_EYE_COLOR 8192 // Eye colour selectable in chargen. (RGB) +#define CAN_JOIN 16384 // Species is selectable in chargen. +#define IS_RESTRICTED 32768 // Is not a core/normally playable species. (castes, mutantraces) +#define REGENERATES_LIMBS 65536 // Attempts to regenerate unamputated limbs. // Language flags. #define WHITELISTED 1 // Language is available if the speaker is whitelisted. diff --git a/code/world.dm b/code/world.dm index ae63acadb2..01c6b0d1c5 100644 --- a/code/world.dm +++ b/code/world.dm @@ -52,9 +52,7 @@ var/global/datum/global_init/init = new () sleep_offline = 1 - // Set up roundstart seed list. This is here because vendors were - // bugging out and not populating with the correct packet names - // due to this list not being instantiated. + // Set up roundstart seed list. plant_controller = new() //Create the asteroid Z-level. @@ -64,17 +62,16 @@ var/global/datum/global_init/init = new () // Create autolathe recipes, as above. populate_lathe_recipes() + // Create robolimbs for chargen. + populate_robolimb_list() + processScheduler = new master_controller = new /datum/controller/game_controller() spawn(1) - processScheduler.deferSetupFor(/datum/controller/process/ticker) processScheduler.setup() - master_controller.setup() - - spawn(3000) //so we aren't adding to the round-start lag if(config.ToRban) ToRban_autoupdate() @@ -85,17 +82,6 @@ var/global/datum/global_init/init = new () return -//world/Topic(href, href_list[]) -// world << "Received a Topic() call!" -// world << "[href]" -// for(var/a in href_list) -// world << "[a]" -// if(href_list["hello"]) -// world << "Hello world!" -// return "Hello world!" -// world << "End of Topic() call." -// ..() - var/world_topic_spam_protect_ip = "0.0.0.0" var/world_topic_spam_protect_time = world.timeofday diff --git a/icons/mob/human_races/cyberlimbs/bishop.dmi b/icons/mob/human_races/cyberlimbs/bishop.dmi new file mode 100644 index 0000000000000000000000000000000000000000..045c3a57249b655882152b59c2144fcae83e2a2c GIT binary patch literal 950 zcmV;n14;aeP)iFEu_#xGi!&v&s2HS)i!-e#F*g;&Hbkh(Axc$Id`4nk z3K518rK~7ECpDc2!-!E;6rYx#UqXao_>?Itxca$(0~r8N^=5k&r5nir00MSNL_t(| zobBArR^u=XhG9@~;pKG`&Eq~qS*0RRBBaKHG@ zdw;|g`Bu2>+y!=`Bs`QaL>2R`^-1d71-evR=sBXz21@zn`lR<4SMEK3+-3u%d~1EO z%YhAK~?$W1zsJ_Fo(c z3FVv7PtTzW&rc0PBKhs20RR91003~MR#Sjmkq2cwuoa?A2R1_@lY})=h6CFn<>A0~ zNO?H09p%|T>L&k$WSqKG{Jb6#8Nt*PX9MFj2R1NIeev^pNUIGL9bY7{0eLxI5mJ1n znPVhgyEzmB000000002^L!o~k>;KoY|7x53Qe^(I+CJ3(k7c)4=--F>|FtH$HXCTG z(5G+Ky4Qo8NAcD>B=w!eTk)J-ddcQZdBt<~oReb%XeWPV-k z2F|aLV*_bk?FJ-yUZHutuMhwL00000Zp3b_dTvwu_h$cpas8Z6U6SJIkc(bYcgpoT zdjH<+|1Ynfd!ze)zTDT>U+Lf5{r|=Fb4vBUZ~nfcz6L!(CaeFyxW2sQ`YE?zpWlq1 z4Ac|EoJ}mQFYm@Fx8X3p8ynCQ)^`$dr4Cmz;KglV2 zf<2pPP#*vQ00000008_~Bzu0xQg&HCrck};tD#3&&&ub?b42TVQu|q%1fMT{Y0rK+ zYN+|Ge3`kp<+&OSV2+g_b z>5~i$OdXysjv*Cu-rl)b^h!abHSr|hgn-*Gf7`#!?3;V90R6gesd#d z#OVS3qTF&<*}49R?9Z@@8N1YHXc?cdNn_92x7Dt*_&ZCnh^^Af{@s~BpZ)su=m&>x zWVMB!_nUJco<+a*4y+Fk6-o}0i?fwHS5sWO`t>XCsHyJWlMJN;KArtKbxoa?R*_!S zu?4(;&Y52ie{$CF;Oq?P9WnRU_X&jW+iCaw%JuU5U3==D_E%*CodE;|+XI&~xN~lv zQ_Vh!t@MJsWEoe1NN3>dYv-L+R$l#**->Zlz~V_xPwlb!?0*FoEO}#*eEOHGiId!} z-A2~?n-FXsOFtq0TpPhyAKk@w2ig8z)1@5}eK zfA{NG+brGx{pcklZD-<#weDz~?Xe*e1Q+;)vG_dk3~DSjClb$^9(%ca7Z zhp(?tU-MKi_0+d~hNO9M-)8JuvSUW`v>&^kzj-ZUwa#Hi+_&j`hG)LLPe^%p;87G{d@npHQfcNSo5uR^@rQi87epa{(lFPY($pq)ei9A@caMW&)rw|<%`x; zGxxIW{(s+gf5hA0VGp;9U-SSoc&Ch+Y07gTe~DWM4f0^q_g literal 0 HcmV?d00001 diff --git a/icons/mob/human_races/cyberlimbs/xion.dmi b/icons/mob/human_races/cyberlimbs/xion.dmi new file mode 100644 index 0000000000000000000000000000000000000000..daf10298c217b113fa82934faed2049535e1d128 GIT binary patch literal 901 zcmV;01A6?4P)C^0t`#5P2z${|WsQG7;XUJ4P05v8msJ|{Ju2*Zd` zRTQ6=pI<_RVfd6OE4cc(fCCu-Q1xbe6{Q==00071NklVA?*n}s}q%LM=cAj9?VD~FUu8u?a#!{{zB>WyBdOzwNlP2E_SmT&bJDlXfqE*5oPaZ0|~UkMeTMgMj9 z?*q|%yT4fN#%lk4Ae?XZ7ptwWeo4BGYWY@w!P>)%`s3G7NF?9xFIGFPQ+NK}6#)PM z0001Xmo~jR$W$b21bU3J%xNRgL$qe==P{qW|FlDZ!!*7D{{j)swULm!siXBJ7^1FU z`WwjFojT~=<`Ot0Ec13pNX`*xD|~Gno2iRsRTmo}yKdkTxB%_Np%4H70000007#|{ zva^QU4>2N_jqW=^zT?B^J!F)| z6M{btb*59sACvMr7cEJ=?G?m--%4$qq7xV{6scX7Y7UxCwq2i8d( z8<6L{3jqKC0001-m^FO=|Cb2QWZx=aWLU%Z`u1*h(2nrT|KHzg_jMz~9KPS=qhFvG z;h6u|54m+07#Zf^v3`D88)!#3W}o%z)3^ft414rjjZ55(NQk#G93N6^K`$a9zMpaW zD{%hrfHi!-Nwqf6j&RKXYc=mejxz)R000000002s=XzGG|Ht^O1iM6Mh4tnlj{iwk zmd+!6-4}f&IuXX3uj5cQ#|E}CjIHDH?u)(>%?M|I000000001h6G|BHA1YzMf2@Q7 b|AT!4Teb}YG@i=o00000NkvXXu0mjfe9nyv literal 0 HcmV?d00001 diff --git a/icons/mob/human_races/cyberlimbs/zenghu.dmi b/icons/mob/human_races/cyberlimbs/zenghu.dmi new file mode 100644 index 0000000000000000000000000000000000000000..ca0cff0efa80a6c992b8b91f40f3c3c9aa8f40d0 GIT binary patch literal 853 zcmV-b1FHOqP)C^0t` z#5P2z${|WsQG7;XUJ4P05v8msJ|{Ju2*Zd`RTQ6=pI<_RVfd6OE4cc(fCCu-Q1xbe z6{Q==0006!Nkly&spTrJHBoObbvXeJ6inA-tTRTYr03ed>=wMtCo@x)ZgkyhcN>$OO7xi*A zeeQflbsBEq^`hR6OB8bdpk}Tr+Vs4hy-=4sU3kT9#0%N`*4uNYwhJLqU%LH zd!!~9|JF^Msh6l}30nMvcVbZ{k+J#g(=VN-*gx~v1vNFcUoZRqs)gU*8Vy$D z)_TtdpH2%Od^8%|(2RZ!l1%UG^lJbB00000hT`Xa-48Hzf0J0x`z?Ne2J;(D(@8z= zxA=i8@~P_Ipq}?z`~VFW{TuihU-tuT>V(*}nwS?EjXf8knZC94(*`T?mD(M-f#acK z)CS6rA|3S|DE~W*`viY~i2wiq0090Iv*v7-_RUU9I-8lY8#kwu8|OS-$aC@C>5o_3Tn< zuxy$lTP=w~W;FHUuFW#hAj`52h0JK`wR!*m00000{1*6@h}dEo3ZM7I{6Dw>u>-1O f7zVWiBTo2VQ2$8{jBy5600000NkvXXu0mjf8YX>( literal 0 HcmV?d00001 diff --git a/icons/mob/human_races/r_diona.dmi b/icons/mob/human_races/r_diona.dmi index 91757faf7ca9fc34f31e877d3e6fc4cf11c210aa..3215ea8908bf32ed70434a8172c544289312c3fc 100644 GIT binary patch delta 2679 zcmV--3W)XF7M~R*iBL{Q4GJ0x0000DNk~Le0002s0002s2m=5B04?*H(*OVfFp(uR z6{SQS*Z=?k0d!JMQvg8b*k%9#0JD*C6@S4BgD?yL&~y70Mek#7yY4cS;bHzlDHz)_ zHIjD9{(ib0WT)nqz)J#2a&@cjb)(8hEoY$Maa31zIUJ=}d>h@GoKI3X@Ycm&5~7K) zh8bx?LncM*DQrbjbYuqD;$l}lOObYFY#Gg1%o6&MF|!BD7|BtjJH*In#$pjEV1H6M zFzHp`dez>%wR?qU5>EuPhh=xgpUYL%l;2nR0FMiwqqPfSZ2$lXUP(kjRCt{2U5%34 zC=518K+&t5e@ zF^>I)aX1_fhr{7;I2;a#!++s$9Ex|}zS@gGc~;;?is)Ecdq??&S-uVR=M~K00jE&< zTfEDapgPOWSM@3;#W`%qxCJPpSmWZnaM3qMDAS&DP zdli6$XT!iT{tkm$6l{WONIs-&_23|Xhf%8^?2{Tp^7$Z@dFE!2zkfr8%CGXR3Wnrk z7ui3^-zjDL1S)OMzJHfzNg|3U-H1|3OrR~I~)#&!{Kl^91e%W;cz%!0P)?o z%vMF}y&zUZTK)jH3-9Vnd)pDOAv&8Iuy21~FNCY2yzWus4|7hXK|Ra`pro9)@t0TS zdgA{K{%(7GR*gSo`+o%f5K3eVJNQdkxt?EY{2c&kc*@e#iHR$e+OftTrc;vmLr4MX zaR-0d1iQYT_&<%mqXCv7ou%j0_7M^du~rj>Yy2TS7x+U+k;AiR{&It-j-e<14>kKj zMl3RqMFs|X(S#xJDIb>v{7rbknZFE8H&o?o%1_V{|EK6rvVWVMb5}pTWYaQ6{$9Ru z8id+U2>6e-e8#{e4d<+TDG1d+sfA4WasgBRD9FF;6=psl|3GGr$M+)*bpJ$%#9jtK;rL8$zpWgyEJIpieshhG}V90p_v zSxI#dJ+bU4jl#(MVKz^CRQc^5;xh`t3OL6oi{J(tH89E{ypXXY3qzIP9%F2vKEx&- z;#oMv5P5i!3UUPO*xY`$fhCD7CsmMGM~wx=D1QcF2hNg!Ng)|yM;FQ+NWaF8 zNL*chs)IoBLzuOrX31iyZT3ou@eb+K;f2LFux8UnR#Eezm^1@(f?+R8PEK@UDRzxe zMZQV$(jYmQCgtNy!lPtQq$Q=Xnf`DRAMzx>s9S^RUkC4k< zWX0ik@ON{uwv4Vk4I0C)lAoUt_`_IDH~4=N(ZNuXeM_o0Qnz;GP*?avVD`Sl!ug=f z@*N2#bBYB|=k`tScWUHRIN89W6g7?+<{u%QPk+KehKRM+uA@rWIBi4?Z)M1@i2%^b zr_-*!>W7wkp$d>Wa)-k)3J}k6F=(yv((fP892FH`hMcj-I&ApFfDAb(GdayuIfhrx z_kd)ca+;7H{ozUUS9RJIe2_2yk=GMQilNMvN%$QHx3i4~-tP;iZT%0f}q1XZ>pBJ0OS`11EeB8K@ z1)R33RRs+Y%w&Oh){c{I1wK+M9f;-QtU*ls^(kLc5a*0ap*(fth?9H3HcfgwIuW@!SZqfmjc{E64t;{EZeEpd|z+ zRwNr^Xb$s4c46cuZhPu_xCA)DI|{JP&bwpj+hKI4KN|s zVAyB!hZ6(@Bil#%w^B54C(U zJ^bCEk}3w;$K)?(*!R7}ScS=7-k|e$igM$lbHF~Ezq~IgJ<+=F@-;uSwfvgn zMJu?Ctfhbi49rg6_{%20Glo5SaG=0<{!+;eH-w9>#I4MjgccIs^M9B0ufw(^4E^ob zOnojs{LWv-11@>|Ff^E-e%jYwj$O&-(|3u#SDu<0B5k z_5Q&z{_^oqCW`s~!Cm;v)xy`8TL1Iw{eyD;(jCyF`{)oBe*by@;I#uELLM1Af`hom zKh_x>{_#ir;s0seGAzhAd}06q002ovPDHLkV1oMd6&L^j delta 2886 zcmV-M3%T^4726giiBL{Q4GJ0x0000DNk~Le00031000312m=5B0BfvRQ~&?~Gm#}U zf55=NGdI^100001bW%=J06^y0W&i*Hyn0kvbVOxyV{&P5bZKvH004NLjnd5u!Y~X6 z@N@eVWxI=0uU=##JGfUUg=TAUTO_R;zPl(mK z#ga&DY}jdpO-n)=fTyCwVOya^Zlj73qEwi5UJ|DCEFi3=0HKf=8Wn&sWT7xPuF^YL z0r6)qfZWbsW^}U*Xdu>OsiF`szso#0D4J6-$a|@RN%R? zxYF>-3+>vPYR(X-5ZCIc&m+uQIpbP`>F;ycf;*1mIF92uj^j9v<2a7vILBji50&2K z=NXp&4ZP@P$=?E)W1D;Oe{cC^`C9-pY^P8$9Y4^JQFuzzB)`pm*pMjxw4cT~3V^7( z2{bq&)aBa+X!1{JafDcApU0pk1>1o9s{AJZga-Kw?eiG5a)9kg_L6-5L5qJvgZ#zz zc~o45ihX_)`7yNkCt#x|-$MJmlJ-^me2aW&@K0FaXE3MWTiEiOfAZ|bk-wL6?1ejX zIF92uj^j9v<2a7vIF551;=6C@&N@kdLS{r#_yOyUtzwexC*u8xYS#+JS*NHUDe(hx zPGiNiHzj~EI}gt>e!ich6-S5k zD+DZxw)`mvSw6=v7o9kYD7w?Gtl1-jel!} z!Fh>EzGYd*C_BqQ8gYRF*uP{?1#tVdLlt7k!Xy%@ZPFC0^nr~70WKr9x%pwN1%W99 zjuM4QQDQWjz`leCV6Tv9p{}eWlhuoRU4SsWOtifbF=+~*b;yEQ;1D2oypaA4-2KXN z9LI4S$8j9Te{megahzWS!wEK)mr(ozj5I3+s^1UIL|^;^tlujJV%DI+e5r=f1gjK5mg#U`B78bkcz3u`3GnU zz>5_}NR$7aO%hjo$#AqAxc=$Yl@KJ=`Qa16KOh#>=s%|k&ej0rL7wTiyrc(sbZpST zv`~32e@8GqCujt}Tjn_{dn;kjv?azZaj^j9vb41Fy z#PUCJEn^>e=y%I9@@^#k0TlKNV#euIr?i-*b>4KELeNi%yE?{RFWn5h-8NDUIqYfu zW^Z~*H59+q_|RJ5BNNhw4sXYVrm(U*z~?=Xf4+z5i~c#PF2kXfk&hmV6)f8U39qsO zu9)mSgT0`SImnrhZc-g<7vu7NB1ZZP!oD)qj+>7df*I1KoU7|o0T>e1yKI}*6_7E~ z>*K?lLAX7A#IorseirlDUOrT{)(zq7l43b{O*)97I+iD@H%4wE^^MtbWGI)vl8jRO ze=KZD?o7Jyo1aFp`U@WOB_#||Jl!4<_++{qx|$ER@(Fk7aT-7#_>j6c&ja-qPQ&}i zh9#i~41tfX^R5?G?>C6NX21{8s!fkzkqi&r}zc(e<)7N7;zRme*A*i7{8$U@SWlp)So`YFOWu2 zBYwfo#A%Vf$Uoupeu1hE?~i(%11C6sz@YdiG;wd*)oJiCL65*R{_9tiG*YQ%S2eGH z@88>R=)w_g+m6!J+o)lg*%XXTDH?^vP+R>V-RjeHkCWbmN6Nd!&0j!;uOiFKL$*a#QN&_hP?C%X}Y-0bcg8 znG#W3S{O0PaU2O_bm@8UDS+r_%Y;D*c2#~BL0iMn!}yi7Lx9#vQKmkmvH_^E+3X%Q~CE0OEf*PhlgT#di}u0_V#%U;->dd_Pt@+E)nEI zKro`o(L!DF2H)R4&l`dXMGZx^`*A;zYsm8DCJ>5!T=e(e-9G;*U&y`4e;HhZlFZn_Vo9;`sxXwUbz z&)+`ik6b{m|A$t=8z)dQf4EI)M0U5&Q}sSn4d~^+=OI5c^4{M*PYN(AXd>re)qiLE zJhQy|!=MZkh6Z-F&llEEfQ+tyo$d3hutRcwa>56{TJ4M*wsFN`=0;m zwfJ5GiM3=MT1%yVS)&CkPOvw(!7k*oN_4LRtAutpSD$xW|N8>ge_99M>tA2)-pnkz zSAaDT=n9yIz-{}`X51eCk@fIbvU&JowtEipru(h%J;2+rZLP}M%VgnE8M~=99{!UE6}w9bh@6w ze}y%s@SYn$bJ Date: Sat, 28 Mar 2015 11:50:25 +1030 Subject: [PATCH 10/11] Fixing bugs. --- code/modules/organs/organ_external.dm | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 0bb6d89f31..28cc8c741d 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -214,26 +214,25 @@ // sync the organ's damage with its wounds src.update_damages() - owner.updatehealth() - var/result = update_icon() - //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 + burn_dam) >= (max_damage * config.organ_health_multiplier)) var/threshold = max_damage/3 + var/dropped if((burn >= threshold) && prob(burn)) + dropped = 1 droplimb(0,1) - return result - if(prob(brute)) + if(!dropped && prob(brute)) if(brute >= threshold) - if((sharp || edge) && used_weapon) - if(istype(used_weapon,/obj/item)) - var/obj/item/W = used_weapon - if(W.w_class >= 3) - droplimb() - return result - droplimb(0,2) - return result + if((sharp || edge) && istype(used_weapon,/obj/item)) + var/obj/item/W = used_weapon + if(W.w_class >= 3) + droplimb() + else + droplimb(0,2) + + owner.updatehealth() + return update_icon() /obj/item/organ/external/proc/heal_damage(brute, burn, internal = 0, robo_repair = 0) if(status & ORGAN_ROBOT && !robo_repair) @@ -896,7 +895,7 @@ Note that amputating the affected organ does in fact remove the infection from t owner.organs_by_name[limb_name] = null // Remove from owner's vars. //Robotic limbs explode if sabotaged. - if(is_robotic) + if(is_robotic && sabotaged) owner.visible_message( "\The [owner]'s [src.name] explodes violently!",\ "Your [src.name] explodes!",\ From 6a6e09b15cccd6b3709703e39e33404e12bfb7fb Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 30 Mar 2015 08:19:30 +1030 Subject: [PATCH 11/11] Updating the organ addition proc. --- code/datums/datumvars.dm | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index 5c0f282501..34d89807bd 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -865,31 +865,8 @@ client usr << "Mob already has that organ." return - if(istype(M,/mob/living/carbon/human)) - var/mob/living/carbon/human/H = M - var/obj/item/organ/I = new new_organ(H) - - var/organ_slot = input(usr, "Which slot do you want the organ to go in ('default' for default)?") as text|null - - if(!organ_slot) - return - - if(organ_slot != "default") - organ_slot = sanitize(copytext(organ_slot,1,MAX_MESSAGE_LEN)) - else - organ_slot = "unknown organ" - - if(H.internal_organs_by_name[organ_slot]) - usr << "[H] already has an organ in that slot." - del(I) - return - - H.internal_organs |= I - H.internal_organs_by_name[organ_slot] = I - usr << "Added new [new_organ] to [H] as slot [organ_slot]." - else - new new_organ(M) - usr << "Added new [new_organ] to [M]." + new new_organ(M) + else if(href_list["remorgan"]) if(!check_rights(R_SPAWN)) return @@ -899,7 +876,7 @@ client usr << "This can only be done to instances of type /mob/living/carbon" return - var/rem_organ = input("Please choose an organ to remove.","Organ",null) as null|anything in M.internal_organs + var/obj/item/organ/rem_organ = input("Please choose an organ to remove.","Organ",null) as null|anything in M.internal_organs if(!M) usr << "Mob doesn't exist anymore" @@ -910,6 +887,7 @@ client return usr << "Removed [rem_organ] from [M]." + rem_organ.removed() del(rem_organ) else if(href_list["fix_nano"])