Updates Part Nine

This commit is contained in:
Unknown
2019-04-11 19:14:25 -04:00
parent 30474e627f
commit e62eb3b068
33 changed files with 537 additions and 167 deletions

View File

@@ -3,7 +3,7 @@
// consoles and laptops use "procssor" item that is held inside machinery piece
/obj/item/modular_computer
name = "Modular Microcomputer"
desc = "A small portable microcomputer"
desc = "A small portable microcomputer."
var/enabled = 0 // Whether the computer is turned on.
var/screen_on = 1 // Whether the computer is active/opened/it's screen is on.
@@ -55,27 +55,27 @@
set src in view(1)
if(usr.incapacitated() || !istype(usr, /mob/living))
usr << "<span class='warning'>You can't do that.</span>"
to_chat(usr, "<span class='warning'>You can't do that.</span>")
return
if(!Adjacent(usr))
usr << "<span class='warning'>You can't reach it.</span>"
to_chat(usr, "<span class='warning'>You can't reach it.</span>")
return
proc_eject_id(usr)
// Eject ID card from computer, if it has ID slot with card inside.
/obj/item/modular_computer/verb/eject_usb()
set name = "Eject Portable Device"
set name = "Eject Portable Storage"
set category = "Object"
set src in view(1)
if(usr.incapacitated() || !istype(usr, /mob/living))
usr << "<span class='warning'>You can't do that.</span>"
to_chat(usr, "<span class='warning'>You can't do that.</span>")
return
if(!Adjacent(usr))
usr << "<span class='warning'>You can't reach it.</span>"
to_chat(usr, "<span class='warning'>You can't reach it.</span>")
return
proc_eject_usb(usr)
@@ -85,11 +85,11 @@
user = usr
if(!card_slot)
user << "\The [src] does not have an ID card slot"
to_chat(user, "\The [src] does not have an ID card slot")
return
if(!card_slot.stored_card)
user << "There is no card in \the [src]"
to_chat(user, "There is no card in \the [src]")
return
if(active_program)
@@ -101,14 +101,15 @@
card_slot.stored_card.forceMove(get_turf(src))
card_slot.stored_card = null
update_uis()
user << "You remove the card from \the [src]"
to_chat(user, "You remove the card from \the [src]")
/obj/item/modular_computer/proc/proc_eject_usb(mob/user)
if(!user)
user = usr
if(!portable_drive)
user << "There is no portable device connected to \the [src]."
to_chat(user, "There is no portable device connected to \the [src].")
return
uninstall_component(user, portable_drive)
@@ -124,19 +125,19 @@
/obj/item/modular_computer/emag_act(var/remaining_charges, var/mob/user)
if(computer_emagged)
user << "\The [src] was already emagged."
to_chat(user, "\The [src] was already emagged.")
return
else
computer_emagged = 1
user << "You emag \the [src]. It's screen briefly shows a \"OVERRIDE ACCEPTED: New software downloads available.\" message."
to_chat(user, "You emag \the [src]. It's screen briefly shows a \"OVERRIDE ACCEPTED: New software downloads available.\" message.")
return 1
/obj/item/modular_computer/examine(var/mob/user)
..()
if(damage > broken_damage)
user << "<span class='danger'>It is heavily damaged!</span>"
to_chat(user, "<span class='danger'>It is heavily damaged!</span>")
else if(damage)
user << "It is damaged."
to_chat(user, "It is damaged.")
/obj/item/modular_computer/New()
START_PROCESSING(SSobj, src)
@@ -235,23 +236,23 @@
var/issynth = issilicon(user) // Robots and AIs get different activation messages.
if(damage > broken_damage)
if(issynth)
user << "You send an activation signal to \the [src], but it responds with an error code. It must be damaged."
to_chat(user, "You send an activation signal to \the [src], but it responds with an error code. It must be damaged.")
else
user << "You press the power button, but the computer fails to boot up, displaying variety of errors before shutting down again."
to_chat(user, "You press the power button, but the computer fails to boot up, displaying variety of errors before shutting down again.")
return
if(processor_unit && ((battery_module && battery_module.battery.charge && battery_module.check_functionality()) || check_power_override())) // Battery-run and charged or non-battery but powered by APC.
if(issynth)
user << "You send an activation signal to \the [src], turning it on"
to_chat(user, "You send an activation signal to \the [src], turning it on")
else
user << "You press the power button and start up \the [src]"
to_chat(user, "You press the power button and start up \the [src]")
enabled = 1
update_icon()
ui_interact(user)
else // Unpowered
if(issynth)
user << "You send an activation signal to \the [src] but it does not respond"
to_chat(user, "You send an activation signal to \the [src] but it does not respond")
else
user << "You press the power button but \the [src] does not respond"
to_chat(user, "You press the power button but \the [src] does not respond")
// Process currently calls handle_power(), may be expanded in future if more things are added.
/obj/item/modular_computer/process()
@@ -418,7 +419,7 @@
P.kill_program(1)
update_uis()
user << "<span class='notice'>Program [P.filename].[P.filetype] with PID [rand(100,999)] has been killed.</span>"
to_chat(user, "<span class='notice'>Program [P.filename].[P.filetype] with PID [rand(100,999)] has been killed.</span>")
if( href_list["PC_runprogram"] )
var/prog = href_list["PC_runprogram"]
@@ -428,7 +429,7 @@
P = hard_drive.find_file_by_name(prog)
if(!P || !istype(P)) // Program not found or it's not executable program.
user << "<span class='danger'>\The [src]'s screen shows \"I/O ERROR - Unable to run program\" warning.</span>"
to_chat(user, "<span class='danger'>\The [src]'s screen shows \"I/O ERROR - Unable to run program\" warning.</span>")
return
P.computer = src
@@ -445,11 +446,11 @@
return
if(idle_threads.len >= processor_unit.max_idle_programs+1)
user << "<span class='notice'>\The [src] displays a \"Maximal CPU load reached. Unable to run another program.\" error</span>"
to_chat(user, "<span class='notice'>\The [src] displays a \"Maximal CPU load reached. Unable to run another program.\" error</span>")
return
if(P.requires_ntnet && !get_ntnet_status(P.requires_ntnet_feature)) // The program requires NTNet connection, but we are not connected to NTNet.
user << "<span class='danger'>\The [src]'s screen shows \"NETWORK ERROR - Unable to connect to NTNet. Please retry. If problem persists contact your system administrator.\" warning.</span>"
to_chat(user, "<span class='danger'>\The [src]'s screen shows \"NETWORK ERROR - Unable to connect to NTNet. Please retry. If problem persists contact your system administrator.\" warning.</span>")
return
if(P.run_program(user))
@@ -493,17 +494,17 @@
if(istype(W, /obj/item/weapon/card/id)) // ID Card, try to insert it.
var/obj/item/weapon/card/id/I = W
if(!card_slot)
user << "You try to insert \the [I] into \the [src], but it does not have an ID card slot installed."
to_chat(user, "You try to insert \the [I] into \the [src], but it does not have an ID card slot installed.")
return
if(card_slot.stored_card)
user << "You try to insert \the [I] into \the [src], but it's ID card slot is occupied."
to_chat(user, "You try to insert \the [I] into \the [src], but it's ID card slot is occupied.")
return
user.drop_from_inventory(I)
card_slot.stored_card = I
I.forceMove(src)
update_uis()
user << "You insert \the [I] into \the [src]."
to_chat(user, "You insert \the [I] into \the [src].")
return
if(istype(W, /obj/item/weapon/paper))
if(!nano_printer)
@@ -514,11 +515,11 @@
if(C.hardware_size <= max_hardware_size)
try_install_component(user, C)
else
user << "This component is too large for \the [src]."
to_chat(user, "This component is too large for \the [src].")
if(W.is_wrench())
var/list/components = get_all_components()
if(components.len)
user << "Remove all components from \the [src] before disassembling it."
to_chat(user, "Remove all components from \the [src] before disassembling it.")
return
new /obj/item/stack/material/steel( get_turf(src.loc), steel_sheet_cost )
src.visible_message("\The [src] has been disassembled by [user].")
@@ -528,23 +529,23 @@
if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(!WT.isOn())
user << "\The [W] is off."
to_chat(user, "\The [W] is off.")
return
if(!damage)
user << "\The [src] does not require repairs."
to_chat(user, "\The [src] does not require repairs.")
return
user << "You begin repairing damage to \the [src]..."
to_chat(user, "You begin repairing damage to \the [src]...")
if(WT.remove_fuel(round(damage/75)) && do_after(usr, damage/10))
damage = 0
user << "You repair \the [src]."
to_chat(user, "You repair \the [src].")
return
if(W.is_screwdriver())
var/list/all_components = get_all_components()
if(!all_components.len)
user << "This device doesn't have any components installed."
to_chat(user, "This device doesn't have any components installed.")
return
var/list/component_names = list()
for(var/obj/item/weapon/computer_hardware/H in all_components)
@@ -578,48 +579,48 @@
// "USB" flash drive.
if(istype(H, /obj/item/weapon/computer_hardware/hard_drive/portable))
if(portable_drive)
user << "This computer's portable drive slot is already occupied by \the [portable_drive]."
to_chat(user, "This computer's portable drive slot is already occupied by \the [portable_drive].")
return
found = 1
portable_drive = H
else if(istype(H, /obj/item/weapon/computer_hardware/hard_drive))
if(hard_drive)
user << "This computer's hard drive slot is already occupied by \the [hard_drive]."
to_chat(user, "This computer's hard drive slot is already occupied by \the [hard_drive].")
return
found = 1
hard_drive = H
else if(istype(H, /obj/item/weapon/computer_hardware/network_card))
if(network_card)
user << "This computer's network card slot is already occupied by \the [network_card]."
to_chat(user, "This computer's network card slot is already occupied by \the [network_card].")
return
found = 1
network_card = H
else if(istype(H, /obj/item/weapon/computer_hardware/nano_printer))
if(nano_printer)
user << "This computer's nano printer slot is already occupied by \the [nano_printer]."
to_chat(user, "This computer's nano printer slot is already occupied by \the [nano_printer].")
return
found = 1
nano_printer = H
else if(istype(H, /obj/item/weapon/computer_hardware/card_slot))
if(card_slot)
user << "This computer's card slot is already occupied by \the [card_slot]."
to_chat(user, "This computer's card slot is already occupied by \the [card_slot].")
return
found = 1
card_slot = H
else if(istype(H, /obj/item/weapon/computer_hardware/battery_module))
if(battery_module)
user << "This computer's battery slot is already occupied by \the [battery_module]."
to_chat(user, "This computer's battery slot is already occupied by \the [battery_module].")
return
found = 1
battery_module = H
else if(istype(H, /obj/item/weapon/computer_hardware/processor_unit))
if(processor_unit)
user << "This computer's processor slot is already occupied by \the [processor_unit]."
to_chat(user, "This computer's processor slot is already occupied by \the [processor_unit].")
return
found = 1
processor_unit = H
if(found)
user << "You install \the [H] into \the [src]"
to_chat(user, "You install \the [H] into \the [src]")
H.holder2 = src
user.drop_from_inventory(H)
H.forceMove(src)
@@ -651,12 +652,12 @@
critical = 1
if(found)
if(user)
user << "You remove \the [H] from \the [src]."
to_chat(user, "You remove \the [H] from \the [src].")
H.forceMove(get_turf(src))
H.holder2 = null
if(critical && enabled)
if(user)
user << "<span class='danger'>\The [src]'s screen freezes for few seconds and then displays an \"HARDWARE ERROR: Critical component disconnected. Please verify component connection and reboot the device. If the problem persists contact technical support for assistance.\" warning.</span>"
to_chat(user, "<span class='danger'>\The [src]'s screen freezes for few seconds and then displays an \"HARDWARE ERROR: Critical component disconnected. Please verify component connection and reboot the device. If the problem persists contact technical support for assistance.\" warning.</span>")
shutdown_computer()
update_icon()
@@ -783,4 +784,4 @@
if(active_program)
return active_program.check_eye(user)
else
return ..()
return ..()

