PDA update (Messenger works while dead, Microwave works, etc). (#80069)

## About The Pull Request

This is an update that touches many more things all at once (compared to
my other PRs) meant to make PDAs in general feel more consistent and not
take away from one of the experiences we want to encourage: interaction
between players.

1. Replaced all checks of a 'pda' with a 'modular pc'. This means
technically (though not done in-game currently) other modpcs can hold an
uplink, and microwaves can charge laptops.
2. Speaking of microwave, they now don't break and require
deconstruction if the cell is removed mid-charge.
3. When a Mod PC is out of power, it will now allow the Messenger to
work (which now also doesn't consume any additional power), if the app
exists on the PC. Here's a video demonstration


https://github.com/tgstation/tgstation/assets/53777086/7ae12f81-a271-49b8-95fa-2ba54d2e2d1f

4. Flashlights can't be turned on while the cell is dead
5. I replaced a bunch of program vars with ``program_flags`` and renamed
``usage_flags`` to ``can_run_on_flags``.
6. Added a debug modPC that has every app installed by default. Mafia
had some issues in the past that were unknown because Mafia wasn't
preinstalled with any tablet so was never in create & destroy nor in any
other unit test. This was just an easy solution I had, but PDAs should
get more in-depth unit tests in the future for running apps n stuff- I
just wanted to make sure no other apps were broken/harddeling.

## Why It's Good For The Game

Currently when a PDA dies, its only use is to reply to PDA messages sent
to you, since you can still reply to them. Instead of just fixing it and
telling players to cope, I thought it would be nice to allow PDA
Messenger to still work, as it is a vital app.
You can call it some emergency power mode or whatever, I don't really
mind the reason behind why it is this way.

When I made cells used more on PDAs, my main goal was to encourage
upgrading your PDA and/or limiting how many apps you use at once, I did
not want this to hit on players who use it as a form of interaction.
This is the best of both worlds, I think.

The rest of the changes is just for modularity, if some downstream wants
to add tablets, phone computers, or whatever the hell else, they can
still get just as far as PDAs should be able to get to, hopefully.

## Changelog

🆑
add: PDAs with a dead power cell are now limited to using their
Messenger app.
fix: Microwaves now stop charging PDAs if the cell was removed
mid-charge.
fix: Microwaves can now charge laptops.
fix: PDA Flashlights can't be turned on while the PDA is dead.
fix: You can now hold a laptop up to a camera (if it has a notekeeper
app installed) like PDAs already could.
/🆑

---------

Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com>
This commit is contained in:
John Willard
2023-12-09 12:05:13 +00:00
committed by GitHub
parent b2a1c7e2ca
commit edbc7c5622
54 changed files with 198 additions and 182 deletions
@@ -5,10 +5,8 @@
program_open_overlay = "generic"
extended_desc = "Firmware Restoration Kit, capable of reconstructing damaged AI systems. Requires direct AI connection via intellicard slot."
size = 12
requires_ntnet = FALSE
usage_flags = PROGRAM_CONSOLE | PROGRAM_LAPTOP
can_run_on_flags = PROGRAM_CONSOLE | PROGRAM_LAPTOP
download_access = list(ACCESS_RD)
available_on_ntnet = TRUE
tgui_id = "NtosAiRestorer"
program_icon = "laptop-code"
@@ -5,7 +5,7 @@
ui_header = "alarm_green.gif"
program_open_overlay = "alert-green"
extended_desc = "This program provides visual interface for a station's alarm system."
requires_ntnet = 1
program_flags = PROGRAM_ON_NTNET_STORE | PROGRAM_REQUIRES_NTNET
size = 4
tgui_id = "NtosStationAlertConsole"
program_icon = "bell"
@@ -6,11 +6,8 @@
program_icon = "tasks"
size = 10
requires_ntnet = FALSE
available_on_ntnet = FALSE
available_on_syndinet = FALSE
usage_flags = PROGRAM_PDA //this is all we've got sprites for :sob:
unique_copy = TRUE
program_flags = PROGRAM_ON_SYNDINET_STORE | PROGRAM_UNIQUE_COPY
can_run_on_flags = PROGRAM_PDA //this is all we've got sprites for :sob:
undeletable = TRUE
tgui_id = "SyndicateContractor"
@@ -5,9 +5,7 @@
program_open_overlay = "hostile"
extended_desc = "This advanced script can perform denial of service attacks against NTNet quantum relays. The system administrator will probably notice this. Multiple devices can run this program together against same relay for increased effect"
size = 20
requires_ntnet = TRUE
available_on_ntnet = FALSE
available_on_syndinet = TRUE
program_flags = PROGRAM_ON_SYNDINET_STORE | PROGRAM_REQUIRES_NTNET
tgui_id = "NtosNetDos"
program_icon = "satellite-dish"
@@ -5,9 +5,7 @@
program_open_overlay = "hostile"
extended_desc = "This virus can destroy hard drive of system it is executed on. It may be obfuscated to look like another non-malicious program. Once armed, it will destroy the system upon next execution."
size = 13
requires_ntnet = FALSE
available_on_ntnet = FALSE
available_on_syndinet = TRUE
program_flags = PROGRAM_ON_SYNDINET_STORE
tgui_id = "NtosRevelation"
program_icon = "magnet"
var/armed = 0
@@ -3,7 +3,6 @@
filedesc = "Donksoft Micro Arcade"
program_open_overlay = "arcade"
extended_desc = "This port of the classic game 'Outbomb Cuban Pete', redesigned to run on tablets, with thrilling graphics and chilling storytelling."
requires_ntnet = FALSE
downloader_category = PROGRAM_CATEGORY_GAMES
size = 6
tgui_id = "NtosArcade"
@@ -5,7 +5,7 @@
ui_header = "borg_mon.gif"
program_open_overlay = "generic"
extended_desc = "This program allows for remote monitoring of station cyborgs."
requires_ntnet = TRUE
program_flags = PROGRAM_ON_NTNET_STORE | PROGRAM_REQUIRES_NTNET
download_access = list(ACCESS_ROBOTICS)
size = 5
tgui_id = "NtosCyborgRemoteMonitor"
@@ -152,9 +152,7 @@
ui_header = "borg_mon.gif"
program_open_overlay = "generic"
extended_desc = "This program allows for remote monitoring of mission-assigned cyborgs."
requires_ntnet = FALSE
available_on_ntnet = FALSE
available_on_syndinet = TRUE
program_flags = PROGRAM_ON_SYNDINET_STORE
download_access = list()
/datum/computer_file/program/borg_monitor/syndicate/evaluate_borg(mob/living/silicon/robot/R)
@@ -4,7 +4,7 @@
downloader_category = PROGRAM_CATEGORY_SUPPLY
program_open_overlay = "bountyboard"
extended_desc = "A multi-platform network for placing requests across the station, with payment across the network being possible.."
requires_ntnet = TRUE
program_flags = PROGRAM_ON_NTNET_STORE | PROGRAM_REQUIRES_NTNET
size = 10
tgui_id = "NtosBountyBoard"
///Reference to the currently logged in user.
@@ -4,8 +4,8 @@
downloader_category = PROGRAM_CATEGORY_SUPPLY
program_open_overlay = "request"
extended_desc = "Nanotrasen Internal Requisition Network interface for supply purchasing using a department budget account."
requires_ntnet = TRUE
usage_flags = PROGRAM_LAPTOP | PROGRAM_PDA
program_flags = PROGRAM_ON_NTNET_STORE | PROGRAM_REQUIRES_NTNET
can_run_on_flags = PROGRAM_LAPTOP | PROGRAM_PDA
size = 10
tgui_id = "NtosCargo"
///Are you actually placing orders with it?
@@ -5,7 +5,6 @@
program_open_overlay = "id"
extended_desc = "Program for programming employee ID cards to access parts of the station."
download_access = list(ACCESS_COMMAND)
requires_ntnet = 0
size = 8
tgui_id = "NtosCard"
program_icon = "id-card"
@@ -11,9 +11,8 @@
program_open_overlay = "command"
extended_desc = "This program allows communication over NTNRC network"
size = 8
requires_ntnet = TRUE
ui_header = "ntnrc_idle.gif"
available_on_ntnet = TRUE
program_flags = PROGRAM_ON_NTNET_STORE | PROGRAM_REQUIRES_NTNET
tgui_id = "NtosNetChat"
program_icon = "comment-alt"
alert_able = TRUE
@@ -5,7 +5,7 @@
program_open_overlay = "id"
extended_desc = "Program for viewing and printing the current crew manifest"
download_access = list(ACCESS_SECURITY, ACCESS_COMMAND)
requires_ntnet = TRUE
program_flags = PROGRAM_ON_NTNET_STORE | PROGRAM_REQUIRES_NTNET
size = 4
tgui_id = "NtosCrewManifest"
program_icon = "clipboard-list"
@@ -4,8 +4,7 @@
extended_desc = "This program allows management of files."
program_open_overlay = "generic"
size = 8
requires_ntnet = FALSE
available_on_ntnet = FALSE
program_flags = NONE
undeletable = TRUE
tgui_id = "NtosFileManager"
program_icon = "folder"
@@ -3,7 +3,7 @@
filedesc = "NT Frontier"
downloader_category = PROGRAM_CATEGORY_SCIENCE
extended_desc = "Scientific paper publication and navigation software."
requires_ntnet = TRUE
program_flags = PROGRAM_ON_NTNET_STORE | PROGRAM_REQUIRES_NTNET
size = 12
program_open_overlay = "research"
tgui_id = "NtosScipaper"
@@ -8,7 +8,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
program_open_overlay = "id"
extended_desc = "Program for viewing and changing job slot availability."
download_access = list(ACCESS_COMMAND)
requires_ntnet = TRUE
program_flags = PROGRAM_ON_NTNET_STORE | PROGRAM_REQUIRES_NTNET
size = 4
tgui_id = "NtosJobManager"
program_icon = "address-book"
@@ -3,7 +3,6 @@
filedesc = "Mafia"
program_open_overlay = "mafia"
extended_desc = "A program that allows you to play the infamous Mafia game, straight from your Modular PC."
requires_ntnet = FALSE
downloader_category = PROGRAM_CATEGORY_GAMES
size = 6
tgui_id = "NtosMafiaPanel"
@@ -6,5 +6,4 @@
*/
/datum/computer_file/program/maintenance
filetype = "MNT"
available_on_ntnet = FALSE
unique_copy = TRUE
program_flags = PROGRAM_UNIQUE_COPY
@@ -5,7 +5,7 @@
downloader_category = PROGRAM_CATEGORY_EQUIPMENT
extended_desc = "This program allows the taking of pictures."
size = 4
usage_flags = PROGRAM_PDA
can_run_on_flags = PROGRAM_PDA
tgui_id = "NtosCamera"
program_icon = "camera"
@@ -4,7 +4,7 @@
downloader_category = PROGRAM_CATEGORY_EQUIPMENT
extended_desc = "This program allows the tablet to scan physical objects and display a data output."
size = 2
usage_flags = PROGRAM_PDA
can_run_on_flags = PROGRAM_PDA
tgui_id = "NtosPhysScanner"
program_icon = "barcode"
/// Information from the last scanned person, to display on the app.
@@ -13,9 +13,9 @@
extended_desc = "This program allows old-school communication with other modular devices."
size = 0
undeletable = TRUE // It comes by default in tablets, can't be downloaded, takes no space and should obviously not be able to be deleted.
header_program = TRUE
available_on_ntnet = FALSE
usage_flags = PROGRAM_PDA
power_cell_use = NONE
program_flags = PROGRAM_HEADER | PROGRAM_RUNS_WITHOUT_POWER
can_run_on_flags = PROGRAM_PDA
ui_header = "ntnrc_idle.gif"
tgui_id = "NtosMessenger"
program_icon = "comment-alt"
@@ -6,8 +6,7 @@
program_open_overlay = "bountyboard"
extended_desc = "This program allows any user to access the Newscaster network from anywhere."
size = 2
requires_ntnet = TRUE
available_on_ntnet = TRUE
program_flags = PROGRAM_ON_NTNET_STORE | PROGRAM_REQUIRES_NTNET
tgui_id = "NtosNewscaster"
program_icon = "newspaper"
///The UI we use for the newscaster
@@ -7,7 +7,7 @@
size = 2
tgui_id = "NtosNotepad"
program_icon = "book"
usage_flags = PROGRAM_ALL
can_run_on_flags = PROGRAM_ALL
var/written_note = "Congratulations on your station upgrading to the new NtOS and Thinktronic based collaboration effort, \
bringing you the best in electronics and software since 2467!\n\
@@ -7,7 +7,7 @@
size = 2
tgui_id = "NtosPay"
program_icon = "money-bill-wave"
usage_flags = PROGRAM_ALL
can_run_on_flags = PROGRAM_ALL
///Reference to the currently logged in user.
var/datum/bank_account/current_user
///Pay token, by which we can send credits
@@ -5,8 +5,7 @@
extended_desc = "This program allows downloads of software from official NT repositories"
undeletable = TRUE
size = 4
requires_ntnet = TRUE
available_on_ntnet = FALSE
program_flags = PROGRAM_REQUIRES_NTNET
tgui_id = "NtosNetDownloader"
program_icon = "download"
@@ -46,7 +45,7 @@
return FALSE
// Attempting to download antag only program, but without having emagged/syndicate computer. No.
if(PRG.available_on_syndinet && !(computer.obj_flags & EMAGGED))
if((PRG.program_flags & PROGRAM_ON_SYNDINET_STORE) && !(computer.obj_flags & EMAGGED))
return FALSE
if(!computer || !computer.can_store_file(PRG))
@@ -136,11 +135,8 @@
data["emagged"] = (computer.obj_flags & EMAGGED)
var/list/repo = SSmodular_computers.available_antag_software | SSmodular_computers.available_station_software
var/list/program_categories = list()
for(var/datum/computer_file/program/programs as anything in repo)
if(!(programs.downloader_category in program_categories))
program_categories.Add(programs.downloader_category)
data["programs"] += list(list(
"icon" = programs.program_icon,
"filename" = programs.filename,
@@ -151,10 +147,10 @@
"compatible" = check_compatibility(programs),
"size" = programs.size,
"access" = programs.can_run(user, downloading = TRUE, access = access),
"verifiedsource" = programs.available_on_ntnet,
"verifiedsource" = !!(programs.program_flags & PROGRAM_ON_NTNET_STORE),
))
data["categories"] = show_categories & program_categories
data["categories"] = show_categories
return data
@@ -16,8 +16,8 @@
program_open_overlay = "dummy"
extended_desc = "This program connects to a Spinward Sector community art site for viewing and printing art."
download_access = list(ACCESS_LIBRARY)
usage_flags = PROGRAM_CONSOLE
requires_ntnet = TRUE
can_run_on_flags = PROGRAM_CONSOLE
program_flags = PROGRAM_ON_NTNET_STORE | PROGRAM_REQUIRES_NTNET
size = 9
tgui_id = "NtosPortraitPrinter"
program_icon = "paint-brush"
@@ -8,8 +8,8 @@
extended_desc = "This program connects to sensors around the station to provide information about electrical systems"
ui_header = "power_norm.gif"
download_access = list(ACCESS_ENGINEERING)
usage_flags = PROGRAM_CONSOLE
requires_ntnet = FALSE
can_run_on_flags = PROGRAM_CONSOLE
program_flags = PROGRAM_ON_NTNET_STORE | PROGRAM_REQUIRES_NTNET
size = 8
tgui_id = "NtosPowerMonitor"
program_icon = "plug"
@@ -4,9 +4,8 @@
downloader_category = PROGRAM_CATEGORY_EQUIPMENT
ui_header = "borg_mon.gif" //DEBUG -- new icon before PR
program_open_overlay = "radarntos"
requires_ntnet = TRUE
available_on_ntnet = FALSE
usage_flags = PROGRAM_LAPTOP | PROGRAM_PDA
program_flags = PROGRAM_REQUIRES_NTNET
can_run_on_flags = PROGRAM_LAPTOP | PROGRAM_PDA
size = 5
tgui_id = "NtosRadar"
///List of trackable entities. Updated by the scan() proc.
@@ -219,9 +218,8 @@
filename = "lifeline"
filedesc = "Lifeline"
extended_desc = "This program allows for tracking of crew members via their suit sensors."
requires_ntnet = TRUE
program_flags = PROGRAM_ON_NTNET_STORE | PROGRAM_REQUIRES_NTNET
download_access = list(ACCESS_MEDICAL)
available_on_ntnet = TRUE
program_icon = "heartbeat"
/datum/computer_file/program/radar/lifeline/find_atom()
@@ -259,9 +257,8 @@
filename = "custodiallocator"
filedesc = "Custodial Locator"
extended_desc = "This program allows for tracking of custodial equipment."
requires_ntnet = TRUE
program_flags = PROGRAM_ON_NTNET_STORE | PROGRAM_REQUIRES_NTNET
download_access = list(ACCESS_JANITOR)
available_on_ntnet = TRUE
program_icon = "broom"
size = 2
detomatix_resistance = DETOMATIX_RESIST_MINOR
@@ -304,9 +301,7 @@
filedesc = "Fission360"
program_open_overlay = "radarsyndicate"
extended_desc = "This program allows for tracking of nuclear authorization disks and warheads."
requires_ntnet = FALSE
available_on_ntnet = FALSE
available_on_syndinet = TRUE
program_flags = PROGRAM_ON_SYNDINET_STORE
tgui_id = "NtosRadarSyndicate"
program_icon = "bomb"
arrowstyle = "ntosradarpointerS.png"
@@ -7,8 +7,8 @@
program_open_overlay = "crew"
tgui_id = "NtosRecords"
size = 4
usage_flags = PROGRAM_PDA | PROGRAM_LAPTOP
available_on_ntnet = FALSE
can_run_on_flags = PROGRAM_PDA | PROGRAM_LAPTOP
program_flags = NONE
detomatix_resistance = DETOMATIX_RESIST_MINOR
var/mode
@@ -19,7 +19,7 @@
program_icon = "book-medical"
extended_desc = "Allows the user to view several basic medical records from the crew."
download_access = list(ACCESS_MEDICAL, ACCESS_FLAG_COMMAND)
available_on_ntnet = TRUE
program_flags = PROGRAM_ON_NTNET_STORE
mode = "medical"
/datum/computer_file/program/records/security
@@ -27,7 +27,7 @@
filename = "secrecords"
extended_desc = "Allows the user to view several basic security records from the crew."
download_access = list(ACCESS_SECURITY, ACCESS_FLAG_COMMAND)
available_on_ntnet = TRUE
program_flags = PROGRAM_ON_NTNET_STORE
mode = "security"
/datum/computer_file/program/records/proc/GetRecordsReadable()
@@ -5,7 +5,7 @@
downloader_category = PROGRAM_CATEGORY_SCIENCE
program_open_overlay = "robot"
extended_desc = "A remote controller used for giving basic commands to non-sentient robots."
requires_ntnet = TRUE
program_flags = PROGRAM_ON_NTNET_STORE | PROGRAM_REQUIRES_NTNET
size = 6
tgui_id = "NtosRoboControl"
program_icon = "robot"
@@ -5,10 +5,9 @@
extended_desc = "A built-in app for cyborg self-management and diagnostics."
ui_header = "robotact.gif" //DEBUG -- new icon before PR
program_open_overlay = "command"
requires_ntnet = FALSE
available_on_ntnet = FALSE
program_flags = NONE
undeletable = TRUE
usage_flags = PROGRAM_PDA
can_run_on_flags = PROGRAM_PDA
size = 5
tgui_id = "NtosRobotact"
program_icon = "terminal"
@@ -7,9 +7,9 @@
ui_header = "borg_mon.gif"
program_open_overlay = "generic"
extended_desc = "This program allows access to standard security camera networks."
requires_ntnet = TRUE
program_flags = PROGRAM_ON_NTNET_STORE | PROGRAM_REQUIRES_NTNET
download_access = list(ACCESS_SECURITY)
usage_flags = PROGRAM_CONSOLE | PROGRAM_LAPTOP
can_run_on_flags = PROGRAM_CONSOLE | PROGRAM_LAPTOP
size = 5
tgui_id = "NtosSecurEye"
program_icon = "eye"
@@ -40,11 +40,8 @@
filedesc = "SyndEye"
extended_desc = "This program allows for illegal access to security camera networks."
download_access = list()
available_on_ntnet = FALSE
available_on_syndinet = TRUE
requires_ntnet = FALSE
usage_flags = PROGRAM_ALL
unique_copy = TRUE
can_run_on_flags = PROGRAM_ALL
program_flags = PROGRAM_ON_SYNDINET_STORE | PROGRAM_UNIQUE_COPY
network = list("ss13", "mine", "rd", "labor", "ordnance", "minisat")
spying = TRUE
@@ -7,7 +7,7 @@
size = 2
tgui_id = "NtosSignaler"
program_icon = "satellite-dish"
usage_flags = PROGRAM_PDA | PROGRAM_LAPTOP
can_run_on_flags = PROGRAM_PDA | PROGRAM_LAPTOP
///What is the saved signal frequency?
var/signal_frequency = FREQ_SIGNALER
/// What is the saved signal code?
@@ -7,7 +7,7 @@
size = 2
tgui_id = "NtosSkillTracker"
program_icon = "medal"
usage_flags = PROGRAM_PDA // Must be a handheld device to read read your chakras or whatever
can_run_on_flags = PROGRAM_PDA // Must be a handheld device to read read your chakras or whatever
/datum/computer_file/program/skill_tracker/ui_data(mob/user)
var/list/data = list()
@@ -5,7 +5,7 @@
ui_header = "smmon_0.gif"
program_open_overlay = "smmon_0"
extended_desc = "Crystal Integrity Monitoring System, connects to specially calibrated supermatter sensors to provide information on the status of supermatter-based engines."
requires_ntnet = TRUE
program_flags = PROGRAM_ON_NTNET_STORE | PROGRAM_REQUIRES_NTNET
download_access = list(ACCESS_CONSTRUCTION)
size = 5
tgui_id = "NtosSupermatter"
@@ -3,14 +3,13 @@
filedesc = "Status Display"
program_icon = "signal"
program_open_overlay = "generic"
requires_ntnet = TRUE
size = 1
extended_desc = "An app used to change the message on the station status displays."
tgui_id = "NtosStatus"
usage_flags = PROGRAM_ALL
available_on_ntnet = FALSE
can_run_on_flags = PROGRAM_ALL
program_flags = PROGRAM_REQUIRES_NTNET
var/upper_text = ""
var/lower_text = ""
@@ -4,7 +4,7 @@
downloader_category = PROGRAM_CATEGORY_SCIENCE
program_open_overlay = "research"
extended_desc = "Connect to the internal science server in order to assist in station research efforts."
requires_ntnet = TRUE
program_flags = PROGRAM_ON_NTNET_STORE | PROGRAM_REQUIRES_NTNET
size = 10
tgui_id = "NtosTechweb"
program_icon = "atom"
@@ -5,9 +5,7 @@
program_open_overlay = "generic"
undeletable = TRUE
size = 0
header_program = TRUE
available_on_ntnet = TRUE
requires_ntnet = FALSE
program_flags = PROGRAM_ON_NTNET_STORE | PROGRAM_HEADER
tgui_id = "NtosThemeConfigure"
program_icon = "paint-roller"
@@ -5,9 +5,8 @@
program_open_overlay = "comm_monitor"
extended_desc = "This program monitors stationwide NTNet network, provides access to logging systems, and allows for configuration changes"
size = 12
requires_ntnet = TRUE
run_access = list(ACCESS_NETWORK) //NETWORK CONTROL IS A MORE SECURE PROGRAM.
available_on_ntnet = TRUE
program_flags = PROGRAM_ON_NTNET_STORE | PROGRAM_REQUIRES_NTNET
tgui_id = "NtosNetMonitor"
program_icon = "network-wired"