Merge pull request #8812 from Sishen1542/surgery-hugboxing

Using the wrong tool during surgery won't hit the patient with it. Also stops medical borgs from attacking with surgical tools outside of harm intent.
This commit is contained in:
kevinz000
2019-07-12 07:42:11 -07:00
committed by GitHub
3 changed files with 16 additions and 3 deletions
+1
View File
@@ -26,6 +26,7 @@
#define NODROP (1<<8) // This flag makes it so that an item literally cannot be removed at all, or at least that's how it should be. Only deleted.
#define ABSTRACT (1<<9) // for all things that are technically items but used for various different stuff
#define IMMUTABLE_SLOW (1<<10) //When players should not be able to change the slowdown of the item (Speed potions, ect)
#define SURGICAL_TOOL (1<<12) //Tool commonly used for surgery: won't attack targets in an active surgical operation on help intent (in case of mistakes)
// Flags for the clothing_flags var on /obj/item/clothing
+8 -3
View File
@@ -49,9 +49,14 @@
var/datum/surgery_step/S = get_surgery_step()
if(S)
if(S.try_op(user, target, user.zone_selected, user.get_active_held_item(), src, try_to_fail))
return 1
return 0
var/obj/item/tool = user.get_active_held_item()
if(S.try_op(user, target, user.zone_selected, tool, src, try_to_fail))
return TRUE
if(iscyborg(user) && user.a_intent != INTENT_HARM) //to save asimov borgs a LOT of heartache
return TRUE
if(tool.item_flags & SURGICAL_TOOL) //Just because you used the wrong tool it doesn't mean you meant to whack the patient with it
to_chat(user, "<span class='warning'>This step requires a different tool!</span>")
return TRUE
/datum/surgery/proc/get_surgery_step()
var/step_type = steps[status]
+7
View File
@@ -4,6 +4,7 @@
icon = 'icons/obj/surgery.dmi'
icon_state = "retractor"
materials = list(MAT_METAL=6000, MAT_GLASS=3000)
item_flags = SURGICAL_TOOL
flags_1 = CONDUCT_1
w_class = WEIGHT_CLASS_TINY
@@ -33,6 +34,7 @@
icon = 'icons/obj/surgery.dmi'
icon_state = "hemostat"
materials = list(MAT_METAL=5000, MAT_GLASS=2500)
item_flags = SURGICAL_TOOL
flags_1 = CONDUCT_1
w_class = WEIGHT_CLASS_TINY
attack_verb = list("attacked", "pinched")
@@ -66,6 +68,7 @@
icon = 'icons/obj/surgery.dmi'
icon_state = "cautery"
materials = list(MAT_METAL=2500, MAT_GLASS=750)
item_flags = SURGICAL_TOOL
flags_1 = CONDUCT_1
w_class = WEIGHT_CLASS_TINY
attack_verb = list("burnt")
@@ -102,6 +105,7 @@
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
hitsound = 'sound/weapons/circsawhit.ogg'
materials = list(MAT_METAL=10000, MAT_GLASS=6000)
item_flags = SURGICAL_TOOL
flags_1 = CONDUCT_1
force = 15
w_class = WEIGHT_CLASS_NORMAL
@@ -151,6 +155,7 @@
throw_speed = 3
throw_range = 5
materials = list(MAT_METAL=4000, MAT_GLASS=1000)
item_flags = SURGICAL_TOOL
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
hitsound = 'sound/weapons/bladeslice.ogg'
sharpness = IS_SHARP_ACCURATE
@@ -209,6 +214,7 @@
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
hitsound = 'sound/weapons/circsawhit.ogg'
throwhitsound = 'sound/weapons/pierce.ogg'
item_flags = SURGICAL_TOOL
flags_1 = CONDUCT_1
force = 15
w_class = WEIGHT_CLASS_NORMAL
@@ -278,6 +284,7 @@
desc = "A container for holding body parts."
icon = 'icons/obj/storage.dmi'
icon_state = "evidenceobj"
item_flags = SURGICAL_TOOL
/obj/item/organ_storage/afterattack(obj/item/I, mob/user, proximity)
. = ..()