View File

@@ -30,9 +30,9 @@
/obj/item/modular_computer/processor/examine(var/mob/user)
if(damage > broken_damage)
user << "<span class='danger'>It is heavily damaged!</span>"
to_chat(user, "<span class='danger'>It is heavily damaged!</span>")
else if(damage)
user << "It is damaged."
to_chat(user, "It is damaged.")
// Power interaction is handled by our machinery part, due to machinery having APC connection.
/obj/item/modular_computer/processor/handle_power()
@@ -98,7 +98,7 @@
/obj/item/modular_computer/processor/try_install_component(var/mob/living/user, var/obj/item/weapon/computer_hardware/H, var/found = 0)
if(istype(H, /obj/item/weapon/computer_hardware/tesla_link))
if(machinery_computer.tesla_link)
user << "This computer's tesla link slot is already occupied by \the [machinery_computer.tesla_link]."
to_chat(user, "This computer's tesla link slot is already occupied by \the [machinery_computer.tesla_link].")
return
var/obj/item/weapon/computer_hardware/tesla_link/L = H
L.holder = machinery_computer
@@ -130,4 +130,4 @@
// If we have a tesla link on our machinery counterpart, enable it automatically. Lets computer without a battery work.
if(machinery_computer && machinery_computer.tesla_link)
machinery_computer.tesla_link.enabled = 1
..()
..()

