diff --git a/code/modules/modular_computers/computers/item/computer_ui.dm b/code/modules/modular_computers/computers/item/computer_ui.dm index d6297f7c192c..55c4f74d7bb0 100644 --- a/code/modules/modular_computers/computers/item/computer_ui.dm +++ b/code/modules/modular_computers/computers/item/computer_ui.dm @@ -5,6 +5,8 @@ /obj/item/modular_computer/proc/can_show_ui(mob/user) if(!enabled) return FALSE + if(SEND_SIGNAL(src, COMSIG_ITEM_ATTACK_SELF, user) & COMPONENT_NO_INTERACT) // Open uplink TGUI instead of our TGUI + return FALSE if(!use_power()) return FALSE // Robots don't really need to see the screen, their wireless connection works as long as computer is on. diff --git a/code/modules/modular_computers/file_system/programs/antagonist/bomberman.dm b/code/modules/modular_computers/file_system/programs/antagonist/bomberman.dm index 5997d38f8e85..c5a29456cf68 100644 --- a/code/modules/modular_computers/file_system/programs/antagonist/bomberman.dm +++ b/code/modules/modular_computers/file_system/programs/antagonist/bomberman.dm @@ -50,8 +50,8 @@ GLOBAL_LIST_EMPTY(PDABombCodes) return TRUE if("PRG_sendbomb") - var/datum/bombcode/bomb - for(var/datum/bombcode/B in GLOB.PDABombCodes) + var/datum/ntosbombcode/bomb + for(var/datum/ntosbombcode/B in GLOB.PDABombCodes) if(bombcode == B.code) bomb = B break @@ -125,10 +125,10 @@ GLOBAL_LIST_EMPTY(PDABombCodes) return data -/datum/bombcode +/datum/ntosbombcode var/code = "" var/uses = 4 -/datum/bombcode/New() +/datum/ntosbombcode/New() code = "[num2hex(rand(1,65535), -1)][num2hex(rand(1,65535), -1)]" // 8 hexadecimal digits GLOB.PDABombCodes += src diff --git a/code/modules/modular_computers/file_system/programs/antagonist/frame.dm b/code/modules/modular_computers/file_system/programs/antagonist/frame.dm new file mode 100644 index 000000000000..5b75c2954b91 --- /dev/null +++ b/code/modules/modular_computers/file_system/programs/antagonist/frame.dm @@ -0,0 +1,114 @@ +GLOBAL_LIST_EMPTY(PDAFrameCodes) + +/datum/computer_file/program/frame + filename = "frame" + filedesc = "F.R.A.M.E." + category = PROGRAM_CATEGORY_MISC + program_icon_state = "hostile" + extended_desc = "A new-age version of the classic 'F.R.A.M.E.' program run on legacy PDAs. Can be used to silently open an uplink on any PDA on the messaging list." + size = 5 + requires_ntnet = FALSE + available_on_ntnet = FALSE + available_on_syndinet = TRUE + tgui_id = "NtosFrame" + program_icon = "comment-alt" + + var/framecode = "Insert Code" + +/datum/computer_file/program/frame/ui_act(action, params) + if(..()) + return + computer.play_interact_sound() + switch(action) + if("PRG_codechange") + var/newcode = params["newcode"] + if(!newcode) + return + framecode = newcode + return TRUE + + if("PRG_sendframe") + var/datum/ntosframecode/framer + for(var/datum/ntosframecode/B in GLOB.PDAFrameCodes) + if(framecode == B.code) + framer = B + break + + if(!framer) + computer.visible_message(span_danger("ERROR. Invalid frame code."), null, null, 1) + return + + if(framer.uses <= 0) + computer.visible_message(span_danger("ERROR. No more charges on this code."), null, null, 1) + return + + var/datum/computer_file/program/pdamessager/target = locate(params["recipient"]) in GLOB.NTPDAs + if(istype(target)) + + if(!target.receiving) + computer.visible_message(span_danger("ERROR. Target not available."), null, null, 1) + return TRUE + + var/obj/item/modular_computer/target_computer + if(target.computer) // Find computer + target_computer = target.computer + else if(istype(target.holder.loc, /obj/item/modular_computer)) + target_computer = target.holder.loc + + if(!target_computer) + computer.visible_message(span_danger("ERROR. Target computer not found."), null, null, 1) + return TRUE + + if(istype(target_computer, /obj/item/modular_computer/tablet/integrated)) + computer.visible_message(span_danger("ERROR. Silicon target cannot be FRAMEd."), null, null, 1) + return TRUE + + framer.uses-- + + var/lock_code = "[rand(100,999)] [pick(GLOB.phonetic_alphabet)]" + computer.visible_message(span_notice("Virus Sent! [framer.uses] left. The unlock code to the target is: [lock_code]"), null, null, 1) + + var/datum/component/uplink/hidden_uplink = target_computer.GetComponent(/datum/component/uplink) + if(!hidden_uplink) + hidden_uplink = target_computer.AddComponent(/datum/component/uplink) + hidden_uplink.unlock_code = lock_code + else + hidden_uplink.hidden_crystals += hidden_uplink.telecrystals //Temporarially hide the PDA's crystals, so you can't steal telecrystals. + hidden_uplink.telecrystals = 0 + hidden_uplink.locked = FALSE + else + computer.visible_message(span_danger("ERROR. Target not found."), null, null, 1) + + return TRUE + + +/datum/computer_file/program/frame/clone() + var/datum/computer_file/program/frame/temp = ..() + temp.framecode = framecode + return temp + +/datum/computer_file/program/frame/ui_data(mob/user) + var/list/data = get_header_data() + + data["framecode"] = framecode + + var/list/pdas = list() + for(var/datum/computer_file/program/pdamessager/P in GLOB.NTPDAs) + if(P.receiving == FALSE) + continue + if(!P.holder) + continue + if(!istype(holder.loc, /obj/item/modular_computer)) + continue + pdas += list(list(P.username, REF(P))) + data["pdas"] = pdas + + return data + +/datum/ntosframecode + var/code = "" + var/uses = 5 + +/datum/ntosframecode/New() + code = "[num2hex(rand(1,65535), -1)][num2hex(rand(1,65535), -1)]" // 8 hexadecimal digits + GLOB.PDAFrameCodes += src diff --git a/code/modules/modular_computers/hardware/portable_disk.dm b/code/modules/modular_computers/hardware/portable_disk.dm index 98f7e92eed75..7e4271e00360 100644 --- a/code/modules/modular_computers/hardware/portable_disk.dm +++ b/code/modules/modular_computers/hardware/portable_disk.dm @@ -56,10 +56,17 @@ /obj/item/computer_hardware/hard_drive/portable/syndicate/bomberman/install_default_programs() ..() var/datum/computer_file/program/bomberman/B = new /datum/computer_file/program/bomberman(src) - var/datum/bombcode/C = new /datum/bombcode + var/datum/ntosbombcode/C = new /datum/ntosbombcode B.bombcode = C.code store_file(B) +/obj/item/computer_hardware/hard_drive/portable/syndicate/frame/install_default_programs() + ..() + var/datum/computer_file/program/frame/F = new /datum/computer_file/program/frame(src) + var/datum/ntosframecode/C = new /datum/ntosframecode + F.framecode = C.code + store_file(F) + ////////////// //Trap Disks// ////////////// diff --git a/code/modules/uplink/uplink_items.dm b/code/modules/uplink/uplink_items.dm index 1a4d3628197a..1afd9b6f8860 100644 --- a/code/modules/uplink/uplink_items.dm +++ b/code/modules/uplink/uplink_items.dm @@ -1520,16 +1520,26 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item)) surplus = 1 /datum/uplink_item/device_tools/frame - name = "F.R.A.M.E. PDA Cartridge" - desc = "When inserted into a personal digital assistant, this cartridge gives you five PDA viruses which \ - when used cause the targeted PDA to become a new uplink with zero TCs, and immediately become unlocked. \ - You will receive the unlock code upon activating the virus, and the new uplink may be charged with \ - telecrystals normally." - item = /obj/item/cartridge/virus/frame + name = "F.R.A.M.E. Program" + desc = "This program allows you to use five viruses which when used cause the targeted \ + computer to become a new uplink with zero TC, and immediately become unlocked. \ + You will receive the unlock code upon activating the virus, \ + and the new uplink may be charged with telecrystals normally." + item = /obj/item/computer_hardware/hard_drive/portable/syndicate/frame cost = 4 manufacturer = /datum/corporation/traitor/waffleco restricted = TRUE +/datum/uplink_item/device_tools/frame/spawn_item(spawn_path, mob/user, datum/component/uplink/U) + . = ..() + var/obj/item/computer_hardware/hard_drive/portable/syndicate/frame/framedisk = . + var/datum/computer_file/program/frame/program = framedisk.find_file_by_name("frame") + var/code = program.framecode + + to_chat(user, span_warning("Your F.R.A.M.E. code is : [code].")) + if(user.mind) + user.mind.store_memory("F.R.A.M.E. code for [U.parent] : [code]") + /datum/uplink_item/device_tools/failsafe name = "Failsafe Uplink Code" desc = "When entered the uplink will self-destruct immediately." diff --git a/tgui/packages/tgui/interfaces/NtosFrame.js b/tgui/packages/tgui/interfaces/NtosFrame.js new file mode 100644 index 000000000000..4b0de72fb606 --- /dev/null +++ b/tgui/packages/tgui/interfaces/NtosFrame.js @@ -0,0 +1,83 @@ +import { useBackend } from '../backend'; +import { Box, Button, Section, Grid } from '../components'; +import { NtosWindow } from '../layouts'; + +export const NtosFrame = (props, context) => { + const { act, data } = useBackend(context); + const { + bombcode, + pdas = [], + } = data; + return ( + + + +
+ )}> + + +
+
+ {pdas.map((pdadata, index) => // P.username, REF(P), blocked_users.Find(P) + ( + + + + + +
+
+
+
+ ); +}; diff --git a/yogstation.dme b/yogstation.dme index 782b9d7d8978..d99c2fe2236f 100644 --- a/yogstation.dme +++ b/yogstation.dme @@ -2673,6 +2673,7 @@ #include "code\modules\modular_computers\file_system\programs\antagonist\bomberman.dm" #include "code\modules\modular_computers\file_system\programs\antagonist\contract_uplink.dm" #include "code\modules\modular_computers\file_system\programs\antagonist\dos.dm" +#include "code\modules\modular_computers\file_system\programs\antagonist\frame.dm" #include "code\modules\modular_computers\file_system\programs\antagonist\revelation.dm" #include "code\modules\modular_computers\file_system\programs\command\budgetviewer.dm" #include "code\modules\modular_computers\file_system\programs\command\card.dm"