h. Updates NTOS, and axes p2p filetransfer!
This commit is contained in:
@@ -25,12 +25,12 @@
|
||||
return ..()
|
||||
|
||||
/datum/ntnet_conversation/proc/add_message(message, username)
|
||||
message = "[STATION_TIME_TIMESTAMP("hh:mm:ss", world.time)] [username]: [message]"
|
||||
message = "[station_time_timestamp()] [username]: [message]"
|
||||
messages.Add(message)
|
||||
trim_message_list()
|
||||
|
||||
/datum/ntnet_conversation/proc/add_status_message(message)
|
||||
messages.Add("[STATION_TIME_TIMESTAMP("hh:mm:ss", world.time)] -!- [message]")
|
||||
messages.Add("[station_time_timestamp()] -!- [message]")
|
||||
trim_message_list()
|
||||
|
||||
/datum/ntnet_conversation/proc/trim_message_list()
|
||||
@@ -73,4 +73,4 @@
|
||||
add_status_message("[client.username] has changed channel title from [title] to [newtitle]")
|
||||
title = newtitle
|
||||
|
||||
#undef MAX_CHANNELS
|
||||
#undef MAX_CHANNELS
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
|
||||
/obj/proc/is_modular_computer()
|
||||
return
|
||||
|
||||
/obj/proc/get_modular_computer_part(part_type)
|
||||
return null
|
||||
|
||||
/obj/item/modular_computer/is_modular_computer()
|
||||
return TRUE
|
||||
|
||||
/obj/item/modular_computer/get_modular_computer_part(part_type)
|
||||
if(!part_type)
|
||||
stack_trace("get_modular_computer_part() called without a valid part_type")
|
||||
return null
|
||||
return all_components[part_type]
|
||||
|
||||
|
||||
/obj/machinery/modular_computer/is_modular_computer()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/modular_computer/get_modular_computer_part(part_type)
|
||||
if(!part_type)
|
||||
stack_trace("get_modular_computer_part() called without a valid part_type")
|
||||
return null
|
||||
return cpu?.all_components[part_type]
|
||||
|
||||
|
||||
/obj/proc/get_modular_computer_parts_examine(mob/user)
|
||||
. = list()
|
||||
if(!is_modular_computer())
|
||||
return
|
||||
|
||||
var/user_is_adjacent = Adjacent(user) //don't reveal full details unless they're close enough to see it on the screen anyway.
|
||||
|
||||
var/obj/item/computer_hardware/ai_slot/ai_slot = get_modular_computer_part(MC_AI)
|
||||
if(ai_slot)
|
||||
if(ai_slot.stored_card)
|
||||
if(user_is_adjacent)
|
||||
. += "It has a slot installed for an intelliCard which contains: [ai_slot.stored_card.name]"
|
||||
else
|
||||
. += "It has a slot installed for an intelliCard, which appears to be occupied."
|
||||
. += "<span class='info'>Alt-click to eject the intelliCard.</span>"
|
||||
else
|
||||
. += "It has a slot installed for an intelliCard."
|
||||
|
||||
var/obj/item/computer_hardware/card_slot/card_slot = get_modular_computer_part(MC_CARD)
|
||||
if(card_slot)
|
||||
if(card_slot.stored_card || card_slot.stored_card2)
|
||||
var/obj/item/card/id/first_ID = card_slot.stored_card
|
||||
var/obj/item/card/id/second_ID = card_slot.stored_card2
|
||||
var/multiple_cards = istype(first_ID) && istype(second_ID)
|
||||
if(user_is_adjacent)
|
||||
. += "It has two slots for identification cards installed[multiple_cards ? " which contain [first_ID] and [second_ID]" : ", one of which contains [first_ID ? first_ID : second_ID]"]."
|
||||
else
|
||||
. += "It has two slots for identification cards installed, [multiple_cards ? "both of which appear" : "and one of them appears"] to be occupied."
|
||||
. += "<span class='info'>Alt-click [src] to eject the identification card[multiple_cards ? "s":""].</span>"
|
||||
else
|
||||
. += "It has two slots installed for identification cards."
|
||||
|
||||
var/obj/item/computer_hardware/printer/printer_slot = get_modular_computer_part(MC_PRINT)
|
||||
if(printer_slot)
|
||||
. += "It has a printer installed."
|
||||
if(user_is_adjacent)
|
||||
. += "The printer's paper levels are at: [printer_slot.stored_paper]/[printer_slot.max_paper].</span>]"
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
var/enabled = 0 // Whether the computer is turned on.
|
||||
var/screen_on = 1 // Whether the computer is active/opened/it's screen is on.
|
||||
var/device_theme = "ntos" // Sets the theme for the main menu, hardware config, and file browser apps. Overridden by certain non-NT devices.
|
||||
var/datum/computer_file/program/active_program = null // A currently active program running on the computer.
|
||||
var/hardware_flag = 0 // A flag that describes this device type
|
||||
var/last_power_usage = 0
|
||||
@@ -98,7 +99,7 @@
|
||||
if(issilicon(usr))
|
||||
return
|
||||
var/obj/item/computer_hardware/card_slot/card_slot = all_components[MC_CARD]
|
||||
if(usr.canUseTopic(src))
|
||||
if(usr.canUseTopic(src, BE_CLOSE))
|
||||
card_slot.try_eject(null, usr)
|
||||
|
||||
// Eject ID card from computer, if it has ID slot with card inside.
|
||||
@@ -109,7 +110,7 @@
|
||||
if(issilicon(usr))
|
||||
return
|
||||
var/obj/item/computer_hardware/ai_slot/ai_slot = all_components[MC_AI]
|
||||
if(usr.canUseTopic(src))
|
||||
if(usr.canUseTopic(src, BE_CLOSE))
|
||||
ai_slot.try_eject(null, usr,1)
|
||||
|
||||
|
||||
@@ -121,17 +122,17 @@
|
||||
if(issilicon(usr))
|
||||
return
|
||||
|
||||
if(usr.canUseTopic(src))
|
||||
if(usr.canUseTopic(src, BE_CLOSE))
|
||||
var/obj/item/computer_hardware/hard_drive/portable/portable_drive = all_components[MC_SDD]
|
||||
if(uninstall_component(portable_drive, usr))
|
||||
portable_drive.verb_pickup()
|
||||
|
||||
/obj/item/modular_computer/AltClick(mob/user)
|
||||
. = ..()
|
||||
..()
|
||||
if(issilicon(user))
|
||||
return
|
||||
|
||||
if(user.canUseTopic(src))
|
||||
if(user.canUseTopic(src, BE_CLOSE))
|
||||
var/obj/item/computer_hardware/card_slot/card_slot = all_components[MC_CARD]
|
||||
var/obj/item/computer_hardware/ai_slot/ai_slot = all_components[MC_AI]
|
||||
var/obj/item/computer_hardware/hard_drive/portable/portable_drive = all_components[MC_SDD]
|
||||
@@ -143,7 +144,7 @@
|
||||
return
|
||||
if(ai_slot)
|
||||
ai_slot.try_eject(null, user)
|
||||
return TRUE
|
||||
|
||||
|
||||
// Gets IDs/access levels from card slot. Would be useful when/if PDAs would become modular PCs.
|
||||
/obj/item/modular_computer/GetAccess()
|
||||
@@ -175,7 +176,7 @@
|
||||
|
||||
/obj/item/modular_computer/MouseDrop(obj/over_object, src_location, over_location)
|
||||
var/mob/M = usr
|
||||
if((!istype(over_object, /obj/screen)) && usr.canUseTopic(src))
|
||||
if((!istype(over_object, /obj/screen)) && usr.canUseTopic(src, BE_CLOSE))
|
||||
return attack_self(M)
|
||||
return ..()
|
||||
|
||||
@@ -195,12 +196,22 @@
|
||||
|
||||
/obj/item/modular_computer/emag_act(mob/user)
|
||||
. = ..()
|
||||
if(obj_flags & EMAGGED)
|
||||
to_chat(user, "<span class='warning'>\The [src] was already emagged.</span>")
|
||||
return
|
||||
obj_flags |= EMAGGED
|
||||
to_chat(user, "<span class='notice'>You emag \the [src]. It's screen briefly shows a \"OVERRIDE ACCEPTED: New software downloads available.\" message.</span>")
|
||||
return TRUE
|
||||
if(!enabled)
|
||||
to_chat(user, "<span class='warning'>You'd need to turn the [src] on first.</span>")
|
||||
return FALSE
|
||||
obj_flags |= EMAGGED //Mostly for consistancy purposes; the programs will do their own emag handling
|
||||
var/newemag = FALSE
|
||||
var/obj/item/computer_hardware/hard_drive/drive = all_components[MC_HDD]
|
||||
for(var/datum/computer_file/program/app in drive.stored_files)
|
||||
if(!istype(app))
|
||||
continue
|
||||
if(app.run_emag())
|
||||
newemag = TRUE
|
||||
if(newemag)
|
||||
to_chat(user, "<span class='notice'>You swipe \the [src]. A console window momentarily fills the screen, with white text rapidly scrolling past.</span>")
|
||||
return TRUE
|
||||
to_chat(user, "<span class='notice'>You swipe \the [src]. A console window fills the screen, but it quickly closes itself after only a few lines are written to it.</span>")
|
||||
return FALSE
|
||||
|
||||
/obj/item/modular_computer/examine(mob/user)
|
||||
. = ..()
|
||||
@@ -209,13 +220,14 @@
|
||||
else if(obj_integrity < max_integrity)
|
||||
. += "<span class='warning'>It is damaged.</span>"
|
||||
|
||||
. += get_modular_computer_parts_examine(user)
|
||||
|
||||
/obj/item/modular_computer/update_icon_state()
|
||||
if(!enabled)
|
||||
icon_state = icon_state_unpowered
|
||||
else
|
||||
icon_state = icon_state_powered
|
||||
|
||||
|
||||
/obj/item/modular_computer/update_overlays()
|
||||
. = ..()
|
||||
if(!display_overlays)
|
||||
@@ -306,6 +318,8 @@
|
||||
/obj/item/modular_computer/proc/get_header_data()
|
||||
var/list/data = list()
|
||||
|
||||
data["PC_device_theme"] = device_theme
|
||||
|
||||
var/obj/item/computer_hardware/battery/battery_module = all_components[MC_CELL]
|
||||
var/obj/item/computer_hardware/recharger/recharger = all_components[MC_CHARGE]
|
||||
|
||||
@@ -407,17 +421,17 @@
|
||||
if(install_component(W, user))
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/wrench))
|
||||
if(W.tool_behaviour == TOOL_WRENCH)
|
||||
if(all_components.len)
|
||||
to_chat(user, "<span class='warning'>Remove all components from \the [src] before disassembling it.</span>")
|
||||
return
|
||||
new /obj/item/stack/sheet/metal( get_turf(src.loc), steel_sheet_cost )
|
||||
physical.visible_message("\The [src] has been disassembled by [user].")
|
||||
physical.visible_message("<span class='notice'>\The [src] is disassembled by [user].</span>")
|
||||
relay_qdel()
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weldingtool))
|
||||
if(W.tool_behaviour == TOOL_WELDER)
|
||||
if(obj_integrity == max_integrity)
|
||||
to_chat(user, "<span class='warning'>\The [src] does not require repairs.</span>")
|
||||
return
|
||||
@@ -431,7 +445,7 @@
|
||||
to_chat(user, "<span class='notice'>You repair \the [src].</span>")
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/screwdriver))
|
||||
if(W.tool_behaviour == TOOL_SCREWDRIVER)
|
||||
if(!all_components.len)
|
||||
to_chat(user, "<span class='warning'>This device doesn't have any components installed.</span>")
|
||||
return
|
||||
@@ -440,7 +454,7 @@
|
||||
var/obj/item/computer_hardware/H = all_components[h]
|
||||
component_names.Add(H.name)
|
||||
|
||||
var/choice = input(user, "Which component do you want to uninstall?", "Computer maintenance", null) as null|anything in component_names
|
||||
var/choice = input(user, "Which component do you want to uninstall?", "Computer maintenance", null) as null|anything in sortList(component_names)
|
||||
|
||||
if(!choice)
|
||||
return
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
|
||||
/obj/item/modular_computer/proc/break_apart()
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
physical.visible_message("\The [src] breaks apart!")
|
||||
physical.visible_message("<span class='notice'>\The [src] breaks apart!</span>")
|
||||
var/turf/newloc = get_turf(src)
|
||||
new /obj/item/stack/sheet/metal(newloc, round(steel_sheet_cost/2))
|
||||
for(var/C in all_components)
|
||||
var/obj/item/computer_hardware/H = all_components[C]
|
||||
if(QDELETED(H))
|
||||
return
|
||||
continue
|
||||
uninstall_component(H)
|
||||
H.forceMove(newloc)
|
||||
if(prob(25))
|
||||
|
||||
@@ -28,8 +28,7 @@
|
||||
|
||||
/obj/item/modular_computer/get_cell()
|
||||
var/obj/item/computer_hardware/battery/battery_module = all_components[MC_CELL]
|
||||
if(battery_module && battery_module.battery)
|
||||
return battery_module.battery
|
||||
return battery_module?.get_cell()
|
||||
|
||||
// Used in following function to reduce copypaste
|
||||
/obj/item/modular_computer/proc/power_failure()
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
icon_state_powered = "laptop"
|
||||
icon_state_unpowered = "laptop-off"
|
||||
icon_state_menu = "menu"
|
||||
display_overlays = FALSE
|
||||
|
||||
hardware_flag = PROGRAM_LAPTOP
|
||||
max_hardware_size = 2
|
||||
@@ -18,8 +19,8 @@
|
||||
screen_on = 0 // Starts closed
|
||||
var/start_open = TRUE // unless this var is set to 1
|
||||
var/icon_state_closed = "laptop-closed"
|
||||
display_overlays = FALSE
|
||||
var/w_class_open = WEIGHT_CLASS_BULKY
|
||||
var/slowdown_open = TRUE
|
||||
|
||||
/obj/item/modular_computer/laptop/examine(mob/user)
|
||||
. = ..()
|
||||
@@ -38,6 +39,13 @@
|
||||
else
|
||||
. = ..()
|
||||
|
||||
/obj/item/modular_computer/laptop/update_overlays()
|
||||
if(screen_on)
|
||||
return ..()
|
||||
else
|
||||
cut_overlays()
|
||||
icon_state = icon_state_closed
|
||||
|
||||
/obj/item/modular_computer/laptop/attack_self(mob/user)
|
||||
if(!screen_on)
|
||||
try_toggle_open(user)
|
||||
@@ -64,7 +72,7 @@
|
||||
return
|
||||
M.put_in_hand(src, H.held_index)
|
||||
|
||||
/obj/item/modular_computer/laptop/on_attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags)
|
||||
/obj/item/modular_computer/laptop/on_attack_hand(mob/user)
|
||||
if(screen_on && isturf(loc))
|
||||
return attack_self(user)
|
||||
|
||||
@@ -73,7 +81,7 @@
|
||||
return
|
||||
if(!isturf(loc) && !ismob(loc)) // No opening it in backpack.
|
||||
return
|
||||
if(!user.canUseTopic(src))
|
||||
if(!user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
|
||||
toggle_open(user)
|
||||
@@ -82,15 +90,17 @@
|
||||
/obj/item/modular_computer/laptop/AltClick(mob/user)
|
||||
if(screen_on) // Close it.
|
||||
try_toggle_open(user)
|
||||
return TRUE
|
||||
return ..()
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/modular_computer/laptop/proc/toggle_open(mob/living/user=null)
|
||||
if(screen_on)
|
||||
to_chat(user, "<span class='notice'>You close \the [src].</span>")
|
||||
slowdown = initial(slowdown)
|
||||
w_class = initial(w_class)
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You open \the [src].</span>")
|
||||
slowdown = slowdown_open
|
||||
w_class = w_class_open
|
||||
|
||||
screen_on = !screen_on
|
||||
|
||||
@@ -20,4 +20,3 @@
|
||||
/obj/item/modular_computer/laptop/preset/civilian/install_programs()
|
||||
var/obj/item/computer_hardware/hard_drive/hard_drive = all_components[MC_HDD]
|
||||
hard_drive.store_file(new/datum/computer_file/program/chatclient())
|
||||
hard_drive.store_file(new/datum/computer_file/program/nttransfer())
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// Held by /obj/machinery/modular_computer to reduce amount of copy-pasted code.
|
||||
//TODO: REFACTOR THIS SPAGHETTI CODE, MAKE IT A COMPUTER_HARDWARE COMPONENT OR REMOVE IT
|
||||
/obj/item/modular_computer/processor
|
||||
name = "processing unit"
|
||||
desc = "You shouldn't see this. If you do, report it."
|
||||
@@ -11,19 +12,22 @@
|
||||
var/obj/machinery/modular_computer/machinery_computer = null
|
||||
|
||||
/obj/item/modular_computer/processor/Destroy()
|
||||
. = ..()
|
||||
if(machinery_computer && (machinery_computer.cpu == src))
|
||||
machinery_computer.cpu = null
|
||||
machinery_computer.UnregisterSignal(src, COMSIG_ATOM_UPDATED_ICON)
|
||||
machinery_computer = null
|
||||
|
||||
/obj/item/modular_computer/processor/Initialize(mapload)
|
||||
. = ..()
|
||||
if(!loc || !istype(loc, /obj/machinery/modular_computer))
|
||||
|
||||
/obj/item/modular_computer/processor/New(comp) //intentional new probably
|
||||
..()
|
||||
STOP_PROCESSING(SSobj, src) // Processed by its machine
|
||||
|
||||
if(!comp || !istype(comp, /obj/machinery/modular_computer))
|
||||
CRASH("Inapropriate type passed to obj/item/modular_computer/processor/New()! Aborting.")
|
||||
// Obtain reference to machinery computer
|
||||
all_components = list()
|
||||
idle_threads = list()
|
||||
machinery_computer = loc
|
||||
machinery_computer = comp
|
||||
machinery_computer.cpu = src
|
||||
hardware_flag = machinery_computer.hardware_flag
|
||||
max_hardware_size = machinery_computer.max_hardware_size
|
||||
@@ -39,7 +43,7 @@
|
||||
qdel(machinery_computer)
|
||||
|
||||
// This thing is not meant to be used on it's own, get topic data from our machinery owner.
|
||||
//obj/item/modular_computer/processor/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
|
||||
//obj/item/modular_computer/processor/canUseTopic(atom/movable/M, be_close=FALSE, no_dexterity=FALSE, no_tk=FALSE)
|
||||
// if(!machinery_computer)
|
||||
// return 0
|
||||
|
||||
@@ -69,3 +73,6 @@
|
||||
machinery_computer.verbs -= /obj/machinery/modular_computer/proc/eject_disk
|
||||
if(MC_AI)
|
||||
machinery_computer.verbs -= /obj/machinery/modular_computer/proc/eject_card
|
||||
|
||||
/obj/item/modular_computer/processor/attack_ghost(mob/user)
|
||||
ui_interact(user)
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
icon_state_unpowered = "tablet"
|
||||
icon_state_powered = "tablet"
|
||||
icon_state_menu = "menu"
|
||||
//worn_icon_state = "tablet"
|
||||
hardware_flag = PROGRAM_TABLET
|
||||
max_hardware_size = 1
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
@@ -32,3 +33,17 @@
|
||||
slot_flags = ITEM_SLOT_ID | ITEM_SLOT_BELT
|
||||
comp_light_luminosity = 6.3
|
||||
has_variants = FALSE
|
||||
|
||||
/// Given to Nuke Ops members.
|
||||
/obj/item/modular_computer/tablet/nukeops
|
||||
icon_state = "tablet-syndicate"
|
||||
comp_light_luminosity = 6.3
|
||||
has_variants = FALSE
|
||||
device_theme = "syndicate"
|
||||
|
||||
/obj/item/modular_computer/tablet/nukeops/emag_act(mob/user)
|
||||
if(!enabled)
|
||||
to_chat(user, "<span class='warning'>You'd need to turn the [src] on first.</span>")
|
||||
return FALSE
|
||||
to_chat(user, "<span class='notice'>You swipe \the [src]. It's screen briefly shows a message reading \"MEMORY CODE INJECTION DETECTED AND SUCCESSFULLY QUARANTINED\".</span>")
|
||||
return FALSE
|
||||
|
||||
@@ -22,23 +22,38 @@
|
||||
|
||||
/obj/item/modular_computer/tablet/preset/cargo/Initialize()
|
||||
. = ..()
|
||||
var/obj/item/computer_hardware/hard_drive/small/hard_drive = new
|
||||
install_component(new /obj/item/computer_hardware/processor_unit/small)
|
||||
install_component(new /obj/item/computer_hardware/battery(src, /obj/item/stock_parts/cell/computer))
|
||||
install_component(new /obj/item/computer_hardware/hard_drive/small)
|
||||
install_component(hard_drive)
|
||||
install_component(new /obj/item/computer_hardware/network_card)
|
||||
install_component(new /obj/item/computer_hardware/printer/mini)
|
||||
hard_drive.store_file(new /datum/computer_file/program/bounty)
|
||||
//hard_drive.store_file(new /datum/computer_file/program/shipping)
|
||||
|
||||
/obj/item/modular_computer/tablet/syndicate_contract_uplink/preset/uplink/Initialize() // Given by the syndicate as part of the contract uplink bundle - loads in the Contractor Uplink.
|
||||
/// Given by the syndicate as part of the contract uplink bundle - loads in the Contractor Uplink.
|
||||
/obj/item/modular_computer/tablet/syndicate_contract_uplink/preset/uplink/Initialize()
|
||||
. = ..()
|
||||
var/obj/item/computer_hardware/hard_drive/small/syndicate/hard_drive = new
|
||||
var/datum/computer_file/program/contract_uplink/uplink = new
|
||||
|
||||
active_program = uplink
|
||||
uplink.program_state = PROGRAM_STATE_ACTIVE
|
||||
uplink.computer = src
|
||||
|
||||
hard_drive.store_file(uplink)
|
||||
|
||||
install_component(new /obj/item/computer_hardware/processor_unit/small)
|
||||
install_component(new /obj/item/computer_hardware/battery(src, /obj/item/stock_parts/cell/computer))
|
||||
install_component(hard_drive)
|
||||
install_component(new /obj/item/computer_hardware/network_card)
|
||||
install_component(new /obj/item/computer_hardware/card_slot)
|
||||
install_component(new /obj/item/computer_hardware/printer/mini)
|
||||
install_component(new /obj/item/computer_hardware/printer/mini)
|
||||
|
||||
/// Given to Nuke Ops members.
|
||||
/obj/item/modular_computer/tablet/nukeops/Initialize()
|
||||
. = ..()
|
||||
install_component(new /obj/item/computer_hardware/processor_unit/small)
|
||||
install_component(new /obj/item/computer_hardware/battery(src, /obj/item/stock_parts/cell/computer))
|
||||
install_component(new /obj/item/computer_hardware/hard_drive/small/nukeops)
|
||||
install_component(new /obj/item/computer_hardware/network_card)
|
||||
|
||||
@@ -46,16 +46,12 @@
|
||||
desc = "A stationary computer. This one comes preloaded with research programs."
|
||||
_has_ai = TRUE
|
||||
|
||||
/obj/machinery/modular_computer/console/preset/research/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Alt-click to eject the intelliCard.</span>"
|
||||
|
||||
/obj/machinery/modular_computer/console/preset/research/install_programs()
|
||||
var/obj/item/computer_hardware/hard_drive/hard_drive = cpu.all_components[MC_HDD]
|
||||
hard_drive.store_file(new/datum/computer_file/program/ntnetmonitor())
|
||||
hard_drive.store_file(new/datum/computer_file/program/nttransfer())
|
||||
hard_drive.store_file(new/datum/computer_file/program/chatclient())
|
||||
hard_drive.store_file(new/datum/computer_file/program/aidiag())
|
||||
hard_drive.store_file(new/datum/computer_file/program/robocontrol())
|
||||
|
||||
|
||||
// ===== COMMAND CONSOLE =====
|
||||
@@ -66,15 +62,27 @@
|
||||
_has_id_slot = TRUE
|
||||
_has_printer = TRUE
|
||||
|
||||
/obj/machinery/modular_computer/console/preset/command/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Alt-click [src] to eject the identification card.</span>"
|
||||
|
||||
/obj/machinery/modular_computer/console/preset/command/install_programs()
|
||||
var/obj/item/computer_hardware/hard_drive/hard_drive = cpu.all_components[MC_HDD]
|
||||
hard_drive.store_file(new/datum/computer_file/program/chatclient())
|
||||
hard_drive.store_file(new/datum/computer_file/program/card_mod())
|
||||
|
||||
|
||||
// ===== IDENTIFICATION CONSOLE =====
|
||||
/obj/machinery/modular_computer/console/preset/id
|
||||
console_department = "Identification"
|
||||
name = "identification console"
|
||||
desc = "A stationary computer. This one comes preloaded with identification modification programs."
|
||||
_has_id_slot = TRUE
|
||||
_has_printer = TRUE
|
||||
|
||||
/obj/machinery/modular_computer/console/preset/id/install_programs()
|
||||
var/obj/item/computer_hardware/hard_drive/hard_drive = cpu.all_components[MC_HDD]
|
||||
hard_drive.store_file(new/datum/computer_file/program/chatclient())
|
||||
hard_drive.store_file(new/datum/computer_file/program/card_mod())
|
||||
hard_drive.store_file(new/datum/computer_file/program/job_management())
|
||||
hard_drive.store_file(new/datum/computer_file/program/crew_manifest())
|
||||
|
||||
// ===== CIVILIAN CONSOLE =====
|
||||
/obj/machinery/modular_computer/console/preset/civilian
|
||||
console_department = "Civilian"
|
||||
@@ -84,5 +92,4 @@
|
||||
/obj/machinery/modular_computer/console/preset/civilian/install_programs()
|
||||
var/obj/item/computer_hardware/hard_drive/hard_drive = cpu.all_components[MC_HDD]
|
||||
hard_drive.store_file(new/datum/computer_file/program/chatclient())
|
||||
hard_drive.store_file(new/datum/computer_file/program/nttransfer())
|
||||
hard_drive.store_file(new/datum/computer_file/program/arcade())
|
||||
|
||||
@@ -36,6 +36,10 @@
|
||||
QDEL_NULL(cpu)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/modular_computer/examine(mob/user)
|
||||
. = ..()
|
||||
. += get_modular_computer_parts_examine(user)
|
||||
|
||||
/obj/machinery/modular_computer/attack_ghost(mob/dead/observer/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
@@ -45,31 +49,31 @@
|
||||
|
||||
/obj/machinery/modular_computer/emag_act(mob/user)
|
||||
. = ..()
|
||||
if(cpu)
|
||||
. |= cpu.emag_act(user)
|
||||
if(!cpu)
|
||||
to_chat(user, "<span class='warning'>You'd need to turn the [src] on first.</span>")
|
||||
return FALSE
|
||||
return (cpu.emag_act(user))
|
||||
|
||||
/obj/machinery/modular_computer/update_icon_state()
|
||||
if(cpu?.enabled)
|
||||
icon_state = icon_state_powered
|
||||
else if(stat & NOPOWER || !(cpu?.use_power()))
|
||||
icon_state = icon_state_unpowered
|
||||
/obj/machinery/modular_computer/update_icon()
|
||||
cut_overlays()
|
||||
icon_state = icon_state_powered
|
||||
|
||||
/obj/machinery/modular_computer/update_overlays()
|
||||
. = ..()
|
||||
if(!cpu || !cpu.enabled)
|
||||
if (!(stat & NOPOWER) && (cpu && cpu.use_power()))
|
||||
. += screen_icon_screensaver
|
||||
add_overlay(screen_icon_screensaver)
|
||||
else
|
||||
icon_state = icon_state_unpowered
|
||||
set_light(0)
|
||||
else
|
||||
set_light(light_strength)
|
||||
if(cpu.active_program)
|
||||
. += cpu.active_program.program_icon_state ? cpu.active_program.program_icon_state : screen_icon_state_menu
|
||||
add_overlay(cpu.active_program.program_icon_state ? cpu.active_program.program_icon_state : screen_icon_state_menu)
|
||||
else
|
||||
. += screen_icon_state_menu
|
||||
add_overlay(screen_icon_state_menu)
|
||||
|
||||
if(cpu && cpu.obj_integrity <= cpu.integrity_failure * cpu.max_integrity)
|
||||
. += "bsod"
|
||||
. += "broken"
|
||||
add_overlay("bsod")
|
||||
add_overlay("broken")
|
||||
|
||||
// Eject ID card from computer, if it has ID slot with card inside.
|
||||
/obj/machinery/modular_computer/proc/eject_id()
|
||||
@@ -96,10 +100,10 @@
|
||||
cpu.eject_card()
|
||||
|
||||
/obj/machinery/modular_computer/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(cpu)
|
||||
return cpu.AltClick(user)
|
||||
cpu.AltClick(user)
|
||||
|
||||
//ATTACK HAND IGNORING PARENT RETURN VALUE
|
||||
// On-click handling. Turns on the computer if it's off and opens the GUI.
|
||||
/obj/machinery/modular_computer/interact(mob/user)
|
||||
if(cpu)
|
||||
@@ -130,8 +134,7 @@
|
||||
stat &= ~NOPOWER
|
||||
update_icon()
|
||||
return
|
||||
..()
|
||||
update_icon()
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/modular_computer/attackby(var/obj/item/W as obj, mob/user)
|
||||
if(cpu && !(flags_1 & NODECONSTRUCT_1))
|
||||
@@ -144,6 +147,13 @@
|
||||
/obj/machinery/modular_computer/ex_act(severity)
|
||||
if(cpu)
|
||||
cpu.ex_act(severity)
|
||||
// switch(severity)
|
||||
// if(EXPLODE_DEVASTATE)
|
||||
// SSexplosions.highobj += cpu
|
||||
// if(EXPLODE_HEAVY)
|
||||
// SSexplosions.medobj += cpu
|
||||
// if(EXPLODE_LIGHT)
|
||||
// SSexplosions.lowobj += cpu
|
||||
..()
|
||||
|
||||
// EMPs are similar to explosions, but don't cause physical damage to the casing. Instead they screw up the components
|
||||
|
||||
@@ -52,4 +52,4 @@
|
||||
network_card.identification_string = "Unknown Console"
|
||||
if(cpu)
|
||||
cpu.screen_on = 1
|
||||
update_icon()
|
||||
update_icon()
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# Modular computer programs
|
||||
|
||||
How module computer programs work
|
||||
|
||||
Ok. so a quick rundown on how to make a program. This is kind of a shitty documentation, but oh well I was asked to.
|
||||
|
||||
## Base setup
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
var/filetype = "XXX" // File full names are [filename].[filetype] so like NewFile.XXX in this case
|
||||
var/size = 1 // File size in GQ. Integers only!
|
||||
var/obj/item/computer_hardware/hard_drive/holder // Holder that contains this file.
|
||||
var/unsendable = 0 // Whether the file may be sent to someone via NTNet transfer or other means.
|
||||
var/undeletable = 0 // Whether the file may be deleted. Setting to 1 prevents deletion/renaming/etc.
|
||||
var/unsendable = FALSE // Whether the file may be sent to someone via NTNet transfer or other means.
|
||||
var/undeletable = FALSE // Whether the file may be deleted. Setting to TRUE prevents deletion/renaming/etc.
|
||||
var/uid // UID of this file
|
||||
var/static/file_uid = 0
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
return ..()
|
||||
|
||||
// Returns independent copy of this file.
|
||||
/datum/computer_file/proc/clone(rename = 0)
|
||||
/datum/computer_file/proc/clone(rename = FALSE)
|
||||
var/datum/computer_file/temp = new type
|
||||
temp.unsendable = unsendable
|
||||
temp.undeletable = undeletable
|
||||
@@ -34,4 +34,4 @@
|
||||
else
|
||||
temp.filename = filename
|
||||
temp.filetype = filetype
|
||||
return temp
|
||||
return temp
|
||||
|
||||
@@ -70,17 +70,17 @@
|
||||
if(!(hardware_flag & usage_flags))
|
||||
if(loud && computer && user)
|
||||
to_chat(user, "<span class='danger'>\The [computer] flashes a \"Hardware Error - Incompatible software\" warning.</span>")
|
||||
return FALSE
|
||||
return TRUE
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/datum/computer_file/program/proc/get_signal(specific_action = 0)
|
||||
if(computer)
|
||||
return computer.get_ntnet_status(specific_action)
|
||||
return FALSE
|
||||
return 0
|
||||
|
||||
// Called by Process() on device that runs us, once every tick.
|
||||
/datum/computer_file/program/proc/process_tick()
|
||||
return TRUE
|
||||
return 1
|
||||
|
||||
// Check if the user can run program. Only humans can operate computer. Automatically called in run_program()
|
||||
// User has to wear their ID for ID Scan to work.
|
||||
@@ -126,7 +126,7 @@
|
||||
return TRUE
|
||||
if(loud)
|
||||
to_chat(user, "<span class='danger'>\The [computer] flashes an \"Access Denied\" warning.</span>")
|
||||
return FALSE
|
||||
return 0
|
||||
|
||||
// This attempts to retrieve header data for UIs. If implementing completely new device of different type than existing ones
|
||||
// always include the device here in this proc. This proc basically relays the request to whatever is running the program.
|
||||
@@ -142,8 +142,8 @@
|
||||
if(requires_ntnet && network_destination)
|
||||
generate_network_log("Connection opened to [network_destination].")
|
||||
program_state = PROGRAM_STATE_ACTIVE
|
||||
return TRUE
|
||||
return FALSE
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -164,7 +164,7 @@
|
||||
program_state = PROGRAM_STATE_KILLED
|
||||
if(network_destination)
|
||||
generate_network_log("Connection to [network_destination] closed.")
|
||||
return TRUE
|
||||
return 1
|
||||
|
||||
/datum/computer_file/program/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
@@ -180,17 +180,17 @@
|
||||
// ALWAYS INCLUDE PARENT CALL ..() OR DIE IN FIRE.
|
||||
/datum/computer_file/program/ui_act(action,list/params,datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
return 1
|
||||
if(computer)
|
||||
switch(action)
|
||||
if("PC_exit")
|
||||
computer.kill_program()
|
||||
ui.close()
|
||||
return TRUE
|
||||
return 1
|
||||
if("PC_shutdown")
|
||||
computer.shutdown_computer()
|
||||
ui.close()
|
||||
return TRUE
|
||||
return 1
|
||||
if("PC_minimize")
|
||||
var/mob/user = usr
|
||||
if(!computer.active_program || !computer.all_components[MC_CPU])
|
||||
|
||||
@@ -13,6 +13,6 @@
|
||||
/datum/computer_file/program/proc/event_networkfailure(background)
|
||||
kill_program(forced = TRUE)
|
||||
if(background)
|
||||
computer.visible_message("<span class='danger'>\The [computer]'s screen displays an \"Process [filename].[filetype] (PID [rand(100,999)]) terminated - Network Error\" error</span>")
|
||||
computer.visible_message("<span class='danger'>\The [computer]'s screen displays a \"Process [filename].[filetype] (PID [rand(100,999)]) terminated - Network Error\" error</span>")
|
||||
else
|
||||
computer.visible_message("<span class='danger'>\The [computer]'s screen briefly freezes and then shows \"NETWORK ERROR - NTNet connection lost. Please retry. If problem persists contact your system administrator.\" error.</span>")
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
transfer_access = ACCESS_HEADS
|
||||
available_on_ntnet = TRUE
|
||||
tgui_id = "NtosAiRestorer"
|
||||
ui_x = 370
|
||||
ui_y = 400
|
||||
/// Variable dictating if we are in the process of restoring the AI in the inserted intellicard
|
||||
var/restoring = FALSE
|
||||
|
||||
@@ -74,8 +72,8 @@
|
||||
restoring = FALSE
|
||||
return
|
||||
ai_slot.locked =TRUE
|
||||
A.adjustOxyLoss(-5, 0)
|
||||
A.adjustFireLoss(-5, 0)
|
||||
A.adjustOxyLoss(-5, 0)//, FALSE)
|
||||
A.adjustFireLoss(-5, 0)//, FALSE)
|
||||
A.adjustToxLoss(-5, 0)
|
||||
A.adjustBruteLoss(-5, 0)
|
||||
A.updatehealth()
|
||||
@@ -113,7 +111,7 @@
|
||||
data["restoring"] = restoring
|
||||
data["health"] = (AI.health + 100) / 2
|
||||
data["isDead"] = AI.stat == DEAD
|
||||
data["laws"] = AI.laws.get_law_list(include_zeroth = 1)
|
||||
data["laws"] = AI.laws.get_law_list(include_zeroth = TRUE, render_html = FALSE)
|
||||
|
||||
return data
|
||||
|
||||
|
||||
@@ -8,9 +8,6 @@
|
||||
network_destination = "alarm monitoring network"
|
||||
size = 5
|
||||
tgui_id = "NtosStationAlertConsole"
|
||||
ui_x = 315
|
||||
ui_y = 500
|
||||
|
||||
var/has_alert = 0
|
||||
var/alarms = list("Fire" = list(), "Atmosphere" = list(), "Power" = list())
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/datum/computer_file/program/contract_uplink
|
||||
filename = "contractor uplink"
|
||||
filedesc = "Syndicate Contract Uplink"
|
||||
filedesc = "Syndicate Contractor Uplink"
|
||||
program_icon_state = "assign"
|
||||
extended_desc = "A standard, Syndicate issued system for handling important contracts while on the field."
|
||||
size = 10
|
||||
@@ -9,8 +9,6 @@
|
||||
unsendable = 1
|
||||
undeletable = 1
|
||||
tgui_id = "SyndContractor"
|
||||
ui_x = 500
|
||||
ui_y = 600
|
||||
var/error = ""
|
||||
var/info_screen = TRUE
|
||||
var/assigned = FALSE
|
||||
@@ -22,14 +20,18 @@
|
||||
/datum/computer_file/program/contract_uplink/ui_act(action, params)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
var/mob/living/user = usr
|
||||
var/obj/item/computer_hardware/hard_drive/small/syndicate/hard_drive = computer.all_components[MC_HDD]
|
||||
|
||||
switch(action)
|
||||
if("PRG_contract-accept")
|
||||
var/contract_id = text2num(params["contract_id"])
|
||||
|
||||
// Set as the active contract
|
||||
hard_drive.traitor_data.contractor_hub.assigned_contracts[contract_id].status = CONTRACT_STATUS_ACTIVE
|
||||
hard_drive.traitor_data.contractor_hub.current_contract = hard_drive.traitor_data.contractor_hub.assigned_contracts[contract_id]
|
||||
|
||||
program_icon_state = "single_contract"
|
||||
return TRUE
|
||||
if("PRG_login")
|
||||
@@ -38,26 +40,30 @@
|
||||
// Bake their data right into the hard drive, or we don't allow non-antags gaining access to an unused
|
||||
// contract system.
|
||||
// We also create their contracts at this point.
|
||||
if(traitor_data)
|
||||
if (traitor_data)
|
||||
// Only play greet sound, and handle contractor hub when assigning for the first time.
|
||||
if(!traitor_data.contractor_hub)
|
||||
if (!traitor_data.contractor_hub)
|
||||
user.playsound_local(user, 'sound/effects/contractstartup.ogg', 100, FALSE)
|
||||
traitor_data.contractor_hub = new
|
||||
traitor_data.contractor_hub.create_hub_items()
|
||||
|
||||
// Stops any topic exploits such as logging in multiple times on a single system.
|
||||
if(!assigned)
|
||||
if (!assigned)
|
||||
traitor_data.contractor_hub.create_contracts(traitor_data.owner)
|
||||
|
||||
hard_drive.traitor_data = traitor_data
|
||||
|
||||
program_icon_state = "contracts"
|
||||
assigned = TRUE
|
||||
else
|
||||
error = "UNAUTHORIZED USER"
|
||||
return TRUE
|
||||
if("PRG_call_extraction")
|
||||
if(hard_drive.traitor_data.contractor_hub.current_contract.status != CONTRACT_STATUS_EXTRACTING)
|
||||
if(hard_drive.traitor_data.contractor_hub.current_contract.handle_extraction(user))
|
||||
if (hard_drive.traitor_data.contractor_hub.current_contract.status != CONTRACT_STATUS_EXTRACTING)
|
||||
if (hard_drive.traitor_data.contractor_hub.current_contract.handle_extraction(user))
|
||||
user.playsound_local(user, 'sound/effects/confirmdropoff.ogg', 100, TRUE)
|
||||
hard_drive.traitor_data.contractor_hub.current_contract.status = CONTRACT_STATUS_EXTRACTING
|
||||
|
||||
program_icon_state = "extracted"
|
||||
else
|
||||
user.playsound_local(user, 'sound/machines/uplinkerror.ogg', 50)
|
||||
@@ -65,15 +71,19 @@
|
||||
else
|
||||
user.playsound_local(user, 'sound/machines/uplinkerror.ogg', 50)
|
||||
error = "Already extracting... Place the target into the pod. If the pod was destroyed, this contract is no longer possible."
|
||||
|
||||
return TRUE
|
||||
if("PRG_contract_abort")
|
||||
var/contract_id = hard_drive.traitor_data.contractor_hub.current_contract.id
|
||||
|
||||
hard_drive.traitor_data.contractor_hub.current_contract = null
|
||||
hard_drive.traitor_data.contractor_hub.assigned_contracts[contract_id].status = CONTRACT_STATUS_ABORTED
|
||||
|
||||
program_icon_state = "contracts"
|
||||
|
||||
return TRUE
|
||||
if("PRG_redeem_TC")
|
||||
if(hard_drive.traitor_data.contractor_hub.contract_TC_to_redeem)
|
||||
if (hard_drive.traitor_data.contractor_hub.contract_TC_to_redeem)
|
||||
var/obj/item/stack/telecrystal/crystals = new /obj/item/stack/telecrystal(get_turf(user),
|
||||
hard_drive.traitor_data.contractor_hub.contract_TC_to_redeem)
|
||||
if(ishuman(user))
|
||||
@@ -82,13 +92,14 @@
|
||||
to_chat(H, "<span class='notice'>Your payment materializes into your hands!</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>Your payment materializes onto the floor.</span>")
|
||||
|
||||
hard_drive.traitor_data.contractor_hub.contract_TC_payed_out += hard_drive.traitor_data.contractor_hub.contract_TC_to_redeem
|
||||
hard_drive.traitor_data.contractor_hub.contract_TC_to_redeem = 0
|
||||
return TRUE
|
||||
else
|
||||
user.playsound_local(user, 'sound/machines/uplinkerror.ogg', 50)
|
||||
return TRUE
|
||||
if("PRG_clear_error")
|
||||
if ("PRG_clear_error")
|
||||
error = ""
|
||||
return TRUE
|
||||
if("PRG_set_first_load_finished")
|
||||
@@ -97,10 +108,11 @@
|
||||
if("PRG_toggle_info")
|
||||
info_screen = !info_screen
|
||||
return TRUE
|
||||
if("buy_hub")
|
||||
if(hard_drive.traitor_data.owner.current == user)
|
||||
if ("buy_hub")
|
||||
if (hard_drive.traitor_data.owner.current == user)
|
||||
var/item = params["item"]
|
||||
for(var/datum/contractor_item/hub_item in hard_drive.traitor_data.contractor_hub.hub_items)
|
||||
|
||||
for (var/datum/contractor_item/hub_item in hard_drive.traitor_data.contractor_hub.hub_items)
|
||||
if (hub_item.name == item)
|
||||
hub_item.handle_purchase(hard_drive.traitor_data.contractor_hub, user)
|
||||
else
|
||||
@@ -112,13 +124,15 @@
|
||||
var/screen_to_be = null
|
||||
|
||||
data["first_load"] = first_load
|
||||
if(hard_drive && hard_drive.traitor_data != null)
|
||||
|
||||
if (hard_drive && hard_drive.traitor_data != null)
|
||||
var/datum/antagonist/traitor/traitor_data = hard_drive.traitor_data
|
||||
data += get_header_data()
|
||||
if(traitor_data.contractor_hub.current_contract)
|
||||
|
||||
if (traitor_data.contractor_hub.current_contract)
|
||||
data["ongoing_contract"] = TRUE
|
||||
screen_to_be = "single_contract"
|
||||
if(traitor_data.contractor_hub.current_contract.status == CONTRACT_STATUS_EXTRACTING)
|
||||
if (traitor_data.contractor_hub.current_contract.status == CONTRACT_STATUS_EXTRACTING)
|
||||
data["extraction_enroute"] = TRUE
|
||||
screen_to_be = "extracted"
|
||||
else
|
||||
@@ -126,15 +140,19 @@
|
||||
else
|
||||
data["ongoing_contract"] = FALSE
|
||||
data["extraction_enroute"] = FALSE
|
||||
|
||||
data["logged_in"] = TRUE
|
||||
data["station_name"] = GLOB.station_name
|
||||
data["redeemable_tc"] = traitor_data.contractor_hub.contract_TC_to_redeem
|
||||
data["earned_tc"] = traitor_data.contractor_hub.contract_TC_payed_out
|
||||
data["contracts_completed"] = traitor_data.contractor_hub.contracts_completed
|
||||
data["contract_rep"] = traitor_data.contractor_hub.contract_rep
|
||||
|
||||
data["info_screen"] = info_screen
|
||||
|
||||
data["error"] = error
|
||||
for(var/datum/contractor_item/hub_item in traitor_data.contractor_hub.hub_items)
|
||||
|
||||
for (var/datum/contractor_item/hub_item in traitor_data.contractor_hub.hub_items)
|
||||
data["contractor_hub_items"] += list(list(
|
||||
"name" = hub_item.name,
|
||||
"desc" = hub_item.desc,
|
||||
@@ -142,7 +160,8 @@
|
||||
"limited" = hub_item.limited,
|
||||
"item_icon" = hub_item.item_icon
|
||||
))
|
||||
for(var/datum/syndicate_contract/contract in traitor_data.contractor_hub.assigned_contracts)
|
||||
|
||||
for (var/datum/syndicate_contract/contract in traitor_data.contractor_hub.assigned_contracts)
|
||||
data["contracts"] += list(list(
|
||||
"target" = contract.contract.target,
|
||||
"target_rank" = contract.target_rank,
|
||||
@@ -155,23 +174,28 @@
|
||||
))
|
||||
|
||||
var/direction
|
||||
if(traitor_data.contractor_hub.current_contract)
|
||||
if (traitor_data.contractor_hub.current_contract)
|
||||
var/turf/curr = get_turf(user)
|
||||
var/turf/dropoff_turf
|
||||
data["current_location"] = "[get_area_name(curr, TRUE)]"
|
||||
for(var/turf/content in traitor_data.contractor_hub.current_contract.contract.dropoff.contents)
|
||||
if(isturf(content))
|
||||
|
||||
for (var/turf/content in traitor_data.contractor_hub.current_contract.contract.dropoff.contents)
|
||||
if (isturf(content))
|
||||
dropoff_turf = content
|
||||
break
|
||||
|
||||
if(curr.z == dropoff_turf.z) //Direction calculations for same z-level only
|
||||
direction = uppertext(dir2text(get_dir(curr, dropoff_turf))) //Direction text (East, etc). Not as precise, but still helpful.
|
||||
if(get_area(user) == traitor_data.contractor_hub.current_contract.contract.dropoff)
|
||||
direction = "LOCATION CONFIRMED"
|
||||
else
|
||||
direction = "???"
|
||||
|
||||
data["dropoff_direction"] = direction
|
||||
|
||||
else
|
||||
data["logged_in"] = FALSE
|
||||
|
||||
program_icon_state = screen_to_be
|
||||
update_computer_icon()
|
||||
return data
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
available_on_ntnet = FALSE
|
||||
available_on_syndinet = TRUE
|
||||
tgui_id = "NtosNetDos"
|
||||
ui_x = 400
|
||||
ui_y = 250
|
||||
|
||||
var/obj/machinery/ntnet_relay/target = null
|
||||
var/dos_speed = 0
|
||||
|
||||
@@ -8,9 +8,6 @@
|
||||
available_on_ntnet = FALSE
|
||||
available_on_syndinet = TRUE
|
||||
tgui_id = "NtosRevelation"
|
||||
ui_x = 400
|
||||
ui_y = 250
|
||||
|
||||
var/armed = 0
|
||||
|
||||
/datum/computer_file/program/revelation/run_program(var/mob/living/user)
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
network_destination = "arcade network"
|
||||
size = 6
|
||||
tgui_id = "NtosArcade"
|
||||
ui_x = 450
|
||||
ui_y = 350
|
||||
|
||||
///Returns TRUE if the game is being played.
|
||||
var/game_active = TRUE
|
||||
@@ -27,6 +25,7 @@
|
||||
|
||||
/datum/computer_file/program/arcade/proc/game_check(mob/user)
|
||||
sleep(5)
|
||||
//user?.mind?.adjust_experience(/datum/skill/gaming, 1) No gaming(TM) Yet
|
||||
if(boss_hp <= 0)
|
||||
heads_up = "You have crushed [boss_name]! Rejoice!"
|
||||
playsound(computer.loc, 'sound/arcade/win.ogg', 50, TRUE, extrarange = -3, falloff = 10)
|
||||
@@ -35,6 +34,7 @@
|
||||
if(istype(computer))
|
||||
computer.update_icon()
|
||||
ticket_count += 1
|
||||
//user?.mind?.adjust_experience(/datum/skill/gaming, 50)
|
||||
sleep(10)
|
||||
else if(player_hp <= 0 || player_mp <= 0)
|
||||
heads_up = "You have been defeated... how will the station survive?"
|
||||
@@ -43,6 +43,7 @@
|
||||
program_icon_state = "arcade_off"
|
||||
if(istype(computer))
|
||||
computer.update_icon()
|
||||
//user?.mind?.adjust_experience(/datum/skill/gaming, 10)
|
||||
sleep(10)
|
||||
|
||||
/datum/computer_file/program/arcade/proc/enemy_check(mob/user)
|
||||
@@ -73,14 +74,13 @@
|
||||
pause_state = FALSE
|
||||
game_check()
|
||||
|
||||
/datum/computer_file/program/arcade/ui_interact(mob/user, ui_key, datum/tgui/ui, force_open, datum/tgui/master_ui, datum/ui_state/state)
|
||||
. = ..()
|
||||
var/datum/asset/assets = get_asset_datum(/datum/asset/simple/arcade)
|
||||
assets.send(user)
|
||||
/datum/computer_file/program/arcade/ui_assets(mob/user)
|
||||
return list(
|
||||
get_asset_datum(/datum/asset/simple/arcade),
|
||||
)
|
||||
|
||||
/datum/computer_file/program/arcade/ui_data(mob/user)
|
||||
var/list/data = get_header_data()
|
||||
|
||||
data["Hitpoints"] = boss_hp
|
||||
data["PlayerHitpoints"] = player_hp
|
||||
data["PlayerMP"] = player_mp
|
||||
@@ -98,11 +98,13 @@
|
||||
if(computer)
|
||||
printer = computer.all_components[MC_PRINT]
|
||||
|
||||
//var/gamerSkillLevel = usr.mind?.get_skill_level(/datum/skill/gaming)
|
||||
//var/gamerSkill = usr.mind?.get_skill_modifier(/datum/skill/gaming, SKILL_RANDS_MODIFIER)
|
||||
switch(action)
|
||||
if("Attack")
|
||||
var/attackamt = 0 //Spam prevention.
|
||||
if(pause_state == FALSE)
|
||||
attackamt = rand(2,6)
|
||||
attackamt = rand(2,6)// + rand(0, gamerSkill)
|
||||
pause_state = TRUE
|
||||
heads_up = "You attack for [attackamt] damage."
|
||||
playsound(computer.loc, 'sound/arcade/hit.ogg', 50, TRUE, extrarange = -3, falloff = 10)
|
||||
@@ -115,8 +117,10 @@
|
||||
var/healamt = 0 //More Spam Prevention.
|
||||
var/healcost = 0
|
||||
if(pause_state == FALSE)
|
||||
healamt = rand(6,8)
|
||||
healamt = rand(6,8)// + rand(0, gamerSkill)
|
||||
var/maxPointCost = 3
|
||||
//if(gamerSkillLevel >= SKILL_LEVEL_JOURNEYMAN)
|
||||
// maxPointCost = 2
|
||||
healcost = rand(1, maxPointCost)
|
||||
pause_state = TRUE
|
||||
heads_up = "You heal for [healamt] damage."
|
||||
@@ -130,7 +134,7 @@
|
||||
if("Recharge_Power")
|
||||
var/rechargeamt = 0 //As above.
|
||||
if(pause_state == FALSE)
|
||||
rechargeamt = rand(4, 7)
|
||||
rechargeamt = rand(4,7)// + rand(0, gamerSkill)
|
||||
pause_state = TRUE
|
||||
heads_up = "You regain [rechargeamt] magic power."
|
||||
playsound(computer.loc, 'sound/arcade/mana.ogg', 50, TRUE, extrarange = -3, falloff = 10)
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
network_destination = "atmos scan"
|
||||
size = 4
|
||||
tgui_id = "NtosAtmos"
|
||||
ui_x = 300
|
||||
ui_y = 350
|
||||
|
||||
/datum/computer_file/program/atmosscan/ui_data(mob/user)
|
||||
var/list/data = get_header_data()
|
||||
|
||||
@@ -9,21 +9,17 @@
|
||||
network_destination = "cyborg remote monitoring"
|
||||
size = 5
|
||||
tgui_id = "NtosCyborgRemoteMonitor"
|
||||
ui_x = 600
|
||||
ui_y = 800
|
||||
|
||||
/datum/computer_file/program/borg_monitor/ui_data(mob/user)
|
||||
var/list/data = get_header_data()
|
||||
|
||||
data["card"] = FALSE
|
||||
if(computer.GetID())
|
||||
if(checkID())
|
||||
data["card"] = TRUE
|
||||
|
||||
data["cyborgs"] = list()
|
||||
for(var/mob/living/silicon/robot/R in GLOB.silicon_mobs)
|
||||
if((get_turf(computer)).z != (get_turf(R)).z)
|
||||
continue
|
||||
if(R.scrambledcodes)
|
||||
if(!evaluate_borg(R))
|
||||
continue
|
||||
|
||||
var/list/upgrade
|
||||
@@ -36,7 +32,7 @@
|
||||
|
||||
var/list/cyborg_data = list(
|
||||
name = R.name,
|
||||
locked_down = R.locked_down,
|
||||
locked_down = R.lockcharge,
|
||||
status = R.stat,
|
||||
shell_discon = shell,
|
||||
charge = R.cell ? round(R.cell.percent()) : null,
|
||||
@@ -56,14 +52,53 @@
|
||||
var/mob/living/silicon/robot/R = locate(params["ref"]) in GLOB.silicon_mobs
|
||||
if(!istype(R))
|
||||
return
|
||||
var/obj/item/card/id/ID = computer.GetID()
|
||||
var/ID = checkID()
|
||||
if(!ID)
|
||||
return
|
||||
var/message = stripped_input(usr, message = "Enter message to be sent to remote cyborg.", title = "Send Message")
|
||||
if(!message)
|
||||
return
|
||||
to_chat(R, "<br><br><span class='notice'>Message from [ID.registered_name] -- \"[message]\"</span><br>")
|
||||
to_chat(R, "<br><br><span class='notice'>Message from [ID] -- \"[message]\"</span><br>")
|
||||
SEND_SOUND(R, 'sound/machines/twobeep_high.ogg')
|
||||
if(R.connected_ai)
|
||||
to_chat(R.connected_ai, "<br><br><span class='notice'>Message from [ID.registered_name] to [R] -- \"[message]\"</span><br>")
|
||||
to_chat(R.connected_ai, "<br><br><span class='notice'>Message from [ID] to [R] -- \"[message]\"</span><br>")
|
||||
SEND_SOUND(R.connected_ai, 'sound/machines/twobeep_high.ogg')
|
||||
usr.log_talk(message, LOG_PDA, tag="Cyborg Monitor Program: ID name \"[ID]\" to [R]")
|
||||
|
||||
///This proc is used to determin if a borg should be shown in the list (based on the borg's scrambledcodes var). Syndicate version overrides this to show only syndicate borgs.
|
||||
/datum/computer_file/program/borg_monitor/proc/evaluate_borg(mob/living/silicon/robot/R)
|
||||
if((get_turf(computer)).z != (get_turf(R)).z)
|
||||
return FALSE
|
||||
if(R.scrambledcodes)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
///Gets the ID's name, if one is inserted into the device. This is a seperate proc solely to be overridden by the syndicate version of the app.
|
||||
/datum/computer_file/program/borg_monitor/proc/checkID()
|
||||
var/obj/item/card/id/ID = computer.GetID()
|
||||
if(!ID)
|
||||
return FALSE
|
||||
return ID.registered_name
|
||||
|
||||
/datum/computer_file/program/borg_monitor/syndicate
|
||||
filename = "scyborgmonitor"
|
||||
filedesc = "Mission-Specific Cyborg Remote Monitoring"
|
||||
ui_header = "borg_mon.gif"
|
||||
program_icon_state = "generic"
|
||||
extended_desc = "This program allows for remote monitoring of mission-assigned cyborgs."
|
||||
requires_ntnet = FALSE
|
||||
available_on_ntnet = FALSE
|
||||
available_on_syndinet = TRUE
|
||||
transfer_access = null
|
||||
network_destination = "cyborg remote monitoring"
|
||||
tgui_id = "NtosCyborgRemoteMonitorSyndicate"
|
||||
|
||||
/datum/computer_file/program/borg_monitor/syndicate/evaluate_borg(mob/living/silicon/robot/R)
|
||||
if((get_turf(computer)).z != (get_turf(R)).z)
|
||||
return FALSE
|
||||
if(!R.scrambledcodes)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/computer_file/program/borg_monitor/syndicate/checkID()
|
||||
return "\[CLASSIFIED\]" //no ID is needed for the syndicate version's message function, and the borg will see "[CLASSIFIED]" as the message sender.
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
/datum/computer_file/program/bounty_board
|
||||
filename = "bountyboard"
|
||||
filedesc = "Bounty Board Request Network"
|
||||
program_icon_state = "bountyboard"
|
||||
extended_desc = "A multi-platform network for placing requests across the station, with payment across the network being possible.."
|
||||
requires_ntnet = TRUE
|
||||
network_destination = "bounty board interface"
|
||||
size = 10
|
||||
tgui_id = "NtosRequestKiosk"
|
||||
///Reference to the currently logged in user.
|
||||
var/datum/bank_account/current_user
|
||||
///The station request datum being affected by UI actions.
|
||||
var/datum/station_request/active_request
|
||||
///Value of the currently bounty input
|
||||
var/bounty_value = 1
|
||||
///Text of the currently written bounty
|
||||
var/bounty_text = ""
|
||||
///Has the app been added to the network yet?
|
||||
var/networked = FALSE
|
||||
|
||||
/datum/computer_file/program/bounty_board/ui_data(mob/user)
|
||||
var/list/data = get_header_data()
|
||||
var/list/formatted_requests = list()
|
||||
var/list/formatted_applicants = list()
|
||||
var/obj/item/computer_hardware/card_slot/card_slot = computer.all_components[MC_CARD]
|
||||
if(!networked)
|
||||
GLOB.allbountyboards += computer
|
||||
networked = TRUE
|
||||
if(card_slot && card_slot.stored_card && card_slot.stored_card.registered_account)
|
||||
current_user = card_slot.stored_card.registered_account
|
||||
for(var/i in GLOB.request_list)
|
||||
if(!i)
|
||||
continue
|
||||
var/datum/station_request/request = i
|
||||
formatted_requests += list(list("owner" = request.owner, "value" = request.value, "description" = request.description, "acc_number" = request.req_number))
|
||||
if(request.applicants)
|
||||
for(var/datum/bank_account/j in request.applicants)
|
||||
formatted_applicants += list(list("name" = j.account_holder, "request_id" = request.owner_account.account_id, "requestee_id" = j.account_id))
|
||||
if(current_user)
|
||||
data["accountName"] = current_user.account_holder
|
||||
data["requests"] = formatted_requests
|
||||
data["applicants"] = formatted_applicants
|
||||
data["bountyValue"] = bounty_value
|
||||
data["bountyText"] = bounty_text
|
||||
return data
|
||||
|
||||
/datum/computer_file/program/bounty_board/ui_act(action, list/params)
|
||||
if(..())
|
||||
return
|
||||
var/current_ref_num = params["request"]
|
||||
var/current_app_num = params["applicant"]
|
||||
var/datum/bank_account/request_target
|
||||
if(current_ref_num)
|
||||
for(var/datum/station_request/i in GLOB.request_list)
|
||||
if("[i.req_number]" == "[current_ref_num]")
|
||||
active_request = i
|
||||
break
|
||||
if(active_request)
|
||||
for(var/datum/bank_account/j in active_request.applicants)
|
||||
if("[j.account_id]" == "[current_app_num]")
|
||||
request_target = j
|
||||
break
|
||||
switch(action)
|
||||
if("createBounty")
|
||||
if(!current_user || !bounty_text)
|
||||
playsound(src, 'sound/machines/buzz-sigh.ogg', 20, TRUE)
|
||||
return TRUE
|
||||
for(var/datum/station_request/i in GLOB.request_list)
|
||||
if("[i.req_number]" == "[current_user.account_id]")
|
||||
computer.say("Account already has active bounty.")
|
||||
return
|
||||
var/datum/station_request/curr_request = new /datum/station_request(current_user.account_holder, bounty_value,bounty_text,current_user.account_id, current_user)
|
||||
GLOB.request_list += list(curr_request)
|
||||
for(var/obj/i in GLOB.allbountyboards)
|
||||
i.say("New bounty has been added!")
|
||||
playsound(i.loc, 'sound/effects/cashregister.ogg', 30, TRUE)
|
||||
return TRUE
|
||||
if("apply")
|
||||
if(!current_user)
|
||||
computer.say("Please swipe a valid ID first.")
|
||||
return TRUE
|
||||
if(current_user.account_holder == active_request.owner)
|
||||
playsound(computer, 'sound/machines/buzz-sigh.ogg', 20, TRUE)
|
||||
return TRUE
|
||||
active_request.applicants += list(current_user)
|
||||
if("payApplicant")
|
||||
if(!current_user)
|
||||
return
|
||||
if(!current_user.has_money(active_request.value) || (current_user.account_holder != active_request.owner))
|
||||
playsound(computer, 'sound/machines/buzz-sigh.ogg', 30, TRUE)
|
||||
return
|
||||
request_target.transfer_money(current_user, active_request.value)
|
||||
computer.say("Paid out [active_request.value] credits.")
|
||||
return TRUE
|
||||
if("clear")
|
||||
if(current_user)
|
||||
current_user = null
|
||||
computer.say("Account Reset.")
|
||||
return TRUE
|
||||
if("deleteRequest")
|
||||
if(!current_user)
|
||||
playsound(computer, 'sound/machines/buzz-sigh.ogg', 20, TRUE)
|
||||
return TRUE
|
||||
if(active_request.owner != current_user.account_holder)
|
||||
playsound(computer, 'sound/machines/buzz-sigh.ogg', 20, TRUE)
|
||||
return TRUE
|
||||
computer.say("Deleted current request.")
|
||||
GLOB.request_list.Remove(active_request)
|
||||
return TRUE
|
||||
if("bountyVal")
|
||||
bounty_value = text2num(params["bountyval"])
|
||||
if(!bounty_value)
|
||||
bounty_value = 1
|
||||
if("bountyText")
|
||||
bounty_text = (params["bountytext"])
|
||||
. = TRUE
|
||||
|
||||
/datum/computer_file/program/bounty_board/Destroy()
|
||||
GLOB.allbountyboards -= computer
|
||||
. = ..()
|
||||
@@ -15,8 +15,6 @@
|
||||
requires_ntnet = 0
|
||||
size = 8
|
||||
tgui_id = "NtosCard"
|
||||
ui_x = 450
|
||||
ui_y = 520
|
||||
|
||||
var/is_centcom = FALSE
|
||||
var/minor = FALSE
|
||||
@@ -275,7 +273,7 @@
|
||||
departments = list("CentCom" = get_all_centcom_jobs())
|
||||
else if(isnull(departments))
|
||||
departments = list(
|
||||
CARDCON_DEPARTMENT_COMMAND = list("Captain"),
|
||||
CARDCON_DEPARTMENT_COMMAND = list("Captain"),//lol
|
||||
CARDCON_DEPARTMENT_ENGINEERING = GLOB.engineering_positions,
|
||||
CARDCON_DEPARTMENT_MEDICAL = GLOB.medical_positions,
|
||||
CARDCON_DEPARTMENT_SCIENCE = GLOB.science_positions,
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
/datum/computer_file/program/bounty
|
||||
filename = "bounty"
|
||||
filedesc = "Nanotrasen Bounty Hunter"
|
||||
program_icon_state = "bounty"
|
||||
extended_desc = "A basic interface for supply personnel to check and claim bounties."
|
||||
requires_ntnet = TRUE
|
||||
transfer_access = ACCESS_CARGO
|
||||
network_destination = "cargo claims interface"
|
||||
size = 10
|
||||
tgui_id = "NtosBountyConsole"
|
||||
///cooldown var for printing paper sheets.
|
||||
var/printer_ready = 0
|
||||
///The cargo account for grabbing the cargo account's credits.
|
||||
var/static/datum/bank_account/cargocash
|
||||
|
||||
/datum/computer_file/program/bounty/proc/print_paper()
|
||||
new /obj/item/paper/bounty_printout(get_turf(computer))
|
||||
|
||||
/datum/computer_file/program/bounty/ui_interact(mob/user, datum/tgui/ui)
|
||||
if(!GLOB.bounties_list.len)
|
||||
setup_bounties()
|
||||
printer_ready = world.time + PRINTER_TIMEOUT
|
||||
cargocash = SSeconomy.get_dep_account(ACCOUNT_CAR)
|
||||
. = ..()
|
||||
|
||||
/datum/computer_file/program/bounty/ui_data(mob/user)
|
||||
var/list/data = get_header_data()
|
||||
var/list/bountyinfo = list()
|
||||
for(var/datum/bounty/B in GLOB.bounties_list)
|
||||
bountyinfo += list(list("name" = B.name, "description" = B.description, "reward_string" = B.reward_string(), "completion_string" = B.completion_string() , "claimed" = B.claimed, "can_claim" = B.can_claim(), "priority" = B.high_priority, "bounty_ref" = REF(B)))
|
||||
data["stored_cash"] = cargocash.account_balance
|
||||
data["bountydata"] = bountyinfo
|
||||
return data
|
||||
|
||||
/datum/computer_file/program/bounty/ui_act(action,params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("ClaimBounty")
|
||||
var/datum/bounty/cashmoney = locate(params["bounty"]) in GLOB.bounties_list
|
||||
if(cashmoney)
|
||||
cashmoney.claim()
|
||||
return TRUE
|
||||
if("Print")
|
||||
if(printer_ready < world.time)
|
||||
printer_ready = world.time + PRINTER_TIMEOUT
|
||||
print_paper()
|
||||
return
|
||||
@@ -6,11 +6,9 @@
|
||||
network_destination = "ship scanner"
|
||||
size = 6
|
||||
tgui_id = "NtosShipping"
|
||||
ui_x = 450
|
||||
ui_y = 350
|
||||
///Account used for creating barcodes.
|
||||
var/datum/bank_account/payments_acc
|
||||
///The amount which the tagger will recieve for the sale.
|
||||
///The amount which the tagger will receive for the sale.
|
||||
var/percent_cut = 20
|
||||
|
||||
/datum/computer_file/program/shipping/ui_data(mob/user)
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
unsendable = 1
|
||||
undeletable = 1
|
||||
size = 4
|
||||
ui_x = 420
|
||||
ui_y = 630
|
||||
available_on_ntnet = 0
|
||||
requires_ntnet = 0
|
||||
tgui_id = "NtosConfiguration"
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
requires_ntnet = FALSE
|
||||
size = 4
|
||||
tgui_id = "NtosCrewManifest"
|
||||
ui_x = 400
|
||||
ui_y = 480
|
||||
|
||||
/datum/computer_file/program/crew_manifest/ui_static_data(mob/user)
|
||||
var/list/data = list()
|
||||
@@ -41,9 +39,9 @@
|
||||
if(computer && printer) //This option should never be called if there is no printer
|
||||
var/contents = {"<h4>Crew Manifest</h4>
|
||||
<br>
|
||||
[GLOB.data_core ? GLOB.data_core.get_manifest_html(0) : ""]
|
||||
[GLOB.data_core ? GLOB.data_core.get_manifest() : ""]
|
||||
"}
|
||||
if(!printer.print_text(contents,text("crew manifest ([])", station_time_timestamp())))
|
||||
if(!printer.print_text(contents,text("crew manifest ([])", STATION_TIME_TIMESTAMP("hh:mm:ss", world.time))))
|
||||
to_chat(usr, "<span class='notice'>Hardware error: Printer was unable to print the file. It may be out of paper.</span>")
|
||||
return
|
||||
else
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
requires_ntnet = 0
|
||||
size = 4
|
||||
tgui_id = "NtosJobManager"
|
||||
ui_x = 400
|
||||
ui_y = 620
|
||||
|
||||
var/change_position_cooldown = 30
|
||||
//Jobs you cannot open new positions for
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
available_on_ntnet = 0
|
||||
ui_header = "downloader_finished.gif"
|
||||
tgui_id = "NtosNetDownloader"
|
||||
ui_x = 480
|
||||
ui_y = 735
|
||||
|
||||
var/datum/computer_file/program/downloaded_file = null
|
||||
var/hacked_download = 0
|
||||
@@ -20,6 +18,21 @@
|
||||
var/download_netspeed = 0
|
||||
var/downloaderror = ""
|
||||
var/obj/item/modular_computer/my_computer = null
|
||||
var/emagged = FALSE
|
||||
var/list/main_repo
|
||||
var/list/antag_repo
|
||||
|
||||
/datum/computer_file/program/ntnetdownload/run_program()
|
||||
. = ..()
|
||||
main_repo = SSnetworks.station_network.available_station_software
|
||||
antag_repo = SSnetworks.station_network.available_antag_software
|
||||
|
||||
/datum/computer_file/program/ntnetdownload/run_emag()
|
||||
if(emagged)
|
||||
return FALSE
|
||||
emagged = TRUE
|
||||
return TRUE
|
||||
|
||||
|
||||
/datum/computer_file/program/ntnetdownload/proc/begin_file_download(filename)
|
||||
if(downloaded_file)
|
||||
@@ -30,8 +43,8 @@
|
||||
if(!PRG || !istype(PRG))
|
||||
return 0
|
||||
|
||||
// Attempting to download antag only program, but without having emagged computer. No.
|
||||
if(PRG.available_on_syndinet && !(computer.obj_flags & EMAGGED))
|
||||
// Attempting to download antag only program, but without having emagged/syndicate computer. No.
|
||||
if(PRG.available_on_syndinet && !emagged)
|
||||
return 0
|
||||
|
||||
var/obj/item/computer_hardware/hard_drive/hard_drive = computer.all_components[MC_HDD]
|
||||
@@ -41,10 +54,10 @@
|
||||
|
||||
ui_header = "downloader_running.gif"
|
||||
|
||||
if(PRG in SSnetworks.station_network.available_station_software)
|
||||
if(PRG in main_repo)
|
||||
generate_network_log("Began downloading file [PRG.filename].[PRG.filetype] from NTNet Software Repository.")
|
||||
hacked_download = 0
|
||||
else if(PRG in SSnetworks.station_network.available_antag_software)
|
||||
else if(PRG in antag_repo)
|
||||
generate_network_log("Began downloading file **ENCRYPTED**.[PRG.filetype] from unspecified server.")
|
||||
hacked_download = 1
|
||||
else
|
||||
@@ -130,7 +143,7 @@
|
||||
data["disk_size"] = hard_drive.max_capacity
|
||||
data["disk_used"] = hard_drive.used_capacity
|
||||
var/list/all_entries[0]
|
||||
for(var/A in SSnetworks.station_network.available_station_software)
|
||||
for(var/A in main_repo)
|
||||
var/datum/computer_file/program/P = A
|
||||
// Only those programs our user can run will show in the list
|
||||
if(!P.can_run(user,transfer = 1) || hard_drive.find_file_by_name(P.filename))
|
||||
@@ -143,9 +156,9 @@
|
||||
"size" = P.size,
|
||||
)))
|
||||
data["hackedavailable"] = FALSE
|
||||
if(computer.obj_flags & EMAGGED) // If we are running on emagged computer we have access to some "bonus" software
|
||||
if(emagged) // If we are running on emagged computer we have access to some "bonus" software
|
||||
var/list/hacked_programs[0]
|
||||
for(var/S in SSnetworks.station_network.available_antag_software)
|
||||
for(var/S in antag_repo)
|
||||
var/datum/computer_file/program/P = S
|
||||
if(hard_drive.find_file_by_name(P.filename))
|
||||
continue
|
||||
@@ -172,3 +185,24 @@
|
||||
/datum/computer_file/program/ntnetdownload/kill_program(forced)
|
||||
abort_file_download()
|
||||
return ..(forced)
|
||||
|
||||
////////////////////////
|
||||
//Syndicate Downloader//
|
||||
////////////////////////
|
||||
|
||||
/// This app only lists programs normally found in the emagged section of the normal downloader app
|
||||
|
||||
/datum/computer_file/program/ntnetdownload/syndicate
|
||||
filename = "syndownloader"
|
||||
filedesc = "Software Download Tool"
|
||||
program_icon_state = "generic"
|
||||
extended_desc = "This program allows downloads of software from shared Syndicate repositories"
|
||||
requires_ntnet = 0
|
||||
ui_header = "downloader_finished.gif"
|
||||
tgui_id = "NtosNetDownloader"
|
||||
emagged = TRUE
|
||||
|
||||
/datum/computer_file/program/ntnetdownload/syndicate/run_program()
|
||||
. = ..()
|
||||
main_repo = SSnetworks.station_network.available_antag_software
|
||||
antag_repo = null
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
ui_header = "ntnrc_idle.gif"
|
||||
available_on_ntnet = 1
|
||||
tgui_id = "NtosNetChat"
|
||||
ui_x = 900
|
||||
ui_y = 675
|
||||
|
||||
var/last_message // Used to generate the toolbar icon
|
||||
var/username
|
||||
var/active_channel
|
||||
|
||||
@@ -1,183 +0,0 @@
|
||||
/datum/computer_file/program/nttransfer
|
||||
filename = "nttransfer"
|
||||
filedesc = "P2P Transfer Client"
|
||||
extended_desc = "This program allows for simple file transfer via direct peer to peer connection."
|
||||
program_icon_state = "comm_logs"
|
||||
size = 7
|
||||
requires_ntnet = 1
|
||||
requires_ntnet_feature = NTNET_PEERTOPEER
|
||||
network_destination = "other device via P2P tunnel"
|
||||
available_on_ntnet = 1
|
||||
tgui_id = "ntos_net_transfer"
|
||||
|
||||
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/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/static/nttransfer_uid = 0
|
||||
|
||||
/datum/computer_file/program/nttransfer/New()
|
||||
unique_token = nttransfer_uid++
|
||||
..()
|
||||
|
||||
/datum/computer_file/program/nttransfer/process_tick()
|
||||
// Server mode
|
||||
update_netspeed()
|
||||
if(provided_file)
|
||||
for(var/datum/computer_file/program/nttransfer/C in connected_clients)
|
||||
// Transfer speed is limited by device which uses slower connectivity.
|
||||
// We can have multiple clients downloading at same time, but let's assume we use some sort of multicast transfer
|
||||
// so they can all run on same speed.
|
||||
C.actual_netspeed = min(C.download_netspeed, download_netspeed)
|
||||
C.download_completion += C.actual_netspeed
|
||||
if(C.download_completion >= provided_file.size)
|
||||
C.finish_download()
|
||||
else if(downloaded_file) // Client mode
|
||||
if(!remote)
|
||||
crash_download("Connection to remote server lost")
|
||||
|
||||
/datum/computer_file/program/nttransfer/kill_program(forced = FALSE)
|
||||
if(downloaded_file) // Client mode, clean up variables for next use
|
||||
finalize_download()
|
||||
|
||||
if(provided_file) // Server mode, disconnect all clients
|
||||
for(var/datum/computer_file/program/nttransfer/P in connected_clients)
|
||||
P.crash_download("Connection terminated by remote server")
|
||||
downloaded_file = null
|
||||
..(forced)
|
||||
|
||||
/datum/computer_file/program/nttransfer/proc/update_netspeed()
|
||||
download_netspeed = 0
|
||||
switch(ntnet_status)
|
||||
if(1)
|
||||
download_netspeed = NTNETSPEED_LOWSIGNAL
|
||||
if(2)
|
||||
download_netspeed = NTNETSPEED_HIGHSIGNAL
|
||||
if(3)
|
||||
download_netspeed = NTNETSPEED_ETHERNET
|
||||
|
||||
// Finishes download and attempts to store the file on HDD
|
||||
/datum/computer_file/program/nttransfer/proc/finish_download()
|
||||
var/obj/item/computer_hardware/hard_drive/hard_drive = computer.all_components[MC_HDD]
|
||||
if(!computer || !hard_drive || !hard_drive.store_file(downloaded_file))
|
||||
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
|
||||
/datum/computer_file/program/nttransfer/proc/crash_download(var/message)
|
||||
error = message ? message : "An unknown error has occurred during download"
|
||||
finalize_download()
|
||||
|
||||
// Cleans up variables for next use
|
||||
/datum/computer_file/program/nttransfer/proc/finalize_download()
|
||||
if(remote)
|
||||
remote.connected_clients.Remove(src)
|
||||
downloaded_file = null
|
||||
remote = null
|
||||
download_completion = 0
|
||||
|
||||
/datum/computer_file/program/nttransfer/ui_act(action, params)
|
||||
if(..())
|
||||
return 1
|
||||
switch(action)
|
||||
if("PRG_downloadfile")
|
||||
for(var/datum/computer_file/program/nttransfer/P in SSnetworks.station_network.fileservers)
|
||||
if("[P.unique_token]" == params["id"])
|
||||
remote = P
|
||||
break
|
||||
if(!remote || !remote.provided_file)
|
||||
return
|
||||
if(remote.server_password)
|
||||
var/pass = reject_bad_text(input(usr, "Code 401 Unauthorized. Please enter password:", "Password required"))
|
||||
if(pass != remote.server_password)
|
||||
error = "Incorrect Password"
|
||||
return
|
||||
downloaded_file = remote.provided_file.clone()
|
||||
remote.connected_clients.Add(src)
|
||||
return 1
|
||||
if("PRG_reset")
|
||||
error = ""
|
||||
upload_menu = 0
|
||||
finalize_download()
|
||||
if(src in SSnetworks.station_network.fileservers)
|
||||
SSnetworks.station_network.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
|
||||
if("PRG_setpassword")
|
||||
var/pass = reject_bad_text(input(usr, "Enter new server password. Leave blank to cancel, input 'none' to disable password.", "Server security", "none"))
|
||||
if(!pass)
|
||||
return
|
||||
if(pass == "none")
|
||||
server_password = ""
|
||||
return
|
||||
server_password = pass
|
||||
return 1
|
||||
if("PRG_uploadfile")
|
||||
var/obj/item/computer_hardware/hard_drive/hard_drive = computer.all_components[MC_HDD]
|
||||
for(var/datum/computer_file/F in hard_drive.stored_files)
|
||||
if("[F.uid]" == params["id"])
|
||||
if(F.unsendable)
|
||||
error = "I/O Error: File locked."
|
||||
return
|
||||
if(istype(F, /datum/computer_file/program))
|
||||
var/datum/computer_file/program/P = F
|
||||
if(!P.can_run(usr,transfer = 1))
|
||||
error = "Access Error: Insufficient rights to upload file."
|
||||
provided_file = F
|
||||
SSnetworks.station_network.fileservers.Add(src)
|
||||
return
|
||||
error = "I/O Error: Unable to locate file on hard drive."
|
||||
return 1
|
||||
if("PRG_uploadmenu")
|
||||
upload_menu = 1
|
||||
|
||||
|
||||
/datum/computer_file/program/nttransfer/ui_data(mob/user)
|
||||
|
||||
var/list/data = get_header_data()
|
||||
|
||||
if(error)
|
||||
data["error"] = error
|
||||
else if(downloaded_file)
|
||||
data["downloading"] = 1
|
||||
data["download_size"] = downloaded_file.size
|
||||
data["download_progress"] = download_completion
|
||||
data["download_netspeed"] = actual_netspeed
|
||||
data["download_name"] = "[downloaded_file.filename].[downloaded_file.filetype]"
|
||||
else if (provided_file)
|
||||
data["uploading"] = 1
|
||||
data["upload_uid"] = unique_token
|
||||
data["upload_clients"] = connected_clients.len
|
||||
data["upload_haspassword"] = server_password ? 1 : 0
|
||||
data["upload_filename"] = "[provided_file.filename].[provided_file.filetype]"
|
||||
else if (upload_menu)
|
||||
var/list/all_files[0]
|
||||
var/obj/item/computer_hardware/hard_drive/hard_drive = computer.all_components[MC_HDD]
|
||||
for(var/datum/computer_file/F in hard_drive.stored_files)
|
||||
all_files.Add(list(list(
|
||||
"uid" = F.uid,
|
||||
"filename" = "[F.filename].[F.filetype]",
|
||||
"size" = F.size
|
||||
)))
|
||||
data["upload_filelist"] = all_files
|
||||
else
|
||||
var/list/all_servers[0]
|
||||
for(var/datum/computer_file/program/nttransfer/P in SSnetworks.station_network.fileservers)
|
||||
all_servers.Add(list(list(
|
||||
"uid" = P.unique_token,
|
||||
"filename" = "[P.provided_file.filename].[P.provided_file.filetype]",
|
||||
"size" = P.provided_file.size,
|
||||
"haspassword" = P.server_password ? 1 : 0
|
||||
)))
|
||||
data["servers"] = all_servers
|
||||
|
||||
return data
|
||||
@@ -12,8 +12,6 @@
|
||||
network_destination = "power monitoring system"
|
||||
size = 9
|
||||
tgui_id = "NtosPowerMonitor"
|
||||
ui_x = 550
|
||||
ui_y = 700
|
||||
|
||||
var/has_alert = 0
|
||||
var/obj/structure/cable/attached_wire
|
||||
|
||||
@@ -2,31 +2,49 @@
|
||||
filename = "genericfinder"
|
||||
filedesc = "debug_finder"
|
||||
ui_header = "borg_mon.gif" //DEBUG -- new icon before PR
|
||||
program_icon_state = "generic"
|
||||
extended_desc = "generic"
|
||||
program_icon_state = "radarntos"
|
||||
requires_ntnet = TRUE
|
||||
transfer_access = null
|
||||
available_on_ntnet = FALSE
|
||||
usage_flags = PROGRAM_LAPTOP | PROGRAM_TABLET
|
||||
network_destination = "tracking program"
|
||||
size = 5
|
||||
tgui_id = "NtosRadar"
|
||||
ui_x = 800
|
||||
ui_y = 600
|
||||
special_assets = list(
|
||||
/datum/asset/simple/radar_assets,
|
||||
)
|
||||
///List of trackable entities. Updated by the scan() proc.
|
||||
var/list/objects
|
||||
///Ref of the last trackable object selected by the user in the tgui window. Updated in the ui_act() proc.
|
||||
var/atom/selected
|
||||
///Used to store when the next scan is available. Updated by the scan() proc.
|
||||
var/next_scan = 0
|
||||
///Used to keep track of the last value program_icon_state was set to, to prevent constant unnecessary update_icon() calls
|
||||
var/last_icon_state = ""
|
||||
///Used by the tgui interface, themed NT or Syndicate.
|
||||
var/arrowstyle = "ntosradarpointer.png"
|
||||
///Used by the tgui interface, themed for NT or Syndicate colors.
|
||||
var/pointercolor = "green"
|
||||
|
||||
/datum/computer_file/program/radar/run_program(mob/living/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
START_PROCESSING(SSfastprocess, src)
|
||||
return
|
||||
return FALSE
|
||||
|
||||
/datum/computer_file/program/radar/kill_program(forced = FALSE)
|
||||
objects = list()
|
||||
selected = null
|
||||
STOP_PROCESSING(SSfastprocess, src)
|
||||
return ..()
|
||||
|
||||
/datum/computer_file/program/radar/Destroy()
|
||||
STOP_PROCESSING(SSfastprocess, src)
|
||||
return ..()
|
||||
|
||||
/datum/computer_file/program/radar/ui_assets(mob/user)
|
||||
return list(
|
||||
get_asset_datum(/datum/asset/simple/radar_assets),
|
||||
)
|
||||
|
||||
/datum/computer_file/program/radar/ui_data(mob/user)
|
||||
var/list/data = get_header_data()
|
||||
data["selected"] = selected
|
||||
@@ -65,7 +83,37 @@
|
||||
*
|
||||
*/
|
||||
/datum/computer_file/program/radar/proc/track()
|
||||
return
|
||||
var/atom/movable/signal = find_atom()
|
||||
if(!trackable(signal))
|
||||
return
|
||||
|
||||
var/turf/here_turf = (get_turf(computer))
|
||||
var/turf/target_turf = (get_turf(signal))
|
||||
var/userot = FALSE
|
||||
var/rot = 0
|
||||
var/pointer="crosshairs"
|
||||
var/locx = (target_turf.x - here_turf.x) + 24
|
||||
var/locy = (here_turf.y - target_turf.y) + 24
|
||||
|
||||
if(get_dist_euclidian(here_turf, target_turf) > 24)
|
||||
userot = TRUE
|
||||
rot = round(Get_Angle(here_turf, target_turf))
|
||||
else
|
||||
if(target_turf.z > here_turf.z)
|
||||
pointer="caret-up"
|
||||
else if(target_turf.z < here_turf.z)
|
||||
pointer="caret-down"
|
||||
|
||||
var/list/trackinfo = list(
|
||||
"locx" = locx,
|
||||
"locy" = locy,
|
||||
"userot" = userot,
|
||||
"rot" = rot,
|
||||
"arrowstyle" = arrowstyle,
|
||||
"color" = pointercolor,
|
||||
"pointer" = pointer,
|
||||
)
|
||||
return trackinfo
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -77,10 +125,12 @@
|
||||
**arg1 is the atom being evaluated.
|
||||
*/
|
||||
/datum/computer_file/program/radar/proc/trackable(atom/movable/signal)
|
||||
if(!signal)
|
||||
if(!signal || !computer)
|
||||
return FALSE
|
||||
var/turf/here = get_turf(computer)
|
||||
var/turf/there = get_turf(signal)
|
||||
if(!here || !there)
|
||||
return FALSE //I was still getting a runtime even after the above check while scanning, so fuck it
|
||||
return (there.z == here.z) || (is_station_level(here.z) && is_station_level(there.z))
|
||||
|
||||
/**
|
||||
@@ -98,6 +148,59 @@
|
||||
/datum/computer_file/program/radar/proc/scan()
|
||||
return
|
||||
|
||||
/**
|
||||
*
|
||||
*Finds the atom in the appropriate list that the `selected` var indicates
|
||||
*
|
||||
*The `selected` var holds a REF, which is a string. A mob REF may be
|
||||
*something like "mob_209". In order to find the actual atom, we need
|
||||
*to search the appropriate list for the REF string. This is dependant
|
||||
*on the program (Lifeline uses GLOB.human_list, while Fission360 uses
|
||||
*GLOB.poi_list), but the result will be the same; evaluate the string and
|
||||
*return an atom reference.
|
||||
*/
|
||||
/datum/computer_file/program/radar/proc/find_atom()
|
||||
return
|
||||
|
||||
//We use SSfastprocess for the program icon state because it runs faster than process_tick() does.
|
||||
/datum/computer_file/program/radar/process()
|
||||
if(computer.active_program != src)
|
||||
STOP_PROCESSING(SSfastprocess, src) //We're not the active program, it's time to stop.
|
||||
return
|
||||
if(!selected)
|
||||
return
|
||||
|
||||
var/atom/movable/signal = find_atom()
|
||||
if(!trackable(signal))
|
||||
program_icon_state = "[initial(program_icon_state)]lost"
|
||||
if(last_icon_state != program_icon_state)
|
||||
computer.update_icon()
|
||||
last_icon_state = program_icon_state
|
||||
return
|
||||
|
||||
var/here_turf = get_turf(computer)
|
||||
var/target_turf = get_turf(signal)
|
||||
var/trackdistance = get_dist_euclidian(here_turf, target_turf)
|
||||
switch(trackdistance)
|
||||
if(0)
|
||||
program_icon_state = "[initial(program_icon_state)]direct"
|
||||
if(1 to 12)
|
||||
program_icon_state = "[initial(program_icon_state)]close"
|
||||
if(13 to 24)
|
||||
program_icon_state = "[initial(program_icon_state)]medium"
|
||||
if(25 to INFINITY)
|
||||
program_icon_state = "[initial(program_icon_state)]far"
|
||||
|
||||
if(last_icon_state != program_icon_state)
|
||||
computer.update_icon()
|
||||
last_icon_state = program_icon_state
|
||||
computer.setDir(get_dir(here_turf, target_turf))
|
||||
|
||||
//We can use process_tick to restart fast processing, since the computer will be running this constantly either way.
|
||||
/datum/computer_file/program/radar/process_tick()
|
||||
if(computer.active_program == src)
|
||||
START_PROCESSING(SSfastprocess, src)
|
||||
|
||||
///////////////////
|
||||
//Suit Sensor App//
|
||||
///////////////////
|
||||
@@ -106,44 +209,13 @@
|
||||
/datum/computer_file/program/radar/lifeline
|
||||
filename = "Lifeline"
|
||||
filedesc = "Lifeline"
|
||||
program_icon_state = "generic"
|
||||
extended_desc = "This program allows for tracking of crew members via their suit sensors."
|
||||
requires_ntnet = TRUE
|
||||
transfer_access = ACCESS_MEDICAL
|
||||
available_on_ntnet = TRUE
|
||||
|
||||
/datum/computer_file/program/radar/lifeline/track()
|
||||
var/mob/living/carbon/human/humanoid = locate(selected) in GLOB.human_list
|
||||
if(!istype(humanoid) || !trackable(humanoid))
|
||||
return
|
||||
|
||||
var/turf/here_turf = (get_turf(computer))
|
||||
var/turf/target_turf = (get_turf(humanoid))
|
||||
var/userot = FALSE
|
||||
var/rot = 0
|
||||
var/pointer="crosshairs"
|
||||
var/locx = (target_turf.x - here_turf.x)
|
||||
var/locy = (here_turf.y - target_turf.y)
|
||||
if(get_dist_euclidian(here_turf, target_turf) > 24) //If they're too far away, we need the angle for the arrow along the edge of the radar display
|
||||
userot = TRUE
|
||||
rot = round(Get_Angle(here_turf, target_turf))
|
||||
else
|
||||
locx = locx + 24
|
||||
locy = locy + 24
|
||||
if(target_turf.z > here_turf.z)
|
||||
pointer="caret-up"
|
||||
else if(target_turf.z < here_turf.z)
|
||||
pointer="caret-down"
|
||||
var/list/trackinfo = list(
|
||||
locx = locx,
|
||||
locy = locy,
|
||||
userot = userot,
|
||||
rot = rot,
|
||||
arrowstyle = "ntosradarpointer.png", //For the rotation arrow, it's stupid I know
|
||||
color = "green",
|
||||
pointer = pointer,
|
||||
)
|
||||
return trackinfo
|
||||
/datum/computer_file/program/radar/lifeline/find_atom()
|
||||
return locate(selected) in GLOB.human_list
|
||||
|
||||
/datum/computer_file/program/radar/lifeline/scan()
|
||||
if(world.time < next_scan)
|
||||
@@ -184,46 +256,18 @@
|
||||
/datum/computer_file/program/radar/fission360
|
||||
filename = "Fission360"
|
||||
filedesc = "Fission360"
|
||||
program_icon_state = "generic"
|
||||
program_icon_state = "radarsyndicate"
|
||||
extended_desc = "This program allows for tracking of nuclear authorization disks and warheads."
|
||||
requires_ntnet = FALSE
|
||||
transfer_access = null
|
||||
available_on_ntnet = FALSE
|
||||
available_on_syndinet = TRUE
|
||||
tgui_id = "NtosRadarSyndicate"
|
||||
arrowstyle = "ntosradarpointerS.png"
|
||||
pointercolor = "red"
|
||||
|
||||
/datum/computer_file/program/radar/fission360/track()
|
||||
var/obj/nuke = locate(selected) in GLOB.poi_list
|
||||
if(!trackable(nuke))
|
||||
return
|
||||
|
||||
var/turf/here_turf = (get_turf(computer))
|
||||
var/turf/target_turf = (get_turf(nuke))
|
||||
var/userot = FALSE
|
||||
var/rot = 0
|
||||
var/pointer="crosshairs"
|
||||
var/locx = (target_turf.x - here_turf.x)
|
||||
var/locy = (here_turf.y - target_turf.y)
|
||||
if(get_dist_euclidian(here_turf, target_turf) > 24) //If they're too far away, we need the angle for the arrow along the edge of the radar display
|
||||
userot = TRUE
|
||||
rot = round(Get_Angle(here_turf, target_turf))
|
||||
else
|
||||
locx = locx + 24
|
||||
locy = locy + 24
|
||||
if(target_turf.z > here_turf.z)
|
||||
pointer="caret-up"
|
||||
else if(target_turf.z < here_turf.z)
|
||||
pointer="caret-down"
|
||||
var/list/trackinfo = list(
|
||||
locx = locx,
|
||||
locy = locy,
|
||||
userot = userot,
|
||||
rot = rot,
|
||||
arrowstyle = "ntosradarpointerS.png",
|
||||
color = "red",
|
||||
pointer = pointer,
|
||||
)
|
||||
return trackinfo
|
||||
/datum/computer_file/program/radar/fission360/find_atom()
|
||||
return locate(selected) in GLOB.poi_list
|
||||
|
||||
/datum/computer_file/program/radar/fission360/scan()
|
||||
if(world.time < next_scan)
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
network_destination = "robotics control network"
|
||||
size = 12
|
||||
tgui_id = "NtosRoboControl"
|
||||
ui_x = 550
|
||||
ui_y = 550
|
||||
///Number of simple robots on-station.
|
||||
var/botcount = 0
|
||||
///Used to find the location of the user for the purposes of summoning robots.
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
network_destination = "supermatter monitoring system"
|
||||
size = 5
|
||||
tgui_id = "NtosSupermatterMonitor"
|
||||
ui_x = 600
|
||||
ui_y = 350
|
||||
var/last_status = SUPERMATTER_INACTIVE
|
||||
var/list/supermatters
|
||||
var/obj/machinery/power/supermatter_crystal/active // Currently selected supermatter crystal.
|
||||
|
||||
@@ -37,4 +37,4 @@
|
||||
icon_state = "cpu_super"
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
power_usage = 75
|
||||
max_idle_programs = 2
|
||||
max_idle_programs = 2
|
||||
|
||||
@@ -32,28 +32,29 @@
|
||||
|
||||
|
||||
/obj/item/computer_hardware/attackby(obj/item/I, mob/living/user)
|
||||
// Multitool. Runs diagnostics
|
||||
if(istype(I, /obj/item/multitool))
|
||||
to_chat(user, "***** DIAGNOSTICS REPORT *****")
|
||||
diagnostics(user)
|
||||
to_chat(user, "******************************")
|
||||
return 1
|
||||
|
||||
// Cable coil. Works as repair method, but will probably require multiple applications and more cable.
|
||||
if(istype(I, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/S = I
|
||||
if(obj_integrity == max_integrity)
|
||||
to_chat(user, "<span class='warning'>\The [src] doesn't seem to require repairs.</span>")
|
||||
return 1
|
||||
if(I.use_tool(src, user, 0, 1))
|
||||
if(S.use(1))
|
||||
to_chat(user, "<span class='notice'>You patch up \the [src] with a bit of \the [I].</span>")
|
||||
obj_integrity = min(obj_integrity + 10, max_integrity)
|
||||
return 1
|
||||
|
||||
if(try_insert(I, user))
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/item/computer_hardware/multitool_act(mob/living/user, obj/item/I)
|
||||
..()
|
||||
to_chat(user, "***** DIAGNOSTICS REPORT *****")
|
||||
diagnostics(user)
|
||||
to_chat(user, "******************************")
|
||||
return TRUE
|
||||
|
||||
// Called on multitool click, prints diagnostic information to the user.
|
||||
/obj/item/computer_hardware/proc/diagnostics(var/mob/user)
|
||||
to_chat(user, "Hardware Integrity Test... (Corruption: [damage]/[max_damage]) [damage > damage_failure ? "FAIL" : damage > damage_malfunction ? "WARN" : "PASS"]")
|
||||
|
||||
@@ -9,6 +9,10 @@
|
||||
var/obj/item/aicard/stored_card = null
|
||||
var/locked = FALSE
|
||||
|
||||
/obj/item/computer_hardware/ai_slot/handle_atom_del(atom/A)
|
||||
if(A == stored_card)
|
||||
try_eject(0, null, TRUE)
|
||||
. = ..()
|
||||
|
||||
/obj/item/computer_hardware/ai_slot/examine(mob/user)
|
||||
. = ..()
|
||||
@@ -41,13 +45,6 @@
|
||||
|
||||
|
||||
/obj/item/computer_hardware/ai_slot/try_eject(slot=0,mob/living/user = null,forced = 0)
|
||||
if (get_dist(src,user) > 1)
|
||||
if (iscarbon(user))
|
||||
var/mob/living/carbon/H = user
|
||||
if (!(H.dna && H.dna.check_mutation(TK) && tkMaxRangeCheck(src,H)))
|
||||
return FALSE
|
||||
else
|
||||
return FALSE
|
||||
if(!stored_card)
|
||||
to_chat(user, "<span class='warning'>There is no card in \the [src].</span>")
|
||||
return FALSE
|
||||
@@ -57,19 +54,21 @@
|
||||
return FALSE
|
||||
|
||||
if(stored_card)
|
||||
stored_card.forceMove(get_turf(src))
|
||||
to_chat(user, "<span class='notice'>You remove [stored_card] from [src].</span>")
|
||||
locked = FALSE
|
||||
stored_card.verb_pickup()
|
||||
if(user)
|
||||
user.put_in_hands(stored_card)
|
||||
else
|
||||
stored_card.forceMove(drop_location())
|
||||
stored_card = null
|
||||
|
||||
to_chat(user, "<span class='notice'>You remove the card from \the [src].</span>")
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/item/computer_hardware/ai_slot/attackby(obj/item/I, mob/living/user)
|
||||
if(..())
|
||||
return
|
||||
if(istype(I, /obj/item/screwdriver))
|
||||
if(I.tool_behaviour == TOOL_SCREWDRIVER)
|
||||
to_chat(user, "<span class='notice'>You press down on the manual eject button with \the [I].</span>")
|
||||
try_eject(,user,1)
|
||||
return
|
||||
return
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
var/obj/item/stock_parts/cell/battery = null
|
||||
device_type = MC_CELL
|
||||
|
||||
/obj/item/computer_hardware/battery/get_cell()
|
||||
return battery
|
||||
|
||||
/obj/item/computer_hardware/battery/New(loc, battery_type = null)
|
||||
if(battery_type)
|
||||
battery = new battery_type(src)
|
||||
@@ -16,6 +19,11 @@
|
||||
. = ..()
|
||||
QDEL_NULL(battery)
|
||||
|
||||
/obj/item/computer_hardware/battery/handle_atom_del(atom/A)
|
||||
if(A == battery)
|
||||
try_eject(0, null, TRUE)
|
||||
. = ..()
|
||||
|
||||
/obj/item/computer_hardware/battery/try_insert(obj/item/I, mob/living/user = null)
|
||||
if(!holder)
|
||||
return FALSE
|
||||
@@ -45,7 +53,10 @@
|
||||
to_chat(user, "<span class='warning'>There is no power cell connected to \the [src].</span>")
|
||||
return FALSE
|
||||
else
|
||||
battery.forceMove(get_turf(src))
|
||||
if(user)
|
||||
user.put_in_hands(battery)
|
||||
else
|
||||
battery.forceMove(drop_location())
|
||||
to_chat(user, "<span class='notice'>You detach \the [battery] from \the [src].</span>")
|
||||
battery = null
|
||||
|
||||
|
||||
@@ -9,6 +9,13 @@
|
||||
var/obj/item/card/id/stored_card = null
|
||||
var/obj/item/card/id/stored_card2 = null
|
||||
|
||||
/obj/item/computer_hardware/card_slot/handle_atom_del(atom/A)
|
||||
if(A == stored_card)
|
||||
try_eject(1, null, TRUE)
|
||||
if(A == stored_card2)
|
||||
try_eject(2, null, TRUE)
|
||||
. = ..()
|
||||
|
||||
/obj/item/computer_hardware/card_slot/Destroy()
|
||||
try_eject()
|
||||
return ..()
|
||||
@@ -67,19 +74,15 @@
|
||||
else
|
||||
stored_card2 = I
|
||||
to_chat(user, "<span class='notice'>You insert \the [I] into \the [src].</span>")
|
||||
playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0)
|
||||
playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
H.sec_hud_set_ID()
|
||||
|
||||
return TRUE
|
||||
|
||||
|
||||
/obj/item/computer_hardware/card_slot/try_eject(slot=0, mob/living/user = null, forced = 0)
|
||||
if (get_dist(src,user) > 1)
|
||||
if (iscarbon(user))
|
||||
var/mob/living/carbon/H = user
|
||||
if (!(H.dna && H.dna.check_mutation(TK) && tkMaxRangeCheck(src,H)))
|
||||
return FALSE
|
||||
else
|
||||
return FALSE
|
||||
if(!stored_card && !stored_card2)
|
||||
to_chat(user, "<span class='warning'>There are no cards in \the [src].</span>")
|
||||
return FALSE
|
||||
@@ -89,7 +92,7 @@
|
||||
if(user)
|
||||
user.put_in_hands(stored_card)
|
||||
else
|
||||
stored_card.forceMove(get_turf(src))
|
||||
stored_card.forceMove(drop_location())
|
||||
stored_card = null
|
||||
ejected++
|
||||
|
||||
@@ -97,7 +100,7 @@
|
||||
if(user)
|
||||
user.put_in_hands(stored_card2)
|
||||
else
|
||||
stored_card2.forceMove(get_turf(src))
|
||||
stored_card2.forceMove(drop_location())
|
||||
stored_card2 = null
|
||||
ejected++
|
||||
|
||||
@@ -109,16 +112,18 @@
|
||||
for(var/I in holder.idle_threads)
|
||||
var/datum/computer_file/program/P = I
|
||||
P.event_idremoved(1, slot)
|
||||
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
H.sec_hud_set_ID()
|
||||
to_chat(user, "<span class='notice'>You remove the card[ejected>1 ? "s" : ""] from \the [src].</span>")
|
||||
playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0)
|
||||
playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/item/computer_hardware/card_slot/attackby(obj/item/I, mob/living/user)
|
||||
if(..())
|
||||
return
|
||||
if(istype(I, /obj/item/screwdriver))
|
||||
if(I.tool_behaviour == TOOL_SCREWDRIVER)
|
||||
to_chat(user, "<span class='notice'>You press down on the manual eject button with \the [I].</span>")
|
||||
try_eject(0,user)
|
||||
return
|
||||
|
||||
@@ -157,18 +157,30 @@
|
||||
max_capacity = 64
|
||||
icon_state = "ssd_mini"
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
custom_price = PRICE_ABOVE_NORMAL
|
||||
custom_price = 150
|
||||
|
||||
/obj/item/computer_hardware/hard_drive/small/syndicate // Syndicate variant - very slight better
|
||||
// Syndicate variant - very slight better
|
||||
/obj/item/computer_hardware/hard_drive/small/syndicate
|
||||
desc = "An efficient SSD for portable devices developed by a rival organisation."
|
||||
power_usage = 8
|
||||
max_capacity = 70
|
||||
var/datum/antagonist/traitor/traitor_data // Syndicate hard drive has the user's data baked directly into it on creation
|
||||
|
||||
/// For tablets given to nuke ops
|
||||
/obj/item/computer_hardware/hard_drive/small/nukeops
|
||||
power_usage = 8
|
||||
max_capacity = 70
|
||||
|
||||
/obj/item/computer_hardware/hard_drive/small/nukeops/install_default_programs()
|
||||
store_file(new/datum/computer_file/program/computerconfig(src))
|
||||
store_file(new/datum/computer_file/program/ntnetdownload/syndicate(src)) // Syndicate version; automatic access to syndicate apps and no NT apps
|
||||
store_file(new/datum/computer_file/program/filemanager(src))
|
||||
store_file(new/datum/computer_file/program/radar/fission360(src)) //I am legitimately afraid if I don't do this, Ops players will think they just don't get a pinpointer anymore.
|
||||
|
||||
/obj/item/computer_hardware/hard_drive/micro
|
||||
name = "micro solid state drive"
|
||||
desc = "A highly efficient SSD chip for portable devices."
|
||||
power_usage = 2
|
||||
max_capacity = 32
|
||||
icon_state = "ssd_micro"
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
|
||||
@@ -10,14 +10,14 @@
|
||||
|
||||
/obj/item/computer_hardware/printer/diagnostics(mob/living/user)
|
||||
..()
|
||||
to_chat(user, "Paper level: [stored_paper]/[max_paper].")
|
||||
to_chat(user, "<span class='notice'>Paper level: [stored_paper]/[max_paper].</span>")
|
||||
|
||||
/obj/item/computer_hardware/printer/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Paper level: [stored_paper]/[max_paper].</span>"
|
||||
|
||||
|
||||
/obj/item/computer_hardware/printer/proc/print_text(var/text_to_print, var/paper_title = "")
|
||||
/obj/item/computer_hardware/printer/proc/print_text(text_to_print, paper_title = "")
|
||||
if(!stored_paper)
|
||||
return FALSE
|
||||
if(!check_functionality())
|
||||
@@ -27,11 +27,12 @@
|
||||
|
||||
// Damaged printer causes the resulting paper to be somewhat harder to read.
|
||||
if(damage > damage_malfunction)
|
||||
P.setText(stars(text_to_print, 100-malfunction_probability))
|
||||
P.info = stars(text_to_print, 100-malfunction_probability)
|
||||
else
|
||||
P.setText(text_to_print)
|
||||
P.info = text_to_print
|
||||
if(paper_title)
|
||||
P.name = paper_title
|
||||
P.update_icon()
|
||||
stored_paper--
|
||||
P = null
|
||||
return TRUE
|
||||
|
||||
Reference in New Issue
Block a user