View File

@@ -6,5 +6,5 @@
icon_state_menu = "menu"
hardware_flag = PROGRAM_TABLET
max_hardware_size = 1
w_class = 2
light_strength = 2 // Same as PDAs
w_class = ITEMSIZE_SMALL
light_strength = 2 // Same as PDAs

View File

@@ -2,7 +2,7 @@
// Available as custom loadout item, this is literally the worst possible cheap tablet
/obj/item/modular_computer/tablet/preset/custom_loadout/cheap/New()
. = ..()
desc = "A low-end tablet often seen among low ranked station personnel"
desc = "A low-end tablet often seen among low ranked station personnel."
processor_unit = new/obj/item/weapon/computer_hardware/processor_unit/small(src)
battery_module = new/obj/item/weapon/computer_hardware/battery_module/nano(src)
battery_module.charge_to_full()

View File

@@ -1,8 +1,11 @@
// Global var to track modular computers
var/list/global_modular_computers = list()
// Modular Computer - device that runs various programs and operates with hardware
// DO NOT SPAWN THIS TYPE. Use /laptop/ or /console/ instead.
/obj/machinery/modular_computer/
name = "modular computer"
desc = "An advanced computer"
desc = "An advanced computer."
var/battery_powered = 0 // Whether computer should be battery powered. It is set automatically
use_power = 0
@@ -64,7 +67,7 @@
// Eject ID card from computer, if it has ID slot with card inside.
/obj/machinery/modular_computer/verb/eject_usb()
set name = "Eject Portable Device"
set name = "Eject Portable Storage"
set category = "Object"
set src in view(1)
@@ -74,6 +77,7 @@
/obj/machinery/modular_computer/New()
..()
cpu = new(src)
global_modular_computers.Add(src)
/obj/machinery/modular_computer/Destroy()
if(cpu)
@@ -162,9 +166,7 @@
/obj/machinery/modular_computer/power_change()
if(battery_powered)
return
else
..()
update_icon()
..()
/obj/machinery/modular_computer/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if(cpu)
@@ -194,3 +196,4 @@
if(cpu)
return cpu.check_eye(user)
return -1

