mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
* Added modular PDA and telescreen They kinda work * Adds a telescreen to box * Cleans up some stuff Left some code in from when I was working on something else, causing the checks to fail. This removes it. * More clean up and an untested fix for computers so they dont runtime if they have an initial program Hope this works. * Hopefully fixes the failed check Forgot about that var. * Makes telescreens machines and more PDA sprites Makes modular telescreens machines, adds more pda program icons, and fixes stuff. * Adds telescreens to more maps and fixes the one on box * Fixes the failed check and cleans up some commented out stuff Forgot about this stuff * Replaces engi and atmos tech phones with modular PDAs Seams reasonable. May atomize it out if people want me to. * Forgot the commit the atmos preset *sigh * Moves telescreens to the machine folder and adds a medical telescreen Moves telescreens to the machine mod pc folder because they are no longer items and adds a medical telescreen that starts with the crew monitor program, though its not on maps yet. * Removed the old telescreen file that didnt get removed thanks github desktop * Forgot about the CMO's computer Though I did this with the medical preset * Adds medical telescreens to most maps * Readds the changes * Forgot to uncomment this *scream * Adds telescreens to mining base and brig infirmary * Everyone gets a telescreen * Forgot the lights * Symmetry * Adds the fixes for delta
73 lines
2.5 KiB
Plaintext
73 lines
2.5 KiB
Plaintext
/obj/machinery/modular_computer/console
|
|
name = "console"
|
|
desc = "A stationary computer."
|
|
|
|
icon = 'icons/obj/modular_console.dmi'
|
|
icon_state = "console"
|
|
icon_state_powered = "console"
|
|
icon_state_unpowered = "console-off"
|
|
screen_icon_state_menu = "menu"
|
|
hardware_flag = PROGRAM_CONSOLE
|
|
density = TRUE
|
|
base_idle_power_usage = 100
|
|
base_active_power_usage = 500
|
|
max_hardware_size = WEIGHT_CLASS_BULKY
|
|
steel_sheet_cost = 10
|
|
light_strength = 2
|
|
max_integrity = 300
|
|
integrity_failure = 150
|
|
var/console_department = "" // Used in New() to set network tag according to our area.
|
|
|
|
/obj/machinery/modular_computer/console/Initialize()
|
|
. = ..()
|
|
var/obj/item/computer_hardware/battery/battery_module = cpu.all_components[MC_CELL]
|
|
if(battery_module)
|
|
qdel(battery_module)
|
|
|
|
var/obj/item/computer_hardware/network_card/wired/network_card = new()
|
|
|
|
cpu.install_component(network_card)
|
|
cpu.install_component(new /obj/item/computer_hardware/recharger/APC)
|
|
cpu.install_component(new /obj/item/computer_hardware/hard_drive/super) // Consoles generally have better HDDs due to lower space limitations
|
|
|
|
var/area/A = get_area(src)
|
|
// Attempts to set this console's tag according to our area. Since some areas have stuff like "XX - YY" in their names we try to remove that too.
|
|
if(A && console_department)
|
|
network_card.identification_string = replacetext(replacetext(replacetext("[A.name] [console_department] Console", " ", "_"), "-", ""), "__", "_") // Replace spaces with "_"
|
|
else if(A)
|
|
network_card.identification_string = replacetext(replacetext(replacetext("[A.name] Console", " ", "_"), "-", ""), "__", "_")
|
|
else if(console_department)
|
|
network_card.identification_string = replacetext(replacetext(replacetext("[console_department] Console", " ", "_"), "-", ""), "__", "_")
|
|
else
|
|
network_card.identification_string = "Unknown Console"
|
|
if(cpu)
|
|
cpu.screen_on = 1
|
|
update_icon()
|
|
|
|
/obj/machinery/modular_computer/console/update_icon()
|
|
. = ..()
|
|
|
|
// this bit of code makes the computer hug the wall its next to
|
|
var/turf/T = get_turf(src)
|
|
var/list/offet_matrix = list(0, 0) // stores offset to be added to the console in following order (pixel_x, pixel_y)
|
|
var/dirlook
|
|
switch(dir)
|
|
if(NORTH)
|
|
offet_matrix[2] = -3
|
|
dirlook = SOUTH
|
|
if(SOUTH)
|
|
offet_matrix[2] = 1
|
|
dirlook = NORTH
|
|
if(EAST)
|
|
offet_matrix[1] = -5
|
|
dirlook = WEST
|
|
if(WEST)
|
|
offet_matrix[1] = 5
|
|
dirlook = EAST
|
|
if(dirlook)
|
|
T = get_step(T, dirlook)
|
|
var/obj/structure/window/W = locate() in T
|
|
if(istype(T, /turf/closed/wall) || W)
|
|
pixel_x = offet_matrix[1]
|
|
pixel_y = offet_matrix[2]
|