mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Merge pull request #7134 from AnturK/assemblies
Makes assembly parts work with wires
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
var/obj/item/device/assembly_holder/holder = null
|
||||
var/cooldown = 0//To prevent spam
|
||||
var/wires = WIRE_RECEIVE | WIRE_PULSE
|
||||
var/attachable = 0 // can this be attached to wires
|
||||
var/datum/wires/connected = null
|
||||
|
||||
var/const/WIRE_RECEIVE = 1 //Allows Pulsed(0) to call Activate()
|
||||
var/const/WIRE_PULSE = 2 //Allows Pulse(0) to act on the holder
|
||||
@@ -59,6 +61,9 @@
|
||||
|
||||
//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(var/radio = 0)
|
||||
if(src.connected && src.wires)
|
||||
connected.Pulse(src)
|
||||
return 1
|
||||
if(holder && (wires & WIRE_PULSE))
|
||||
holder.process_activation(src, 1, 0)
|
||||
if(holder && (wires & WIRE_PULSE_SPECIAL))
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
m_amt = 800
|
||||
g_amt = 200
|
||||
origin_tech = "magnets=1"
|
||||
attachable = 1
|
||||
|
||||
var/scanning = 0
|
||||
var/timing = 0
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
g_amt = 120
|
||||
origin_tech = "magnets=1"
|
||||
wires = WIRE_RECEIVE | WIRE_PULSE | WIRE_RADIO_PULSE | WIRE_RADIO_RECEIVE
|
||||
attachable = 1
|
||||
|
||||
var/code = 30
|
||||
var/frequency = 1457
|
||||
var/delay = 0
|
||||
var/datum/wires/connected = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
/obj/item/device/assembly/signaler/New()
|
||||
@@ -126,14 +126,6 @@ Code:
|
||||
if(S) 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
|
||||
if(signal.encryption != code) return 0
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
m_amt = 500
|
||||
g_amt = 50
|
||||
origin_tech = "magnets=1"
|
||||
attachable = 1
|
||||
|
||||
var/timing = 0
|
||||
var/time = 5
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
g_amt = 50
|
||||
origin_tech = "magnets=1"
|
||||
flags = HEAR
|
||||
attachable = 1
|
||||
var/listening = 0
|
||||
var/recorded = "" //the activation message
|
||||
|
||||
|
||||
Reference in New Issue
Block a user