Fixes Repairing Bots (#6325)

* Fixes Repairing Bots

You can now repair beepsky, slime securitrons, and other bots if they get damaged

* Can Fix Emag

* Updates changelog

* fix rcsadd to rscadd
This commit is contained in:
Andrew
2019-07-27 12:06:59 -05:00
committed by VirgoBot
parent 2f5957ee9f
commit 9d4f42ca29
2 changed files with 56 additions and 4 deletions
+19 -4
View File
@@ -88,13 +88,13 @@
/mob/living/bot/attackby(var/obj/item/O, var/mob/user)
if(O.GetID())
if(access_scanner.allowed(user) && !open && !emagged)
if(access_scanner.allowed(user) && !open)
locked = !locked
to_chat(user, "<span class='notice'>Controls are now [locked ? "locked." : "unlocked."]</span>")
attack_hand(user)
else
if(emagged)
to_chat(user, "<span class='warning'>ERROR</span>")
to_chat(user, "<span class='warning'>ERROR! SYSTEMS COMPROMISED!</span>")
else
if(open)
to_chat(user, "<span class='warning'>Please close the access panel before locking it.</span>")
else
@@ -111,7 +111,15 @@
else if(istype(O, /obj/item/weapon/weldingtool))
if(health < getMaxHealth())
if(open)
health = min(getMaxHealth(), health + 10)
if(getBruteLoss() < 10)
bruteloss = 0
else
bruteloss = bruteloss - 10
if(getFireLoss() < 10)
fireloss = 0
else
fireloss = fireloss - 10
updatehealth()
user.visible_message("<span class='notice'>[user] repairs [src].</span>","<span class='notice'>You repair [src].</span>")
playsound(src, O.usesound, 50, 1)
else
@@ -119,6 +127,13 @@
else
to_chat(user, "<span class='notice'>[src] does not need a repair.</span>")
return
else if(istype(O, /obj/item/device/assembly/prox_sensor) && emagged)
if(open)
to_chat(user, "<span class='notice'>You repair the bot's systems.</span>")
emagged = 0
qdel(O)
else
to_chat(user, "<span class='notice'>Unable to repair with the maintenance panel closed.</span>")
else
..()