View File

@@ -15,22 +15,22 @@
set src in view(1)
if(usr.stat || usr.restrained() || usr.lying || !istype(usr, /mob/living))
usr << "<span class='warning'>You can't do that.</span>"
to_chat(usr, "<span class='warning'>You can't do that.</span>")
return
if(!Adjacent(usr))
usr << "You can't reach it."
to_chat(usr, "You can't reach it.")
return
if(!istype(loc,/turf))
usr << "[src] is too bulky! You'll have to set it down."
to_chat(usr, "[src] is too bulky! You'll have to set it down.")
return
if(!stored_computer)
if(contents.len)
for(var/obj/O in contents)
O.forceMove(src.loc)
usr << "\The [src] crumbles to pieces."
to_chat(usr, "\The [src] crumbles to pieces.")
spawn(5)
qdel(src)
return
@@ -41,7 +41,7 @@
if(stored_computer.cpu)
stored_computer.cpu.screen_on = 1
loc = stored_computer
usr << "You open \the [src]."
to_chat(usr, "You open \the [src].")
/obj/item/laptop/AltClick()
@@ -51,7 +51,7 @@
// The actual laptop
/obj/machinery/modular_computer/laptop
name = "laptop computer"
desc = "A portable computer"
desc = "A portable computer."
var/obj/item/laptop/portable = null // Portable version of this computer, dropped on alt-click to allow transport. Used by laptops.
hardware_flag = PROGRAM_LAPTOP
icon_state_unpowered = "laptop-open" // Icon state when the computer is turned off
@@ -78,11 +78,11 @@
set src in view(1)
if(usr.stat || usr.restrained() || usr.lying || !istype(usr, /mob/living))
usr << "<span class='warning'>You can't do that.</span>"
to_chat(usr, "<span class='warning'>You can't do that.</span>")
return
if(!Adjacent(usr))
usr << "<span class='warning'>You can't reach it.</span>"
to_chat(usr, "<span class='warning'>You can't reach it.</span>")
return
close_laptop(usr)
@@ -101,10 +101,10 @@
src.forceMove(portable)
stat |= MAINT
if(user)
user << "You close \the [src]."
to_chat(user, "You close \the [src].")
if(cpu)
cpu.screen_on = 0
/obj/machinery/modular_computer/laptop/AltClick()
if(Adjacent(usr))
close_laptop()
close_laptop()