Merge pull request #10734 from datlo/syndimedbody

Adds the cyborg body analyzer to syndi medborgs
This commit is contained in:
variableundefined
2019-01-27 06:24:49 +08:00
committed by GitHub
2 changed files with 34 additions and 6 deletions
+33 -6
View File
@@ -569,10 +569,20 @@ REAGENT SCANNER
var/ready = TRUE // Ready to scan
var/time_to_use = 0 // How much time remaining before next scan is available.
var/usecharge = 750
var/scan_time = 10 SECONDS //how long does it take to scan
var/scan_cd = 60 SECONDS //how long before we can scan again
/obj/item/bodyanalyzer/advanced
cell_type = /obj/item/stock_parts/cell/upgraded/plus
/obj/item/bodyanalyzer/borg
name = "cyborg body analyzer"
desc = "Scan an entire body to prepare for field surgery. Consumes power for each scan."
/obj/item/bodyanalyzer/borg/syndicate
scan_time = 5 SECONDS
scan_cd = 20 SECONDS
/obj/item/bodyanalyzer/New()
..()
power_supply = new cell_type(src)
@@ -614,29 +624,46 @@ REAGENT SCANNER
to_chat(user, "<span class='notice'>The scanner beeps angrily at you! It's out of charge!</span>")
playsound(user.loc, 'sound/machines/buzz-sigh.ogg', 50, 1)
/obj/item/bodyanalyzer/borg/attack(mob/living/M, mob/living/silicon/robot/user)
if(user.incapacitated() || !user.Adjacent(M))
return
if(!ready)
to_chat(user, "<span class='notice'>[src] is currently recharging - [round((time_to_use - world.time) * 0.1)] seconds remaining.</span>")
return
if(user.cell.charge >= usecharge)
mobScan(M, user)
else
to_chat(user, "<span class='notice'>You need to recharge before you can use [src]</span>")
/obj/item/bodyanalyzer/proc/mobScan(mob/living/M, mob/user)
if(ishuman(M))
var/report = generate_printing_text(M, user)
user.visible_message("[user] begins scanning [M] with [src].", "You begin scanning [M].")
if(do_after(user, 100, target = M))
if(do_after(user, scan_time, target = M))
var/obj/item/paper/printout = new
printout.info = report
printout.name = "Scan report - [M.name]"
playsound(user.loc, 'sound/goonstation/machines/printer_dotmatrix.ogg', 50, 1)
user.put_in_hands(printout)
time_to_use = world.time + 600
power_supply.use(usecharge)
time_to_use = world.time + scan_cd
if(isrobot(user))
var/mob/living/silicon/robot/R = user
R.cell.use(usecharge)
else
power_supply.use(usecharge)
ready = FALSE
update_icon(TRUE)
addtimer(CALLBACK(src, /obj/item/bodyanalyzer/.proc/setReady), 600)
addtimer(CALLBACK(src, /obj/item/bodyanalyzer/.proc/setReady), scan_cd)
addtimer(CALLBACK(src, /obj/item/bodyanalyzer/.proc/update_icon), 20)
else if(iscorgi(M) && M.stat == DEAD)
to_chat(user, "<span class='notice'>You wonder if [M.p_they()] was a good dog. <b>[src] tells you they were the best...</b></span>") // :'(
playsound(loc, 'sound/machines/ping.ogg', 50, 0)
ready = FALSE
addtimer(CALLBACK(src, /obj/item/bodyanalyzer/.proc/setReady), 600)
time_to_use = world.time + 600
addtimer(CALLBACK(src, /obj/item/bodyanalyzer/.proc/setReady), scan_cd)
time_to_use = world.time + scan_cd
else
to_chat(user, "<span class='notice'>Scanning error detected. Invalid specimen.</span>")