Allows all assemblies to be attached to wires (#29880)

* Allows all assemblies to be attached to wires

* Making it for all items it's inside, like things that use wires

* Better way to write it

* Typo

* Mobs were a mistake

Co-authored-by: kanef <kanef9x@protonmail.com>
This commit is contained in:
kane-f
2021-06-26 15:14:51 +01:00
committed by GitHub
parent cf56af02eb
commit 0a5c00edf7
4 changed files with 17 additions and 23 deletions

View File

@@ -36,6 +36,7 @@ var/global/list/assembly_short_name_to_type = list() //Please, I beg you, don't
var/list/attached_overlays = list()
var/obj/item/device/assembly_holder/holder = null
var/cooldown = 0//To prevent spam
var/datum/wires/connected = null
var/wires = WIRE_RECEIVE | WIRE_PULSE
var/const/WIRE_RECEIVE = 1 //Allows Pulsed(0) to call Activate()
@@ -228,7 +229,9 @@ var/global/list/assembly_short_name_to_type = list() //Please, I beg you, don't
/obj/item/device/assembly/pulse(var/radio = 0)
if(istype(holder, /obj/item/device/assembly_frame))
if(src.connected && src.wires)
connected.Pulse(src)
else if(istype(holder, /obj/item/device/assembly_frame))
var/obj/item/device/assembly_frame/AB = holder
AB.receive_pulse(src)

View File

@@ -101,7 +101,7 @@
T = holder.loc
else if (holder.master && isturf(holder.loc.loc)) //or in an assembly rigging something that's on the floor?
T = holder.loc.loc
else if(istype(loc,/obj/item/weapon/grenade) && isturf(loc.loc)) // or in a grenade that's on the floor? (can it even activate grenades without igniters?)
else if(isobj(loc) && isturf(loc.loc)) // or in a grenade on the floor/wired item? (can it even activate grenades without igniters?)
T = loc.loc
if(T)
if(!beam)

View File

@@ -18,7 +18,6 @@
var/code = 30
var/frequency = 1457
var/delay = 0
var/datum/wires/connected = null
var/datum/radio_frequency/radio_connection
var/deadman = 0
@@ -158,14 +157,6 @@
S.pulse(0)
return 0*/
/obj/item/device/assembly/signaler/pulse(var/radio = 0)
if(src.connected && src.wires)
connected.Pulse(src)
else
return ..(radio)
/obj/item/device/assembly/signaler/receive_signal(datum/signal/signal)
if(!signal)
return 0