Ohkay
This commit is contained in:
@@ -246,7 +246,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
|
||||
var/datum/asset/assets = get_asset_datum(/datum/asset/spritesheet/pipes)
|
||||
assets.send(user)
|
||||
|
||||
ui = new(user, src, ui_key, "rpd", name, 300, 550, master_ui, state)
|
||||
ui = new(user, src, ui_key, "rpd", name, 425, 472, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/item/pipe_dispenser/ui_data(mob/user)
|
||||
@@ -313,9 +313,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
|
||||
playeffect = FALSE
|
||||
if("mode")
|
||||
var/n = text2num(params["mode"])
|
||||
if(n == 2 && !(mode&1) && !(mode&2))
|
||||
mode |= 3
|
||||
else if(mode&n)
|
||||
if(mode & n)
|
||||
mode &= ~n
|
||||
else
|
||||
mode |= n
|
||||
@@ -324,6 +322,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
|
||||
spark_system.start()
|
||||
effectcooldown = world.time + 100
|
||||
playsound(get_turf(src), 'sound/effects/pop.ogg', 50, 0)
|
||||
return TRUE
|
||||
|
||||
/obj/item/pipe_dispenser/pre_attack(atom/A, mob/user)
|
||||
if(!user.IsAdvancedToolUser() || istype(A, /turf/open/space/transit))
|
||||
|
||||
@@ -1,228 +1,226 @@
|
||||
GLOBAL_LIST_EMPTY(GPS_list)
|
||||
/obj/item/gps
|
||||
name = "global positioning system"
|
||||
desc = "Helping lost spacemen find their way through the planets since 2016."
|
||||
icon = 'icons/obj/telescience.dmi'
|
||||
icon_state = "gps-c"
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
slot_flags = ITEM_SLOT_BELT
|
||||
obj_flags = UNIQUE_RENAME
|
||||
var/gpstag = "COM0"
|
||||
var/emped = FALSE
|
||||
var/tracking = TRUE
|
||||
var/updating = TRUE //Automatic updating of GPS list. Can be set to manual by user.
|
||||
var/global_mode = TRUE //If disabled, only GPS signals of the same Z level are shown
|
||||
|
||||
/obj/item/gps/examine(mob/user)
|
||||
. = ..()
|
||||
var/turf/curr = get_turf(src)
|
||||
. += "The screen says: [get_area_name(curr, TRUE)] ([curr.x], [curr.y], [curr.z])"
|
||||
. += "<span class='notice'>Alt-click to switch it [tracking ? "off":"on"].</span>"
|
||||
|
||||
/obj/item/gps/Initialize()
|
||||
. = ..()
|
||||
GLOB.GPS_list += src
|
||||
name = "global positioning system ([gpstag])"
|
||||
add_overlay("working")
|
||||
|
||||
/obj/item/gps/Destroy()
|
||||
GLOB.GPS_list -= src
|
||||
return ..()
|
||||
|
||||
/obj/item/gps/emp_act(severity)
|
||||
. = ..()
|
||||
if (. & EMP_PROTECT_SELF)
|
||||
return
|
||||
emped = TRUE
|
||||
cut_overlay("working")
|
||||
add_overlay("emp")
|
||||
addtimer(CALLBACK(src, .proc/reboot), 300, TIMER_UNIQUE|TIMER_OVERRIDE) //if a new EMP happens, remove the old timer so it doesn't reactivate early
|
||||
SStgui.close_uis(src) //Close the UI control if it is open.
|
||||
|
||||
/obj/item/gps/proc/reboot()
|
||||
emped = FALSE
|
||||
cut_overlay("emp")
|
||||
add_overlay("working")
|
||||
|
||||
/obj/item/gps/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(!user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
toggletracking(user)
|
||||
return TRUE
|
||||
|
||||
/obj/item/gps/proc/toggletracking(mob/user)
|
||||
if(!user.canUseTopic(src, BE_CLOSE))
|
||||
return //user not valid to use gps
|
||||
if(emped)
|
||||
to_chat(user, "It's busted!")
|
||||
return
|
||||
if(tracking)
|
||||
cut_overlay("working")
|
||||
to_chat(user, "[src] is no longer tracking, or visible to other GPS devices.")
|
||||
tracking = FALSE
|
||||
else
|
||||
add_overlay("working")
|
||||
to_chat(user, "[src] is now tracking, and visible to other GPS devices.")
|
||||
tracking = TRUE
|
||||
|
||||
|
||||
/obj/item/gps/ui_interact(mob/user, ui_key = "gps", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) // Remember to use the appropriate state.
|
||||
if(emped)
|
||||
to_chat(user, "[src] fizzles weakly.")
|
||||
return
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
var/gps_window_height = 300 + GLOB.GPS_list.len * 20 // Variable window height, depending on how many GPS units there are to show
|
||||
ui = new(user, src, ui_key, "gps", "Global Positioning System", 600, gps_window_height, master_ui, state) //width, height
|
||||
ui.open()
|
||||
|
||||
ui.set_autoupdate(state = updating)
|
||||
|
||||
|
||||
/obj/item/gps/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["power"] = tracking
|
||||
data["tag"] = gpstag
|
||||
data["updating"] = updating
|
||||
data["globalmode"] = global_mode
|
||||
if(!tracking || emped) //Do not bother scanning if the GPS is off or EMPed
|
||||
return data
|
||||
|
||||
var/turf/curr = get_turf(src)
|
||||
data["current"] = "[get_area_name(curr, TRUE)] ([curr.x], [curr.y], [curr.z])"
|
||||
|
||||
var/list/signals = list()
|
||||
data["signals"] = list()
|
||||
|
||||
for(var/gps in GLOB.GPS_list)
|
||||
var/obj/item/gps/G = gps
|
||||
if(G.emped || !G.tracking || G == src)
|
||||
continue
|
||||
var/turf/pos = get_turf(G)
|
||||
if(!global_mode && pos.z != curr.z)
|
||||
continue
|
||||
var/list/signal = list()
|
||||
signal["entrytag"] = G.gpstag //Name or 'tag' of the GPS
|
||||
signal["area"] = get_area_name(G, TRUE)
|
||||
signal["coord"] = "[pos.x], [pos.y], [pos.z]"
|
||||
if(pos.z == curr.z) //Distance/Direction calculations for same z-level only
|
||||
signal["dist"] = max(get_dist(curr, pos), 0) //Distance between the src and remote GPS turfs
|
||||
signal["degrees"] = round(Get_Angle(curr, pos)) //0-360 degree directional bearing, for more precision.
|
||||
var/direction = uppertext(dir2text(get_dir(curr, pos))) //Direction text (East, etc). Not as precise, but still helpful.
|
||||
if(!direction)
|
||||
direction = "CENTER"
|
||||
signal["degrees"] = "N/A"
|
||||
signal["direction"] = direction
|
||||
|
||||
signals += list(signal) //Add this signal to the list of signals
|
||||
data["signals"] = signals
|
||||
return data
|
||||
|
||||
|
||||
|
||||
/obj/item/gps/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("rename")
|
||||
var/a = input("Please enter desired tag.", name, gpstag) as text
|
||||
a = copytext(sanitize(a), 1, 20)
|
||||
gpstag = a
|
||||
. = TRUE
|
||||
name = "global positioning system ([gpstag])"
|
||||
|
||||
if("power")
|
||||
toggletracking(usr)
|
||||
. = TRUE
|
||||
if("updating")
|
||||
updating = !updating
|
||||
. = TRUE
|
||||
if("globalmode")
|
||||
global_mode = !global_mode
|
||||
. = TRUE
|
||||
|
||||
|
||||
/obj/item/gps/science
|
||||
icon_state = "gps-s"
|
||||
gpstag = "SCI0"
|
||||
|
||||
/obj/item/gps/engineering
|
||||
icon_state = "gps-e"
|
||||
gpstag = "ENG0"
|
||||
|
||||
/obj/item/gps/mining
|
||||
icon_state = "gps-m"
|
||||
gpstag = "MINE0"
|
||||
desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
|
||||
|
||||
/obj/item/gps/cyborg
|
||||
icon_state = "gps-b"
|
||||
gpstag = "BORG0"
|
||||
desc = "A mining cyborg internal positioning system. Used as a recovery beacon for damaged cyborg assets, or a collaboration tool for mining teams."
|
||||
|
||||
/obj/item/gps/cyborg/Initialize()
|
||||
. = ..()
|
||||
ADD_TRAIT(src, TRAIT_NODROP, CYBORG_ITEM_TRAIT)
|
||||
|
||||
/obj/item/gps/internal
|
||||
icon_state = null
|
||||
item_flags = ABSTRACT
|
||||
gpstag = "Eerie Signal"
|
||||
desc = "Report to a coder immediately."
|
||||
invisibility = INVISIBILITY_MAXIMUM
|
||||
var/obj/item/implant/gps/implant
|
||||
|
||||
/obj/item/gps/internal/Initialize(mapload, obj/item/implant/gps/_implant)
|
||||
. = ..()
|
||||
implant = _implant
|
||||
|
||||
/obj/item/gps/internal/Destroy()
|
||||
if(implant?.imp_in)
|
||||
qdel(implant)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/gps/internal/mining
|
||||
icon_state = "gps-m"
|
||||
gpstag = "MINER"
|
||||
desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
|
||||
|
||||
/obj/item/gps/internal/base
|
||||
gpstag = "NT_AUX"
|
||||
desc = "A homing signal from Nanotrasen's mining base."
|
||||
|
||||
/obj/item/gps/visible_debug
|
||||
name = "visible GPS"
|
||||
gpstag = "ADMIN"
|
||||
desc = "This admin-spawn GPS unit leaves the coordinates visible \
|
||||
on any turf that it passes over, for debugging. Especially useful \
|
||||
for marking the area around the transition edges."
|
||||
var/list/turf/tagged
|
||||
|
||||
/obj/item/gps/visible_debug/Initialize()
|
||||
. = ..()
|
||||
tagged = list()
|
||||
START_PROCESSING(SSfastprocess, src)
|
||||
|
||||
/obj/item/gps/visible_debug/process()
|
||||
var/turf/T = get_turf(src)
|
||||
if(T)
|
||||
// I assume it's faster to color,tag and OR the turf in, rather
|
||||
// then checking if its there
|
||||
T.color = RANDOM_COLOUR
|
||||
T.maptext = "[T.x],[T.y],[T.z]"
|
||||
tagged |= T
|
||||
|
||||
/obj/item/gps/visible_debug/proc/clear()
|
||||
while(tagged.len)
|
||||
var/turf/T = pop(tagged)
|
||||
T.color = initial(T.color)
|
||||
T.maptext = initial(T.maptext)
|
||||
|
||||
/obj/item/gps/visible_debug/Destroy()
|
||||
if(tagged)
|
||||
clear()
|
||||
tagged = null
|
||||
STOP_PROCESSING(SSfastprocess, src)
|
||||
. = ..()
|
||||
GLOBAL_LIST_EMPTY(GPS_list)
|
||||
/obj/item/gps
|
||||
name = "global positioning system"
|
||||
desc = "Helping lost spacemen find their way through the planets since 2016."
|
||||
icon = 'icons/obj/telescience.dmi'
|
||||
icon_state = "gps-c"
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
slot_flags = ITEM_SLOT_BELT
|
||||
obj_flags = UNIQUE_RENAME
|
||||
var/gpstag = "COM0"
|
||||
var/emped = FALSE
|
||||
var/tracking = TRUE
|
||||
var/updating = TRUE //Automatic updating of GPS list. Can be set to manual by user.
|
||||
var/global_mode = TRUE //If disabled, only GPS signals of the same Z level are shown
|
||||
|
||||
/obj/item/gps/examine(mob/user)
|
||||
. = ..()
|
||||
var/turf/curr = get_turf(src)
|
||||
. += "The screen says: [get_area_name(curr, TRUE)] ([curr.x], [curr.y], [curr.z])"
|
||||
. += "<span class='notice'>Alt-click to switch it [tracking ? "off":"on"].</span>"
|
||||
|
||||
/obj/item/gps/Initialize()
|
||||
. = ..()
|
||||
GLOB.GPS_list += src
|
||||
name = "global positioning system ([gpstag])"
|
||||
add_overlay("working")
|
||||
|
||||
/obj/item/gps/Destroy()
|
||||
GLOB.GPS_list -= src
|
||||
return ..()
|
||||
|
||||
/obj/item/gps/emp_act(severity)
|
||||
. = ..()
|
||||
if (. & EMP_PROTECT_SELF)
|
||||
return
|
||||
emped = TRUE
|
||||
cut_overlay("working")
|
||||
add_overlay("emp")
|
||||
addtimer(CALLBACK(src, .proc/reboot), 300, TIMER_UNIQUE|TIMER_OVERRIDE) //if a new EMP happens, remove the old timer so it doesn't reactivate early
|
||||
SStgui.close_uis(src) //Close the UI control if it is open.
|
||||
|
||||
/obj/item/gps/proc/reboot()
|
||||
emped = FALSE
|
||||
cut_overlay("emp")
|
||||
add_overlay("working")
|
||||
|
||||
/obj/item/gps/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(!user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
toggletracking(user)
|
||||
return TRUE
|
||||
|
||||
/obj/item/gps/proc/toggletracking(mob/user)
|
||||
if(!user.canUseTopic(src, BE_CLOSE))
|
||||
return //user not valid to use gps
|
||||
if(emped)
|
||||
to_chat(user, "It's busted!")
|
||||
return
|
||||
if(tracking)
|
||||
cut_overlay("working")
|
||||
to_chat(user, "[src] is no longer tracking, or visible to other GPS devices.")
|
||||
tracking = FALSE
|
||||
else
|
||||
add_overlay("working")
|
||||
to_chat(user, "[src] is now tracking, and visible to other GPS devices.")
|
||||
tracking = TRUE
|
||||
|
||||
|
||||
/obj/item/gps/ui_interact(mob/user, ui_key = "gps", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) // Remember to use the appropriate state.
|
||||
if(emped)
|
||||
to_chat(user, "[src] fizzles weakly.")
|
||||
return
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
// Variable window height, depending on how many GPS units there are
|
||||
// to show, clamped to relatively safe range.
|
||||
var/gps_window_height = CLAMP(325 + GLOB.GPS_list.len * 14, 325, 700)
|
||||
ui = new(user, src, ui_key, "gps", "Global Positioning System", 470, gps_window_height, master_ui, state) //width, height
|
||||
ui.open()
|
||||
|
||||
ui.set_autoupdate(state = updating)
|
||||
|
||||
|
||||
/obj/item/gps/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["power"] = tracking
|
||||
data["tag"] = gpstag
|
||||
data["updating"] = updating
|
||||
data["globalmode"] = global_mode
|
||||
if(!tracking || emped) //Do not bother scanning if the GPS is off or EMPed
|
||||
return data
|
||||
|
||||
var/turf/curr = get_turf(src)
|
||||
data["current"] = "[get_area_name(curr, TRUE)] ([curr.x], [curr.y], [curr.z])"
|
||||
data["currentArea"] = "[get_area_name(curr, TRUE)]"
|
||||
data["currentCoords"] = "[curr.x], [curr.y], [curr.z]"
|
||||
|
||||
var/list/signals = list()
|
||||
data["signals"] = list()
|
||||
|
||||
for(var/gps in GLOB.GPS_list)
|
||||
var/obj/item/gps/G = gps
|
||||
if(G.emped || !G.tracking || G == src)
|
||||
continue
|
||||
var/turf/pos = get_turf(G)
|
||||
if(!global_mode && pos.z != curr.z)
|
||||
continue
|
||||
var/list/signal = list()
|
||||
signal["entrytag"] = G.gpstag //Name or 'tag' of the GPS
|
||||
signal["coords"] = "[pos.x], [pos.y], [pos.z]"
|
||||
if(pos.z == curr.z) //Distance/Direction calculations for same z-level only
|
||||
signal["dist"] = max(get_dist(curr, pos), 0) //Distance between the src and remote GPS turfs
|
||||
signal["degrees"] = round(Get_Angle(curr, pos)) //0-360 degree directional bearing, for more precision.
|
||||
|
||||
signals += list(signal) //Add this signal to the list of signals
|
||||
data["signals"] = signals
|
||||
return data
|
||||
|
||||
|
||||
|
||||
/obj/item/gps/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("rename")
|
||||
var/a = input("Please enter desired tag.", name, gpstag) as text
|
||||
a = copytext(sanitize(a), 1, 20)
|
||||
gpstag = a
|
||||
. = TRUE
|
||||
name = "global positioning system ([gpstag])"
|
||||
|
||||
if("power")
|
||||
toggletracking(usr)
|
||||
. = TRUE
|
||||
if("updating")
|
||||
updating = !updating
|
||||
. = TRUE
|
||||
if("globalmode")
|
||||
global_mode = !global_mode
|
||||
. = TRUE
|
||||
|
||||
|
||||
/obj/item/gps/science
|
||||
icon_state = "gps-s"
|
||||
gpstag = "SCI0"
|
||||
|
||||
/obj/item/gps/engineering
|
||||
icon_state = "gps-e"
|
||||
gpstag = "ENG0"
|
||||
|
||||
/obj/item/gps/mining
|
||||
icon_state = "gps-m"
|
||||
gpstag = "MINE0"
|
||||
desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
|
||||
|
||||
/obj/item/gps/cyborg
|
||||
icon_state = "gps-b"
|
||||
gpstag = "BORG0"
|
||||
desc = "A mining cyborg internal positioning system. Used as a recovery beacon for damaged cyborg assets, or a collaboration tool for mining teams."
|
||||
|
||||
/obj/item/gps/cyborg/Initialize()
|
||||
. = ..()
|
||||
ADD_TRAIT(src, TRAIT_NODROP, CYBORG_ITEM_TRAIT)
|
||||
|
||||
/obj/item/gps/internal
|
||||
icon_state = null
|
||||
item_flags = ABSTRACT
|
||||
gpstag = "Eerie Signal"
|
||||
desc = "Report to a coder immediately."
|
||||
invisibility = INVISIBILITY_MAXIMUM
|
||||
var/obj/item/implant/gps/implant
|
||||
|
||||
/obj/item/gps/internal/Initialize(mapload, obj/item/implant/gps/_implant)
|
||||
. = ..()
|
||||
implant = _implant
|
||||
|
||||
/obj/item/gps/internal/Destroy()
|
||||
if(implant?.imp_in)
|
||||
qdel(implant)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/gps/internal/mining
|
||||
icon_state = "gps-m"
|
||||
gpstag = "MINER"
|
||||
desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
|
||||
|
||||
/obj/item/gps/internal/base
|
||||
gpstag = "NT_AUX"
|
||||
desc = "A homing signal from Nanotrasen's mining base."
|
||||
|
||||
/obj/item/gps/visible_debug
|
||||
name = "visible GPS"
|
||||
gpstag = "ADMIN"
|
||||
desc = "This admin-spawn GPS unit leaves the coordinates visible \
|
||||
on any turf that it passes over, for debugging. Especially useful \
|
||||
for marking the area around the transition edges."
|
||||
var/list/turf/tagged
|
||||
|
||||
/obj/item/gps/visible_debug/Initialize()
|
||||
. = ..()
|
||||
tagged = list()
|
||||
START_PROCESSING(SSfastprocess, src)
|
||||
|
||||
/obj/item/gps/visible_debug/process()
|
||||
var/turf/T = get_turf(src)
|
||||
if(T)
|
||||
// I assume it's faster to color,tag and OR the turf in, rather
|
||||
// then checking if its there
|
||||
T.color = RANDOM_COLOUR
|
||||
T.maptext = "[T.x],[T.y],[T.z]"
|
||||
tagged |= T
|
||||
|
||||
/obj/item/gps/visible_debug/proc/clear()
|
||||
while(tagged.len)
|
||||
var/turf/T = pop(tagged)
|
||||
T.color = initial(T.color)
|
||||
T.maptext = initial(T.maptext)
|
||||
|
||||
/obj/item/gps/visible_debug/Destroy()
|
||||
if(tagged)
|
||||
clear()
|
||||
tagged = null
|
||||
STOP_PROCESSING(SSfastprocess, src)
|
||||
. = ..()
|
||||
|
||||
@@ -1,429 +1,436 @@
|
||||
/obj/item/radio
|
||||
icon = 'icons/obj/radio.dmi'
|
||||
name = "station bounced radio"
|
||||
icon_state = "walkietalkie"
|
||||
item_state = "walkietalkie"
|
||||
desc = "A basic handheld radio that communicates with local telecommunication networks."
|
||||
dog_fashion = /datum/dog_fashion/back
|
||||
|
||||
flags_1 = CONDUCT_1 | HEAR_1
|
||||
slot_flags = ITEM_SLOT_BELT
|
||||
throw_speed = 3
|
||||
throw_range = 7
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
materials = list(MAT_METAL=75, MAT_GLASS=25)
|
||||
obj_flags = USES_TGUI
|
||||
|
||||
var/on = TRUE
|
||||
var/frequency = FREQ_COMMON
|
||||
var/canhear_range = 3 // The range around the radio in which mobs can hear what it receives.
|
||||
var/emped = 0 // Tracks the number of EMPs currently stacked.
|
||||
|
||||
var/broadcasting = FALSE // Whether the radio will transmit dialogue it hears nearby.
|
||||
var/listening = TRUE // Whether the radio is currently receiving.
|
||||
var/prison_radio = FALSE // If true, the transmit wire starts cut.
|
||||
var/unscrewed = FALSE // Whether wires are accessible. Toggleable by screwdrivering.
|
||||
var/freerange = FALSE // If true, the radio has access to the full spectrum.
|
||||
var/subspace_transmission = FALSE // If true, the radio transmits and receives on subspace exclusively.
|
||||
var/subspace_switchable = FALSE // If true, subspace_transmission can be toggled at will.
|
||||
var/freqlock = FALSE // Frequency lock to stop the user from untuning specialist radios.
|
||||
var/use_command = FALSE // If true, broadcasts will be large and BOLD.
|
||||
var/command = FALSE // If true, use_command can be toggled at will.
|
||||
var/commandspan = SPAN_COMMAND //allow us to set what the fuck we want for headsets
|
||||
|
||||
// Encryption key handling
|
||||
var/obj/item/encryptionkey/keyslot
|
||||
var/translate_binary = FALSE // If true, can hear the special binary channel.
|
||||
var/independent = FALSE // If true, can say/hear on the special CentCom channel.
|
||||
var/syndie = FALSE // If true, hears all well-known channels automatically, and can say/hear on the Syndicate channel.
|
||||
var/list/channels = list() // Map from name (see communications.dm) to on/off. First entry is current department (:h).
|
||||
var/list/secure_radio_connections
|
||||
|
||||
var/const/FREQ_LISTENING = 1
|
||||
//FREQ_BROADCASTING = 2
|
||||
|
||||
/obj/item/radio/suicide_act(mob/living/user)
|
||||
user.visible_message("<span class='suicide'>[user] starts bouncing [src] off [user.p_their()] head! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
return BRUTELOSS
|
||||
|
||||
/obj/item/radio/proc/set_frequency(new_frequency)
|
||||
SEND_SIGNAL(src, COMSIG_RADIO_NEW_FREQUENCY, args)
|
||||
remove_radio(src, frequency)
|
||||
frequency = add_radio(src, new_frequency)
|
||||
|
||||
/obj/item/radio/proc/recalculateChannels()
|
||||
channels = list()
|
||||
translate_binary = FALSE
|
||||
syndie = FALSE
|
||||
independent = FALSE
|
||||
|
||||
if(keyslot)
|
||||
for(var/ch_name in keyslot.channels)
|
||||
if(!(ch_name in channels))
|
||||
channels[ch_name] = keyslot.channels[ch_name]
|
||||
|
||||
if(keyslot.translate_binary)
|
||||
translate_binary = TRUE
|
||||
if(keyslot.syndie)
|
||||
syndie = TRUE
|
||||
if(keyslot.independent)
|
||||
independent = TRUE
|
||||
|
||||
for(var/ch_name in channels)
|
||||
secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name])
|
||||
|
||||
/obj/item/radio/proc/make_syndie() // Turns normal radios into Syndicate radios!
|
||||
qdel(keyslot)
|
||||
keyslot = new /obj/item/encryptionkey/syndicate
|
||||
syndie = 1
|
||||
recalculateChannels()
|
||||
|
||||
/obj/item/radio/Destroy()
|
||||
remove_radio_all(src) //Just to be sure
|
||||
QDEL_NULL(wires)
|
||||
QDEL_NULL(keyslot)
|
||||
return ..()
|
||||
|
||||
/obj/item/radio/Initialize()
|
||||
wires = new /datum/wires/radio(src)
|
||||
if(prison_radio)
|
||||
wires.cut(WIRE_TX) // OH GOD WHY
|
||||
secure_radio_connections = new
|
||||
. = ..()
|
||||
frequency = sanitize_frequency(frequency, freerange)
|
||||
set_frequency(frequency)
|
||||
|
||||
for(var/ch_name in channels)
|
||||
secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name])
|
||||
|
||||
/obj/item/radio/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/empprotection, EMP_PROTECT_WIRES)
|
||||
|
||||
/obj/item/radio/interact(mob/user)
|
||||
if(unscrewed && !isAI(user))
|
||||
wires.interact(user)
|
||||
add_fingerprint(user)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/radio/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.inventory_state)
|
||||
. = ..()
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "radio", name, 370, 220 + channels.len * 22, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/item/radio/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
|
||||
data["broadcasting"] = broadcasting
|
||||
data["listening"] = listening
|
||||
data["frequency"] = frequency
|
||||
data["minFrequency"] = freerange ? MIN_FREE_FREQ : MIN_FREQ
|
||||
data["maxFrequency"] = freerange ? MAX_FREE_FREQ : MAX_FREQ
|
||||
data["freqlock"] = freqlock
|
||||
data["channels"] = list()
|
||||
for(var/channel in channels)
|
||||
data["channels"][channel] = channels[channel] & FREQ_LISTENING
|
||||
data["command"] = command
|
||||
data["useCommand"] = use_command
|
||||
data["subspace"] = subspace_transmission
|
||||
data["subspaceSwitchable"] = subspace_switchable
|
||||
data["headset"] = istype(src, /obj/item/radio/headset)
|
||||
|
||||
return data
|
||||
|
||||
/obj/item/radio/ui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("frequency")
|
||||
if(freqlock)
|
||||
return
|
||||
var/tune = params["tune"]
|
||||
var/adjust = text2num(params["adjust"])
|
||||
if(tune == "input")
|
||||
var/min = format_frequency(freerange ? MIN_FREE_FREQ : MIN_FREQ)
|
||||
var/max = format_frequency(freerange ? MAX_FREE_FREQ : MAX_FREQ)
|
||||
tune = input("Tune frequency ([min]-[max]):", name, format_frequency(frequency)) as null|num
|
||||
if(!isnull(tune) && !..())
|
||||
if (tune < MIN_FREE_FREQ && tune <= MAX_FREE_FREQ / 10)
|
||||
// allow typing 144.7 to get 1447
|
||||
tune *= 10
|
||||
. = TRUE
|
||||
else if(adjust)
|
||||
tune = frequency + adjust * 10
|
||||
. = TRUE
|
||||
else if(text2num(tune) != null)
|
||||
tune = tune * 10
|
||||
. = TRUE
|
||||
if(.)
|
||||
set_frequency(sanitize_frequency(tune, freerange))
|
||||
if("listen")
|
||||
listening = !listening
|
||||
. = TRUE
|
||||
if("broadcast")
|
||||
broadcasting = !broadcasting
|
||||
. = TRUE
|
||||
if("channel")
|
||||
var/channel = params["channel"]
|
||||
if(!(channel in channels))
|
||||
return
|
||||
if(channels[channel] & FREQ_LISTENING)
|
||||
channels[channel] &= ~FREQ_LISTENING
|
||||
else
|
||||
channels[channel] |= FREQ_LISTENING
|
||||
. = TRUE
|
||||
if("command")
|
||||
use_command = !use_command
|
||||
. = TRUE
|
||||
if("subspace")
|
||||
if(subspace_switchable)
|
||||
subspace_transmission = !subspace_transmission
|
||||
if(!subspace_transmission)
|
||||
channels = list()
|
||||
else
|
||||
recalculateChannels()
|
||||
. = TRUE
|
||||
|
||||
/obj/item/radio/talk_into(atom/movable/M, message, channel, list/spans, datum/language/language)
|
||||
if(!spans)
|
||||
spans = list(M.speech_span)
|
||||
if(!language)
|
||||
language = M.get_default_language()
|
||||
INVOKE_ASYNC(src, .proc/talk_into_impl, M, message, channel, spans.Copy(), language)
|
||||
return ITALICS | REDUCE_RANGE
|
||||
|
||||
/obj/item/radio/proc/talk_into_impl(atom/movable/M, message, channel, list/spans, datum/language/language)
|
||||
if(!on)
|
||||
return // the device has to be on
|
||||
if(!M || !message)
|
||||
return
|
||||
if(wires.is_cut(WIRE_TX)) // Permacell and otherwise tampered-with radios
|
||||
return
|
||||
if(!M.IsVocal())
|
||||
return
|
||||
|
||||
if(use_command)
|
||||
spans |= commandspan
|
||||
|
||||
/*
|
||||
Roughly speaking, radios attempt to make a subspace transmission (which
|
||||
is received, processed, and rebroadcast by the telecomms satellite) and
|
||||
if that fails, they send a mundane radio transmission.
|
||||
|
||||
Headsets cannot send/receive mundane transmissions, only subspace.
|
||||
Syndicate radios can hear transmissions on all well-known frequencies.
|
||||
CentCom radios can hear the CentCom frequency no matter what.
|
||||
*/
|
||||
|
||||
// From the channel, determine the frequency and get a reference to it.
|
||||
var/freq
|
||||
if(channel && channels && channels.len > 0)
|
||||
if(channel == MODE_DEPARTMENT)
|
||||
channel = channels[1]
|
||||
freq = secure_radio_connections[channel]
|
||||
if (!channels[channel]) // if the channel is turned off, don't broadcast
|
||||
return
|
||||
else
|
||||
freq = frequency
|
||||
channel = null
|
||||
|
||||
// Nearby active jammers severely gibberish the message
|
||||
var/turf/position = get_turf(src)
|
||||
for(var/obj/item/jammer/jammer in GLOB.active_jammers)
|
||||
var/turf/jammer_turf = get_turf(jammer)
|
||||
if(position.z == jammer_turf.z && (get_dist(position, jammer_turf) < jammer.range))
|
||||
message = Gibberish(message,100)
|
||||
break
|
||||
|
||||
// Determine the identity information which will be attached to the signal.
|
||||
var/atom/movable/virtualspeaker/speaker = new(null, M, src)
|
||||
|
||||
// Construct the signal
|
||||
var/datum/signal/subspace/vocal/signal = new(src, freq, speaker, language, message, spans)
|
||||
|
||||
// Independent radios, on the CentCom frequency, reach all independent radios
|
||||
if (independent && (freq == FREQ_CENTCOM || freq == FREQ_CTF_RED || freq == FREQ_CTF_BLUE))
|
||||
signal.data["compression"] = 0
|
||||
signal.transmission_method = TRANSMISSION_SUPERSPACE
|
||||
signal.levels = list(0) // reaches all Z-levels
|
||||
signal.broadcast()
|
||||
return
|
||||
|
||||
// All radios make an attempt to use the subspace system first
|
||||
signal.send_to_receivers()
|
||||
|
||||
// If the radio is subspace-only, that's all it can do
|
||||
if (subspace_transmission)
|
||||
return
|
||||
|
||||
// Non-subspace radios will check in a couple of seconds, and if the signal
|
||||
// was never received, send a mundane broadcast (no headsets).
|
||||
addtimer(CALLBACK(src, .proc/backup_transmission, signal), 20)
|
||||
|
||||
/obj/item/radio/proc/backup_transmission(datum/signal/subspace/vocal/signal)
|
||||
var/turf/T = get_turf(src)
|
||||
if (signal.data["done"] && (T.z in signal.levels))
|
||||
return
|
||||
|
||||
// Okay, the signal was never processed, send a mundane broadcast.
|
||||
signal.data["compression"] = 0
|
||||
signal.transmission_method = TRANSMISSION_RADIO
|
||||
signal.levels = list(T.z)
|
||||
signal.broadcast()
|
||||
|
||||
/obj/item/radio/Hear(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, message_mode, atom/movable/source)
|
||||
. = ..()
|
||||
if(radio_freq || !broadcasting || get_dist(src, speaker) > canhear_range)
|
||||
return
|
||||
|
||||
if(message_mode == MODE_WHISPER || message_mode == MODE_WHISPER_CRIT)
|
||||
// radios don't pick up whispers very well
|
||||
raw_message = stars(raw_message)
|
||||
else if(message_mode == MODE_L_HAND || message_mode == MODE_R_HAND)
|
||||
// try to avoid being heard double
|
||||
if (loc == speaker && ismob(speaker))
|
||||
var/mob/M = speaker
|
||||
var/idx = M.get_held_index_of_item(src)
|
||||
// left hands are odd slots
|
||||
if (idx && (idx % 2) == (message_mode == MODE_L_HAND))
|
||||
return
|
||||
|
||||
talk_into(speaker, raw_message, , spans, language=message_language)
|
||||
|
||||
// Checks if this radio can receive on the given frequency.
|
||||
/obj/item/radio/proc/can_receive(freq, level)
|
||||
// deny checks
|
||||
if (!on || !listening || wires.is_cut(WIRE_RX))
|
||||
return FALSE
|
||||
if (freq == FREQ_SYNDICATE && !syndie)
|
||||
return FALSE
|
||||
if (freq == FREQ_CENTCOM)
|
||||
return independent // hard-ignores the z-level check
|
||||
if (!(0 in level))
|
||||
var/turf/position = get_turf(src)
|
||||
if(!position || !(position.z in level))
|
||||
return FALSE
|
||||
|
||||
// allow checks: are we listening on that frequency?
|
||||
if (freq == frequency)
|
||||
return TRUE
|
||||
for(var/ch_name in channels)
|
||||
if(channels[ch_name] & FREQ_LISTENING)
|
||||
//the GLOB.radiochannels list is located in communications.dm
|
||||
if(GLOB.radiochannels[ch_name] == text2num(freq) || syndie)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
|
||||
/obj/item/radio/examine(mob/user)
|
||||
. = ..()
|
||||
if (unscrewed)
|
||||
. += "<span class='notice'>It can be attached and modified.</span>"
|
||||
else
|
||||
. += "<span class='notice'>It cannot be modified or attached.</span>"
|
||||
|
||||
/obj/item/radio/attackby(obj/item/W, mob/user, params)
|
||||
add_fingerprint(user)
|
||||
if(istype(W, /obj/item/screwdriver))
|
||||
unscrewed = !unscrewed
|
||||
if(unscrewed)
|
||||
to_chat(user, "<span class='notice'>The radio can now be attached and modified!</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>The radio can no longer be modified or attached!</span>")
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/radio/emp_act(severity)
|
||||
. = ..()
|
||||
if (. & EMP_PROTECT_SELF)
|
||||
return
|
||||
emped++ //There's been an EMP; better count it
|
||||
var/curremp = emped //Remember which EMP this was
|
||||
if (listening && ismob(loc)) // if the radio is turned on and on someone's person they notice
|
||||
to_chat(loc, "<span class='warning'>\The [src] overloads.</span>")
|
||||
broadcasting = FALSE
|
||||
listening = FALSE
|
||||
for (var/ch_name in channels)
|
||||
channels[ch_name] = 0
|
||||
on = FALSE
|
||||
spawn(200)
|
||||
if(emped == curremp) //Don't fix it if it's been EMP'd again
|
||||
emped = 0
|
||||
if (!istype(src, /obj/item/radio/intercom)) // intercoms will turn back on on their own
|
||||
on = TRUE
|
||||
|
||||
///////////////////////////////
|
||||
//////////Borg Radios//////////
|
||||
///////////////////////////////
|
||||
//Giving borgs their own radio to have some more room to work with -Sieve
|
||||
|
||||
/obj/item/radio/borg
|
||||
name = "cyborg radio"
|
||||
subspace_switchable = TRUE
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/radio/borg/Initialize(mapload)
|
||||
. = ..()
|
||||
|
||||
/obj/item/radio/borg/syndicate
|
||||
syndie = 1
|
||||
keyslot = new /obj/item/encryptionkey/syndicate
|
||||
|
||||
/obj/item/radio/borg/syndicate/Initialize()
|
||||
. = ..()
|
||||
set_frequency(FREQ_SYNDICATE)
|
||||
|
||||
/obj/item/radio/borg/attackby(obj/item/W, mob/user, params)
|
||||
|
||||
if(istype(W, /obj/item/screwdriver))
|
||||
if(keyslot)
|
||||
for(var/ch_name in channels)
|
||||
SSradio.remove_object(src, GLOB.radiochannels[ch_name])
|
||||
secure_radio_connections[ch_name] = null
|
||||
|
||||
|
||||
if(keyslot)
|
||||
var/turf/T = get_turf(user)
|
||||
if(T)
|
||||
keyslot.forceMove(T)
|
||||
keyslot = null
|
||||
|
||||
recalculateChannels()
|
||||
to_chat(user, "<span class='notice'>You pop out the encryption key in the radio.</span>")
|
||||
|
||||
else
|
||||
to_chat(user, "<span class='warning'>This radio doesn't have any encryption keys!</span>")
|
||||
|
||||
else if(istype(W, /obj/item/encryptionkey/))
|
||||
if(keyslot)
|
||||
to_chat(user, "<span class='warning'>The radio can't hold another key!</span>")
|
||||
return
|
||||
|
||||
if(!keyslot)
|
||||
if(!user.transferItemToLoc(W, src))
|
||||
return
|
||||
keyslot = W
|
||||
|
||||
recalculateChannels()
|
||||
|
||||
|
||||
/obj/item/radio/off // Station bounced radios, their only difference is spawning with the speakers off, this was made to help the lag.
|
||||
listening = 0 // And it's nice to have a subtype too for future features.
|
||||
dog_fashion = /datum/dog_fashion/back
|
||||
|
||||
/obj/item/radio/internal
|
||||
var/obj/item/implant/radio/implant
|
||||
|
||||
/obj/item/radio/internal/Initialize(mapload, obj/item/implant/radio/_implant)
|
||||
. = ..()
|
||||
implant = _implant
|
||||
|
||||
/obj/item/radio/internal/Destroy()
|
||||
if(implant?.imp_in)
|
||||
qdel(implant)
|
||||
else
|
||||
return ..()
|
||||
/obj/item/radio
|
||||
icon = 'icons/obj/radio.dmi'
|
||||
name = "station bounced radio"
|
||||
icon_state = "walkietalkie"
|
||||
item_state = "walkietalkie"
|
||||
desc = "A basic handheld radio that communicates with local telecommunication networks."
|
||||
dog_fashion = /datum/dog_fashion/back
|
||||
|
||||
flags_1 = CONDUCT_1 | HEAR_1
|
||||
slot_flags = ITEM_SLOT_BELT
|
||||
throw_speed = 3
|
||||
throw_range = 7
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
materials = list(MAT_METAL=75, MAT_GLASS=25)
|
||||
obj_flags = USES_TGUI
|
||||
|
||||
var/on = TRUE
|
||||
var/frequency = FREQ_COMMON
|
||||
var/canhear_range = 3 // The range around the radio in which mobs can hear what it receives.
|
||||
var/emped = 0 // Tracks the number of EMPs currently stacked.
|
||||
|
||||
var/broadcasting = FALSE // Whether the radio will transmit dialogue it hears nearby.
|
||||
var/listening = TRUE // Whether the radio is currently receiving.
|
||||
var/prison_radio = FALSE // If true, the transmit wire starts cut.
|
||||
var/unscrewed = FALSE // Whether wires are accessible. Toggleable by screwdrivering.
|
||||
var/freerange = FALSE // If true, the radio has access to the full spectrum.
|
||||
var/subspace_transmission = FALSE // If true, the radio transmits and receives on subspace exclusively.
|
||||
var/subspace_switchable = FALSE // If true, subspace_transmission can be toggled at will.
|
||||
var/freqlock = FALSE // Frequency lock to stop the user from untuning specialist radios.
|
||||
var/use_command = FALSE // If true, broadcasts will be large and BOLD.
|
||||
var/command = FALSE // If true, use_command can be toggled at will.
|
||||
var/commandspan = SPAN_COMMAND //allow us to set what the fuck we want for headsets
|
||||
|
||||
// Encryption key handling
|
||||
var/obj/item/encryptionkey/keyslot
|
||||
var/translate_binary = FALSE // If true, can hear the special binary channel.
|
||||
var/independent = FALSE // If true, can say/hear on the special CentCom channel.
|
||||
var/syndie = FALSE // If true, hears all well-known channels automatically, and can say/hear on the Syndicate channel.
|
||||
var/list/channels = list() // Map from name (see communications.dm) to on/off. First entry is current department (:h).
|
||||
var/list/secure_radio_connections
|
||||
|
||||
var/const/FREQ_LISTENING = 1
|
||||
//FREQ_BROADCASTING = 2
|
||||
|
||||
/obj/item/radio/suicide_act(mob/living/user)
|
||||
user.visible_message("<span class='suicide'>[user] starts bouncing [src] off [user.p_their()] head! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
return BRUTELOSS
|
||||
|
||||
/obj/item/radio/proc/set_frequency(new_frequency)
|
||||
SEND_SIGNAL(src, COMSIG_RADIO_NEW_FREQUENCY, args)
|
||||
remove_radio(src, frequency)
|
||||
frequency = add_radio(src, new_frequency)
|
||||
|
||||
/obj/item/radio/proc/recalculateChannels()
|
||||
channels = list()
|
||||
translate_binary = FALSE
|
||||
syndie = FALSE
|
||||
independent = FALSE
|
||||
|
||||
if(keyslot)
|
||||
for(var/ch_name in keyslot.channels)
|
||||
if(!(ch_name in channels))
|
||||
channels[ch_name] = keyslot.channels[ch_name]
|
||||
|
||||
if(keyslot.translate_binary)
|
||||
translate_binary = TRUE
|
||||
if(keyslot.syndie)
|
||||
syndie = TRUE
|
||||
if(keyslot.independent)
|
||||
independent = TRUE
|
||||
|
||||
for(var/ch_name in channels)
|
||||
secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name])
|
||||
|
||||
/obj/item/radio/proc/make_syndie() // Turns normal radios into Syndicate radios!
|
||||
qdel(keyslot)
|
||||
keyslot = new /obj/item/encryptionkey/syndicate
|
||||
syndie = 1
|
||||
recalculateChannels()
|
||||
|
||||
/obj/item/radio/Destroy()
|
||||
remove_radio_all(src) //Just to be sure
|
||||
QDEL_NULL(wires)
|
||||
QDEL_NULL(keyslot)
|
||||
return ..()
|
||||
|
||||
/obj/item/radio/Initialize()
|
||||
wires = new /datum/wires/radio(src)
|
||||
if(prison_radio)
|
||||
wires.cut(WIRE_TX) // OH GOD WHY
|
||||
secure_radio_connections = new
|
||||
. = ..()
|
||||
frequency = sanitize_frequency(frequency, freerange)
|
||||
set_frequency(frequency)
|
||||
|
||||
for(var/ch_name in channels)
|
||||
secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name])
|
||||
|
||||
/obj/item/radio/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/empprotection, EMP_PROTECT_WIRES)
|
||||
|
||||
/obj/item/radio/interact(mob/user)
|
||||
if(unscrewed && !isAI(user))
|
||||
wires.interact(user)
|
||||
add_fingerprint(user)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/radio/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.inventory_state)
|
||||
. = ..()
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
var/ui_width = 360
|
||||
var/ui_height = 106
|
||||
if(subspace_transmission)
|
||||
if(channels.len > 0)
|
||||
ui_height += 6 + channels.len * 21
|
||||
else
|
||||
ui_height += 24
|
||||
ui = new(user, src, ui_key, "radio", name, ui_width, ui_height, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/item/radio/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
|
||||
data["broadcasting"] = broadcasting
|
||||
data["listening"] = listening
|
||||
data["frequency"] = frequency
|
||||
data["minFrequency"] = freerange ? MIN_FREE_FREQ : MIN_FREQ
|
||||
data["maxFrequency"] = freerange ? MAX_FREE_FREQ : MAX_FREQ
|
||||
data["freqlock"] = freqlock
|
||||
data["channels"] = list()
|
||||
for(var/channel in channels)
|
||||
data["channels"][channel] = channels[channel] & FREQ_LISTENING
|
||||
data["command"] = command
|
||||
data["useCommand"] = use_command
|
||||
data["subspace"] = subspace_transmission
|
||||
data["subspaceSwitchable"] = subspace_switchable
|
||||
data["headset"] = istype(src, /obj/item/radio/headset)
|
||||
|
||||
return data
|
||||
|
||||
/obj/item/radio/ui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("frequency")
|
||||
if(freqlock)
|
||||
return
|
||||
var/tune = params["tune"]
|
||||
var/adjust = text2num(params["adjust"])
|
||||
if(tune == "input")
|
||||
var/min = format_frequency(freerange ? MIN_FREE_FREQ : MIN_FREQ)
|
||||
var/max = format_frequency(freerange ? MAX_FREE_FREQ : MAX_FREQ)
|
||||
tune = input("Tune frequency ([min]-[max]):", name, format_frequency(frequency)) as null|num
|
||||
if(!isnull(tune) && !..())
|
||||
if (tune < MIN_FREE_FREQ && tune <= MAX_FREE_FREQ / 10)
|
||||
// allow typing 144.7 to get 1447
|
||||
tune *= 10
|
||||
. = TRUE
|
||||
else if(adjust)
|
||||
tune = frequency + adjust * 10
|
||||
. = TRUE
|
||||
else if(text2num(tune) != null)
|
||||
tune = tune * 10
|
||||
. = TRUE
|
||||
if(.)
|
||||
set_frequency(sanitize_frequency(tune, freerange))
|
||||
if("listen")
|
||||
listening = !listening
|
||||
. = TRUE
|
||||
if("broadcast")
|
||||
broadcasting = !broadcasting
|
||||
. = TRUE
|
||||
if("channel")
|
||||
var/channel = params["channel"]
|
||||
if(!(channel in channels))
|
||||
return
|
||||
if(channels[channel] & FREQ_LISTENING)
|
||||
channels[channel] &= ~FREQ_LISTENING
|
||||
else
|
||||
channels[channel] |= FREQ_LISTENING
|
||||
. = TRUE
|
||||
if("command")
|
||||
use_command = !use_command
|
||||
. = TRUE
|
||||
if("subspace")
|
||||
if(subspace_switchable)
|
||||
subspace_transmission = !subspace_transmission
|
||||
if(!subspace_transmission)
|
||||
channels = list()
|
||||
else
|
||||
recalculateChannels()
|
||||
. = TRUE
|
||||
|
||||
/obj/item/radio/talk_into(atom/movable/M, message, channel, list/spans, datum/language/language)
|
||||
if(!spans)
|
||||
spans = list(M.speech_span)
|
||||
if(!language)
|
||||
language = M.get_default_language()
|
||||
INVOKE_ASYNC(src, .proc/talk_into_impl, M, message, channel, spans.Copy(), language)
|
||||
return ITALICS | REDUCE_RANGE
|
||||
|
||||
/obj/item/radio/proc/talk_into_impl(atom/movable/M, message, channel, list/spans, datum/language/language)
|
||||
if(!on)
|
||||
return // the device has to be on
|
||||
if(!M || !message)
|
||||
return
|
||||
if(wires.is_cut(WIRE_TX)) // Permacell and otherwise tampered-with radios
|
||||
return
|
||||
if(!M.IsVocal())
|
||||
return
|
||||
|
||||
if(use_command)
|
||||
spans |= commandspan
|
||||
|
||||
/*
|
||||
Roughly speaking, radios attempt to make a subspace transmission (which
|
||||
is received, processed, and rebroadcast by the telecomms satellite) and
|
||||
if that fails, they send a mundane radio transmission.
|
||||
|
||||
Headsets cannot send/receive mundane transmissions, only subspace.
|
||||
Syndicate radios can hear transmissions on all well-known frequencies.
|
||||
CentCom radios can hear the CentCom frequency no matter what.
|
||||
*/
|
||||
|
||||
// From the channel, determine the frequency and get a reference to it.
|
||||
var/freq
|
||||
if(channel && channels && channels.len > 0)
|
||||
if(channel == MODE_DEPARTMENT)
|
||||
channel = channels[1]
|
||||
freq = secure_radio_connections[channel]
|
||||
if (!channels[channel]) // if the channel is turned off, don't broadcast
|
||||
return
|
||||
else
|
||||
freq = frequency
|
||||
channel = null
|
||||
|
||||
// Nearby active jammers severely gibberish the message
|
||||
var/turf/position = get_turf(src)
|
||||
for(var/obj/item/jammer/jammer in GLOB.active_jammers)
|
||||
var/turf/jammer_turf = get_turf(jammer)
|
||||
if(position.z == jammer_turf.z && (get_dist(position, jammer_turf) < jammer.range))
|
||||
message = Gibberish(message,100)
|
||||
break
|
||||
|
||||
// Determine the identity information which will be attached to the signal.
|
||||
var/atom/movable/virtualspeaker/speaker = new(null, M, src)
|
||||
|
||||
// Construct the signal
|
||||
var/datum/signal/subspace/vocal/signal = new(src, freq, speaker, language, message, spans)
|
||||
|
||||
// Independent radios, on the CentCom frequency, reach all independent radios
|
||||
if (independent && (freq == FREQ_CENTCOM || freq == FREQ_CTF_RED || freq == FREQ_CTF_BLUE))
|
||||
signal.data["compression"] = 0
|
||||
signal.transmission_method = TRANSMISSION_SUPERSPACE
|
||||
signal.levels = list(0) // reaches all Z-levels
|
||||
signal.broadcast()
|
||||
return
|
||||
|
||||
// All radios make an attempt to use the subspace system first
|
||||
signal.send_to_receivers()
|
||||
|
||||
// If the radio is subspace-only, that's all it can do
|
||||
if (subspace_transmission)
|
||||
return
|
||||
|
||||
// Non-subspace radios will check in a couple of seconds, and if the signal
|
||||
// was never received, send a mundane broadcast (no headsets).
|
||||
addtimer(CALLBACK(src, .proc/backup_transmission, signal), 20)
|
||||
|
||||
/obj/item/radio/proc/backup_transmission(datum/signal/subspace/vocal/signal)
|
||||
var/turf/T = get_turf(src)
|
||||
if (signal.data["done"] && (T.z in signal.levels))
|
||||
return
|
||||
|
||||
// Okay, the signal was never processed, send a mundane broadcast.
|
||||
signal.data["compression"] = 0
|
||||
signal.transmission_method = TRANSMISSION_RADIO
|
||||
signal.levels = list(T.z)
|
||||
signal.broadcast()
|
||||
|
||||
/obj/item/radio/Hear(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, message_mode, atom/movable/source)
|
||||
. = ..()
|
||||
if(radio_freq || !broadcasting || get_dist(src, speaker) > canhear_range)
|
||||
return
|
||||
|
||||
if(message_mode == MODE_WHISPER || message_mode == MODE_WHISPER_CRIT)
|
||||
// radios don't pick up whispers very well
|
||||
raw_message = stars(raw_message)
|
||||
else if(message_mode == MODE_L_HAND || message_mode == MODE_R_HAND)
|
||||
// try to avoid being heard double
|
||||
if (loc == speaker && ismob(speaker))
|
||||
var/mob/M = speaker
|
||||
var/idx = M.get_held_index_of_item(src)
|
||||
// left hands are odd slots
|
||||
if (idx && (idx % 2) == (message_mode == MODE_L_HAND))
|
||||
return
|
||||
|
||||
talk_into(speaker, raw_message, , spans, language=message_language)
|
||||
|
||||
// Checks if this radio can receive on the given frequency.
|
||||
/obj/item/radio/proc/can_receive(freq, level)
|
||||
// deny checks
|
||||
if (!on || !listening || wires.is_cut(WIRE_RX))
|
||||
return FALSE
|
||||
if (freq == FREQ_SYNDICATE && !syndie)
|
||||
return FALSE
|
||||
if (freq == FREQ_CENTCOM)
|
||||
return independent // hard-ignores the z-level check
|
||||
if (!(0 in level))
|
||||
var/turf/position = get_turf(src)
|
||||
if(!position || !(position.z in level))
|
||||
return FALSE
|
||||
|
||||
// allow checks: are we listening on that frequency?
|
||||
if (freq == frequency)
|
||||
return TRUE
|
||||
for(var/ch_name in channels)
|
||||
if(channels[ch_name] & FREQ_LISTENING)
|
||||
//the GLOB.radiochannels list is located in communications.dm
|
||||
if(GLOB.radiochannels[ch_name] == text2num(freq) || syndie)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
|
||||
/obj/item/radio/examine(mob/user)
|
||||
. = ..()
|
||||
if (unscrewed)
|
||||
. += "<span class='notice'>It can be attached and modified.</span>"
|
||||
else
|
||||
. += "<span class='notice'>It cannot be modified or attached.</span>"
|
||||
|
||||
/obj/item/radio/attackby(obj/item/W, mob/user, params)
|
||||
add_fingerprint(user)
|
||||
if(istype(W, /obj/item/screwdriver))
|
||||
unscrewed = !unscrewed
|
||||
if(unscrewed)
|
||||
to_chat(user, "<span class='notice'>The radio can now be attached and modified!</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>The radio can no longer be modified or attached!</span>")
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/radio/emp_act(severity)
|
||||
. = ..()
|
||||
if (. & EMP_PROTECT_SELF)
|
||||
return
|
||||
emped++ //There's been an EMP; better count it
|
||||
var/curremp = emped //Remember which EMP this was
|
||||
if (listening && ismob(loc)) // if the radio is turned on and on someone's person they notice
|
||||
to_chat(loc, "<span class='warning'>\The [src] overloads.</span>")
|
||||
broadcasting = FALSE
|
||||
listening = FALSE
|
||||
for (var/ch_name in channels)
|
||||
channels[ch_name] = 0
|
||||
on = FALSE
|
||||
spawn(200)
|
||||
if(emped == curremp) //Don't fix it if it's been EMP'd again
|
||||
emped = 0
|
||||
if (!istype(src, /obj/item/radio/intercom)) // intercoms will turn back on on their own
|
||||
on = TRUE
|
||||
|
||||
///////////////////////////////
|
||||
//////////Borg Radios//////////
|
||||
///////////////////////////////
|
||||
//Giving borgs their own radio to have some more room to work with -Sieve
|
||||
|
||||
/obj/item/radio/borg
|
||||
name = "cyborg radio"
|
||||
subspace_switchable = TRUE
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/radio/borg/Initialize(mapload)
|
||||
. = ..()
|
||||
|
||||
/obj/item/radio/borg/syndicate
|
||||
syndie = 1
|
||||
keyslot = new /obj/item/encryptionkey/syndicate
|
||||
|
||||
/obj/item/radio/borg/syndicate/Initialize()
|
||||
. = ..()
|
||||
set_frequency(FREQ_SYNDICATE)
|
||||
|
||||
/obj/item/radio/borg/attackby(obj/item/W, mob/user, params)
|
||||
|
||||
if(istype(W, /obj/item/screwdriver))
|
||||
if(keyslot)
|
||||
for(var/ch_name in channels)
|
||||
SSradio.remove_object(src, GLOB.radiochannels[ch_name])
|
||||
secure_radio_connections[ch_name] = null
|
||||
|
||||
|
||||
if(keyslot)
|
||||
var/turf/T = get_turf(user)
|
||||
if(T)
|
||||
keyslot.forceMove(T)
|
||||
keyslot = null
|
||||
|
||||
recalculateChannels()
|
||||
to_chat(user, "<span class='notice'>You pop out the encryption key in the radio.</span>")
|
||||
|
||||
else
|
||||
to_chat(user, "<span class='warning'>This radio doesn't have any encryption keys!</span>")
|
||||
|
||||
else if(istype(W, /obj/item/encryptionkey/))
|
||||
if(keyslot)
|
||||
to_chat(user, "<span class='warning'>The radio can't hold another key!</span>")
|
||||
return
|
||||
|
||||
if(!keyslot)
|
||||
if(!user.transferItemToLoc(W, src))
|
||||
return
|
||||
keyslot = W
|
||||
|
||||
recalculateChannels()
|
||||
|
||||
|
||||
/obj/item/radio/off // Station bounced radios, their only difference is spawning with the speakers off, this was made to help the lag.
|
||||
listening = 0 // And it's nice to have a subtype too for future features.
|
||||
dog_fashion = /datum/dog_fashion/back
|
||||
|
||||
/obj/item/radio/internal
|
||||
var/obj/item/implant/radio/implant
|
||||
|
||||
/obj/item/radio/internal/Initialize(mapload, obj/item/implant/radio/_implant)
|
||||
. = ..()
|
||||
implant = _implant
|
||||
|
||||
/obj/item/radio/internal/Destroy()
|
||||
if(implant?.imp_in)
|
||||
qdel(implant)
|
||||
else
|
||||
return ..()
|
||||
|
||||
@@ -156,7 +156,7 @@
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.hands_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "tanks", name, 420, 200, master_ui, state)
|
||||
ui = new(user, src, ui_key, "tanks", name, 400, 120, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/item/tank/ui_data(mob/user)
|
||||
|
||||
@@ -12,9 +12,11 @@
|
||||
roundstart = FALSE
|
||||
death = FALSE
|
||||
mob_species = /datum/species/pod
|
||||
flavour_text = "<span class='big bold'>You are a sentient ecosystem,</span><b> an example of the mastery over life that your creators possessed. Your masters, benevolent as they were, created uncounted \
|
||||
seed vaults and spread them across the universe to every planet they could chart. You are in one such seed vault. Your goal is to cultivate and spread life wherever it will go while waiting \
|
||||
for contact from your creators. Estimated time of last contact: Deployment, 5x10^3 millennia ago.</b>"
|
||||
short_desc = "You are a sentient ecosystem, an example of the mastery over life that your creators possessed."
|
||||
flavour_text = "Your masters, benevolent as they were, created uncounted seed vaults and spread them across \
|
||||
the universe to every planet they could chart. You are in one such seed vault. \
|
||||
Your goal is to cultivate and spread life wherever it will go while waiting for contact from your creators. \
|
||||
Estimated time of last contact: Deployment, 5000 millennia ago."
|
||||
assignedrole = "Lifebringer"
|
||||
|
||||
/obj/effect/mob_spawn/human/seed_vault/special(mob/living/new_spawn)
|
||||
@@ -47,8 +49,10 @@
|
||||
death = FALSE
|
||||
anchored = FALSE
|
||||
density = FALSE
|
||||
flavour_text = "<span class='big bold'>You are an ash walker.</span><b> Your tribe worships <span class='danger'>the Necropolis</span>. The wastes are sacred ground, its monsters a blessed bounty. You would never leave its beautiful expanse. \
|
||||
You have seen lights in the distance... they foreshadow the arrival of outsiders that seek to tear apart the Necropolis and its domain. Fresh sacrifices for your nest.</b>"
|
||||
short_desc = "You are an ash walker. Your tribe worships the Necropolis."
|
||||
flavour_text = "The wastes are sacred ground, its monsters a blessed bounty. You would never leave its sacred ground. \
|
||||
You have seen lights in the distance... they foreshadow the arrival of outsiders that seek to tear apart the Necropolis and its domain. \
|
||||
Fresh sacrifices for your nest."
|
||||
assignedrole = "Ash Walker"
|
||||
|
||||
/obj/effect/mob_spawn/human/ash_walker/special(mob/living/new_spawn)
|
||||
@@ -87,8 +91,9 @@
|
||||
roundstart = FALSE
|
||||
death = FALSE
|
||||
mob_species = /datum/species/shadow
|
||||
flavour_text = "<span class='big bold'>You are cursed.</span><b> Years ago, you sacrificed the lives of your trusted friends and the humanity of yourself to reach the Wish Granter. Though you \
|
||||
did so, it has come at a cost: your very body rejects the light, dooming you to wander endlessly in this horrible wasteland.</b>"
|
||||
short_desc = "You are cursed."
|
||||
flavour_text = "Years ago, you sacrificed the lives of your trusted friends and the humanity of yourself to reach the Wish Granter. Though you \
|
||||
did so, it has come at a cost: your very body rejects the light, dooming you to wander endlessly in this horrible wasteland."
|
||||
assignedrole = "Exile"
|
||||
|
||||
/obj/effect/mob_spawn/human/exile/Destroy()
|
||||
@@ -124,9 +129,10 @@
|
||||
var/has_owner = FALSE
|
||||
var/can_transfer = TRUE //if golems can switch bodies to this new shell
|
||||
var/mob/living/owner = null //golem's owner if it has one
|
||||
flavour_text = "<span class='big bold'>You are a Free Golem.</span><b> Your family worships <span class='danger'>The Liberator</span>. In his infinite and divine wisdom, he set your clan free to \
|
||||
short_desc = "You are a Free Golem. Your family worships The Liberator."
|
||||
flavour_text = "In his infinite and divine wisdom, he set your clan free to \
|
||||
travel the stars with a single declaration: \"Yeah go do whatever.\" Though you are bound to the one who created you, it is customary in your society to repeat those same words to newborn \
|
||||
golems, so that no golem may ever be forced to serve again.</b>"
|
||||
golems, so that no golem may ever be forced to serve again."
|
||||
|
||||
/obj/effect/mob_spawn/human/golem/Initialize(mapload, datum/species/golem/species = null, mob/creator = null)
|
||||
if(species) //spawners list uses object name to register so this goes before ..()
|
||||
@@ -137,8 +143,9 @@
|
||||
if(!mapload && A)
|
||||
notify_ghosts("\A [initial(species.prefix)] golem shell has been completed in \the [A.name].", source = src, action=NOTIFY_ATTACK, flashwindow = FALSE, ignore_key = POLL_IGNORE_GOLEM, ignore_dnr_observers = TRUE)
|
||||
if(has_owner && creator)
|
||||
flavour_text = "<span class='big bold'>You are a Golem.</span><b> You move slowly, but are highly resistant to heat and cold as well as blunt trauma. You are unable to wear clothes, but can still use most tools. \
|
||||
Serve [creator], and assist [creator.p_them()] in completing [creator.p_their()] goals at any cost.</b>"
|
||||
short_desc = "You are a golem."
|
||||
flavour_text = "You move slowly, but are highly resistant to heat and cold as well as blunt trauma. You are unable to wear clothes, but can still use most tools."
|
||||
important_info = "Serve [creator], and assist [creator.p_them()] in completing [creator.p_their()] goals at any cost."
|
||||
owner = creator
|
||||
|
||||
/obj/effect/mob_spawn/human/golem/special(mob/living/new_spawn, name)
|
||||
@@ -211,8 +218,9 @@
|
||||
death = FALSE
|
||||
random = TRUE
|
||||
mob_species = /datum/species/human
|
||||
flavour_text = "<span class='big bold'>You've been stranded in this godless prison of a planet for longer than you can remember.</span><b> Each day you barely scrape by, and between the terrible \
|
||||
conditions of your makeshift shelter, the hostile creatures, and the ash drakes swooping down from the cloudless skies, all you can wish for is the feel of soft grass between your toes and \
|
||||
short_desc = "You've been stranded in this godless prison of a planet for longer than you can remember."
|
||||
flavour_text = "Each day you barely scrape by, and between the terrible conditions of your makeshift shelter, \
|
||||
the hostile creatures, and the ash drakes swooping down from the cloudless skies, all you can wish for is the feel of soft grass between your toes and \
|
||||
the fresh air of Earth. These thoughts are dispelled by yet another recollection of how you got here... "
|
||||
assignedrole = "Hermit"
|
||||
|
||||
@@ -223,20 +231,20 @@
|
||||
if(1)
|
||||
flavour_text += "you were a [pick("arms dealer", "shipwright", "docking manager")]'s assistant on a small trading station several sectors from here. Raiders attacked, and there was \
|
||||
only one pod left when you got to the escape bay. You took it and launched it alone, and the crowd of terrified faces crowding at the airlock door as your pod's engines burst to \
|
||||
life and sent you to this hell are forever branded into your memory.</b>"
|
||||
life and sent you to this hell are forever branded into your memory."
|
||||
outfit.uniform = /obj/item/clothing/under/assistantformal
|
||||
outfit.shoes = /obj/item/clothing/shoes/sneakers/black
|
||||
outfit.back = /obj/item/storage/backpack
|
||||
if(2)
|
||||
flavour_text += "you're an exile from the Tiger Cooperative. Their technological fanaticism drove you to question the power and beliefs of the Exolitics, and they saw you as a \
|
||||
heretic and subjected you to hours of horrible torture. You were hours away from execution when a high-ranking friend of yours in the Cooperative managed to secure you a pod, \
|
||||
scrambled its destination's coordinates, and launched it. You awoke from stasis when you landed and have been surviving - barely - ever since.</b>"
|
||||
scrambled its destination's coordinates, and launched it. You awoke from stasis when you landed and have been surviving - barely - ever since."
|
||||
outfit.uniform = /obj/item/clothing/under/rank/prisoner
|
||||
outfit.shoes = /obj/item/clothing/shoes/sneakers/orange
|
||||
outfit.back = /obj/item/storage/backpack
|
||||
if(3)
|
||||
flavour_text += "you were a doctor on one of Nanotrasen's space stations, but you left behind that damn corporation's tyranny and everything it stood for. From a metaphorical hell \
|
||||
to a literal one, you find yourself nonetheless missing the recycled air and warm floors of what you left behind... but you'd still rather be here than there.</b>"
|
||||
to a literal one, you find yourself nonetheless missing the recycled air and warm floors of what you left behind... but you'd still rather be here than there."
|
||||
outfit.uniform = /obj/item/clothing/under/rank/medical
|
||||
outfit.suit = /obj/item/clothing/suit/toggle/labcoat
|
||||
outfit.back = /obj/item/storage/backpack/medic
|
||||
@@ -244,7 +252,7 @@
|
||||
if(4)
|
||||
flavour_text += "you were always joked about by your friends for \"not playing with a full deck\", as they so <i>kindly</i> put it. It seems that they were right when you, on a tour \
|
||||
at one of Nanotrasen's state-of-the-art research facilities, were in one of the escape pods alone and saw the red button. It was big and shiny, and it caught your eye. You pressed \
|
||||
it, and after a terrifying and fast ride for days, you landed here. You've had time to wisen up since then, and you think that your old friends wouldn't be laughing now.</b>"
|
||||
it, and after a terrifying and fast ride for days, you landed here. You've had time to wisen up since then, and you think that your old friends wouldn't be laughing now."
|
||||
outfit.uniform = /obj/item/clothing/under/color/grey/glorf
|
||||
outfit.shoes = /obj/item/clothing/shoes/sneakers/black
|
||||
outfit.back = /obj/item/storage/backpack
|
||||
@@ -283,8 +291,9 @@
|
||||
outfit = /datum/outfit/lavalandprisoner
|
||||
roundstart = FALSE
|
||||
death = FALSE
|
||||
flavour_text = "<b>Good. It seems as though your ship crashed. <span class='big bold'>You're a prisoner,</span> sentenced to hard work in one of Nanotrasen's labor camps, but it seems as \
|
||||
though fate has other plans for you. You remember that you were convicted of "
|
||||
short_desc = "You're a prisoner, sentenced to hard work in one of Nanotrasen's labor camps, but it seems as \
|
||||
though fate has other plans for you."
|
||||
flavour_text = "Good. It seems as though your ship crashed. You remember that you were convicted of "
|
||||
assignedrole = "Escaped Prisoner"
|
||||
|
||||
/obj/effect/mob_spawn/human/prisoner_transport/special(mob/living/L)
|
||||
@@ -296,7 +305,7 @@
|
||||
var/list/crimes = list("murder", "larceny", "embezzlement", "unionization", "dereliction of duty", "kidnapping", "gross incompetence", "grand theft", "collaboration with the Syndicate", \
|
||||
"worship of a forbidden deity", "interspecies relations", "mutiny")
|
||||
flavour_text += "[pick(crimes)]. but regardless of that, it seems like your crime doesn't matter now. You don't know where you are, but you know that it's out to kill you, and you're not going \
|
||||
to lose this opportunity. Find a way to get out of this mess and back to where you rightfully belong - your [pick("house", "apartment", "spaceship", "station")]</b>."
|
||||
to lose this opportunity. Find a way to get out of this mess and back to where you rightfully belong - your [pick("house", "apartment", "spaceship", "station")]."
|
||||
|
||||
/datum/outfit/lavalandprisoner
|
||||
name = "Lavaland Prisoner"
|
||||
@@ -323,8 +332,9 @@
|
||||
roundstart = FALSE
|
||||
random = TRUE
|
||||
outfit = /datum/outfit/hotelstaff
|
||||
flavour_text = "<span class='big bold'>You are a staff member of a top-of-the-line space hotel!</span><b> Cater to guests and <font size=6><b>DON'T</b></font> leave the hotel, lest the manager fire you for\
|
||||
dereliction of duty!</b>"
|
||||
short_desc = "You are a staff member of a top-of-the-line space hotel!"
|
||||
flavour_text = "You are a staff member of a top-of-the-line space hotel! Cater to guests and make sure the manager doesn't fire you."
|
||||
important_info = "DON'T leave the hotel"
|
||||
assignedrole = "Hotel Staff"
|
||||
|
||||
/datum/outfit/hotelstaff
|
||||
@@ -341,8 +351,10 @@
|
||||
mob_name = "hotel security member"
|
||||
job_description = "Hotel Security"
|
||||
outfit = /datum/outfit/hotelstaff/security
|
||||
flavour_text = "<span class='big bold'>You are a peacekeeper</span><b> assigned to this hotel to protect the interests of the company while keeping the peace between \
|
||||
guests and the staff. Do <font size=6>NOT</font> leave the hotel, as that is grounds for contract termination.</b>"
|
||||
short_desc = "You are a peacekeeper."
|
||||
flavour_text = "You have been assigned to this hotel to protect the interests of the company while keeping the peace between \
|
||||
guests and the staff."
|
||||
important_info = "Do NOT leave the hotel, as that is grounds for contract termination."
|
||||
objectives = "Do not leave your assigned hotel. Try and keep the peace between staff and guests, non-lethal force heavily advised if possible."
|
||||
|
||||
/datum/outfit/hotelstaff/security
|
||||
@@ -381,7 +393,8 @@
|
||||
/obj/effect/mob_spawn/human/demonic_friend/Initialize(mapload, datum/mind/owner_mind, obj/effect/proc_holder/spell/targeted/summon_friend/summoning_spell)
|
||||
. = ..()
|
||||
owner = owner_mind
|
||||
flavour_text = "<span class='big bold'>You have been given a reprieve from your eternity of torment, to be [owner.name]'s friend for [owner.p_their()] short mortal coil.</span><b> Be aware that if you do not live up to [owner.name]'s expectations, they can send you back to hell with a single thought. [owner.name]'s death will also return you to hell.</b>"
|
||||
flavour_text = "You have been given a reprieve from your eternity of torment, to be [owner.name]'s friend for [owner.p_their()] short mortal coil."
|
||||
important_info = "Be aware that if you do not live up to [owner.name]'s expectations, they can send you back to hell with a single thought. [owner.name]'s death will also return you to hell."
|
||||
var/area/A = get_area(src)
|
||||
if(!mapload && A)
|
||||
notify_ghosts("\A friendship shell has been completed in \the [A.name].", source = src, action=NOTIFY_ATTACK, flashwindow = FALSE, ignore_dnr_observers = TRUE)
|
||||
@@ -439,9 +452,9 @@
|
||||
|
||||
/obj/effect/mob_spawn/human/syndicate/battlecruiser
|
||||
name = "Syndicate Battlecruiser Ship Operative"
|
||||
flavour_text = "<span class='big bold'>You are a crewmember aboard the syndicate flagship: the SBC Starfury.</span><span class='big'> <span class='danger'><b>Your job is to follow your captain's orders, maintain the ship, and keep the engine running.</b></span> If you are not familiar with how the supermatter engine functions: <b>do not attempt to start it.</b><br>\
|
||||
<br>\
|
||||
<span class='danger'><b>The armory is not a candy store, and your role is not to assault the station directly, leave that work to the assault operatives.</b></span></font>"
|
||||
short_desc = "You are a crewmember aboard the syndicate flagship: the SBC Starfury."
|
||||
flavour_text = "Your job is to follow your captain's orders, maintain the ship, and keep the engine running. If you are not familiar with how the supermatter engine functions: do not attempt to start it."
|
||||
important_info = "The armory is not a candy store, and your role is not to assault the station directly, leave that work to the assault operatives."
|
||||
outfit = /datum/outfit/syndicate_empty/SBC
|
||||
|
||||
/datum/outfit/syndicate_empty/SBC
|
||||
@@ -451,10 +464,9 @@
|
||||
belt = /obj/item/storage/belt/military/assault
|
||||
|
||||
/obj/effect/mob_spawn/human/syndicate/battlecruiser/assault
|
||||
name = "Syndicate Battlecruiser Assault Operative"
|
||||
flavour_text = "<span class='big bold'>You are an assault operative aboard the syndicate flagship: the SBC Starfury.</span><span class='big'> <span class='danger'><b>Your job is to follow your captain's orders, keep intruders out of the ship, and assault Space Station 13.</b></span> There is an armory, multiple assault ships, and beam cannons to attack the station with.<br>\
|
||||
<br>\
|
||||
<span class='danger'><b>Work as a team with your fellow operatives and work out a plan of attack. If you are overwhelmed, escape back to your ship!</b></span></span>"
|
||||
short_desc = "You are an assault operative aboard the syndicate flagship: the SBC Starfury."
|
||||
flavour_text = "Your job is to follow your captain's orders, keep intruders out of the ship, and assault Space Station 13. There is an armory, multiple assault ships, and beam cannons to attack the station with."
|
||||
important_info = "Work as a team with your fellow operatives and work out a plan of attack. If you are overwhelmed, escape back to your ship!"
|
||||
outfit = /datum/outfit/syndicate_empty/SBC/assault
|
||||
|
||||
/datum/outfit/syndicate_empty/SBC/assault
|
||||
@@ -470,9 +482,9 @@
|
||||
|
||||
/obj/effect/mob_spawn/human/syndicate/battlecruiser/captain
|
||||
name = "Syndicate Battlecruiser Captain"
|
||||
flavour_text = "<span class='big bold'>You are the captain aboard the syndicate flagship: the SBC Starfury.</span><span class='big'> <span class='danger'><b>Your job is to oversee your crew, defend the ship, and destroy Space Station 13.</b></span> The ship has an armory, multiple ships, beam cannons, and multiple crewmembers to accomplish this goal.<br>\
|
||||
<br>\
|
||||
<span class='danger'><b>As the captain, this whole operation falls on your shoulders.</b></span> You do not need to nuke the station, causing sufficient damage and preventing your ship from being destroyed will be enough.</span>"
|
||||
short_desc = "You are the captain aboard the syndicate flagship: the SBC Starfury."
|
||||
flavour_text = "Your job is to oversee your crew, defend the ship, and destroy Space Station 13. The ship has an armory, multiple ships, beam cannons, and multiple crewmembers to accomplish this goal."
|
||||
important_info = "As the captain, this whole operation falls on your shoulders. You do not need to nuke the station, causing sufficient damage and preventing your ship from being destroyed will be enough."
|
||||
outfit = /datum/outfit/syndicate_empty/SBC/assault/captain
|
||||
id_access_list = list(150,151)
|
||||
|
||||
@@ -498,10 +510,11 @@
|
||||
death = FALSE
|
||||
random = TRUE
|
||||
mob_species = /datum/species/human
|
||||
flavour_text = "<span class='big bold'>You are a security officer working for Nanotrasen,</span><b> stationed onboard a state of the art research station. You vaguely recall rushing into a \
|
||||
cryogenics pod due to an oncoming radiation storm. The last thing you remember is the station's Artificial Program telling you that you would only be asleep for eight hours. As you open \
|
||||
your eyes, everything seems rusted and broken, a dark feeling swells in your gut as you climb out of your pod. \
|
||||
Work as a team with your fellow survivors and do not abandon them.</b>"
|
||||
short_desc = "You are a security officer working for Nanotrasen, stationed onboard a state of the art research station."
|
||||
flavour_text = "You vaguely recall rushing into a cryogenics pod due to an oncoming radiation storm. \
|
||||
The last thing you remember is the station's Artificial Program telling you that you would only be asleep for eight hours. As you open \
|
||||
your eyes, everything seems rusted and broken, a dark feeling swells in your gut as you climb out of your pod."
|
||||
important_info = "Work as a team with your fellow survivors and do not abandon them."
|
||||
uniform = /obj/item/clothing/under/rank/security
|
||||
shoes = /obj/item/clothing/shoes/jackboots
|
||||
id = /obj/item/card/id/away/old/sec
|
||||
@@ -525,10 +538,11 @@
|
||||
death = FALSE
|
||||
random = TRUE
|
||||
mob_species = /datum/species/human
|
||||
flavour_text = "<span class='big bold'>You are an engineer working for Nanotrasen,</span><b> stationed onboard a state of the art research station. You vaguely recall rushing into a \
|
||||
cryogenics pod due to an oncoming radiation storm. The last thing you remember is the station's Artificial Program telling you that you would only be asleep for eight hours. As you open \
|
||||
your eyes, everything seems rusted and broken, a dark feeling swells in your gut as you climb out of your pod. \
|
||||
Work as a team with your fellow survivors and do not abandon them.</b>"
|
||||
short_desc = "You are an engineer working for Nanotrasen, stationed onboard a state of the art research station."
|
||||
flavour_text = "You vaguely recall rushing into a cryogenics pod due to an oncoming radiation storm. The last thing \
|
||||
you remember is the station's Artificial Program telling you that you would only be asleep for eight hours. As you open \
|
||||
your eyes, everything seems rusted and broken, a dark feeling swells in your gut as you climb out of your pod."
|
||||
important_info = "Work as a team with your fellow survivors and do not abandon them."
|
||||
uniform = /obj/item/clothing/under/rank/engineer
|
||||
shoes = /obj/item/clothing/shoes/workboots
|
||||
id = /obj/item/card/id/away/old/eng
|
||||
@@ -550,10 +564,11 @@
|
||||
death = FALSE
|
||||
random = TRUE
|
||||
mob_species = /datum/species/human
|
||||
flavour_text = "<span class='big bold'>You are a scientist working for Nanotrasen,</span><b> stationed onboard a state of the art research station. You vaguely recall rushing into a \
|
||||
cryogenics pod due to an oncoming radiation storm. The last thing you remember is the station's Artificial Program telling you that you would only be asleep for eight hours. As you open \
|
||||
your eyes, everything seems rusted and broken, a dark feeling swells in your gut as you climb out of your pod. \
|
||||
Work as a team with your fellow survivors and do not abandon them.</b>"
|
||||
short_desc = "You are a scientist working for Nanotrasen, stationed onboard a state of the art research station."
|
||||
flavour_text = "You vaguely recall rushing into a cryogenics pod due to an oncoming radiation storm. \
|
||||
The last thing you remember is the station's Artificial Program telling you that you would only be asleep for eight hours. As you open \
|
||||
your eyes, everything seems rusted and broken, a dark feeling swells in your gut as you climb out of your pod."
|
||||
important_info = "Work as a team with your fellow survivors and do not abandon them."
|
||||
uniform = /obj/item/clothing/under/rank/scientist
|
||||
shoes = /obj/item/clothing/shoes/laceup
|
||||
id = /obj/item/card/id/away/old/sci
|
||||
@@ -580,7 +595,8 @@
|
||||
anchored = TRUE
|
||||
density = FALSE
|
||||
show_flavour = FALSE //Flavour only exists for spawners menu
|
||||
flavour_text = "<span class='big bold'>You are a space pirate.</span><b> The station refused to pay for your protection, protect the ship, siphon the credits from the station and raid it for even more loot.</b>"
|
||||
short_desc = "You are a space pirate."
|
||||
flavour_text = "The station refused to pay for your protection, protect the ship, siphon the credits from the station and raid it for even more loot."
|
||||
assignedrole = "Space Pirate"
|
||||
var/rank = "Mate"
|
||||
|
||||
|
||||
@@ -1,111 +1,111 @@
|
||||
#define TANK_DISPENSER_CAPACITY 10
|
||||
|
||||
/obj/structure/tank_dispenser
|
||||
name = "tank dispenser"
|
||||
desc = "A simple yet bulky storage device for gas tanks. Holds up to 10 oxygen tanks and 10 plasma tanks."
|
||||
icon = 'icons/obj/objects.dmi'
|
||||
icon_state = "dispenser"
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
max_integrity = 300
|
||||
var/oxygentanks = TANK_DISPENSER_CAPACITY
|
||||
var/plasmatanks = TANK_DISPENSER_CAPACITY
|
||||
|
||||
/obj/structure/tank_dispenser/oxygen
|
||||
plasmatanks = 0
|
||||
|
||||
/obj/structure/tank_dispenser/plasma
|
||||
oxygentanks = 0
|
||||
|
||||
/obj/structure/tank_dispenser/Initialize()
|
||||
. = ..()
|
||||
for(var/i in 1 to oxygentanks)
|
||||
new /obj/item/tank/internals/oxygen(src)
|
||||
for(var/i in 1 to plasmatanks)
|
||||
new /obj/item/tank/internals/plasma(src)
|
||||
update_icon()
|
||||
|
||||
/obj/structure/tank_dispenser/update_icon()
|
||||
cut_overlays()
|
||||
switch(oxygentanks)
|
||||
if(1 to 3)
|
||||
add_overlay("oxygen-[oxygentanks]")
|
||||
if(4 to TANK_DISPENSER_CAPACITY)
|
||||
add_overlay("oxygen-4")
|
||||
switch(plasmatanks)
|
||||
if(1 to 4)
|
||||
add_overlay("plasma-[plasmatanks]")
|
||||
if(5 to TANK_DISPENSER_CAPACITY)
|
||||
add_overlay("plasma-5")
|
||||
|
||||
/obj/structure/tank_dispenser/attackby(obj/item/I, mob/user, params)
|
||||
var/full
|
||||
if(istype(I, /obj/item/tank/internals/plasma))
|
||||
if(plasmatanks < TANK_DISPENSER_CAPACITY)
|
||||
plasmatanks++
|
||||
else
|
||||
full = TRUE
|
||||
else if(istype(I, /obj/item/tank/internals/oxygen))
|
||||
if(oxygentanks < TANK_DISPENSER_CAPACITY)
|
||||
oxygentanks++
|
||||
else
|
||||
full = TRUE
|
||||
else if(istype(I, /obj/item/wrench))
|
||||
default_unfasten_wrench(user, I, time = 20)
|
||||
return
|
||||
else if(user.a_intent != INTENT_HARM)
|
||||
to_chat(user, "<span class='notice'>[I] does not fit into [src].</span>")
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
if(full)
|
||||
to_chat(user, "<span class='notice'>[src] can't hold any more of [I].</span>")
|
||||
return
|
||||
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You put [I] in [src].</span>")
|
||||
update_icon()
|
||||
|
||||
/obj/structure/tank_dispenser/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "tank_dispenser", name, 275, 100, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/structure/tank_dispenser/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["oxygen"] = oxygentanks
|
||||
data["plasma"] = plasmatanks
|
||||
|
||||
return data
|
||||
|
||||
/obj/structure/tank_dispenser/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("plasma")
|
||||
var/obj/item/tank/internals/plasma/tank = locate() in src
|
||||
if(tank && Adjacent(usr))
|
||||
usr.put_in_hands(tank)
|
||||
plasmatanks--
|
||||
. = TRUE
|
||||
if("oxygen")
|
||||
var/obj/item/tank/internals/oxygen/tank = locate() in src
|
||||
if(tank && Adjacent(usr))
|
||||
usr.put_in_hands(tank)
|
||||
oxygentanks--
|
||||
. = TRUE
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/structure/tank_dispenser/deconstruct(disassembled = TRUE)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
for(var/X in src)
|
||||
var/obj/item/I = X
|
||||
I.forceMove(loc)
|
||||
new /obj/item/stack/sheet/metal (loc, 2)
|
||||
qdel(src)
|
||||
|
||||
#undef TANK_DISPENSER_CAPACITY
|
||||
#define TANK_DISPENSER_CAPACITY 10
|
||||
|
||||
/obj/structure/tank_dispenser
|
||||
name = "tank dispenser"
|
||||
desc = "A simple yet bulky storage device for gas tanks. Holds up to 10 oxygen tanks and 10 plasma tanks."
|
||||
icon = 'icons/obj/objects.dmi'
|
||||
icon_state = "dispenser"
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
max_integrity = 300
|
||||
var/oxygentanks = TANK_DISPENSER_CAPACITY
|
||||
var/plasmatanks = TANK_DISPENSER_CAPACITY
|
||||
|
||||
/obj/structure/tank_dispenser/oxygen
|
||||
plasmatanks = 0
|
||||
|
||||
/obj/structure/tank_dispenser/plasma
|
||||
oxygentanks = 0
|
||||
|
||||
/obj/structure/tank_dispenser/Initialize()
|
||||
. = ..()
|
||||
for(var/i in 1 to oxygentanks)
|
||||
new /obj/item/tank/internals/oxygen(src)
|
||||
for(var/i in 1 to plasmatanks)
|
||||
new /obj/item/tank/internals/plasma(src)
|
||||
update_icon()
|
||||
|
||||
/obj/structure/tank_dispenser/update_icon()
|
||||
cut_overlays()
|
||||
switch(oxygentanks)
|
||||
if(1 to 3)
|
||||
add_overlay("oxygen-[oxygentanks]")
|
||||
if(4 to TANK_DISPENSER_CAPACITY)
|
||||
add_overlay("oxygen-4")
|
||||
switch(plasmatanks)
|
||||
if(1 to 4)
|
||||
add_overlay("plasma-[plasmatanks]")
|
||||
if(5 to TANK_DISPENSER_CAPACITY)
|
||||
add_overlay("plasma-5")
|
||||
|
||||
/obj/structure/tank_dispenser/attackby(obj/item/I, mob/user, params)
|
||||
var/full
|
||||
if(istype(I, /obj/item/tank/internals/plasma))
|
||||
if(plasmatanks < TANK_DISPENSER_CAPACITY)
|
||||
plasmatanks++
|
||||
else
|
||||
full = TRUE
|
||||
else if(istype(I, /obj/item/tank/internals/oxygen))
|
||||
if(oxygentanks < TANK_DISPENSER_CAPACITY)
|
||||
oxygentanks++
|
||||
else
|
||||
full = TRUE
|
||||
else if(istype(I, /obj/item/wrench))
|
||||
default_unfasten_wrench(user, I, time = 20)
|
||||
return
|
||||
else if(user.a_intent != INTENT_HARM)
|
||||
to_chat(user, "<span class='notice'>[I] does not fit into [src].</span>")
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
if(full)
|
||||
to_chat(user, "<span class='notice'>[src] can't hold any more of [I].</span>")
|
||||
return
|
||||
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You put [I] in [src].</span>")
|
||||
update_icon()
|
||||
|
||||
/obj/structure/tank_dispenser/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "tank_dispenser", name, 275, 103, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/structure/tank_dispenser/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["oxygen"] = oxygentanks
|
||||
data["plasma"] = plasmatanks
|
||||
|
||||
return data
|
||||
|
||||
/obj/structure/tank_dispenser/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("plasma")
|
||||
var/obj/item/tank/internals/plasma/tank = locate() in src
|
||||
if(tank && Adjacent(usr))
|
||||
usr.put_in_hands(tank)
|
||||
plasmatanks--
|
||||
. = TRUE
|
||||
if("oxygen")
|
||||
var/obj/item/tank/internals/oxygen/tank = locate() in src
|
||||
if(tank && Adjacent(usr))
|
||||
usr.put_in_hands(tank)
|
||||
oxygentanks--
|
||||
. = TRUE
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/structure/tank_dispenser/deconstruct(disassembled = TRUE)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
for(var/X in src)
|
||||
var/obj/item/I = X
|
||||
I.forceMove(loc)
|
||||
new /obj/item/stack/sheet/metal (loc, 2)
|
||||
qdel(src)
|
||||
|
||||
#undef TANK_DISPENSER_CAPACITY
|
||||
|
||||
Reference in New Issue
Block a user