diff --git a/code/game/objects/items/devices/radio/electropack.dm b/code/game/objects/items/devices/radio/electropack.dm
index 231818be77..5b13537a44 100644
--- a/code/game/objects/items/devices/radio/electropack.dm
+++ b/code/game/objects/items/devices/radio/electropack.dm
@@ -156,6 +156,7 @@ Code:
strip_delay = 60
equip_delay_other = 60
materials = list(MAT_METAL=5000, MAT_GLASS=2000)
+
var/tagname = null
/datum/design/electropack/shockcollar
@@ -170,18 +171,17 @@ Code:
if(loc == user && user.get_item_by_slot(SLOT_NECK))
to_chat(user, "The collar is fastened tight! You'll need help taking this off!")
return
- ..()
+ return ..()
/obj/item/electropack/shockcollar/receive_signal(datum/signal/signal)
if(!signal || signal.data["code"] != code)
return
if(isliving(loc) && on)
- if(shock_cooldown != 0)
+ if(shock_cooldown == TRUE)
return
- shock_cooldown = 1
- spawn(100)
- shock_cooldown = 0
+ shock_cooldown = TRUE
+ addtimer(VARSET_CALLBACK(src, shock_cooldown, FALSE), 100)
var/mob/living/L = loc
step(L, pick(GLOB.cardinals))
@@ -196,33 +196,26 @@ Code:
master.receive_signal()
return
-/obj/item/electropack/shockcollar/attack_self(mob/user) //Turns out can't fully source this from the parent item, spritepath gets confused if power toggled. Will come back to this when I know how to code better and readd powertoggle..
- var/option = "Change Name"
- option = input(user, "What do you want to do?", "[src]", option) as null|anything in list("Change Name", "Change Frequency")
- switch(option)
- if("Change Name")
- var/t = input(user, "Would you like to change the name on the tag?", "Name your new pet", tagname ? tagname : "Spot") as null|text
- if(t)
- tagname = copytext(sanitize(t), 1, MAX_NAME_LEN)
- name = "[initial(name)] - [tagname]"
- if("Change Frequency")
- if(!ishuman(user))
- return
- user.set_machine(src)
- var/dat = {"
- Frequency/Code for shock collar:
- Frequency:
- -
- - [format_frequency(frequency)]
- +
- +
- Code:
- -
- - [code]
- +
- +
- "}
+/obj/item/electropack/shockcollar/attackby(obj/item/W, mob/user, params) //moves it here because on_click is being bad
+ if(istype(W, /obj/item/pen))
+ var/t = input(user, "Would you like to change the name on the tag?", "Name your new pet", tagname ? tagname : "Spot") as null|text
+ if(t)
+ tagname = copytext(sanitize(t), 1, MAX_NAME_LEN)
+ name = "[initial(name)] - [tagname]"
+ else
+ return ..()
- user << browse(dat, "window=radio")
- onclose(user, "radio")
- return
+/obj/item/electropack/shockcollar/ui_interact(mob/user) //on_click calls this
+ var/dat = {"
+
+Frequency/Code for shock collar:
+Frequency:
+[format_frequency(src.frequency)]
+Set
+Code:
+[src.code]
+Set
+"}
+ user << browse(dat, "window=radio")
+ onclose(user, "radio")
+ return