diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm index a35db68de44..ec2f9ccd639 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -37,11 +37,8 @@ species_list[S.id] = S.type //Surgeries - for(var/path in typesof(/datum/surgery)) - if(path == /datum/surgery) - continue - var/datum/surgery/S = new path() - surgeries_list[S.name] = S + for(var/path in (typesof(/datum/surgery) - /datum/surgery)) + surgeries_list += new path() init_subtypes(/datum/table_recipe, table_recipes) diff --git a/code/game/objects/items/weapons/defib.dm b/code/game/objects/items/weapons/defib.dm index 5266cb9077e..37a582cac7b 100644 --- a/code/game/objects/items/weapons/defib.dm +++ b/code/game/objects/items/weapons/defib.dm @@ -361,11 +361,13 @@ return if(user.zone_sel && user.zone_sel.selecting == "chest") if(!defib.safety && user.a_intent == "harm") - user.visible_message("[user] begins to place [src] on [M.name]'s chest.", "You overcharge the paddles and begin to place them onto [M]'s chest...") + user.visible_message("[user] begins to place [src] on [M.name]'s chest.", + "You overcharge the paddles and begin to place them onto [M]'s chest...") busy = 1 update_icon() if(do_after(user, 30, target = M)) - user.visible_message("[user] places [src] on [M.name]'s chest.", "You place [src] on [M.name]'s chest and begin to charge them.") + user.visible_message("[user] places [src] on [M.name]'s chest.", + "You place [src] on [M.name]'s chest and begin to charge them.") var/turf/T = get_turf(defib) playsound(get_turf(src), 'sound/machines/defib_charge.ogg', 50, 0) T.audible_message("\The [defib] lets out an urgent beep and lets out a steadily rising hum...") @@ -384,7 +386,8 @@ if(!HU.heart_attack) HU.heart_attack = 1 if(!HU.stat) - HU.visible_message("[M] thrashes wildly, clutching at their chest!", "You feel a horrible agony in your chest!") + HU.visible_message("[M] thrashes wildly, clutching at their chest!", + "You feel a horrible agony in your chest!") HU.apply_damage(50, BURN, "chest") add_logs(user, M, "overloaded the heart of", defib) M.Weaken(5) @@ -427,7 +430,22 @@ total_brute = H.getBruteLoss() total_burn = H.getFireLoss() - if(total_burn <= 180 && total_brute <= 180 && !H.suiciding && !H.get_ghost() && tplus < tlimit && !(NOCLONE in H.mutations)) + var/failed = null + + if (H.suiciding || (NOCLONE in H.mutations)) + failed = "[defib] buzzes: Resuscitation failed - Recovery of patient impossible. Further attempts futile." + else if ((tplus > tlimit) || !H.getorgan(/obj/item/organ/internal/heart)) + failed = "[defib] buzzes: Resuscitation failed - Heart tissue damage beyond point of no return. Further attempts futile." + else if(total_burn >= 180 || total_brute >= 180) + failed = "[defib] buzzes: Resuscitation failed - Severe tissue damage detected." + else if(H.get_ghost() || !H.getorgan(/obj/item/organ/internal/brain)) + failed = "[defib] buzzes: Resuscitation failed - No activity in patient's brain. Further attempts may be successful." + + + if(failed) + user.visible_message(failed) + playsound(get_turf(src), 'sound/machines/defib_failed.ogg', 50, 0) + else //If the body has been fixed so that they would not be in crit when defibbed, give them oxyloss to put them back into crit if (H.health > halfwaycritdeath) H.adjustOxyLoss(H.health - halfwaycritdeath) @@ -446,19 +464,8 @@ H.emote("gasp") if(tplus > tloss) H.setBrainLoss( max(0, min(99, ((tlimit - tplus) / tlimit * 100)))) - defib.deductcharge(revivecost) add_logs(user, M, "revived", defib) - else - if (H.suiciding || (NOCLONE in H.mutations)) - user.visible_message("[defib] buzzes: Resuscitation failed - Recovery of patient impossible. Further attempts futile.") - else if (tplus > tlimit) - user.visible_message("[defib] buzzes: Resuscitation failed - Heart tissue damage beyond point of no return for defibrillation. Further attempts futile.") - else if(total_burn >= 180 || total_brute >= 180) - user.visible_message("[defib] buzzes: Resuscitation failed - Severe tissue damage detected.") - else - user.visible_message("[defib] buzzes: Resuscitation failed - No soul in patient body. Further attempts may be successful.") - playsound(get_turf(src), 'sound/machines/defib_failed.ogg', 50, 0) - defib.deductcharge(revivecost) + defib.deductcharge(revivecost) update_icon() cooldown = 1 defib.cooldowncheck(user) diff --git a/code/game/objects/items/weapons/implants/implant_explosive.dm b/code/game/objects/items/weapons/implants/implant_explosive.dm index 2b35e79369c..58baba89092 100644 --- a/code/game/objects/items/weapons/implants/implant_explosive.dm +++ b/code/game/objects/items/weapons/implants/implant_explosive.dm @@ -4,8 +4,8 @@ icon_state = "explosive" origin_tech = "materials=2;combat=3;biotech=4;syndicate=4" var/weak = 2 - var/medium = 1 - var/heavy = 0.5 + var/medium = 0.8 + var/heavy = 0.4 var/delay = 7 /obj/item/weapon/implant/explosive/get_data() diff --git a/code/modules/surgery/helpers.dm b/code/modules/surgery/helpers.dm index f3bbee0b6c9..a9675ffba2f 100644 --- a/code/modules/surgery/helpers.dm +++ b/code/modules/surgery/helpers.dm @@ -18,8 +18,8 @@ if(!current_surgery) var/list/all_surgeries = surgeries_list.Copy() var/list/available_surgeries = list() - for(var/i in all_surgeries) - var/datum/surgery/S = all_surgeries[i] + + for(var/datum/surgery/S in all_surgeries) if(!S.possible_locs.Find(selected_zone)) continue if(affecting && S.requires_organic_bodypart && affecting.status == ORGAN_ROBOTIC) @@ -48,11 +48,21 @@ else user << "You need to expose [M]'s [parse_zone(selected_zone)] first!" - else if(current_surgery.status == 1 && !current_surgery.step_in_progress) - M.surgeries -= current_surgery - user.visible_message("[user] removes the drapes from [M]'s [parse_zone(selected_zone)].", \ - "You remove the drapes from [M]'s [parse_zone(selected_zone)].") - qdel(current_surgery) + else if(!current_surgery.step_in_progress) + if(current_surgery.status == 1) + M.surgeries -= current_surgery + user.visible_message("[user] removes the drapes from [M]'s [parse_zone(selected_zone)].", \ + "You remove the drapes from [M]'s [parse_zone(selected_zone)].") + qdel(current_surgery) + else if(istype(user.get_inactive_hand(), /obj/item/weapon/cautery) && current_surgery.can_cancel) + M.surgeries -= current_surgery + user.visible_message("[user] mends the incision and removes the drapes from [M]'s [parse_zone(selected_zone)].", \ + "You mend the incision and remove the drapes from [M]'s [parse_zone(selected_zone)].") + qdel(current_surgery) + else if(current_surgery.can_cancel) + user << "You need to hold a cautery in inactive hand to stop [M]'s surgery!" + + return 1 return 0 diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index 0801896b63a..ecee25e7b13 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -3,6 +3,7 @@ var/status = 1 var/list/steps = list() //Steps in a surgery var/step_in_progress = 0 //Actively performing a Surgery + var/can_cancel = 1 //Can cancel this surgery after step 1 with cautery var/list/species = list(/mob/living/carbon/human) //Acceptable Species var/location = "chest" //Surgery location var/requires_organic_bodypart = 1 //Prevents you from performing an operation on robotic limbs diff --git a/html/changelogs/c0-surgery-part2.yml b/html/changelogs/c0-surgery-part2.yml index 2008145952c..cd26830edb4 100644 --- a/html/changelogs/c0-surgery-part2.yml +++ b/html/changelogs/c0-surgery-part2.yml @@ -34,5 +34,7 @@ delete-after: True # Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. changes: - tweak: "Changed the way most of the surgical operations work. See wiki for new steps." + - tweak: "You can cancel step 2+ surgeries with drapes and cautery in inactive hand." + - tweak: "Defib no longer works on humans who have no heart. Changeling/thrall/cult/strange reagent revives are still working, and this is intended." - rscadd: "You can eat all organs raw now, with exception for brains and cyberimplants." - rscadd: "Some xenos abilities are linked to their organs. Play with xenos' guts for fun and profit!" \ No newline at end of file