mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-28 02:52:28 +00:00
RADIO HEADSET update by Barhandar and me:
Three new channels and new :h-like shortcuts for each channel.
shortcuts now are:
":r" = "right hand" (unchanged)
":l" = "left hand" (unchanged)
":i" = "intercom" (unchanged)
":h" = "department" (unchanged for everyone except captain)
":w" = "whisper" (NEW shortcut)
":b" = "binary" (CHANGED)
":a" = "alientalk" (unchanged)
":t" = "Syndicate" (NEW channel)
":c" = "Command" (NEW shortcut)
":n" = "Science" (NEW channel) ("n" because all other letters are occupied)
":m" = "Medical" (NEW shortcut)
":e" = "Engineering" (NEW shortcut)
":s" = "Security" (NEW shortcut)
Note:
":h" works as before, i.e. sends on engineering channel for engineers and CE, on medical channel for MD, CMO,etc and so on.
All heads have command channel in their headsets along with department channel.
Warden and QM aren't heads.
Captain have almost all channels in his/her headset, but some are switched off by default. The default channel for captain is "Command" now.
Bugs fixed:
If headset is tuned to other frequency dept channel don't work.
A receive wire in intercoms can be cut.
Some others bugs.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1020 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -3,26 +3,30 @@
|
||||
suffix = "\[3\]"
|
||||
icon_state = "walkietalkie"
|
||||
item_state = "walkietalkie"
|
||||
var/last_transmission
|
||||
var/frequency = 1459
|
||||
var/secure_frequency
|
||||
var/traitor_frequency = 0.0
|
||||
var/obj/item/device/radio/patch_link = null
|
||||
var/obj/item/weapon/syndicate_uplink/traitorradio = null
|
||||
var/wires = WIRE_SIGNAL | WIRE_RECEIVE | WIRE_TRANSMIT
|
||||
var/b_stat = 0.0
|
||||
var/broadcasting = null
|
||||
var/listening = 1.0
|
||||
var/freerange = 0 // 0 - Sanitize frequencies, 1 - Full range
|
||||
flags = 450.0
|
||||
var
|
||||
last_transmission
|
||||
frequency = 1459 //common chat
|
||||
traitor_frequency = 0 //tune to frequency to unlock traitor supplies
|
||||
obj/item/device/radio/patch_link = null
|
||||
obj/item/weapon/syndicate_uplink/traitorradio = null
|
||||
wires = WIRE_SIGNAL | WIRE_RECEIVE | WIRE_TRANSMIT
|
||||
b_stat = 0
|
||||
broadcasting = 0
|
||||
listening = 1
|
||||
freerange = 0 // 0 - Sanitize frequencies, 1 - Full range
|
||||
list/channels = list() //see communications.dm for full list. First channes is a "default" for :h
|
||||
// "Example" = FREQ_LISTENING|FREQ_BROADCASTING
|
||||
flags = 450
|
||||
throw_speed = 2
|
||||
throw_range = 9
|
||||
w_class = 2.0
|
||||
w_class = 2
|
||||
var/const
|
||||
WIRE_SIGNAL = 1 //sends a signal, like to set off a bomb or electrocute someone
|
||||
WIRE_RECEIVE = 2
|
||||
WIRE_TRANSMIT = 4
|
||||
TRANSMISSION_DELAY = 5 // only 2/second/radio
|
||||
FREQ_LISTENING = 1
|
||||
//FREQ_BROADCASTING = 2
|
||||
|
||||
/obj/item/device/radio/beacon
|
||||
name = "Tracking Beacon"
|
||||
@@ -39,62 +43,101 @@
|
||||
/obj/item/device/radio/electropack
|
||||
name = "Electropack"
|
||||
icon_state = "electropack0"
|
||||
var/code = 2.0
|
||||
var/on = 0.0
|
||||
var/code = 2
|
||||
var/on = 0
|
||||
var/e_pads = 0.0
|
||||
frequency = 1449
|
||||
w_class = 5.0
|
||||
flags = 323.0
|
||||
flags = 323
|
||||
item_state = "electropack"
|
||||
|
||||
/obj/item/device/radio/headset
|
||||
name = "Radio Headset"
|
||||
icon_state = "headset"
|
||||
item_state = "headset"
|
||||
var/protective_temperature = 0
|
||||
var/bintran = 0
|
||||
|
||||
/obj/item/device/radio/headset/traitor
|
||||
bintran = 1
|
||||
|
||||
/obj/item/device/radio/headset/headset_sec // -- TLE
|
||||
name = "Security Radio Headset"
|
||||
icon_state = "sec_headset"
|
||||
item_state = "headset"
|
||||
secure_frequency = 1359
|
||||
|
||||
/obj/item/device/radio/headset/headset_eng // -- TLE
|
||||
name = "Engineering Radio Headset"
|
||||
icon_state = "eng_headset"
|
||||
item_state = "headset"
|
||||
secure_frequency = 1357
|
||||
|
||||
/obj/item/device/radio/headset/headset_med // -- TLE
|
||||
name = "Medical Radio Headset"
|
||||
icon_state = "med_headset"
|
||||
item_state = "headset"
|
||||
secure_frequency = 1355
|
||||
|
||||
/obj/item/device/radio/headset/headset_com // -- TLE
|
||||
name = "Command Radio Headset"
|
||||
icon_state = "com_headset"
|
||||
item_state = "headset"
|
||||
secure_frequency = 1353
|
||||
|
||||
/obj/item/device/radio/intercom
|
||||
name = "Station Intercom (Radio)"
|
||||
icon_state = "intercom"
|
||||
anchored = 1.0
|
||||
var/number = 0
|
||||
var/anyai = 1
|
||||
var/mob/living/silicon/ai/ai = list()
|
||||
|
||||
/obj/item/device/radio/signaler
|
||||
name = "Remote Signaling Device"
|
||||
icon_state = "signaller"
|
||||
item_state = "signaler"
|
||||
var/code = 30.0
|
||||
w_class = 1.0
|
||||
var/code = 30
|
||||
w_class = 1
|
||||
frequency = 1457
|
||||
var/delay = 0
|
||||
var/airlock_wire = null
|
||||
|
||||
/obj/item/device/radio/intercom
|
||||
name = "Station Intercom (Radio)"
|
||||
icon_state = "intercom"
|
||||
anchored = 1
|
||||
var/number = 0
|
||||
var/anyai = 1
|
||||
var/mob/living/silicon/ai/ai = list()
|
||||
|
||||
/obj/item/device/radio/headset
|
||||
name = "Radio Headset"
|
||||
icon_state = "headset"
|
||||
item_state = "headset"
|
||||
var
|
||||
protective_temperature = 0
|
||||
translate_binary = 0
|
||||
translate_hive = 0
|
||||
|
||||
/obj/item/device/radio/headset/traitor
|
||||
translate_binary = 1
|
||||
channels = list("Syndicate" = 1)
|
||||
|
||||
/obj/item/device/radio/headset/headset_sec // -- TLE
|
||||
name = "Security Radio Headset"
|
||||
icon_state = "sec_headset"
|
||||
item_state = "headset"
|
||||
channels = list("Security" = 1)
|
||||
|
||||
/obj/item/device/radio/headset/headset_eng // -- TLE
|
||||
name = "Engineering Radio Headset"
|
||||
icon_state = "eng_headset"
|
||||
item_state = "headset"
|
||||
channels = list("Engineering" = 1)
|
||||
|
||||
/obj/item/device/radio/headset/headset_med // -- TLE
|
||||
name = "Medical Radio Headset"
|
||||
icon_state = "med_headset"
|
||||
item_state = "headset"
|
||||
channels = list("Medical" = 1)
|
||||
|
||||
/obj/item/device/radio/headset/headset_com // -- TLE
|
||||
name = "Command Radio Headset"
|
||||
icon_state = "com_headset"
|
||||
item_state = "headset"
|
||||
channels = list("Command" = 1)
|
||||
|
||||
/obj/item/device/radio/headset/headset_sci // -- Bar
|
||||
name = "Science Radio Headset"
|
||||
icon_state = "com_headset"
|
||||
item_state = "headset"
|
||||
channels = list("Science" = 1)
|
||||
|
||||
/obj/item/device/radio/headset/heads/captain // -- Bar
|
||||
name = "Captain's Headset"
|
||||
icon_state = "com_headset"
|
||||
item_state = "headset"
|
||||
channels = list("Command" = 1, "Science" = 0, "Medical" = 0, "Security" = 1, "Engineering" = 0)
|
||||
|
||||
/obj/item/device/radio/headset/heads/rd // -- Bar
|
||||
name = "Research Director's Headset"
|
||||
icon_state = "com_headset"
|
||||
item_state = "headset"
|
||||
channels = list("Science" = 1, "Command" = 1, "Medical" = 1)
|
||||
|
||||
/obj/item/device/radio/headset/heads/hos // -- Bar
|
||||
name = "Head of Security's Headset"
|
||||
icon_state = "com_headset"
|
||||
item_state = "headset"
|
||||
channels = list("Security" = 1, "Command" = 1)
|
||||
|
||||
/obj/item/device/radio/headset/heads/ce // -- Bar
|
||||
name = "Chief Engineer's Headset"
|
||||
icon_state = "com_headset"
|
||||
item_state = "headset"
|
||||
channels = list("Engineering" = 1, "Command" = 1)
|
||||
|
||||
/obj/item/device/radio/headset/heads/cmo // -- Bar
|
||||
name = "Chief Medical Officer's Headset"
|
||||
icon_state = "com_headset"
|
||||
item_state = "headset"
|
||||
channels = list("Medical" = 1, "Command" = 1)
|
||||
@@ -67,6 +67,7 @@ Radiochat range: 1441 to 1489
|
||||
|
||||
Radio:
|
||||
1459 - standard radio chat
|
||||
1351 - Science
|
||||
1353 - Command
|
||||
1355 - Medical
|
||||
1357 - Engineering
|
||||
@@ -75,8 +76,8 @@ Radio:
|
||||
1443 - Confession Intercom
|
||||
|
||||
Devices:
|
||||
1457 - RSD default
|
||||
1451 - tracking implant
|
||||
1457 - RSD default
|
||||
|
||||
On the map:
|
||||
1311 for prison shuttle console (in fact, it is not used)
|
||||
@@ -94,6 +95,21 @@ On the map:
|
||||
1455 for AI access
|
||||
*/
|
||||
|
||||
var/list/radiochannels = list(
|
||||
"Common" = 1459,
|
||||
"Science" = 1351,
|
||||
"Command" = 1353,
|
||||
"Medical" = 1355,
|
||||
"Engineering" = 1357,
|
||||
"Security" = 1359,
|
||||
"Deathsquad" = 1441,
|
||||
"Syndicate" = 1213,
|
||||
)
|
||||
//depenging helpers
|
||||
var/list/DEPT_FREQS = list(1351,1355,1357,1359,1213,1441)
|
||||
var/const/COMM_FREQ = 1353
|
||||
var/const/SYND_FREQ = 1213
|
||||
|
||||
#define TRANSMISSION_WIRE 0
|
||||
#define TRANSMISSION_RADIO 1
|
||||
|
||||
|
||||
@@ -396,7 +396,7 @@
|
||||
src.equip_if_possible(new /obj/item/device/flashlight/pen(src), slot_r_store)
|
||||
|
||||
if ("Captain")
|
||||
src.equip_if_possible(new /obj/item/device/radio/headset/headset_com (src), slot_ears) // -- TLE
|
||||
src.equip_if_possible(new /obj/item/device/radio/headset/heads/captain (src), slot_ears)
|
||||
src.equip_if_possible(new /obj/item/weapon/storage/backpack(src), slot_back)
|
||||
src.equip_if_possible(new /obj/item/device/pda/captain(src), slot_belt)
|
||||
src.equip_if_possible(new /obj/item/clothing/under/rank/captain(src), slot_w_uniform)
|
||||
@@ -443,6 +443,7 @@
|
||||
src.equip_if_possible(new /obj/item/device/flash(src), slot_l_store)
|
||||
|
||||
if ("Scientist")
|
||||
src.equip_if_possible(new /obj/item/device/radio/headset/headset_sci (src), slot_ears)
|
||||
src.equip_if_possible(new /obj/item/device/pda/toxins(src), slot_belt)
|
||||
src.equip_if_possible(new /obj/item/clothing/under/rank/scientist(src), slot_w_uniform)
|
||||
src.equip_if_possible(new /obj/item/clothing/shoes/white(src), slot_shoes)
|
||||
@@ -452,7 +453,7 @@
|
||||
src.equip_if_possible(new /obj/item/weapon/tank/air(src), slot_l_hand)
|
||||
|
||||
if ("Head of Security")
|
||||
src.equip_if_possible(new /obj/item/device/radio/headset/headset_sec (src), slot_ears) // -- TLE
|
||||
src.equip_if_possible(new /obj/item/device/radio/headset/heads/hos (src), slot_ears)
|
||||
src.equip_if_possible(new /obj/item/device/pda/heads(src), slot_belt)
|
||||
src.equip_if_possible(new /obj/item/clothing/under/rank/head_of_security(src), slot_w_uniform)
|
||||
src.equip_if_possible(new /obj/item/clothing/suit/armor/hos(src), slot_wear_suit)
|
||||
@@ -553,7 +554,7 @@
|
||||
src.equip_if_possible(new /obj/item/device/pda/quartermaster(src), slot_belt)
|
||||
|
||||
if ("Chief Engineer")
|
||||
src.equip_if_possible(new /obj/item/device/radio/headset/headset_eng (src), slot_ears) // -- TLE
|
||||
src.equip_if_possible(new /obj/item/device/radio/headset/heads/ce (src), slot_ears)
|
||||
src.equip_if_possible(new /obj/item/device/pda/heads(src), slot_belt)
|
||||
src.equip_if_possible(new /obj/item/clothing/gloves/yellow(src), slot_gloves)
|
||||
src.equip_if_possible(new /obj/item/clothing/shoes/brown(src), slot_shoes)
|
||||
@@ -562,7 +563,7 @@
|
||||
src.equip_if_possible(new /obj/item/clothing/under/rank/chief_engineer(src), slot_w_uniform)
|
||||
|
||||
if ("Research Director")
|
||||
src.equip_if_possible(new /obj/item/device/radio/headset/headset_com (src), slot_ears) // -- TLE
|
||||
src.equip_if_possible(new /obj/item/device/radio/headset/heads/rd (src), slot_ears)
|
||||
src.equip_if_possible(new /obj/item/device/pda/heads(src), slot_belt)
|
||||
src.equip_if_possible(new /obj/item/clothing/shoes/brown(src), slot_shoes)
|
||||
src.equip_if_possible(new /obj/item/clothing/under/rank/research_director(src), slot_w_uniform)
|
||||
@@ -572,7 +573,7 @@
|
||||
src.equip_if_possible(new /obj/item/device/flashlight/pen(src), slot_r_store)
|
||||
|
||||
if ("Chief Medical Officer")
|
||||
src.equip_if_possible(new /obj/item/device/radio/headset/headset_med (src), slot_ears) // -- TLE
|
||||
src.equip_if_possible(new /obj/item/device/radio/headset/heads/cmo (src), slot_ears)
|
||||
src.equip_if_possible(new /obj/item/device/pda/medical(src), slot_belt)
|
||||
src.equip_if_possible(new /obj/item/weapon/storage/backpack/medic (src), slot_back)
|
||||
src.equip_if_possible(new /obj/item/clothing/shoes/brown(src), slot_shoes)
|
||||
|
||||
@@ -96,14 +96,14 @@
|
||||
usr << browse(null, "window=radio")
|
||||
return
|
||||
return
|
||||
|
||||
/*
|
||||
/obj/item/device/radio/electropack/accept_rad(obj/item/device/radio/signaler/R as obj, message)
|
||||
|
||||
if ((istype(R, /obj/item/device/radio/signaler) && R.frequency == src.frequency && R.code == src.code))
|
||||
return 1
|
||||
else
|
||||
return null
|
||||
return
|
||||
return*/
|
||||
|
||||
/obj/item/device/radio/electropack/receive_signal(datum/signal/signal)
|
||||
if(!signal || (signal.encryption != code))
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
attack_self(user)
|
||||
|
||||
/obj/item/device/radio/intercom/send_hear()
|
||||
if (!(src.wires & WIRE_RECEIVE))
|
||||
return
|
||||
if (src.listening)
|
||||
return hearers(7, src.loc)
|
||||
|
||||
|
||||
@@ -12,12 +12,35 @@
|
||||
src.frequency = sanitize_frequency(src.frequency)
|
||||
|
||||
set_frequency(frequency)
|
||||
|
||||
for (var/ch_name in channels)
|
||||
secure_radio_connections[ch_name] = radio_controller.add_object(src, radiochannels[ch_name], RADIO_CHAT)
|
||||
/*
|
||||
if(src.secure_frequency)
|
||||
secure_radio_connection = radio_controller.add_object(src, secure_frequency, RADIO_CHAT)
|
||||
if(src.channels.Find("Medical"))
|
||||
med_connection = radio_controller.add_object(src, med_freq, RADIO_CHAT)
|
||||
if(src.channels.Find("Science"))
|
||||
sci_connection = radio_controller.add_object(src, sci_freq, RADIO_CHAT)
|
||||
if(src.channels.Find("Security"))
|
||||
sec_connection = radio_controller.add_object(src, sec_freq, RADIO_CHAT)
|
||||
if(src.channels.Find("Command"))
|
||||
com_connection = radio_controller.add_object(src, com_freq, RADIO_CHAT)
|
||||
if(src.channels.Find("Engineer"))
|
||||
eng_connection = radio_controller.add_object(src, eng_freq, RADIO_CHAT)*/
|
||||
|
||||
/obj/item/device/radio
|
||||
var/datum/radio_frequency/radio_connection
|
||||
var/datum/radio_frequency/secure_radio_connection // Shared by Mport2004 for the security headsets -- TLE
|
||||
var
|
||||
datum/radio_frequency/radio_connection
|
||||
|
||||
list/datum/radio_frequency/secure_radio_connections = new
|
||||
/*
|
||||
datum/radio_frequency/secure_radio_connection // Shared by Mport2004 for the security headsets -- TLE
|
||||
datum/radio_frequency/med_connection
|
||||
datum/radio_frequency/sci_connection
|
||||
datum/radio_frequency/com_connection
|
||||
datum/radio_frequency/eng_connection
|
||||
datum/radio_frequency/sec_connection*/
|
||||
|
||||
proc
|
||||
set_frequency(new_frequency)
|
||||
@@ -27,17 +50,11 @@
|
||||
|
||||
/obj/item/device/radio/attack_self(mob/user as mob)
|
||||
user.machine = src
|
||||
var/t1
|
||||
if (src.b_stat)
|
||||
t1 = {"
|
||||
-------<BR>
|
||||
Green Wire: <A href='byond://?src=\ref[src];wires=4'>[src.wires & 4 ? "Cut" : "Mend"] Wire</A><BR>
|
||||
Red Wire: <A href='byond://?src=\ref[src];wires=2'>[src.wires & 2 ? "Cut" : "Mend"] Wire</A><BR>
|
||||
Blue Wire: <A href='byond://?src=\ref[src];wires=1'>[src.wires & 1 ? "Cut" : "Mend"] Wire</A><BR>"}
|
||||
else
|
||||
t1 = "-------"
|
||||
interact(user)
|
||||
|
||||
/obj/item/device/radio/proc/interact(mob/user as mob)
|
||||
var/dat = {"
|
||||
<TT>
|
||||
<html><head><title>[src]</title></head><body><TT>
|
||||
Microphone: [src.broadcasting ? "<A href='byond://?src=\ref[src];talk=0'>Engaged</A>" : "<A href='byond://?src=\ref[src];talk=1'>Disengaged</A>"]<BR>
|
||||
Speaker: [src.listening ? "<A href='byond://?src=\ref[src];listen=0'>Engaged</A>" : "<A href='byond://?src=\ref[src];listen=1'>Disengaged</A>"]<BR>
|
||||
Frequency:
|
||||
@@ -45,103 +62,130 @@ Frequency:
|
||||
<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>
|
||||
[t1]
|
||||
</TT>"}
|
||||
<A href='byond://?src=\ref[src];freq=10'>+</A><BR>"}
|
||||
|
||||
for (var/ch_name in channels)
|
||||
dat+=text_sec_channel(ch_name, channels[ch_name])
|
||||
dat+={"[text_wires()]</TT></body></html>"}
|
||||
user << browse(dat, "window=radio")
|
||||
onclose(user, "radio")
|
||||
return
|
||||
|
||||
/obj/item/device/radio/proc/text_wires()
|
||||
if (!src.b_stat)
|
||||
return ""
|
||||
return {"
|
||||
<hr>
|
||||
Green Wire: <A href='byond://?src=\ref[src];wires=4'>[(src.wires & 4) ? "Cut" : "Mend"] Wire</A><BR>
|
||||
Red Wire: <A href='byond://?src=\ref[src];wires=2'>[(src.wires & 2) ? "Cut" : "Mend"] Wire</A><BR>
|
||||
Blue Wire: <A href='byond://?src=\ref[src];wires=1'>[(src.wires & 1) ? "Cut" : "Mend"] Wire</A><BR>"}
|
||||
|
||||
|
||||
/obj/item/device/radio/proc/text_sec_channel(var/chan_name, var/chan_stat)
|
||||
//var/broad = (chan_stat&FREQ_BROADCASTING)!=0
|
||||
var/list = !!(chan_stat&FREQ_LISTENING)!=0
|
||||
/*
|
||||
Microphone:"<A href='byond://?src=\ref[src];ch_name=[chan_name];talk=[!broad]'> [broad ? "Engaged" : "Disengaged"]</A>"
|
||||
*/
|
||||
return {"
|
||||
<B>[chan_name]</B><br>
|
||||
Speaker: <A href='byond://?src=\ref[src];ch_name=[chan_name];listen=[!list]'>[list ? "Engaged" : "Disengaged"]</A><BR>"}
|
||||
|
||||
/obj/item/device/radio/Topic(href, href_list)
|
||||
//..()
|
||||
if (usr.stat)
|
||||
return
|
||||
if ((usr.contents.Find(src) || in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon)))
|
||||
usr.machine = src
|
||||
if (href_list["track"])
|
||||
var/mob/target = locate(href_list["track"])
|
||||
var/mob/living/silicon/ai/A = locate(href_list["track2"])
|
||||
A.ai_actual_track(target)
|
||||
return
|
||||
if (href_list["freq"])
|
||||
var/new_frequency = sanitize_frequency(frequency + text2num(href_list["freq"]))
|
||||
set_frequency(new_frequency)
|
||||
|
||||
if (src.traitor_frequency && src.frequency == src.traitor_frequency)
|
||||
usr.machine = null
|
||||
usr << browse(null, "window=radio")
|
||||
onclose(usr, "radio")
|
||||
// now transform the regular radio, into a (disguised)syndicate uplink!
|
||||
var/obj/item/weapon/syndicate_uplink/T = src.traitorradio
|
||||
var/obj/item/device/radio/R = src
|
||||
R.loc = T
|
||||
T.loc = usr
|
||||
R.layer = 0
|
||||
if (usr.client)
|
||||
usr.client.screen -= R
|
||||
if (usr.r_hand == R)
|
||||
usr.u_equip(R)
|
||||
usr.r_hand = T
|
||||
else
|
||||
usr.u_equip(R)
|
||||
usr.l_hand = T
|
||||
R.loc = T
|
||||
T.layer = 20
|
||||
T.attack_self(usr)
|
||||
return
|
||||
else
|
||||
if (href_list["talk"])
|
||||
src.broadcasting = text2num(href_list["talk"])
|
||||
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 (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
|
||||
if (!( src.master ))
|
||||
if (istype(src.loc, /mob))
|
||||
attack_self(src.loc)
|
||||
else
|
||||
src.updateDialog()
|
||||
else
|
||||
if (istype(src.master.loc, /mob))
|
||||
src.attack_self(src.master.loc)
|
||||
else
|
||||
src.updateDialog()
|
||||
src.add_fingerprint(usr)
|
||||
else
|
||||
if (\
|
||||
!(\
|
||||
istype(usr, /mob/living/silicon) || \
|
||||
(\
|
||||
usr.contents.Find(src) || \
|
||||
( in_range(src, usr) && istype(src.loc, /turf) )\
|
||||
)\
|
||||
)\
|
||||
)
|
||||
usr << browse(null, "window=radio")
|
||||
return
|
||||
usr.machine = src
|
||||
if (href_list["track"])
|
||||
var/mob/target = locate(href_list["track"])
|
||||
var/mob/living/silicon/ai/A = locate(href_list["track2"])
|
||||
A.ai_actual_track(target)
|
||||
return
|
||||
else if (href_list["freq"])
|
||||
var/new_frequency = (frequency + text2num(href_list["freq"]))
|
||||
if (!src.freerange || (src.frequency < 1200 || src.frequency > 1600))
|
||||
new_frequency = sanitize_frequency(new_frequency)
|
||||
set_frequency(new_frequency)
|
||||
|
||||
/obj/item/device/radio/talk_into(mob/M as mob, message, secure)
|
||||
if (src.traitor_frequency && src.frequency == src.traitor_frequency)
|
||||
usr.machine = null
|
||||
usr << browse(null, "window=radio")
|
||||
// now transform the regular radio, into a (disguised)syndicate uplink!
|
||||
var/obj/item/weapon/syndicate_uplink/T = src.traitorradio
|
||||
var/obj/item/device/radio/R = src
|
||||
R.loc = T
|
||||
T.loc = usr
|
||||
R.layer = 0
|
||||
if (usr.client)
|
||||
usr.client.screen -= R
|
||||
if (usr.r_hand == R)
|
||||
usr.u_equip(R)
|
||||
usr.r_hand = T
|
||||
else
|
||||
usr.u_equip(R)
|
||||
usr.l_hand = T
|
||||
R.loc = T
|
||||
T.layer = 20
|
||||
T.attack_self(usr)
|
||||
return
|
||||
else if (href_list["talk"])
|
||||
src.broadcasting = text2num(href_list["talk"])
|
||||
else if (href_list["listen"])
|
||||
var/chan_name = href_list["ch_name"]
|
||||
if (!chan_name)
|
||||
src.listening = text2num(href_list["listen"])
|
||||
else
|
||||
if (channels[chan_name] & FREQ_LISTENING)
|
||||
channels[chan_name] &= ~FREQ_LISTENING
|
||||
else
|
||||
channels[chan_name] |= FREQ_LISTENING
|
||||
else if (href_list["wires"])
|
||||
var/t1 = text2num(href_list["wires"])
|
||||
if (!( istype(usr.equipped(), /obj/item/weapon/wirecutters) ))
|
||||
return
|
||||
if (src.wires & t1)
|
||||
src.wires &= ~t1
|
||||
else
|
||||
src.wires |= t1
|
||||
if (!( src.master ))
|
||||
if (istype(src.loc, /mob))
|
||||
interact(src.loc)
|
||||
else
|
||||
src.updateDialog()
|
||||
else
|
||||
if (istype(src.master.loc, /mob))
|
||||
interact(src.master.loc)
|
||||
else
|
||||
src.updateDialog()
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
/obj/item/device/radio/talk_into(mob/M as mob, message, channel)
|
||||
|
||||
var/datum/radio_frequency/connection = null // Code shared by Mport2004 for Security Headsets -- TLE
|
||||
var/datum/display_freq = src.frequency
|
||||
if(secure && src.secure_radio_connection)
|
||||
connection = src.secure_radio_connection
|
||||
display_freq = src.secure_frequency
|
||||
if(channel && src.channels && src.channels.len > 0)
|
||||
if (channel == "department")
|
||||
//world << "DEBUG: channel=\"[channel]\" switching to \"[src.channels[1]]\""
|
||||
channel = src.channels[1]
|
||||
connection = secure_radio_connections[channel]
|
||||
else
|
||||
connection = src.radio_connection
|
||||
secure = 0
|
||||
channel = null
|
||||
if (!istype(connection))
|
||||
return
|
||||
var/display_freq = connection.frequency
|
||||
|
||||
//world << "DEBUG: used channel=\"[channel]\" frequency= \"[display_freq]\" connection.devices.len = [connection.devices.len]"
|
||||
|
||||
var/eqjobname
|
||||
|
||||
@@ -157,18 +201,19 @@ Frequency:
|
||||
else
|
||||
eqjobname = "Unknown"
|
||||
|
||||
if (!(src.wires & 4))
|
||||
if (!(src.wires & WIRE_TRANSMIT))
|
||||
return
|
||||
|
||||
var/list/receive = list()
|
||||
|
||||
//for (var/obj/item/device/radio/R in radio_connection.devices)
|
||||
for (var/obj/item/device/radio/R in connection.devices["[RADIO_CHAT]"]) // Modified for security headset code -- TLE
|
||||
if(R.accept_rad(src, message))
|
||||
for (var/i in R.send_hear())
|
||||
if (!(i in receive))
|
||||
receive += i
|
||||
//if(R.accept_rad(src, message))
|
||||
for (var/i in R.send_hear(display_freq))
|
||||
if (!(i in receive))
|
||||
receive += i
|
||||
|
||||
//world << "DEBUG: receive.len=[receive.len]"
|
||||
var/list/heard_masked = list() // masked name or no real name
|
||||
var/list/heard_normal = list() // normal message
|
||||
var/list/heard_voice = list() // voice message
|
||||
@@ -187,29 +232,35 @@ Frequency:
|
||||
heard_garbled += R
|
||||
|
||||
if (length(heard_masked) || length(heard_normal) || length(heard_voice) || length(heard_garbled))
|
||||
var/part_a = "<span class='game radio'><span class='name'>"
|
||||
var/part_a = "<span class='radio'><span class='name'>"
|
||||
//var/part_b = "</span><b> \icon[src]\[[format_frequency(src.frequency)]\]</b> <span class='message'>"
|
||||
var/part_b = "</span><b> \icon[src]\[[format_frequency(display_freq)]\]</b> <span class='message'>" // Tweaked for security headsets -- TLE
|
||||
var/freq_text = (display_freq!=SYND_FREQ) ? format_frequency(display_freq) : "#unkn"
|
||||
var/part_b = "</span><b> \icon[src]\[[freq_text]\]</b> <span class='message'>" // Tweaked for security headsets -- TLE
|
||||
var/part_c = "</span></span>"
|
||||
|
||||
if(findtext(part_b, "135.3") || findtext(part_b, "135.5") || findtext(part_b, "135.7") || findtext(part_b, "135.9"))
|
||||
if (display_freq==SYND_FREQ)
|
||||
part_a = "<span class='syndradio'><span class='name'>"
|
||||
else if (display_freq==COMM_FREQ)
|
||||
part_a = "<span class='comradio'><span class='name'>"
|
||||
else if (display_freq in DEPT_FREQS)
|
||||
part_a = "<span class='deptradio'><span class='name'>"
|
||||
|
||||
var/quotedmsg = M.say_quote(message)
|
||||
if (length(heard_masked))
|
||||
var/rendered = "[part_a][M.name][part_b][M.say_quote(message)][part_c]"
|
||||
var/rendered = "[part_a][M.name][part_b][quotedmsg][part_c]"
|
||||
|
||||
for (var/mob/R in heard_masked)
|
||||
if(istype(R, /mob/living/silicon/ai))
|
||||
R.show_message("[part_a]<a href='byond://?src=\ref[src];track2=\ref[R];track=\ref[M]'>[M.name] ([eqjobname]) </a>[part_b][M.say_quote(message)][part_c]", 2)
|
||||
R.show_message("[part_a]<a href='byond://?src=\ref[src];track2=\ref[R];track=\ref[M]'>[M.name] ([eqjobname]) </a>[part_b][quotedmsg][part_c]", 2)
|
||||
else
|
||||
R.show_message(rendered, 2)
|
||||
|
||||
if (length(heard_normal))
|
||||
var/rendered = "[part_a][M.real_name][part_b][M.say_quote(message)][part_c]"
|
||||
var/rendered = "[part_a][M.real_name][part_b][quotedmsg][part_c]"
|
||||
|
||||
for (var/mob/R in heard_normal)
|
||||
if(istype(R, /mob/living/silicon/ai))
|
||||
R.show_message("[part_a]<a href='byond://?src=\ref[src];track2=\ref[R];track=\ref[M]'>[M.real_name] ([eqjobname]) </a>[part_b][M.say_quote(message)][part_c]", 2)
|
||||
R.show_message("[part_a]<a href='byond://?src=\ref[src];track2=\ref[R];track=\ref[M]'>[M.real_name] ([eqjobname]) </a>[part_b][quotedmsg][part_c]", 2)
|
||||
else
|
||||
R.show_message(rendered, 2)
|
||||
|
||||
@@ -223,41 +274,56 @@ Frequency:
|
||||
R.show_message(rendered, 2)
|
||||
|
||||
if (length(heard_garbled))
|
||||
var/rendered = "[part_a][M.voice_name][part_b][M.say_quote(stars(message))][part_c]"
|
||||
quotedmsg = M.say_quote(stars(message))
|
||||
var/rendered = "[part_a][M.voice_name][part_b][quotedmsg][part_c]"
|
||||
|
||||
for (var/mob/R in heard_voice)
|
||||
if(istype(R, /mob/living/silicon/ai))
|
||||
R.show_message("[part_a]<a href='byond://?src=\ref[src];track2=\ref[R];track=\ref[M]'>[M.voice_name]</a>[part_b][M.say_quote(stars(message))][part_c]", 2)
|
||||
R.show_message("[part_a]<a href='byond://?src=\ref[src];track2=\ref[R];track=\ref[M]'>[M.voice_name]</a>[part_b][quotedmsg][part_c]", 2)
|
||||
else
|
||||
R.show_message(rendered, 2)
|
||||
|
||||
/obj/item/device/radio/hear_talk(mob/M as mob, msg)
|
||||
if (src.broadcasting)
|
||||
talk_into(M, msg)
|
||||
|
||||
/*
|
||||
/obj/item/device/radio/proc/accept_rad(obj/item/device/radio/R as obj, message)
|
||||
|
||||
if ((R.frequency == src.frequency && message))
|
||||
return 1
|
||||
else if
|
||||
|
||||
else
|
||||
return null
|
||||
return
|
||||
|
||||
/obj/item/device/radio/proc/send_hear()
|
||||
*/
|
||||
/obj/item/device/radio/proc/send_hear(freq)
|
||||
if(last_transmission && world.time < (last_transmission + TRANSMISSION_DELAY))
|
||||
return
|
||||
last_transmission = world.time
|
||||
if ((src.listening && src.wires & 2))
|
||||
var/list/hear = hearers(1, src.loc)
|
||||
if (!(src.wires & WIRE_RECEIVE))
|
||||
return
|
||||
if (!freq) //recieved on main frequency
|
||||
if (!src.listening)
|
||||
return
|
||||
else
|
||||
var/accept = (freq==frequency && src.listening)
|
||||
if (!accept)
|
||||
for (var/ch_name in channels)
|
||||
var/datum/radio_frequency/RF = secure_radio_connections[ch_name]
|
||||
if (RF.frequency==freq && (channels[ch_name]&FREQ_LISTENING))
|
||||
accept = 1
|
||||
break
|
||||
if (!accept)
|
||||
return
|
||||
var/list/hear = hearers(1, src.loc)
|
||||
|
||||
// modified so that a mob holding the radio is always a hearer of it
|
||||
// this fixes radio problems when inside something (e.g. mulebot)
|
||||
|
||||
if(ismob(loc))
|
||||
if(! hear.Find(loc) )
|
||||
hear += loc
|
||||
return hear
|
||||
return
|
||||
// modified so that a mob holding the radio is always a hearer of it
|
||||
// this fixes radio problems when inside something (e.g. mulebot)
|
||||
if(ismob(loc))
|
||||
if(! (loc in hear) )
|
||||
hear += loc
|
||||
return hear
|
||||
|
||||
/obj/item/device/radio/examine()
|
||||
set src in view()
|
||||
@@ -279,9 +345,7 @@ Frequency:
|
||||
user.show_message("\blue The radio can now be attached and modified!")
|
||||
else
|
||||
user.show_message("\blue The radio can no longer be modified or attached!")
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if (M.client)
|
||||
src.attack_self(M)
|
||||
src.updateDialog()
|
||||
//Foreach goto(83)
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
@@ -289,4 +353,6 @@ Frequency:
|
||||
/obj/item/device/radio/emp_act(severity)
|
||||
broadcasting = 0
|
||||
listening = 0
|
||||
for (var/ch_name in channels)
|
||||
channels[ch_name] = 0
|
||||
..()
|
||||
|
||||
@@ -84,6 +84,7 @@
|
||||
src.fingerprints = from.fingerprints
|
||||
src.fingerprintshidden = from.fingerprintshidden
|
||||
src.fingerprintslast = from.fingerprintslast
|
||||
//TODO bloody overlay
|
||||
|
||||
/datum/stack_recipe
|
||||
var/title = "ERROR"
|
||||
|
||||
@@ -685,7 +685,7 @@
|
||||
|
||||
if (istype(src.ears, /obj/item/device/radio/headset))
|
||||
var/obj/item/device/radio/headset/H = src.ears
|
||||
src.robot_talk_understand = H.bintran
|
||||
src.robot_talk_understand = H.translate_binary
|
||||
|
||||
if (src.stat == 2 || src.mutations & 4)
|
||||
src.sight |= SEE_TURFS
|
||||
|
||||
@@ -4,23 +4,27 @@
|
||||
if (!message)
|
||||
return
|
||||
|
||||
log_say("[src.name]/[src.key] : [message]")
|
||||
|
||||
if (length(message) >= 1)
|
||||
if (copytext(message, 1, 2) != "*")
|
||||
if (src.miming)
|
||||
return
|
||||
|
||||
if (src.muted || src.silent)
|
||||
return
|
||||
if (src.miming && copytext(message, 1, 2) != "*")
|
||||
return
|
||||
|
||||
if (src.stat == 2)
|
||||
return src.say_dead(message)
|
||||
|
||||
if (src.muted || src.silent)
|
||||
return
|
||||
|
||||
// wtf?
|
||||
if (src.stat)
|
||||
return
|
||||
|
||||
// Mute disability
|
||||
if (src.sdisabilities & 2)
|
||||
return
|
||||
|
||||
if (istype(src.wear_mask, /obj/item/clothing/mask/muzzle))
|
||||
return
|
||||
|
||||
// emotes
|
||||
if (copytext(message, 1, 2) == "*" && !src.stat)
|
||||
return src.emote(copytext(message, 2))
|
||||
@@ -29,13 +33,6 @@
|
||||
if (istype(src, /mob/living/carbon/human) && src.name != src.real_name)
|
||||
var/mob/living/carbon/human/H = src
|
||||
alt_name = " (as [H.get_visible_name()])"
|
||||
// Mute disability
|
||||
if (src.sdisabilities & 2)
|
||||
return
|
||||
|
||||
if (istype(src.wear_mask, /obj/item/clothing/mask/muzzle))
|
||||
return
|
||||
|
||||
var/italics = 0
|
||||
var/message_range = null
|
||||
var/message_mode = null
|
||||
@@ -49,47 +46,51 @@
|
||||
message_mode = "headset"
|
||||
message = copytext(message, 2)
|
||||
|
||||
|
||||
else if (length(message) >= 2)
|
||||
if (copytext(message, 1, 3) == ":r")
|
||||
message_mode = "right hand"
|
||||
message = copytext(message, 3)
|
||||
var/channel_prefix = copytext(message, 1, 3)
|
||||
|
||||
else if (copytext(message, 1, 3) == ":l")
|
||||
message_mode = "left hand"
|
||||
message = copytext(message, 3)
|
||||
|
||||
else if (copytext(message, 1, 3) == ":h" || (copytext(message, 1, 3) == ":<3A>" ))
|
||||
if (ishuman(src))
|
||||
message_mode = "secure headset"
|
||||
message = copytext(message, 3)
|
||||
|
||||
/*else if (copytext(message, 1, 3) == ":w")
|
||||
message_mode = "whisper"
|
||||
message = copytext(message, 3)*/
|
||||
|
||||
else if (copytext(message, 1, 3) == ":i")
|
||||
message_mode = "intercom"
|
||||
message = copytext(message, 3)
|
||||
|
||||
else if ((copytext(message, 1, 3) == ":s" || (copytext(message, 1, 3) == ":<3A>" )) && src.robot_talk_understand)
|
||||
message = copytext(message, 3)
|
||||
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
src.robot_talk(message)
|
||||
return
|
||||
|
||||
else if ((copytext(message, 1, 3) == ":a" || (copytext(message, 1, 3) == ":<3A>")) && src.alien_talk_understand)
|
||||
message = copytext(message, 3)
|
||||
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
src.alien_talk(message)
|
||||
return
|
||||
var/list/keys = list(
|
||||
":r" = "right hand",
|
||||
":l" = "left hand",
|
||||
":i" = "intercom",
|
||||
":h" = "department",
|
||||
":c" = "Command",
|
||||
":n" = "Science",
|
||||
":m" = "Medical",
|
||||
":e" = "Engineering",
|
||||
":s" = "Security",
|
||||
":w" = "whisper",
|
||||
":b" = "binary",
|
||||
":a" = "alientalk",
|
||||
":t" = "Syndicate",
|
||||
|
||||
//kinda localization -- rastaf0
|
||||
//same keys as above, but on russian keyboard layout. This file uses cp1251 as encoding.
|
||||
":<EFBFBD>" = "right hand",
|
||||
":<3A>" = "left hand",
|
||||
":<3A>" = "intercom",
|
||||
":<3A>" = "department",
|
||||
":<3A>" = "Command",
|
||||
":<3A>" = "Science",
|
||||
":<EFBFBD>" = "Medical",
|
||||
":<3A>" = "Engineering",
|
||||
":<3A>" = "Security",
|
||||
":<3A>" = "whisper",
|
||||
":<3A>" = "binary",
|
||||
":<3A>" = "alientalk",
|
||||
":<3A>" = "Syndicate",
|
||||
)
|
||||
|
||||
message_mode = keys[channel_prefix]
|
||||
//world << "channel_prefix=[channel_prefix]; message_mode=[message_mode]"
|
||||
if (message_mode)
|
||||
message = trim(copytext(message, 3))
|
||||
if (!ishuman(src) && (message_mode=="department" || (message_mode in radiochannels)))
|
||||
message_mode = null //only humans can use headsets
|
||||
|
||||
if (!message)
|
||||
return
|
||||
|
||||
if (src.stuttering)
|
||||
message = stutter(message)
|
||||
|
||||
// :downs:
|
||||
if (src.brainloss >= 60)
|
||||
message = dd_replacetext(message, " am ", " ")
|
||||
@@ -98,12 +99,18 @@
|
||||
message = dd_replacetext(message, "you", "u")
|
||||
message = dd_replacetext(message, "help", "halp")
|
||||
message = dd_replacetext(message, "grief", "grife")
|
||||
message = dd_replacetext(message, "space", "spess")
|
||||
message = dd_replacetext(message, "carp", "crap")
|
||||
if(prob(50))
|
||||
message = uppertext(message)
|
||||
message = "[message][stutter(pick("!", "!!", "!!!"))]"
|
||||
message += "[stutter(pick("!", "!!", "!!!"))]"
|
||||
if(!src.stuttering && prob(15))
|
||||
message = stutter(message)
|
||||
|
||||
if (src.stuttering)
|
||||
message = stutter(message)
|
||||
|
||||
/* //qw do not have beesease atm.
|
||||
if(src.virus)
|
||||
if(src.virus.name=="beesease" && src.virus.stage>=2)
|
||||
if(prob(src.virus.stage*10))
|
||||
@@ -111,7 +118,7 @@
|
||||
message = "B"
|
||||
for(var/i=0,i<bzz,i++)
|
||||
message += "Z"
|
||||
|
||||
*/
|
||||
|
||||
switch (message_mode)
|
||||
if ("headset")
|
||||
@@ -142,11 +149,6 @@
|
||||
message_range = 1
|
||||
italics = 1
|
||||
|
||||
//Might put this back if people are used to the old system.
|
||||
/*if ("whisper")
|
||||
message_range = 1
|
||||
italics = 1*/
|
||||
|
||||
if ("intercom")
|
||||
for (var/obj/item/device/radio/intercom/I in view(1, null))
|
||||
I.talk_into(src, message)
|
||||
@@ -154,6 +156,36 @@
|
||||
message_range = 1
|
||||
italics = 1
|
||||
|
||||
//I see no reason to restrict such way of whispering
|
||||
if ("whisper")
|
||||
src.whisper(message)
|
||||
return
|
||||
|
||||
if ("binary")
|
||||
//message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN)) //seems redundant
|
||||
src.robot_talk(message)
|
||||
return
|
||||
|
||||
if ("alientalk")
|
||||
//message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN)) //seems redundant
|
||||
src.alien_talk(message)
|
||||
return
|
||||
|
||||
if ("department")
|
||||
if (src:ears)
|
||||
src:ears.talk_into(src, message, message_mode)
|
||||
message_range = 1
|
||||
italics = 1
|
||||
/////SPECIAL HEADSETS START
|
||||
else
|
||||
//world << "SPECIAL HEADSETS"
|
||||
if (message_mode in radiochannels)
|
||||
if (src:ears)
|
||||
src:ears.talk_into(src, message, message_mode)
|
||||
message_range = 1
|
||||
italics = 1
|
||||
/////SPECIAL HEADSETS END
|
||||
|
||||
for (var/obj/O in view(message_range, src))
|
||||
spawn (0)
|
||||
if (O)
|
||||
@@ -233,5 +265,7 @@
|
||||
for (var/mob/M in world)
|
||||
if (istype(M, /mob/new_player))
|
||||
continue
|
||||
if (M.stat > 1 && !(M in heard_a))
|
||||
if (M.stat >= 2 && !(M in heard_a))
|
||||
M.show_message(rendered, 2)
|
||||
|
||||
log_say("[src.name]/[src.key] : [message]")
|
||||
@@ -89,8 +89,19 @@ h1, h2, h3, h4, h5, h6
|
||||
|
||||
.deptradio
|
||||
{
|
||||
color: #993399
|
||||
color: #993399;
|
||||
}
|
||||
|
||||
.comradio
|
||||
{
|
||||
color: #ACA82D;
|
||||
}
|
||||
|
||||
.syndradio
|
||||
{
|
||||
color: #6D3F40;
|
||||
}
|
||||
|
||||
.alert
|
||||
{
|
||||
color: #ff0000;
|
||||
|
||||
Reference in New Issue
Block a user