Merge remote-tracking branch 'upstream/dev' into 160112-PublicToggle

Conflicts:
	baystation12.dme
This commit is contained in:
PsiOmegaDelta
2016-01-13 10:14:51 +01:00
4 changed files with 82 additions and 30 deletions

View File

@@ -1872,6 +1872,7 @@
#include "code\unit_tests\mob_tests.dm"
#include "code\unit_tests\unit_test.dm"
#include "code\unit_tests\zas_tests.dm"
#include "code\unit_tests\map_tests.dm"
#include "code\ZAS\_docs.dm"
#include "code\ZAS\Airflow.dm"
#include "code\ZAS\Atom.dm"

View File

@@ -80,6 +80,7 @@
return
..()
machinery_computer.update_icon()
machinery_computer.use_power = 0
return
// Tesla links only work on machinery types, so we'll override the default try_install_component() proc
@@ -94,6 +95,7 @@
// Consoles don't usually have internal power source, so we can't disable tesla link in them.
if(istype(machinery_computer, /obj/machinery/modular_computer/console))
L.critical = 1
L.enabled = 1
found = 1
..(user, H, found)

View File

@@ -16,25 +16,16 @@
/datum/nano_module/computer_configurator
name = "NTOS Computer Configuration Tool"
var/obj/machinery/modular_computer/stationary = null
var/obj/item/modular_computer/movable = null
/datum/nano_module/computer_configurator/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state)
if(program)
stationary = program.computer
movable = program.computer
if(!istype(stationary))
stationary = null
if(!istype(movable))
movable = null
if(istype(movable, /obj/item/modular_computer/processor))
var/obj/item/modular_computer/processor/P = movable
stationary = P.machinery_computer
// No computer connection, we can't get data from that.
if(!movable && !stationary)
if(!movable)
return 0
var/list/data = list()
@@ -42,27 +33,15 @@
if(program)
data = program.get_header_data()
var/list/hardware = list()
if(stationary)
if(stationary.cpu)
movable = stationary.cpu
hardware.Add(stationary.tesla_link)
else
return
var/list/hardware = movable.get_all_components()
if(movable)
hardware.Add(movable.network_card)
hardware.Add(movable.hard_drive)
hardware.Add(movable.card_slot)
hardware.Add(movable.nano_printer)
hardware.Add(movable.battery_module)
data["disk_size"] = movable.hard_drive.max_capacity
data["disk_used"] = movable.hard_drive.used_capacity
data["power_usage"] = movable.last_power_usage
data["battery_exists"] = movable.battery_module ? 1 : 0
if(movable.battery_module)
data["battery_rating"] = movable.battery_module.battery.maxcharge
data["battery_percent"] = round(movable.battery_module.battery.percent())
data["disk_size"] = movable.hard_drive.max_capacity
data["disk_used"] = movable.hard_drive.used_capacity
data["power_usage"] = movable.last_power_usage
data["battery_exists"] = movable.battery_module ? 1 : 0
if(movable.battery_module)
data["battery_rating"] = movable.battery_module.battery.maxcharge
data["battery_percent"] = round(movable.battery_module.battery.percent())
var/list/all_entries[0]
for(var/obj/item/weapon/computer_hardware/H in hardware)

View File

@@ -0,0 +1,70 @@
/*
*
* Map Unit Tests.
* Zone checks / APC / Scrubber / Vent.
*
*
*/
#define FAILURE 0
#define SUCCESS 1
datum/unit_test/apc_area_test
name = "MAP: Area Test APC / Scrubbers / Vents Z level 1"
datum/unit_test/apc_area_test/start_test()
var/list/bad_areas = list()
var/area_test_count = 0
var/list/exempt_areas = typesof(/area/space, \
/area/syndicate_station, \
/area/skipjack_station, \
/area/solar, \
/area/shuttle, \
/area/holodeck, \
/area/supply/station \
)
var/list/exempt_from_atmos = typesof( /area/maintenance, \
/area/storage, \
/area/engineering/atmos/storage, \
/area/rnd/test_area, \
/area/construction, \
/area/server
)
var/list/exempt_from_apc = typesof( /area/construction, \
/area/medical/genetics
)
for(var/area/A in world)
if(A.z == 1 && !(A.type in exempt_areas))
area_test_count++
var/area_good = 1
var/bad_msg = "[ascii_red]--------------- [A.name]([A.type])"
if(isnull(A.apc) && !(A.type in exempt_from_apc))
log_unit_test("[bad_msg] lacks an APC.[ascii_reset]")
area_good = 0
if(!A.air_scrub_info.len && !(A.type in exempt_from_atmos))
log_unit_test("[bad_msg] lacks an Air scrubber.[ascii_reset]")
area_good = 0
if(!A.air_vent_info.len && !(A.type in exempt_from_atmos))
log_unit_test("[bad_msg] lacks an Air vent.[ascii_reset]")
area_good = 0
if(!area_good)
bad_areas.Add(A)
if(bad_areas.len)
fail("\[[bad_areas.len]/[area_test_count]\]Some areas lacked APCs, Air Scrubbers, or Air vents.")
else
pass("All \[[area_test_count]\] areas contained APCs, Air scrubbers, and Air vents.")
return 1
#undef SUCCESS
#undef FAILURE