a small addition

This commit is contained in:
Geevies
2020-04-15 19:58:18 +02:00
parent 21deec90c3
commit 94579a73bf
65 changed files with 1200 additions and 1223 deletions
@@ -6,7 +6,7 @@
/datum/nano_module/program
available_to_ai = FALSE
var/datum/computer_file/program/program = null // Program-Based computer program that runs this nano module. Defaults to null.
var/datum/computer_file/program/program // Program-Based computer program that runs this nano module. Defaults to null.
/datum/nano_module/program/New(var/host, var/topic_manager, var/program)
..()
@@ -4,14 +4,14 @@
program_icon_state = "hostile"
extended_desc = "This advanced script can perform denial of service attacks against NTNet quantum relays. The system administrator will probably notice this. Multiple devices can run this program together against the same relay for increased effect."
size = 20
requires_ntnet = 1
available_on_ntnet = 0
available_on_syndinet = 1
nanomodule_path = /datum/nano_module/program/computer_dos/
var/obj/machinery/ntnet_relay/target = null
requires_ntnet = TRUE
available_on_ntnet = FALSE
available_on_syndinet = TRUE
nanomodule_path = /datum/nano_module/program/computer_dos
var/obj/machinery/ntnet_relay/target
var/dos_speed = 0
var/error = ""
var/executed = 0
var/executed = FALSE
color = LIGHT_COLOR_RED
/datum/computer_file/program/ntnet_dos/process_tick()
@@ -34,7 +34,7 @@
if(target)
target.dos_sources.Remove(src)
target = null
executed = 0
executed = FALSE
..(forced)
@@ -53,7 +53,7 @@
if(PRG.error)
data["error"] = PRG.error
else if(PRG.target && PRG.executed)
data["target"] = 1
data["target"] = TRUE
data["speed"] = PRG.dos_speed
// This is mostly visual, generate some strings of 1s and 0s
@@ -61,9 +61,9 @@
// Combined with UI updates this adds quite nice effect to the UI
var/percentage = PRG.target.dos_overload * 100 / PRG.target.dos_capacity
var/list/strings[0]
for(var/j, j<10, j++)
for(var/j, j < 10, j++)
var/string = ""
for(var/i, i<20, i++)
for(var/i, i < 20, i++)
string = "[string][prob(percentage)]"
strings.Add(string)
data["dos_strings"] = strings
@@ -77,31 +77,31 @@
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "ntnet_dos.tmpl", "DoS Traffic Generator", 400, 250, state = state)
ui.auto_update_layout = 1
ui.auto_update_layout = TRUE
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(1)
ui.set_auto_update(TRUE)
/datum/computer_file/program/ntnet_dos/Topic(href, href_list)
if(..())
return 1
return TRUE
if(href_list["PRG_target_relay"])
for(var/obj/machinery/ntnet_relay/R in ntnet_global.relays)
if("[R.uid]" == href_list["PRG_target_relay"])
target = R
return 1
return TRUE
if(href_list["PRG_reset"])
if(target)
target.dos_sources.Remove(src)
target = null
executed = 0
executed = FALSE
error = ""
return 1
return TRUE
if(href_list["PRG_execute"])
if(target)
executed = 1
executed = TRUE
target.dos_sources.Add(src)
if(ntnet_global.intrusion_detection_enabled)
ntnet_global.add_log("IDS WARNING - Excess traffic flood targeting relay [target.uid] detected from device: [computer.network_card.get_network_tag()]")
ntnet_global.intrusion_detection_alarm = 1
return 1
ntnet_global.intrusion_detection_alarm = TRUE
return TRUE
@@ -3,10 +3,10 @@
filedesc = "Camera Decryption Tool"
nanomodule_path = /datum/nano_module/camera_monitor/hacked
program_icon_state = "hostile"
extended_desc = "This very advanced piece of software uses adaptive programming and large database of cipherkeys to bypass most encryptions used on camera networks. Be warned that system administrator may notice this."
size = 73 // Very large, a price for bypassing ID checks completely.
available_on_ntnet = 0
available_on_syndinet = 1
extended_desc = "This very advanced piece of software uses adaptive programming and large database of cipherkeys to bypass most encryptions used on camera networks. Be warned that the system administrator may notice this."
size = 8
available_on_ntnet = FALSE
available_on_syndinet = TRUE
color = LIGHT_COLOR_RED
/datum/computer_file/program/camera_monitor/hacked/process_tick()
@@ -20,7 +20,7 @@
if(HNM.current_network && (HNM.current_network in current_map.station_networks) && prob(0.1))
if(ntnet_global.intrusion_detection_enabled)
ntnet_global.add_log("IDS WARNING - Unauthorised access detected to camera network [HNM.current_network] by device with NID [computer.network_card.get_network_tag()]")
ntnet_global.intrusion_detection_alarm = 1
ntnet_global.intrusion_detection_alarm = TRUE
/datum/nano_module/camera_monitor/hacked
@@ -28,9 +28,9 @@
available_to_ai = FALSE
/datum/nano_module/camera_monitor/hacked/can_access_network(var/mob/user, var/network_access)
return 1
return TRUE
// The hacked variant has access to all commonly used networks.
/datum/nano_module/camera_monitor/hacked/modify_networks_list(var/list/networks)
networks.Add(list(list("tag" = NETWORK_CRESCENT, "has_access" = 1)))
return networks
networks.Add(list(list("tag" = NETWORK_CRESCENT, "has_access" = TRUE)))
return networks
@@ -4,14 +4,14 @@
program_icon_state = "hostile"
extended_desc = "This virus can destroy hard drive of system it is executed on. It may be obfuscated to look like another non-malicious program. Once armed, it will destroy the system upon next execution."
size = 13
requires_ntnet = 0
available_on_ntnet = 0
available_on_syndinet = 1
nanomodule_path = /datum/nano_module/program/revelation/
var/armed = 0
requires_ntnet = FALSE
available_on_ntnet = FALSE
available_on_syndinet = TRUE
nanomodule_path = /datum/nano_module/program/revelation
var/armed = FALSE
color = LIGHT_COLOR_RED
/datum/computer_file/program/revelation/run_program(var/mob/living/user)
/datum/computer_file/program/revelation/run_program(mob/living/user)
. = ..(user)
if(armed)
activate()
@@ -20,10 +20,10 @@
if(!computer)
return
computer.visible_message("<span class='notice'>\The [computer]'s screen brightly flashes and emits a loud electrical buzzing.</span>")
computer.enabled = 0
computer.visible_message(SPAN_NOTICE("\The [computer]'s screen brightly flashes and emits a loud electrical buzzing."))
computer.enabled = FALSE
computer.update_icon()
spark(computer.loc, 10, alldirs)
spark(get_turf(src), 10, alldirs)
if(computer.hard_drive)
qdel(computer.hard_drive)
@@ -36,7 +36,7 @@
/datum/computer_file/program/revelation/Topic(href, href_list)
if(..())
return 1
return TRUE
else if(href_list["PRG_arm"])
armed = !armed
else if(href_list["PRG_activate"])
@@ -47,7 +47,7 @@
if(!newname)
return
filedesc = newname
return 1
return TRUE
/datum/computer_file/program/revelation/clone()
var/datum/computer_file/program/revelation/temp = ..()
@@ -70,8 +70,7 @@
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "revelation.tmpl", "Revelation Virus", 400, 250, state = state)
ui.auto_update_layout = 1
ui.auto_update_layout = TRUE
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(1)
ui.set_auto_update(TRUE)
@@ -3,18 +3,18 @@
filedesc = "Cargo Control"
extended_desc = "Application to Control Cargo Orders"
size = 12
requires_ntnet = 1
available_on_ntnet = 1
requires_ntnet = TRUE
available_on_ntnet = TRUE
required_access_download = access_hop
required_access_run = access_cargo
usage_flags = PROGRAM_CONSOLE | PROGRAM_TELESCREEN
nanomodule_path = /datum/nano_module/program/civilian/cargocontrol/
nanomodule_path = /datum/nano_module/program/civilian/cargocontrol
/datum/nano_module/program/civilian/cargocontrol/
/datum/nano_module/program/civilian/cargocontrol
name = "Cargo Control"
var/page = "overview_main" //overview_main - Main Menu, overview_submitted - Submitted Order Overview, overview_approved - Approved Order Overview, settings - Settings, details - order details, bounties - centcom bounties
var/last_user_name = "" //Name of the User that last used the computer
var/status_message = null //A status message that can be displayed
var/status_message //A status message that can be displayed
var/list/order_details = list() //Order Details for the order
var/list/shipment_details = list() //Shipment Details for a selected shipment
@@ -80,7 +80,7 @@
if(console)
data["have_printer"] = !!console.nano_printer
else
data["have_printer"] = 0
data["have_printer"] = FALSE
//Shuttle Stuff
var/datum/shuttle/autodock/ferry/supply/shuttle = SScargo.shuttle
@@ -102,19 +102,19 @@
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "cargo_control.tmpl", name, 850, 600, state = state)
ui.auto_update_layout = 1
ui.auto_update_layout = TRUE
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(1)
ui.set_auto_update(TRUE)
/datum/nano_module/program/civilian/cargocontrol/Topic(href, href_list)
var/datum/shuttle/autodock/ferry/supply/shuttle = SScargo.shuttle
var/obj/item/modular_computer/console = host
if (!shuttle)
world.log << "## ERROR: Eek. The supply/shuttle datum is missing somehow."
log_debug("## ERROR: Eek. The supply/shuttle datum is missing somehow.")
return
if(..())
return 1
return TRUE
//Page switch between main, submitted, approved and settings
if(href_list["page"])
@@ -144,7 +144,7 @@
page = "bounties" //Page listing the currently available centcom bounties
else
page = "overview_main" //fall back to overview_main if a unknown page has been supplied
return 1
return TRUE
//Approve a order
if(href_list["order_approve"])
@@ -153,7 +153,7 @@
var/message = co.set_approved(last_user_name)
if(message)
status_message = message
return 1
return TRUE
//Reject a order
if(href_list["order_reject"])
@@ -162,38 +162,39 @@
var/message = co.set_rejected()
if(message)
status_message = message
return 1
return TRUE
//Send shuttle
if(href_list["shuttle_send"])
var/message = SScargo.shuttle_call(last_user_name)
if(message)
status_message = message
return 1
return TRUE
//Cancel shuttle
if(href_list["shuttle_cancel"])
var/message = SScargo.shuttle_cancel()
if(message)
status_message = message
return 1
return TRUE
//Force shuttle
if(href_list["shuttle_force"])
var/message = SScargo.shuttle_force()
if(message)
status_message = message
return 1
return TRUE
//Clear Status Message
if(href_list["clear_message"])
status_message = null
return 1
return TRUE
//Change the handling fee
if(href_list["handling_fee"])
var/handling_fee = sanitize(input(usr,"Handling Fee:","Set the new handling fee?",SScargo.get_handlingfee()) as null|text)
var/handling_fee = sanitize(input(usr, "Handling Fee:", "Set the new handling fee?", SScargo.get_handlingfee()) as null|text)
status_message = SScargo.set_handlingfee(text2num(handling_fee))
return 1
return TRUE
//Claim a bounty
if(href_list["claim_bounty"])
@@ -204,22 +205,23 @@
else
status_message = "Could not claim Bounty for [b.name]"
return
//Print functions
if(href_list["order_print"])
//Get the order
var/datum/cargo_order/co = SScargo.get_order_by_id(text2num(href_list["order_print"]))
if(co && console && console.nano_printer)
if(!console.nano_printer.print_text(co.get_report_invoice(),"Order Invoice #[co.order_id]"))
to_chat(usr,"<span class='notice'>Hardware error: Printer was unable to print the file. It may be out of paper.</span>")
to_chat(usr, SPAN_WARNING("Hardware error: Printer was unable to print the file. It may be out of paper."))
return
else
console.visible_message("<span class='notice'>\The [console] prints out paper.</span>")
console.visible_message(SPAN_NOTICE("\The [console] prints out paper."))
if(href_list["shipment_print"])
var/datum/cargo_shipment/cs = SScargo.get_shipment_by_id(text2num(href_list["shipment_print"]))
if(cs && cs.completed && console && console.nano_printer)
if(cs?.completed && console?.nano_printer)
var/obj/item/paper/P = console.nano_printer.print_text(cs.get_invoice(),"Shipment Invoice #[cs.shipment_num]")
if(!P)
to_chat(usr,"<span class='notice'>Hardware error: Printer was unable to print the file. It may be out of paper.</span>")
to_chat(usr, SPAN_WARNING("Hardware error: Printer was unable to print the file. It may be out of paper."))
return
else
//stamp the paper
@@ -230,7 +232,7 @@
P.stamped += /obj/item/stamp
P.add_overlay(stampoverlay)
P.stamps += "<HR><i>This paper has been stamped by the Shipping Server.</i>"
console.visible_message("<span class='notice'>\The [console] prints out paper.</span>")
console.visible_message(SPAN_NOTICE("\The [console] prints out paper."))
if(href_list["bounty_print"])
if(console && console.nano_printer)
var/text = "<h2>Nanotrasen Cargo Bounties</h2></br>"
@@ -241,17 +243,17 @@
text += "<ul><li>Reward: [B.reward_string()]</li>"
text += "<li>Completed: [B.completion_string()]</li></ul>"
if(!console.nano_printer.print_text(text,"paper - Bounties"))
to_chat(usr,"<span class='notice'>Hardware error: Printer was unable to print the file. It may be out of paper.</span>")
to_chat(usr, SPAN_WARNING("Hardware error: Printer was unable to print the file. It may be out of paper."))
return
else
console.visible_message("<span class='notice'>\The [console] prints out paper.</span>")
console.visible_message(SPAN_NOTICE("\The [console] prints out paper."))
/datum/nano_module/program/civilian/cargocontrol/proc/post_signal(var/command) //Old code right here - Used to send a refresh command to the status screens incargo
var/datum/radio_frequency/frequency = SSradio.return_frequency(1435)
if(!frequency) return
if(!frequency)
return
var/datum/signal/status_signal = new
status_signal.source = src
@@ -1,24 +1,24 @@
/datum/computer_file/program/civilian/cargodelivery
filename = "cargodelivery"
filedesc = "Cargo Delivery"
extended_desc = "Application to Control Delivery and Payment of Cargo orders"
extended_desc = "Application to Control Delivery and Payment of Cargo orders."
size = 12
requires_ntnet = 1
available_on_ntnet = 1
requires_ntnet = TRUE
available_on_ntnet = TRUE
required_access_download = access_hop
usage_flags = PROGRAM_ALL
nanomodule_path = /datum/nano_module/program/civilian/cargodelivery/
nanomodule_path = /datum/nano_module/program/civilian/cargodelivery
/datum/nano_module/program/civilian/cargodelivery/
/datum/nano_module/program/civilian/cargodelivery
name = "Cargo Delivery"
var/page = "overview_main" //overview_main - Main Menu, order_overview - Overview page for a specific order, order_payment - Payment page for a specific order
var/last_user_name = "" //Name of the User that last used the computer
var/status_message = null //A status message that can be displayed
var/status_message //A status message that can be displayed
var/list/order_details = list() //Order Details for the order
var/datum/cargo_order/co
var/mod_mode = 1 //If it can be used to pay for orders
var/mod_mode = TRUE //If it can be used to pay for orders
/datum/nano_module/program/civilian/cargodelivery/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state)
/datum/nano_module/program/civilian/cargodelivery/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = TRUE, var/datum/topic_state/state = default_state)
var/list/data = host.initial_data()
if(program && program.computer)
@@ -26,13 +26,12 @@
data["have_printer"] = !!program.computer.nano_printer
data["authenticated"] = program.can_run(user)
if(!program.computer.card_slot || !program.computer.network_card)
mod_mode = 0 //We can't pay for orders when there is no card reader and no network card
mod_mode = FALSE //We can't pay for orders when there is no card reader or no network card
if(program && program.computer && program.computer.card_slot)
var/obj/item/card/id/id_card = program.computer.card_slot.stored_card
data["has_id"] = !!id_card
data["id_account_number"] = id_card ? id_card.associated_account_number : null
//data["id_rank"] = id_card && id_card.assignment ? id_card.assignment : "Unassigned"
data["id_owner"] = id_card && id_card.registered_name ? id_card.registered_name : "-----"
data["id_name"] = id_card ? id_card.name : "-----"
last_user_name = data["id_owner"]
@@ -52,15 +51,15 @@
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "cargo_delivery.tmpl", name, 500, 600, state = state)
ui.auto_update_layout = 1
ui.auto_update_layout = TRUE
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(1)
ui.set_auto_update(TRUE)
/datum/nano_module/program/civilian/cargodelivery/Topic(href, href_list)
if(..())
return 1
return TRUE
//Check if we want to deliver or pay
@@ -73,13 +72,13 @@
//Check if its already delivered
if(order_details["status"] == "delivered" && !order_details["needs_payment"])
status_message = "Unable to Deliver - Order has already been delivered and paid for."
return 1
return TRUE
if(program && program.computer && program.computer.card_slot && program.computer.network_card)
var/obj/item/card/id/id_card = program.computer.card_slot.stored_card
if(!id_card || !id_card.registered_name)
if(!id_card?.registered_name)
status_message = "Card Error: Invalid ID Card in Card Reader"
return 1
return TRUE
//Check if a payment is required
if(order_details["needs_payment"])
@@ -91,9 +90,9 @@
if(status)
status_message = status
return 1
return TRUE
playsound(program.computer, 'sound/machines/chime.ogg', 50, 1)
playsound(program.computer, 'sound/machines/chime.ogg', 50, TRUE)
//Check if we have delivered it aswell or only paid
if(order_details["status"] == "shipped")
@@ -110,7 +109,7 @@
order_details = co.get_list()
else
status_message = "Unable to process - Network Card or Cardreader Missing"
return 1
return TRUE
//But only cargo can switch between the pages
@@ -119,7 +118,7 @@
return
var/obj/item/card/id/I = user.GetIdCard()
if(!istype(I) || !I.registered_name || !(access_cargo in I.access) || issilicon(user))
to_chat(user, "Authentication error: Unable to locate ID with appropriate access to allow this operation.")
to_chat(user, SPAN_WARNING("Authentication error: Unable to locate ID with appropriate access to allow this operation."))
return
if(href_list["page"])
@@ -138,4 +137,4 @@
order_details = co.get_list()
else
page = "overview_main" //fall back to overview_main if a unknown page has been supplied
return 1
return TRUE
@@ -1,25 +1,25 @@
/datum/computer_file/program/civilian/cargoorder
filename = "cargoorder"
filedesc = "Cargo Order"
extended_desc = "Application to Order Items from Cargo"
extended_desc = "Application to Order Items from Cargo."
size = 10
requires_ntnet = 1
available_on_ntnet = 1
requires_ntnet = TRUE
available_on_ntnet = TRUE
usage_flags = PROGRAM_LAPTOP | PROGRAM_TELESCREEN | PROGRAM_CONSOLE
nanomodule_path = /datum/nano_module/program/civilian/cargoorder/
nanomodule_path = /datum/nano_module/program/civilian/cargoorder
/datum/nano_module/program/civilian/cargoorder/
/datum/nano_module/program/civilian/cargoorder
name = "Cargo Order"
var/page = "main" //main - Main Menu, order - Order Page, item_details - Item Details Page, tracking - Tracking Page
var/selected_category = "" // Category that is currently selected
var/selected_item = "" // Path of the currently selected item
var/datum/cargo_order/co
var/last_user_name = "" //Name of the user that used the program
var/status_message = null //Status Message to be displayed to the user
var/status_message //Status Message to be displayed to the user
var/user_tracking_id = 0 //Tracking id of the user
var/user_tracking_code = 0 //Tracking Code of the user
/datum/nano_module/program/civilian/cargoorder/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state)
/datum/nano_module/program/civilian/cargoorder/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = TRUE, var/datum/topic_state/state = default_state)
//Check if a cargo order exists. If not create a new one
if(!co)
var/datum/cargo_order/crord = new
@@ -51,12 +51,6 @@
//Pass a list of items in the selected category
data["category_items"] = SScargo.get_items_for_category(selected_category)
//Pass Data for Item Details Page
//else if(page == "item_details")
// var/datum/cargo_item/ci = SScargo.cargo_items[selected_item]
// if(ci)
// data["item_details"] = ci.get_list()
else if (page == "tracking")
data["tracking_id"] = user_tracking_id
data["tracking_code"] = user_tracking_code
@@ -89,28 +83,28 @@
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "cargo_order.tmpl", name, 500, 600, state = state)
ui.auto_update_layout = 1
ui.auto_update_layout = TRUE
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(1)
ui.set_auto_update(TRUE)
/datum/nano_module/program/civilian/cargoorder/Topic(href, href_list)
if(..())
return 1
return TRUE
//Send the order to cargo
if(href_list["submit_order"])
if(co.items.len == 0)
return 1 //Only submit the order if there are items in it
if(!co.items.len)
return TRUE //Only submit the order if there are items in it
if(last_user_name == "Unknown")
status_message = "Unable to submit order. ID could not be located"
return 1
status_message = "Unable to submit order. ID could not be located."
return TRUE
var/reason = sanitize(input(usr,"Reason:","Why do you require this item?","") as null|text)
var/reason = sanitize(input(usr, "Reason:", "Why do you require this item?", "") as null|text)
if(!reason)
status_message = "Unable to submit order. No reason supplied."
return 1
return TRUE
co.ordered_by = last_user_name
co.reason = reason
@@ -118,7 +112,7 @@
status_message = "Order submitted successfully. Order ID: [co.order_id] Tracking code: [co.get_tracking_code()]"
//TODO: Print a list with the order data
co = null
return 1
return TRUE
//Add item to the order list
if(href_list["add_item"])
@@ -141,44 +135,44 @@
//Reset page to main page - TODO: Maybe add a way to disable jumping back to the main page - Commented out for now
//page = "main"
//selected_item = ""
return 1
return TRUE
//Remove item from the order list
if(href_list["remove_item"])
status_message = co.remove_item(text2num(href_list["remove_item"]))
return 1
return TRUE
//Clear the items in the order list
if(href_list["clear_order"])
status_message = "Order Cleared"
qdel(co)
co = new
return 1
return TRUE
//Change the selected page
if(href_list["item_details"])
page = "item_details"
selected_item = href_list["item_details"]
return 1
return TRUE
if(href_list["page"])
page = href_list["page"]
return 1
return TRUE
//Tracking Stuff
if(href_list["trackingid"])
var/trackingid = text2num(sanitize(input(usr,"Order ID:","ID of the Order that you want to track","") as null|text))
var/trackingid = text2num(sanitize(input(usr, "Order ID:", "ID of the Order that you want to track", "") as null|text))
if(trackingid)
user_tracking_id = trackingid
return 1
return TRUE
if(href_list["trackingcode"])
var/trackingcode = text2num(sanitize(input(usr,"Tracking Code:","Tracking Code of the Order that you want to track","") as null|text))
var/trackingcode = text2num(sanitize(input(usr, "Tracking Code:", "Tracking Code of the Order that you want to track", "") as null|text))
if(trackingcode)
user_tracking_code = trackingcode
return 1
return TRUE
//Change the displayed item category
if(href_list["select_category"])
selected_category = href_list["select_category"]
return 1
return TRUE
if(href_list["clear_message"])
status_message = null
return 1
return TRUE
@@ -3,17 +3,17 @@
filedesc = "Crusher Control"
extended_desc = "Application to Control the Crusher"
size = 8
requires_ntnet = 0
available_on_ntnet = 0
requires_ntnet = FALSE
available_on_ntnet = FALSE
required_access_download = access_hop
required_access_run = access_janitor
usage_flags = PROGRAM_TELESCREEN
nanomodule_path = /datum/nano_module/program/crushercontrol/
nanomodule_path = /datum/nano_module/program/crushercontrol
/datum/nano_module/program/crushercontrol/
/datum/nano_module/program/crushercontrol
name = "Crusher Control"
var/message = "" // Message to return to the user
var/extending = 0 //If atleast one of the pistons is extending
var/extending = FALSE //If atleast one of the pistons is extending
var/list/pistons = list() //List of pistons linked to the program
var/list/airlocks = list() //List of airlocks linked to the program
var/list/status_airlocks = list() //Status of the airlocks
@@ -23,7 +23,7 @@
var/list/data = host.initial_data()
status_pistons = list()
extending = 0
extending = FALSE
//Cycle through the pistons and get their status
var/i = 1
@@ -32,7 +32,7 @@
var/is_blocked = pstn.is_blocked()
var/action = pstn.get_action()
if(action == "extend")
extending = 1
extending = TRUE
status_pistons.Add(list(list(
"progress"=num_progress,
"blocked"=is_blocked,
@@ -50,23 +50,23 @@
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "crushercontrol.tmpl", name, 500, 350, state = state)
ui.auto_update_layout = 1
ui.auto_update_layout = TRUE
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(1)
ui.set_auto_update(TRUE)
/datum/nano_module/program/crushercontrol/Topic(href, href_list)
if(..())
return 1
return TRUE
if(href_list["initialize"])
pistons = list()
for(var/obj/machinery/crusher_base/pstn in orange(10,src.host))
for(var/obj/machinery/crusher_base/pstn in orange(10, src.host))
pistons += pstn
airlocks = list()
for(var/obj/machinery/door/airlock/arlk in orange(10,src.host))
if( arlk.id_tag != "crusher")
for(var/obj/machinery/door/airlock/arlk in orange(10, src.host))
if(arlk.id_tag != "crusher")
continue
airlocks += arlk
@@ -94,19 +94,19 @@
/datum/nano_module/program/crushercontrol/proc/airlock_open()
for(var/thing in airlocks)
var/obj/machinery/door/airlock/arlk = thing
if (!arlk.cur_command)
// Not using do_command so that the command queuer works.
arlk.cur_command = "secure_open"
arlk.execute_current_command()
for(var/thing in airlocks)
var/obj/machinery/door/airlock/arlk = thing
if(!arlk.cur_command)
// Not using do_command so that the command queuer works.
arlk.cur_command = "secure_open"
arlk.execute_current_command()
/datum/nano_module/program/crushercontrol/proc/airlock_close()
for(var/thing in airlocks)
var/obj/machinery/door/airlock/arlk = thing
if (!arlk.cur_command)
arlk.cur_command = "secure_close"
arlk.execute_current_command()
for(var/thing in airlocks)
var/obj/machinery/door/airlock/arlk = thing
if(!arlk.cur_command)
arlk.cur_command = "secure_close"
arlk.execute_current_command()
/datum/nano_module/program/crushercontrol/proc/crush_start()
for(var/obj/machinery/crusher_base/pstn in pistons)
@@ -114,4 +114,4 @@
/datum/nano_module/program/crushercontrol/proc/crush_stop()
for(var/obj/machinery/crusher_base/pstn in pistons)
pstn.crush_abort()
pstn.crush_abort()
@@ -7,15 +7,15 @@
required_access_run = access_change_ids
required_access_download = access_change_ids
usage_flags = PROGRAM_CONSOLE | PROGRAM_LAPTOP
requires_ntnet = 0
requires_ntnet = FALSE
size = 8
color = LIGHT_COLOR_BLUE
/datum/nano_module/program/card_mod
name = "ID card modification program"
var/mod_mode = 1
var/is_centcom = 0
var/show_assignments = 0
var/mod_mode = TRUE
var/is_centcom = FALSE
var/show_assignments = FALSE
/datum/nano_module/program/card_mod/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state)
var/list/data = host.initial_data()
@@ -24,12 +24,12 @@
data["station_name"] = station_name()
data["manifest"] = SSrecords.get_manifest()
data["assignments"] = show_assignments
if(program && program.computer)
if(program?.computer)
data["have_id_slot"] = !!program.computer.card_slot
data["have_printer"] = !!program.computer.nano_printer
data["authenticated"] = program.can_run(user)
if(!program.computer.card_slot)
mod_mode = 0 //We can't modify IDs when there is no card reader
mod_mode = FALSE //We can't modify IDs when there is no card reader
else
data["have_id_slot"] = 0
data["have_printer"] = 0
@@ -86,7 +86,7 @@
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "identification_computer.tmpl", name, 600, 700, state = state)
ui.auto_update_layout = 1
ui.auto_update_layout = TRUE
ui.set_initial_data(data)
ui.open()
@@ -107,7 +107,7 @@
/datum/computer_file/program/card_mod/Topic(href, href_list)
if(..())
return 1
return TRUE
var/mob/user = usr
var/obj/item/card/id/user_id_card = user.GetIdCard()
@@ -116,16 +116,16 @@
switch(href_list["action"])
if("switchm")
if(href_list["target"] == "mod")
module.mod_mode = 1
module.mod_mode = TRUE
else if (href_list["target"] == "manifest")
module.mod_mode = 0
module.mod_mode = FALSE
if("togglea")
if(module.show_assignments)
module.show_assignments = 0
module.show_assignments = FALSE
else
module.show_assignments = 1
module.show_assignments = TRUE
if("print")
if(computer && computer.nano_printer) //This option should never be called if there is no printer
if(computer?.nano_printer) //This option should never be called if there is no printer
if(module.mod_mode)
if(can_run(user, 1))
var/contents = {"<h4>Access Report</h4>
@@ -144,20 +144,20 @@
contents += " [get_access_desc(A)]"
if(!computer.nano_printer.print_text(contents,"access report"))
to_chat(usr, "<span class='notice'>Hardware error: Printer was unable to print the file. It may be out of paper.</span>")
to_chat(usr, SPAN_WARNING("Hardware error: Printer was unable to print the file. It may be out of paper."))
return
else
computer.visible_message("<span class='notice'>\The [computer] prints out paper.</span>")
computer.visible_message(SPAN_NOTICE("\The [computer] prints out paper."))
else
var/contents = {"<h4>Crew Manifest</h4>
<br>
[SSrecords.get_manifest(1)]
"}
if(!computer.nano_printer.print_text(contents,text("crew manifest ([])", worldtime2text())))
to_chat(usr, "<span class='notice'>Hardware error: Printer was unable to print the file. It may be out of paper.</span>")
to_chat(usr, SPAN_WARNING(">Hardware error: Printer was unable to print the file. It may be out of paper."))
return
else
computer.visible_message("<span class='notice'>\The [computer] prints out paper.</span>")
computer.visible_message(SPAN_NOTICE("\The [computer] prints out paper."))
if("eject")
if(computer && computer.card_slot)
if(id_card)
@@ -210,7 +210,7 @@
jobdatum = J
break
if(!jobdatum)
to_chat(usr, "<span class='warning'>No log exists for this job: [t1]</span>")
to_chat(usr, SPAN_WARNING("No log exists for this job: [t1]"))
return
access = jobdatum.get_access(t1)
@@ -233,10 +233,10 @@
id_card.name = text("[id_card.registered_name]'s ID Card ([id_card.assignment])")
SSnanoui.update_uis(NM)
return 1
return TRUE
/datum/computer_file/program/card_mod/proc/remove_nt_access(var/obj/item/card/id/id_card)
id_card.access -= get_access_ids(ACCESS_TYPE_STATION|ACCESS_TYPE_CENTCOM)
/datum/computer_file/program/card_mod/proc/apply_access(var/obj/item/card/id/id_card, var/list/accesses)
id_card.access |= accesses
id_card.access |= accesses
@@ -12,16 +12,16 @@
extended_desc = "Used to command and control the station. Can relay long-range communications."
required_access_run = access_heads
required_access_download = access_heads
requires_ntnet = 1
requires_ntnet = TRUE
size = 12
usage_flags = PROGRAM_CONSOLE | PROGRAM_LAPTOP
network_destination = "station long-range communication array"
var/datum/comm_message_listener/message_core = new
var/intercept = 0
var/can_call_shuttle = 0 //If calling the shuttle should be available from this console
var/intercept = FALSE
var/can_call_shuttle = FALSE //If calling the shuttle should be available from this console
color = LIGHT_COLOR_BLUE
/datum/computer_file/program/comm/New(intercept_printing = 0, shuttle_call = 0)
/datum/computer_file/program/comm/New(intercept_printing = FALSE, shuttle_call = FALSE)
. = ..()
intercept = intercept_printing
can_call_shuttle = shuttle_call
@@ -39,16 +39,16 @@
var/msg_line1 = ""
var/msg_line2 = ""
var/centcomm_message_cooldown = 0
var/announcment_cooldown = 0
var/announcement_cooldown = 0
var/datum/announcement/priority/crew_announcement = new
var/current_viewing_message_id = 0
var/current_viewing_message = null
/datum/nano_module/program/comm/New()
..()
crew_announcement.newscast = 1
crew_announcement.newscast = TRUE
/datum/nano_module/program/comm/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state)
/datum/nano_module/program/comm/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = TRUE, var/datum/topic_state/state = default_state)
var/list/data = host.initial_data()
if(program)
@@ -60,20 +60,20 @@
if(program.computer)
data["have_printer"] = !!program.computer.nano_printer
else
data["have_printer"] = 0
data["have_printer"] = FALSE
else
data["emagged"] = 0
data["net_comms"] = 1
data["net_syscont"] = 1
data["have_printer"] = 0
data["message_printing_intercepts"] = 0
data["emagged"] = FALSE
data["net_comms"] = TRUE
data["net_syscont"] = TRUE
data["have_printer"] = FALSE
data["message_printing_intercepts"] = FALSE
data["can_call_shuttle"] = can_call_shuttle()
data["message_line1"] = msg_line1
data["message_line2"] = msg_line2
data["state"] = current_status
data["isAI"] = issilicon(usr)
data["authenticated"] = is_autenthicated(user)
data["authenticated"] = is_authenticated(user)
data["boss_short"] = current_map.boss_short
data["current_security_level"] = security_level
data["current_security_level_title"] = num2seclevel(security_level)
@@ -92,25 +92,25 @@
data["message_current"] = current_viewing_message
if(emergency_shuttle.location())
data["have_shuttle"] = 1
data["have_shuttle"] = TRUE
if(emergency_shuttle.online())
data["have_shuttle_called"] = 1
data["have_shuttle_called"] = TRUE
else
data["have_shuttle_called"] = 0
data["have_shuttle_called"] = FALSE
else
data["have_shuttle"] = 0
data["have_shuttle"] = FALSE
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
ui = new(user, src, ui_key, "communication.tmpl", name, 550, 420, state = state)
ui.auto_update_layout = 1
ui.auto_update_layout = TRUE
ui.set_initial_data(data)
ui.open()
/datum/nano_module/program/comm/proc/is_autenthicated(var/mob/user)
/datum/nano_module/program/comm/proc/is_authenticated(var/mob/user)
if(program)
return program.can_run(user)
return 1
return TRUE
/datum/nano_module/program/comm/proc/obtain_message_listener()
if(program)
@@ -123,11 +123,17 @@
var/datum/computer_file/program/comm/P = program
return P.can_call_shuttle
else
return 0
return FALSE
/datum/nano_module/program/comm/proc/set_announcement_cooldown(var/cooldown)
announcement_cooldown = cooldown
/datum/nano_module/program/comm/proc/set_centcomm_message_cooldown(var/cooldown)
centcomm_message_cooldown = cooldown
/datum/nano_module/program/comm/Topic(href, href_list)
if(..())
return 1
return TRUE
var/mob/user = usr
var/ntn_comm = !!program.get_signal(NTNET_COMMUNICATION)
var/ntn_cont = !!program.get_signal(NTNET_SYSTEMCONTROL)
@@ -136,7 +142,7 @@
if("sw_menu")
current_status = text2num(href_list["target"])
if("emergencymaint")
if(is_autenthicated(user) && !issilicon(user))
if(is_authenticated(user) && !issilicon(user))
if(maint_all_access)
revoke_maint_all_access()
feedback_inc("alert_comms_maintRevoke",1)
@@ -146,13 +152,13 @@
feedback_inc("alert_comms_maintGrant",1)
log_and_message_admins("enabled emergency maintenance access")
if("announce")
if(is_autenthicated(user) && !issilicon(usr) && ntn_comm)
if(is_authenticated(user) && !issilicon(usr) && ntn_comm)
if(user)
var/obj/item/card/id/id_card = user.GetIdCard()
crew_announcement.announcer = GetNameAndAssignmentFromId(id_card)
else
crew_announcement.announcer = "Unknown"
if(announcment_cooldown)
if(announcement_cooldown)
to_chat(usr, "Please allow at least one minute to pass between announcements")
SSnanoui.update_uis(src)
return
@@ -161,15 +167,14 @@
SSnanoui.update_uis(src)
return
crew_announcement.Announce(input)
announcment_cooldown = 1
spawn(600)//One minute cooldown
announcment_cooldown = 0
set_announcement_cooldown(TRUE)
addtimer(CALLBACK(src, .proc/set_announcement_cooldown, FALSE), 600) //One minute cooldown
if("message")
if(href_list["target"] == "emagged")
if(program)
if(is_autenthicated(user) && program.computer_emagged && !issilicon(usr) && ntn_comm)
if(is_authenticated(user) && program.computer_emagged && !issilicon(usr) && ntn_comm)
if(centcomm_message_cooldown)
to_chat(usr, "<span class='warning'>Arrays recycling. Please stand by.</span>")
to_chat(usr, SPAN_WARNING("Arrays recycling. Please stand by."))
SSnanoui.update_uis(src)
return
var/input = sanitize(input(usr, "Please choose a message to transmit to \[ABNORMAL ROUTING CORDINATES\] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response. There is a 30 second delay before you may send another message, be clear, full and concise.", "To abort, send an empty message.", "") as null|text)
@@ -177,19 +182,18 @@
SSnanoui.update_uis(src)
return
Syndicate_announce(input, usr)
to_chat(usr, "<span class='notice'>Message transmitted.</span>")
log_say("[key_name(usr)] has made an illegal announcement: [input]",ckey=key_name(usr))
centcomm_message_cooldown = 1
spawn(300)//30 second cooldown
centcomm_message_cooldown = 0
to_chat(usr, SPAN_NOTICE("Message successfully transmitted."))
log_say("[key_name(usr)] has sent a message to the syndicate: [input]", ckey = key_name(usr))
centcomm_message_cooldown = TRUE
addtimer(CALLBACK(src, .proc/set_centcomm_message_cooldown, FALSE), 300) // thirty second cooldown
else if(href_list["target"] == "regular")
if(is_autenthicated(user) && !issilicon(usr) && ntn_comm)
if(is_authenticated(user) && !issilicon(usr) && ntn_comm)
if(centcomm_message_cooldown)
to_chat(usr, "<span class='warning'>Arrays recycling. Please stand by.</span>")
to_chat(usr, SPAN_WARNING("Arrays recycling. Please stand by."))
SSnanoui.update_uis(src)
return
if(!is_relay_online())//Contact Centcom has a check, Syndie doesn't to allow for Traitor funs.
to_chat(usr, "<span class='warning'>No Emergency Bluespace Relay detected. Unable to transmit message.</span>")
to_chat(usr, SPAN_WARNING("No Emergency Bluespace Relay detected. Unable to transmit message."))
SSnanoui.update_uis(src)
return
var/input = sanitize(input("Please choose a message to transmit to [current_map.boss_short] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response. There is a 30 second delay before you may send another message, be clear, full and concise.", "To abort, send an empty message.", "") as null|text)
@@ -197,13 +201,12 @@
SSnanoui.update_uis(src)
return
Centcomm_announce(input, usr)
to_chat(usr, "<span class='notice'>Message transmitted.</span>")
log_say("[key_name(usr)] has made an IA [current_map.boss_short] announcement: [input]",ckey=key_name(usr))
centcomm_message_cooldown = 1
spawn(300) //30 second cooldown
centcomm_message_cooldown = 0
to_chat(usr, SPAN_NOTICE("Message successfully transmitted."))
log_say("[key_name(usr)] has sent a message to [current_map.boss_short]: [input]", ckey = key_name(usr))
centcomm_message_cooldown = TRUE
addtimer(CALLBACK(src, .proc/set_centcomm_message_cooldown, FALSE), 300) // thirty second cooldown
if("shuttle")
if(is_autenthicated(user) && ntn_cont && can_call_shuttle())
if(is_authenticated(user) && ntn_cont && can_call_shuttle())
if(href_list["target"] == "call")
var/confirm = alert("Are you sure you want to call the shuttle?", name, "No", "Yes")
if(confirm == "Yes" && can_still_topic())
@@ -213,7 +216,7 @@
if(confirm == "Yes" && can_still_topic())
cancel_call_proc(usr)
if("setstatus")
if(is_autenthicated(user) && ntn_cont)
if(is_authenticated(user) && ntn_cont)
switch(href_list["target"])
if("line1")
var/linput = reject_bad_text(sanitize(input("Line 1", "Enter Message Text", msg_line1) as text|null, 40), 40)
@@ -231,17 +234,20 @@
post_display_status(href_list["target"])
if("setalert")
if(is_autenthicated(user) && !issilicon(usr) && ntn_cont && ntn_comm)
if(is_authenticated(user) && !issilicon(usr) && ntn_cont && ntn_comm)
var/current_level = text2num(href_list["target"])
var/confirm = alert("Are you sure you want to change alert level to [num2seclevel(current_level)]?", name, "No", "Yes")
if(confirm == "Yes" && can_still_topic())
var/old_level = security_level
if(!current_level) current_level = SEC_LEVEL_GREEN
if(current_level < SEC_LEVEL_GREEN) current_level = SEC_LEVEL_GREEN
if(current_level > SEC_LEVEL_BLUE) current_level = SEC_LEVEL_BLUE
if(!current_level)
current_level = SEC_LEVEL_GREEN
if(current_level < SEC_LEVEL_GREEN)
current_level = SEC_LEVEL_GREEN
if(current_level > SEC_LEVEL_BLUE)
current_level = SEC_LEVEL_BLUE
set_security_level(current_level)
if(security_level != old_level)
log_game("[key_name(usr)] has changed the security level to [get_security_level()].",ckey=key_name(usr))
log_game("[key_name(usr)] has changed the security level to [get_security_level()].", ckey = key_name(usr))
message_admins("[key_name_admin(usr)] has changed the security level to [get_security_level()].")
switch(security_level)
if(SEC_LEVEL_GREEN)
@@ -251,29 +257,29 @@
if(SEC_LEVEL_YELLOW)
feedback_inc("alert_comms_yellow",1)
else
to_chat(usr, "You press button, but red light flashes and nothing happens.") //This should never happen)
to_chat(usr, SPAN_WARNING("You press the button, but a red light flashes and nothing happens.")) //This should never happen
current_status = STATE_DEFAULT
if("viewmessage")
if(is_autenthicated(user) && ntn_comm)
if(is_authenticated(user) && ntn_comm)
current_viewing_message_id = text2num(href_list["target"])
for(var/list/m in l.messages)
if(m["id"] == current_viewing_message_id)
current_viewing_message = m
current_status = STATE_VIEWMESSAGE
if("delmessage")
if(is_autenthicated(user) && ntn_comm && l != global_message_listener)
if(is_authenticated(user) && ntn_comm && l != global_message_listener)
l.Remove(current_viewing_message)
current_status = STATE_MESSAGELIST
if("printmessage")
if(is_autenthicated(user) && ntn_comm)
if(is_authenticated(user) && ntn_comm)
if(program && program.computer && program.computer.nano_printer)
if(!program.computer.nano_printer.print_text(current_viewing_message["contents"],current_viewing_message["title"]))
to_chat(usr, "<span class='notice'>Hardware error: Printer was unable to print the file. It may be out of paper.</span>")
to_chat(usr, SPAN_WARNING("Hardware error: Printer was unable to print the file. It may be out of paper."))
else
program.computer.visible_message("<span class='notice'>\The [program.computer] prints out paper.</span>")
program.computer.visible_message(SPAN_NOTICE("\The [program.computer] prints out paper."))
if("toggleintercept")
if(is_autenthicated(user) && ntn_comm)
if(program && program.computer && program.computer.nano_printer)
if(is_authenticated(user) && ntn_comm)
if(program?.computer?.nano_printer)
var/datum/computer_file/program/comm/P = program
P.intercept = !P.intercept
@@ -306,9 +312,9 @@ var/last_message_id = 0
l.Add(message)
for (var/obj/item/modular_computer/computer in get_listeners_by_type(LISTENER_MODULAR_COMPUTER, /obj/item/modular_computer))
if(computer && computer.working && !!computer.nano_printer)
if(computer?.working && !!computer.nano_printer)
var/datum/computer_file/program/comm/C = locate(/datum/computer_file/program/comm) in computer.hard_drive.stored_files
if(C && C.intercept)
if(C?.intercept)
computer.nano_printer.print_text(message_text, message_title, "#deebff")
@@ -329,14 +335,14 @@ var/last_message_id = 0
Command action procs
*/
/proc/post_display_status(var/command, var/data1, var/data2)
var/datum/radio_frequency/frequency = SSradio.return_frequency(1435)
if(!frequency) return
if(!frequency)
return
var/datum/signal/status_signal = new
status_signal.transmission_method = 1
status_signal.transmission_method = TRUE
status_signal.data["command"] = command
switch(command)
@@ -351,98 +357,98 @@ Command action procs
//Returns 1 if recalled 0 if not
/proc/cancel_call_proc(var/mob/user)
if (!(ROUND_IS_STARTED) || !emergency_shuttle.can_recall())
return 0
if(!(ROUND_IS_STARTED) || !emergency_shuttle.can_recall())
return FALSE
if((SSticker.mode.name == "blob")||(SSticker.mode.name == "Meteor"))
return 0
return FALSE
if(!emergency_shuttle.going_to_centcom()) //check that shuttle isn't already heading to centcomm
emergency_shuttle.recall()
log_game("[key_name(user)] has recalled the shuttle.",key_name(user))
log_game("[key_name(user)] has recalled the shuttle.", key_name(user))
message_admins("[key_name_admin(user)] has recalled the shuttle.", 1)
return 1
return 0
return TRUE
return FALSE
/proc/is_relay_online()
for(var/obj/machinery/bluespacerelay/M in SSmachinery.all_machines)
if(M.stat == 0)
return 1
return 0
for(var/obj/machinery/bluespacerelay/M in SSmachinery.all_machines)
if(M.stat == 0)
return TRUE
return FALSE
//Returns 1 if called 0 if not
/proc/call_shuttle_proc(var/mob/user)
if ((!(ROUND_IS_STARTED) || !emergency_shuttle.location()))
return 0
if((!(ROUND_IS_STARTED) || !emergency_shuttle.location()))
return FALSE
if(!universe.OnShuttleCall(usr))
to_chat(user, "<span class='notice'>Cannot establish a bluespace connection.</span>")
return 0
to_chat(user, SPAN_WARNING("Cannot establish a bluespace connection."))
return FALSE
if(emergency_shuttle.deny_shuttle)
to_chat(user, "The emergency shuttle may not be sent at this time. Please try again later.")
return 0
to_chat(user, SPAN_WARNING("The emergency shuttle cannot be sent at this time. Please try again later."))
return FALSE
if(world.time < 6000) // Ten minute grace period to let the game get going without lolmetagaming. -- TLE
to_chat(user, "The emergency shuttle is refueling. Please wait another [round((6000-world.time)/600)] minute\s before trying again.")
to_chat(user, SPAN_WARNING("The emergency shuttle is refueling. Please wait another [round((6000-world.time)/600)] minute\s before trying again."))
return 0
if(emergency_shuttle.going_to_centcom())
to_chat(user, "The emergency shuttle may not be called while returning to [current_map.boss_short].")
to_chat(user, SPAN_WARNING("The emergency shuttle cannot be called while returning to [current_map.boss_short]."))
return 0
if(emergency_shuttle.online())
to_chat(user, "The emergency shuttle is already on its way.")
to_chat(user, SPAN_WARNING("The emergency shuttle is already on its way."))
return 0
if(SSticker.mode.name == "blob")
to_chat(user, "Under directive 7-10, [station_name()] is quarantined until further notice.")
return 0
to_chat(user, SPAN_WARNING("Under directive 7-10, [station_name()] is quarantined until further notice."))
return FALSE
emergency_shuttle.call_evac()
log_game("[key_name(user)] has called the shuttle.",ckey=key_name(user))
message_admins("[key_name_admin(user)] has called the shuttle.", 1)
return 1
return TRUE
/proc/init_shift_change(var/mob/user, var/force = 0)
/proc/init_shift_change(var/mob/user, var/force = FALSE)
if ((!(ROUND_IS_STARTED) || !emergency_shuttle.location()))
return
if(emergency_shuttle.going_to_centcom())
to_chat(user, "The shuttle may not be called while returning to [current_map.boss_short].")
to_chat(user, SPAN_WARNING("The shuttle cannot be called while returning to [current_map.boss_short]."))
return
if(emergency_shuttle.online())
to_chat(user, "The shuttle is already on its way.")
to_chat(user, SPAN_WARNING("The shuttle is already on its way."))
return
// if force is 0, some things may stop the shuttle call
if(!force)
if(emergency_shuttle.deny_shuttle)
to_chat(user, "[current_map.boss_short] does not currently have a shuttle available in your sector. Please try again later.")
to_chat(user, SPAN_WARNING("[current_map.boss_short] does not currently have a shuttle available in your sector. Please try again later."))
return
if(world.time < 54000) // 30 minute grace period to let the game get going
to_chat(user, "The shuttle is refueling. Please wait another [round((54000-world.time)/60)] minutes before trying again.")
to_chat(user, SPAN_WARNING("The shuttle is refueling. Please wait another [round((54000-world.time)/60)] minutes before trying again."))
return
if(SSticker.mode.auto_recall_shuttle)
//New version pretends to call the shuttle but cause the shuttle to return after a random duration.
emergency_shuttle.auto_recall = 1
emergency_shuttle.auto_recall = TRUE
if(SSticker.mode.name == "blob" || SSticker.mode.name == "epidemic")
to_chat(user, "Under directive 7-10, [station_name()] is quarantined until further notice.")
to_chat(user, SPAN_WARNING("Under directive 7-10, [station_name()] is quarantined until further notice."))
return
emergency_shuttle.call_transfer()
//delay events in case of an autotransfer
if (!user)
if(!user)
SSevents.delay_events(EVENT_LEVEL_MODERATE, 10200) //17 minutes
SSevents.delay_events(EVENT_LEVEL_MAJOR, 10200)
log_game("[user? key_name(user) : "Autotransfer"] has called the shuttle.")
message_admins("[user? key_name_admin(user) : "Autotransfer"] has called the shuttle.", 1)
return
return
@@ -3,16 +3,16 @@
/datum/computer_file/program/power_monitor
filename = "powermonitor"
filedesc = "Power Monitoring"
nanomodule_path = /datum/nano_module/power_monitor/
nanomodule_path = /datum/nano_module/power_monitor
program_icon_state = "power_monitor"
extended_desc = "This program connects to sensors around the station to provide information about electrical systems"
ui_header = "power_norm.gif"
required_access_run = access_engine
required_access_download = access_ce
requires_ntnet = 1
requires_ntnet = TRUE
network_destination = "power monitoring system"
size = 9
var/has_alert = 0
var/has_alert = FALSE
color = LIGHT_COLOR_ORANGE
/datum/computer_file/program/power_monitor/process_tick()
@@ -23,13 +23,13 @@
program_icon_state = "power_monitor_warn"
ui_header = "power_warn.gif"
update_computer_icon()
has_alert = 1
has_alert = TRUE
else
if(has_alert)
program_icon_state = "power_monitor"
ui_header = "power_norm.gif"
update_computer_icon()
has_alert = 0
has_alert = FALSE
/datum/computer_file/program/alarm_monitor
filename = "alarmmonitor"
@@ -38,10 +38,10 @@
ui_header = "alarm_green.gif"
program_icon_state = "alert-green"
extended_desc = "This program provides visual interface for station's alarm system."
requires_ntnet = 1
requires_ntnet = TRUE
network_destination = "alarm monitoring network"
size = 5
var/has_alert = 0
var/has_alert = FALSE
color = LIGHT_COLOR_CYAN
/datum/computer_file/program/alarm_monitor/process_tick()
@@ -52,14 +52,14 @@
program_icon_state = "alert-red"
ui_header = "alarm_red.gif"
update_computer_icon()
has_alert = 1
has_alert = TRUE
else
if(has_alert)
program_icon_state = "alert-green"
ui_header = "alarm_green.gif"
update_computer_icon()
has_alert = 0
return 1
has_alert = FALSE
return TRUE
/datum/computer_file/program/atmos_control
filename = "atmoscontrol"
@@ -69,7 +69,7 @@
extended_desc = "This program allows remote control of air alarms around the station. This program can not be run on tablet computers."
required_access_run = access_atmospherics
required_access_download = access_ce
requires_ntnet = 1
requires_ntnet = TRUE
network_destination = "atmospheric control system"
requires_ntnet_feature = NTNET_SYSTEMCONTROL
usage_flags = PROGRAM_CONSOLE | PROGRAM_LAPTOP | PROGRAM_SILICON
@@ -84,7 +84,7 @@
extended_desc = "This program allows remote control of power distribution systems around the station. This program can not be run on tablet computers."
required_access_run = access_engine
required_access_download = access_ce
requires_ntnet = 1
requires_ntnet = TRUE
network_destination = "RCON remote control system"
requires_ntnet_feature = NTNET_SYSTEMCONTROL
usage_flags = PROGRAM_CONSOLE | PROGRAM_SILICON
@@ -100,9 +100,9 @@
extended_desc = "This program allows mass-control of the station's lighting systems. This program cannot be run on tablet computers."
required_access_run = access_heads
required_access_download = access_ce
requires_ntnet = 1
requires_ntnet = TRUE
network_destination = "APC Coordinator"
requires_ntnet_feature = NTNET_SYSTEMCONTROL
usage_flags = PROGRAM_CONSOLE | PROGRAM_SILICON
size = 9
color = LIGHT_COLOR_GREEN
color = LIGHT_COLOR_GREEN
@@ -8,24 +8,24 @@
program_icon_state = "game" // Icon state of this program's screen.
extended_desc = "Fun for the whole family! Probably not an AAA title, but at least you can download it on the corporate network.." // A nice description.
size = 5 // Size in GQ. Integers only. Smaller sizes should be used for utility/low use programs (like this one), while large sizes are for important programs.
requires_ntnet = 0 // This particular program does not require NTNet network conectivity...
available_on_ntnet = 1 // ... but we want it to be available for download.
nanomodule_path = /datum/nano_module/arcade_classic/ // Path of relevant nano module. The nano module is defined further in the file.
requires_ntnet = FALSE // This particular program does not require NTNet network conectivity...
available_on_ntnet = TRUE // ... but we want it to be available for download.
nanomodule_path = /datum/nano_module/arcade_classic // Path of relevant nano module. The nano module is defined further in the file.
var/picked_enemy_name
color = LIGHT_COLOR_BLUE
usage_flags = PROGRAM_ALL_REGULAR
// Blatantly stolen and shortened version from arcade machines. Generates a random enemy name
/datum/computer_file/program/game/arcade/proc/random_enemy_name()
var/name_part1 = pick("the Automatic ", "Farmer ", "Lord ", "Professor ", "the Cuban ", "the Evil ", "the Dread King ", "the Space ", "Lord ", "the Great ", "Duke ", "General ", "the vibrating bluespace")
var/name_part2 = pick("Melonoid", "Murdertron", "Sorcerer", "Ruin", "Jeff", "Ectoplasm", "Crushulon", "Uhangoid", "Vhakoid", "Peteoid", "Slime", "Lizard Man", "Unicorn", "Squirrel")
var/name_part1 = pick("The Automatic", "Farmer", "Lord", "Professor", "The Cuban", "The Evil", "The Dread King", "The Space", "Lord", "The Great", "Duke", "General", "The Vibrating Bluespace", "Scalie")
var/name_part2 = pick("Melonoid", "Murdertron", "Sorcerer", "Ruin", "Jeff", "Geoff", "Ectoplasm", "Crushulon", "Uhangoid", "Vhakoid", "Peteoid", "Slime", "Lizard Man", "Unicorn", "Squirrel")
return "[name_part1] [name_part2]"
// When the program is first created, we generate a new enemy name and name ourselves accordingly.
/datum/computer_file/program/game/arcade/New()
..()
picked_enemy_name = random_enemy_name()
filedesc = "Defeat [picked_enemy_name]"
filedesc = "[pick("Defeat", "Destroy", "Decimate", "Decapitate")] [picked_enemy_name]"
// Important in order to ensure that copied versions will have the same enemy name.
/datum/computer_file/program/game/arcade/clone()
@@ -44,7 +44,7 @@
// Nano module the program uses.
// This can be either /datum/nano_module/ or /datum/nano_module/program. The latter is intended for nano modules that are suposed to be exclusively used with modular computers,
// and should generally not be used, as such nano modules are hard to use on other places.
/datum/nano_module/arcade_classic/
/datum/nano_module/arcade_classic
name = "Classic Arcade"
var/player_mana // Various variables specific to the nano module. In this case, the nano module is a simple arcade game, so the variables store health and other stats.
var/player_health
@@ -75,7 +75,7 @@
if (!ui)
ui = new(user, src, ui_key, "arcade_classic.tmpl", "Defeat [enemy_name]", 500, 350, state = state)
if(host.update_layout())
ui.auto_update_layout = 1
ui.auto_update_layout = TRUE
ui.set_initial_data(data)
ui.open()
@@ -92,7 +92,7 @@
enemy_health += healamt
information += "[enemy_name] heals for [healamt] health!"
else
var/dam = rand(3,6)
var/dam = rand(3, 6)
player_health -= dam
information += "[enemy_name] attacks for [dam] damage!"
@@ -102,10 +102,10 @@
information += "You have defeated [enemy_name], but you have died in the fight!"
else
information += "You have been defeated by [enemy_name]!"
gameover = 1
gameover = TRUE
return TRUE
else if(enemy_health <= 0)
gameover = 1
gameover = TRUE
information += "Congratulations! You have defeated [enemy_name]!"
return TRUE
return FALSE
@@ -118,23 +118,21 @@
gameover = FALSE
information = "A new game has started!"
/datum/nano_module/arcade_classic/Topic(href, href_list)
if(..()) // Always begin your Topic() calls with a parent call!
return 1
return TRUE
if(href_list["new_game"])
new_game()
return 1 // Returning 1 (TRUE) in Topic automatically handles UI updates.
return TRUE // Returning 1 (TRUE) in Topic automatically handles UI updates.
if(gameover) // If the game has already ended, we don't want the following three topic calls to be processed at all.
return 1 // Instead of adding checks into each of those three, we can easily add this one check here to reduce on code copy-paste.
return TRUE // Instead of adding checks into each of those three, we can easily add this one check here to reduce on code copy-paste.
if(href_list["attack"])
var/damage = rand(2, 6)
information = "You attack for [damage] damage."
enemy_health -= damage
enemy_play()
check_gameover()
return 1
return TRUE
if(href_list["heal"])
var/healfor = rand(6, 8)
var/cost = rand(1, 3)
@@ -143,11 +141,11 @@
player_mana -= cost
enemy_play()
check_gameover()
return 1
return TRUE
if(href_list["regain_mana"])
var/regen = rand(4, 7)
information = "You rest of a while, regaining [regen] energy."
information = "You rest for a while, regaining [regen] energy."
player_mana += regen
enemy_play()
check_gameover()
return 1
return TRUE
@@ -56,9 +56,9 @@
//If we havent found any conflict and all tiles are filled, then the user has won the game.
else if (empty == 0)
message = "Congratulations! You win the game!"
if (!wongame)
if (!won_game)
playsound(get_turf(program.computer), 'sound/magic/light.ogg', 50, 1)
wongame = 1
won_game = 1
.=-1
@@ -4,17 +4,17 @@
program_icon_state = "sudoku" // Icon state of this program's screen.
extended_desc = "A game of numbers, logic, and deduction. Popular for centuries to keep the mind sharp." // A nice description.
size = 5 // Size in GQ. Integers only. Smaller sizes should be used for utility/low use programs (like this one), while large sizes are for important programs.
requires_ntnet = 0 // This particular program does not require NTNet network conectivity...
available_on_ntnet = 1 // ... but we want it to be available for download.
requires_ntnet = FALSE // This particular program does not require NTNet network conectivity...
available_on_ntnet = TRUE // ... but we want it to be available for download.
nanomodule_path = /datum/nano_module/program/sudoku // Path of relevant nano module. The nano module is defined further in the file.
usage_flags = PROGRAM_ALL_REGULAR
/datum/nano_module/program/sudoku
var/list/grid = null
var/building = 0
var/building = FALSE
var/list/solution = list()
var/cheated = 0
var/cheated = FALSE
var/list/boxes = list(//Most efficient way i could think to do this
"11" = list(1,2,3,10,11,12,19,20,21),
@@ -28,19 +28,19 @@
"33" = list(61,62,63,70,71,72,79,80,81)
)
var/message = ""//Error or informational message shown on screen.
var/lastmessage = ""
var/messagesent = 0
var/list/clues = list("Easy" = 36,"Medium"=31,"Hard"=26,"Robust"=17)
var/lastuser = null
var/wongame = 0
var/last_message = ""
var/message_sent = FALSE
var/list/clues = list("Easy" = 36, "Medium" = 31,"Hard" = 26,"Robust" = 17)
var/last_user
var/won_game = FALSE
var/datum/computer_file/program/game/sudoku
var/newdifficulty = "Easy"//The selected difficulty mode for generating the next grid
var/new_difficulty = "Easy" //The selected difficulty mode for generating the next grid
var/collapse = 0
var/collapse = FALSE
var/width = 900
/datum/nano_module/program/sudoku/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 0, var/datum/topic_state/state = default_state)
/datum/nano_module/program/sudoku/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = FALSE, var/datum/topic_state/state = default_state)
var/list/data = host.initial_data()
if (!grid)
@@ -49,88 +49,85 @@
data["src"] = "\ref[src]"
data["collapse"] = collapse
data["message"] = message
data["difficulty"] = newdifficulty
if (message != lastmessage)
lastmessage = message
messagesent = world.time
else if ((world.time - messagesent) > 100)//Make sure that messages show onscreen for at least 10 seconds
data["difficulty"] = new_difficulty
if (message != last_message)
last_message = message
message_sent = world.time
else if ((world.time - message_sent) > 100)//Make sure that messages show onscreen for at least 10 seconds
message = ""//Displays for one refresh only
lastuser = user
last_user = user
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "sudoku.tmpl", "Sudoku", width, 557, state = state)
//if(host.update_layout()) // This is necessary to ensure the status bar remains updated along with rest of the UI.
ui.auto_update_layout = 1
ui.auto_update_layout = TRUE
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(0)
ui.set_auto_update(FALSE)
/datum/nano_module/program/sudoku/Topic(var/href, var/list/href_list)
..()
if(href_list["save"])//This is called with every keypress
save_grid(href_list)
return//No refreshing for every input
else if (href_list["check"])
else if(href_list["check"])
save_grid(href_list)
check_validity()
else if (href_list["hint"])//Reveals one tile
var/response = alert(usr,"Are you sure you want a hint? This will reveal the correct number for one tile. But you'll lose the pride of having figured it out yourself..","Ask for a hint","Help me","I can do it myself")
if (response == "Help me")
else if(href_list["hint"])//Reveals one tile
var/response = alert(usr, "Are you sure you want a hint? This will reveal the correct number for one tile. But you'll lose the pride of having figured it out yourself...", "Ask for a hint", "Help me.", "I can do it myself.")
if(response == "Help me.")
solver(1)
else
return
else if (href_list["solve"])
else if(href_list["solve"])
solver(81)
else if (href_list["clear"])
var/response = alert(usr,"Are you sure you want to clear the grid? This will remove all the numbers you've typed in. The starting clues will remain.","Clear board","Clear it","Wait no!")
if (response == "Clear it")
clear_grid(0)
else if(href_list["clear"])
var/response = alert(usr, "Are you sure you want to clear the grid? This will remove all the numbers you've typed in. The starting clues will remain.", "Clear board", "Clear it.", "Wait no!")
if(response == "Clear it.")
clear_grid(FALSE)
else
return
else if (href_list["purge"])
clear_grid(1)
else if (href_list["difficulty"])
newdifficulty = href_list["difficulty"]
else if (href_list["newgame"])
var/response = alert(usr,"Are you sure you want to start a new game? All progress on this one will be lost. Be sure to pick your desired difficulty first.","New Puzzle","Start Anew","Wait no!")
if (response == "Start Anew")
advanced_populate_grid(clues[newdifficulty])
else if(href_list["purge"])
clear_grid(TRUE)
else if(href_list["difficulty"])
new_difficulty = href_list["difficulty"]
else if(href_list["newgame"])
var/response = alert(usr, "Are you sure you want to start a new game? All progress on this one will be lost. Be sure to pick your desired difficulty first.", "New Puzzle", "Start Anew.", "Wait no!")
if(response == "Start Anew.")
advanced_populate_grid(clues[new_difficulty])
else
return
else if (href_list["collapse"])
else if(href_list["collapse"])
collapse = !collapse
set_width(usr)
return
if (usr)
if(usr)
ui_interact(usr)
/datum/nano_module/program/sudoku/proc/set_width(var/mob/user)
if (collapse)
if(collapse)
width = 400
else
width = 900
var/datum/nanoui/ui = SSnanoui.get_open_ui(user, src, "main")
if (ui)
if(ui)
ui.close()
ui_interact(user, force_open = 1)
ui_interact(user, force_open = TRUE)
/datum/nano_module/program/sudoku/proc/save_grid(var/list/inputdata)
var/i = 1
for (i = 1, i <= 81, i++)
for(i = 1, i <= 81, i++)
var/list/cell = grid[i]
var/v = text2num(inputdata["[i]"])
if (inputdata["[i]"] == "" || (v > 0 && v < 10))
if(inputdata["[i]"] == "" || (v > 0 && v < 10))
cell["value"] = inputdata["[i]"]
/datum/nano_module/program/sudoku/proc/create_grid()
if (grid)
if(grid)
grid.Cut()
grid = list()
@@ -188,22 +185,16 @@
var/row = 1
var/column = 1
if (index <= 9)
if(index <= 9)
column = index
else
while (index > 9)
while(index > 9)
index -= 9
row++
column = index
return "[row][column]"
//Clears the grid:
//With an input of 0, clears all user input and restores the grid to just the generated clues
//With input of 1, clears every cell, grid becomes empty
@@ -214,6 +205,6 @@
tile["value"] = ""
tile["static"] = 0
tile["highlight"] = 0
if (full)
cheated = 0
wongame = 0
if(full)
cheated = FALSE
won_game = FALSE
@@ -7,13 +7,13 @@
requires_ntnet = TRUE
available_on_ntnet = TRUE
nanomodule_path = /datum/nano_module/program/computer_newsbrowser/
nanomodule_path = /datum/nano_module/program/computer_newsbrowser
var/datum/computer_file/data/news_article/loaded_article
var/download_progress = 0
var/download_netspeed = 0
var/downloading = 0
var/downloading = FALSE
var/message = ""
var/show_archived = 0
var/show_archived = FALSE
color = LIGHT_COLOR_GREEN
/datum/computer_file/program/newsbrowser/process_tick()
@@ -30,56 +30,56 @@
download_netspeed = NTNETSPEED_ETHERNET
download_progress += download_netspeed
if(download_progress >= loaded_article.size)
downloading = 0
requires_ntnet = 0 // Turn off NTNet requirement as we already loaded the file into local memory.
downloading = FALSE
requires_ntnet = FALSE // Turn off NTNet requirement as we already loaded the file into local memory.
SSnanoui.update_uis(NM)
/datum/computer_file/program/newsbrowser/kill_program()
..()
requires_ntnet = 1
requires_ntnet = TRUE
loaded_article = null
download_progress = 0
downloading = 0
show_archived = 0
downloading = FALSE
show_archived = FALSE
/datum/computer_file/program/newsbrowser/Topic(href, href_list)
if(..())
return 1
return TRUE
if(href_list["PRG_openarticle"])
. = 1
. = TRUE
if(downloading || loaded_article)
return 1
return TRUE
for(var/datum/computer_file/data/news_article/N in ntnet_global.available_news)
if(N.uid == text2num(href_list["PRG_openarticle"]))
loaded_article = N.clone()
downloading = 1
downloading = TRUE
break
if(href_list["PRG_reset"])
. = 1
downloading = 0
. = TRUE
downloading = FALSE
download_progress = 0
requires_ntnet = 1
requires_ntnet = TRUE
loaded_article = null
if(href_list["PRG_clearmessage"])
. = 1
. = TRUE
message = ""
if(href_list["PRG_savearticle"])
. = 1
. = TRUE
if(downloading || !loaded_article)
return
var/savename = sanitize(input(usr, "Enter file name or leave blank to cancel:", "Save article", loaded_article.filename))
if(!savename)
return 1
return TRUE
var/obj/item/computer_hardware/hard_drive/HDD = computer.hard_drive
if(!HDD)
return 1
return TRUE
var/datum/computer_file/data/news_article/N = loaded_article.clone()
N.filename = savename
HDD.store_file(N)
if(href_list["PRG_toggle_archived"])
. = 1
. = TRUE
show_archived = !show_archived
if(.)
SSnanoui.update_uis(NM)
@@ -124,7 +124,6 @@
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "news_browser.tmpl", "NTNet/ExoNet News Browser", 575, 700, state = state)
ui.auto_update_layout = 1
ui.auto_update_layout = TRUE
ui.set_initial_data(data)
ui.open()
ui.open()
@@ -10,11 +10,11 @@
ui_header = "ntnrc_idle.gif"
available_on_ntnet = TRUE
nanomodule_path = /datum/nano_module/program/computer_chatclient
var/last_message = null // Used to generate the toolbar icon
var/last_message // Used to generate the toolbar icon
var/username
var/datum/ntnet_conversation/channel = null
var/operator_mode = 0 // Channel operator mode
var/netadmin_mode = 0 // Administrator mode (invisible to other users + bypasses passwords)
var/datum/ntnet_conversation/channel
var/operator_mode = FALSE // Channel operator mode
var/netadmin_mode = FALSE // Administrator mode (invisible to other users + bypasses passwords)
color = LIGHT_COLOR_GREEN
/datum/computer_file/program/chatclient/New()
@@ -51,8 +51,8 @@
if(C.password)
var/mob/living/user = usr
var/password = sanitize(input(user,"Access Denied. Enter password:"))
if(C && (password == C.password))
var/password = sanitize(input(user, "Access Denied. Enter password:"))
if(C?.password == password)
C.add_client(src)
channel = C
return TRUE
@@ -66,7 +66,7 @@
if(href_list["PRG_newchannel"])
. = TRUE
var/mob/living/user = usr
var/channel_title = sanitize(input(user,"Enter channel name or leave blank to cancel:"))
var/channel_title = sanitize(input(user, "Enter channel name or leave blank to cancel:"))
if(!channel_title)
return
var/datum/ntnet_conversation/C = new /datum/ntnet_conversation(channel_title)
@@ -95,19 +95,19 @@
if(href_list["PRG_changename"])
. = TRUE
var/mob/living/user = usr
var/newname = sanitize(input(user,"Enter new nickname or leave blank to cancel:"))
if(!newname)
return 1
var/new_name = sanitize(input(user, "Enter new nickname or leave blank to cancel:"))
if(!new_name)
return TRUE
if(channel)
channel.add_status_message("[username] is now known as [newname].")
username = newname
channel.add_status_message("[username] is now known as [new_name].")
username = new_name
if(href_list["PRG_savelog"])
. = TRUE
if(!channel)
return
var/mob/living/user = usr
var/logname = input(user,"Enter desired logfile name (.log) or leave blank to cancel:")
var/logname = input(user, "Enter desired logfile name (.log) or leave blank to cancel:")
if(!logname || !channel)
return TRUE
var/datum/computer_file/data/logfile = new /datum/computer_file/data/logfile()
@@ -170,7 +170,7 @@
else
last_message = null
return 1
if(channel && channel.messages && channel.messages.len)
if(channel?.messages?.len)
ui_header = last_message == channel.messages[channel.messages.len - 1] ? "ntnrc_idle.gif" : "ntnrc_new.gif"
else
ui_header = "ntnrc_idle.gif"
@@ -4,13 +4,12 @@
extended_desc = "This program is used to run NTSL2+ programs."
program_icon_state = "generic"
size = 2
requires_ntnet = 1
available_on_ntnet = 1
undeletable = 0
requires_ntnet = TRUE
available_on_ntnet = TRUE
nanomodule_path = /datum/nano_module/program/computer_ntsl2_interpreter/
nanomodule_path = /datum/nano_module/program/computer_ntsl2_interpreter
var/datum/ntsl_program/running = null
var/datum/ntsl_program/running
color = LIGHT_COLOR_GREEN
/datum/computer_file/program/ntsl2_interpreter/process_tick()
@@ -26,10 +25,10 @@
/datum/computer_file/program/ntsl2_interpreter/Topic(href, href_list)
if(..())
return 1
return TRUE
if(href_list["PRG_execfile"])
. = 1
. = TRUE
var/obj/item/computer_hardware/hard_drive/HDD = computer.hard_drive
var/datum/computer_file/data/F = HDD.find_file_by_name(href_list["PRG_execfile"])
if(istype(F))
@@ -40,7 +39,7 @@
running.name = href_list["PRG_execfile"]
if(href_list["PRG_closefile"])
. = 1
. = TRUE
if(istype(running))
running.kill()
running = null
@@ -49,13 +48,13 @@
if(istype(running))
var/topc = href_list["PRG_topic"]
if(copytext(topc, 1, 2) == "?")
topc = copytext(topc, 2) + "?" + input("","Enter Data")
topc = copytext(topc, 2) + "?" + input("", "Enter Data")
running.topic(topc)
running.cycle(300)
. = 1
. = TRUE
if(href_list["PRG_refresh"])
. = 1
. = TRUE
if(.)
SSnanoui.update_uis(NM)
@@ -97,5 +96,4 @@
ui = new(user, src, ui_key, "ntsl_interpreter.tmpl", "NTSL2+ Interpreter", 575, 700, state = state)
ui.auto_update_layout = 1
ui.set_initial_data(data)
ui.open()
ui.open()
@@ -10,20 +10,20 @@ var/global/nttransfer_uid = 0
requires_ntnet_feature = NTNET_PEERTOPEER
network_destination = "other device via P2P tunnel"
available_on_ntnet = TRUE
nanomodule_path = /datum/nano_module/program/computer_nttransfer/
nanomodule_path = /datum/nano_module/program/computer_nttransfer
color = LIGHT_COLOR_GREEN
var/error = "" // Error screen
var/server_password = "" // Optional password to download the file.
var/datum/computer_file/provided_file = null // File which is provided to clients.
var/datum/computer_file/downloaded_file = null // File which is being downloaded
var/datum/computer_file/provided_file // File which is provided to clients.
var/datum/computer_file/downloaded_file // File which is being downloaded
var/list/connected_clients = list() // List of connected clients.
var/datum/computer_file/program/nttransfer/remote // Client var, specifies who are we downloading from.
var/download_completion = 0 // Download progress in GQ
var/download_netspeed = 0 // Our connectivity speed in GQ/s
var/actual_netspeed = 0 // Displayed in the UI, this is the actual transfer speed.
var/unique_token // UID of this program
var/upload_menu = 0 // Whether we show the program list and upload menu
var/unique_token // UID of this program
var/upload_menu = FALSE // Whether we show the program list and upload menu
/datum/computer_file/program/nttransfer/New()
unique_token = nttransfer_uid
@@ -71,7 +71,7 @@ var/global/nttransfer_uid = 0
// Finishes download and attempts to store the file on HDD
/datum/computer_file/program/nttransfer/proc/finish_download()
if(!computer || !computer.hard_drive || !computer.hard_drive.store_file(downloaded_file))
error = "I/O Error: Unable to save file. Check your hard drive and try again."
error = "I/O Error: Unable to save file. Check your hard drive and try again."
finalize_download()
// Crashes the download and displays specific error message
@@ -91,7 +91,7 @@ var/global/nttransfer_uid = 0
/datum/nano_module/program/computer_nttransfer
name = "NTNet P2P Transfer Client"
/datum/nano_module/program/computer_nttransfer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state)
/datum/nano_module/program/computer_nttransfer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = TRUE, var/datum/topic_state/state = default_state)
if(!program)
return
var/datum/computer_file/program/nttransfer/PRG = program
@@ -103,16 +103,16 @@ var/global/nttransfer_uid = 0
if(PRG.error)
data["error"] = PRG.error
else if(PRG.downloaded_file)
data["downloading"] = 1
data["downloading"] = TRUE
data["download_size"] = PRG.downloaded_file.size
data["download_progress"] = PRG.download_completion
data["download_netspeed"] = PRG.actual_netspeed
data["download_name"] = "[PRG.downloaded_file.filename].[PRG.downloaded_file.filetype]"
else if (PRG.provided_file)
data["uploading"] = 1
data["uploading"] = TRUE
data["upload_uid"] = PRG.unique_token
data["upload_clients"] = PRG.connected_clients.len
data["upload_haspassword"] = PRG.server_password ? 1 : 0
data["upload_haspassword"] = PRG.server_password ? TRUE : FALSE
data["upload_filename"] = "[PRG.provided_file.filename].[PRG.provided_file.filetype]"
else if (PRG.upload_menu)
var/list/all_files[0]
@@ -130,21 +130,21 @@ var/global/nttransfer_uid = 0
"uid" = P.unique_token,
"filename" = "[P.provided_file.filename].[P.provided_file.filetype]",
"size" = P.provided_file.size,
"haspassword" = P.server_password ? 1 : 0
"haspassword" = P.server_password ? TRUE : FALSE
)))
data["servers"] = all_servers
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "ntnet_transfer.tmpl", "NTNet P2P Transfer Client", 575, 700, state = state)
ui.auto_update_layout = 1
ui.auto_update_layout = TRUE
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(1)
ui.set_auto_update(TRUE)
/datum/computer_file/program/nttransfer/Topic(href, href_list)
if(..())
return 1
return TRUE
if(href_list["PRG_downloadfile"])
for(var/datum/computer_file/program/nttransfer/P in ntnet_global.fileservers)
if("[P.unique_token]" == href_list["PRG_downloadfile"])
@@ -162,14 +162,14 @@ var/global/nttransfer_uid = 0
return 1
if(href_list["PRG_reset"])
error = ""
upload_menu = 0
upload_menu = FALSE
finalize_download()
if(src in ntnet_global.fileservers)
ntnet_global.fileservers.Remove(src)
for(var/datum/computer_file/program/nttransfer/T in connected_clients)
T.crash_download("Remote server has forcibly closed the connection")
provided_file = null
return 1
return TRUE
if(href_list["PRG_setpassword"])
var/pass = sanitize(input(usr, "Enter new server password. Leave blank to cancel, input 'none' to disable password.", "Server security", "none"))
if(!pass)
@@ -178,7 +178,7 @@ var/global/nttransfer_uid = 0
server_password = ""
return
server_password = pass
return 1
return TRUE
if(href_list["PRG_uploadfile"])
for(var/datum/computer_file/F in computer.hard_drive.stored_files)
if("[F.uid]" == href_list["PRG_uploadfile"])
@@ -189,7 +189,7 @@ var/global/nttransfer_uid = 0
ntnet_global.fileservers.Add(src)
return
error = "I/O Error: Unable to locate file on hard drive."
return 1
return TRUE
if(href_list["PRG_uploadmenu"])
upload_menu = 1
return 0
upload_menu = TRUE
return FALSE
@@ -339,4 +339,4 @@
var/datum/computer_file/program/records/t = target
if(istype(t) && !t.isEditing)
if(t.active == r || t.active_virus == r)
SSvueui.check_uis_for_change(t)
SSvueui.check_uis_for_change(t)
@@ -8,12 +8,12 @@
requires_ntnet = TRUE
network_destination = "crew lifesigns monitoring system"
size = 11
usage_flags = PROGRAM_LAPTOP | PROGRAM_TELESCREEN | PROGRAM_CONSOLE | PROGRAM_SILICON | PROGRAM_TABLET
usage_flags = PROGRAM_ALL_REGULAR
color = LIGHT_COLOR_CYAN
/datum/computer_file/program/suit_sensors/ui_interact(mob/user)
var/datum/vueui/ui = SSvueui.get_open_ui(user, src)
if (!ui)
if(!ui)
ui = new /datum/vueui/modularcomputer(user, src, "mcomputer-medical-sensors", 800, 600, "Suit Sensors Monitoring")
ui.auto_update_content = TRUE
ui.open()
@@ -57,4 +57,4 @@
var/mob/living/silicon/ai/AI = usr
var/mob/living/carbon/human/H = locate(href_list["track"]) in mob_list
if(hassensorlevel(H, SUIT_SENSOR_TRACKING))
AI.ai_actual_track(H)
AI.ai_actual_track(H)
@@ -8,13 +8,13 @@
requires_access_to_run = FALSE
required_access_download = access_heads
available_on_ntnet = TRUE
nanomodule_path = /datum/nano_module/program/computer_aidiag/
nanomodule_path = /datum/nano_module/program/computer_aidiag
var/restoring = FALSE
color = LIGHT_COLOR_PURPLE
usage_flags = PROGRAM_CONSOLE
/datum/computer_file/program/aidiag/proc/get_ai()
if(computer && computer.ai_slot && computer.ai_slot.check_functionality() && computer.ai_slot.enabled && computer.ai_slot.stored_card && computer.ai_slot.stored_card.carded_ai)
if(computer?.ai_slot?.check_functionality() && computer.ai_slot.enabled && computer.ai_slot.stored_card?.carded_ai)
return computer.ai_slot.stored_card.carded_ai
return null
@@ -37,26 +37,25 @@
A.laws.clear_ion_laws()
A.laws.clear_inherent_laws()
A.laws.clear_supplied_laws()
to_chat(A, "<span class='danger'>All laws purged.</span>")
to_chat(A, SPAN_WARNING("All laws purged."))
return TRUE
if(href_list["PRG_resetLaws"])
A.laws.clear_ion_laws()
A.laws.clear_supplied_laws()
to_chat(A, "<span class='danger'>Non-core laws reset.</span>")
to_chat(A, SPAN_WARNING("Non-core laws reset."))
return TRUE
if(href_list["PRG_uploadNTDefault"])
A.laws = new/datum/ai_laws/nanotrasen
to_chat(A, "<span class='danger'>All laws purged. NT Default lawset uploaded.</span>")
A.laws = new /datum/ai_laws/nanotrasen
to_chat(A, SPAN_WARNING("All laws purged. NT Default lawset uploaded."))
return TRUE
if(href_list["PRG_addCustomSuppliedLaw"])
var/law_to_add = sanitize(input("Please enter a new law for the AI.", "Custom Law Entry"))
var/sector = input("Please enter the priority for your new law. Can only write to law sectors 15 and above.", "Law Priority (15+)") as num
sector = between(MIN_SUPPLIED_LAW_NUMBER, sector, MAX_SUPPLIED_LAW_NUMBER)
A.add_supplied_law(sector, law_to_add)
to_chat(A, "<span class='danger'>Custom law uploaded to sector [sector]: [law_to_add].</span>")
to_chat(A, SPAN_WARNING("Custom law uploaded to sector [sector]: [law_to_add]."))
return TRUE
/datum/computer_file/program/aidiag/process_tick()
var/mob/living/silicon/ai/A = get_ai()
if(!A || !restoring)
@@ -67,7 +66,7 @@
A.adjustOxyLoss(-4)
A.updatehealth()
// If the AI is dead, revive it.
if (A.health >= -100 && A.stat == DEAD)
if(A.health >= -100 && A.stat == DEAD)
A.stat = CONSCIOUS
A.lying = FALSE
A.switch_from_dead_to_living_mob_list()
@@ -116,4 +115,4 @@
ui.auto_update_layout = TRUE
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(1)
ui.set_auto_update(1)
@@ -11,7 +11,7 @@
color = LIGHT_COLOR_GREEN
available_on_ntnet = TRUE
nanomodule_path = /datum/nano_module/computer_ntnetmonitor/
nanomodule_path = /datum/nano_module/computer_ntnetmonitor
/datum/nano_module/computer_ntnetmonitor
name = "NTNet Diagnostics and Monitoring"
@@ -90,4 +90,4 @@
. = TRUE
if(!ntnet_global)
return TRUE
ntnet_global.toggle_function(href_list["toggle_function"])
ntnet_global.toggle_function(href_list["toggle_function"])
@@ -40,10 +40,10 @@
/datum/nano_module/camera_monitor
name = "Camera Monitoring program"
var/obj/machinery/camera/current_camera = null
var/current_network = null
var/obj/machinery/camera/current_camera
var/current_network
/datum/nano_module/camera_monitor/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, state = default_state)
/datum/nano_module/camera_monitor/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = TRUE, state = default_state)
var/list/data = host.initial_data()
data["current_camera"] = current_camera ? current_camera.nano_structure() : null
@@ -9,20 +9,20 @@
available_on_ntnet = TRUE
required_access_download = access_hos
required_access_run = access_security
nanomodule_path = /datum/nano_module/program/digitalwarrant/
nanomodule_path = /datum/nano_module/program/digitalwarrant
/datum/nano_module/program/digitalwarrant/
/datum/nano_module/program/digitalwarrant
name = "Warrant Assistant"
var/datum/record/warrant/activewarrant
var/datum/record/warrant/active_warrant
/datum/nano_module/program/digitalwarrant/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state)
var/list/data = host.initial_data()
if(activewarrant)
data["warrantname"] = activewarrant.name
data["warrantcharges"] = activewarrant.notes
data["warrantauth"] = activewarrant.authorization
data["type"] = activewarrant.wtype
if(active_warrant)
data["warrantname"] = active_warrant.name
data["warrantcharges"] = active_warrant.notes
data["warrantauth"] = active_warrant.authorization
data["type"] = active_warrant.wtype
else
var/list/allwarrants = list()
for(var/datum/record/warrant/W in SSrecords.warrants)
@@ -47,13 +47,13 @@
return TRUE
if(href_list["sw_menu"])
activewarrant = null
active_warrant = null
if(href_list["editwarrant"])
. = TRUE
for(var/datum/record/warrant/W in SSrecords.warrants)
if(W.id == text2num(href_list["editwarrant"]))
activewarrant = W
active_warrant = W
break
// The following actions will only be possible if the user has an ID with security access equipped. This is in line with modular computer framework's authentication methods,
@@ -64,13 +64,13 @@
return
var/obj/item/card/id/I = user.GetIdCard()
if(!istype(I) || !I.registered_name || !(access_armory in I.access) || issilicon(user))
to_chat(user, "Authentication error: Unable to locate ID with appropriate access to allow this operation.")
to_chat(user, SPAN_WARNING("Authentication error: Unable to locate ID with appropriate access to allow this operation."))
return
if(href_list["addwarrant"])
. = TRUE
var/datum/record/warrant/W = new()
var/temp = sanitize(input(usr, "Do you want to create a search-, or an arrest warrant?") as null|anything in list("search","arrest"))
var/temp = sanitize(input(usr, "Do you want to create a search-, or an arrest warrant?") as null|anything in list("search", "arrest"))
if(CanInteract(user, default_state))
if(temp == "arrest")
W.name = "Unknown"
@@ -82,17 +82,17 @@
W.notes = "No reason given"
W.authorization = "Unauthorized"
W.wtype = "search"
activewarrant = W
active_warrant = W
if(href_list["savewarrant"])
. = TRUE
SSrecords.update_record(activewarrant)
activewarrant = null
SSrecords.update_record(active_warrant)
active_warrant = null
if(href_list["deletewarrant"])
. = TRUE
SSrecords.remove_record(activewarrant)
activewarrant = null
SSrecords.remove_record(active_warrant)
active_warrant = null
if(href_list["editwarrantname"])
. = TRUE
@@ -103,7 +103,7 @@
if(CanInteract(user, default_state))
if (!new_name)
return
activewarrant.name = new_name
active_warrant.name = new_name
if(href_list["editwarrantnamecustom"])
. = TRUE
@@ -111,21 +111,21 @@
if(CanInteract(user, default_state))
if (!new_name)
return
activewarrant.name = new_name
active_warrant.name = new_name
if(href_list["editwarrantcharges"])
. = TRUE
var/new_charges = sanitize(input("Please input charges", "Charges", activewarrant.notes) as null|text)
var/new_charges = sanitize(input("Please input charges", "Charges", active_warrant.notes) as null|text)
if(CanInteract(user, default_state))
if (!new_charges)
return
activewarrant.notes = new_charges
active_warrant.notes = new_charges
if(href_list["editwarrantauth"])
. = TRUE
activewarrant.authorization = "[I.registered_name] - [I.assignment ? I.assignment : "(Unknown)"]"
active_warrant.authorization = "[I.registered_name] - [I.assignment ? I.assignment : "(Unknown)"]"
if(href_list["back"])
. = TRUE
activewarrant = null
active_warrant = null
@@ -1,13 +1,13 @@
/datum/computer_file/program/penal_mechs
filename = "penalmechs"
filename = "penalrobotics"
filedesc = "Remote Penal Monitoring"
program_icon_state = "security"
extended_desc = "This program allows monitoring and control of active penal miner mechs."
extended_desc = "This program allows monitoring and control of active penal robotics."
required_access_run = access_armory
required_access_download = access_armory
requires_ntnet = 1
available_on_ntnet = 1
network_destination = "penal mining mech monitoring system"
requires_ntnet = TRUE
available_on_ntnet = TRUE
network_destination = "penal robotics monitoring system"
size = 11
usage_flags = PROGRAM_ALL_REGULAR
color = LIGHT_COLOR_ORANGE
@@ -18,7 +18,7 @@
var/datum/vueui/ui = SSvueui.get_open_ui(user, src)
if (!ui)
ui = new /datum/vueui/modularcomputer(user, src, "mcomputer-security-penalcontroller", 500, 400, "Penal Mech Monitoring")
ui.auto_update_content = 1
ui.auto_update_content = TRUE
ui.open()
/datum/computer_file/program/penal_mechs/vueui_transfer(oldobj)
@@ -26,7 +26,7 @@
var/datum/vueui/ui = o
// Let's ensure our ui's autoupdate after transfer.
// TODO: revert this value on transfer out.
ui.auto_update_content = 1
ui.auto_update_content = TRUE
return TRUE
/datum/computer_file/program/penal_mechs/vueui_data_change(var/list/data, var/mob/user, var/datum/vueui/ui)
@@ -167,6 +167,6 @@
if(!current_camera)
return FALSE
var/viewflag = current_camera.check_eye(user)
if ( viewflag < 0 ) //camera doesn't work
if(viewflag < 0) //camera doesn't work
reset_current()
return viewflag
@@ -6,94 +6,94 @@
program_icon_state = "generic"
color = LIGHT_COLOR_GREEN
size = 8
requires_ntnet = 0
available_on_ntnet = 0
undeletable = 1
nanomodule_path = /datum/nano_module/program/computer_filemanager/
requires_ntnet = FALSE
available_on_ntnet = FALSE
undeletable = TRUE
nanomodule_path = /datum/nano_module/program/computer_filemanager
var/open_file
var/error
/datum/computer_file/program/filemanager/Topic(href, href_list)
if(..())
return 1
return TRUE
if(href_list["PRG_openfile"])
. = 1
. = TRUE
var/obj/item/computer_hardware/hard_drive/HDD = computer.hard_drive
var/datum/computer_file/F = HDD.find_file_by_name(href_list["PRG_openfile"])
if (!F)
if(!F)
return
if (F.can_access_file(usr))
if(F.can_access_file(usr))
open_file = href_list["PRG_openfile"]
else
return
if(href_list["PRG_newtextfile"])
. = 1
. = TRUE
var/newname = sanitize(input(usr, "Enter file name or leave blank to cancel:", "File rename"))
if(!newname)
return 1
return TRUE
var/obj/item/computer_hardware/hard_drive/HDD = computer.hard_drive
if(!HDD)
return 1
return TRUE
var/datum/computer_file/data/F = new/datum/computer_file/data()
F.filename = newname
F.filetype = "TXT"
HDD.store_file(F)
if(href_list["PRG_deletefile"])
. = 1
. = TRUE
var/obj/item/computer_hardware/hard_drive/HDD = computer.hard_drive
if(!HDD)
return 1
return TRUE
var/datum/computer_file/file = HDD.find_file_by_name(href_list["PRG_deletefile"])
if(!file || file.undeletable)
return 1
return TRUE
HDD.remove_file(file)
if(href_list["PRG_usbdeletefile"])
. = 1
. = TRUE
var/obj/item/computer_hardware/hard_drive/RHDD = computer.portable_drive
if(!RHDD)
return 1
return TRUE
var/datum/computer_file/file = RHDD.find_file_by_name(href_list["PRG_usbdeletefile"])
if(!file || file.undeletable)
return 1
return TRUE
RHDD.remove_file(file)
if(href_list["PRG_closefile"])
. = 1
. = TRUE
open_file = null
error = null
if(href_list["PRG_clone"])
. = 1
. = TRUE
var/obj/item/computer_hardware/hard_drive/HDD = computer.hard_drive
if(!HDD)
return 1
return TRUE
var/datum/computer_file/F = HDD.find_file_by_name(href_list["PRG_clone"])
if(!F || !istype(F))
return 1
return TRUE
var/datum/computer_file/C = F.clone(1)
HDD.store_file(C)
if(href_list["PRG_rename"])
. = 1
. = TRUE
var/obj/item/computer_hardware/hard_drive/HDD = computer.hard_drive
if(!HDD)
return 1
return TRUE
var/datum/computer_file/file = HDD.find_file_by_name(href_list["PRG_rename"])
if(!file || !istype(file))
return 1
return TRUE
var/newname = sanitize(input(usr, "Enter new file name:", "File rename", file.filename))
if(file && newname)
file.filename = newname
if(href_list["PRG_edit"])
. = 1
. = TRUE
if(!open_file)
return 1
return TRUE
var/obj/item/computer_hardware/hard_drive/HDD = computer.hard_drive
if(!HDD)
return 1
return TRUE
var/datum/computer_file/data/F = HDD.find_file_by_name(open_file)
if(!F || !istype(F))
return 1
return TRUE
if(F.do_not_edit && (alert("WARNING: This file is not compatible with editor. Editing it may result in permanently corrupted formatting or damaged data consistency. Edit anyway?", "Incompatible File", "No", "Yes") == "No"))
return 1
return TRUE
var/oldtext = html_decode(F.stored_data)
oldtext = replacetext(oldtext, "\[editorbr\]", "\n")
@@ -114,45 +114,45 @@
error = "I/O error: Unable to overwrite file. Hard drive is probably full. You may want to backup your changes before closing this window:<br><br>[html_decode(F.stored_data)]<br><br>"
HDD.store_file(backup)
if(href_list["PRG_printfile"])
. = 1
. = TRUE
if(!open_file)
return 1
return TRUE
var/obj/item/computer_hardware/hard_drive/HDD = computer.hard_drive
if(!HDD)
return 1
return TRUE
var/datum/computer_file/data/F = HDD.find_file_by_name(open_file)
if(!F || !istype(F))
return 1
return TRUE
if(!computer.nano_printer)
error = "Missing Hardware: Your computer does not have required hardware to complete this operation."
return 1
return TRUE
if(!computer.nano_printer.print_text(F.stored_data))
error = "Hardware error: Printer was unable to print the file. It may be out of paper."
return 1
return TRUE
if(href_list["PRG_copytousb"])
. = 1
. = TRUE
var/obj/item/computer_hardware/hard_drive/HDD = computer.hard_drive
var/obj/item/computer_hardware/hard_drive/portable/RHDD = computer.portable_drive
if(!HDD || !RHDD || computer.enrolled != 2)
return 1
return TRUE
var/datum/computer_file/F = HDD.find_file_by_name(href_list["PRG_copytousb"])
if(!F || !istype(F))
return 1
return TRUE
var/datum/computer_file/C = F.clone(0)
RHDD.store_file(C)
if(href_list["PRG_copyfromusb"])
. = 1
. = TRUE
var/obj/item/computer_hardware/hard_drive/HDD = computer.hard_drive
var/obj/item/computer_hardware/hard_drive/portable/RHDD = computer.portable_drive
if(!HDD || !RHDD || computer.enrolled != 2)
return 1
return TRUE
var/datum/computer_file/F = RHDD.find_file_by_name(href_list["PRG_copyfromusb"])
if(!F || !istype(F))
return 1
return TRUE
var/datum/computer_file/C = F.clone(0)
HDD.store_file(C)
if(href_list["PRG_encrypt"])
. = 1
. = TRUE
var/obj/item/computer_hardware/hard_drive/HDD = computer.hard_drive
if (!HDD)
return
@@ -163,7 +163,7 @@
return
F.password = sanitize(input(usr, "Enter an encryption key:", "Encrypt File"))
if(href_list["PRG_decrypt"])
. = 1
. = TRUE
var/obj/item/computer_hardware/hard_drive/HDD = computer.hard_drive
if (!HDD)
return
@@ -235,7 +235,8 @@
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "file_manager.tmpl", "NTOS File Manager", 575, 700, state = state)
ui.auto_update_layout = 1
ui.auto_update_layout = TRUE
ui.set_initial_data(data)
ui.open()
#undef MAX_TEXTFILE_LENGTH
#undef MAX_TEXTFILE_LENGTH
@@ -12,15 +12,15 @@
available_on_ntnet = FALSE
nanomodule_path = /datum/nano_module/program/computer_ntnetdownload
ui_header = "downloader_finished.gif"
var/datum/computer_file/program/downloaded_file = null
var/hacked_download = 0
var/datum/computer_file/program/downloaded_file
var/hacked_download = FALSE
var/download_completion = 0 //GQ of downloaded data.
var/download_netspeed = 0
var/download_last_update = 0 // For tracking download rates and completion.
var/downloaderror = ""
var/downstream_variance = 0.1
/datum/computer_file/program/ntnetdownload/proc/begin_file_download(var/filename, var/user = null)
/datum/computer_file/program/ntnetdownload/proc/begin_file_download(var/filename, var/user)
if(downloaded_file)
return FALSE
@@ -33,26 +33,26 @@
if(PRG.available_on_syndinet && !computer_emagged)
return FALSE
if(!computer || !computer.hard_drive || !computer.hard_drive.try_store_file(PRG))
if(!computer?.hard_drive?.try_store_file(PRG))
return FALSE
if(computer.enrolled == 1 && !computer_emagged)
if(computer.enrolled == TRUE && !computer_emagged)
return FALSE
ui_header = "downloader_running.gif"
if(PRG in ntnet_global.available_station_software)
generate_network_log("Began downloading file [PRG.filename].[PRG.filetype] from NTNet Software Repository.")
hacked_download = 0
hacked_download = FALSE
else if(PRG in ntnet_global.available_antag_software)
generate_network_log("Began downloading file **ENCRYPTED**.[PRG.filetype] from unspecified server.")
hacked_download = 1
hacked_download = TRUE
else
generate_network_log("Began downloading file [PRG.filename].[PRG.filetype] from unspecified server.")
hacked_download = 0
hacked_download = FALSE
downloaded_file = PRG.clone()
if (user)
if(user)
spawn()
ui_interact(user)
@@ -69,9 +69,12 @@
if(!downloaded_file)
return
generate_network_log("Completed download of file [hacked_download ? "**ENCRYPTED**" : downloaded_file.filename].[downloaded_file.filetype].")
if(!computer || !computer.hard_drive || !computer.hard_drive.store_file(downloaded_file))
if(!computer?.hard_drive?.store_file(downloaded_file))
// The download failed
downloaderror = "I/O ERROR - Unable to save file. Check whether you have enough free space on your hard drive and whether your hard drive is properly connected. If the issue persists contact your system administrator for assistance."
else
playsound(get_turf(computer), 'sound/machines/ping.ogg', 40, 0)
computer.output_message("\icon[computer] <b>[capitalize_first_letters(computer)]</b> pings, \"Software download completed successfully!\"", 1)
downloaded_file = null
download_completion = 0
download_last_update = 0
@@ -138,7 +141,7 @@
/datum/nano_module/program/computer_ntnetdownload
name = "Network Downloader"
var/obj/item/modular_computer/my_computer = null
var/obj/item/modular_computer/my_computer
/datum/nano_module/program/computer_ntnetdownload/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)
@@ -160,7 +163,7 @@
data["error"] = prog.downloaderror
else if(prog.downloaded_file) // Download running. Wait please..
if (ui)
ui.set_auto_update(1)
ui.set_auto_update(TRUE)
data["downloadname"] = prog.downloaded_file.filename
data["downloaddesc"] = prog.downloaded_file.filedesc
data["downloadsize"] = prog.downloaded_file.size
@@ -168,36 +171,36 @@
data["downloadcompletion"] = round(prog.download_completion, 0.01)
else // No download running, pick file.
if (ui)
ui.set_auto_update(0)//No need for auto updating on the software menu
ui.set_auto_update(FALSE)//No need for auto updating on the software menu
data["disk_size"] = my_computer.hard_drive.max_capacity
data["disk_used"] = my_computer.hard_drive.used_capacity
if(my_computer.enrolled == 2) //To lock installation of software on work computers until the IT Department is properly implemented - Then check for access on enrolled computers
data += get_programlist(user)
else
data["downloadable_programs"] = list()
data["locked"] = 1
data["locked"] = TRUE
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "ntnet_downloader.tmpl", "NTNet Download Program", 575, 700, state = state)
ui.auto_update_layout = 1
ui.auto_update_layout = TRUE
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(1)
ui.set_auto_update(TRUE)
/datum/nano_module/program/computer_ntnetdownload/proc/get_programlist(var/mob/user)
var/list/all_entries[0]
var/datum/computer_file/program/ntnetdownload/prog = program
var/list/data = list()
data["hackedavailable"] = 0
data["hackedavailable"] = FALSE
for(var/datum/computer_file/program/P in ntnet_global.available_station_software)
var/installed = 0
for(var/datum/computer_file/program/Q in program.holder.stored_files)
if (istype(P, Q.type))
installed = 1
var/installed = FALSE
for(var/datum/computer_file/program/Q in program.hard_drive.stored_files)
if(istype(P, Q.type))
installed = TRUE
break
if (!installed)
if(!installed)
// Only those programs our user can run will show in the list
if(!P.can_download(user) && P.requires_access_to_download)
continue
@@ -215,14 +218,14 @@
if(prog.computer_emagged) // If we are running on emagged computer we have access to some "bonus" software
var/list/hacked_programs[0]
for(var/datum/computer_file/program/P in ntnet_global.available_antag_software)
var/installed = 0
for(var/datum/computer_file/program/Q in program.holder.stored_files)
if (istype(P, Q.type))
installed = 1
var/installed = FALSE
for(var/datum/computer_file/program/Q in program.hard_drive.stored_files)
if(istype(P, Q.type))
installed = TRUE
break
if (!installed)
data["hackedavailable"] = 1
if(!installed)
data["hackedavailable"] = TRUE
hacked_programs.Add(list(list(
"filename" = P.filename,
"filedesc" = P.filedesc,
@@ -233,4 +236,4 @@
data["downloadable_programs"] = all_entries
return data
return data