Computer tweaks (#1285)

Pulling in some computer changes from bay.
This commit is contained in:
Werner
2016-12-25 13:19:50 +01:00
committed by skull132
parent 93143a8e45
commit 5df9509435
94 changed files with 2682 additions and 989 deletions

View File

@@ -7,6 +7,7 @@ var/global/datum/ntnet/ntnet_global = new()
var/list/logs = list()
var/list/available_station_software = list()
var/list/available_antag_software = list()
var/list/available_news = list()
var/list/chat_channels = list()
var/list/fileservers = list()
// Amount of logs the system tries to keep in memory. Keep below 999 to prevent byond from acting weirdly.
@@ -32,6 +33,7 @@ var/global/datum/ntnet/ntnet_global = new()
relays.Add(R)
R.NTNet = src
build_software_lists()
build_news_list()
add_log("NTNet logging system activated.")
// Simplified logging: Adds a log. log_string is mandatory parameter, source is optional.
@@ -61,7 +63,7 @@ var/global/datum/ntnet/ntnet_global = new()
// Check all relays. If we have at least one working relay, network is up.
for(var/obj/machinery/ntnet_relay/R in relays)
if(R.is_operational())
if(R.operable())
operating = 1
break
@@ -93,6 +95,15 @@ var/global/datum/ntnet/ntnet_global = new()
if(prog.available_on_syndinet)
available_antag_software.Add(prog)
// Builds lists that contain downloadable software.
/datum/ntnet/proc/build_news_list()
available_news = list()
for(var/F in typesof(/datum/computer_file/data/news_article/))
var/datum/computer_file/data/news_article/news = new F(1)
if(news.stored_data)
available_news.Add(news)
// Attempts to find a downloadable file according to filename var
/datum/ntnet/proc/find_ntnet_file_by_name(var/filename)
for(var/datum/computer_file/program/P in available_station_software)

View File

@@ -20,8 +20,8 @@
// TODO: Implement more logic here. For now it's only a placeholder.
/obj/machinery/ntnet_relay/proc/is_operational()
if(stat & (BROKEN | NOPOWER | EMPED))
/obj/machinery/ntnet_relay/operable()
if(!..(EMPED))
return 0
if(dos_failure)
return 0
@@ -30,13 +30,13 @@
return 1
/obj/machinery/ntnet_relay/update_icon()
if(is_operational())
if(operable())
icon_state = "bus"
else
icon_state = "bus_off"
/obj/machinery/ntnet_relay/process()
if(is_operational())
if(operable())
use_power = 2
else
use_power = 1