Merge branch 'SignalerButton' into 'Bleeding-Edge'

Remote Signaler Buttons

The button frame is constructed by using a metal sheet on a remote signaling device, similar to constructing conveyor switches. The frame is then used on a wall to place the button. Use a crowbar to pry the button off of the wall, and then use a wrench on it to turn it back into metal+signaling device.

Using a multitool on the button opens the standard remote signaling device dialogue, allowing one to change frequencies. If a multitool is not available, one may also set the frequency and code before constructing it.

Pressing the button sends a signal on the set frequency. The button turns green until it is ready to send again. For some reason, the amount of time before the next signal can be sent is slightly longer for the button than it is for using an actual remote signaling device, but I don't think it's a big issue.

The button can be named by using a pen on it.

This will be useful for people who wish to create contraptions using remote signaling devices, but don't want to have to juggle signalers in their backpack.

In addition, I've fixed a bug allowing remote signaling devices to be used from anywhere if you had the window open, and I've enabled wheelchair-bound people to make use of proximity sensors and timers now in addition to remote signaling devices. I've also made all three usable while buckled into things, as long as you are not also restrained or out of range.

See merge request !112
This commit is contained in:
Rob Nelson
2015-08-19 06:46:24 +00:00
6 changed files with 111 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
/obj/item/mounted/frame/driver_button
name = "mass driver button frame"
desc = "Used for repairing or building mass driver buttons"
desc = "Used for repairing or building mass driver buttons."
icon = 'icons/obj/objects.dmi'
icon_state = "launcherbtt_frame"
flags = FPRINT
@@ -9,3 +9,23 @@
/obj/item/mounted/frame/driver_button/do_build(turf/on_wall, mob/user)
new /obj/machinery/driver_button(get_turf(user), get_dir(user, on_wall))
qdel(src)
/obj/item/mounted/frame/driver_button/signaler_button
name = "signaler button frame"
desc = "Used for building signaler buttons."
var/code = 30
var/frequency = 1457
/obj/item/mounted/frame/driver_button/signaler_button/do_build(turf/on_wall, mob/user)
var/obj/item/device/assembly/signaler/signaler_button/I = new (get_turf(user), get_dir(user, on_wall))
I.code = src.code
I.frequency = src.frequency
qdel(src)
/obj/item/mounted/frame/driver_button/signaler_button/attackby(obj/item/weapon/W, mob/user)
if(istype(W, /obj/item/weapon/wrench))
new /obj/item/stack/sheet/metal(get_turf(src.loc))
var/obj/item/device/assembly/signaler/I = new (get_turf(src.loc))
I.code = src.code
I.frequency = src.frequency
qdel(src)

View File

@@ -13,6 +13,7 @@
throw_range = 10
origin_tech = "magnets=1"
var/show_status = 1 //in order to prevent the signaler button in signaler.dm from saying "... is ready!" when examined
var/secured = 1
var/list/attached_overlays = null
var/obj/item/device/assembly_holder/holder = null
@@ -145,10 +146,11 @@
/obj/item/device/assembly/examine(mob/user)
..()
if(secured)
user << "<span class='info'>\The [src] is ready!</span>"
else
user << "<span class='info'>\The [src] can be attached!</span>"
if(show_status)
if(secured)
user << "<span class='info'>\The [src] is ready!</span>"
else
user << "<span class='info'>\The [src] can be attached!</span>"
/obj/item/device/assembly/attack_self(mob/user as mob)
if(!user) return 0

View File

@@ -125,7 +125,9 @@
/obj/item/device/assembly/prox_sensor/Topic(href, href_list)
..()
if(!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr))
if(usr.stat || usr.restrained() || !in_range(loc, usr) || (!usr.canmove && !usr.locked_to))
//If the user is handcuffed or out of range, or if they're unable to move,
//but NOT if they're unable to move as a result of being buckled into something, they're unable to use the device.
usr << browse(null, "window=prox")
onclose(usr, "prox")
return

View File

@@ -33,6 +33,16 @@
user.u_equip(src,0)
qdel(src)
if(istype(W, /obj/item/stack/sheet/metal))
var/obj/item/stack/sheet/metal/R = W
if(R.amount >= 1)
R.use(1)
var/obj/item/mounted/frame/driver_button/signaler_button/I = new (get_turf(src.loc))
I.code = src.code
I.frequency = src.frequency
user.u_equip(src,0)
qdel(src)
/obj/item/device/assembly/signaler/activate()
if(cooldown > 0) return 0
cooldown = 2
@@ -79,9 +89,12 @@
/obj/item/device/assembly/signaler/Topic(href, href_list)
. = ..()
if(.)
..()
if(usr.stat || usr.restrained() || !in_range(loc, usr) || (!usr.canmove && !usr.locked_to))
//If the user is handcuffed or out of range, or if they're unable to move,
//but NOT if they're unable to move as a result of being buckled into something, they're unable to use the device.
usr << browse(null, "window=radio")
onclose(usr, "radio")
return
if(href_list["freq"])
@@ -192,3 +205,59 @@
deadman = 1
processing_objects.Add(src)
user.visible_message("<span class='warning'>[user] moves their finger over [src]'s signal button...</span>")
///Mounted Signaler Button///
/obj/item/device/assembly/signaler/signaler_button
name = "signaler button"
icon = 'icons/obj/objects.dmi'
icon_state = "launcherbtt"
desc = "Can be used to send signals to various frequencies."
var/id_tag = "default"
var/active = 0
anchored = 1.0
show_status = 0
var/activated = 0
ghost_read = 0 // Deactivate ghost touching.
ghost_write = 0
/obj/item/device/assembly/signaler/signaler_button/New(turf/loc, var/w_dir=null)
..()
switch(w_dir)
if(NORTH)
pixel_y = 25
if(SOUTH)
pixel_y = -25
if(EAST)
pixel_x = 25
if(WEST)
pixel_x = -25
/obj/item/device/assembly/signaler/signaler_button/attack_hand(mob/user)
if(!activated)
activated = 1
icon_state = "launcheract"
activate()
sleep(20)
icon_state = "launcherbtt"
activated = 0
/obj/item/device/assembly/signaler/signaler_button/attackby(obj/item/weapon/W, mob/user)
if(istype(W,/obj/item/weapon/pen)) //Naming the button without having to use a labeler
var/n_name = copytext(sanitize(input(user, "What would you like to name this button?", "Button Labeling", null) as text|null), 1, MAX_NAME_LEN*3)
if(n_name && Adjacent(user) && !user.stat)
name = "[n_name]"
return
if(istype(W, /obj/item/weapon/crowbar))
user << "You begin prying \the [src] off the wall."
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
if(do_after(user, src,10))
user << "<span class='notice'>You pry the button off of the wall.</span>"
var/obj/item/mounted/frame/driver_button/signaler_button/I = new (get_turf(user))
I.code = src.code
I.frequency = src.frequency
qdel(src)
return
if(istype(W, /obj/item/device/multitool))
interact(user, null)
return

View File

@@ -83,7 +83,9 @@
/obj/item/device/assembly/timer/Topic(href, href_list)
..()
if(!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr))
if(usr.stat || usr.restrained() || !in_range(loc, usr) || (!usr.canmove && !usr.locked_to))
//If the user is handcuffed or out of range, or if they're unable to move,
//but NOT if they're unable to move as a result of being buckled into something, they're unable to use the device.
usr << browse(null, "window=timer")
onclose(usr, "timer")
return