mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-21 11:07:12 +01:00
Merge pull request #10736 from datlo/ghettosurgeryfix
Refactor surgery early cautery, add cyborg medical grip, misc surgery fix/changes
This commit is contained in:
@@ -38,16 +38,35 @@
|
||||
/obj/item/gripper/paperwork
|
||||
name = "paperwork gripper"
|
||||
desc = "A simple grasping tool for clerical work."
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "gripper"
|
||||
|
||||
can_hold = list(
|
||||
/obj/item/clipboard,
|
||||
/obj/item/paper,
|
||||
// /obj/item/paper_bundle,
|
||||
/obj/item/card/id
|
||||
)
|
||||
|
||||
/obj/item/gripper/medical
|
||||
name = "medical gripper"
|
||||
desc = "A grasping tool used to help patients up once surgery is complete."
|
||||
can_hold = list()
|
||||
|
||||
/obj/item/gripper/medical/afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, proximity, params)
|
||||
var/mob/living/carbon/human/H
|
||||
if(!wrapped && proximity && target && ishuman(target))
|
||||
H = target
|
||||
if(H.lying)
|
||||
H.AdjustSleeping(-5)
|
||||
if(H.sleeping == 0)
|
||||
H.StopResting()
|
||||
H.AdjustParalysis(-3)
|
||||
H.AdjustStunned(-3)
|
||||
H.AdjustWeakened(-3)
|
||||
playsound(user.loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
user.visible_message( \
|
||||
"<span class='notice'>[user] shakes [H] trying to wake [H.p_them()] up!</span>",\
|
||||
"<span class='notice'>You shake [H] trying to wake [H.p_them()] up!</span>",\
|
||||
)
|
||||
|
||||
/obj/item/gripper/New()
|
||||
..()
|
||||
can_hold = typecacheof(can_hold)
|
||||
|
||||
@@ -153,15 +153,15 @@
|
||||
modules += new /obj/item/stack/medical/ointment/advanced(src)
|
||||
modules += new /obj/item/stack/medical/splint(src)
|
||||
modules += new /obj/item/stack/nanopaste(src)
|
||||
modules += new /obj/item/scalpel(src)
|
||||
modules += new /obj/item/scalpel/laser/laser1(src)
|
||||
modules += new /obj/item/hemostat(src)
|
||||
modules += new /obj/item/retractor(src)
|
||||
modules += new /obj/item/cautery(src)
|
||||
modules += new /obj/item/bonegel(src)
|
||||
modules += new /obj/item/FixOVein(src)
|
||||
modules += new /obj/item/bonesetter(src)
|
||||
modules += new /obj/item/circular_saw(src)
|
||||
modules += new /obj/item/surgicaldrill(src)
|
||||
modules += new /obj/item/gripper/medical(src)
|
||||
|
||||
emag = new /obj/item/reagent_containers/spray(src)
|
||||
|
||||
@@ -417,14 +417,14 @@
|
||||
modules += new /obj/item/stack/medical/ointment/advanced(src)
|
||||
modules += new /obj/item/stack/medical/splint(src)
|
||||
modules += new /obj/item/stack/nanopaste(src)
|
||||
modules += new /obj/item/scalpel(src)
|
||||
modules += new /obj/item/scalpel/laser/laser1(src)
|
||||
modules += new /obj/item/hemostat(src)
|
||||
modules += new /obj/item/retractor(src)
|
||||
modules += new /obj/item/cautery(src)
|
||||
modules += new /obj/item/bonegel(src)
|
||||
modules += new /obj/item/FixOVein(src)
|
||||
modules += new /obj/item/bonesetter(src)
|
||||
modules += new /obj/item/surgicaldrill(src)
|
||||
modules += new /obj/item/gripper/medical(src)
|
||||
modules += new /obj/item/melee/energy/sword/cyborg/saw(src) //Energy saw -- primary weapon
|
||||
modules += new /obj/item/card/emag(src)
|
||||
modules += new /obj/item/crowbar/cyborg(src)
|
||||
|
||||
@@ -3,6 +3,13 @@
|
||||
var/mob/living/carbon/human/H
|
||||
var/obj/item/organ/external/affecting
|
||||
var/selected_zone = user.zone_sel.selecting
|
||||
var/list/cautery_tools = list(
|
||||
/obj/item/scalpel/laser = 100, \
|
||||
/obj/item/cautery = 100, \
|
||||
/obj/item/clothing/mask/cigarette = 90, \
|
||||
/obj/item/lighter = 60, \
|
||||
/obj/item/weldingtool = 30
|
||||
)
|
||||
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
H = M
|
||||
@@ -61,26 +68,48 @@
|
||||
user.visible_message("[user] prepares to operate on [M]'s [parse_zone(selected_zone)].", \
|
||||
"<span class='notice'>You prepare to operate on [M]'s [parse_zone(selected_zone)].</span>")
|
||||
|
||||
else if(!current_surgery.step_in_progress)
|
||||
if(current_surgery.status == 1 )
|
||||
else if(!current_surgery.step_in_progress && ishuman(M)) //early surgery cautery
|
||||
var/datum/surgery_step/generic/cauterize/C = new
|
||||
if(current_surgery.status == 1)
|
||||
M.surgeries -= current_surgery
|
||||
to_chat(user, "You stop the surgery.")
|
||||
qdel(current_surgery)
|
||||
else if(istype(user.get_inactive_hand(), /obj/item/cautery) && current_surgery.can_cancel)
|
||||
M.surgeries -= current_surgery
|
||||
user.visible_message("[user] mends the incision on [M]'s [parse_zone(selected_zone)] with the [I] .", \
|
||||
"<span class='notice'>You mend the incision on [M]'s [parse_zone(selected_zone)].</span>")
|
||||
if(affecting)
|
||||
affecting.open = 0
|
||||
affecting.germ_level = 0
|
||||
qdel(current_surgery)
|
||||
else if(current_surgery.can_cancel)
|
||||
to_chat(user, "<span class='warning'>You need to hold a cautery in inactive hand to stop [M]'s surgery!</span>")
|
||||
|
||||
else if(current_surgery.can_cancel)
|
||||
var/cautery_chance = 0
|
||||
var/obj/item/cautery_tool = null
|
||||
|
||||
if(isrobot(user))
|
||||
if(istype(I, /obj/item/scalpel/laser))
|
||||
cautery_chance = 100
|
||||
cautery_tool = I
|
||||
|
||||
else
|
||||
for(var/T in cautery_tools)
|
||||
if(istype(user.get_inactive_hand(), T))
|
||||
cautery_chance = cautery_tools[T]
|
||||
cautery_tool = user.get_inactive_hand()
|
||||
|
||||
if(cautery_chance)
|
||||
C.begin_step(user, H, selected_zone, cautery_tool, current_surgery)
|
||||
if(do_after(user, C.time * cautery_tool.toolspeed, target = M))
|
||||
if(!isrobot(user))
|
||||
cautery_chance *= get_location_modifier(H)
|
||||
cautery_chance *= get_pain_modifier(H)
|
||||
if(prob(cautery_chance))
|
||||
C.end_step(user, H, selected_zone, cautery_tool, current_surgery)
|
||||
M.surgeries -= current_surgery
|
||||
qdel(current_surgery)
|
||||
else
|
||||
C.fail_step(user, H, selected_zone, cautery_tool, current_surgery)
|
||||
|
||||
else if(!isrobot(user))
|
||||
to_chat(user, "<span class='notice'>You need to hold a cautery or equivalent in your inactive hand to stop the surgery in progress.</span>")
|
||||
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
/proc/get_pain_modifier(mob/living/carbon/human/M) //returns modfier to make surgery harder if patient is conscious and feels pain
|
||||
if(M.stat) //stat=0 if CONSCIOUS, 1=UNCONSCIOUS and 2=DEAD. Operating on dead people is easy, too. Just sleeping won't work, though.
|
||||
return 1
|
||||
@@ -111,6 +140,16 @@
|
||||
else
|
||||
return 0.5
|
||||
|
||||
//check if mob is lying down on something we can operate him on.
|
||||
/proc/can_operate(mob/living/carbon/M)
|
||||
if(locate(/obj/machinery/optable, M.loc) && (M.lying || M.resting))
|
||||
return TRUE
|
||||
if(locate(/obj/structure/bed, M.loc) && (M.buckled || M.lying || M.weakened || M.stunned || M.paralysis || M.sleeping || M.stat))
|
||||
return TRUE
|
||||
if(locate(/obj/structure/table, M.loc) && (M.lying || M.weakened || M.stunned || M.paralysis || M.sleeping || M.stat))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
// Called when a limb containing this object is placed back on a body
|
||||
/atom/movable/proc/attempt_become_organ(obj/item/organ/external/parent,mob/living/carbon/human/H)
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user