mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-14 08:34:16 +01:00
Bit of blob work.
Moved the radio defines into the actual radio code files. Fixed a few runtimes. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2229 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -103,7 +103,7 @@ Frequency:
|
||||
|
||||
/obj/item/weapon/hand_tele/attack_self(mob/user as mob)
|
||||
var/turf/current_location = get_turf(user)//What turf is the user on?
|
||||
if(!current_location||current_location.z==2)//If turf was not found or they're on z level 2.
|
||||
if(!current_location||current_location.z==2||current_location.z>=7)//If turf was not found or they're on z level 2 or >7 which does not currently exist.
|
||||
user << "The [src] is malfunctioning."
|
||||
return
|
||||
var/list/L = list( )
|
||||
@@ -119,7 +119,8 @@ Frequency:
|
||||
if(T.x>world.maxx-4 || T.x<4) continue //putting them at the edge is dumb
|
||||
if(T.y>world.maxy-4 || T.y<4) continue
|
||||
turfs += T
|
||||
L["None (Dangerous)"] = pick(turfs)
|
||||
if(turfs.len)
|
||||
L["None (Dangerous)"] = pick(turfs)
|
||||
var/t1 = input(user, "Please select a teleporter to lock in on.", "Hand Teleporter") in L
|
||||
if ((user.equipped() != src || user.stat || user.restrained()))
|
||||
return
|
||||
|
||||
@@ -1,9 +1,20 @@
|
||||
/obj/item/device/radio/beacon
|
||||
name = "Tracking Beacon"
|
||||
desc = "A beacon used by a teleporter."
|
||||
icon_state = "beacon"
|
||||
item_state = "signaler"
|
||||
var/code = "electronic"
|
||||
origin_tech = "bluespace=1"
|
||||
|
||||
|
||||
/obj/item/device/radio/beacon/hear_talk()
|
||||
return
|
||||
|
||||
|
||||
/obj/item/device/radio/beacon/send_hear()
|
||||
return null
|
||||
|
||||
|
||||
/obj/item/device/radio/beacon/verb/alter_signal(t as text)
|
||||
set name = "Alter Beacon's Signal"
|
||||
set category = "Object"
|
||||
@@ -16,7 +27,8 @@
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/device/radio/beacon/bacon //Probably a better way of doing this, I'm lazy.
|
||||
proc/digest_delay()
|
||||
spawn(600)
|
||||
del(src)
|
||||
del(src)
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
/obj/item/device/radio/headset
|
||||
name = "Radio Headset"
|
||||
desc = "An intercom that fits over the head."
|
||||
icon_state = "headset"
|
||||
item_state = "headset"
|
||||
g_amt = 0
|
||||
m_amt = 75
|
||||
var
|
||||
protective_temperature = 0
|
||||
translate_binary = 0
|
||||
translate_hive = 0
|
||||
|
||||
/obj/item/device/radio/headset/traitor
|
||||
translate_binary = 1
|
||||
channels = list("Syndicate" = 1)
|
||||
origin_tech = "syndicate=3"
|
||||
|
||||
/obj/item/device/radio/headset/headset_sec
|
||||
name = "Security Radio Headset"
|
||||
desc = "This is used by your elite security force. To access the security channel, use :s."
|
||||
icon_state = "sec_headset"
|
||||
item_state = "headset"
|
||||
channels = list("Security" = 1)
|
||||
|
||||
/obj/item/device/radio/headset/headset_eng
|
||||
name = "Engineering Radio Headset"
|
||||
desc = "When the engineers wish to chat like girls. To access the engineering channel, use :e. "
|
||||
icon_state = "eng_headset"
|
||||
item_state = "headset"
|
||||
channels = list("Engineering" = 1)
|
||||
|
||||
/obj/item/device/radio/headset/headset_rob
|
||||
name = "Robotics Radio Headset"
|
||||
desc = "Made specifically for the roboticists who cannot decide between departments. To access the engineering channel, use :e. For research, use :n."
|
||||
icon_state = "rob_headset"
|
||||
item_state = "headset"
|
||||
channels = list("Engineering" = 1, "Science" = 1)
|
||||
|
||||
/obj/item/device/radio/headset/headset_med
|
||||
name = "Medical Radio Headset"
|
||||
desc = "A headset for the trained staff of the medbay. To access the medical channel, use :m."
|
||||
icon_state = "med_headset"
|
||||
item_state = "headset"
|
||||
channels = list("Medical" = 1)
|
||||
|
||||
/obj/item/device/radio/headset/headset_sci
|
||||
name = "Science Radio Headset"
|
||||
desc = "A sciency headset. Like usual. To access the science channel, use :n."
|
||||
icon_state = "com_headset"
|
||||
item_state = "headset"
|
||||
channels = list("Science" = 1)
|
||||
|
||||
/obj/item/device/radio/headset/headset_medsci
|
||||
name = "Medical Research Radio Headset"
|
||||
desc = "A headset that is a result of the mating between medical and science. To access the medical channel, use :m. For science, use :n."
|
||||
icon_state = "med_headset"
|
||||
item_state = "headset"
|
||||
channels = list("Medical" = 1, "Science" = 1)
|
||||
|
||||
/obj/item/device/radio/headset/headset_com
|
||||
name = "Command Radio Headset"
|
||||
desc = "A headset with a commanding channel. To access the command channel, use :c."
|
||||
icon_state = "com_headset"
|
||||
item_state = "headset"
|
||||
channels = list("Command" = 1)
|
||||
|
||||
/obj/item/device/radio/headset/heads/captain
|
||||
name = "Captain's Headset"
|
||||
desc = "The headset of the boss. Channels are as follows: :c - command, :s - security, :e - engineering, :d - mining, :q - cargo, :m - medical, :n - science."
|
||||
icon_state = "com_headset"
|
||||
item_state = "headset"
|
||||
channels = list("Command" = 1, "Science" = 0, "Medical" = 0, "Security" = 1, "Engineering" = 0, "Mining" = 0, "Cargo" = 0)
|
||||
|
||||
/obj/item/device/radio/headset/heads/rd
|
||||
name = "Research Director's Headset"
|
||||
desc = "Headset of the researching God. To access the science channel, use :n. For command, use :c."
|
||||
icon_state = "com_headset"
|
||||
item_state = "headset"
|
||||
channels = list("Science" = 1, "Command" = 1)
|
||||
|
||||
/obj/item/device/radio/headset/heads/hos
|
||||
name = "Head of Security's Headset"
|
||||
desc = "The headset of the man who protects your worthless lifes. To access the security channel, use :s. For command, use :c."
|
||||
icon_state = "com_headset"
|
||||
item_state = "headset"
|
||||
channels = list("Security" = 1, "Command" = 1)
|
||||
|
||||
/obj/item/device/radio/headset/heads/ce
|
||||
name = "Chief Engineer's Headset"
|
||||
desc = "The headset of the guy who is in charge of morons. To access the engineering channel, use :e. For command, use :c."
|
||||
icon_state = "com_headset"
|
||||
item_state = "headset"
|
||||
channels = list("Engineering" = 1, "Command" = 1)
|
||||
|
||||
/obj/item/device/radio/headset/heads/cmo
|
||||
name = "Chief Medical Officer's Headset"
|
||||
desc = "The headset of the highly trained medical chief. To access the medical channel, use :m. For command, use :c."
|
||||
icon_state = "com_headset"
|
||||
item_state = "headset"
|
||||
channels = list("Medical" = 1, "Command" = 1)
|
||||
|
||||
/obj/item/device/radio/headset/heads/hop
|
||||
name = "Head of Personnel's Headset"
|
||||
desc = "The headset of the guy who will one day be captain. Channels are as follows: :c - command, :s - security, :q - cargo, :d - mining."
|
||||
icon_state = "com_headset"
|
||||
item_state = "headset"
|
||||
channels = list("Command" = 1, "Security" = 0, "Cargo" = 1, "Mining" = 0)
|
||||
|
||||
|
||||
/obj/item/device/radio/headset/headset_mine
|
||||
name = "Mining Radio Headset"
|
||||
desc = "Headset used by miners. How useless. To access the mining channel, use :d."
|
||||
icon_state = "mine_headset"
|
||||
item_state = "headset"
|
||||
channels = list("Mining" = 1)
|
||||
|
||||
|
||||
|
||||
/obj/item/device/radio/headset/heads/qm
|
||||
name = "Quartermaster's Headset"
|
||||
desc = "The headset of the man who control your toiletpaper supply. To access the cargo channel, use :q. For mining, use :d."
|
||||
icon_state = "cargo_headset"
|
||||
item_state = "headset"
|
||||
channels = list("Cargo" = 1, "Mining" = 1)
|
||||
|
||||
|
||||
/obj/item/device/radio/headset/headset_cargo
|
||||
name = "Cargo Radio Headset"
|
||||
desc = "Headset used by the QM's slaves. To access the cargo channel, use :q."
|
||||
icon_state = "cargo_headset"
|
||||
item_state = "headset"
|
||||
channels = list("Cargo" = 1)
|
||||
@@ -1,39 +1,52 @@
|
||||
/obj/item/device/radio/intercom/attack_ai(mob/user as mob)
|
||||
src.add_fingerprint(user)
|
||||
spawn (0)
|
||||
attack_self(user)
|
||||
/obj/item/device/radio/intercom
|
||||
name = "Station Intercom (Radio)"
|
||||
desc = "Talk through this."
|
||||
icon_state = "intercom"
|
||||
anchored = 1
|
||||
var/number = 0
|
||||
var/anyai = 1
|
||||
var/mob/living/silicon/ai/ai = list()
|
||||
|
||||
/obj/item/device/radio/intercom/attack_paw(mob/user as mob)
|
||||
if ((ticker && ticker.mode.name == "monkey"))
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/item/device/radio/intercom/attack_hand(mob/user as mob)
|
||||
src.add_fingerprint(user)
|
||||
spawn (0)
|
||||
attack_self(user)
|
||||
attack_ai(mob/user as mob)
|
||||
src.add_fingerprint(user)
|
||||
spawn (0)
|
||||
attack_self(user)
|
||||
|
||||
/obj/item/device/radio/intercom/send_hear()
|
||||
if (!(src.wires & WIRE_RECEIVE))
|
||||
return
|
||||
if (!src.listening)
|
||||
return
|
||||
attack_paw(mob/user as mob)
|
||||
if ((ticker && ticker.mode.name == "monkey"))
|
||||
return src.attack_hand(user)
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
var/list/hear = hearers(7, T)
|
||||
var/list/V
|
||||
//find mobs in lockers, cryo and intellycards
|
||||
for (var/mob/M in world)
|
||||
if (isturf(M.loc))
|
||||
continue //if M can hear us it is already was found by hearers()
|
||||
if (!M.client)
|
||||
continue //skip monkeys and leavers
|
||||
if (!V) //lasy initialisation
|
||||
V = view(7, T)
|
||||
if (get_turf(M) in V) //this slow, but I don't think we'd have a lot of wardrobewhores every round --rastaf0
|
||||
hear+=M
|
||||
return hear
|
||||
|
||||
/obj/item/device/radio/intercom/hear_talk(mob/M as mob, msg)
|
||||
if(!src.anyai && !(M in src.ai))
|
||||
return
|
||||
..()
|
||||
attack_hand(mob/user as mob)
|
||||
src.add_fingerprint(user)
|
||||
spawn (0)
|
||||
attack_self(user)
|
||||
|
||||
|
||||
send_hear()
|
||||
if (!(src.wires & WIRE_RECEIVE))
|
||||
return
|
||||
if (!src.listening)
|
||||
return
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
var/list/hear = hearers(7, T)
|
||||
var/list/V
|
||||
//find mobs in lockers, cryo and intellycards
|
||||
for(var/mob/M in world)
|
||||
if (isturf(M.loc))
|
||||
continue //if M can hear us it is already was found by hearers()
|
||||
if (!M.client)
|
||||
continue //skip monkeys and leavers
|
||||
if (!V) //lasy initialisation
|
||||
V = view(7, T)
|
||||
if (get_turf(M) in V) //this slow, but I don't think we'd have a lot of wardrobewhores every round --rastaf0
|
||||
hear+=M
|
||||
return hear
|
||||
|
||||
|
||||
hear_talk(mob/M as mob, msg)
|
||||
if(!src.anyai && !(M in src.ai))
|
||||
return
|
||||
..()
|
||||
@@ -1,3 +1,49 @@
|
||||
/obj/item/device/radio
|
||||
icon = 'radio.dmi'
|
||||
name = "station bounced radio"
|
||||
suffix = "\[3\]"
|
||||
icon_state = "walkietalkie"
|
||||
item_state = "walkietalkie"
|
||||
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
|
||||
g_amt = 25
|
||||
m_amt = 75
|
||||
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
|
||||
var
|
||||
datum/radio_frequency/radio_connection
|
||||
list/datum/radio_frequency/secure_radio_connections = new
|
||||
proc
|
||||
set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, frequency, RADIO_CHAT)
|
||||
|
||||
|
||||
|
||||
/obj/item/device/radio/New()
|
||||
..()
|
||||
if(radio_controller)
|
||||
@@ -16,15 +62,6 @@
|
||||
for (var/ch_name in channels)
|
||||
secure_radio_connections[ch_name] = radio_controller.add_object(src, radiochannels[ch_name], RADIO_CHAT)
|
||||
|
||||
/obj/item/device/radio
|
||||
var
|
||||
datum/radio_frequency/radio_connection
|
||||
list/datum/radio_frequency/secure_radio_connections = new
|
||||
proc
|
||||
set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, frequency, RADIO_CHAT)
|
||||
|
||||
/obj/item/device/radio/attack_self(mob/user as mob)
|
||||
user.machine = src
|
||||
@@ -62,11 +99,7 @@
|
||||
|
||||
|
||||
/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>
|
||||
@@ -406,8 +439,3 @@ Microphone:"<A href='byond://?src=\ref[src];ch_name=[chan_name];talk=[!broad]'>
|
||||
for (var/ch_name in channels)
|
||||
channels[ch_name] = 0
|
||||
..()
|
||||
|
||||
/obj/item/device/radio/banana //Why is this even needed? So that it shows up as a banana in the chat log.
|
||||
name = "Banana Phone"
|
||||
icon = 'items.dmi'
|
||||
icon_state = "banana" //needs a new icon.
|
||||
@@ -143,7 +143,7 @@ Code:
|
||||
spawn(0)
|
||||
holder:Process_Activation(src)
|
||||
return
|
||||
// src.holder.receive_signal(signal)
|
||||
|
||||
|
||||
for(var/mob/O in hearers(1, src.loc))
|
||||
O.show_message(text("\icon[] *beep* *beep*", src), 3, "*beep* *beep*", 2)
|
||||
|
||||
Reference in New Issue
Block a user