diff --git a/code/__HELPERS/cmp.dm b/code/__HELPERS/cmp.dm index 0825e51ae4..a688d20451 100644 --- a/code/__HELPERS/cmp.dm +++ b/code/__HELPERS/cmp.dm @@ -85,9 +85,6 @@ GLOBAL_VAR_INIT(cmp_field, "name") /proc/cmp_advdisease_resistance_asc(datum/disease/advance/A, datum/disease/advance/B) return A.totalResistance() - B.totalResistance() -/proc/cmp_job_display_asc(datum/job/A, datum/job/B) - return A.display_order - B.display_order - /proc/cmp_uplink_items_dsc(datum/uplink_item/A, datum/uplink_item/B) return sorttext(initial(B.name), initial(A.name)) @@ -97,9 +94,6 @@ GLOBAL_VAR_INIT(cmp_field, "name") /proc/cmp_numbered_displays_name_dsc(datum/numbered_display/A, datum/numbered_display/B) return sorttext(B.sample_object.name, A.sample_object.name) -/proc/cmp_reagents_asc(datum/reagent/a, datum/reagent/b) - return sorttext(initial(b.name),initial(a.name)) - /proc/cmp_quirk_asc(datum/quirk/A, datum/quirk/B) var/a_sign = num2sign(initial(A.value) * -1) var/b_sign = num2sign(initial(B.value) * -1) @@ -133,3 +127,12 @@ GLOBAL_VAR_INIT(cmp_field, "name") return A.required_temp - B.required_temp //return coldest else return B.required_temp - A.required_temp //return hottest + +/proc/cmp_job_display_asc(datum/job/A, datum/job/B) + return A.display_order - B.display_order + +/proc/cmp_reagents_asc(datum/reagent/a, datum/reagent/b) + return sorttext(initial(b.name),initial(a.name)) + +/proc/cmp_typepaths_asc(A, B) + return sorttext("[B]","[A]") \ No newline at end of file diff --git a/code/datums/ai_laws.dm b/code/datums/ai_laws.dm index 9c6bb2ebfd..15115b62c0 100644 --- a/code/datums/ai_laws.dm +++ b/code/datums/ai_laws.dm @@ -431,25 +431,31 @@ if(!owner) owner = M -/datum/ai_laws/proc/get_law_list(include_zeroth = 0, show_numbers = 1) +/** + * Generates a list of all laws on this datum, including rendered HTML tags if required + * + * Arguments: + * * include_zeroth - Operator that controls if law 0 or law 666 is returned in the set + * * show_numbers - Operator that controls if law numbers are prepended to the returned laws + * * render_html - Operator controlling if HTML tags are rendered on the returned laws + */ +/datum/ai_laws/proc/get_law_list(include_zeroth = FALSE, show_numbers = TRUE, render_html = TRUE) var/list/data = list() - if (include_zeroth && devillaws && devillaws.len) - for(var/i in devillaws) - data += "[show_numbers ? "666:" : ""] [i]" + if (include_zeroth && devillaws) + for(var/law in devillaws) + data += "[show_numbers ? "666:" : ""] [render_html ? "[law]" : law]" if (include_zeroth && zeroth) - data += "[show_numbers ? "0:" : ""] [zeroth]" + data += "[show_numbers ? "0:" : ""] [render_html ? "[zeroth]" : zeroth]" for(var/law in hacked) if (length(law) > 0) - var/num = ionnum() - data += "[show_numbers ? "[num]:" : ""] [law]" + data += "[show_numbers ? "[ionnum()]:" : ""] [render_html ? "[law]" : law]" for(var/law in ion) if (length(law) > 0) - var/num = ionnum() - data += "[show_numbers ? "[num]:" : ""] [law]" + data += "[show_numbers ? "[ionnum()]:" : ""] [render_html ? "[law]" : law]" var/number = 1 for(var/law in inherent) @@ -459,6 +465,7 @@ for(var/law in supplied) if (length(law) > 0) - data += "[show_numbers ? "[number]:" : ""] [law]" + data += "[show_numbers ? "[number]:" : ""] [render_html ? "[law]" : law]" number++ return data + diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index cf942f077f..dc429702f1 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -1,13 +1,13 @@ - +//TODO: someone please get rid of this shit /datum/datacore - var/medical[] = list() + var/list/medical = list() var/medicalPrintCount = 0 - var/general[] = list() - var/security[] = list() + var/list/general = list() + var/list/security = list() var/securityPrintCount = 0 var/securityCrimeCounter = 0 - //This list tracks characters spawned in the world and cannot be modified in-game. Currently referenced by respawn_character(). - var/locked[] = list() + ///This list tracks characters spawned in the world and cannot be modified in-game. Currently referenced by respawn_character(). + var/list/locked = list() /datum/data var/name = "data" diff --git a/code/datums/skills/_check_skills.dm b/code/datums/skills/_check_skills.dm index b40770e073..d0c6442ff9 100644 --- a/code/datums/skills/_check_skills.dm +++ b/code/datums/skills/_check_skills.dm @@ -22,9 +22,9 @@ if(!ui) ui = new(user, src, "SkillPanel") ui.open() - else if(need_static_data_update) - update_static_data(user) - need_static_data_update = FALSE + //else if(need_static_data_update) + // update_static_data(user) + // need_static_data_update = FALSE /datum/skill_holder/ui_static_data(mob/user) . = list() diff --git a/code/modules/cargo/centcom_podlauncher.dm b/code/modules/cargo/centcom_podlauncher.dm index 1352d45f3d..d1d6950108 100644 --- a/code/modules/cargo/centcom_podlauncher.dm +++ b/code/modules/cargo/centcom_podlauncher.dm @@ -50,7 +50,7 @@ var/mob/M = H holder = M.client //if its a mob, assign the mob's client to holder bay = locate(/area/centcom/supplypod/loading/one) in GLOB.sortedAreas //Locate the default bay (one) from the centcom map - temp_pod = new(locate(/area/centcom/supplypod/pod_storage) in GLOB.sortedAreas) //Create a new temp_pod in the podStorage area on centcom (so users are free to look at it and change other variables if needed) + temp_pod = new(locate(/area/centcom/supplypod/podStorage) in GLOB.sortedAreas) //Create a new temp_pod in the podStorage area on centcom (so users are free to look at it and change other variables if needed) orderedArea = createOrderedArea(bay) //Order all the turfs in the selected bay (top left to bottom right) to a single list. Used for the "ordered" mode (launchChoice = 1) /datum/centcom_podlauncher/ui_state(mob/user) @@ -64,7 +64,7 @@ /datum/centcom_podlauncher/ui_data(mob/user) //Sends info about the pod to the UI. var/list/data = list() //*****NOTE*****: Many of these comments are similarly described in supplypod.dm. If you change them here, please consider doing so in the supplypod code as well! - var/B = (istype(bay, /area/centcom/supplypod/loading/one)) ? 1 : (istype(bay, /area/centcom/supplypod/loading/two)) ? 2 : (istype(bay, /area/centcom/supplypod/loading/three)) ? 3 : (istype(bay, /area/centcom/supplypod/loading/four)) ? 4 : (istype(bay, /area/centcom/supplypod/loading/ert)) ? 5 : 0 //top ten THICCEST FUCKING TERNARY CONDITIONALS OF 2036 + var/B = (istype(bay, /area/centcom/supplypod/loading/one)) ? 1 : (istype(bay, /area/centcom/supplypod/loading/two)) ? 2 : (istype(bay, /area/centcom/supplypod/loading/three)) ? 3 : (istype(bay, /area/centcom/supplypod/loading/four)) ? 4 : 0 //(istype(bay, /area/centcom/supplypod/loading/ert)) ? 5 : 0 //top ten THICCEST FUCKING TERNARY CONDITIONALS OF 2036 data["bay"] = bay //Holds the current bay the user is launching objects from. Bays are specific rooms on the centcom map. data["bayNumber"] = B //Holds the bay as a number. Useful for comparisons in centcom_podlauncher.ract data["oldArea"] = (oldTurf ? get_area(oldTurf) : null) //Holds the name of the area that the user was in before using the teleportCentcom action @@ -80,7 +80,7 @@ data["openingDelay"] = temp_pod.openingDelay //How long the pod takes to open after landing data["departureDelay"] = temp_pod.departureDelay //How long the pod takes to leave after opening (if bluespace=true, it deletes. if reversing=true, it flies back to centcom) data["styleChoice"] = temp_pod.style //Style is a variable that keeps track of what the pod is supposed to look like. It acts as an index to the POD_STYLES list in cargo.dm defines to get the proper icon/name/desc for the pod. - data["effectShrapnel"] = temp_pod.effectShrapnel //If true, creates a cloud of shrapnel of a decided type and magnitude on landing + data["effectShrapnel"] = FALSE //temp_pod.effectShrapnel //If true, creates a cloud of shrapnel of a decided type and magnitude on landing data["effectStun"] = temp_pod.effectStun //If true, stuns anyone under the pod when it launches until it lands, forcing them to get hit by the pod. Devilish! data["effectLimb"] = temp_pod.effectLimb //If true, pops off a limb (if applicable) from anyone caught under the pod when it lands data["effectOrgans"] = temp_pod.effectOrgans //If true, yeets the organs out of any bodies caught under the pod when it lands @@ -257,11 +257,12 @@ temp_pod.desc = descInput temp_pod.adminNamed = TRUE //This variable is checked in the supplypod/setStyle() proc . = TRUE + /* if("effectShrapnel") //Creates a cloud of shrapnel on landing if (temp_pod.effectShrapnel == TRUE) //If already doing custom damage, set back to default (no shrapnel) temp_pod.effectShrapnel = FALSE return - var/shrapnelInput = input("Please enter the type of pellet cloud you'd like to create on landing (Can be any projectile!)", "Projectile Typepath", 0) in sortList(subtypesof(/obj/projectile), /proc/cmp_typepaths_asc) + var/shrapnelInput = input("Please enter the type of pellet cloud you'd like to create on landing (Can be any projectile!)", "Projectile Typepath", 0) in sortList(subtypesof(/obj/item/projectile), /proc/cmp_typepaths_asc) if (isnull(shrapnelInput)) return var/shrapnelMagnitude = input("Enter the magnitude of the pellet cloud. This is usually a value around 1-5. Please note that Ryll-Ryll has asked me to tell you that if you go too crazy with the projectiles you might crash the server. So uh, be gentle!", "Shrapnel Magnitude", 0) as null|num @@ -274,6 +275,7 @@ temp_pod.shrapnel_magnitude = shrapnelMagnitude temp_pod.effectShrapnel = TRUE . = TRUE + */ if("effectStun") //Toggle: Any mob under the pod is stunned (cant move) until the pod lands, hitting them! temp_pod.effectStun = !temp_pod.effectStun . = TRUE @@ -485,11 +487,11 @@ return if (launching || turf_picking) //If the launching param is true, we give the user new mouse icons. if(launching) - holder.mouse_up_icon = 'icons/effects/mouse_pointers/supplypod_target.dmi' //Icon for when mouse is released - holder.mouse_down_icon = 'icons/effects/mouse_pointers/supplypod_down_target.dmi' //Icon for when mouse is pressed + holder.mouse_up_icon = 'icons/effects/supplypod_target.dmi' //Icon for when mouse is released + holder.mouse_down_icon = 'icons/effects/supplypod_down_target.dmi' //Icon for when mouse is pressed if(turf_picking) - holder.mouse_up_icon = 'icons/effects/mouse_pointers/supplypod_pickturf.dmi' //Icon for when mouse is released - holder.mouse_down_icon = 'icons/effects/mouse_pointers/supplypod_pickturf_down.dmi' //Icon for when mouse is pressed + holder.mouse_up_icon = 'icons/effects/supplypod_pickturf.dmi' //Icon for when mouse is released + holder.mouse_down_icon = 'icons/effects/supplypod_pickturf_down.dmi' //Icon for when mouse is pressed holder.mouse_pointer_icon = holder.mouse_up_icon //Icon for idle mouse (same as icon for when released) holder.click_intercept = src //Create a click_intercept so we know where the user is clicking else @@ -519,7 +521,7 @@ else return //if target is null and we don't have a specific target, cancel if (effectAnnounce) - deadchat_broadcast("A special package is being launched at the station!", turf_target = target, message_type=DEADCHAT_ANNOUNCEMENT) + deadchat_broadcast("A special package is being launched at the station!", turf_target = target) //, message_type=DEADCHAT_ANNOUNCEMENT) var/list/bouttaDie = list() for (var/mob/living/M in target) bouttaDie.Add(M) @@ -603,10 +605,12 @@ if (isnull(A)) return var/obj/structure/closet/supplypod/centcompod/toLaunch = DuplicateObject(temp_pod) //Duplicate the temp_pod (which we have been varediting or configuring with the UI) and store the result + /* if(dropoff_turf) toLaunch.reverse_dropoff_turf = dropoff_turf else toLaunch.reverse_dropoff_turf = bay //Bay is currently a nonstatic expression, so it cant go into toLaunch using DuplicateObject + */ toLaunch.update_icon()//we update_icon() here so that the door doesnt "flicker on" right after it lands var/shippingLane = GLOB.areas_by_type[/area/centcom/supplypod/fly_me_to_the_moon] toLaunch.forceMove(shippingLane) @@ -624,7 +628,7 @@ else for (var/atom/movable/O in launchList) //If we aren't cloning the objects, just go through the launchList O.forceMove(toLaunch) //and forceMove any atom/moveable into the supplypod - new /obj/effect/pod_landingzone(A, toLaunch) //Then, create the DPTarget effect, which will eventually forceMove the temp_pod to it's location + new /obj/effect/abstract/DPtarget(A, toLaunch) //Then, create the DPTarget effect, which will eventually forceMove the temp_pod to it's location if (launchClone) launchCounter++ //We only need to increment launchCounter if we are cloning objects. //If we aren't cloning objects, taking and removing the first item each time from the acceptableTurfs list will inherently iterate through the list in order diff --git a/code/modules/modular_computers/NTNet/NTNRC/conversation.dm b/code/modules/modular_computers/NTNet/NTNRC/conversation.dm index eeb5212aeb..27eb3a6ae9 100644 --- a/code/modules/modular_computers/NTNet/NTNRC/conversation.dm +++ b/code/modules/modular_computers/NTNet/NTNRC/conversation.dm @@ -25,12 +25,12 @@ return ..() /datum/ntnet_conversation/proc/add_message(message, username) - message = "[STATION_TIME_TIMESTAMP("hh:mm:ss", world.time)] [username]: [message]" + message = "[station_time_timestamp()] [username]: [message]" messages.Add(message) trim_message_list() /datum/ntnet_conversation/proc/add_status_message(message) - messages.Add("[STATION_TIME_TIMESTAMP("hh:mm:ss", world.time)] -!- [message]") + messages.Add("[station_time_timestamp()] -!- [message]") trim_message_list() /datum/ntnet_conversation/proc/trim_message_list() @@ -73,4 +73,4 @@ add_status_message("[client.username] has changed channel title from [title] to [newtitle]") title = newtitle -#undef MAX_CHANNELS \ No newline at end of file +#undef MAX_CHANNELS diff --git a/code/modules/modular_computers/computers/_modular_computer_shared.dm b/code/modules/modular_computers/computers/_modular_computer_shared.dm new file mode 100644 index 0000000000..8ca93e8347 --- /dev/null +++ b/code/modules/modular_computers/computers/_modular_computer_shared.dm @@ -0,0 +1,64 @@ + +/obj/proc/is_modular_computer() + return + +/obj/proc/get_modular_computer_part(part_type) + return null + +/obj/item/modular_computer/is_modular_computer() + return TRUE + +/obj/item/modular_computer/get_modular_computer_part(part_type) + if(!part_type) + stack_trace("get_modular_computer_part() called without a valid part_type") + return null + return all_components[part_type] + + +/obj/machinery/modular_computer/is_modular_computer() + return TRUE + +/obj/machinery/modular_computer/get_modular_computer_part(part_type) + if(!part_type) + stack_trace("get_modular_computer_part() called without a valid part_type") + return null + return cpu?.all_components[part_type] + + +/obj/proc/get_modular_computer_parts_examine(mob/user) + . = list() + if(!is_modular_computer()) + return + + var/user_is_adjacent = Adjacent(user) //don't reveal full details unless they're close enough to see it on the screen anyway. + + var/obj/item/computer_hardware/ai_slot/ai_slot = get_modular_computer_part(MC_AI) + if(ai_slot) + if(ai_slot.stored_card) + if(user_is_adjacent) + . += "It has a slot installed for an intelliCard which contains: [ai_slot.stored_card.name]" + else + . += "It has a slot installed for an intelliCard, which appears to be occupied." + . += "Alt-click to eject the intelliCard." + else + . += "It has a slot installed for an intelliCard." + + var/obj/item/computer_hardware/card_slot/card_slot = get_modular_computer_part(MC_CARD) + if(card_slot) + if(card_slot.stored_card || card_slot.stored_card2) + var/obj/item/card/id/first_ID = card_slot.stored_card + var/obj/item/card/id/second_ID = card_slot.stored_card2 + var/multiple_cards = istype(first_ID) && istype(second_ID) + if(user_is_adjacent) + . += "It has two slots for identification cards installed[multiple_cards ? " which contain [first_ID] and [second_ID]" : ", one of which contains [first_ID ? first_ID : second_ID]"]." + else + . += "It has two slots for identification cards installed, [multiple_cards ? "both of which appear" : "and one of them appears"] to be occupied." + . += "Alt-click [src] to eject the identification card[multiple_cards ? "s":""]." + else + . += "It has two slots installed for identification cards." + + var/obj/item/computer_hardware/printer/printer_slot = get_modular_computer_part(MC_PRINT) + if(printer_slot) + . += "It has a printer installed." + if(user_is_adjacent) + . += "The printer's paper levels are at: [printer_slot.stored_paper]/[printer_slot.max_paper].]" diff --git a/code/modules/modular_computers/computers/item/computer.dm b/code/modules/modular_computers/computers/item/computer.dm index d722197bd9..67c04de13f 100644 --- a/code/modules/modular_computers/computers/item/computer.dm +++ b/code/modules/modular_computers/computers/item/computer.dm @@ -7,6 +7,7 @@ var/enabled = 0 // Whether the computer is turned on. var/screen_on = 1 // Whether the computer is active/opened/it's screen is on. + var/device_theme = "ntos" // Sets the theme for the main menu, hardware config, and file browser apps. Overridden by certain non-NT devices. var/datum/computer_file/program/active_program = null // A currently active program running on the computer. var/hardware_flag = 0 // A flag that describes this device type var/last_power_usage = 0 @@ -98,7 +99,7 @@ if(issilicon(usr)) return var/obj/item/computer_hardware/card_slot/card_slot = all_components[MC_CARD] - if(usr.canUseTopic(src)) + if(usr.canUseTopic(src, BE_CLOSE)) card_slot.try_eject(null, usr) // Eject ID card from computer, if it has ID slot with card inside. @@ -109,7 +110,7 @@ if(issilicon(usr)) return var/obj/item/computer_hardware/ai_slot/ai_slot = all_components[MC_AI] - if(usr.canUseTopic(src)) + if(usr.canUseTopic(src, BE_CLOSE)) ai_slot.try_eject(null, usr,1) @@ -121,17 +122,17 @@ if(issilicon(usr)) return - if(usr.canUseTopic(src)) + if(usr.canUseTopic(src, BE_CLOSE)) var/obj/item/computer_hardware/hard_drive/portable/portable_drive = all_components[MC_SDD] if(uninstall_component(portable_drive, usr)) portable_drive.verb_pickup() /obj/item/modular_computer/AltClick(mob/user) - . = ..() + ..() if(issilicon(user)) return - if(user.canUseTopic(src)) + if(user.canUseTopic(src, BE_CLOSE)) var/obj/item/computer_hardware/card_slot/card_slot = all_components[MC_CARD] var/obj/item/computer_hardware/ai_slot/ai_slot = all_components[MC_AI] var/obj/item/computer_hardware/hard_drive/portable/portable_drive = all_components[MC_SDD] @@ -143,7 +144,7 @@ return if(ai_slot) ai_slot.try_eject(null, user) - return TRUE + // Gets IDs/access levels from card slot. Would be useful when/if PDAs would become modular PCs. /obj/item/modular_computer/GetAccess() @@ -175,7 +176,7 @@ /obj/item/modular_computer/MouseDrop(obj/over_object, src_location, over_location) var/mob/M = usr - if((!istype(over_object, /obj/screen)) && usr.canUseTopic(src)) + if((!istype(over_object, /obj/screen)) && usr.canUseTopic(src, BE_CLOSE)) return attack_self(M) return ..() @@ -195,12 +196,22 @@ /obj/item/modular_computer/emag_act(mob/user) . = ..() - if(obj_flags & EMAGGED) - to_chat(user, "\The [src] was already emagged.") - return - obj_flags |= EMAGGED - to_chat(user, "You emag \the [src]. It's screen briefly shows a \"OVERRIDE ACCEPTED: New software downloads available.\" message.") - return TRUE + if(!enabled) + to_chat(user, "You'd need to turn the [src] on first.") + return FALSE + obj_flags |= EMAGGED //Mostly for consistancy purposes; the programs will do their own emag handling + var/newemag = FALSE + var/obj/item/computer_hardware/hard_drive/drive = all_components[MC_HDD] + for(var/datum/computer_file/program/app in drive.stored_files) + if(!istype(app)) + continue + if(app.run_emag()) + newemag = TRUE + if(newemag) + to_chat(user, "You swipe \the [src]. A console window momentarily fills the screen, with white text rapidly scrolling past.") + return TRUE + to_chat(user, "You swipe \the [src]. A console window fills the screen, but it quickly closes itself after only a few lines are written to it.") + return FALSE /obj/item/modular_computer/examine(mob/user) . = ..() @@ -209,13 +220,14 @@ else if(obj_integrity < max_integrity) . += "It is damaged." + . += get_modular_computer_parts_examine(user) + /obj/item/modular_computer/update_icon_state() if(!enabled) icon_state = icon_state_unpowered else icon_state = icon_state_powered - /obj/item/modular_computer/update_overlays() . = ..() if(!display_overlays) @@ -306,6 +318,8 @@ /obj/item/modular_computer/proc/get_header_data() var/list/data = list() + data["PC_device_theme"] = device_theme + var/obj/item/computer_hardware/battery/battery_module = all_components[MC_CELL] var/obj/item/computer_hardware/recharger/recharger = all_components[MC_CHARGE] @@ -407,17 +421,17 @@ if(install_component(W, user)) return - if(istype(W, /obj/item/wrench)) + if(W.tool_behaviour == TOOL_WRENCH) if(all_components.len) to_chat(user, "Remove all components from \the [src] before disassembling it.") return new /obj/item/stack/sheet/metal( get_turf(src.loc), steel_sheet_cost ) - physical.visible_message("\The [src] has been disassembled by [user].") + physical.visible_message("\The [src] is disassembled by [user].") relay_qdel() qdel(src) return - if(istype(W, /obj/item/weldingtool)) + if(W.tool_behaviour == TOOL_WELDER) if(obj_integrity == max_integrity) to_chat(user, "\The [src] does not require repairs.") return @@ -431,7 +445,7 @@ to_chat(user, "You repair \the [src].") return - if(istype(W, /obj/item/screwdriver)) + if(W.tool_behaviour == TOOL_SCREWDRIVER) if(!all_components.len) to_chat(user, "This device doesn't have any components installed.") return @@ -440,7 +454,7 @@ var/obj/item/computer_hardware/H = all_components[h] component_names.Add(H.name) - var/choice = input(user, "Which component do you want to uninstall?", "Computer maintenance", null) as null|anything in component_names + var/choice = input(user, "Which component do you want to uninstall?", "Computer maintenance", null) as null|anything in sortList(component_names) if(!choice) return diff --git a/code/modules/modular_computers/computers/item/computer_damage.dm b/code/modules/modular_computers/computers/item/computer_damage.dm index 6664b449bd..b510f8aded 100644 --- a/code/modules/modular_computers/computers/item/computer_damage.dm +++ b/code/modules/modular_computers/computers/item/computer_damage.dm @@ -18,13 +18,13 @@ /obj/item/modular_computer/proc/break_apart() if(!(flags_1 & NODECONSTRUCT_1)) - physical.visible_message("\The [src] breaks apart!") + physical.visible_message("\The [src] breaks apart!") var/turf/newloc = get_turf(src) new /obj/item/stack/sheet/metal(newloc, round(steel_sheet_cost/2)) for(var/C in all_components) var/obj/item/computer_hardware/H = all_components[C] if(QDELETED(H)) - return + continue uninstall_component(H) H.forceMove(newloc) if(prob(25)) diff --git a/code/modules/modular_computers/computers/item/computer_power.dm b/code/modules/modular_computers/computers/item/computer_power.dm index d3c65f86ec..b5188f43d9 100644 --- a/code/modules/modular_computers/computers/item/computer_power.dm +++ b/code/modules/modular_computers/computers/item/computer_power.dm @@ -28,8 +28,7 @@ /obj/item/modular_computer/get_cell() var/obj/item/computer_hardware/battery/battery_module = all_components[MC_CELL] - if(battery_module && battery_module.battery) - return battery_module.battery + return battery_module?.get_cell() // Used in following function to reduce copypaste /obj/item/modular_computer/proc/power_failure() diff --git a/code/modules/modular_computers/computers/item/laptop.dm b/code/modules/modular_computers/computers/item/laptop.dm index 4781cbd8bc..95b81d9b52 100644 --- a/code/modules/modular_computers/computers/item/laptop.dm +++ b/code/modules/modular_computers/computers/item/laptop.dm @@ -7,6 +7,7 @@ icon_state_powered = "laptop" icon_state_unpowered = "laptop-off" icon_state_menu = "menu" + display_overlays = FALSE hardware_flag = PROGRAM_LAPTOP max_hardware_size = 2 @@ -18,8 +19,8 @@ screen_on = 0 // Starts closed var/start_open = TRUE // unless this var is set to 1 var/icon_state_closed = "laptop-closed" - display_overlays = FALSE var/w_class_open = WEIGHT_CLASS_BULKY + var/slowdown_open = TRUE /obj/item/modular_computer/laptop/examine(mob/user) . = ..() @@ -38,6 +39,13 @@ else . = ..() +/obj/item/modular_computer/laptop/update_overlays() + if(screen_on) + return ..() + else + cut_overlays() + icon_state = icon_state_closed + /obj/item/modular_computer/laptop/attack_self(mob/user) if(!screen_on) try_toggle_open(user) @@ -64,7 +72,7 @@ return M.put_in_hand(src, H.held_index) -/obj/item/modular_computer/laptop/on_attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags) +/obj/item/modular_computer/laptop/on_attack_hand(mob/user) if(screen_on && isturf(loc)) return attack_self(user) @@ -73,7 +81,7 @@ return if(!isturf(loc) && !ismob(loc)) // No opening it in backpack. return - if(!user.canUseTopic(src)) + if(!user.canUseTopic(src, BE_CLOSE)) return toggle_open(user) @@ -82,15 +90,17 @@ /obj/item/modular_computer/laptop/AltClick(mob/user) if(screen_on) // Close it. try_toggle_open(user) - return TRUE - return ..() + else + return ..() /obj/item/modular_computer/laptop/proc/toggle_open(mob/living/user=null) if(screen_on) to_chat(user, "You close \the [src].") + slowdown = initial(slowdown) w_class = initial(w_class) else to_chat(user, "You open \the [src].") + slowdown = slowdown_open w_class = w_class_open screen_on = !screen_on diff --git a/code/modules/modular_computers/computers/item/laptop_presets.dm b/code/modules/modular_computers/computers/item/laptop_presets.dm index e50392e3b3..6bc2919bea 100644 --- a/code/modules/modular_computers/computers/item/laptop_presets.dm +++ b/code/modules/modular_computers/computers/item/laptop_presets.dm @@ -20,4 +20,3 @@ /obj/item/modular_computer/laptop/preset/civilian/install_programs() var/obj/item/computer_hardware/hard_drive/hard_drive = all_components[MC_HDD] hard_drive.store_file(new/datum/computer_file/program/chatclient()) - hard_drive.store_file(new/datum/computer_file/program/nttransfer()) diff --git a/code/modules/modular_computers/computers/item/processor.dm b/code/modules/modular_computers/computers/item/processor.dm index 81e2cb95e6..c79d7a9361 100644 --- a/code/modules/modular_computers/computers/item/processor.dm +++ b/code/modules/modular_computers/computers/item/processor.dm @@ -1,4 +1,5 @@ // Held by /obj/machinery/modular_computer to reduce amount of copy-pasted code. +//TODO: REFACTOR THIS SPAGHETTI CODE, MAKE IT A COMPUTER_HARDWARE COMPONENT OR REMOVE IT /obj/item/modular_computer/processor name = "processing unit" desc = "You shouldn't see this. If you do, report it." @@ -11,19 +12,22 @@ var/obj/machinery/modular_computer/machinery_computer = null /obj/item/modular_computer/processor/Destroy() - . = ..() if(machinery_computer && (machinery_computer.cpu == src)) machinery_computer.cpu = null + machinery_computer.UnregisterSignal(src, COMSIG_ATOM_UPDATED_ICON) machinery_computer = null - -/obj/item/modular_computer/processor/Initialize(mapload) . = ..() - if(!loc || !istype(loc, /obj/machinery/modular_computer)) + +/obj/item/modular_computer/processor/New(comp) //intentional new probably + ..() + STOP_PROCESSING(SSobj, src) // Processed by its machine + + if(!comp || !istype(comp, /obj/machinery/modular_computer)) CRASH("Inapropriate type passed to obj/item/modular_computer/processor/New()! Aborting.") // Obtain reference to machinery computer all_components = list() idle_threads = list() - machinery_computer = loc + machinery_computer = comp machinery_computer.cpu = src hardware_flag = machinery_computer.hardware_flag max_hardware_size = machinery_computer.max_hardware_size @@ -39,7 +43,7 @@ qdel(machinery_computer) // This thing is not meant to be used on it's own, get topic data from our machinery owner. -//obj/item/modular_computer/processor/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE) +//obj/item/modular_computer/processor/canUseTopic(atom/movable/M, be_close=FALSE, no_dexterity=FALSE, no_tk=FALSE) // if(!machinery_computer) // return 0 @@ -69,3 +73,6 @@ machinery_computer.verbs -= /obj/machinery/modular_computer/proc/eject_disk if(MC_AI) machinery_computer.verbs -= /obj/machinery/modular_computer/proc/eject_card + +/obj/item/modular_computer/processor/attack_ghost(mob/user) + ui_interact(user) diff --git a/code/modules/modular_computers/computers/item/tablet.dm b/code/modules/modular_computers/computers/item/tablet.dm index a371e97ec6..41a256467f 100644 --- a/code/modules/modular_computers/computers/item/tablet.dm +++ b/code/modules/modular_computers/computers/item/tablet.dm @@ -5,6 +5,7 @@ icon_state_unpowered = "tablet" icon_state_powered = "tablet" icon_state_menu = "menu" + //worn_icon_state = "tablet" hardware_flag = PROGRAM_TABLET max_hardware_size = 1 w_class = WEIGHT_CLASS_SMALL @@ -32,3 +33,17 @@ slot_flags = ITEM_SLOT_ID | ITEM_SLOT_BELT comp_light_luminosity = 6.3 has_variants = FALSE + +/// Given to Nuke Ops members. +/obj/item/modular_computer/tablet/nukeops + icon_state = "tablet-syndicate" + comp_light_luminosity = 6.3 + has_variants = FALSE + device_theme = "syndicate" + +/obj/item/modular_computer/tablet/nukeops/emag_act(mob/user) + if(!enabled) + to_chat(user, "You'd need to turn the [src] on first.") + return FALSE + to_chat(user, "You swipe \the [src]. It's screen briefly shows a message reading \"MEMORY CODE INJECTION DETECTED AND SUCCESSFULLY QUARANTINED\".") + return FALSE diff --git a/code/modules/modular_computers/computers/item/tablet_presets.dm b/code/modules/modular_computers/computers/item/tablet_presets.dm index f516d3802f..7cca8ea5b4 100644 --- a/code/modules/modular_computers/computers/item/tablet_presets.dm +++ b/code/modules/modular_computers/computers/item/tablet_presets.dm @@ -22,23 +22,38 @@ /obj/item/modular_computer/tablet/preset/cargo/Initialize() . = ..() + var/obj/item/computer_hardware/hard_drive/small/hard_drive = new install_component(new /obj/item/computer_hardware/processor_unit/small) install_component(new /obj/item/computer_hardware/battery(src, /obj/item/stock_parts/cell/computer)) - install_component(new /obj/item/computer_hardware/hard_drive/small) + install_component(hard_drive) install_component(new /obj/item/computer_hardware/network_card) install_component(new /obj/item/computer_hardware/printer/mini) + hard_drive.store_file(new /datum/computer_file/program/bounty) + //hard_drive.store_file(new /datum/computer_file/program/shipping) -/obj/item/modular_computer/tablet/syndicate_contract_uplink/preset/uplink/Initialize() // Given by the syndicate as part of the contract uplink bundle - loads in the Contractor Uplink. +/// Given by the syndicate as part of the contract uplink bundle - loads in the Contractor Uplink. +/obj/item/modular_computer/tablet/syndicate_contract_uplink/preset/uplink/Initialize() . = ..() var/obj/item/computer_hardware/hard_drive/small/syndicate/hard_drive = new var/datum/computer_file/program/contract_uplink/uplink = new + active_program = uplink uplink.program_state = PROGRAM_STATE_ACTIVE uplink.computer = src + hard_drive.store_file(uplink) + install_component(new /obj/item/computer_hardware/processor_unit/small) install_component(new /obj/item/computer_hardware/battery(src, /obj/item/stock_parts/cell/computer)) install_component(hard_drive) install_component(new /obj/item/computer_hardware/network_card) install_component(new /obj/item/computer_hardware/card_slot) - install_component(new /obj/item/computer_hardware/printer/mini) \ No newline at end of file + install_component(new /obj/item/computer_hardware/printer/mini) + +/// Given to Nuke Ops members. +/obj/item/modular_computer/tablet/nukeops/Initialize() + . = ..() + install_component(new /obj/item/computer_hardware/processor_unit/small) + install_component(new /obj/item/computer_hardware/battery(src, /obj/item/stock_parts/cell/computer)) + install_component(new /obj/item/computer_hardware/hard_drive/small/nukeops) + install_component(new /obj/item/computer_hardware/network_card) diff --git a/code/modules/modular_computers/computers/machinery/console_presets.dm b/code/modules/modular_computers/computers/machinery/console_presets.dm index 066f1fb98b..9d29b23e76 100644 --- a/code/modules/modular_computers/computers/machinery/console_presets.dm +++ b/code/modules/modular_computers/computers/machinery/console_presets.dm @@ -46,16 +46,12 @@ desc = "A stationary computer. This one comes preloaded with research programs." _has_ai = TRUE -/obj/machinery/modular_computer/console/preset/research/examine(mob/user) - . = ..() - . += "Alt-click to eject the intelliCard." - /obj/machinery/modular_computer/console/preset/research/install_programs() var/obj/item/computer_hardware/hard_drive/hard_drive = cpu.all_components[MC_HDD] hard_drive.store_file(new/datum/computer_file/program/ntnetmonitor()) - hard_drive.store_file(new/datum/computer_file/program/nttransfer()) hard_drive.store_file(new/datum/computer_file/program/chatclient()) hard_drive.store_file(new/datum/computer_file/program/aidiag()) + hard_drive.store_file(new/datum/computer_file/program/robocontrol()) // ===== COMMAND CONSOLE ===== @@ -66,15 +62,27 @@ _has_id_slot = TRUE _has_printer = TRUE -/obj/machinery/modular_computer/console/preset/command/examine(mob/user) - . = ..() - . += "Alt-click [src] to eject the identification card." - /obj/machinery/modular_computer/console/preset/command/install_programs() var/obj/item/computer_hardware/hard_drive/hard_drive = cpu.all_components[MC_HDD] hard_drive.store_file(new/datum/computer_file/program/chatclient()) hard_drive.store_file(new/datum/computer_file/program/card_mod()) + +// ===== IDENTIFICATION CONSOLE ===== +/obj/machinery/modular_computer/console/preset/id + console_department = "Identification" + name = "identification console" + desc = "A stationary computer. This one comes preloaded with identification modification programs." + _has_id_slot = TRUE + _has_printer = TRUE + +/obj/machinery/modular_computer/console/preset/id/install_programs() + var/obj/item/computer_hardware/hard_drive/hard_drive = cpu.all_components[MC_HDD] + hard_drive.store_file(new/datum/computer_file/program/chatclient()) + hard_drive.store_file(new/datum/computer_file/program/card_mod()) + hard_drive.store_file(new/datum/computer_file/program/job_management()) + hard_drive.store_file(new/datum/computer_file/program/crew_manifest()) + // ===== CIVILIAN CONSOLE ===== /obj/machinery/modular_computer/console/preset/civilian console_department = "Civilian" @@ -84,5 +92,4 @@ /obj/machinery/modular_computer/console/preset/civilian/install_programs() var/obj/item/computer_hardware/hard_drive/hard_drive = cpu.all_components[MC_HDD] hard_drive.store_file(new/datum/computer_file/program/chatclient()) - hard_drive.store_file(new/datum/computer_file/program/nttransfer()) hard_drive.store_file(new/datum/computer_file/program/arcade()) diff --git a/code/modules/modular_computers/computers/machinery/modular_computer.dm b/code/modules/modular_computers/computers/machinery/modular_computer.dm index 7e384c3ddd..6f016ad147 100644 --- a/code/modules/modular_computers/computers/machinery/modular_computer.dm +++ b/code/modules/modular_computers/computers/machinery/modular_computer.dm @@ -36,6 +36,10 @@ QDEL_NULL(cpu) return ..() +/obj/machinery/modular_computer/examine(mob/user) + . = ..() + . += get_modular_computer_parts_examine(user) + /obj/machinery/modular_computer/attack_ghost(mob/dead/observer/user) . = ..() if(.) @@ -45,31 +49,31 @@ /obj/machinery/modular_computer/emag_act(mob/user) . = ..() - if(cpu) - . |= cpu.emag_act(user) + if(!cpu) + to_chat(user, "You'd need to turn the [src] on first.") + return FALSE + return (cpu.emag_act(user)) -/obj/machinery/modular_computer/update_icon_state() - if(cpu?.enabled) - icon_state = icon_state_powered - else if(stat & NOPOWER || !(cpu?.use_power())) - icon_state = icon_state_unpowered +/obj/machinery/modular_computer/update_icon() + cut_overlays() + icon_state = icon_state_powered -/obj/machinery/modular_computer/update_overlays() - . = ..() if(!cpu || !cpu.enabled) if (!(stat & NOPOWER) && (cpu && cpu.use_power())) - . += screen_icon_screensaver + add_overlay(screen_icon_screensaver) + else + icon_state = icon_state_unpowered set_light(0) else set_light(light_strength) if(cpu.active_program) - . += cpu.active_program.program_icon_state ? cpu.active_program.program_icon_state : screen_icon_state_menu + add_overlay(cpu.active_program.program_icon_state ? cpu.active_program.program_icon_state : screen_icon_state_menu) else - . += screen_icon_state_menu + add_overlay(screen_icon_state_menu) if(cpu && cpu.obj_integrity <= cpu.integrity_failure * cpu.max_integrity) - . += "bsod" - . += "broken" + add_overlay("bsod") + add_overlay("broken") // Eject ID card from computer, if it has ID slot with card inside. /obj/machinery/modular_computer/proc/eject_id() @@ -96,10 +100,10 @@ cpu.eject_card() /obj/machinery/modular_computer/AltClick(mob/user) - . = ..() if(cpu) - return cpu.AltClick(user) + cpu.AltClick(user) +//ATTACK HAND IGNORING PARENT RETURN VALUE // On-click handling. Turns on the computer if it's off and opens the GUI. /obj/machinery/modular_computer/interact(mob/user) if(cpu) @@ -130,8 +134,7 @@ stat &= ~NOPOWER update_icon() return - ..() - update_icon() + . = ..() /obj/machinery/modular_computer/attackby(var/obj/item/W as obj, mob/user) if(cpu && !(flags_1 & NODECONSTRUCT_1)) @@ -144,6 +147,13 @@ /obj/machinery/modular_computer/ex_act(severity) if(cpu) cpu.ex_act(severity) + // switch(severity) + // if(EXPLODE_DEVASTATE) + // SSexplosions.highobj += cpu + // if(EXPLODE_HEAVY) + // SSexplosions.medobj += cpu + // if(EXPLODE_LIGHT) + // SSexplosions.lowobj += cpu ..() // EMPs are similar to explosions, but don't cause physical damage to the casing. Instead they screw up the components diff --git a/code/modules/modular_computers/computers/machinery/modular_console.dm b/code/modules/modular_computers/computers/machinery/modular_console.dm index 3d4ec22e89..5d596f98e4 100644 --- a/code/modules/modular_computers/computers/machinery/modular_console.dm +++ b/code/modules/modular_computers/computers/machinery/modular_console.dm @@ -52,4 +52,4 @@ network_card.identification_string = "Unknown Console" if(cpu) cpu.screen_on = 1 - update_icon() \ No newline at end of file + update_icon() diff --git a/code/modules/modular_computers/documentation.md b/code/modules/modular_computers/documentation.md index 246da7c3d9..88d059da7a 100644 --- a/code/modules/modular_computers/documentation.md +++ b/code/modules/modular_computers/documentation.md @@ -1,5 +1,7 @@ # Modular computer programs +How module computer programs work + Ok. so a quick rundown on how to make a program. This is kind of a shitty documentation, but oh well I was asked to. ## Base setup diff --git a/code/modules/modular_computers/file_system/computer_file.dm b/code/modules/modular_computers/file_system/computer_file.dm index 7776fc04d0..4e862c4ae3 100644 --- a/code/modules/modular_computers/file_system/computer_file.dm +++ b/code/modules/modular_computers/file_system/computer_file.dm @@ -3,8 +3,8 @@ var/filetype = "XXX" // File full names are [filename].[filetype] so like NewFile.XXX in this case var/size = 1 // File size in GQ. Integers only! var/obj/item/computer_hardware/hard_drive/holder // Holder that contains this file. - var/unsendable = 0 // Whether the file may be sent to someone via NTNet transfer or other means. - var/undeletable = 0 // Whether the file may be deleted. Setting to 1 prevents deletion/renaming/etc. + var/unsendable = FALSE // Whether the file may be sent to someone via NTNet transfer or other means. + var/undeletable = FALSE // Whether the file may be deleted. Setting to TRUE prevents deletion/renaming/etc. var/uid // UID of this file var/static/file_uid = 0 @@ -24,7 +24,7 @@ return ..() // Returns independent copy of this file. -/datum/computer_file/proc/clone(rename = 0) +/datum/computer_file/proc/clone(rename = FALSE) var/datum/computer_file/temp = new type temp.unsendable = unsendable temp.undeletable = undeletable @@ -34,4 +34,4 @@ else temp.filename = filename temp.filetype = filetype - return temp \ No newline at end of file + return temp diff --git a/code/modules/modular_computers/file_system/program.dm b/code/modules/modular_computers/file_system/program.dm index c81939bc0d..12e5ef6e95 100644 --- a/code/modules/modular_computers/file_system/program.dm +++ b/code/modules/modular_computers/file_system/program.dm @@ -70,17 +70,17 @@ if(!(hardware_flag & usage_flags)) if(loud && computer && user) to_chat(user, "\The [computer] flashes a \"Hardware Error - Incompatible software\" warning.") - return FALSE - return TRUE + return 0 + return 1 /datum/computer_file/program/proc/get_signal(specific_action = 0) if(computer) return computer.get_ntnet_status(specific_action) - return FALSE + return 0 // Called by Process() on device that runs us, once every tick. /datum/computer_file/program/proc/process_tick() - return TRUE + return 1 // Check if the user can run program. Only humans can operate computer. Automatically called in run_program() // User has to wear their ID for ID Scan to work. @@ -126,7 +126,7 @@ return TRUE if(loud) to_chat(user, "\The [computer] flashes an \"Access Denied\" warning.") - return FALSE + return 0 // This attempts to retrieve header data for UIs. If implementing completely new device of different type than existing ones // always include the device here in this proc. This proc basically relays the request to whatever is running the program. @@ -142,8 +142,8 @@ if(requires_ntnet && network_destination) generate_network_log("Connection opened to [network_destination].") program_state = PROGRAM_STATE_ACTIVE - return TRUE - return FALSE + return 1 + return 0 /** * @@ -164,7 +164,7 @@ program_state = PROGRAM_STATE_KILLED if(network_destination) generate_network_log("Connection to [network_destination] closed.") - return TRUE + return 1 /datum/computer_file/program/ui_interact(mob/user, datum/tgui/ui) ui = SStgui.try_update_ui(user, src, ui) @@ -180,17 +180,17 @@ // ALWAYS INCLUDE PARENT CALL ..() OR DIE IN FIRE. /datum/computer_file/program/ui_act(action,list/params,datum/tgui/ui) if(..()) - return TRUE + return 1 if(computer) switch(action) if("PC_exit") computer.kill_program() ui.close() - return TRUE + return 1 if("PC_shutdown") computer.shutdown_computer() ui.close() - return TRUE + return 1 if("PC_minimize") var/mob/user = usr if(!computer.active_program || !computer.all_components[MC_CPU]) diff --git a/code/modules/modular_computers/file_system/program_events.dm b/code/modules/modular_computers/file_system/program_events.dm index 279d646cfd..3c1daa5af3 100644 --- a/code/modules/modular_computers/file_system/program_events.dm +++ b/code/modules/modular_computers/file_system/program_events.dm @@ -13,6 +13,6 @@ /datum/computer_file/program/proc/event_networkfailure(background) kill_program(forced = TRUE) if(background) - computer.visible_message("\The [computer]'s screen displays an \"Process [filename].[filetype] (PID [rand(100,999)]) terminated - Network Error\" error") + computer.visible_message("\The [computer]'s screen displays a \"Process [filename].[filetype] (PID [rand(100,999)]) terminated - Network Error\" error") else computer.visible_message("\The [computer]'s screen briefly freezes and then shows \"NETWORK ERROR - NTNet connection lost. Please retry. If problem persists contact your system administrator.\" error.") diff --git a/code/modules/modular_computers/file_system/programs/airestorer.dm b/code/modules/modular_computers/file_system/programs/airestorer.dm index 4e9cd85577..364ad79737 100644 --- a/code/modules/modular_computers/file_system/programs/airestorer.dm +++ b/code/modules/modular_computers/file_system/programs/airestorer.dm @@ -9,8 +9,6 @@ transfer_access = ACCESS_HEADS available_on_ntnet = TRUE tgui_id = "NtosAiRestorer" - ui_x = 370 - ui_y = 400 /// Variable dictating if we are in the process of restoring the AI in the inserted intellicard var/restoring = FALSE @@ -74,8 +72,8 @@ restoring = FALSE return ai_slot.locked =TRUE - A.adjustOxyLoss(-5, 0) - A.adjustFireLoss(-5, 0) + A.adjustOxyLoss(-5, 0)//, FALSE) + A.adjustFireLoss(-5, 0)//, FALSE) A.adjustToxLoss(-5, 0) A.adjustBruteLoss(-5, 0) A.updatehealth() @@ -113,7 +111,7 @@ data["restoring"] = restoring data["health"] = (AI.health + 100) / 2 data["isDead"] = AI.stat == DEAD - data["laws"] = AI.laws.get_law_list(include_zeroth = 1) + data["laws"] = AI.laws.get_law_list(include_zeroth = TRUE, render_html = FALSE) return data diff --git a/code/modules/modular_computers/file_system/programs/alarm.dm b/code/modules/modular_computers/file_system/programs/alarm.dm index 34daeff6ca..577fad83d0 100644 --- a/code/modules/modular_computers/file_system/programs/alarm.dm +++ b/code/modules/modular_computers/file_system/programs/alarm.dm @@ -8,9 +8,6 @@ network_destination = "alarm monitoring network" size = 5 tgui_id = "NtosStationAlertConsole" - ui_x = 315 - ui_y = 500 - var/has_alert = 0 var/alarms = list("Fire" = list(), "Atmosphere" = list(), "Power" = list()) diff --git a/code/modules/modular_computers/file_system/programs/antagonist/contract_uplink.dm b/code/modules/modular_computers/file_system/programs/antagonist/contract_uplink.dm index cf842f086f..3accb8e02d 100644 --- a/code/modules/modular_computers/file_system/programs/antagonist/contract_uplink.dm +++ b/code/modules/modular_computers/file_system/programs/antagonist/contract_uplink.dm @@ -1,6 +1,6 @@ /datum/computer_file/program/contract_uplink filename = "contractor uplink" - filedesc = "Syndicate Contract Uplink" + filedesc = "Syndicate Contractor Uplink" program_icon_state = "assign" extended_desc = "A standard, Syndicate issued system for handling important contracts while on the field." size = 10 @@ -9,8 +9,6 @@ unsendable = 1 undeletable = 1 tgui_id = "SyndContractor" - ui_x = 500 - ui_y = 600 var/error = "" var/info_screen = TRUE var/assigned = FALSE @@ -22,14 +20,18 @@ /datum/computer_file/program/contract_uplink/ui_act(action, params) if(..()) return TRUE + var/mob/living/user = usr var/obj/item/computer_hardware/hard_drive/small/syndicate/hard_drive = computer.all_components[MC_HDD] + switch(action) if("PRG_contract-accept") var/contract_id = text2num(params["contract_id"]) + // Set as the active contract hard_drive.traitor_data.contractor_hub.assigned_contracts[contract_id].status = CONTRACT_STATUS_ACTIVE hard_drive.traitor_data.contractor_hub.current_contract = hard_drive.traitor_data.contractor_hub.assigned_contracts[contract_id] + program_icon_state = "single_contract" return TRUE if("PRG_login") @@ -38,26 +40,30 @@ // Bake their data right into the hard drive, or we don't allow non-antags gaining access to an unused // contract system. // We also create their contracts at this point. - if(traitor_data) + if (traitor_data) // Only play greet sound, and handle contractor hub when assigning for the first time. - if(!traitor_data.contractor_hub) + if (!traitor_data.contractor_hub) user.playsound_local(user, 'sound/effects/contractstartup.ogg', 100, FALSE) traitor_data.contractor_hub = new traitor_data.contractor_hub.create_hub_items() + // Stops any topic exploits such as logging in multiple times on a single system. - if(!assigned) + if (!assigned) traitor_data.contractor_hub.create_contracts(traitor_data.owner) + hard_drive.traitor_data = traitor_data + program_icon_state = "contracts" assigned = TRUE else error = "UNAUTHORIZED USER" return TRUE if("PRG_call_extraction") - if(hard_drive.traitor_data.contractor_hub.current_contract.status != CONTRACT_STATUS_EXTRACTING) - if(hard_drive.traitor_data.contractor_hub.current_contract.handle_extraction(user)) + if (hard_drive.traitor_data.contractor_hub.current_contract.status != CONTRACT_STATUS_EXTRACTING) + if (hard_drive.traitor_data.contractor_hub.current_contract.handle_extraction(user)) user.playsound_local(user, 'sound/effects/confirmdropoff.ogg', 100, TRUE) hard_drive.traitor_data.contractor_hub.current_contract.status = CONTRACT_STATUS_EXTRACTING + program_icon_state = "extracted" else user.playsound_local(user, 'sound/machines/uplinkerror.ogg', 50) @@ -65,15 +71,19 @@ else user.playsound_local(user, 'sound/machines/uplinkerror.ogg', 50) error = "Already extracting... Place the target into the pod. If the pod was destroyed, this contract is no longer possible." + return TRUE if("PRG_contract_abort") var/contract_id = hard_drive.traitor_data.contractor_hub.current_contract.id + hard_drive.traitor_data.contractor_hub.current_contract = null hard_drive.traitor_data.contractor_hub.assigned_contracts[contract_id].status = CONTRACT_STATUS_ABORTED + program_icon_state = "contracts" + return TRUE if("PRG_redeem_TC") - if(hard_drive.traitor_data.contractor_hub.contract_TC_to_redeem) + if (hard_drive.traitor_data.contractor_hub.contract_TC_to_redeem) var/obj/item/stack/telecrystal/crystals = new /obj/item/stack/telecrystal(get_turf(user), hard_drive.traitor_data.contractor_hub.contract_TC_to_redeem) if(ishuman(user)) @@ -82,13 +92,14 @@ to_chat(H, "Your payment materializes into your hands!") else to_chat(user, "Your payment materializes onto the floor.") + hard_drive.traitor_data.contractor_hub.contract_TC_payed_out += hard_drive.traitor_data.contractor_hub.contract_TC_to_redeem hard_drive.traitor_data.contractor_hub.contract_TC_to_redeem = 0 return TRUE else user.playsound_local(user, 'sound/machines/uplinkerror.ogg', 50) return TRUE - if("PRG_clear_error") + if ("PRG_clear_error") error = "" return TRUE if("PRG_set_first_load_finished") @@ -97,10 +108,11 @@ if("PRG_toggle_info") info_screen = !info_screen return TRUE - if("buy_hub") - if(hard_drive.traitor_data.owner.current == user) + if ("buy_hub") + if (hard_drive.traitor_data.owner.current == user) var/item = params["item"] - for(var/datum/contractor_item/hub_item in hard_drive.traitor_data.contractor_hub.hub_items) + + for (var/datum/contractor_item/hub_item in hard_drive.traitor_data.contractor_hub.hub_items) if (hub_item.name == item) hub_item.handle_purchase(hard_drive.traitor_data.contractor_hub, user) else @@ -112,13 +124,15 @@ var/screen_to_be = null data["first_load"] = first_load - if(hard_drive && hard_drive.traitor_data != null) + + if (hard_drive && hard_drive.traitor_data != null) var/datum/antagonist/traitor/traitor_data = hard_drive.traitor_data data += get_header_data() - if(traitor_data.contractor_hub.current_contract) + + if (traitor_data.contractor_hub.current_contract) data["ongoing_contract"] = TRUE screen_to_be = "single_contract" - if(traitor_data.contractor_hub.current_contract.status == CONTRACT_STATUS_EXTRACTING) + if (traitor_data.contractor_hub.current_contract.status == CONTRACT_STATUS_EXTRACTING) data["extraction_enroute"] = TRUE screen_to_be = "extracted" else @@ -126,15 +140,19 @@ else data["ongoing_contract"] = FALSE data["extraction_enroute"] = FALSE + data["logged_in"] = TRUE data["station_name"] = GLOB.station_name data["redeemable_tc"] = traitor_data.contractor_hub.contract_TC_to_redeem data["earned_tc"] = traitor_data.contractor_hub.contract_TC_payed_out data["contracts_completed"] = traitor_data.contractor_hub.contracts_completed data["contract_rep"] = traitor_data.contractor_hub.contract_rep + data["info_screen"] = info_screen + data["error"] = error - for(var/datum/contractor_item/hub_item in traitor_data.contractor_hub.hub_items) + + for (var/datum/contractor_item/hub_item in traitor_data.contractor_hub.hub_items) data["contractor_hub_items"] += list(list( "name" = hub_item.name, "desc" = hub_item.desc, @@ -142,7 +160,8 @@ "limited" = hub_item.limited, "item_icon" = hub_item.item_icon )) - for(var/datum/syndicate_contract/contract in traitor_data.contractor_hub.assigned_contracts) + + for (var/datum/syndicate_contract/contract in traitor_data.contractor_hub.assigned_contracts) data["contracts"] += list(list( "target" = contract.contract.target, "target_rank" = contract.target_rank, @@ -155,23 +174,28 @@ )) var/direction - if(traitor_data.contractor_hub.current_contract) + if (traitor_data.contractor_hub.current_contract) var/turf/curr = get_turf(user) var/turf/dropoff_turf data["current_location"] = "[get_area_name(curr, TRUE)]" - for(var/turf/content in traitor_data.contractor_hub.current_contract.contract.dropoff.contents) - if(isturf(content)) + + for (var/turf/content in traitor_data.contractor_hub.current_contract.contract.dropoff.contents) + if (isturf(content)) dropoff_turf = content break + if(curr.z == dropoff_turf.z) //Direction calculations for same z-level only direction = uppertext(dir2text(get_dir(curr, dropoff_turf))) //Direction text (East, etc). Not as precise, but still helpful. if(get_area(user) == traitor_data.contractor_hub.current_contract.contract.dropoff) direction = "LOCATION CONFIRMED" else direction = "???" + data["dropoff_direction"] = direction + else data["logged_in"] = FALSE + program_icon_state = screen_to_be update_computer_icon() return data diff --git a/code/modules/modular_computers/file_system/programs/antagonist/dos.dm b/code/modules/modular_computers/file_system/programs/antagonist/dos.dm index 9dedc3810f..803dadc0a0 100644 --- a/code/modules/modular_computers/file_system/programs/antagonist/dos.dm +++ b/code/modules/modular_computers/file_system/programs/antagonist/dos.dm @@ -8,8 +8,6 @@ available_on_ntnet = FALSE available_on_syndinet = TRUE tgui_id = "NtosNetDos" - ui_x = 400 - ui_y = 250 var/obj/machinery/ntnet_relay/target = null var/dos_speed = 0 diff --git a/code/modules/modular_computers/file_system/programs/antagonist/revelation.dm b/code/modules/modular_computers/file_system/programs/antagonist/revelation.dm index a312815008..2ba3d69fe6 100644 --- a/code/modules/modular_computers/file_system/programs/antagonist/revelation.dm +++ b/code/modules/modular_computers/file_system/programs/antagonist/revelation.dm @@ -8,9 +8,6 @@ available_on_ntnet = FALSE available_on_syndinet = TRUE tgui_id = "NtosRevelation" - ui_x = 400 - ui_y = 250 - var/armed = 0 /datum/computer_file/program/revelation/run_program(var/mob/living/user) diff --git a/code/modules/modular_computers/file_system/programs/arcade.dm b/code/modules/modular_computers/file_system/programs/arcade.dm index 87debafd6b..2503073f9a 100644 --- a/code/modules/modular_computers/file_system/programs/arcade.dm +++ b/code/modules/modular_computers/file_system/programs/arcade.dm @@ -7,8 +7,6 @@ network_destination = "arcade network" size = 6 tgui_id = "NtosArcade" - ui_x = 450 - ui_y = 350 ///Returns TRUE if the game is being played. var/game_active = TRUE @@ -27,6 +25,7 @@ /datum/computer_file/program/arcade/proc/game_check(mob/user) sleep(5) + //user?.mind?.adjust_experience(/datum/skill/gaming, 1) No gaming(TM) Yet if(boss_hp <= 0) heads_up = "You have crushed [boss_name]! Rejoice!" playsound(computer.loc, 'sound/arcade/win.ogg', 50, TRUE, extrarange = -3, falloff = 10) @@ -35,6 +34,7 @@ if(istype(computer)) computer.update_icon() ticket_count += 1 + //user?.mind?.adjust_experience(/datum/skill/gaming, 50) sleep(10) else if(player_hp <= 0 || player_mp <= 0) heads_up = "You have been defeated... how will the station survive?" @@ -43,6 +43,7 @@ program_icon_state = "arcade_off" if(istype(computer)) computer.update_icon() + //user?.mind?.adjust_experience(/datum/skill/gaming, 10) sleep(10) /datum/computer_file/program/arcade/proc/enemy_check(mob/user) @@ -73,14 +74,13 @@ pause_state = FALSE game_check() -/datum/computer_file/program/arcade/ui_interact(mob/user, ui_key, datum/tgui/ui, force_open, datum/tgui/master_ui, datum/ui_state/state) - . = ..() - var/datum/asset/assets = get_asset_datum(/datum/asset/simple/arcade) - assets.send(user) +/datum/computer_file/program/arcade/ui_assets(mob/user) + return list( + get_asset_datum(/datum/asset/simple/arcade), + ) /datum/computer_file/program/arcade/ui_data(mob/user) var/list/data = get_header_data() - data["Hitpoints"] = boss_hp data["PlayerHitpoints"] = player_hp data["PlayerMP"] = player_mp @@ -98,11 +98,13 @@ if(computer) printer = computer.all_components[MC_PRINT] + //var/gamerSkillLevel = usr.mind?.get_skill_level(/datum/skill/gaming) + //var/gamerSkill = usr.mind?.get_skill_modifier(/datum/skill/gaming, SKILL_RANDS_MODIFIER) switch(action) if("Attack") var/attackamt = 0 //Spam prevention. if(pause_state == FALSE) - attackamt = rand(2,6) + attackamt = rand(2,6)// + rand(0, gamerSkill) pause_state = TRUE heads_up = "You attack for [attackamt] damage." playsound(computer.loc, 'sound/arcade/hit.ogg', 50, TRUE, extrarange = -3, falloff = 10) @@ -115,8 +117,10 @@ var/healamt = 0 //More Spam Prevention. var/healcost = 0 if(pause_state == FALSE) - healamt = rand(6,8) + healamt = rand(6,8)// + rand(0, gamerSkill) var/maxPointCost = 3 + //if(gamerSkillLevel >= SKILL_LEVEL_JOURNEYMAN) + // maxPointCost = 2 healcost = rand(1, maxPointCost) pause_state = TRUE heads_up = "You heal for [healamt] damage." @@ -130,7 +134,7 @@ if("Recharge_Power") var/rechargeamt = 0 //As above. if(pause_state == FALSE) - rechargeamt = rand(4, 7) + rechargeamt = rand(4,7)// + rand(0, gamerSkill) pause_state = TRUE heads_up = "You regain [rechargeamt] magic power." playsound(computer.loc, 'sound/arcade/mana.ogg', 50, TRUE, extrarange = -3, falloff = 10) diff --git a/code/modules/modular_computers/file_system/programs/atmosscan.dm b/code/modules/modular_computers/file_system/programs/atmosscan.dm index fe3833facd..5168e0bb79 100644 --- a/code/modules/modular_computers/file_system/programs/atmosscan.dm +++ b/code/modules/modular_computers/file_system/programs/atmosscan.dm @@ -6,8 +6,6 @@ network_destination = "atmos scan" size = 4 tgui_id = "NtosAtmos" - ui_x = 300 - ui_y = 350 /datum/computer_file/program/atmosscan/ui_data(mob/user) var/list/data = get_header_data() diff --git a/code/modules/modular_computers/file_system/programs/borg_monitor.dm b/code/modules/modular_computers/file_system/programs/borg_monitor.dm index c493926c65..c2160a0e92 100644 --- a/code/modules/modular_computers/file_system/programs/borg_monitor.dm +++ b/code/modules/modular_computers/file_system/programs/borg_monitor.dm @@ -9,21 +9,17 @@ network_destination = "cyborg remote monitoring" size = 5 tgui_id = "NtosCyborgRemoteMonitor" - ui_x = 600 - ui_y = 800 /datum/computer_file/program/borg_monitor/ui_data(mob/user) var/list/data = get_header_data() data["card"] = FALSE - if(computer.GetID()) + if(checkID()) data["card"] = TRUE data["cyborgs"] = list() for(var/mob/living/silicon/robot/R in GLOB.silicon_mobs) - if((get_turf(computer)).z != (get_turf(R)).z) - continue - if(R.scrambledcodes) + if(!evaluate_borg(R)) continue var/list/upgrade @@ -36,7 +32,7 @@ var/list/cyborg_data = list( name = R.name, - locked_down = R.locked_down, + locked_down = R.lockcharge, status = R.stat, shell_discon = shell, charge = R.cell ? round(R.cell.percent()) : null, @@ -56,14 +52,53 @@ var/mob/living/silicon/robot/R = locate(params["ref"]) in GLOB.silicon_mobs if(!istype(R)) return - var/obj/item/card/id/ID = computer.GetID() + var/ID = checkID() if(!ID) return var/message = stripped_input(usr, message = "Enter message to be sent to remote cyborg.", title = "Send Message") if(!message) return - to_chat(R, "

