Makes borg cell replacement take priority over petting (#7579)

* Makes borg cell replacement take priority over petting

* dont pet WHILE taking cell out either
This commit is contained in:
Heroman3003
2020-08-30 16:49:02 +10:00
committed by GitHub
parent 811cd0b47e
commit 4cd8585e7e

View File

@@ -673,9 +673,26 @@
add_fingerprint(user)
if(istype(user,/mob/living/carbon/human))
if(opened && !wiresexposed && (!istype(user, /mob/living/silicon)))
var/datum/robot_component/cell_component = components["power cell"]
if(cell)
cell.update_icon()
cell.add_fingerprint(user)
user.put_in_active_hand(cell)
to_chat(user, "You remove \the [cell].")
cell = null
cell_component.wrapped = null
cell_component.installed = 0
updateicon()
else if(cell_component.installed == -1)
cell_component.installed = 0
var/obj/item/broken_device = cell_component.wrapped
to_chat(user, "You remove \the [broken_device].")
user.put_in_active_hand(broken_device)
if(istype(user,/mob/living/carbon/human) && !opened)
var/mob/living/carbon/human/H = user
//Adding borg petting. Help intent pets, Disarm intent taps, Grab should remove the battery for replacement, and Harm is punching(no damage)
//Adding borg petting. Help intent pets, Disarm intent taps and Harm is punching(no damage)
switch(H.a_intent)
if(I_HELP)
visible_message("<span class='notice'>[H] pets [src].</span>")
@@ -696,23 +713,6 @@
return
//Addition of borg petting end
if(opened && !wiresexposed && (!istype(user, /mob/living/silicon)))
var/datum/robot_component/cell_component = components["power cell"]
if(cell)
cell.update_icon()
cell.add_fingerprint(user)
user.put_in_active_hand(cell)
to_chat(user, "You remove \the [cell].")
cell = null
cell_component.wrapped = null
cell_component.installed = 0
updateicon()
else if(cell_component.installed == -1)
cell_component.installed = 0
var/obj/item/broken_device = cell_component.wrapped
to_chat(user, "You remove \the [broken_device].")
user.put_in_active_hand(broken_device)
//Robots take half damage from basic attacks.
/mob/living/silicon/robot/attack_generic(var/mob/user, var/damage, var/attack_message)
return ..(user,FLOOR(damage/2, 1),attack_message)