From 4432b2dd8bdc95ae3613638f127efdd9d0918d8f Mon Sep 17 00:00:00 2001 From: Arokha Sieyes Date: Thu, 18 Jan 2018 14:53:27 -0500 Subject: [PATCH] VS: Adds Destroy on shock collars (tsk tsk) --- .../under/accessories/accessory_vr.dm | 50 ++++++++++--------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/code/modules/clothing/under/accessories/accessory_vr.dm b/code/modules/clothing/under/accessories/accessory_vr.dm index 51c8c3279e1..4a975f6bf75 100644 --- a/code/modules/clothing/under/accessories/accessory_vr.dm +++ b/code/modules/clothing/under/accessories/accessory_vr.dm @@ -34,20 +34,25 @@ icon_state = "collar_shk0" item_state = "collar_shk_overlay" overlay_state = "collar_shk_overlay" - // How about some copypasta? - var/on = 0 // 0 for off, 1 for on, starts off to encourage people to set non-default frequencies and codes. + var/on = FALSE // 0 for off, 1 for on, starts off to encourage people to set non-default frequencies and codes. var/frequency = 1449 var/code = 2 var/datum/radio_frequency/radio_connection - var/list/datum/radio_frequency/secure_radio_connections = new - proc/set_frequency(new_frequency) - radio_controller.remove_object(src, frequency) - frequency = new_frequency - radio_connection = radio_controller.add_object(src, frequency, RADIO_CHAT) - + /obj/item/clothing/accessory/collar/shock/New() + ..() radio_connection = radio_controller.add_object(src, frequency, RADIO_CHAT) // Makes it so you don't need to change the frequency off of default for it to work. - + +/obj/item/clothing/accessory/collar/shock/Destroy() //Clean up your toys when you're done. + radio_controller.remove_object(src, frequency) + radio_connection = null //Don't delete this, this is a shared object. + return ..() + +/obj/item/clothing/accessory/collar/shock/proc/set_frequency(new_frequency) + radio_controller.remove_object(src, frequency) + frequency = new_frequency + radio_connection = radio_controller.add_object(src, frequency, RADIO_CHAT) + /obj/item/clothing/accessory/collar/shock/Topic(href, href_list) if(usr.stat || usr.restrained()) return @@ -107,24 +112,23 @@ return user.set_machine(src) var/dat = {" -Turn [on ? "Off" : "On"]
-Frequency/Code for collar:
-Frequency: -- -- [format_frequency(frequency)] -+ -+
+ Turn [on ? "Off" : "On"]
+ Frequency/Code for collar:
+ Frequency: + - + - [format_frequency(frequency)] + + + +
-Code: -- -- [code] -+ -+
-
"} + Code: + - + - [code] + + + +
+ "} user << browse(dat, "window=radio") onclose(user, "radio") return - /obj/item/clothing/accessory/collar/spike name = "Spiked collar"