mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Adds F.R.A.M.E. to NTOS (#15546)
* frame * get told code on purchase * typo * typo2 * no sillycons
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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//
|
||||
//////////////
|
||||
|
||||
@@ -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."
|
||||
|
||||
83
tgui/packages/tgui/interfaces/NtosFrame.js
Normal file
83
tgui/packages/tgui/interfaces/NtosFrame.js
Normal file
@@ -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 (
|
||||
<NtosWindow
|
||||
width={400}
|
||||
height={480}
|
||||
theme="syndicate">
|
||||
<NtosWindow.Content scrollable>
|
||||
<Box>
|
||||
<Section
|
||||
title="SyndieMessenger V4.0.0"
|
||||
buttons={(
|
||||
<Button
|
||||
content="Messages" />
|
||||
)}>
|
||||
<Grid>
|
||||
<Grid.Column>
|
||||
<Button
|
||||
fluid
|
||||
content="Ringer: STEALTHY :)"
|
||||
color="bad" />
|
||||
</Grid.Column>
|
||||
<Grid.Column>
|
||||
<Button
|
||||
fluid
|
||||
content="Send / Receive: YES"
|
||||
selected />
|
||||
</Grid.Column>
|
||||
</Grid>
|
||||
<Grid>
|
||||
<Grid.Column>
|
||||
<Button
|
||||
fluid
|
||||
content="CODE GOES THERE ---->" />
|
||||
</Grid.Column>
|
||||
<Grid.Column>
|
||||
<Button.Input
|
||||
fluid
|
||||
content={bombcode}
|
||||
currentValue={bombcode}
|
||||
onCommit={(e, value) => act('PRG_codechange', {
|
||||
newcode: value,
|
||||
})} />
|
||||
</Grid.Column>
|
||||
</Grid>
|
||||
</Section>
|
||||
<Section title="Detected PDAs">
|
||||
{pdas.map((pdadata, index) => // P.username, REF(P), blocked_users.Find(P)
|
||||
(
|
||||
<Grid key={'pda'+index}>
|
||||
<Grid.Column size={4}>
|
||||
<Button.Input
|
||||
fluid
|
||||
content={pdadata[0].substring(0, 35)}
|
||||
disabled
|
||||
color="primary" />
|
||||
</Grid.Column>
|
||||
<Grid.Column>
|
||||
<Button
|
||||
fluid
|
||||
content="FRAME"
|
||||
color="bad"
|
||||
onClick={() => act('PRG_sendframe', {
|
||||
recipient: pdadata[1],
|
||||
})} />
|
||||
</Grid.Column>
|
||||
</Grid>
|
||||
)
|
||||
)}
|
||||
</Section>
|
||||
</Box>
|
||||
</NtosWindow.Content>
|
||||
</NtosWindow>
|
||||
);
|
||||
};
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user