Adds do_surgery() behaviour for various items

Heath scanners, autopsy scanners, syringes, hyposprays, droppers and bottles.
This commit is contained in:
HarpyEagle
2016-06-01 21:57:49 -04:00
committed by Yoshax
parent fc063115df
commit 58b87f1a4b
7 changed files with 48 additions and 17 deletions
+10 -3
View File
@@ -24,8 +24,16 @@ REAGENT SCANNER
origin_tech = list(TECH_MAGNET = 1, TECH_BIO = 1)
var/mode = 1;
/obj/item/device/healthanalyzer/do_surgery(mob/living/M, mob/living/user)
if(user.a_intent != I_HELP) //in case it is ever used as a surgery tool
return ..()
scan_mob(M, user) //default surgery behaviour is just to scan as usual
return 1
/obj/item/device/healthanalyzer/attack(mob/living/M as mob, mob/living/user as mob)
/obj/item/device/healthanalyzer/attack(mob/living/M, mob/living/user)
scan_mob(M, user)
/obj/item/device/healthanalyzer/proc/scan_mob(mob/living/M, mob/living/user)
if ((CLUMSY in user.mutations) && prob(50))
user << text("<span class='warning'>You try to analyze the floor's vitals!</span>")
for(var/mob/O in viewers(M, null))
@@ -168,8 +176,7 @@ REAGENT SCANNER
else
user.show_message("<span class='notice'>Blood Level Normal: [blood_percent]% [blood_volume]cl. Type: [blood_type]</span>")
user.show_message("<span class='notice'>Subject's pulse: <font color='[H.pulse == PULSE_THREADY || H.pulse == PULSE_NONE ? "red" : "blue"]'>[H.get_pulse(GETPULSE_TOOL)] bpm.</font></span>")
src.add_fingerprint(user)
return
/obj/item/device/healthanalyzer/verb/toggle_mode()
set name = "Switch Verbosity"
+5 -9
View File
@@ -162,19 +162,16 @@
if(istype(usr,/mob/living/carbon))
usr.put_in_hands(src)
/obj/item/weapon/autopsy_scanner/attack(mob/living/carbon/human/M as mob, mob/living/carbon/user as mob)
/obj/item/weapon/autopsy_scanner/do_surgery(mob/living/carbon/human/M, mob/living/user)
if(!istype(M))
return
if(!can_operate(M))
return
return 0
if(target_name != M.name)
target_name = M.name
src.wdata = list()
src.chemtraces = list()
src.timeofdeath = null
user << "<span class='notice'>A new patient has been registered.. Purging data for previous patient.</span>"
user << "<span class='notice'>A new patient has been registered. Purging data for previous patient.</span>"
src.timeofdeath = M.timeofdeath
@@ -183,10 +180,9 @@
usr << "<span class='warning'>You can't scan this body part.</span>"
return
if(!S.open)
usr << "<span class='warning'>You have to cut the limb open first!</span>"
usr << "<span class='warning'>You have to cut [S] open first!</span>"
return
for(var/mob/O in viewers(M))
O.show_message("<span class='notice'>\The [user] scans the wounds on [M.name]'s [S.name] with \the [src]</span>", 1)
M.visible_message("<span class='notice'>\The [user] scans the wounds on [M]'s [S.name] with [src]</span>")
src.add_data(S)