Major update

- Renames some files, tidies up some of the code
- Adds forceMove() and Topic() sanity checks from github suggestions
- Properly implements tablets, usage flags and portable devices in general. For now, adds codersprites (final release will have actual sprites)
- Fixes some bugs
- Assigns file sizes to programs
This commit is contained in:
Atlantis
2015-08-25 02:23:34 +02:00
parent 49f044d5b8
commit d40ce38e0a
18 changed files with 540 additions and 111 deletions

View File

@@ -9,7 +9,7 @@
var/atom/movable/computer = null // Device that runs this program.
var/filedesc = "Unknown Program" // User-friendly name of this program.
var/program_icon_state = null // Overlay for this program, selected by computer
var/keyboard_icon_state = null // Program-specific keboard icon state
var/keyboard_icon_state = null // Program-specific keboard icon state
var/requires_ntnet = 0 // Set to 1 for program to require nonstop NTNet connection to run. If NTNet connection is lost program crashes.
var/requires_ntnet_feature = 0 // Optional, if above is set to 1 checks for specific function of NTNet (currently NTNET_SOFTWAREDOWNLOAD, NTNET_PEERTOPEER, NTNET_SYSTEMCONTROL and NTNET_COMMUNICATION)
var/ntnet_status = 1 // NTNet status, updated every tick by computer running this program. Don't use this for checks if NTNet works, computers do that. Use this for calculations, etc.
@@ -31,6 +31,13 @@
temp.usage_flags = usage_flags
return temp
/datum/computer_file/program/proc/is_supported_by_hardware(var/hardware_flag = 0, var/loud = 0, var/mob/user = null)
if(!(hardware_flag & usage_flags))
if(loud && computer && user)
user << "<span class='danger'>\The [computer] flashes an \"Hardware Error - Incompatible software\" warning.</span>"
return 0
return 1
// Check if the user can run program. Only humans can operate computer. Automatically called in run_program()
// User has to wear their ID or have it inhand for ID Scan to work.
/datum/computer_file/program/proc/can_run(var/mob/living/user, var/loud = 0)
@@ -64,6 +71,10 @@
if(istype(computer, /obj/machinery/modular_computer))
var/obj/machinery/modular_computer/L = computer
return L.get_header_data()
if(istype(computer, /obj/item/modular_computer))
var/obj/item/modular_computer/L = computer
return L.get_header_data()
return list()
// This is performed on program startup. May be overriden to add extra logic. Remember to include ..() call. Return 1 on success, 0 on failure.
// When implementing new program based device, use this to run the program.

View File

@@ -7,6 +7,7 @@
program_icon_state = "power_monitor"
keyboard_icon_state = "keyboard9"
requires_ntnet = 1
size = 8
/datum/computer_file/program/alarm_monitor
filename = "alarmmonitor"
@@ -15,6 +16,7 @@
program_icon_state = "alarm_monitor"
keyboard_icon_state = "keyboard4"
requires_ntnet = 1
size = 5
/datum/computer_file/program/atmos_control
filename = "atmoscontrol"
@@ -26,6 +28,7 @@
requires_ntnet = 1
requires_ntnet_feature = NTNET_SYSTEMCONTROL
usage_flags = PROGRAM_LAPTOP & PROGRAM_CONSOLE
size = 17
/datum/computer_file/program/rcon_console
filename = "rconconsole"
@@ -37,6 +40,7 @@
requires_ntnet = 1
requires_ntnet_feature = NTNET_SYSTEMCONTROL
usage_flags = PROGRAM_LAPTOP & PROGRAM_CONSOLE
size = 25
/datum/computer_file/program/suit_sensors
filename = "sensormonitor"
@@ -44,4 +48,5 @@
nanomodule_path = /datum/nano_module/crew_monitor
program_icon_state = "crew"
keyboard_icon_state = "keyboard7"
requires_ntnet = 1
requires_ntnet = 1
size = 20