diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index 143a603ec1e..fb7c4b586c3 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -490,7 +490,7 @@ var/global/datum/controller/occupations/job_master if(istype(H)) //give humans wheelchairs, if they need them. 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)) + if(!l_foot || !r_foot) var/obj/structure/bed/chair/wheelchair/W = new /obj/structure/bed/chair/wheelchair(H.loc) H.buckled = W H.update_canmove() diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index ef38ab99ba8..0f65429e05b 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -401,7 +401,7 @@ if(!AN && !open && !infected & !imp) AN = "None:" - if(!(e.status & ORGAN_DESTROYED)) + if(!e.is_stump()) dat += "[e.name][e.burn_dam][e.brute_dam][robot][bled][AN][splint][open][infected][imp][internal_bleeding][lung_ruptured]" else dat += "[e.name]--Not [e.is_stump() ? "Found" : "Attached Completely"]" diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 96dda70158f..5692feafee3 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -985,6 +985,11 @@ if (usr.stat || !ishuman(usr)) return + + if (usr.buckled) + usr << "You can't climb into the exosuit while buckled!" + return + src.log_message("[usr] tries to move in.") if(iscarbon(usr)) var/mob/living/carbon/C = usr diff --git a/code/game/objects/effects/decals/Cleanable/humans.dm b/code/game/objects/effects/decals/Cleanable/humans.dm index 1c723c04ada..2887a8249ad 100644 --- a/code/game/objects/effects/decals/Cleanable/humans.dm +++ b/code/game/objects/effects/decals/Cleanable/humans.dm @@ -60,7 +60,7 @@ var/global/list/image/splatter_cache=list() 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)) + if((!l_foot || l_foot.is_stump()) && (!r_foot || r_foot.is_stump())) hasfeet = 0 if(perp.shoes && !perp.buckled)//Adding blood to shoes var/obj/item/clothing/shoes/S = perp.shoes diff --git a/code/game/objects/items/weapons/clown_items.dm b/code/game/objects/items/weapons/clown_items.dm index e32b58e098f..c801d14f8da 100644 --- a/code/game/objects/items/weapons/clown_items.dm +++ b/code/game/objects/items/weapons/clown_items.dm @@ -15,7 +15,15 @@ /* * Soap */ -/obj/item/weapon/soap/Crossed(AM as mob|obj) //EXACTLY the same as bananapeel for now, so it makes sense to put it in the same dm -- Urist +/obj/item/weapon/soap/New() + ..() + create_reagents(5) + wet() + +/obj/item/weapon/soap/proc/wet() + reagents.add_reagent("cleaner", 5) + +/obj/item/weapon/soap/Crossed(AM as mob|obj) if (istype(AM, /mob/living)) var/mob/living/M = AM M.slip("the [src.name]",3) @@ -32,7 +40,10 @@ else if(istype(target,/turf)) user << "You scrub \the [target.name] clean." var/turf/T = target - T.clean(src) + T.clean(src, user) + else if(istype(target,/obj/structure/sink)) + user << "You wet \the [src] in the sink." + wet() else user << "You clean \the [target.name]." target.clean_blood() diff --git a/code/game/objects/items/weapons/implants/implant.dm b/code/game/objects/items/weapons/implants/implant.dm index 36fefdec3a6..1b8a70c6d32 100644 --- a/code/game/objects/items/weapons/implants/implant.dm +++ b/code/game/objects/items/weapons/implants/implant.dm @@ -6,6 +6,7 @@ name = "implant" icon = 'icons/obj/device.dmi' icon_state = "implant" + w_class = 1 var/implanted = null var/mob/imp_in = null var/obj/item/organ/external/part = null diff --git a/code/game/objects/items/weapons/mop.dm b/code/game/objects/items/weapons/mop.dm index abf5e08a3be..e50ce867967 100644 --- a/code/game/objects/items/weapons/mop.dm +++ b/code/game/objects/items/weapons/mop.dm @@ -14,19 +14,7 @@ /obj/item/weapon/mop/New() - create_reagents(5) - -//expects an atom containing the reagents used to clean the turf -/turf/proc/clean(atom/source) - if(source.reagents.has_reagent("water", 1)) - clean_blood() - if(istype(src, /turf/simulated)) - var/turf/simulated/T = src - T.dirt = 0 - for(var/obj/effect/O in src) - if(istype(O,/obj/effect/rune) || istype(O,/obj/effect/decal/cleanable) || istype(O,/obj/effect/overlay)) - qdel(O) - source.reagents.trans_to_turf(src, 1, 10) //10 is the multiplier for the reaction effect. probably needed to wet the floor properly. + create_reagents(30) /obj/item/weapon/mop/afterattack(atom/A, mob/user, proximity) if(!proximity) return @@ -40,7 +28,7 @@ if(do_after(user, 40)) var/turf/T = get_turf(A) if(T) - T.clean(src) + T.clean(src, user) user << "You have finished mopping!" diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index d4472905f9b..df5f556f192 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -339,3 +339,17 @@ if(A.density && !(A.flags & ON_BORDER)) return 1 return 0 + +//expects an atom containing the reagents used to clean the turf +/turf/proc/clean(atom/source, mob/user) + if(source.reagents.has_reagent("water", 1) || source.reagents.has_reagent("cleaner", 1)) + clean_blood() + if(istype(src, /turf/simulated)) + var/turf/simulated/T = src + T.dirt = 0 + for(var/obj/effect/O in src) + if(istype(O,/obj/effect/rune) || istype(O,/obj/effect/decal/cleanable) || istype(O,/obj/effect/overlay)) + qdel(O) + else + user << "\The [source] is too dry to wash that." + source.reagents.trans_to_turf(src, 1, 10) //10 is the multiplier for the reaction effect. probably needed to wet the floor properly. diff --git a/code/modules/clothing/spacesuits/rig/modules/utility.dm b/code/modules/clothing/spacesuits/rig/modules/utility.dm index b761df8438b..8cda74ad438 100644 --- a/code/modules/clothing/spacesuits/rig/modules/utility.dm +++ b/code/modules/clothing/spacesuits/rig/modules/utility.dm @@ -36,6 +36,7 @@ interface_desc = "A self-sustaining plasma arc capable of cutting through walls." suit_overlay_active = "plasmacutter" suit_overlay_inactive = "plasmacutter" + use_power_cost = 0.5 device_type = /obj/item/weapon/pickaxe/plasmacutter @@ -56,6 +57,7 @@ interface_desc = "A diamond-tipped industrial drill." suit_overlay_active = "mounted-drill" suit_overlay_inactive = "mounted-drill" + use_power_cost = 0.1 device_type = /obj/item/weapon/pickaxe/diamonddrill diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index c8bfa944433..eaa525d3210 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -205,7 +205,7 @@ if(40 to INFINITY) status += "peeling away" - if(org.status & ORGAN_DESTROYED) + if(org.is_stump()) status += "MISSING" if(org.status & ORGAN_MUTATED) status += "weirdly shapen" diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index c1cd4ccfa17..6ac44bccadf 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -269,7 +269,6 @@ var/list/organ_data = species.has_limbs[organ_tag] var/organ_descriptor = organ_data["descriptor"] - is_destroyed["organ_descriptor"] = 1 var/obj/item/organ/external/E = organs_by_name[organ_tag] if(!E) @@ -277,15 +276,10 @@ else if(E.is_stump()) wound_flavor_text["[organ_descriptor]"] = "[t_He] has a stump where [t_his] [organ_descriptor] should be.\n" else - is_destroyed["organ_descriptor"] = 0 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] [t_is] missing [t_his] [temp.name].\n" - continue if(temp.status & ORGAN_ROBOT) if(!(temp.brute_dam + temp.burn_dam)) wound_flavor_text["[temp.name]"] = "[t_He] has a robot [temp.name]!\n" diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 047a7089c88..589bcb0445d 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -327,7 +327,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/obj/item/organ/external/head = get_organ("head") - if(!head || head.disfigured || (head.status & ORGAN_DESTROYED) || !real_name || (HUSK in mutations) ) //disfigured. use id-name if possible + if(!head || head.disfigured || head.is_stump() || !real_name || (HUSK in mutations) ) //disfigured. use id-name if possible return "Unknown" return real_name diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index 8224d3e518d..f76d49e036e 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -125,7 +125,7 @@ var/hit_zone = H.zone_sel.selecting var/obj/item/organ/external/affecting = get_organ(hit_zone) - if(!affecting || affecting.is_stump() || (affecting.status & ORGAN_DESTROYED)) + if(!affecting || affecting.is_stump()) M << "They are missing that limb!" return 1 diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index bd5f176b196..5cdc406f70a 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -181,6 +181,11 @@ emp_act for(var/obj/O in src) if(!O) continue O.emp_act(severity) + for(var/obj/item/organ/external/O in organs) + O.emp_act(severity) + for(var/obj/item/organ/I in O.internal_organs) + if(I.robotic == 0) continue + I.emp_act(severity) ..() @@ -198,7 +203,7 @@ emp_act var/obj/item/organ/external/affecting = get_organ(target_zone) - if (!affecting || (affecting.status & ORGAN_DESTROYED) || affecting.is_stump()) + if (!affecting || affecting.is_stump()) user << "They are missing that limb!" return diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index f4b28d2b6b0..d660d766a30 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/obj/item/organ/external/E = get_organ(organ_name) - if(!E || (E.status & ORGAN_DESTROYED)) + if(!E || E.is_stump()) tally += 4 if(E.status & ORGAN_SPLINTED) tally += 0.5 @@ -40,9 +40,9 @@ for(var/organ_name in list("l_foot","r_foot","l_leg","r_leg")) var/obj/item/organ/external/E = get_organ(organ_name) - if(!E || (E.status & ORGAN_DESTROYED)) + if(!E || E.is_stump()) tally += 4 - if(E.status & ORGAN_SPLINTED) + else if(E.status & ORGAN_SPLINTED) tally += 0.5 else if(E.status & ORGAN_BROKEN) tally += 1.5 diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index d69f6e57cc2..0259a3ef4bb 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -70,7 +70,7 @@ 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 || (E.status & (ORGAN_DESTROYED|ORGAN_DEAD))) + if(!E || (E.status & (ORGAN_MUTATED|ORGAN_DEAD)) || E.is_stump()) //should just be !E.is_usable() here but dislocation screws that up. stance_damage += 2 // let it fail even if just foot&leg else if (E.is_malfunctioning()) //malfunctioning only happens intermittently so treat it as a missing limb when it procs diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index 75e6750d9f6..f775d2c6a48 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -33,7 +33,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/obj/item/organ/external/O = organs_by_name[name] - return (O && !(O.status & ORGAN_DESTROYED) && !O.is_stump()) + return (O && !O.is_stump()) /mob/living/carbon/human/proc/has_organ_for_slot(slot) switch(slot) diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 2b201a38057..c96bf1e0c9b 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -225,15 +225,20 @@ 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/organ_tag in has_organ) + var/organ_type = has_organ[organ_tag] + var/obj/item/organ/O = new organ_type(H,1) + if(organ_tag != O.organ_tag) + warning("[O.type] has a default organ tag \"[O.organ_tag]\" that differs from the species' organ tag \"[organ_tag]\". Updating organ_tag to match.") + O.organ_tag = organ_tag + H.internal_organs_by_name[organ_tag] = O - for(var/name in H.organs_by_name) - H.organs |= H.organs_by_name[name] - - for(var/obj/item/organ/external/O in H.organs) - O.owner = H + if(flags & IS_SYNTHETIC) + for(var/obj/item/organ/external/E in H.organs) + if(E.status & ORGAN_CUT_AWAY || E.is_stump()) continue + E.robotize() + 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) if (target.holder_type && target.a_intent == "help" && H.a_intent == "help") diff --git a/code/modules/mob/living/carbon/human/unarmed_attack.dm b/code/modules/mob/living/carbon/human/unarmed_attack.dm index 1d148b96ead..e541920cb4f 100644 --- a/code/modules/mob/living/carbon/human/unarmed_attack.dm +++ b/code/modules/mob/living/carbon/human/unarmed_attack.dm @@ -18,11 +18,11 @@ // Check if they have a functioning hand. var/obj/item/organ/external/E = user.organs_by_name["l_hand"] - if(E && !(E.status & ORGAN_DESTROYED)) + if(E && !E.is_stump()) return 1 E = user.organs_by_name["r_hand"] - if(E && !(E.status & ORGAN_DESTROYED)) + if(E && !E.is_stump()) return 1 return 0 @@ -170,11 +170,11 @@ return 0 var/obj/item/organ/external/E = user.organs_by_name["l_foot"] - if(E && !(E.status & ORGAN_DESTROYED)) + if(E && !E.is_stump()) return 1 E = user.organs_by_name["r_foot"] - if(E && !(E.status & ORGAN_DESTROYED)) + if(E && !E.is_stump()) return 1 return 0 @@ -214,11 +214,11 @@ if(target.grabbed_by == user && target.lying) return 0 var/obj/item/organ/external/E = user.organs_by_name["l_foot"] - if(E && !(E.status & ORGAN_DESTROYED)) + if(E && !E.is_stump()) return 1 E = user.organs_by_name["r_foot"] - if(E && !(E.status & ORGAN_DESTROYED)) + if(E && !E.is_stump()) return 1 return 0 diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 596dc3e02e1..0d9a5e39397 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -186,9 +186,10 @@ var/global/list/damage_icon_parts = list() 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 + //if(O.status & ORGAN_DESTROYED) damage_appearance += "d" //what is this? + //else + // damage_appearance += O.damage_state + damage_appearance += O.damage_state if(damage_appearance == previous_damage_appearance) // nothing to do here @@ -204,20 +205,20 @@ var/global/list/damage_icon_parts = list() 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 - var/icon/DI - var/cache_index = "[O.damage_state]/[O.icon_name]/[species.blood_color]/[species.get_bodytype()]" - if(damage_icon_parts[cache_index] == null) - DI = new /icon(species.damage_overlays, O.damage_state) // the damage icon for whole human - DI.Blend(new /icon(species.damage_mask, O.icon_name), ICON_MULTIPLY) // mask with this organ's pixels - DI.Blend(species.blood_color, ICON_MULTIPLY) - damage_icon_parts[cache_index] = DI - else - DI = damage_icon_parts[cache_index] - standing_image.overlays += DI + O.update_icon() + if(O.damage_state == "00") continue + var/icon/DI + var/cache_index = "[O.damage_state]/[O.icon_name]/[species.blood_color]/[species.get_bodytype()]" + if(damage_icon_parts[cache_index] == null) + DI = new /icon(species.damage_overlays, O.damage_state) // the damage icon for whole human + DI.Blend(new /icon(species.damage_mask, O.icon_name), ICON_MULTIPLY) // mask with this organ's pixels + DI.Blend(species.blood_color, ICON_MULTIPLY) + damage_icon_parts[cache_index] = DI + else + DI = damage_icon_parts[cache_index] + + standing_image.overlays += DI overlays_standing[DAMAGE_LAYER] = standing_image @@ -259,7 +260,7 @@ var/global/list/damage_icon_parts = list() for(var/organ_tag in species.has_limbs) var/obj/item/organ/external/part = organs_by_name[organ_tag] - if(isnull(part) || part.is_stump() || (part.status & ORGAN_DESTROYED)) + if(isnull(part) || part.is_stump()) icon_key += "0" else if(part.status & ORGAN_ROBOT) icon_key += "2[part.model ? "-[part.model]": ""]" @@ -343,7 +344,7 @@ var/global/list/damage_icon_parts = list() overlays_standing[HAIR_LAYER] = null var/obj/item/organ/external/head/head_organ = get_organ("head") - if(!head_organ || head_organ.is_stump() || (head_organ.status & ORGAN_DESTROYED) ) + if(!head_organ || head_organ.is_stump() ) if(update_icons) update_icons() return 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 88be25cc245..f6b87bfd444 100644 --- a/code/modules/mob/living/simple_animal/borer/borer_powers.dm +++ b/code/modules/mob/living/simple_animal/borer/borer_powers.dm @@ -74,7 +74,7 @@ var/mob/living/carbon/human/H = M var/obj/item/organ/external/E = H.organs_by_name["head"] - if(!E || (E.status & ORGAN_DESTROYED)) + if(!E || E.is_stump()) src << "\The [H] does not have a head!" if(!H.species.has_organ["brain"]) diff --git a/code/modules/mob/mob_grab_specials.dm b/code/modules/mob/mob_grab_specials.dm index e43179ca385..9a9f741041c 100644 --- a/code/modules/mob/mob_grab_specials.dm +++ b/code/modules/mob/mob_grab_specials.dm @@ -3,7 +3,7 @@ var/obj/item/organ/external/E = H.get_organ(target_zone) - if(!E || (E.status & ORGAN_DESTROYED)) + if(!E || E.is_stump()) user << "[H] is missing that bodypart." return diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 6060f18e05c..55d07707d2d 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -295,7 +295,7 @@ var/mob/living/carbon/human/driver = mob.buckled 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))) + if((!l_hand || l_hand.is_stump()) && (!r_hand || r_hand.is_stump())) return // No hands to drive your chair? Tough luck! //drunk wheelchair driving if(mob.confused) diff --git a/code/modules/nano/nanoui.dm b/code/modules/nano/nanoui.dm index c2feeaebfa0..4335b083817 100644 --- a/code/modules/nano/nanoui.dm +++ b/code/modules/nano/nanoui.dm @@ -140,8 +140,8 @@ nanoui is used to open and update nano browser uis * @return nothing */ /datum/nanoui/proc/update_status(var/push_update = 0) - src_object = src_object.nano_host() - var/new_status = src_object.CanUseTopic(user, state) + var/obj/host = src_object.nano_host() + var/new_status = host.CanUseTopic(user, state) if(master_ui) new_status = min(new_status, master_ui.status) diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index 664e00d275c..c5dbdc5db5e 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -64,7 +64,7 @@ var/list/organ_cache = list() var/mob/living/carbon/human/H = holder if(istype(H)) if(internal) - var/obj/item/organ/external/E = H.organs_by_name[src.parent_organ] + var/obj/item/organ/external/E = H.get_organ(parent_organ) if(E) if(E.internal_organs == null) E.internal_organs = list() @@ -249,7 +249,6 @@ var/list/organ_cache = list() src.status &= ~ORGAN_BLEEDING src.status &= ~ORGAN_SPLINTED src.status &= ~ORGAN_CUT_AWAY - src.status &= ~ORGAN_DESTROYED src.status |= ORGAN_ROBOT src.status |= ORGAN_ASSISTED diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 5c6fe0c8afb..5e95b1a0dec 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -81,15 +81,15 @@ if(istype(I,/obj/item/organ)) continue removable_objects |= I - if(!removable_objects.len) - return ..() - var/obj/item/I = pick(removable_objects) - if(!istype(I)) - return ..() - I.loc = get_turf(user) - if(!(user.l_hand && user.r_hand)) - user.put_in_hands(I) - user.visible_message("\The [user] rips \the [I] out of \the [src]!") + if(removable_objects.len) + var/obj/item/I = pick(removable_objects) + I.loc = get_turf(user) //just in case something was embedded that is not an item + if(istype(I)) + if(!(user.l_hand && user.r_hand)) + user.put_in_hands(I) + user.visible_message("\The [user] rips \the [I] out of \the [src]!") + return //no eating the limb until everything's been removed + return ..() /obj/item/organ/external/examine() ..() @@ -162,8 +162,8 @@ return -/obj/item/organ/external/New(var/mob/living/carbon/holder, var/internal) - ..() +/obj/item/organ/external/New(var/mob/living/carbon/holder) + ..(holder, 0) if(owner) replaced(owner) sync_colour_to_human(owner) @@ -202,8 +202,6 @@ /obj/item/organ/external/take_damage(brute, burn, sharp, edge, used_weapon = null, list/forbidden_limbs = list()) if((brute <= 0) && (burn <= 0)) return 0 - if(status & ORGAN_DESTROYED) - return 0 brute *= brute_mod burn *= burn_mod @@ -432,11 +430,11 @@ This function completely restores a damaged organ to perfect condition. /obj/item/organ/external/process() if(owner) - if(parent) - if(parent.status & ORGAN_DESTROYED) - status |= ORGAN_DESTROYED - owner.update_body(1) - return + //Dismemberment + //if(parent && parent.is_stump()) //should never happen + // warning("\The [src] ([src.type]) belonging to [owner] ([owner.type]) was attached to a stump") + // remove() + // return // Process wounds, doing healing etc. Only do this every few ticks to save processing power if(owner.life_tick % wound_update_accuracy == 0) @@ -478,7 +476,7 @@ Note that amputating the affected organ does in fact remove the infection from t */ /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. + if(status & (ORGAN_ROBOT) || (owner.species && owner.species.flags & IS_PLANT)) //Robotic limbs shouldn't be infected, nor should nonexistant limbs. germ_level = 0 return @@ -655,8 +653,6 @@ 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 /obj/item/organ/external/proc/damage_state_text() - if(status & ORGAN_DESTROYED) - return "--" var/tburn = 0 var/tbrute = 0 @@ -685,14 +681,11 @@ 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, var/ignore_children) +/obj/item/organ/external/proc/droplimb(var/clean, var/disintegrate = DROPLIMB_EDGE, var/ignore_children = null) if(cannot_amputate || !owner) return - if(!disintegrate) - disintegrate = DROPLIMB_EDGE - switch(disintegrate) if(DROPLIMB_EDGE) if(!clean) @@ -716,16 +709,16 @@ Note that amputating the affected organ does in fact remove the infection from t "You hear the [gore_sound].") var/mob/living/carbon/human/victim = owner //Keep a reference for post-removed(). + var/obj/item/organ/external/parent_organ = parent removed(null, ignore_children) victim.traumatic_shock += 60 wounds.Cut() - if(parent) + if(parent_organ) var/datum/wound/lost_limb/W = new (src, disintegrate, clean) - parent.children -= src if(clean) - parent.wounds |= W - parent.update_damages() + parent_organ.wounds |= W + parent_organ.update_damages() else var/obj/item/organ/external/stump/stump = new (victim, 0, src) if(status & ORGAN_ROBOT) @@ -733,7 +726,6 @@ Note that amputating the affected organ does in fact remove the infection from t stump.wounds |= W victim.organs |= stump stump.update_damages() - parent = null spawn(1) victim.updatehealth() @@ -928,9 +920,7 @@ Note that amputating the affected organ does in fact remove the infection from t return 0 /obj/item/organ/external/proc/is_usable() - if((status & ORGAN_ROBOT) && get_damage() >= max_damage) //robot limbs just become inoperable at max damage - return - return !is_dislocated() && !(status & (ORGAN_DESTROYED|ORGAN_MUTATED|ORGAN_DEAD)) + return !is_dislocated() && !(status & (ORGAN_MUTATED|ORGAN_DEAD)) /obj/item/organ/external/proc/is_malfunctioning() return ((status & ORGAN_ROBOT) && (brute_dam + burn_dam) >= 10 && prob(brute_dam + burn_dam)) @@ -949,7 +939,7 @@ Note that amputating the affected organ does in fact remove the infection from t H.drop_from_inventory(W) W.loc = owner -/obj/item/organ/external/removed(var/mob/living/user, var/ignore_children) +/obj/item/organ/external/removed(var/mob/living/user, var/ignore_children = 0) if(!owner) return @@ -958,14 +948,13 @@ Note that amputating the affected organ does in fact remove the infection from t ..() - status |= ORGAN_DESTROYED victim.bad_external_organs -= src - for(var/obj/item/implant in implants) - if(!istype(implant)) - return - if(implant.w_class <= 2) - qdel(implant) + for(var/atom/movable/implant in implants) + //large items and non-item objs fall to the floor, everything else stays + var/obj/item/I = implant + if(istype(I) && I.w_class < 3) + implant.loc = get_turf(victim.loc) else implant.loc = src implants.Cut() @@ -984,6 +973,10 @@ Note that amputating the affected organ does in fact remove the infection from t organ.removed() organ.loc = src + // Remove parent references + parent.children -= src + parent = null + release_restraints(victim) victim.organs -= src victim.organs_by_name[limb_name] = null // Remove from owner's vars. @@ -1060,7 +1053,7 @@ Note that amputating the affected organ does in fact remove the infection from t if(wound_descriptors.len) var/list/flavor_text = list() var/list/no_exclude = list("gaping wound", "big gaping wound", "massive wound", "large bruise",\ - "huge bruise", "massive bruise", "severe burn", "large burn", "deep burn", "carbonised area") + "huge bruise", "massive bruise", "severe burn", "large burn", "deep burn", "carbonised area") //note to self make this more robust for(var/wound in wound_descriptors) switch(wound_descriptors[wound]) if(1) diff --git a/code/modules/organs/subtypes/diona.dm b/code/modules/organs/subtypes/diona.dm index 6f19c7eee80..5c997e47611 100644 --- a/code/modules/organs/subtypes/diona.dm +++ b/code/modules/organs/subtypes/diona.dm @@ -166,14 +166,6 @@ name = "anchoring ligament" parent_organ = "groin" -/obj/item/organ/diona/node - name = "receptor node" - parent_organ = "head" - -/obj/item/organ/diona/nutrients - name = "nutrient vessel" - parent_organ = "chest" - /obj/item/organ/diona name = "diona nymph" icon = 'icons/obj/objects.dmi' @@ -191,8 +183,9 @@ // These are different to the standard diona organs as they have a purpose in other // species (absorbing radiation and light respectively) /obj/item/organ/diona/nutrients - name = "nutrient vessel" - organ_tag = "nutrient vessel" + name = "nutrient channel" + parent_organ = "chest" + organ_tag = "nutrient channel" icon = 'icons/mob/alien.dmi' icon_state = "claw" @@ -200,7 +193,8 @@ return /obj/item/organ/diona/node - name = "receptor node" + name = "response node" + parent_organ = "head" organ_tag = "receptor node" icon = 'icons/mob/alien.dmi' icon_state = "claw" diff --git a/code/modules/paperwork/paperbin.dm b/code/modules/paperwork/paperbin.dm index 4ef6f1eef5b..e9390c87e60 100644 --- a/code/modules/paperwork/paperbin.dm +++ b/code/modules/paperwork/paperbin.dm @@ -74,6 +74,7 @@ i.loc = src user << "You put [i] in [src]." papers.Add(i) + update_icon() amount++ diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index c06b57d54c8..a688ba66d5d 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -231,7 +231,7 @@ var/target_zone = ran_zone(check_zone(user.zone_sel.selecting, target)) var/obj/item/organ/external/affecting = H.get_organ(target_zone) - if (!affecting || (affecting.status & ORGAN_DESTROYED) || affecting.is_stump()) + if (!affecting || affecting.is_stump()) user << "They are missing that limb!" return diff --git a/code/modules/surgery/generic.dm b/code/modules/surgery/generic.dm index d1becd0cbf9..e12637c7a73 100644 --- a/code/modules/surgery/generic.dm +++ b/code/modules/surgery/generic.dm @@ -15,7 +15,7 @@ var/obj/item/organ/external/affected = target.get_organ(target_zone) if (affected == null) return 0 - if (affected.status & ORGAN_DESTROYED) + if (affected.is_stump()) return 0 if (affected.status & ORGAN_ROBOT) return 0 @@ -288,8 +288,6 @@ var/obj/item/organ/external/affected = target.get_organ(target_zone) if (affected == null) return 0 - if (affected.status & ORGAN_DESTROYED) - return 0 return !affected.cannot_amputate begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)