Cable Retracting (#15285)

This commit is contained in:
SabreML
2021-01-24 13:39:08 +00:00
committed by GitHub
parent 039f82d17e
commit a8b7888ae9
4 changed files with 12 additions and 15 deletions
+1 -2
View File
@@ -120,11 +120,10 @@
desc = "A device bored paper pushers use to remind themselves that time did not stop yet. Contains gravity."
/obj/item/pai_cable
desc = "A flexible coated cable with a universal jack on one end."
name = "data cable"
desc = "A flexible coated cable with a universal jack on one end."
icon = 'icons/obj/power.dmi'
icon_state = "wire1"
var/obj/machinery/machine
/obj/item/phone
@@ -317,16 +317,17 @@
to_chat(usr, "<span class='warning'>You are already hacking that door!</span>")
else
hacking = TRUE
INVOKE_ASYNC(src, /datum/pai_software/door_jack/.proc/hackloop)
INVOKE_ASYNC(src, .proc/hackloop)
if("cancel")
hackdoor = null
if("cable")
if(cable)
to_chat(usr, "<span class='warning'>You already have a cable deployed!</span>")
return
var/turf/T = get_turf(pai_holder)
cable = new /obj/item/pai_cable(T)
pai_holder.visible_message("<span class='warning'>A port on [pai_holder] opens to reveal [cable], which promptly falls to the floor.</span>")
playsound(pai_holder, 'sound/mecha/mechmove03.ogg', 25, TRUE)
if(cable) // Retracting
pai_holder.visible_message("<span class='warning'>[cable] is pulled back into [pai_holder] with a quick snap.</span>")
QDEL_NULL(cable)
else // Extending
cable = new /obj/item/pai_cable(get_turf(pai_holder))
pai_holder.visible_message("<span class='warning'>A port on [pai_holder] opens to reveal [cable], which promptly falls to the floor.</span>")
/**
* Door jack hack loop
@@ -17,14 +17,11 @@ export const pai_doorjack = (props, context) => {
cableContent = (
<Button selected content="Connected" />
);
} else if (cable) {
cableContent = (
<Button color={"orange"} content="Extended" />
);
} else {
cableContent = (
<Button
content="Retracted"
content={cable ? "Extended" : "Retracted"}
color={cable ? "orange" : null}
onClick={() => act('cable')}
/>
);
File diff suppressed because one or more lines are too long