Merge pull request #569 from Neerti/12/14/2015_communicators_v2

Communicators: Reloaded: Revenge of the NanoUI
This commit is contained in:
Neerti
2015-12-14 17:32:09 -05:00
21 changed files with 1413 additions and 346 deletions
@@ -0,0 +1,26 @@
/datum/category_item/player_setup_item/player_global/communicators
name = "Communicators"
sort_order = 4
/datum/category_item/player_setup_item/player_global/communicators/load_preferences(var/savefile/S)
S["communicator_visibility"] >> pref.communicator_visibility
/datum/category_item/player_setup_item/player_global/communicators/save_preferences(var/savefile/S)
S["communicator_visibility"] << pref.communicator_visibility
/datum/category_item/player_setup_item/player_global/communicators/sanitize_preferences()
pref.communicator_visibility = sanitize_integer(pref.communicator_visibility, 0, 1, initial(pref.communicator_visibility))
/datum/category_item/player_setup_item/player_global/communicators/content(var/mob/user)
. += "<b>Communicator Identity:</b><br>"
. += "Visibility: <a href='?src=\ref[src];toggle_comm_visibility=1'><b>[(pref.communicator_visibility) ? "Yes" : "No"]</b></a><br>"
/datum/category_item/player_setup_item/player_global/communicators/OnTopic(var/href,var/list/href_list, var/mob/user)
if(href_list["toggle_comm_visibility"])
if(CanUseTopic(user))
pref.communicator_visibility = !pref.communicator_visibility
return TOPIC_REFRESH
return ..()
+3
View File
@@ -108,6 +108,9 @@ datum/preferences
// OOC Metadata:
var/metadata = ""
// Communicator identity data
var/communicator_visibility = 0
var/client/client = null
var/datum/category_collection/player_setup_collection/player_setup
@@ -18,3 +18,5 @@
/datum/event/communications_blackout/start()
for(var/obj/machinery/telecomms/T in telecomms_list)
T.emp_act(1)
for(var/obj/machinery/exonet_node/N in machines)
N.emp_act(1)
+6
View File
@@ -2,6 +2,7 @@
endWhen = 36000
var/last_spam_time = 0
var/obj/machinery/message_server/useMS
var/obj/machinery/exonet_node/node
/datum/event/pda_spam/setup()
last_spam_time = world.time
@@ -19,6 +20,11 @@
//if there's no spam managed to get to receiver for five minutes, give up
kill()
return
if(!node)
node = get_exonet_node()
if(!node || !node.on || !node.allow_external_PDAs)
return
if(!useMS || !useMS.active)
useMS = null
@@ -0,0 +1,22 @@
/obj/item/device/communicator
description_info = "This device allows someone to speak to another player sourced from the observer pool, as well as other communicators linked to it. \
To use the device, use it in your hand, and it will open an interface with various buttons. Near the bottom will be a list of devices currently available \
for you to call, both from communications on the station, and communicators very far away (observers). To call someone, send a communications request to \
someone and hope they respond, or receive one yourself and respond to them. Hanging up is also simple, and is handled in the 'Manage Connections' tab."
description_fluff = "As a concept, a device that allows long-distance communication has existed for over five hundred years. A device that can accomplish \
that while in space, across star systems, and that the consumer can afford and use without training, is much more recent, and is thanks to the backbone \
that is the Exonet.<br>\
<br>\
The Exonet is the predominant interstellar telecom system, servicing trillions of devices across a large portion of human-controlled space. \
It is distributed by a massive network of telecommunication satellites, some privately owned and others owned by the systems local governments, \
that utilize FTL technologies to bounce data between satellites at speeds that would not be possible at sub-light technology. This communicator \
uses a protocol called Exonet Protocol Version 2, generally shortened to EPv2.<br>\
<br>\
EPv2 is the most common communications protocol in the Exonet, and was specifically designed for it. It was designed to facilitate communication \
between any device in a star system, and have the ability to forward interstellar requests at the root node of that systems Exonet. \
It is also built to cope with the reality that the numerous nodes in a system will likely have frequent outages. The protocol allows for \
up to 18,446,744,073,709,551,616 unique addresses, one of which is assigned to this device."
description_antag = "Electromagnetic pulses will cause the device to disconnect all linked communicators. Turning off the Exonet node at the Telecomms \
satellite will also accomplish this, but for all communicators on and near the station. This may be needed to allow for a quiet kill or capture."
@@ -0,0 +1,36 @@
//This is not strictly a telecomms machine but conceptually it is.
/obj/machinery/exonet_node
description_info = "This machine is needed for several machines back at the colony to interact with systems beyond this region of space, such as \
communicators, external PDA messages, and even newscaster units, which host their content externally. You can fiddle with the device with \
just your hands, due to the integrated monitor and keyboard. Synthetic units can interface with it as well, just like most other machines."
description_fluff = "This is one of many nodes that make up the Exonet, which services trillions of devices across space. This particular node \
is referred to as a terminal node, servicing the Northern Star.<br>\
<br>\
In the beginning of humanity's ascend into space, the Exonet didn't exist. Instead, the Exonet is the evolution to a network called the Interplanetary \
Internet (sometimes referred to as the InterPlaNet), which was conceived and developed due to the limitations of the terrestrial Internet, mainly because \
the IP protocol was unsuitable for long range communications in space, due to the massive delays associated with lightspeed being unable to overcome \
the massive distances between planets in a timely manner. It was a store-and-forward network of smaller internets, distributed between various nodes, \
and was designed to be error, fault, and delay tolerant. The first nodes were put into space around the time when colonization had begun, to service humanitys \
close holdings, such as Luna and Mars.<br>\
<br>\
By 2104, the Interplanetary Internet had coverage within most of Sol, but the network of networks were limited by the speed of light, and due \
to orbital mechanics, the delay for a request to be processed could vary. As an example, a direct message from Mars to Earth could take anywhere \
between three to twenty two minutes to get to Earth, and then the same amount of time to return to Mars. Coverage was also spotty due to the \
nature of operating at such vast distances.<br>\
<br>\
Fortunately, a method for traveling faster than light was discovered, which could allow data to be transmitted beyond the speed of light, \
and thus overcome the limitations of the Interplanetary Internet. One by one, each of the nodes were upgraded to utilize cutting edge \
(at the time) FTL technologies to rapidly increase response time.<br>\
<br>\
Once humanity had send colonists out beyond Sol, to other star systems such as Sirius and Alpha Centauri, they required their own interplanetary \
internet, so a new protocol had to be created, and another hardware upgrade for the separate interplanetary internets. The end result allowed \
communications between Sol and the various exosolar systems, and was dubbed the Exonet. It remains the most common way for consumers to engage \
in long range communications across planets and star systems. Generally, each system has their own Exonet, which is connected to all the other \
Exonets at the root node(s), and is typically arranged in a tree structure. The root node(s) are generally government-owned and are very secure \
and resilient to failure.<br>\
<br>\
This node is privately owned and maintained by Nanotrasen, and allows the colonists of the Northern Star to have access to the Exonet."
description_antag = "An EMP will disable this device for a short period of time. A longer downage can be achieved by turning it off, or rigging \
the APC it uses to turn off remotely, such as with a signaler in the right wire."
+56 -25
View File
@@ -1,13 +1,11 @@
//A very, very simple mob that exists inside other objects to talk and has zero influence on the world.
/mob/living/voice
name = "unknown"
name = "unknown person"
desc = "How are you examining me?"
// default_language = "Galactic Common"
see_invisible = SEE_INVISIBLE_LIVING
var/obj/item/device/communicator/comm = null
emote_type = 2 //This lets them emote through containers. The communicator has a image feed of the person calling them so...
var/stable_connection = 0 //If set to zero, makes the mob effectively deaf, mute, and blind, due to interferance.
/mob/living/voice/New(loc)
add_language("Galactic Common")
@@ -20,11 +18,15 @@
comm = loc
..()
// Proc: transfer_identity()
// Parameters: 1 (speaker - the mob (usually an observer) to copy information from)
// Description: Copies the mob's icons, overlays, TOD, gender, currently loaded character slot, and languages, to src.
/mob/living/voice/proc/transfer_identity(mob/speaker)
if(ismob(speaker))
icon = speaker.icon
icon_state = speaker.icon_state
overlays = speaker.overlays
timeofdeath = speaker.timeofdeath
alpha = 127 //Maybe we'll have hologram calls later.
if(speaker.client && speaker.client.prefs)
@@ -36,6 +38,9 @@
for(var/language in p.alternate_languages)
add_language(language)
// Proc: Login()
// Parameters: None
// Description: Adds a static overlay to the client's screen.
/mob/living/voice/Login()
var/obj/screen/static_effect = new() //Since what the player sees is essentially a video feed, from a vast distance away, the view isn't going to be perfect.
static_effect.screen_loc = ui_entire_screen
@@ -44,10 +49,23 @@
static_effect.mouse_opacity = 0 //So the static doesn't get in the way of clicking.
client.screen.Add(static_effect)
// Proc: Destroy()
// Parameters: None
// Description: Removes reference to the communicator, so it can qdel() successfully.
/mob/living/voice/Destroy()
comm = null
..()
// Proc: ghostize()
// Parameters: None
// Description: Sets a timeofdeath variable, to fix the free respawn bug.
/mob/living/voice/ghostize()
timeofdeath = world.time
. = ..()
// Verb: hang_up()
// Parameters: None
// Description: Disconnects the voice mob from the communicator.
/mob/living/voice/verb/hang_up()
set name = "Hang Up"
set category = "Communicator"
@@ -55,40 +73,53 @@
set src = usr
if(comm)
comm.close_connection(src, "[src] hung up")
comm.close_connection(user = src, target = src, reason = "[src] hung up")
else
src << "You appear to not be inside a communicator. This is a bug and you should report it."
// Verb: change_name()
// Parameters: None
// Description: Allows the voice mob to change their name, assuming it is valid.
/mob/living/voice/verb/change_name()
set name = "Change Name"
set category = "Communicator"
set desc = "Changes your name."
set src = usr
var/new_name = sanitizeSafe(input(src, "Who would you like to be now?", "Communicator", src.client.prefs.real_name) as text, MAX_NAME_LEN)
if(new_name)
if(comm)
comm.visible_message("<span class='notice'>\icon[comm] [src.name] has left, and now you see [new_name].</span>")
//Do a bit of logging in-case anyone tries to impersonate other characters for whatever reason.
var/msg = "[src.client.key] ([src]) has changed their communicator identity's name to [new_name]."
message_admins(msg)
log_game(msg)
src.name = new_name
else
src << "<span class='warning'>Invalid name. Rejected.</span>"
// Proc: Life()
// Parameters: None
// Description: Checks the active variable on the Exonet node, and kills the mob if it goes down or stops existing.
/mob/living/voice/Life()
if(comm && comm.server && !comm.server.active)
comm.close_connection(src,"Connection to telecommunications array timed out")
if(comm)
if(!comm.node || !comm.node.on || !comm.node.allow_external_communicators)
comm.close_connection(user = src, target = src, reason = "Connection to telecommunications array timed out")
..()
// Proc: say()
// Parameters: 4 (generic say() arguments)
// Description: Adds a speech bubble to the communicator device, then calls ..() to do the real work.
/mob/living/voice/say(var/message, var/datum/language/speaking = null, var/verb="says", var/alt_name="")
// world << "say() was called. Arguments: ([message], [speaking], [verb], [alt_name])."
if(!stable_connection)
return 0
//Speech bubbles.
if(comm)
var/speech_bubble_test = say_test(message)
var/image/speech_bubble = image('icons/mob/talk.dmi',src,"h[speech_bubble_test]")
var/image/speech_bubble = image('icons/mob/talk.dmi',comm,"h[speech_bubble_test]")
spawn(30)
qdel(speech_bubble)
for(var/mob/M in hearers(world.view,comm)) //simplifed since it's just a speech bubble
for(var/mob/M in hearers(comm)) //simplifed since it's just a speech bubble
M << speech_bubble
src << speech_bubble
..(message, speaking, verb, alt_name) //mob/living/say() can do the actual talking.
/*
/mob/verb/test_voice_mob()
set name = "Make Voice Mob"
set category = "Debug"
set desc = "For testing only!"
set src = usr
var/turf/T = get_turf(src)
var/obj/item/device/communicator/comm = new(T)
comm.open_connection(src, src)
*/
..(message, speaking, verb, alt_name) //mob/living/say() can do the actual talking.
+7
View File
@@ -1215,6 +1215,13 @@ CIRCUITS BELOW
build_path = /obj/item/weapon/circuitboard/telecomms/receiver
sort_string = "PAAAG"
/datum/design/circuit/tcom/exonet_node
name = "exonet node"
id = "tcom-exonet_node"
req_tech = list(TECH_DATA = 5, TECH_ENGINEERING = 5, TECH_BLUESPACE = 4)
build_path = /obj/item/weapon/circuitboard/telecomms/broadcaster
sort_string = "PAAAH"
/datum/design/circuit/shield
req_tech = list(TECH_BLUESPACE = 4, TECH_PHORON = 3)
materials = list("glass" = 2000, "gold" = 1000)