mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
Signalers will now work with the PDA Signalers.
Numpad may once again be used to type numbers and operators. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2539 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -1,48 +0,0 @@
|
||||
/obj/item/device/Nradio
|
||||
icon = 'radio.dmi'
|
||||
name = "station bounced radio"
|
||||
suffix = "\[3\]"
|
||||
icon_state = "walkietalkie"
|
||||
item_state = "walkietalkie"
|
||||
|
||||
flags = 450//FFFF what does this even mean likely conduct+onbelt+someothershit
|
||||
throw_speed = 2
|
||||
throw_range = 9
|
||||
w_class = 2
|
||||
g_amt = 25
|
||||
m_amt = 75
|
||||
|
||||
var
|
||||
//General things
|
||||
frequency = 1459 //Default freq
|
||||
broadcasting = 0 //Mike
|
||||
listening = 1 //Speaker
|
||||
secured = 0 //Can you see our wires
|
||||
freerange = 0 // 0 - Sanitize frequencies, 1 - Full range
|
||||
|
||||
datum/radio_frequency/radio_connection = null
|
||||
list/datum/radio_frequency/secure_radio_connections = new
|
||||
|
||||
//Internal things
|
||||
obj/item/weapon/syndicate_uplink/uplink = null //If we have an uplink one of our freqs will activate it
|
||||
wires = WIRE_RECEIVE | WIRE_TRANSMIT //Active wires
|
||||
|
||||
list/channels = list() //see communications.dm for full list. First channes is a "default" for :h
|
||||
// "Example" = FREQ_LISTENING|FREQ_BROADCASTING
|
||||
|
||||
last_transmission //What is this
|
||||
obj/item/device/radio/patch_link = null //What is this
|
||||
|
||||
var/const
|
||||
WIRE_TRANSMIT = 1 //sends a signal, like to set off a bomb or electrocute someone, or talk
|
||||
WIRE_RECEIVE = 2 //we can hear things
|
||||
TRANSMISSION_DELAY = 5 // only 2/second/radio antispam protection
|
||||
FREQ_LISTENING = 1
|
||||
|
||||
|
||||
proc
|
||||
set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, frequency, RADIO_CHAT)
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
/obj/item/device/radio/signaler
|
||||
name = "Remote Signaling Device"
|
||||
desc = "Used to remotely activate devices."
|
||||
icon = 'new_assemblies.dmi'
|
||||
icon_state = "signaller"
|
||||
item_state = "signaler"
|
||||
var/code = 30
|
||||
w_class = 1
|
||||
frequency = 1457
|
||||
var/delay = 0
|
||||
|
||||
|
||||
attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(isscrewdriver(W))
|
||||
b_stat = !b_stat
|
||||
if(b_stat)
|
||||
user.show_message("\blue The [src.name] can now be attached!")
|
||||
else
|
||||
user.show_message("\blue The [src.name] is ready!")
|
||||
return
|
||||
else
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/device/radio/signaler/attack_self(mob/user as mob, flag1)
|
||||
user.machine = src
|
||||
interact(user,flag1)
|
||||
|
||||
/obj/item/device/radio/signaler/interact(mob/user as mob, flag1)
|
||||
var/t1
|
||||
if ((src.b_stat && !( flag1 )))
|
||||
t1 = text("-------<BR>\nGreen Wire: []<BR>\nRed Wire: []<BR>\nBlue Wire: []<BR>\n", (src.wires & 4 ? text("<A href='?src=\ref[];wires=4'>Cut Wire</A>", src) : text("<A href='?src=\ref[];wires=4'>Mend Wire</A>", src)), (src.wires & 2 ? text("<A href='?src=\ref[];wires=2'>Cut Wire</A>", src) : text("<A href='?src=\ref[];wires=2'>Mend Wire</A>", src)), (src.wires & 1 ? text("<A href='?src=\ref[];wires=1'>Cut Wire</A>", src) : text("<A href='?src=\ref[];wires=1'>Mend Wire</A>", src)))
|
||||
else
|
||||
t1 = "-------"
|
||||
var/dat = {"
|
||||
<TT>
|
||||
Speaker: [src.listening ? "<A href='byond://?src=\ref[src];listen=0'>Engaged</A>" : "<A href='byond://?src=\ref[src];listen=1'>Disengaged</A>"]<BR>
|
||||
<A href='byond://?src=\ref[src];send=1'>Send Signal</A><BR>
|
||||
<B>Frequency/Code</B> for signaler:<BR>
|
||||
Frequency:
|
||||
<A href='byond://?src=\ref[src];freq=-10'>-</A>
|
||||
<A href='byond://?src=\ref[src];freq=-2'>-</A>
|
||||
[format_frequency(src.frequency)]
|
||||
<A href='byond://?src=\ref[src];freq=2'>+</A>
|
||||
<A href='byond://?src=\ref[src];freq=10'>+</A><BR>
|
||||
|
||||
Code:
|
||||
<A href='byond://?src=\ref[src];code=-5'>-</A>
|
||||
<A href='byond://?src=\ref[src];code=-1'>-</A>
|
||||
[src.code]
|
||||
<A href='byond://?src=\ref[src];code=1'>+</A>
|
||||
<A href='byond://?src=\ref[src];code=5'>+</A><BR>
|
||||
[t1]
|
||||
</TT>"}
|
||||
user << browse(dat, "window=radio")
|
||||
onclose(user, "radio")
|
||||
return
|
||||
|
||||
/obj/item/device/radio/signaler/hear_talk()
|
||||
return
|
||||
|
||||
/obj/item/device/radio/signaler/send_hear()
|
||||
return
|
||||
|
||||
|
||||
/obj/item/device/radio/signaler/receive_signal(datum/signal/signal)
|
||||
if(!signal || (signal.encryption != code)) return 0
|
||||
|
||||
if (!( src.wires & 2 ))
|
||||
return
|
||||
|
||||
for(var/mob/O in hearers(1, src.loc))
|
||||
O.show_message(text("\icon[] *beep* *beep*", src), 3, "*beep* *beep*", 2)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/device/radio/signaler/proc/send_signal(message="ACTIVATE")
|
||||
|
||||
if(last_transmission && world.time < (last_transmission + TRANSMISSION_DELAY))
|
||||
return
|
||||
last_transmission = world.time
|
||||
|
||||
if (!( src.wires & 4 ))
|
||||
return
|
||||
|
||||
if((usr)&&(ismob(usr)))
|
||||
var/time = time2text(world.realtime,"hh:mm:ss")
|
||||
lastsignalers.Add("[time] <B>:</B> [usr.key] used [src] @ location ([src.loc.x],[src.loc.y],[src.loc.z]) <B>:</B> [format_frequency(frequency)]/[code]")
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.source = src
|
||||
signal.encryption = code
|
||||
signal.data["message"] = message
|
||||
|
||||
radio_connection.post_signal(src, signal)
|
||||
|
||||
return
|
||||
|
||||
/obj/item/device/radio/signaler/Topic(href, href_list)
|
||||
//..()
|
||||
if (usr.stat)
|
||||
return
|
||||
if (usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf)))
|
||||
usr.machine = src
|
||||
if (href_list["freq"])
|
||||
..()
|
||||
return
|
||||
else
|
||||
if (href_list["code"])
|
||||
src.code += text2num(href_list["code"])
|
||||
src.code = round(src.code)
|
||||
src.code = min(100, src.code)
|
||||
src.code = max(1, src.code)
|
||||
else
|
||||
if (href_list["send"])
|
||||
spawn( 0 )
|
||||
src.send_signal("ACTIVATE")
|
||||
return
|
||||
else
|
||||
if (href_list["listen"])
|
||||
src.listening = text2num(href_list["listen"])
|
||||
else
|
||||
if (href_list["wires"])
|
||||
var/t1 = text2num(href_list["wires"])
|
||||
if (!( istype(usr.equipped(), /obj/item/weapon/wirecutters) ))
|
||||
return
|
||||
if ((!( src.b_stat ) && !( src.master )))
|
||||
return
|
||||
if (t1 & 1)
|
||||
if (src.wires & 1)
|
||||
src.wires &= 65534
|
||||
else
|
||||
src.wires |= 1
|
||||
else
|
||||
if (t1 & 2)
|
||||
if (src.wires & 2)
|
||||
src.wires &= 65533
|
||||
else
|
||||
src.wires |= 2
|
||||
else
|
||||
if (t1 & 4)
|
||||
if (src.wires & 4)
|
||||
src.wires &= 65531
|
||||
else
|
||||
src.wires |= 4
|
||||
src.add_fingerprint(usr)
|
||||
if (!src.master)
|
||||
if (istype(src.loc, /mob))
|
||||
attack_self(src.loc)
|
||||
else
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if (M.client)
|
||||
src.attack_self(M)
|
||||
else
|
||||
if (istype(src.master.loc, /mob))
|
||||
src.attack_self(src.master.loc)
|
||||
else
|
||||
for(var/mob/M in viewers(1, src.master))
|
||||
if (M.client)
|
||||
src.attack_self(M)
|
||||
else
|
||||
usr << browse(null, "window=radio")
|
||||
return
|
||||
return
|
||||
Reference in New Issue
Block a user