diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index 9ff136fabb3..ca30de7a0d9 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -4,36 +4,37 @@ icon_state = "arcade" icon_keyboard = null icon_screen = "invaders" - clicksound = null //Gets too spammy and makes no sense for arcade to have the console keyboard noise anyway - var/list/prizes = list( /obj/item/storage/box/snappops = 2, - /obj/item/toy/blink = 2, - /obj/item/clothing/under/syndicate/tacticool = 2, - /obj/item/toy/sword = 2, - /obj/item/gun/projectile/revolver/capgun = 2, - /obj/item/toy/crossbow = 2, - /obj/item/clothing/suit/syndicatefake = 2, - /obj/item/storage/fancy/crayons = 2, - /obj/item/toy/spinningtoy = 2, - /obj/item/toy/prize/ripley = 1, - /obj/item/toy/prize/fireripley = 1, - /obj/item/toy/prize/deathripley = 1, - /obj/item/toy/prize/gygax = 1, - /obj/item/toy/prize/durand = 1, - /obj/item/toy/prize/honk = 1, - /obj/item/toy/prize/marauder = 1, - /obj/item/toy/prize/seraph = 1, - /obj/item/toy/prize/mauler = 1, - /obj/item/toy/prize/odysseus = 1, - /obj/item/toy/prize/phazon = 1, - /obj/item/toy/waterflower = 1, - /obj/random/action_figure = 1, - /obj/random/plushie = 1, - /obj/item/toy/cultsword = 1, - /obj/item/toy/bouquet/fake = 1, - /obj/item/clothing/accessory/badge/sheriff = 2, - /obj/item/clothing/head/cowboy_hat/small = 2, - /obj/item/toy/stickhorse = 2 - ) + clicksound = null // Gets too spammy and makes no sense for arcade to have the console keyboard noise anyway + var/list/prizes = list( + /obj/item/storage/box/snappops = 2, + /obj/item/toy/blink = 2, + /obj/item/clothing/under/syndicate/tacticool = 2, + /obj/item/toy/sword = 2, + /obj/item/gun/projectile/revolver/capgun = 2, + /obj/item/toy/crossbow = 2, + /obj/item/clothing/suit/syndicatefake = 2, + /obj/item/storage/fancy/crayons = 2, + /obj/item/toy/spinningtoy = 2, + /obj/item/toy/prize/ripley = 1, + /obj/item/toy/prize/fireripley = 1, + /obj/item/toy/prize/deathripley = 1, + /obj/item/toy/prize/gygax = 1, + /obj/item/toy/prize/durand = 1, + /obj/item/toy/prize/honk = 1, + /obj/item/toy/prize/marauder = 1, + /obj/item/toy/prize/seraph = 1, + /obj/item/toy/prize/mauler = 1, + /obj/item/toy/prize/odysseus = 1, + /obj/item/toy/prize/phazon = 1, + /obj/item/toy/waterflower = 1, + /obj/random/action_figure = 1, + /obj/random/plushie = 1, + /obj/item/toy/cultsword = 1, + /obj/item/toy/bouquet/fake = 1, + /obj/item/clothing/accessory/badge/sheriff = 2, + /obj/item/clothing/head/cowboy_hat/small = 2, + /obj/item/toy/stickhorse = 2 + ) /obj/machinery/computer/arcade/Initialize(mapload) . = ..() diff --git a/code/game/machinery/computer/atmos_control.dm b/code/game/machinery/computer/atmos_control.dm index f3102ec982c..d55cf42a403 100644 --- a/code/game/machinery/computer/atmos_control.dm +++ b/code/game/machinery/computer/atmos_control.dm @@ -14,15 +14,17 @@ var/list/monitored_alarm_ids = null var/datum/tgui_module/atmos_control/atmos_control -/obj/machinery/computer/atmoscontrol/laptop - name = "Atmospherics Laptop" - desc = "A cheap laptop." - icon_screen = "atmoslaptop" - icon_state = "laptop" - icon_keyboard = "laptop_key" +/obj/machinery/computer/atmoscontrol/laptop //TODO: Change name to PCU and update mapdata to include replacement computers + name = "\improper Atmospherics PCU" + desc = "A personal computer unit. It seems to have only the Atmosphereics Control program installed." + icon_screen = "pcu_atmo" + icon_state = "pcu_engi" + icon_keyboard = "pcu_key" density = FALSE + light_color = "#00cc00" + density = 0 -/obj/machinery/computer/atmoscontrol/attack_ai(var/mob/user as mob) +/obj/machinery/computer/atmoscontrol/attack_ai(mob/user) ui_interact(user) /obj/machinery/computer/atmoscontrol/attack_hand(mob/user) @@ -30,10 +32,11 @@ return TRUE ui_interact(user) -/obj/machinery/computer/atmoscontrol/emag_act(var/remaining_carges, var/mob/user) +/obj/machinery/computer/atmoscontrol/emag_act(remaining_carges, mob/user) if(!emagged) - user.visible_message(SPAN_WARNING("\The [user] does something \the [src], causing the screen to flash!"),\ - SPAN_WARNING("You cause the screen to flash as you gain full control."),\ + user.visible_message( \ + SPAN_WARNING("\The [user] does something \the [src], causing the screen to flash!"), \ + SPAN_WARNING("You cause the screen to flash as you gain full control."), \ "You hear an electronic warble.") atmos_control.emagged = TRUE return TRUE diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index 909375a4151..d6acf7ae47e 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -1,13 +1,14 @@ /obj/machinery/computer name = "computer" - icon = 'icons/obj/computer_vr.dmi' + icon = 'icons/obj/computer.dmi' icon_state = "computer" - density = 1 - anchored = 1.0 + density = TRUE + anchored = TRUE use_power = USE_POWER_IDLE idle_power_usage = 300 active_power_usage = 300 - var/processing = 0 + //blocks_emissive = FALSE + var/processing = FALSE var/icon_keyboard = "generic_key" var/icon_screen = "generic" @@ -25,8 +26,8 @@ /obj/machinery/computer/process(delta_time) if(stat & (NOPOWER|BROKEN)) - return 0 - return 1 + return FALSE + return TRUE /obj/machinery/computer/emp_act(severity) if(prob(20/severity)) set_broken() @@ -63,22 +64,41 @@ ex_act(2) /obj/machinery/computer/update_icon() - overlays.Cut() - if(stat & NOPOWER) - set_light(0) - if(icon_keyboard) - overlays += image(icon,"[icon_keyboard]_off", overlay_layer) - return - else - set_light(light_range_on, light_power_on) + cut_overlays() + + . = list() + + // Connecty //TODO: Use TG Smoothing. + if(initial(icon_state) == "computer") + var/append_string = "" + var/left = turn(dir, 90) + var/right = turn(dir, -90) + var/turf/L = get_step(src, left) + var/turf/R = get_step(src, right) + var/obj/machinery/computer/LC = locate() in L + var/obj/machinery/computer/RC = locate() in R + if(LC && LC.dir == dir && initial(LC.icon_state) == "computer") + append_string += "_L" + if(RC && RC.dir == dir && initial(RC.icon_state) == "computer") + append_string += "_R" + icon_state = "computer[append_string]" - if(stat & BROKEN) - overlays += image(icon,"[icon_state]_broken", overlay_layer) - else - overlays += image(icon,icon_screen, overlay_layer) if(icon_keyboard) - overlays += image(icon, icon_keyboard, overlay_layer) + if(stat & NOPOWER) + playsound(src, 'sound/machines/terminal_off.ogg', 50, 1) + return add_overlay("[icon_keyboard]_off") + . += icon_keyboard + + // This whole block lets screens ignore lighting and be visible even in the darkest room + var/overlay_state = icon_screen + if(stat & BROKEN) + overlay_state = "[icon_state]_broken" + . += mutable_appearance(icon, overlay_state) + //. += emissive_appearance(icon, overlay_state) + playsound(src, 'sound/machines/terminal_on.ogg', 50, 1) + + add_overlay(.) /obj/machinery/computer/power_change() ..() @@ -88,7 +108,6 @@ else set_light(light_range_on, light_power_on) - /obj/machinery/computer/proc/set_broken() stat |= BROKEN update_icon() diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index 2c0c4c7a085..7ab5d867e69 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -494,14 +494,15 @@ ..(severity) -/obj/machinery/computer/med_data/laptop - name = "Medical Laptop" - desc = "A cheap laptop." - icon_state = "laptop" - icon_keyboard = "laptop_key" - icon_screen = "medlaptop" - throwpass = 1 //VOREStation Edit - Really??? - density = FALSE //THIS IS A LAPTOP. --CITADEL EDIT +/obj/machinery/computer/med_data/laptop //TODO: Change name to PCU and update mapdata to include replacement computers + name = "\improper Medical Laptop" + desc = "A personal computer unit. It seems to have only the medical records program installed." + icon_screen = "pcu_generic" + icon_state = "pcu_med" + icon_keyboard = "pcu_key" + light_color = "#5284e7" + circuit = /obj/item/circuitboard/med_data/pcu + density = FALSE #undef FIELD diff --git a/code/game/machinery/computer/skills.dm b/code/game/machinery/computer/skills.dm index f6bf06482bf..546e711f7bc 100644 --- a/code/game/machinery/computer/skills.dm +++ b/code/game/machinery/computer/skills.dm @@ -4,16 +4,16 @@ #define FIELD(N, V, E) list(field = N, value = V, edit = E) -/obj/machinery/computer/skills//TODO:SANITY - name = "employment records console" - desc = "Used to view, edit and maintain employment records." - icon_state = "laptop" - icon_keyboard = "laptop_key" - icon_screen = "medlaptop" - light_color = "#00b000" +/obj/machinery/computer/skills//TODO:SANITY //TODO2: Change name to PCU and update mapdata to include replacement computers + name = "\improper Employment Records PCU" + desc = "A personal computer unit that's used to view, edit and maintain employment records." + icon_screen = "pcu_generic" + icon_state = "pcu" + icon_keyboard = "pcu_key" + light_color = "#5284e7" req_one_access = list(access_heads) - circuit = /obj/item/circuitboard/skills - density = 0 + circuit = /obj/item/circuitboard/skills/pcu + density = FALSE var/obj/item/card/id/scan = null var/authenticated = null var/rank = null @@ -22,7 +22,7 @@ var/a_id = null var/list/temp = null var/printing = null - var/can_change_id = 0 + var/can_change_id = FALSE // The below are used to make modal generation more convenient var/static/list/field_edit_questions var/static/list/field_edit_choices diff --git a/code/game/objects/items/weapons/circuitboards/computer/computer.dm b/code/game/objects/items/weapons/circuitboards/computer/computer.dm index 35417d7fe3b..79a5716fc19 100644 --- a/code/game/objects/items/weapons/circuitboards/computer/computer.dm +++ b/code/game/objects/items/weapons/circuitboards/computer/computer.dm @@ -21,8 +21,8 @@ name = T_BOARD("medical records console") build_path = /obj/machinery/computer/med_data -/obj/item/circuitboard/med_data/laptop - name = T_BOARD("medical records laptop") +/obj/item/circuitboard/med_data/pcu + name = T_BOARD("medical records PCU") build_path = /obj/machinery/computer/med_data/laptop /obj/item/circuitboard/scan_consolenew @@ -52,8 +52,8 @@ name = T_BOARD("security records console") build_path = /obj/machinery/computer/secure_data -/obj/item/circuitboard/skills - name = T_BOARD("employment records console") +/obj/item/circuitboard/skills/pcu + name = T_BOARD("employment records PCU") build_path = /obj/machinery/computer/skills /obj/item/circuitboard/stationalert_engineering diff --git a/code/modules/modular_computers/computers/modular_computer/core.dm b/code/modules/modular_computers/computers/modular_computer/core.dm index d7c74758283..9ac67d87080 100644 --- a/code/modules/modular_computers/computers/modular_computer/core.dm +++ b/code/modules/modular_computers/computers/modular_computer/core.dm @@ -1,13 +1,14 @@ /obj/item/modular_computer/process(delta_time) if(!enabled) // The computer is turned off last_power_usage = 0 - return 0 + return FALSE if(damage > broken_damage) shutdown_computer() - return 0 + return FALSE - if(active_program && active_program.requires_ntnet && !get_ntnet_status(active_program.requires_ntnet_feature)) // Active program requires NTNet to run but we've just lost connection. Crash. + // Active program requires NTNet to run but we've just lost connection. Crash. + if(active_program && active_program.requires_ntnet && !get_ntnet_status(active_program.requires_ntnet_feature)) active_program.event_networkfailure(0) for(var/datum/computer_file/program/P in idle_threads) @@ -33,13 +34,13 @@ handle_power() // Handles all computer power interaction check_update_ui_need() -// Used to perform preset-specific hardware changes. +/// Used to perform preset-specific hardware changes. /obj/item/modular_computer/proc/install_default_hardware() - return 1 + return TRUE -// Used to install preset-specific programs +/// Used to install preset-specific programs /obj/item/modular_computer/proc/install_default_programs() - return 1 + return TRUE /obj/item/modular_computer/Initialize(mapload) . = ..() @@ -63,9 +64,9 @@ to_chat(user, "\The [src] was already emagged.") return //NO_EMAG_ACT else - computer_emagged = 1 + computer_emagged = TRUE to_chat(user, "You emag \the [src]. It's screen briefly shows a \"OVERRIDE ACCEPTED: New software downloads available.\" message.") - return 1 + return TRUE /obj/item/modular_computer/update_icon() icon_state = icon_state_unpowered @@ -87,11 +88,11 @@ else overlays.Add(icon_state_menu) -/obj/item/modular_computer/proc/turn_on(var/mob/user) +/obj/item/modular_computer/proc/turn_on(mob/user) if(bsod) return if(tesla_link) - tesla_link.enabled = 1 + tesla_link.enabled = TRUE var/issynth = issilicon(user) // Robots and AIs get different activation messages. if(damage > broken_damage) if(issynth) @@ -112,8 +113,8 @@ else to_chat(user, "You press the power button but \the [src] does not respond") -// Relays kill program request to currently active program. Use this to quit current program. -/obj/item/modular_computer/proc/kill_program(var/forced = 0) +/// Relays kill program request to currently active program. Use this to quit current program. +/obj/item/modular_computer/proc/kill_program(forced = FALSE) if(active_program) active_program.kill_program(forced) active_program = null @@ -123,28 +124,28 @@ update_icon() // Returns 0 for No Signal, 1 for Low Signal and 2 for Good Signal. 3 is for wired connection (always-on) -/obj/item/modular_computer/proc/get_ntnet_status(var/specific_action = 0) +/obj/item/modular_computer/proc/get_ntnet_status(specific_action = 0) if(network_card) return network_card.get_signal(specific_action) else - return 0 + return FALSE -/obj/item/modular_computer/proc/add_log(var/text) +/obj/item/modular_computer/proc/add_log(text) if(!get_ntnet_status()) - return 0 + return FALSE return ntnet_global.add_log(text, network_card) -/obj/item/modular_computer/proc/shutdown_computer(var/loud = 1) +/obj/item/modular_computer/proc/shutdown_computer(loud = TRUE) kill_program(1) for(var/datum/computer_file/program/P in idle_threads) P.kill_program(1) idle_threads.Remove(P) if(loud) visible_message("\The [src] shuts down.") - enabled = 0 + enabled = FALSE update_icon() -/obj/item/modular_computer/proc/enable_computer(var/mob/user = null) +/obj/item/modular_computer/proc/enable_computer(mob/user = null) enabled = 1 update_icon() @@ -169,7 +170,6 @@ if(istype(user)) nano_ui_interact(user) // Re-open the UI on this computer. It should show the main screen now. - /obj/item/modular_computer/proc/run_program(prog) var/datum/computer_file/program/P = null var/mob/user = usr @@ -177,7 +177,7 @@ P = hard_drive.find_file_by_name(prog) if(!P || !istype(P)) // Program not found or it's not executable program. - to_chat(user, "\The [src]'s screen shows \"I/O ERROR - Unable to run [prog]\" warning.") + to_chat(user, SPAN_DANGER("\The [src]'s screen shows \"I/O ERROR - Unable to run [prog]\" warning.")) return P.computer = src @@ -192,11 +192,11 @@ return if(idle_threads.len >= processor_unit.max_idle_programs+1) - to_chat(user, "\The [src] displays a \"Maximal CPU load reached. Unable to run another program.\" error") + to_chat(user, SPAN_NOTICE("\The [src] displays a \"Maximal CPU load reached. Unable to run another program.\" error")) return if(P.requires_ntnet && !get_ntnet_status(P.requires_ntnet_feature)) // The program requires NTNet connection, but we are not connected to NTNet. - to_chat(user, "\The [src]'s screen shows \"NETWORK ERROR - Unable to connect to NTNet. Please retry. If problem persists contact your system administrator.\" warning.") + to_chat(user, SPAN_DANGER("\The [src]'s screen shows \"NETWORK ERROR - Unable to connect to NTNet. Please retry. If problem persists contact your system administrator.\" warning.")) return if(active_program) @@ -204,7 +204,7 @@ if(P.run_program(user)) update_icon() - return 1 + return TRUE /obj/item/modular_computer/proc/update_uis() if(active_program) //Should we update program ui or computer ui? @@ -215,16 +215,16 @@ SSnanoui.update_uis(src) /obj/item/modular_computer/proc/check_update_ui_need() - var/ui_update_needed = 0 + var/ui_update_needed = FALSE if(battery_module) var/batery_percent = battery_module.battery.percent() if(last_battery_percent != batery_percent) //Let's update UI on percent change - ui_update_needed = 1 + ui_update_needed = TRUE last_battery_percent = batery_percent if(stationtime2text() != last_world_time) last_world_time = stationtime2text() - ui_update_needed = 1 + ui_update_needed = TRUE if(idle_threads.len) var/list/current_header_icons = list() @@ -237,25 +237,25 @@ else if(!(last_header_icons ~= current_header_icons)) last_header_icons = current_header_icons - ui_update_needed = 1 + ui_update_needed = TRUE else for(var/x in last_header_icons|current_header_icons) if(last_header_icons[x]!=current_header_icons[x]) last_header_icons = current_header_icons - ui_update_needed = 1 + ui_update_needed = TRUE break if(ui_update_needed) update_uis() // Used by camera monitor program -/obj/item/modular_computer/check_eye(var/mob/user) +/obj/item/modular_computer/check_eye(mob/user) if(active_program) return active_program.check_eye(user) else return ..() -/obj/item/modular_computer/relaymove(var/mob/user, direction) +/obj/item/modular_computer/relaymove(mob/user, direction) if(active_program) return active_program.relaymove(user, direction) diff --git a/code/modules/modular_computers/computers/modular_computer/damage.dm b/code/modules/modular_computers/computers/modular_computer/damage.dm index c1ad60059a5..b72b5acfe56 100644 --- a/code/modules/modular_computers/computers/modular_computer/damage.dm +++ b/code/modules/modular_computers/computers/modular_computer/damage.dm @@ -1,7 +1,7 @@ /obj/item/modular_computer/examine(mob/user) . = ..() if(damage > broken_damage) - . += "It is heavily damaged!" + . += SPAN_DANGER("It is heavily damaged!") else if(damage) . += "It is damaged." @@ -16,7 +16,7 @@ H.take_damage(rand(10,30)) qdel() -/obj/item/modular_computer/take_damage(var/amount, var/component_probability, var/damage_casing = 1, var/randomize = 1) +/obj/item/modular_computer/take_damage(amount, component_probability, damage_casing = TRUE, randomize = TRUE) if(randomize) // 75%-125%, rand() works with integers, apparently. amount *= (rand(75, 125) / 100.0) @@ -33,19 +33,23 @@ if(damage >= max_damage) break_apart() -// Stronger explosions cause serious damage to internal components -// Minor explosions are mostly mitigitated by casing. -/obj/item/modular_computer/ex_act(var/severity) +/** + * Stronger explosions cause serious damage to internal components + * Minor explosions are mostly mitigitated by casing. + */ +/obj/item/modular_computer/ex_act(severity) take_damage(rand(100,200) / severity, 30 / severity) -// EMPs are similar to explosions, but don't cause physical damage to the casing. Instead they screw up the components -/obj/item/modular_computer/emp_act(var/severity) +/// EMPs are similar to explosions, but don't cause physical damage to the casing. Instead they screw up the components +/obj/item/modular_computer/emp_act(severity) take_damage(rand(100,200) / severity, 50 / severity, 0) -// "Stun" weapons can cause minor damage to components (short-circuits?) -// "Burn" damage is equally strong against internal components and exterior casing -// "Brute" damage mostly damages the casing. -/obj/item/modular_computer/bullet_act(var/obj/item/projectile/Proj) +/** + * "Stun" weapons can cause minor damage to components (short-circuits?) + * "Burn" damage is equally strong against internal components and exterior casing + * "Brute" damage mostly damages the casing. + */ +/obj/item/modular_computer/bullet_act(obj/item/projectile/Proj) switch(Proj.damage_type) if(BRUTE) take_damage(Proj.damage, Proj.damage / 2) diff --git a/code/modules/modular_computers/computers/modular_computer/hardware.dm b/code/modules/modular_computers/computers/modular_computer/hardware.dm index a9c941aac41..ac4ef98741d 100644 --- a/code/modules/modular_computers/computers/modular_computer/hardware.dm +++ b/code/modules/modular_computers/computers/modular_computer/hardware.dm @@ -1,53 +1,53 @@ -// Attempts to install the hardware into apropriate slot. -/obj/item/modular_computer/proc/try_install_component(var/mob/living/user, var/obj/item/computer_hardware/H, var/found = 0) +/// Attempts to install the hardware into apropriate slot. +/obj/item/modular_computer/proc/try_install_component(mob/living/user, obj/item/computer_hardware/H, found = FALSE) // "USB" flash drive. if(istype(H, /obj/item/computer_hardware/hard_drive/portable)) if(portable_drive) to_chat(user, "This computer's portable drive slot is already occupied by \the [portable_drive].") return - found = 1 + found = TRUE portable_drive = H else if(istype(H, /obj/item/computer_hardware/hard_drive)) if(hard_drive) to_chat(user, "This computer's hard drive slot is already occupied by \the [hard_drive].") return - found = 1 + found = TRUE hard_drive = H else if(istype(H, /obj/item/computer_hardware/network_card)) if(network_card) to_chat(user, "This computer's network card slot is already occupied by \the [network_card].") return - found = 1 + found = TRUE network_card = H else if(istype(H, /obj/item/computer_hardware/nano_printer)) if(nano_printer) to_chat(user, "This computer's nano printer slot is already occupied by \the [nano_printer].") return - found = 1 + found = TRUE nano_printer = H else if(istype(H, /obj/item/computer_hardware/card_slot)) if(card_slot) to_chat(user, "This computer's card slot is already occupied by \the [card_slot].") return - found = 1 + found = TRUE card_slot = H else if(istype(H, /obj/item/computer_hardware/battery_module)) if(battery_module) to_chat(user, "This computer's battery slot is already occupied by \the [battery_module].") return - found = 1 + found = TRUE battery_module = H else if(istype(H, /obj/item/computer_hardware/processor_unit)) if(processor_unit) to_chat(user, "This computer's processor slot is already occupied by \the [processor_unit].") return - found = 1 + found = TRUE processor_unit = H else if(istype(H, /obj/item/computer_hardware/tesla_link)) if(tesla_link) to_chat(user, "This computer's tesla link slot is already occupied by \the [tesla_link].") return - found = 1 + found = TRUE tesla_link = H if(found) to_chat(user, "You install \the [H] into \the [src]") @@ -56,34 +56,34 @@ H.forceMove(src) update_verbs() -// Uninstalls component. Found and Critical vars may be passed by parent types, if they have additional hardware. -/obj/item/modular_computer/proc/uninstall_component(var/mob/living/user, var/obj/item/computer_hardware/H, var/found = 0, var/critical = 0) +/// Uninstalls component. Found and Critical vars may be passed by parent types, if they have additional hardware. +/obj/item/modular_computer/proc/uninstall_component(mob/living/user, obj/item/computer_hardware/H, found = FALSE, critical = FALSE) if(portable_drive == H) portable_drive = null - found = 1 + found = TRUE if(hard_drive == H) hard_drive = null - found = 1 - critical = 1 + found = TRUE + critical = TRUE if(network_card == H) network_card = null - found = 1 + found = TRUE if(nano_printer == H) nano_printer = null - found = 1 + found = TRUE if(card_slot == H) card_slot = null - found = 1 + found = TRUE if(battery_module == H) battery_module = null - found = 1 + found = TRUE if(processor_unit == H) processor_unit = null - found = 1 - critical = 1 + found = TRUE + critical = TRUE if(tesla_link == H) tesla_link = null - found = 1 + found = TRUE if(found) if(user) to_chat(user, "You remove \the [H] from \the [src].") @@ -92,13 +92,13 @@ update_verbs() if(critical && enabled) if(user) - to_chat(user, "\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.") + to_chat(user, SPAN_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.")) shutdown_computer() update_icon() -// Checks all hardware pieces to determine if name matches, if yes, returns the hardware piece, otherwise returns null -/obj/item/modular_computer/proc/find_hardware_by_name(var/name) +/// Checks all hardware pieces to determine if name matches, if yes, returns the hardware piece, otherwise returns null. +/obj/item/modular_computer/proc/find_hardware_by_name(name) if(portable_drive && (portable_drive.name == name)) return portable_drive if(hard_drive && (hard_drive.name == name)) @@ -117,7 +117,7 @@ return tesla_link return null -// Returns list of all components +/// Returns list of all components. /obj/item/modular_computer/proc/get_all_components() var/list/all_components = list() if(hard_drive) diff --git a/code/modules/modular_computers/computers/modular_computer/interaction.dm b/code/modules/modular_computers/computers/modular_computer/interaction.dm index aa7f9cbd0da..407638d6f17 100644 --- a/code/modules/modular_computers/computers/modular_computer/interaction.dm +++ b/code/modules/modular_computers/computers/modular_computer/interaction.dm @@ -13,20 +13,20 @@ set src in view(1) if(usr.incapacitated() || !istype(usr, /mob/living)) - to_chat(usr, "You can't do that.") + to_chat(usr, SPAN_WARNING("You can't do that.")) return if(!Adjacent(usr)) - to_chat(usr, "You can't reach it.") + to_chat(usr, SPAN_WARNING("You can't reach it.")) return if(enabled) - bsod = 1 + bsod = TRUE update_icon() shutdown_computer() to_chat(usr, "You press a hard-reset button on \the [src]. It displays a brief debug screen before shutting down.") spawn(2 SECONDS) - bsod = 0 + bsod = FALSE update_icon() @@ -37,11 +37,11 @@ set src in view(1) if(usr.incapacitated() || !istype(usr, /mob/living)) - to_chat(usr, "You can't do that.") + to_chat(usr, SPAN_WARNING("You can't do that.")) return if(!Adjacent(usr)) - to_chat(usr, "You can't reach it.") + to_chat(usr, SPAN_WARNING("You can't reach it.")) return proc_eject_id(usr) @@ -53,11 +53,11 @@ set src in view(1) if(usr.incapacitated() || !istype(usr, /mob/living)) - to_chat(usr, "You can't do that.") + to_chat(usr, SPAN_WARNING("You can't do that.")) return if(!Adjacent(usr)) - to_chat(usr, "You can't reach it.") + to_chat(usr, SPAN_WARNING("You can't reach it.")) return proc_eject_usb(usr) @@ -97,31 +97,31 @@ uninstall_component(user, portable_drive) update_uis() -/obj/item/modular_computer/attack_ghost(var/mob/observer/ghost/user) +/obj/item/modular_computer/attack_ghost(mob/observer/ghost/user) . = ..() if(enabled) nano_ui_interact(user) else if(check_rights(R_ADMIN, 0, user)) - var/response = alert(user, "This computer is turned off. Would you like to turn it on?", "Admin Override", "Yes", "No") + var/response = tgui_alert(user, "This computer is turned off. Would you like to turn it on?", "Admin Override", list("Yes", "No")) if(response == "Yes") turn_on(user) -/obj/item/modular_computer/attack_ai(var/mob/user) +/obj/item/modular_computer/attack_ai(mob/user) return attack_self(user) -/obj/item/modular_computer/attack_hand(var/mob/user) +/obj/item/modular_computer/attack_hand(mob/user) if(anchored) return attack_self(user) return ..() -// On-click handling. Turns on the computer if it's off and opens the GUI. -/obj/item/modular_computer/attack_self(var/mob/user) +/// On-click handling. Turns on the computer if it's off and opens the GUI. +/obj/item/modular_computer/attack_self(mob/user) if(enabled && screen_on) nano_ui_interact(user) else if(!enabled && screen_on) turn_on(user) -/obj/item/modular_computer/attackby(var/obj/item/W as obj, var/mob/user as mob) +/obj/item/modular_computer/attackby(obj/item/W, mob/user) if(istype(W, /obj/item/card/id)) // ID Card, try to insert it. var/obj/item/card/id/I = W if(!card_slot) @@ -181,7 +181,7 @@ for(var/obj/item/computer_hardware/H in all_components) component_names.Add(H.name) - var/choice = input(usr, "Which component do you want to uninstall?", "Computer maintenance", null) as null|anything in component_names + var/choice = tgui_input_list(user, "Which component do you want to uninstall?", "Computer maintenance", component_names) if(!choice) return diff --git a/code/modules/modular_computers/computers/modular_computer/power.dm b/code/modules/modular_computers/computers/modular_computer/power.dm index 0a2962669db..efc5efb33ae 100644 --- a/code/modules/modular_computers/computers/modular_computer/power.dm +++ b/code/modules/modular_computers/computers/modular_computer/power.dm @@ -1,14 +1,14 @@ -/obj/item/modular_computer/proc/power_failure(var/malfunction = 0) +/obj/item/modular_computer/proc/power_failure(malfunction = FALSE) if(enabled) // Shut down the computer - visible_message("\The [src]'s screen flickers briefly and then goes dark.") + visible_message(SPAN_DANGER("\The [src]'s screen flickers briefly and then goes dark.")) if(active_program) active_program.event_powerfailure(0) for(var/datum/computer_file/program/PRG in idle_threads) PRG.event_powerfailure(1) shutdown_computer(0) -// Tries to use power from battery. Passing 0 as parameter results in this proc returning whether battery is functional or not. -/obj/item/modular_computer/proc/battery_power(var/power_usage = 0) +/// Tries to use power from battery. Passing 0 as parameter results in this proc returning whether battery is functional or not. +/obj/item/modular_computer/proc/battery_power(power_usage = 0) apc_powered = FALSE if(!battery_module || !battery_module.check_functionality() || battery_module.battery.charge <= 0) return FALSE @@ -16,8 +16,8 @@ return TRUE return FALSE -// Tries to use power from APC, if present. -/obj/item/modular_computer/proc/apc_power(var/power_usage = 0) +/// Tries to use power from APC, if present. +/obj/item/modular_computer/proc/apc_power(power_usage = 0) apc_powered = TRUE // Tesla link was originally limited to machinery only, but this probably works too, and the benefit of being able to power all devices from an APC outweights // the possible minor performance loss. @@ -35,7 +35,7 @@ A.use_power_oneoff(power_usage, EQUIP) return TRUE -// Handles power-related things, such as battery interaction, recharging, shutdown when it's discharged +/// Handles power-related things, such as battery interaction, recharging, shutdown when it's discharged /obj/item/modular_computer/proc/handle_power() var/power_usage = screen_on ? base_active_power_usage : base_idle_power_usage for(var/obj/item/computer_hardware/H in get_all_components()) diff --git a/code/modules/modular_computers/computers/modular_computer/ui.dm b/code/modules/modular_computers/computers/modular_computer/ui.dm index c2332be85b5..e397b4a9dec 100644 --- a/code/modules/modular_computers/computers/modular_computer/ui.dm +++ b/code/modules/modular_computers/computers/modular_computer/ui.dm @@ -1,5 +1,5 @@ // Operates NanoUI -/obj/item/modular_computer/nano_ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) +/obj/item/modular_computer/nano_ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1) if(!screen_on || !enabled) if(ui) ui.close() diff --git a/code/modules/modular_computers/computers/modular_computer/variables.dm b/code/modules/modular_computers/computers/modular_computer/variables.dm index 034c6b6b744..6dd9e0f7c73 100644 --- a/code/modules/modular_computers/computers/modular_computer/variables.dm +++ b/code/modules/modular_computers/computers/modular_computer/variables.dm @@ -4,50 +4,83 @@ name = "Modular Computer" desc = "A modular computer. You shouldn't see this." - 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/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 // Last tick power usage of this computer - var/last_battery_percent = 0 // Used for deciding if battery percentage has chandged + /// Whether the computer is turned on. + var/enabled = FALSE + /// Whether the computer is active/opened/it's screen is on. + var/screen_on = TRUE + /// A currently active program running on the computer. + var/datum/computer_file/program/active_program = null + /// A flag that describes this device type. + var/hardware_flag = 0 + /// Last tick power usage of this computer. + var/last_power_usage = 0 + /// Used for deciding if battery percentage has chandged. + var/last_battery_percent = 0 var/last_world_time = "00:00" var/list/last_header_icons - var/computer_emagged = FALSE // Whether the computer is emagged. - var/apc_powered = FALSE // Set automatically. Whether the computer used APC power last tick. - var/base_active_power_usage = 50 // Power usage when the computer is open (screen is active) and can be interacted with. Remember hardware can use power too. - var/base_idle_power_usage = 5 // Power usage when the computer is idle and screen is off (currently only applies to laptops) - var/bsod = FALSE // Error screen displayed + /// Whether the computer is emagged. + var/computer_emagged = FALSE + /// Set automatically. Whether the computer used APC power last tick. + var/apc_powered = FALSE + /// Power usage when the computer is open (screen is active) and can be interacted with. Remember hardware can use power too. + var/base_active_power_usage = 50 + /// Power usage when the computer is idle and screen is off. (currently only applies to laptops) + var/base_idle_power_usage = 5 + /// Error screen displayed. + var/bsod = FALSE // Modular computers can run on various devices. Each DEVICE (Laptop, Console, Tablet,..) // must have it's own DMI file. Icon states must be called exactly the same in all files, but may look differently // If you create a program which is limited to Laptops and Consoles you don't have to add it's icon_state overlay for Tablets too, for example. - icon = null // This thing isn't meant to be used on it's own. Subtypes should supply their own icon. + /// This thing isn't meant to be used on it's own. Subtypes should supply their own icon. + icon = null icon_state = null - //center_of_mass = null // No pixelshifting by placing on tables, etc. - //randpixel = 0 // And no random pixelshifting on-creation either. - var/icon_state_unpowered = null // Icon state when the computer is turned off - var/icon_state_menu = "menu" // Icon state overlay when the computer is turned on, but no program is loaded that would override the screen. + /// No pixelshifting by placing on tables, etc. + //center_of_mass = null + /// And no random pixelshifting on-creation either. + //randpixel = 0 + + /// Icon state when the computer is turned off. + var/icon_state_unpowered = null + /// Icon state overlay when the computer is turned on, but no program is loaded that would override the screen. + var/icon_state_menu = "menu" var/icon_state_screensaver = null - var/max_hardware_size = 0 // Maximal hardware size. Currently, tablets have 1, laptops 2 and consoles 3. Limits what hardware types can be installed. - var/steel_sheet_cost = 5 // Amount of steel sheets refunded when disassembling an empty frame of this computer. - var/light_strength = 0 // Intensity of light this computer emits. Comparable to numbers light fixtures use. - var/list/idle_threads = list() // Idle programs on background. They still receive process calls but can't be interacted with. + /// Maximal hardware size. Currently, tablets have 1, laptops 2 and consoles 3. Limits what hardware types can be installed. + var/max_hardware_size = 0 + /// Amount of steel sheets refunded when disassembling an empty frame of this computer. + var/steel_sheet_cost = 5 + /// Intensity of light this computer emits. Comparable to numbers light fixtures use. + var/light_strength = 0 + /// Idle programs on background. They still receive process calls but can't be interacted with. + var/list/idle_threads = list() - // Damage of the chassis. If the chassis takes too much damage it will break apart. - var/damage = 0 // Current damage level - var/broken_damage = 50 // Damage level at which the computer ceases to operate - var/max_damage = 100 // Damage level at which the computer breaks apart. + //! Damage of the chassis. If the chassis takes too much damage it will break apart. + /// Current damage level. + var/damage = 0 + /// Damage level at which the computer ceases to operate. + var/broken_damage = 50 + /// Damage level at which the computer breaks apart. + var/max_damage = 100 - // Important hardware (must be installed for computer to work) - var/obj/item/computer_hardware/processor_unit/processor_unit // CPU. Without it the computer won't run. Better CPUs can run more programs at once. - var/obj/item/computer_hardware/network_card/network_card // Network Card component of this computer. Allows connection to NTNet - var/obj/item/computer_hardware/hard_drive/hard_drive // Hard Drive component of this computer. Stores programs and files. + //! Important hardware (must be installed for computer to work) + /// CPU. Without it the computer won't run. Better CPUs can run more programs at once. + var/obj/item/computer_hardware/processor_unit/processor_unit + /// Network Card component of this computer. Allows connection to NTNet. + var/obj/item/computer_hardware/network_card/network_card + /// Hard Drive component of this computer. Stores programs and files. + var/obj/item/computer_hardware/hard_drive/hard_drive - // Optional hardware (improves functionality, but is not critical for computer to work in most cases) - var/obj/item/computer_hardware/battery_module/battery_module // An internal power source for this computer. Can be recharged. - var/obj/item/computer_hardware/card_slot/card_slot // ID Card slot component of this computer. Mostly for HoP modification console that needs ID slot for modification. - var/obj/item/computer_hardware/nano_printer/nano_printer // Nano Printer component of this computer, for your everyday paperwork needs. - var/obj/item/computer_hardware/hard_drive/portable/portable_drive // Portable data storage - var/obj/item/computer_hardware/ai_slot/ai_slot // AI slot, an intellicard housing that allows modifications of AIs. - var/obj/item/computer_hardware/tesla_link/tesla_link // Tesla Link, Allows remote charging from nearest APC. + //! Optional hardware (improves functionality, but is not critical for computer to work in most cases) + /// An internal power source for this computer. Can be recharged. + var/obj/item/computer_hardware/battery_module/battery_module + /// ID Card slot component of this computer. Mostly for HoP modification console that needs ID slot for modification. + var/obj/item/computer_hardware/card_slot/card_slot + /// Nano Printer component of this computer, for your everyday paperwork needs. + var/obj/item/computer_hardware/nano_printer/nano_printer + /// Portable data storage. + var/obj/item/computer_hardware/hard_drive/portable/portable_drive + /// AI slot, an intellicard housing that allows modifications of AIs. + var/obj/item/computer_hardware/ai_slot/ai_slot + /// Tesla Link, Allows remote charging from nearest APC. + var/obj/item/computer_hardware/tesla_link/tesla_link diff --git a/code/modules/modular_computers/computers/subtypes/dev_console.dm b/code/modules/modular_computers/computers/subtypes/dev_console.dm index a895b35e8cb..6d480233d73 100644 --- a/code/modules/modular_computers/computers/subtypes/dev_console.dm +++ b/code/modules/modular_computers/computers/subtypes/dev_console.dm @@ -1,14 +1,14 @@ /obj/item/modular_computer/console name = "console" desc = "A stationary computer." - icon = 'icons/obj/modular_console_vr.dmi' //VOREStation Edit + icon = 'icons/obj/modular_console.dmi' icon_state = "console" icon_state_unpowered = "console" icon_state_screensaver = "standby" icon_state_menu = "menu" hardware_flag = PROGRAM_CONSOLE anchored = TRUE - density = 1 + density = TRUE base_idle_power_usage = 100 base_active_power_usage = 500 max_hardware_size = 3 @@ -16,3 +16,21 @@ light_strength = 4 max_damage = 300 broken_damage = 150 + +/obj/item/modular_computer/console/update_icon() + . = ..() + + // Connecty //TODO: Use TG Smoothing. + if(initial(icon_state) == "console") + var/append_string = "" + var/left = turn(dir, -90) + var/right = turn(dir, 90) + var/turf/L = get_step(src, left) + var/turf/R = get_step(src, right) + var/obj/item/modular_computer/console/LC = locate() in L + var/obj/item/modular_computer/console/RC = locate() in R + if(LC && LC.dir == dir && initial(LC.icon_state) == "console") + append_string += "_L" + if(RC && RC.dir == dir && initial(RC.icon_state) == "console") + append_string += "_R" + icon_state = "console[append_string]" diff --git a/code/modules/modular_computers/computers/subtypes/dev_tablet.dm b/code/modules/modular_computers/computers/subtypes/dev_tablet.dm index 83e8d90b6ae..54b2d559065 100644 --- a/code/modules/modular_computers/computers/subtypes/dev_tablet.dm +++ b/code/modules/modular_computers/computers/subtypes/dev_tablet.dm @@ -8,7 +8,7 @@ hardware_flag = PROGRAM_TABLET max_hardware_size = 1 w_class = ITEMSIZE_SMALL - light_strength = 2 // Same as PDAs + light_strength = 2 // Same as PDAs /obj/item/modular_computer/tablet/lease desc = "A small portable microcomputer. This one has a gold and blue stripe, and a serial number stamped into the case." diff --git a/code/modules/modular_computers/file_system/computer_file.dm b/code/modules/modular_computers/file_system/computer_file.dm index 475dc220dc7..0e5b45a1219 100644 --- a/code/modules/modular_computers/file_system/computer_file.dm +++ b/code/modules/modular_computers/file_system/computer_file.dm @@ -1,13 +1,20 @@ var/global/file_uid = 0 -/datum/computer_file/ - var/filename = "NewFile" // Placeholder. No spacebars - 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/uid // UID of this file +/datum/computer_file + /// Placeholder. No spacebars + var/filename = "NewFile" + /// File full names are [filename].[filetype] so like NewFile.XXX in this case. + var/filetype = "XXX" + /// File size in GQ. Integers only! + var/size = 1 + /// Holder that contains this file. + var/obj/item/computer_hardware/hard_drive/holder + /// Whether the file may be sent to someone via NTNet transfer or other means. + var/unsendable = FALSE + /// Whether the file may be deleted. Setting to 1 prevents deletion/renaming/etc. + var/undeletable = FALSE + /// UID of this file. + var/uid /datum/computer_file/New() ..() @@ -25,7 +32,7 @@ var/global/file_uid = 0 holder = null ..() -// Returns independent copy of this file. +/// Returns independent copy of this file. /datum/computer_file/proc/clone(var/rename = 0) var/datum/computer_file/temp = new type temp.unsendable = unsendable @@ -36,4 +43,4 @@ var/global/file_uid = 0 else temp.filename = filename temp.filetype = filetype - return temp + return temp diff --git a/code/modules/modular_computers/file_system/data.dm b/code/modules/modular_computers/file_system/data.dm index 7ad48bea54b..70bb3560d04 100644 --- a/code/modules/modular_computers/file_system/data.dm +++ b/code/modules/modular_computers/file_system/data.dm @@ -1,17 +1,22 @@ -// /data/ files store data in string format. -// They don't contain other logic for now. +/** + * /data/ files store data in string format. + * They don't contain other logic for now. + */ /datum/computer_file/data - var/stored_data = "" // Stored data in string format. filetype = "DAT" + /// Whether the user will be reminded that the file probably shouldn't be edited. + var/do_not_edit = 0 + /// Stored data in string format. + var/stored_data = "" + /// The file size of this bit of data. var/block_size = 250 - var/do_not_edit = 0 // Whether the user will be reminded that the file probably shouldn't be edited. /datum/computer_file/data/clone() var/datum/computer_file/data/temp = ..() temp.stored_data = stored_data return temp -// Calculates file size from amount of characters in saved string +/// Calculates file size from amount of characters in saved string /datum/computer_file/data/proc/calculate_size() size = max(1, round(length(stored_data) / block_size)) diff --git a/code/modules/modular_computers/file_system/news_article.dm b/code/modules/modular_computers/file_system/news_article.dm index 217dae58d0b..07c924a4738 100644 --- a/code/modules/modular_computers/file_system/news_article.dm +++ b/code/modules/modular_computers/file_system/news_article.dm @@ -1,13 +1,20 @@ -// /data/ files store data in string format. -// They don't contain other logic for now. +/** + * /data/ files store data in string format. + * They don't contain other logic for now. + */ /datum/computer_file/data/news_article filetype = "XNML" filename = "Unknown News Entry" - block_size = 5000 // Results in smaller files - do_not_edit = 1 // Editing the file breaks most formatting due to some HTML tags not being accepted as input from average user. - var/server_file_path // File path to HTML file that will be loaded on server start. Example: '/news_articles/space_magazine_1.html'. Use the /news_articles/ folder! - var/archived // Set to 1 for older stuff - var/cover //filename of cover. + /// Results in smaller files. + block_size = 5000 + /// Editing the file breaks most formatting due to some HTML tags not being accepted as input from average user. + do_not_edit = 1 + /// File path to HTML file that will be loaded on server start. Example: '/news_articles/space_magazine_1.html'. Use the /news_articles/ folder! + var/server_file_path + /// Set to 1 for older stuff. + var/archived + /// Filename of cover. + var/cover /datum/computer_file/data/news_article/New(var/load_from_file = 0) ..() @@ -16,7 +23,7 @@ calculate_size() -// NEWS DEFINITIONS BELOW THIS LINE +//! ## NEWS DEFINITIONS BELOW THIS LINE /* KEPT HERE AS AN EXAMPLE /datum/computer_file/data/news_article/space/vol_one filename = "SPACE Magazine vol. 1" diff --git a/code/modules/modular_computers/file_system/program.dm b/code/modules/modular_computers/file_system/program.dm index 9959189010c..25684e81650 100644 --- a/code/modules/modular_computers/file_system/program.dm +++ b/code/modules/modular_computers/file_system/program.dm @@ -1,36 +1,64 @@ // /program/ files are executable programs that do things. /datum/computer_file/program filetype = "PRG" - filename = "UnknownProgram" // File name. FILE NAME MUST BE UNIQUE IF YOU WANT THE PROGRAM TO BE DOWNLOADABLE FROM NTNET! - var/required_access = null // List of required accesses to run/download the program. - var/requires_access_to_run = 1 // Whether the program checks for required_access when run. - var/requires_access_to_download = 1 // Whether the program checks for required_access when downloading. - //nanoui - var/datum/nano_module/NM = null // If the program uses NanoModule, put it here and it will be automagically opened. Otherwise implement nano_ui_interact. - var/nanomodule_path = null // Path to nanomodule, make sure to set this if implementing new program. - // t gui - var/datum/tgui_module/TM = null // If the program uses TGUIModule, put it here and it will be automagically opened. Otherwise implement ui_interact. - var/tguimodule_path = null // Path to tguimodule, make sure to set this if implementing new program. - // misc program stuff - var/program_state = PROGRAM_STATE_KILLED// PROGRAM_STATE_KILLED or PROGRAM_STATE_BACKGROUND or PROGRAM_STATE_ACTIVE - specifies whether this program is running. - var/obj/item/modular_computer/computer // Device that runs this program. - var/filedesc = "Unknown Program" // User-friendly name of this program. - var/extended_desc = "N/A" // Short description of this program's function. - var/program_icon_state = null // Program-specific screen icon state - var/program_key_state = "standby_key" // Program-specific keyboard icon state - var/program_menu_icon = "newwin" // Icon to use for program's link in main menu - var/requires_ntnet = 0 // Set to 1 for program to require nonstop NTNet connection to run. If NTNet connection is lost program crashes. - var/requires_ntnet_feature = 0 // Optional, if above is set to 1 checks for specific function of NTNet (currently NTNET_SOFTWAREDOWNLOAD, NTNET_PEERTOPEER, NTNET_SYSTEMCONTROL and NTNET_COMMUNICATION) - var/ntnet_status = 1 // NTNet status, updated every tick by computer running this program. Don't use this for checks if NTNet works, computers do that. Use this for calculations, etc. - var/usage_flags = PROGRAM_ALL // Bitflags (PROGRAM_CONSOLE, PROGRAM_LAPTOP, PROGRAM_TABLET combination) or PROGRAM_ALL - var/network_destination = null // Optional string that describes what NTNet server/system this program connects to. Used in default logging. - var/available_on_ntnet = 1 // Whether the program can be downloaded from NTNet. Set to 0 to disable. - var/available_on_syndinet = 0 // Whether the program can be downloaded from SyndiNet (accessible via emagging the computer). Set to 1 to enable. - var/computer_emagged = 0 // Set to 1 if computer that's running us was emagged. Computer updates this every Process() tick - var/ui_header = null // Example: "something.gif" - a header image that will be rendered in computer's UI when this program is running at background. Images are taken from /nano/images/status_icons. Be careful not to use too large images! - var/ntnet_speed = 0 // GQ/s - current network connectivity transfer rate + //! File name. FILE NAME MUST BE UNIQUE IF YOU WANT THE PROGRAM TO BE DOWNLOADABLE FROM NTNET! + filename = "UnknownProgram" + /// List of required accesses to run/download the program. + var/required_access = null + /// Whether the program checks for required_access when run. + var/requires_access_to_run = TRUE + /// Whether the program checks for required_access when downloading. + var/requires_access_to_download = TRUE -/datum/computer_file/program/New(var/obj/item/modular_computer/comp = null) +//! ## Nanoui + /// If the program uses NanoModule, put it here and it will be automagically opened. Otherwise implement nano_ui_interact. + var/datum/nano_module/NM = null + /// Path to nanomodule, make sure to set this if implementing new program. + var/nanomodule_path = null + +//! ## TGUI + /// If the program uses TGUIModule, put it here and it will be automagically opened. Otherwise implement ui_interact. + var/datum/tgui_module/TM = null + /// Path to tguimodule, make sure to set this if implementing new program. + var/tguimodule_path = null + +//! ## Misc Program Stuff + /// PROGRAM_STATE_KILLED or PROGRAM_STATE_BACKGROUND or PROGRAM_STATE_ACTIVE - specifies whether this program is running. + var/program_state = PROGRAM_STATE_KILLED + /// Device that runs this program. + var/obj/item/modular_computer/computer + /// User-friendly name of this program. + var/filedesc = "Unknown Program" + /// Short description of this program's function. + var/extended_desc = "N/A" + /// Program-specific screen icon state. + var/program_icon_state = null + /// Program-specific keyboard icon state. + var/program_key_state = "standby_key" + /// Icon to use for program's link in main menu. + var/program_menu_icon = "newwin" + /// Set to TRUE for program to require nonstop NTNet connection to run. If NTNet connection is lost program crashes. + var/requires_ntnet = FALSE + /// Optional, if above is set to TRUE checks for specific function of NTNet (currently NTNET_SOFTWAREDOWNLOAD, NTNET_PEERTOPEER, NTNET_SYSTEMCONTROL and NTNET_COMMUNICATION) + var/requires_ntnet_feature = FALSE + /// NTNet status, updated every tick by computer running this program. Don't use this for checks if NTNet works, computers do that. Use this for calculations, etc. + var/ntnet_status = 1 + /// Bitflags (PROGRAM_CONSOLE, PROGRAM_LAPTOP, PROGRAM_TABLET combination) or PROGRAM_ALL + var/usage_flags = PROGRAM_ALL + /// Optional string that describes what NTNet server/system this program connects to. Used in default logging. + var/network_destination = null + /// Whether the program can be downloaded from NTNet. Set to FALSE to disable. + var/available_on_ntnet = TRUE + /// Whether the program can be downloaded from SyndiNet (accessible via emagging the computer). Set to TRUE to enable. + var/available_on_syndinet = FALSE + /// Set to TRUE if computer that's running us was emagged. Computer updates this every Process() tick + var/computer_emagged = FALSE + /// Example: "something.gif" - a header image that will be rendered in computer's UI when this program is running at background. Images are taken from /nano/images/status_icons. Be careful not to use too large images! + var/ui_header = null + /// GQ/s - current network connectivity transfer rate. + var/ntnet_speed = 0 + +/datum/computer_file/program/New(obj/item/modular_computer/comp = null) ..() if(comp && istype(comp)) computer = comp @@ -53,33 +81,33 @@ temp.usage_flags = usage_flags return temp -// Relays icon update to the computer. +/// Relays icon update to the computer. /datum/computer_file/program/proc/update_computer_icon() if(computer) computer.update_icon() -// Attempts to create a log in global ntnet datum. Returns 1 on success, 0 on fail. -/datum/computer_file/program/proc/generate_network_log(var/text) +/// Attempts to create a log in global ntnet datum. Returns TRUE on success, FALSE on fail. +/datum/computer_file/program/proc/generate_network_log(text) if(computer) return computer.add_log(text) - return 0 + return FALSE -/datum/computer_file/program/proc/is_supported_by_hardware(var/hardware_flag = 0, var/loud = 0, var/mob/user = null) +/datum/computer_file/program/proc/is_supported_by_hardware(hardware_flag = 0, loud = FALSE, mob/user = null) if(!(hardware_flag & usage_flags)) if(loud && computer && user) - to_chat(user, "\The [computer] flashes: \"Hardware Error - Incompatible software\".") - return 0 - return 1 + to_chat(user, SPAN_WARNING("\The [computer] flashes: \"Hardware Error - Incompatible software\".")) + return FALSE + return TRUE -/datum/computer_file/program/proc/get_signal(var/specific_action = 0) +/datum/computer_file/program/proc/get_signal(specific_action = 0) if(computer) return computer.get_ntnet_status(specific_action) - return 0 + return FALSE -// Called by Process() on device that runs us, once every tick. +/// Called by Process() on device that runs us, once every tick. /datum/computer_file/program/proc/process_tick() update_netspeed() - return 1 + return TRUE /datum/computer_file/program/proc/update_netspeed() ntnet_speed = 0 @@ -91,44 +119,50 @@ if(3) ntnet_speed = NTNETSPEED_ETHERNET -// Check if the user can run program. Only humans can operate computer. Automatically called in run_program() -// User has to wear their ID or have it inhand for ID Scan to work. -// Can also be called manually, with optional parameter being access_to_check to scan the user's ID -/datum/computer_file/program/proc/can_run(var/mob/living/user, var/loud = 0, var/access_to_check) +/** + * Check if the user can run program. Only humans can operate computer. Automatically called in run_program() + * User has to wear their ID or have it inhand for ID Scan to work. + * Can also be called manually, with optional parameter being access_to_check to scan the user's ID + */ +/datum/computer_file/program/proc/can_run(mob/living/user, loud = FALSE, access_to_check) // Defaults to required_access if(!access_to_check) access_to_check = required_access if(!access_to_check) // No required_access, allow it. - return 1 + return TRUE // Admin override - allows operation of any computer as aghosted admin, as if you had any required access. if(istype(user, /mob/observer/dead) && check_rights(R_ADMIN, 0, user)) - return 1 + return TRUE if(!istype(user)) - return 0 + return FALSE var/obj/item/card/id/I = user.GetIdCard() if(!I) if(loud) - to_chat(user, "\The [computer] flashes an \"RFID Error - Unable to scan ID\" warning.") - return 0 + to_chat(user, SPAN_NOTICE("\The [computer] flashes an \"RFID Error - Unable to scan ID\" warning.")) + return FALSE if(access_to_check in I.access) - return 1 + return TRUE else if(loud) - to_chat(user, "\The [computer] flashes an \"Access Denied\" warning.") + to_chat(user, SPAN_NOTICE("\The [computer] flashes an \"Access Denied\" warning.")) -// This attempts to retrieve header data for NanoUIs. 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. +/** + * This attempts to retrieve header data for NanoUIs. 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. + */ /datum/computer_file/program/proc/get_header_data() if(computer) return computer.get_header_data() return list() -// This is performed on program startup. May be overriden to add extra logic. Remember to include ..() call. Return 1 on success, 0 on failure. -// When implementing new program based device, use this to run the program. -/datum/computer_file/program/proc/run_program(var/mob/living/user) +/** + * This is performed on program startup. May be overriden to add extra logic. Remember to include ..() call. Return 1 on success, 0 on failure. + * When implementing new program based device, use this to run the program. + */ +/datum/computer_file/program/proc/run_program(mob/living/user) if(can_run(user, 1) || !requires_access_to_run) computer.active_program = src if(nanomodule_path) @@ -141,11 +175,11 @@ if(requires_ntnet && network_destination) generate_network_log("Connection opened to [network_destination].") program_state = PROGRAM_STATE_ACTIVE - return 1 - return 0 + return TRUE + return FALSE -// Use this proc to kill the program. Designed to be implemented by each program if it requires on-quit logic, such as the NTNRC client. -/datum/computer_file/program/proc/kill_program(var/forced = 0) +/// Use this proc to kill the program. Designed to be implemented by each program if it requires on-quit logic, such as the NTNRC client. +/datum/computer_file/program/proc/kill_program(forced = FALSE) program_state = PROGRAM_STATE_KILLED if(network_destination) generate_network_log("Connection to [network_destination] closed.") @@ -154,37 +188,42 @@ SStgui.close_uis(TM) qdel(TM) TM = null - return 1 + return TRUE -// This is called every tick when the program is enabled. Ensure you do parent call if you override it. If parent returns 1 continue with UI initialisation. -// It returns 0 if it can't run or if NanoModule was used instead. I suggest using NanoModules where applicable. -/datum/computer_file/program/nano_ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) +/** + * This is called every tick when the program is enabled. Ensure you do parent call if you override it. If parent returns TRUE continue with UI initialisation. + * It returns FALSE if it can't run or if NanoModule was used instead. I suggest using NanoModules where applicable. + */ +/datum/computer_file/program/nano_ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, force_open = TRUE) if(program_state != PROGRAM_STATE_ACTIVE) // Our program was closed. Close the ui if it exists. if(ui) ui.close() return computer.nano_ui_interact(user) if(istype(NM)) NM.nano_ui_interact(user, ui_key, null, force_open) - return 0 + return FALSE if(istype(TM)) TM.ui_interact(user) - return 0 - return 1 + return FALSE + return TRUE - -// CONVENTIONS, READ THIS WHEN CREATING NEW PROGRAM AND OVERRIDING THIS PROC: -// Topic calls are automagically forwarded from NanoModule this program contains. -// Calls beginning with "PRG_" are reserved for programs handling. -// Calls beginning with "PC_" are reserved for computer handling (by whatever runs the program) -// ALWAYS INCLUDE PARENT CALL ..() OR DIE IN FIRE. +/** + *! CONVENTIONS, READ THIS WHEN CREATING NEW PROGRAM AND OVERRIDING THIS PROC: + * + * Topic calls are automagically forwarded from NanoModule this program contains. + * Calls beginning with "PRG_" are reserved for programs handling. + * Calls beginning with "PC_" are reserved for computer handling (by whatever runs the program) + * + *! ALWAYS INCLUDE PARENT CALL ..() OR DIE IN FIRE. + */ /datum/computer_file/program/Topic(href, href_list) if(..()) return 1 if(computer) return computer.Topic(href, href_list) -// Relays the call to nano module, if we have one -/datum/computer_file/program/proc/check_eye(var/mob/user) +/// Relays the call to nano module, if we have one +/datum/computer_file/program/proc/check_eye(mob/user) if(NM) return NM.check_eye(user) else @@ -197,25 +236,28 @@ return TRUE /datum/nano_module/program + /// Program-Based computer program that runs this nano module. Defaults to null. + var/datum/computer_file/program/program = null //available_to_ai = FALSE - var/datum/computer_file/program/program = null // Program-Based computer program that runs this nano module. Defaults to null. -/datum/nano_module/program/New(var/host, var/topic_manager, var/program) +/datum/nano_module/program/New(host, topic_manager, program) ..() src.program = program /datum/topic_manager/program var/datum/program -/datum/topic_manager/program/New(var/datum/program) +/datum/topic_manager/program/New(datum/program) ..() src.program = program -// Calls forwarded to PROGRAM itself should begin with "PRG_" -// Calls forwarded to COMPUTER running the program should begin with "PC_" +/** + * Calls forwarded to PROGRAM itself should begin with "PRG_" + * Calls forwarded to COMPUTER running the program should begin with "PC_" + */ /datum/topic_manager/program/Topic(href, href_list) return program && program.Topic(href, href_list) -/datum/computer_file/program/proc/relaymove(var/mob/M, direction) +/datum/computer_file/program/proc/relaymove(mob/M, direction) if(NM) return NM.relaymove(M, direction) diff --git a/code/modules/modular_computers/file_system/program_events.dm b/code/modules/modular_computers/file_system/program_events.dm index ef1eac09aa9..02d196ba618 100644 --- a/code/modules/modular_computers/file_system/program_events.dm +++ b/code/modules/modular_computers/file_system/program_events.dm @@ -1,18 +1,20 @@ -// Events are sent to the program by the computer. -// Always include a parent call when overriding an event. +/** + * Events are sent to the program by the computer. + * Always include a parent call when overriding an event. + */ -// Called when the ID card is removed from computer. ID is removed AFTER this proc. -/datum/computer_file/program/proc/event_idremoved(var/background) +/// Called when the ID card is removed from computer. ID is removed AFTER this proc. +/datum/computer_file/program/proc/event_idremoved(background) return -// Called when the computer fails due to power loss. Override when program wants to specifically react to power loss. -/datum/computer_file/program/proc/event_powerfailure(var/background) +/// Called when the computer fails due to power loss. Override when program wants to specifically react to power loss. +/datum/computer_file/program/proc/event_powerfailure(background) kill_program(1) -// Called when the network connectivity fails. Computer does necessary checks and only calls this when requires_ntnet_feature and similar variables are not met. -/datum/computer_file/program/proc/event_networkfailure(var/background) +/// Called when the network connectivity fails. Computer does necessary checks and only calls this when requires_ntnet_feature and similar variables are not met. +/datum/computer_file/program/proc/event_networkfailure(background) kill_program(1) if(background) - computer.visible_message("\The [computer]'s screen displays an error: \"Network connectivity lost - process [filename].[filetype] (PID [rand(100,999)]) terminated.\"") + computer.visible_message(SPAN_WARNING("\The [computer]'s screen displays an error: \"Network connectivity lost - process [filename].[filetype] (PID [rand(100,999)]) terminated.\"")) else - computer.visible_message("\The [computer]'s screen briefly freezes and then shows: \"FATAL NETWORK ERROR - NTNet connection lost. Please try again later. If problem persists, please contact your system administrator.\"") + computer.visible_message(SPAN_WARNING("\The [computer]'s screen briefly freezes and then shows: \"FATAL NETWORK ERROR - NTNet connection lost. Please try again later. If problem persists, please contact your system administrator.\"")) diff --git a/code/modules/modular_computers/hardware/_hardware.dm b/code/modules/modular_computers/hardware/_hardware.dm index c54de210e4b..ba94a62a8b9 100644 --- a/code/modules/modular_computers/hardware/_hardware.dm +++ b/code/modules/modular_computers/hardware/_hardware.dm @@ -3,15 +3,24 @@ desc = "Unknown Hardware." icon = 'icons/obj/modular_components.dmi' var/obj/item/modular_computer/holder2 = null - var/power_usage = 0 // If the hardware uses extra power, change this. - var/enabled = 1 // If the hardware is turned off set this to 0. - var/critical = 1 // Prevent disabling for important component, like the HDD. - var/hardware_size = 1 // Limits which devices can contain this component. 1: Tablets/Laptops/Consoles, 2: Laptops/Consoles, 3: Consoles only - var/damage = 0 // Current damage level - var/max_damage = 100 // Maximal damage level. - var/damage_malfunction = 20 // "Malfunction" threshold. When damage exceeds this value the hardware piece will semi-randomly fail and do !!FUN!! things - var/damage_failure = 50 // "Failure" threshold. When damage exceeds this value the hardware piece will not work at all. - var/malfunction_probability = 10// Chance of malfunction when the component is damaged + /// If the hardware uses extra power, change this. + var/power_usage = 0 + /// If the hardware is turned off set this to FALSE. + var/enabled = TRUE + /// Prevent disabling for important component, like the HDD. + var/critical = 1 + /// Limits which devices can contain this component. 1: Tablets/Laptops/Consoles, 2: Laptops/Consoles, 3: Consoles only. + var/hardware_size = 1 + /// Current damage level. + var/damage = 0 + /// Maximal damage level. + var/max_damage = 100 + /// "Malfunction" threshold. When damage exceeds this value the hardware piece will semi-randomly fail and do !!FUN!! things. + var/damage_malfunction = 20 + /// "Failure" threshold. When damage exceeds this value the hardware piece will not work at all. + var/damage_failure = 50 + /// Chance of malfunction when the component is damaged. + var/malfunction_probability = 10 /obj/item/computer_hardware/attackby(var/obj/item/W as obj, var/mob/living/user as mob) // Multitool. Runs diagnostics @@ -19,30 +28,30 @@ to_chat(user, "***** DIAGNOSTICS REPORT *****") diagnostics(user) to_chat(user, "******************************") - return 1 + return TRUE // Nanopaste. Repair all damage if present for a single unit. var/obj/item/stack/S = W if(istype(S, /obj/item/stack/nanopaste)) if(!damage) to_chat(user, "\The [src] doesn't seem to require repairs.") - return 1 + return TRUE if(S.use(1)) to_chat(user, "You apply a bit of \the [W] to \the [src]. It immediately repairs all damage.") damage = 0 - return 1 + return TRUE // Cable coil. Works as repair method, but will probably require multiple applications and more cable. if(istype(S, /obj/item/stack/cable_coil)) if(!damage) to_chat(user, "\The [src] doesn't seem to require repairs.") - return 1 + return TRUE if(S.use(1)) to_chat(user, "You patch up \the [src] with a bit of \the [W].") take_damage(-10) - return 1 + return TRUE return ..() -// Called on multitool click, prints diagnostic information to the user. +/// 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"]") @@ -56,31 +65,31 @@ holder2 = null return ..() -// Handles damage checks +/// Handles damage checks. /obj/item/computer_hardware/proc/check_functionality() // Turned off if(!enabled) - return 0 + return FALSE // Too damaged to work at all. if(damage > damage_failure) - return 0 + return FALSE // Still working. Well, sometimes... if(damage > damage_malfunction) if(prob(malfunction_probability)) - return 0 + return FALSE // Good to go. - return 1 + return TRUE /obj/item/computer_hardware/examine(mob/user) . = ..() if(damage > damage_failure) - . += "It seems to be severely damaged!" + . += SPAN_DANGER("It seems to be severely damaged!") else if(damage > damage_malfunction) - . += "It seems to be damaged!" + . += SPAN_NOTICE("It seems to be damaged!") else if(damage) . += "It seems to be slightly damaged." // Damages the component. Contains necessary checks. Negative damage "heals" the component. -/obj/item/computer_hardware/take_damage(var/amount) - damage += round(amount) // We want nice rounded numbers here. - damage = between(0, damage, max_damage) // Clamp the value. +/obj/item/computer_hardware/take_damage(amount) + damage += round(amount) // We want nice rounded numbers here. + damage = between(0, damage, max_damage) // Clamp the value. diff --git a/code/modules/overmap/bluespace_rift.dm b/code/modules/overmap/bluespace_rift.dm index 3f708c5028b..dbec34f3075 100644 --- a/code/modules/overmap/bluespace_rift.dm +++ b/code/modules/overmap/bluespace_rift.dm @@ -5,8 +5,8 @@ icon_state = "portal" color = "#2288FF" - known = 0 // Shows up on nav computers automatically - scannable = TRUE // If set to TRUE will show up on ship sensors for detailed scans + known = 0 // Shows up on nav computers automatically + scannable = TRUE // If set to TRUE will show up on ship sensors for detailed scans var/obj/effect/overmap/bluespace_rift/partner var/paused @@ -16,29 +16,29 @@ if(new_partner) pair(new_partner) -/obj/effect/overmap/bluespace_rift/proc/pair(var/obj/effect/overmap/bluespace_rift/new_partner) +/obj/effect/overmap/bluespace_rift/proc/pair(obj/effect/overmap/bluespace_rift/new_partner) if(istype(new_partner)) partner = new_partner new_partner.partner = src -/obj/effect/overmap/bluespace_rift/proc/take_this(var/atom/movable/AM) +/obj/effect/overmap/bluespace_rift/proc/take_this(atom/movable/AM) paused = TRUE AM.forceMove(get_turf(src)) paused = FALSE -/obj/effect/overmap/bluespace_rift/Crossed(var/atom/movable/AM) +/obj/effect/overmap/bluespace_rift/Crossed(atom/movable/AM) if(istype(AM, /obj/effect/overmap/visitable/ship) && !paused && partner) partner.take_this(AM) else return ..() -/obj/effect/overmap/bluespace_rift/attack_ghost(var/mob/observer/dead/user) +/obj/effect/overmap/bluespace_rift/attack_ghost(mob/observer/dead/user) if(!partner && user?.client?.holder) - var/response = alert(user, "You appear to be staff. This rift has no exit point. If you want to make one, move to where you want it to go, and click 'Make Here', otherwise click 'Cancel'","Rift Exit","Cancel","Make Here") + var/response = tgui_alert(user, "You appear to be staff. This rift has no exit point. If you want to make one, move to where you want it to go, and click 'Make Here', otherwise click 'Cancel'", "Bluespace Rift", list("Cancel","Make Here")) if(response == "Make Here") new type(get_turf(user), src) else if(partner) user.forceMove(get_turf(partner)) - to_chat(user, "Your ghostly form is pulled through the rift!") + to_chat(user, SPAN_NOTICE("Your ghostly form is pulled through the rift!")) else return ..() diff --git a/code/modules/overmap/bluespace_rift_vr.dm b/code/modules/overmap/bluespace_rift_vr.dm deleted file mode 100644 index 91abc32ad8f..00000000000 --- a/code/modules/overmap/bluespace_rift_vr.dm +++ /dev/null @@ -1,44 +0,0 @@ -/obj/effect/overmap/bluespace_rift - name = "bluespace rift" - desc = "Some sort of bluespace rift. Who knows where it leads?" - icon = 'icons/obj/overmap_vr.dmi' - icon_state = "portal" - color = "#2288FF" - - known = 0 //shows up on nav computers automatically - scannable = TRUE //if set to TRUE will show up on ship sensors for detailed scans - - var/obj/effect/overmap/bluespace_rift/partner - var/paused - -/obj/effect/overmap/bluespace_rift/Initialize(mapload, new_partner) - . = ..() - if(new_partner) - pair(new_partner) - -/obj/effect/overmap/bluespace_rift/proc/pair(var/obj/effect/overmap/bluespace_rift/new_partner) - if(istype(new_partner)) - partner = new_partner - new_partner.partner = src - -/obj/effect/overmap/bluespace_rift/proc/take_this(var/atom/movable/AM) - paused = TRUE - AM.forceMove(get_turf(src)) - paused = FALSE - -/obj/effect/overmap/bluespace_rift/Crossed(var/atom/movable/AM) - if(istype(AM, /obj/effect/overmap/visitable/ship) && !paused && partner) - partner.take_this(AM) - else - return ..() - -/obj/effect/overmap/bluespace_rift/attack_ghost(var/mob/observer/dead/user) - if(!partner && user?.client?.holder) - var/response = alert(user, "You appear to be staff. This rift has no exit point. If you want to make one, move to where you want it to go, and click 'Make Here', otherwise click 'Cancel'","Rift Exit","Cancel","Make Here") - if(response == "Make Here") - new type(get_turf(user), src) - else if(partner) - user.forceMove(get_turf(partner)) - to_chat(user, "Your ghostly form is pulled through the rift!") - else - return ..() diff --git a/code/modules/overmap/disperser/disperser_console.dm b/code/modules/overmap/disperser/disperser_console.dm index 2f94800dece..443a89566f4 100644 --- a/code/modules/overmap/disperser/disperser_console.dm +++ b/code/modules/overmap/disperser/disperser_console.dm @@ -2,7 +2,7 @@ /obj/machinery/computer/ship/disperser name = "obstruction removal ballista control" - icon = 'icons/obj/computer_vr.dmi' + icon = 'icons/obj/computer.dmi' icon_keyboard = "security_key" icon_screen = "disperser" light_color = "#7faaff" diff --git a/code/modules/overmap/overmap_object.dm b/code/modules/overmap/overmap_object.dm index 610b3bb1323..0037ec8e4a9 100644 --- a/code/modules/overmap/overmap_object.dm +++ b/code/modules/overmap/overmap_object.dm @@ -4,16 +4,27 @@ icon_state = "object" color = "#fffffe" - var/known = 1 //shows up on nav computers automatically - var/scannable //if set to TRUE will show up on ship sensors for detailed scans - var/scanner_name // Name for scans, replaces name once scanned - var/scanner_desc // Description for scans + /// Does this show up on nav computers automatically. + var/known = TRUE + /// If set to TRUE will show up on ship sensors for detailed scans. + var/scannable + /// Name for scans, replaces name once scanned. + var/scanner_name + /// Description for scans. + var/scanner_desc + + /// Icon file to use for skybox. + var/skybox_icon + /// Icon state to use for skybox. + var/skybox_icon_state + /// Shift from lower left corner of skybox. + var/skybox_pixel_x + /// Shift from lower left corner of skybox. + var/skybox_pixel_y + + //Cache stuff + var/image/cached_skybox_image - var/skybox_icon //Icon file to use for skybox - var/skybox_icon_state //Icon state to use for skybox - var/skybox_pixel_x //Shift from lower left corner of skybox - var/skybox_pixel_y //Shift from lower left corner of skybox - var/image/cached_skybox_image //Cachey var/image/real_appearance /// parallax vis contents object if any diff --git a/code/modules/overmap/ships/computers/computer_shims.dm b/code/modules/overmap/ships/computers/computer_shims.dm index 863f1f6b319..5eb0fe94b85 100644 --- a/code/modules/overmap/ships/computers/computer_shims.dm +++ b/code/modules/overmap/ships/computers/computer_shims.dm @@ -84,7 +84,7 @@ if((. = ..())) return if(!allowed(user)) - to_chat(user, "Access Denied.") + to_chat(user, SPAN_WARNING("Access Denied.")) return TRUE if(ui_status(user, ui_state()) > UI_CLOSE) return interface_interact(user) diff --git a/code/modules/overmap/ships/computers/engine_control.dm b/code/modules/overmap/ships/computers/engine_control.dm index a2f32666fc6..18483a2b464 100644 --- a/code/modules/overmap/ships/computers/engine_control.dm +++ b/code/modules/overmap/ships/computers/engine_control.dm @@ -6,6 +6,13 @@ icon_screen = "engines" circuit = /obj/item/circuitboard/engine +// fancy sprite +/obj/machinery/computer/ship/engines/adv + icon_keyboard = null + icon_state = "adv_engines" + icon_screen = "adv_engines_screen" + light_color = "#05A6A8" + /obj/machinery/computer/ship/engines/ui_interact(mob/user, datum/tgui/ui) if(!linked) display_reconnect_dialog(user, "ship control systems") diff --git a/code/modules/overmap/ships/computers/helm.dm b/code/modules/overmap/ships/computers/helm.dm index 4d4d38472e1..ee5b6a71f7e 100644 --- a/code/modules/overmap/ships/computers/helm.dm +++ b/code/modules/overmap/ships/computers/helm.dm @@ -24,11 +24,21 @@ GLOBAL_LIST_EMPTY(all_waypoints) var/autopilot = 0 var/autopilot_disabled = TRUE var/list/known_sectors = list() - var/dx //desitnation - var/dy //coordinates - var/speedlimit = 1/(20 SECONDS) //top speed for autopilot, 5 - var/accellimit = 0.001 //manual limiter for acceleration - req_one_access = list(access_pilot) //VOREStation Edit + var/dx //desitnation + var/dy //coordinates + + /// Top speed for autopilot, 5 + var/speedlimit = 1/(20 SECONDS) + /// Manual limiter for acceleration. + var/accellimit = 0.001 + req_one_access = list(access_pilot) + +// fancy sprite +/obj/machinery/computer/ship/helm/adv + icon_keyboard = null + icon_state = "adv_helm" + icon_screen = "adv_helm_screen" + light_color = "#70ffa0" /obj/machinery/computer/ship/helm/Initialize(mapload) . = ..() diff --git a/code/modules/overmap/ships/computers/sensors.dm b/code/modules/overmap/ships/computers/sensors.dm index 1f0d5b17b5e..7a89773b0d7 100644 --- a/code/modules/overmap/ships/computers/sensors.dm +++ b/code/modules/overmap/ships/computers/sensors.dm @@ -7,6 +7,13 @@ extra_view = 4 var/obj/machinery/shipsensors/sensors +// fancy sprite +/obj/machinery/computer/ship/sensors/adv + icon_keyboard = null + icon_state = "adv_sensors" + icon_screen = "adv_sensors_screen" + light_color = "#05A6A8" + /obj/machinery/computer/ship/sensors/attempt_hook_up(obj/effect/overmap/visitable/ship/sector) if(!(. = ..())) return diff --git a/code/modules/overmap/ships/computers/ship.dm b/code/modules/overmap/ships/computers/ship.dm index c40e2cb09c4..b52cb697a1b 100644 --- a/code/modules/overmap/ships/computers/ship.dm +++ b/code/modules/overmap/ships/computers/ship.dm @@ -1,20 +1,24 @@ -/* -While these computers can be placed anywhere, they will only function if placed on either a non-space, non-shuttle turf -with an /obj/effect/overmap/visitable/ship present elsewhere on that z level, or else placed in a shuttle area with an /obj/effect/overmap/visitable/ship -somewhere on that shuttle. Subtypes of these can be then used to perform ship overmap movement functions. -*/ +/** + * While these computers can be placed anywhere, they will only function if placed on either a non-space, non-shuttle turf + * with an /obj/effect/overmap/visitable/ship present elsewhere on that z level, or else placed in a shuttle area with an /obj/effect/overmap/visitable/ship + * somewhere on that shuttle. Subtypes of these can be then used to perform ship overmap movement functions. + */ /obj/machinery/computer/ship var/obj/effect/overmap/visitable/ship/linked - var/list/viewers // Weakrefs to mobs in direct-view mode. - var/extra_view = 0 // how much the view is increased by when the mob is in overmap mode. + /// Weakrefs to mobs in direct-view mode. + var/list/viewers + /// how much the view is increased by when the mob is in overmap mode. + var/extra_view = 0 + /// Has been emagged, no access restrictions. + var/hacked = 0 -// A late init operation called in SSshuttle, used to attach the thing to the right ship. +/// A late init operation called in SSshuttle, used to attach the thing to the right ship. /obj/machinery/computer/ship/proc/attempt_hook_up(obj/effect/overmap/visitable/ship/sector) if(!istype(sector)) return if(sector.check_ownership(src)) linked = sector - return 1 + return TRUE /obj/machinery/computer/ship/proc/sync_linked(var/user = null) var/obj/effect/overmap/visitable/ship/sector = get_overmap_sector(z) @@ -22,8 +26,8 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov return . = attempt_hook_up_recursive(sector) if(. && linked && user) - to_chat(user, "[src] reconnected to [linked]") - user << browse(null, "window=[src]") // Close reconnect dialog + to_chat(user, SPAN_NOTICE("[src] reconnected to [linked]")) + user << browse(null, "window=[src]") // Close reconnect dialog /obj/machinery/computer/ship/proc/attempt_hook_up_recursive(obj/effect/overmap/visitable/ship/sector) if(attempt_hook_up(sector)) @@ -108,7 +112,7 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov user.unset_machine() unlook(user) -/obj/machinery/computer/ship/check_eye(var/mob/user) +/obj/machinery/computer/ship/check_eye(mob/user) if(!get_dist(user, src) > 1 || user.blinded || !linked) unlook(user) return -1 @@ -123,3 +127,11 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov if(M) unlook(M) . = ..() + +/obj/machinery/computer/ship/emag_act(remaining_charges, mob/user) + if (!hacked) + req_access = list() + req_one_access = list() + hacked = TRUE + to_chat(user, "You short out the console's ID checking system. It's now available to everyone!") + return TRUE diff --git a/code/modules/overmap/ships/computers/ship_vr.dm b/code/modules/overmap/ships/computers/ship_vr.dm deleted file mode 100644 index b317eb3c1e4..00000000000 --- a/code/modules/overmap/ships/computers/ship_vr.dm +++ /dev/null @@ -1,13 +0,0 @@ -/* -Ships can now be hijacked! -*/ -/obj/machinery/computer/ship - var/hacked = 0 // Has been emagged, no access restrictions. - -/obj/machinery/computer/ship/emag_act(var/remaining_charges, var/mob/user) - if (!hacked) - req_access = list() - req_one_access = list() - hacked = 1 - to_chat(user, "You short out the console's ID checking system. It's now available to everyone!") - return 1 diff --git a/code/modules/overmap/ships/ship.dm b/code/modules/overmap/ships/ship.dm index ad9a13b9e66..6e355147699 100644 --- a/code/modules/overmap/ships/ship.dm +++ b/code/modules/overmap/ships/ship.dm @@ -18,23 +18,38 @@ appearance_flags = TILE_BOUND|KEEP_TOGETHER|LONG_GLIDE var/moving_state = "ship_moving" - var/vessel_mass = 10000 // Tonnes, arbitrary number, affects acceleration provided by engines - var/vessel_size = SHIP_SIZE_LARGE // Arbitrary number, affects how likely are we to evade meteors - var/max_speed = 1/(1 SECOND) // "Speed of light" for the ship, in turfs/decisecond. - var/min_speed = 1/(2 MINUTES) // Below this, we round speed to 0 to avoid math errors. + /// Tonnes, arbitrary number, affects acceleration provided by engines. + var/vessel_mass = 10000 + /// Arbitrary number, affects how likely are we to evade meteors. + var/vessel_size = SHIP_SIZE_LARGE + /// "Speed of light" for the ship, in turfs/decisecond. + var/max_speed = 1/(1 SECOND) + /// Below this, we round speed to 0 to avoid math errors. + var/min_speed = 1/(2 MINUTES) - var/position_x // Pixel coordinates in the world - var/position_y // Pixel coordinates in the world. - var/list/speed = list(0,0) // Speed in x,y direction - var/last_burn = 0 // Worldtime when ship last acceleated - var/burn_delay = 1 SECOND // How often ship can do burns - var/fore_dir = NORTH // What dir ship flies towards for purpose of moving stars effect procs + /// Pixel coordinates in the world. + var/position_x + /// Pixel coordinates in the world. + var/position_y + /// Speed in x,y direction. + var/list/speed = list(0,0) + /// Worldtime when ship last acceleated. + var/last_burn = 0 + /// How often ship can do burns. + var/burn_delay = 1 SECOND + /// What dir ship flies towards for purpose of moving stars effect procs. + var/fore_dir = NORTH + /// The list of all the engines we have. var/list/engines = list() - var/engines_state = 0 // Global on/off toggle for all engines - var/thrust_limit = 1 // Global thrust limit for all engines, 0..1 - var/halted = 0 // Admin halt or other stop. - var/skill_needed = SKILL_ADEPT // Piloting skill needed to steer it without going in random dir + /// Global on/off toggle for all engines. + var/engines_state = 0 + /// Global thrust limit for all engines, 0..1 + var/thrust_limit = 1 + /// Admin halt or other stop. + var/halted = 0 + /// Skill needed to steer it without going in random dir. + var/skill_needed = SKILL_NONE //We don't like skills. var/operator_skill /obj/effect/overmap/visitable/ship/Initialize(mapload) diff --git a/code/modules/resleeving/designer.dm b/code/modules/resleeving/designer.dm index fc1c9cd3016..a24e80b0b5f 100644 --- a/code/modules/resleeving/designer.dm +++ b/code/modules/resleeving/designer.dm @@ -5,7 +5,7 @@ name = "body design console" catalogue_data = list(///datum/category_item/catalogue/information/organization/vey_med, /datum/category_item/catalogue/technology/resleeving) - icon = 'icons/obj/computer_vr.dmi' + icon = 'icons/obj/computer.dmi' icon_keyboard = "med_key" icon_screen = "explosive" light_color = "#315ab4" diff --git a/icons/obj/computer.dmi b/icons/obj/computer.dmi index a2828408476..47f96897d0f 100644 Binary files a/icons/obj/computer.dmi and b/icons/obj/computer.dmi differ diff --git a/icons/obj/computer_vr.dmi b/icons/obj/computer_vr.dmi index 9d1832e7c99..af0c10d697c 100644 Binary files a/icons/obj/computer_vr.dmi and b/icons/obj/computer_vr.dmi differ diff --git a/icons/obj/modular_console.dmi b/icons/obj/modular_console.dmi index 42b37af8acf..60c2c0f25b7 100644 Binary files a/icons/obj/modular_console.dmi and b/icons/obj/modular_console.dmi differ diff --git a/icons/obj/modular_console_vr.dmi b/icons/obj/modular_console_vr.dmi deleted file mode 100644 index 125711410dc..00000000000 Binary files a/icons/obj/modular_console_vr.dmi and /dev/null differ diff --git a/icons/obj/modular_laptop.dmi b/icons/obj/modular_laptop.dmi index a950ac118c5..f66bcfb0d24 100644 Binary files a/icons/obj/modular_laptop.dmi and b/icons/obj/modular_laptop.dmi differ diff --git a/vorestation.dme b/vorestation.dme index 240ed181f96..7573bcdea71 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -3241,7 +3241,6 @@ #include "code\modules\overmap\ships\computers\helm.dm" #include "code\modules\overmap\ships\computers\sensors.dm" #include "code\modules\overmap\ships\computers\ship.dm" -#include "code\modules\overmap\ships\computers\ship_vr.dm" #include "code\modules\overmap\ships\computers\shuttle.dm" #include "code\modules\overmap\ships\engines\engine.dm" #include "code\modules\overmap\ships\engines\gas_thruster.dm"