Message from [ID.registered_name] -- \"[message]\"
") + to_chat(R, "

Message from [ID] -- \"[message]\"
") SEND_SOUND(R, 'sound/machines/twobeep_high.ogg') if(R.connected_ai) - to_chat(R.connected_ai, "

Message from [ID.registered_name] to [R] -- \"[message]\"
") + to_chat(R.connected_ai, "

Message from [ID] to [R] -- \"[message]\"
") SEND_SOUND(R.connected_ai, 'sound/machines/twobeep_high.ogg') + usr.log_talk(message, LOG_PDA, tag="Cyborg Monitor Program: ID name \"[ID]\" to [R]") + +///This proc is used to determin if a borg should be shown in the list (based on the borg's scrambledcodes var). Syndicate version overrides this to show only syndicate borgs. +/datum/computer_file/program/borg_monitor/proc/evaluate_borg(mob/living/silicon/robot/R) + if((get_turf(computer)).z != (get_turf(R)).z) + return FALSE + if(R.scrambledcodes) + return FALSE + return TRUE + +///Gets the ID's name, if one is inserted into the device. This is a seperate proc solely to be overridden by the syndicate version of the app. +/datum/computer_file/program/borg_monitor/proc/checkID() + var/obj/item/card/id/ID = computer.GetID() + if(!ID) + return FALSE + return ID.registered_name + +/datum/computer_file/program/borg_monitor/syndicate + filename = "scyborgmonitor" + filedesc = "Mission-Specific Cyborg Remote Monitoring" + ui_header = "borg_mon.gif" + program_icon_state = "generic" + extended_desc = "This program allows for remote monitoring of mission-assigned cyborgs." + requires_ntnet = FALSE + available_on_ntnet = FALSE + available_on_syndinet = TRUE + transfer_access = null + network_destination = "cyborg remote monitoring" + tgui_id = "NtosCyborgRemoteMonitorSyndicate" + +/datum/computer_file/program/borg_monitor/syndicate/evaluate_borg(mob/living/silicon/robot/R) + if((get_turf(computer)).z != (get_turf(R)).z) + return FALSE + if(!R.scrambledcodes) + return FALSE + return TRUE + +/datum/computer_file/program/borg_monitor/syndicate/checkID() + return "\[CLASSIFIED\]" //no ID is needed for the syndicate version's message function, and the borg will see "[CLASSIFIED]" as the message sender. diff --git a/code/modules/modular_computers/file_system/programs/bounty_board.dm b/code/modules/modular_computers/file_system/programs/bounty_board.dm new file mode 100644 index 0000000000..46fde84f65 --- /dev/null +++ b/code/modules/modular_computers/file_system/programs/bounty_board.dm @@ -0,0 +1,120 @@ +/datum/computer_file/program/bounty_board + filename = "bountyboard" + filedesc = "Bounty Board Request Network" + program_icon_state = "bountyboard" + extended_desc = "A multi-platform network for placing requests across the station, with payment across the network being possible.." + requires_ntnet = TRUE + network_destination = "bounty board interface" + size = 10 + tgui_id = "NtosRequestKiosk" + ///Reference to the currently logged in user. + var/datum/bank_account/current_user + ///The station request datum being affected by UI actions. + var/datum/station_request/active_request + ///Value of the currently bounty input + var/bounty_value = 1 + ///Text of the currently written bounty + var/bounty_text = "" + ///Has the app been added to the network yet? + var/networked = FALSE + +/datum/computer_file/program/bounty_board/ui_data(mob/user) + var/list/data = get_header_data() + var/list/formatted_requests = list() + var/list/formatted_applicants = list() + var/obj/item/computer_hardware/card_slot/card_slot = computer.all_components[MC_CARD] + if(!networked) + GLOB.allbountyboards += computer + networked = TRUE + if(card_slot && card_slot.stored_card && card_slot.stored_card.registered_account) + current_user = card_slot.stored_card.registered_account + for(var/i in GLOB.request_list) + if(!i) + continue + var/datum/station_request/request = i + formatted_requests += list(list("owner" = request.owner, "value" = request.value, "description" = request.description, "acc_number" = request.req_number)) + if(request.applicants) + for(var/datum/bank_account/j in request.applicants) + formatted_applicants += list(list("name" = j.account_holder, "request_id" = request.owner_account.account_id, "requestee_id" = j.account_id)) + if(current_user) + data["accountName"] = current_user.account_holder + data["requests"] = formatted_requests + data["applicants"] = formatted_applicants + data["bountyValue"] = bounty_value + data["bountyText"] = bounty_text + return data + +/datum/computer_file/program/bounty_board/ui_act(action, list/params) + if(..()) + return + var/current_ref_num = params["request"] + var/current_app_num = params["applicant"] + var/datum/bank_account/request_target + if(current_ref_num) + for(var/datum/station_request/i in GLOB.request_list) + if("[i.req_number]" == "[current_ref_num]") + active_request = i + break + if(active_request) + for(var/datum/bank_account/j in active_request.applicants) + if("[j.account_id]" == "[current_app_num]") + request_target = j + break + switch(action) + if("createBounty") + if(!current_user || !bounty_text) + playsound(src, 'sound/machines/buzz-sigh.ogg', 20, TRUE) + return TRUE + for(var/datum/station_request/i in GLOB.request_list) + if("[i.req_number]" == "[current_user.account_id]") + computer.say("Account already has active bounty.") + return + var/datum/station_request/curr_request = new /datum/station_request(current_user.account_holder, bounty_value,bounty_text,current_user.account_id, current_user) + GLOB.request_list += list(curr_request) + for(var/obj/i in GLOB.allbountyboards) + i.say("New bounty has been added!") + playsound(i.loc, 'sound/effects/cashregister.ogg', 30, TRUE) + return TRUE + if("apply") + if(!current_user) + computer.say("Please swipe a valid ID first.") + return TRUE + if(current_user.account_holder == active_request.owner) + playsound(computer, 'sound/machines/buzz-sigh.ogg', 20, TRUE) + return TRUE + active_request.applicants += list(current_user) + if("payApplicant") + if(!current_user) + return + if(!current_user.has_money(active_request.value) || (current_user.account_holder != active_request.owner)) + playsound(computer, 'sound/machines/buzz-sigh.ogg', 30, TRUE) + return + request_target.transfer_money(current_user, active_request.value) + computer.say("Paid out [active_request.value] credits.") + return TRUE + if("clear") + if(current_user) + current_user = null + computer.say("Account Reset.") + return TRUE + if("deleteRequest") + if(!current_user) + playsound(computer, 'sound/machines/buzz-sigh.ogg', 20, TRUE) + return TRUE + if(active_request.owner != current_user.account_holder) + playsound(computer, 'sound/machines/buzz-sigh.ogg', 20, TRUE) + return TRUE + computer.say("Deleted current request.") + GLOB.request_list.Remove(active_request) + return TRUE + if("bountyVal") + bounty_value = text2num(params["bountyval"]) + if(!bounty_value) + bounty_value = 1 + if("bountyText") + bounty_text = (params["bountytext"]) + . = TRUE + +/datum/computer_file/program/bounty_board/Destroy() + GLOB.allbountyboards -= computer + . = ..() diff --git a/code/modules/modular_computers/file_system/programs/card.dm b/code/modules/modular_computers/file_system/programs/card.dm index 07d39438d8..842d6e2588 100644 --- a/code/modules/modular_computers/file_system/programs/card.dm +++ b/code/modules/modular_computers/file_system/programs/card.dm @@ -15,8 +15,6 @@ requires_ntnet = 0 size = 8 tgui_id = "NtosCard" - ui_x = 450 - ui_y = 520 var/is_centcom = FALSE var/minor = FALSE @@ -275,7 +273,7 @@ departments = list("CentCom" = get_all_centcom_jobs()) else if(isnull(departments)) departments = list( - CARDCON_DEPARTMENT_COMMAND = list("Captain"), + CARDCON_DEPARTMENT_COMMAND = list("Captain"),//lol CARDCON_DEPARTMENT_ENGINEERING = GLOB.engineering_positions, CARDCON_DEPARTMENT_MEDICAL = GLOB.medical_positions, CARDCON_DEPARTMENT_SCIENCE = GLOB.science_positions, diff --git a/code/modules/modular_computers/file_system/programs/cargobounty.dm b/code/modules/modular_computers/file_system/programs/cargobounty.dm new file mode 100644 index 0000000000..d9bc65c98d --- /dev/null +++ b/code/modules/modular_computers/file_system/programs/cargobounty.dm @@ -0,0 +1,48 @@ +/datum/computer_file/program/bounty + filename = "bounty" + filedesc = "Nanotrasen Bounty Hunter" + program_icon_state = "bounty" + extended_desc = "A basic interface for supply personnel to check and claim bounties." + requires_ntnet = TRUE + transfer_access = ACCESS_CARGO + network_destination = "cargo claims interface" + size = 10 + tgui_id = "NtosBountyConsole" + ///cooldown var for printing paper sheets. + var/printer_ready = 0 + ///The cargo account for grabbing the cargo account's credits. + var/static/datum/bank_account/cargocash + +/datum/computer_file/program/bounty/proc/print_paper() + new /obj/item/paper/bounty_printout(get_turf(computer)) + +/datum/computer_file/program/bounty/ui_interact(mob/user, datum/tgui/ui) + if(!GLOB.bounties_list.len) + setup_bounties() + printer_ready = world.time + PRINTER_TIMEOUT + cargocash = SSeconomy.get_dep_account(ACCOUNT_CAR) + . = ..() + +/datum/computer_file/program/bounty/ui_data(mob/user) + var/list/data = get_header_data() + var/list/bountyinfo = list() + for(var/datum/bounty/B in GLOB.bounties_list) + bountyinfo += list(list("name" = B.name, "description" = B.description, "reward_string" = B.reward_string(), "completion_string" = B.completion_string() , "claimed" = B.claimed, "can_claim" = B.can_claim(), "priority" = B.high_priority, "bounty_ref" = REF(B))) + data["stored_cash"] = cargocash.account_balance + data["bountydata"] = bountyinfo + return data + +/datum/computer_file/program/bounty/ui_act(action,params) + if(..()) + return + switch(action) + if("ClaimBounty") + var/datum/bounty/cashmoney = locate(params["bounty"]) in GLOB.bounties_list + if(cashmoney) + cashmoney.claim() + return TRUE + if("Print") + if(printer_ready < world.time) + printer_ready = world.time + PRINTER_TIMEOUT + print_paper() + return diff --git a/code/modules/modular_computers/file_system/programs/cargoship.dm b/code/modules/modular_computers/file_system/programs/cargoship.dm index 39543adfa5..3ba08a3719 100644 --- a/code/modules/modular_computers/file_system/programs/cargoship.dm +++ b/code/modules/modular_computers/file_system/programs/cargoship.dm @@ -6,11 +6,9 @@ network_destination = "ship scanner" size = 6 tgui_id = "NtosShipping" - ui_x = 450 - ui_y = 350 ///Account used for creating barcodes. var/datum/bank_account/payments_acc - ///The amount which the tagger will recieve for the sale. + ///The amount which the tagger will receive for the sale. var/percent_cut = 20 /datum/computer_file/program/shipping/ui_data(mob/user) diff --git a/code/modules/modular_computers/file_system/programs/configurator.dm b/code/modules/modular_computers/file_system/programs/configurator.dm index 76da58ea11..fae06544d5 100644 --- a/code/modules/modular_computers/file_system/programs/configurator.dm +++ b/code/modules/modular_computers/file_system/programs/configurator.dm @@ -10,8 +10,6 @@ unsendable = 1 undeletable = 1 size = 4 - ui_x = 420 - ui_y = 630 available_on_ntnet = 0 requires_ntnet = 0 tgui_id = "NtosConfiguration" diff --git a/code/modules/modular_computers/file_system/programs/crewmanifest.dm b/code/modules/modular_computers/file_system/programs/crewmanifest.dm index 662c867a39..37961d5803 100644 --- a/code/modules/modular_computers/file_system/programs/crewmanifest.dm +++ b/code/modules/modular_computers/file_system/programs/crewmanifest.dm @@ -7,8 +7,6 @@ requires_ntnet = FALSE size = 4 tgui_id = "NtosCrewManifest" - ui_x = 400 - ui_y = 480 /datum/computer_file/program/crew_manifest/ui_static_data(mob/user) var/list/data = list() @@ -41,9 +39,9 @@ if(computer && printer) //This option should never be called if there is no printer var/contents = {"

