Kills off /obj/item/device (#6561)

This commit is contained in:
kevinz000
2018-04-29 22:06:58 -07:00
committed by Poojawa
parent ab3035a4ea
commit 3369c804b2
538 changed files with 6728 additions and 6707 deletions
+18 -18
View File
@@ -4,7 +4,7 @@
#define WIRE_RADIO_RECEIVE (1<<3)
#define WIRE_RADIO_PULSE (1<<4)
/obj/item/device/assembly
/obj/item/assembly
name = "assembly"
desc = "A small electronic device that should never exist."
icon = 'icons/obj/assemblies/new_assemblies.dmi'
@@ -18,28 +18,28 @@
var/secured = TRUE
var/list/attached_overlays = null
var/obj/item/device/assembly_holder/holder = null
var/obj/item/assembly_holder/holder = null
var/wire_type = WIRE_RECEIVE | WIRE_PULSE
var/attachable = FALSE // can this be attached to wires
var/datum/wires/connected = null
var/next_activate = 0 //When we're next allowed to activate - for spam control
/obj/item/device/assembly/get_part_rating()
/obj/item/assembly/get_part_rating()
return 1
/obj/item/device/assembly/proc/on_attach()
/obj/item/assembly/proc/on_attach()
/obj/item/device/assembly/proc/on_detach()
/obj/item/assembly/proc/on_detach()
/obj/item/device/assembly/proc/holder_movement() //Called when the holder is moved
/obj/item/assembly/proc/holder_movement() //Called when the holder is moved
return
/obj/item/device/assembly/proc/describe() // Called by grenades to describe the state of the trigger (time left, etc)
/obj/item/assembly/proc/describe() // Called by grenades to describe the state of the trigger (time left, etc)
return "The trigger assembly looks broken!"
/obj/item/device/assembly/proc/is_secured(mob/user)
/obj/item/assembly/proc/is_secured(mob/user)
if(!secured)
to_chat(user, "<span class='warning'>The [name] is unsecured!</span>")
return FALSE
@@ -47,7 +47,7 @@
//Called when another assembly acts on this one, var/radio will determine where it came from for wire calcs
/obj/item/device/assembly/proc/pulsed(radio = 0)
/obj/item/assembly/proc/pulsed(radio = 0)
if(wire_type & WIRE_RECEIVE)
INVOKE_ASYNC(src, .proc/activate)
if(radio && (wire_type & WIRE_RADIO_RECEIVE))
@@ -56,7 +56,7 @@
//Called when this device attempts to act on another device, var/radio determines if it was sent via radio or direct
/obj/item/device/assembly/proc/pulse(radio = 0)
/obj/item/assembly/proc/pulse(radio = 0)
if(connected && wire_type)
connected.pulse_assembly(src)
return TRUE
@@ -68,24 +68,24 @@
// What the device does when turned on
/obj/item/device/assembly/proc/activate()
/obj/item/assembly/proc/activate()
if(QDELETED(src) || !secured || (next_activate > world.time))
return FALSE
next_activate = world.time + 30
return TRUE
/obj/item/device/assembly/proc/toggle_secure()
/obj/item/assembly/proc/toggle_secure()
secured = !secured
update_icon()
return secured
/obj/item/device/assembly/attackby(obj/item/W, mob/user, params)
/obj/item/assembly/attackby(obj/item/W, mob/user, params)
if(isassembly(W))
var/obj/item/device/assembly/A = W
var/obj/item/assembly/A = W
if((!A.secured) && (!secured))
holder = new/obj/item/device/assembly_holder(get_turf(src))
holder = new/obj/item/assembly_holder(get_turf(src))
holder.assemble(src,A,user)
to_chat(user, "<span class='notice'>You attach and secure \the [A] to \the [src]!</span>")
else
@@ -100,7 +100,7 @@
..()
/obj/item/device/assembly/examine(mob/user)
/obj/item/assembly/examine(mob/user)
..()
if(secured)
to_chat(user, "\The [src] is secured and ready to be used.")
@@ -108,12 +108,12 @@
to_chat(user, "\The [src] can be attached to other things.")
/obj/item/device/assembly/attack_self(mob/user)
/obj/item/assembly/attack_self(mob/user)
if(!user)
return FALSE
user.set_machine(src)
interact(user)
return TRUE
/obj/item/device/assembly/interact(mob/user)
/obj/item/assembly/interact(mob/user)
return ui_interact(user)