Crew Manifest


- [GLOB.data_core ? GLOB.data_core.get_manifest_html(0) : ""] + [GLOB.data_core ? GLOB.data_core.get_manifest() : ""] "} - if(!printer.print_text(contents,text("crew manifest ([])", station_time_timestamp()))) + if(!printer.print_text(contents,text("crew manifest ([])", STATION_TIME_TIMESTAMP("hh:mm:ss", world.time)))) to_chat(usr, "Hardware error: Printer was unable to print the file. It may be out of paper.") return else diff --git a/code/modules/modular_computers/file_system/programs/jobmanagement.dm b/code/modules/modular_computers/file_system/programs/jobmanagement.dm index 7b847c123e..bccc6e4dbe 100644 --- a/code/modules/modular_computers/file_system/programs/jobmanagement.dm +++ b/code/modules/modular_computers/file_system/programs/jobmanagement.dm @@ -7,8 +7,6 @@ requires_ntnet = 0 size = 4 tgui_id = "NtosJobManager" - ui_x = 400 - ui_y = 620 var/change_position_cooldown = 30 //Jobs you cannot open new positions for diff --git a/code/modules/modular_computers/file_system/programs/ntdownloader.dm b/code/modules/modular_computers/file_system/programs/ntdownloader.dm index 352f13f305..6401d6207f 100644 --- a/code/modules/modular_computers/file_system/programs/ntdownloader.dm +++ b/code/modules/modular_computers/file_system/programs/ntdownloader.dm @@ -11,8 +11,6 @@ available_on_ntnet = 0 ui_header = "downloader_finished.gif" tgui_id = "NtosNetDownloader" - ui_x = 480 - ui_y = 735 var/datum/computer_file/program/downloaded_file = null var/hacked_download = 0 @@ -20,6 +18,21 @@ var/download_netspeed = 0 var/downloaderror = "" var/obj/item/modular_computer/my_computer = null + var/emagged = FALSE + var/list/main_repo + var/list/antag_repo + +/datum/computer_file/program/ntnetdownload/run_program() + . = ..() + main_repo = SSnetworks.station_network.available_station_software + antag_repo = SSnetworks.station_network.available_antag_software + +/datum/computer_file/program/ntnetdownload/run_emag() + if(emagged) + return FALSE + emagged = TRUE + return TRUE + /datum/computer_file/program/ntnetdownload/proc/begin_file_download(filename) if(downloaded_file) @@ -30,8 +43,8 @@ if(!PRG || !istype(PRG)) return 0 - // Attempting to download antag only program, but without having emagged computer. No. - if(PRG.available_on_syndinet && !(computer.obj_flags & EMAGGED)) + // Attempting to download antag only program, but without having emagged/syndicate computer. No. + if(PRG.available_on_syndinet && !emagged) return 0 var/obj/item/computer_hardware/hard_drive/hard_drive = computer.all_components[MC_HDD] @@ -41,10 +54,10 @@ ui_header = "downloader_running.gif" - if(PRG in SSnetworks.station_network.available_station_software) + if(PRG in main_repo) generate_network_log("Began downloading file [PRG.filename].[PRG.filetype] from NTNet Software Repository.") hacked_download = 0 - else if(PRG in SSnetworks.station_network.available_antag_software) + else if(PRG in antag_repo) generate_network_log("Began downloading file **ENCRYPTED**.[PRG.filetype] from unspecified server.") hacked_download = 1 else @@ -130,7 +143,7 @@ data["disk_size"] = hard_drive.max_capacity data["disk_used"] = hard_drive.used_capacity var/list/all_entries[0] - for(var/A in SSnetworks.station_network.available_station_software) + for(var/A in main_repo) var/datum/computer_file/program/P = A // Only those programs our user can run will show in the list if(!P.can_run(user,transfer = 1) || hard_drive.find_file_by_name(P.filename)) @@ -143,9 +156,9 @@ "size" = P.size, ))) data["hackedavailable"] = FALSE - if(computer.obj_flags & EMAGGED) // If we are running on emagged computer we have access to some "bonus" software + if(emagged) // If we are running on emagged computer we have access to some "bonus" software var/list/hacked_programs[0] - for(var/S in SSnetworks.station_network.available_antag_software) + for(var/S in antag_repo) var/datum/computer_file/program/P = S if(hard_drive.find_file_by_name(P.filename)) continue @@ -172,3 +185,24 @@ /datum/computer_file/program/ntnetdownload/kill_program(forced) abort_file_download() return ..(forced) + +//////////////////////// +//Syndicate Downloader// +//////////////////////// + +/// This app only lists programs normally found in the emagged section of the normal downloader app + +/datum/computer_file/program/ntnetdownload/syndicate + filename = "syndownloader" + filedesc = "Software Download Tool" + program_icon_state = "generic" + extended_desc = "This program allows downloads of software from shared Syndicate repositories" + requires_ntnet = 0 + ui_header = "downloader_finished.gif" + tgui_id = "NtosNetDownloader" + emagged = TRUE + +/datum/computer_file/program/ntnetdownload/syndicate/run_program() + . = ..() + main_repo = SSnetworks.station_network.available_antag_software + antag_repo = null diff --git a/code/modules/modular_computers/file_system/programs/ntnrc_client.dm b/code/modules/modular_computers/file_system/programs/ntnrc_client.dm index 4ae5bd326b..df9b02d8ec 100644 --- a/code/modules/modular_computers/file_system/programs/ntnrc_client.dm +++ b/code/modules/modular_computers/file_system/programs/ntnrc_client.dm @@ -10,9 +10,6 @@ ui_header = "ntnrc_idle.gif" available_on_ntnet = 1 tgui_id = "NtosNetChat" - ui_x = 900 - ui_y = 675 - var/last_message // Used to generate the toolbar icon var/username var/active_channel diff --git a/code/modules/modular_computers/file_system/programs/nttransfer.dm b/code/modules/modular_computers/file_system/programs/nttransfer.dm deleted file mode 100644 index 698e557941..0000000000 --- a/code/modules/modular_computers/file_system/programs/nttransfer.dm +++ /dev/null @@ -1,183 +0,0 @@ -/datum/computer_file/program/nttransfer - filename = "nttransfer" - filedesc = "P2P Transfer Client" - extended_desc = "This program allows for simple file transfer via direct peer to peer connection." - program_icon_state = "comm_logs" - size = 7 - requires_ntnet = 1 - requires_ntnet_feature = NTNET_PEERTOPEER - network_destination = "other device via P2P tunnel" - available_on_ntnet = 1 - tgui_id = "ntos_net_transfer" - - var/error = "" // Error screen - var/server_password = "" // Optional password to download the file. - var/datum/computer_file/provided_file = null // File which is provided to clients. - var/datum/computer_file/downloaded_file = null // File which is being downloaded - var/list/connected_clients = list() // List of connected clients. - var/datum/computer_file/program/nttransfer/remote // Client var, specifies who are we downloading from. - var/download_completion = 0 // Download progress in GQ - var/download_netspeed = 0 // Our connectivity speed in GQ/s - var/actual_netspeed = 0 // Displayed in the UI, this is the actual transfer speed. - var/unique_token // UID of this program - var/upload_menu = 0 // Whether we show the program list and upload menu - var/static/nttransfer_uid = 0 - -/datum/computer_file/program/nttransfer/New() - unique_token = nttransfer_uid++ - ..() - -/datum/computer_file/program/nttransfer/process_tick() - // Server mode - update_netspeed() - if(provided_file) - for(var/datum/computer_file/program/nttransfer/C in connected_clients) - // Transfer speed is limited by device which uses slower connectivity. - // We can have multiple clients downloading at same time, but let's assume we use some sort of multicast transfer - // so they can all run on same speed. - C.actual_netspeed = min(C.download_netspeed, download_netspeed) - C.download_completion += C.actual_netspeed - if(C.download_completion >= provided_file.size) - C.finish_download() - else if(downloaded_file) // Client mode - if(!remote) - crash_download("Connection to remote server lost") - -/datum/computer_file/program/nttransfer/kill_program(forced = FALSE) - if(downloaded_file) // Client mode, clean up variables for next use - finalize_download() - - if(provided_file) // Server mode, disconnect all clients - for(var/datum/computer_file/program/nttransfer/P in connected_clients) - P.crash_download("Connection terminated by remote server") - downloaded_file = null - ..(forced) - -/datum/computer_file/program/nttransfer/proc/update_netspeed() - download_netspeed = 0 - switch(ntnet_status) - if(1) - download_netspeed = NTNETSPEED_LOWSIGNAL - if(2) - download_netspeed = NTNETSPEED_HIGHSIGNAL - if(3) - download_netspeed = NTNETSPEED_ETHERNET - -// Finishes download and attempts to store the file on HDD -/datum/computer_file/program/nttransfer/proc/finish_download() - var/obj/item/computer_hardware/hard_drive/hard_drive = computer.all_components[MC_HDD] - if(!computer || !hard_drive || !hard_drive.store_file(downloaded_file)) - error = "I/O Error: Unable to save file. Check your hard drive and try again." - finalize_download() - -// Crashes the download and displays specific error message -/datum/computer_file/program/nttransfer/proc/crash_download(var/message) - error = message ? message : "An unknown error has occurred during download" - finalize_download() - -// Cleans up variables for next use -/datum/computer_file/program/nttransfer/proc/finalize_download() - if(remote) - remote.connected_clients.Remove(src) - downloaded_file = null - remote = null - download_completion = 0 - -/datum/computer_file/program/nttransfer/ui_act(action, params) - if(..()) - return 1 - switch(action) - if("PRG_downloadfile") - for(var/datum/computer_file/program/nttransfer/P in SSnetworks.station_network.fileservers) - if("[P.unique_token]" == params["id"]) - remote = P - break - if(!remote || !remote.provided_file) - return - if(remote.server_password) - var/pass = reject_bad_text(input(usr, "Code 401 Unauthorized. Please enter password:", "Password required")) - if(pass != remote.server_password) - error = "Incorrect Password" - return - downloaded_file = remote.provided_file.clone() - remote.connected_clients.Add(src) - return 1 - if("PRG_reset") - error = "" - upload_menu = 0 - finalize_download() - if(src in SSnetworks.station_network.fileservers) - SSnetworks.station_network.fileservers.Remove(src) - for(var/datum/computer_file/program/nttransfer/T in connected_clients) - T.crash_download("Remote server has forcibly closed the connection") - provided_file = null - return 1 - if("PRG_setpassword") - var/pass = reject_bad_text(input(usr, "Enter new server password. Leave blank to cancel, input 'none' to disable password.", "Server security", "none")) - if(!pass) - return - if(pass == "none") - server_password = "" - return - server_password = pass - return 1 - if("PRG_uploadfile") - var/obj/item/computer_hardware/hard_drive/hard_drive = computer.all_components[MC_HDD] - for(var/datum/computer_file/F in hard_drive.stored_files) - if("[F.uid]" == params["id"]) - if(F.unsendable) - error = "I/O Error: File locked." - return - if(istype(F, /datum/computer_file/program)) - var/datum/computer_file/program/P = F - if(!P.can_run(usr,transfer = 1)) - error = "Access Error: Insufficient rights to upload file." - provided_file = F - SSnetworks.station_network.fileservers.Add(src) - return - error = "I/O Error: Unable to locate file on hard drive." - return 1 - if("PRG_uploadmenu") - upload_menu = 1 - - -/datum/computer_file/program/nttransfer/ui_data(mob/user) - - var/list/data = get_header_data() - - if(error) - data["error"] = error - else if(downloaded_file) - data["downloading"] = 1 - data["download_size"] = downloaded_file.size - data["download_progress"] = download_completion - data["download_netspeed"] = actual_netspeed - data["download_name"] = "[downloaded_file.filename].[downloaded_file.filetype]" - else if (provided_file) - data["uploading"] = 1 - data["upload_uid"] = unique_token - data["upload_clients"] = connected_clients.len - data["upload_haspassword"] = server_password ? 1 : 0 - data["upload_filename"] = "[provided_file.filename].[provided_file.filetype]" - else if (upload_menu) - var/list/all_files[0] - var/obj/item/computer_hardware/hard_drive/hard_drive = computer.all_components[MC_HDD] - for(var/datum/computer_file/F in hard_drive.stored_files) - all_files.Add(list(list( - "uid" = F.uid, - "filename" = "[F.filename].[F.filetype]", - "size" = F.size - ))) - data["upload_filelist"] = all_files - else - var/list/all_servers[0] - for(var/datum/computer_file/program/nttransfer/P in SSnetworks.station_network.fileservers) - all_servers.Add(list(list( - "uid" = P.unique_token, - "filename" = "[P.provided_file.filename].[P.provided_file.filetype]", - "size" = P.provided_file.size, - "haspassword" = P.server_password ? 1 : 0 - ))) - data["servers"] = all_servers - - return data \ No newline at end of file diff --git a/code/modules/modular_computers/file_system/programs/powermonitor.dm b/code/modules/modular_computers/file_system/programs/powermonitor.dm index d2d57b1447..bd11474858 100644 --- a/code/modules/modular_computers/file_system/programs/powermonitor.dm +++ b/code/modules/modular_computers/file_system/programs/powermonitor.dm @@ -12,8 +12,6 @@ network_destination = "power monitoring system" size = 9 tgui_id = "NtosPowerMonitor" - ui_x = 550 - ui_y = 700 var/has_alert = 0 var/obj/structure/cable/attached_wire diff --git a/code/modules/modular_computers/file_system/programs/radar.dm b/code/modules/modular_computers/file_system/programs/radar.dm index 7a6e80267c..9b0e09ef99 100644 --- a/code/modules/modular_computers/file_system/programs/radar.dm +++ b/code/modules/modular_computers/file_system/programs/radar.dm @@ -2,31 +2,49 @@ filename = "genericfinder" filedesc = "debug_finder" ui_header = "borg_mon.gif" //DEBUG -- new icon before PR - program_icon_state = "generic" - extended_desc = "generic" + program_icon_state = "radarntos" requires_ntnet = TRUE transfer_access = null available_on_ntnet = FALSE + usage_flags = PROGRAM_LAPTOP | PROGRAM_TABLET network_destination = "tracking program" size = 5 tgui_id = "NtosRadar" - ui_x = 800 - ui_y = 600 - special_assets = list( - /datum/asset/simple/radar_assets, - ) ///List of trackable entities. Updated by the scan() proc. var/list/objects ///Ref of the last trackable object selected by the user in the tgui window. Updated in the ui_act() proc. var/atom/selected ///Used to store when the next scan is available. Updated by the scan() proc. var/next_scan = 0 + ///Used to keep track of the last value program_icon_state was set to, to prevent constant unnecessary update_icon() calls + var/last_icon_state = "" + ///Used by the tgui interface, themed NT or Syndicate. + var/arrowstyle = "ntosradarpointer.png" + ///Used by the tgui interface, themed for NT or Syndicate colors. + var/pointercolor = "green" + +/datum/computer_file/program/radar/run_program(mob/living/user) + . = ..() + if(.) + START_PROCESSING(SSfastprocess, src) + return + return FALSE /datum/computer_file/program/radar/kill_program(forced = FALSE) objects = list() selected = null + STOP_PROCESSING(SSfastprocess, src) return ..() +/datum/computer_file/program/radar/Destroy() + STOP_PROCESSING(SSfastprocess, src) + return ..() + +/datum/computer_file/program/radar/ui_assets(mob/user) + return list( + get_asset_datum(/datum/asset/simple/radar_assets), + ) + /datum/computer_file/program/radar/ui_data(mob/user) var/list/data = get_header_data() data["selected"] = selected @@ -65,7 +83,37 @@ * */ /datum/computer_file/program/radar/proc/track() - return + var/atom/movable/signal = find_atom() + if(!trackable(signal)) + return + + var/turf/here_turf = (get_turf(computer)) + var/turf/target_turf = (get_turf(signal)) + var/userot = FALSE + var/rot = 0 + var/pointer="crosshairs" + var/locx = (target_turf.x - here_turf.x) + 24 + var/locy = (here_turf.y - target_turf.y) + 24 + + if(get_dist_euclidian(here_turf, target_turf) > 24) + userot = TRUE + rot = round(Get_Angle(here_turf, target_turf)) + else + if(target_turf.z > here_turf.z) + pointer="caret-up" + else if(target_turf.z < here_turf.z) + pointer="caret-down" + + var/list/trackinfo = list( + "locx" = locx, + "locy" = locy, + "userot" = userot, + "rot" = rot, + "arrowstyle" = arrowstyle, + "color" = pointercolor, + "pointer" = pointer, + ) + return trackinfo /** * @@ -77,10 +125,12 @@ **arg1 is the atom being evaluated. */ /datum/computer_file/program/radar/proc/trackable(atom/movable/signal) - if(!signal) + if(!signal || !computer) return FALSE var/turf/here = get_turf(computer) var/turf/there = get_turf(signal) + if(!here || !there) + return FALSE //I was still getting a runtime even after the above check while scanning, so fuck it return (there.z == here.z) || (is_station_level(here.z) && is_station_level(there.z)) /** @@ -98,6 +148,59 @@ /datum/computer_file/program/radar/proc/scan() return +/** + * + *Finds the atom in the appropriate list that the `selected` var indicates + * + *The `selected` var holds a REF, which is a string. A mob REF may be + *something like "mob_209". In order to find the actual atom, we need + *to search the appropriate list for the REF string. This is dependant + *on the program (Lifeline uses GLOB.human_list, while Fission360 uses + *GLOB.poi_list), but the result will be the same; evaluate the string and + *return an atom reference. +*/ +/datum/computer_file/program/radar/proc/find_atom() + return + +//We use SSfastprocess for the program icon state because it runs faster than process_tick() does. +/datum/computer_file/program/radar/process() + if(computer.active_program != src) + STOP_PROCESSING(SSfastprocess, src) //We're not the active program, it's time to stop. + return + if(!selected) + return + + var/atom/movable/signal = find_atom() + if(!trackable(signal)) + program_icon_state = "[initial(program_icon_state)]lost" + if(last_icon_state != program_icon_state) + computer.update_icon() + last_icon_state = program_icon_state + return + + var/here_turf = get_turf(computer) + var/target_turf = get_turf(signal) + var/trackdistance = get_dist_euclidian(here_turf, target_turf) + switch(trackdistance) + if(0) + program_icon_state = "[initial(program_icon_state)]direct" + if(1 to 12) + program_icon_state = "[initial(program_icon_state)]close" + if(13 to 24) + program_icon_state = "[initial(program_icon_state)]medium" + if(25 to INFINITY) + program_icon_state = "[initial(program_icon_state)]far" + + if(last_icon_state != program_icon_state) + computer.update_icon() + last_icon_state = program_icon_state + computer.setDir(get_dir(here_turf, target_turf)) + +//We can use process_tick to restart fast processing, since the computer will be running this constantly either way. +/datum/computer_file/program/radar/process_tick() + if(computer.active_program == src) + START_PROCESSING(SSfastprocess, src) + /////////////////// //Suit Sensor App// /////////////////// @@ -106,44 +209,13 @@ /datum/computer_file/program/radar/lifeline filename = "Lifeline" filedesc = "Lifeline" - program_icon_state = "generic" extended_desc = "This program allows for tracking of crew members via their suit sensors." requires_ntnet = TRUE transfer_access = ACCESS_MEDICAL available_on_ntnet = TRUE -/datum/computer_file/program/radar/lifeline/track() - var/mob/living/carbon/human/humanoid = locate(selected) in GLOB.human_list - if(!istype(humanoid) || !trackable(humanoid)) - return - - var/turf/here_turf = (get_turf(computer)) - var/turf/target_turf = (get_turf(humanoid)) - var/userot = FALSE - var/rot = 0 - var/pointer="crosshairs" - var/locx = (target_turf.x - here_turf.x) - var/locy = (here_turf.y - target_turf.y) - if(get_dist_euclidian(here_turf, target_turf) > 24) //If they're too far away, we need the angle for the arrow along the edge of the radar display - userot = TRUE - rot = round(Get_Angle(here_turf, target_turf)) - else - locx = locx + 24 - locy = locy + 24 - if(target_turf.z > here_turf.z) - pointer="caret-up" - else if(target_turf.z < here_turf.z) - pointer="caret-down" - var/list/trackinfo = list( - locx = locx, - locy = locy, - userot = userot, - rot = rot, - arrowstyle = "ntosradarpointer.png", //For the rotation arrow, it's stupid I know - color = "green", - pointer = pointer, - ) - return trackinfo +/datum/computer_file/program/radar/lifeline/find_atom() + return locate(selected) in GLOB.human_list /datum/computer_file/program/radar/lifeline/scan() if(world.time < next_scan) @@ -184,46 +256,18 @@ /datum/computer_file/program/radar/fission360 filename = "Fission360" filedesc = "Fission360" - program_icon_state = "generic" + program_icon_state = "radarsyndicate" extended_desc = "This program allows for tracking of nuclear authorization disks and warheads." requires_ntnet = FALSE transfer_access = null available_on_ntnet = FALSE available_on_syndinet = TRUE tgui_id = "NtosRadarSyndicate" + arrowstyle = "ntosradarpointerS.png" + pointercolor = "red" -/datum/computer_file/program/radar/fission360/track() - var/obj/nuke = locate(selected) in GLOB.poi_list - if(!trackable(nuke)) - return - - var/turf/here_turf = (get_turf(computer)) - var/turf/target_turf = (get_turf(nuke)) - var/userot = FALSE - var/rot = 0 - var/pointer="crosshairs" - var/locx = (target_turf.x - here_turf.x) - var/locy = (here_turf.y - target_turf.y) - if(get_dist_euclidian(here_turf, target_turf) > 24) //If they're too far away, we need the angle for the arrow along the edge of the radar display - userot = TRUE - rot = round(Get_Angle(here_turf, target_turf)) - else - locx = locx + 24 - locy = locy + 24 - if(target_turf.z > here_turf.z) - pointer="caret-up" - else if(target_turf.z < here_turf.z) - pointer="caret-down" - var/list/trackinfo = list( - locx = locx, - locy = locy, - userot = userot, - rot = rot, - arrowstyle = "ntosradarpointerS.png", - color = "red", - pointer = pointer, - ) - return trackinfo +/datum/computer_file/program/radar/fission360/find_atom() + return locate(selected) in GLOB.poi_list /datum/computer_file/program/radar/fission360/scan() if(world.time < next_scan) diff --git a/code/modules/modular_computers/file_system/programs/robocontrol.dm b/code/modules/modular_computers/file_system/programs/robocontrol.dm index 910f923327..8644ce09b4 100644 --- a/code/modules/modular_computers/file_system/programs/robocontrol.dm +++ b/code/modules/modular_computers/file_system/programs/robocontrol.dm @@ -9,8 +9,6 @@ network_destination = "robotics control network" size = 12 tgui_id = "NtosRoboControl" - ui_x = 550 - ui_y = 550 ///Number of simple robots on-station. var/botcount = 0 ///Used to find the location of the user for the purposes of summoning robots. diff --git a/code/modules/modular_computers/file_system/programs/sm_monitor.dm b/code/modules/modular_computers/file_system/programs/sm_monitor.dm index 0a675a7abc..32ad102871 100644 --- a/code/modules/modular_computers/file_system/programs/sm_monitor.dm +++ b/code/modules/modular_computers/file_system/programs/sm_monitor.dm @@ -9,8 +9,6 @@ network_destination = "supermatter monitoring system" size = 5 tgui_id = "NtosSupermatterMonitor" - ui_x = 600 - ui_y = 350 var/last_status = SUPERMATTER_INACTIVE var/list/supermatters var/obj/machinery/power/supermatter_crystal/active // Currently selected supermatter crystal. diff --git a/code/modules/modular_computers/hardware/CPU.dm b/code/modules/modular_computers/hardware/CPU.dm index d08d65ff8b..f13081e1f3 100644 --- a/code/modules/modular_computers/hardware/CPU.dm +++ b/code/modules/modular_computers/hardware/CPU.dm @@ -37,4 +37,4 @@ icon_state = "cpu_super" w_class = WEIGHT_CLASS_TINY power_usage = 75 - max_idle_programs = 2 \ No newline at end of file + max_idle_programs = 2 diff --git a/code/modules/modular_computers/hardware/_hardware.dm b/code/modules/modular_computers/hardware/_hardware.dm index 37f3fc434e..b33442f99b 100644 --- a/code/modules/modular_computers/hardware/_hardware.dm +++ b/code/modules/modular_computers/hardware/_hardware.dm @@ -32,28 +32,29 @@ /obj/item/computer_hardware/attackby(obj/item/I, mob/living/user) - // Multitool. Runs diagnostics - if(istype(I, /obj/item/multitool)) - to_chat(user, "***** DIAGNOSTICS REPORT *****") - diagnostics(user) - to_chat(user, "******************************") - return 1 - // Cable coil. Works as repair method, but will probably require multiple applications and more cable. if(istype(I, /obj/item/stack/cable_coil)) + var/obj/item/stack/S = I if(obj_integrity == max_integrity) to_chat(user, "\The [src] doesn't seem to require repairs.") return 1 - if(I.use_tool(src, user, 0, 1)) + if(S.use(1)) to_chat(user, "You patch up \the [src] with a bit of \the [I].") obj_integrity = min(obj_integrity + 10, max_integrity) return 1 if(try_insert(I, user)) - return 1 + return TRUE return ..() +/obj/item/computer_hardware/multitool_act(mob/living/user, obj/item/I) + ..() + to_chat(user, "***** DIAGNOSTICS REPORT *****") + diagnostics(user) + to_chat(user, "******************************") + return TRUE + // Called on multitool click, prints diagnostic information to the user. /obj/item/computer_hardware/proc/diagnostics(var/mob/user) to_chat(user, "Hardware Integrity Test... (Corruption: [damage]/[max_damage]) [damage > damage_failure ? "FAIL" : damage > damage_malfunction ? "WARN" : "PASS"]") diff --git a/code/modules/modular_computers/hardware/ai_slot.dm b/code/modules/modular_computers/hardware/ai_slot.dm index 8428467a87..0ad157afcb 100644 --- a/code/modules/modular_computers/hardware/ai_slot.dm +++ b/code/modules/modular_computers/hardware/ai_slot.dm @@ -9,6 +9,10 @@ var/obj/item/aicard/stored_card = null var/locked = FALSE +/obj/item/computer_hardware/ai_slot/handle_atom_del(atom/A) + if(A == stored_card) + try_eject(0, null, TRUE) + . = ..() /obj/item/computer_hardware/ai_slot/examine(mob/user) . = ..() @@ -41,13 +45,6 @@ /obj/item/computer_hardware/ai_slot/try_eject(slot=0,mob/living/user = null,forced = 0) - if (get_dist(src,user) > 1) - if (iscarbon(user)) - var/mob/living/carbon/H = user - if (!(H.dna && H.dna.check_mutation(TK) && tkMaxRangeCheck(src,H))) - return FALSE - else - return FALSE if(!stored_card) to_chat(user, "There is no card in \the [src].") return FALSE @@ -57,19 +54,21 @@ return FALSE if(stored_card) - stored_card.forceMove(get_turf(src)) + to_chat(user, "You remove [stored_card] from [src].") locked = FALSE - stored_card.verb_pickup() + if(user) + user.put_in_hands(stored_card) + else + stored_card.forceMove(drop_location()) stored_card = null - to_chat(user, "You remove the card from \the [src].") return TRUE return FALSE /obj/item/computer_hardware/ai_slot/attackby(obj/item/I, mob/living/user) if(..()) return - if(istype(I, /obj/item/screwdriver)) + if(I.tool_behaviour == TOOL_SCREWDRIVER) to_chat(user, "You press down on the manual eject button with \the [I].") try_eject(,user,1) - return \ No newline at end of file + return diff --git a/code/modules/modular_computers/hardware/battery_module.dm b/code/modules/modular_computers/hardware/battery_module.dm index e03427cc9c..6e3193abfd 100644 --- a/code/modules/modular_computers/hardware/battery_module.dm +++ b/code/modules/modular_computers/hardware/battery_module.dm @@ -7,6 +7,9 @@ var/obj/item/stock_parts/cell/battery = null device_type = MC_CELL +/obj/item/computer_hardware/battery/get_cell() + return battery + /obj/item/computer_hardware/battery/New(loc, battery_type = null) if(battery_type) battery = new battery_type(src) @@ -16,6 +19,11 @@ . = ..() QDEL_NULL(battery) +/obj/item/computer_hardware/battery/handle_atom_del(atom/A) + if(A == battery) + try_eject(0, null, TRUE) + . = ..() + /obj/item/computer_hardware/battery/try_insert(obj/item/I, mob/living/user = null) if(!holder) return FALSE @@ -45,7 +53,10 @@ to_chat(user, "There is no power cell connected to \the [src].") return FALSE else - battery.forceMove(get_turf(src)) + if(user) + user.put_in_hands(battery) + else + battery.forceMove(drop_location()) to_chat(user, "You detach \the [battery] from \the [src].") battery = null diff --git a/code/modules/modular_computers/hardware/card_slot.dm b/code/modules/modular_computers/hardware/card_slot.dm index e4bc45dbc5..18b423a42e 100644 --- a/code/modules/modular_computers/hardware/card_slot.dm +++ b/code/modules/modular_computers/hardware/card_slot.dm @@ -9,6 +9,13 @@ var/obj/item/card/id/stored_card = null var/obj/item/card/id/stored_card2 = null +/obj/item/computer_hardware/card_slot/handle_atom_del(atom/A) + if(A == stored_card) + try_eject(1, null, TRUE) + if(A == stored_card2) + try_eject(2, null, TRUE) + . = ..() + /obj/item/computer_hardware/card_slot/Destroy() try_eject() return ..() @@ -67,19 +74,15 @@ else stored_card2 = I to_chat(user, "You insert \the [I] into \the [src].") - playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0) + playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE) + if(ishuman(user)) + var/mob/living/carbon/human/H = user + H.sec_hud_set_ID() return TRUE /obj/item/computer_hardware/card_slot/try_eject(slot=0, mob/living/user = null, forced = 0) - if (get_dist(src,user) > 1) - if (iscarbon(user)) - var/mob/living/carbon/H = user - if (!(H.dna && H.dna.check_mutation(TK) && tkMaxRangeCheck(src,H))) - return FALSE - else - return FALSE if(!stored_card && !stored_card2) to_chat(user, "There are no cards in \the [src].") return FALSE @@ -89,7 +92,7 @@ if(user) user.put_in_hands(stored_card) else - stored_card.forceMove(get_turf(src)) + stored_card.forceMove(drop_location()) stored_card = null ejected++ @@ -97,7 +100,7 @@ if(user) user.put_in_hands(stored_card2) else - stored_card2.forceMove(get_turf(src)) + stored_card2.forceMove(drop_location()) stored_card2 = null ejected++ @@ -109,16 +112,18 @@ for(var/I in holder.idle_threads) var/datum/computer_file/program/P = I P.event_idremoved(1, slot) - + if(ishuman(user)) + var/mob/living/carbon/human/H = user + H.sec_hud_set_ID() to_chat(user, "You remove the card[ejected>1 ? "s" : ""] from \the [src].") - playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0) + playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE) return TRUE return FALSE /obj/item/computer_hardware/card_slot/attackby(obj/item/I, mob/living/user) if(..()) return - if(istype(I, /obj/item/screwdriver)) + if(I.tool_behaviour == TOOL_SCREWDRIVER) to_chat(user, "You press down on the manual eject button with \the [I].") try_eject(0,user) return diff --git a/code/modules/modular_computers/hardware/hard_drive.dm b/code/modules/modular_computers/hardware/hard_drive.dm index e27eaa53ae..b8b9624388 100644 --- a/code/modules/modular_computers/hardware/hard_drive.dm +++ b/code/modules/modular_computers/hardware/hard_drive.dm @@ -157,18 +157,30 @@ max_capacity = 64 icon_state = "ssd_mini" w_class = WEIGHT_CLASS_TINY - custom_price = PRICE_ABOVE_NORMAL + custom_price = 150 -/obj/item/computer_hardware/hard_drive/small/syndicate // Syndicate variant - very slight better +// Syndicate variant - very slight better +/obj/item/computer_hardware/hard_drive/small/syndicate desc = "An efficient SSD for portable devices developed by a rival organisation." power_usage = 8 max_capacity = 70 var/datum/antagonist/traitor/traitor_data // Syndicate hard drive has the user's data baked directly into it on creation +/// For tablets given to nuke ops +/obj/item/computer_hardware/hard_drive/small/nukeops + power_usage = 8 + max_capacity = 70 + +/obj/item/computer_hardware/hard_drive/small/nukeops/install_default_programs() + store_file(new/datum/computer_file/program/computerconfig(src)) + store_file(new/datum/computer_file/program/ntnetdownload/syndicate(src)) // Syndicate version; automatic access to syndicate apps and no NT apps + store_file(new/datum/computer_file/program/filemanager(src)) + store_file(new/datum/computer_file/program/radar/fission360(src)) //I am legitimately afraid if I don't do this, Ops players will think they just don't get a pinpointer anymore. + /obj/item/computer_hardware/hard_drive/micro name = "micro solid state drive" desc = "A highly efficient SSD chip for portable devices." power_usage = 2 max_capacity = 32 icon_state = "ssd_micro" - w_class = WEIGHT_CLASS_TINY \ No newline at end of file + w_class = WEIGHT_CLASS_TINY diff --git a/code/modules/modular_computers/hardware/printer.dm b/code/modules/modular_computers/hardware/printer.dm index 36c666e5d6..ebe40c1922 100644 --- a/code/modules/modular_computers/hardware/printer.dm +++ b/code/modules/modular_computers/hardware/printer.dm @@ -10,14 +10,14 @@ /obj/item/computer_hardware/printer/diagnostics(mob/living/user) ..() - to_chat(user, "Paper level: [stored_paper]/[max_paper].") + to_chat(user, "Paper level: [stored_paper]/[max_paper].") /obj/item/computer_hardware/printer/examine(mob/user) . = ..() . += "Paper level: [stored_paper]/[max_paper]." -/obj/item/computer_hardware/printer/proc/print_text(var/text_to_print, var/paper_title = "") +/obj/item/computer_hardware/printer/proc/print_text(text_to_print, paper_title = "") if(!stored_paper) return FALSE if(!check_functionality()) @@ -27,11 +27,12 @@ // Damaged printer causes the resulting paper to be somewhat harder to read. if(damage > damage_malfunction) - P.setText(stars(text_to_print, 100-malfunction_probability)) + P.info = stars(text_to_print, 100-malfunction_probability) else - P.setText(text_to_print) + P.info = text_to_print if(paper_title) P.name = paper_title + P.update_icon() stored_paper-- P = null return TRUE diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 7e2979d25f..896887a70d 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -965,7 +965,7 @@ . = UI_INTERACTIVE /obj/machinery/power/apc/ui_act(action, params) - if(..() || !can_use(usr, 1) || (locked && area.hasSiliconAccessInArea(usr, PRIVILEDGES_SILICON|PRIVILEDGES_DRONE) && !failure_timer && action != "toggle_nightshift") || (integration_cog && (is_servant_of_ratvar(usr))) + if(..() || !can_use(usr, 1) || (locked && area.hasSiliconAccessInArea(usr, PRIVILEDGES_SILICON|PRIVILEDGES_DRONE) && !failure_timer && action != "toggle_nightshift") || (integration_cog && (is_servant_of_ratvar(usr)))) return switch(action) if("lock") @@ -1006,7 +1006,7 @@ update() . = TRUE if("overload") - if(usr.has_unlimited_silicon_privilege) + if(area.hasSiliconAccessInArea(usr, PRIVILEDGES_SILICON|PRIVILEDGES_DRONE)) //usr.has_unlimited_silicon_privilege) overload_lighting() . = TRUE if("hack") diff --git a/code/modules/security_levels/keycard_authentication.dm b/code/modules/security_levels/keycard_authentication.dm index dc5b8b1b56..7326cad816 100644 --- a/code/modules/security_levels/keycard_authentication.dm +++ b/code/modules/security_levels/keycard_authentication.dm @@ -48,12 +48,10 @@ GLOBAL_DATUM_INIT(keycard_events, /datum/events, new) var/list/data = list() data["waiting"] = waiting data["auth_required"] = event_source ? event_source.event : 0 - data["red_alert"] = (seclevel2num(get_security_level()) >= SEC_LEVEL_RED) ? 1 : 0 + data["red_alert"] = (SECLEVEL2NUM(NUM2SECLEVEL(GLOB.security_level)) >= SEC_LEVEL_RED) ? 1 : 0 data["emergency_maint"] = GLOB.emergency_access data["bsa_unlock"] = GLOB.bsa_unlock return data -= GLOB.bsa_unlock - return data /obj/machinery/keycard_auth/ui_status(mob/user) if(isanimal(user)) diff --git a/tgstation.dme b/tgstation.dme index b694d93fc1..0e3485fb36 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -2706,6 +2706,7 @@ #include "code\modules\mob\living\simple_animal\slime\slime_mobility.dm" #include "code\modules\mob\living\simple_animal\slime\subtypes.dm" #include "code\modules\modular_computers\laptop_vendor.dm" +#include "code\modules\modular_computers\computers\_modular_computer_shared.dm" #include "code\modules\modular_computers\computers\item\computer.dm" #include "code\modules\modular_computers\computers\item\computer_components.dm" #include "code\modules\modular_computers\computers\item\computer_damage.dm" @@ -2727,12 +2728,14 @@ #include "code\modules\modular_computers\file_system\programs\alarm.dm" #include "code\modules\modular_computers\file_system\programs\arcade.dm" #include "code\modules\modular_computers\file_system\programs\card.dm" +#include "code\modules\modular_computers\file_system\programs\cargobounty.dm" #include "code\modules\modular_computers\file_system\programs\configurator.dm" +#include "code\modules\modular_computers\file_system\programs\crewmanifest.dm" #include "code\modules\modular_computers\file_system\programs\file_browser.dm" +#include "code\modules\modular_computers\file_system\programs\jobmanagement.dm" #include "code\modules\modular_computers\file_system\programs\ntdownloader.dm" #include "code\modules\modular_computers\file_system\programs\ntmonitor.dm" #include "code\modules\modular_computers\file_system\programs\ntnrc_client.dm" -#include "code\modules\modular_computers\file_system\programs\nttransfer.dm" #include "code\modules\modular_computers\file_system\programs\powermonitor.dm" #include "code\modules\modular_computers\file_system\programs\radar.dm" #include "code\modules\modular_computers\file_system\programs\robocontrol.dm"