Files
Bubberstation/code/modules/modular_computers/file_system/computer_file.dm
John Willard 06197693a5 Adds support for non-science techwebs (+Config) (#71070)
## About The Pull Request

This is an expanding of
https://github.com/tgstation/tgstation/pull/69708

Adds a config to not connect machines to a techweb at the start of a
round
Adds the ability to multitool a server to get its techweb in its buffer,
which can then be used on machines to sync them.
Adds support for some machines to not cry when they don't have a techweb
linked to it, in case they actually don't.

If the config to not have machines connected to the science server is
enabled, research servers will make their own techwebs instead. This is
barebones though and would need more work if this option is used.

For misc stuff:
- I replaced checking ``GLOB.machines`` for research servers, to instead
check ``SSresearch.servers``, where we can use ``as anything``.
- Removed unused vars on the RD server control
- I renamed the operating computer's .dm file to remove the capitalized
letter from it. It's now operating_computer instead of Operations.

## Why It's Good For The Game

This is adding support for 2 different cases that can be used in the
future:
1. Off-station roles, we can make roles like Oldstation have their own
techweb so they don't ruin science's efforts, or use their advanced
research to get things we don't want, or even possibly have some
blacklist webs for ghost roles (like teleporters) so that way we don't
need to have this dance where we have to give them a very specific
amount of materials for them to do things while not being able to get a
teleporter and leaving. I heard discussions that people wanted this a
while back, and one of the main things preventing this from happening is
the lack of support. Hopefully this is encouragement to make it a
reality, because I think it would be a really cool expansion of ghost
roles and a good way to prevent them from messing with the round in
progress.
2. Downstreams who want to do different things with Science. Personally
I made this PR with voidcrew(shiptest) in mind and think this would make
their lives easier. I didn't expand too much on this because I'm leaving
up mostly to the downstreams to figure out what they want to do with
these systems.

## Changelog

This generally isn't really player facing, since most of the changes
would only come into effect if the config is enabled??

🆑
fix: Research servers now only show servers connected to their techweb.
/🆑
2022-11-20 15:34:53 +01:00

64 lines
2.0 KiB
Plaintext

/datum/computer_file
///The name of the internal file shown in file management.
var/filename = "NewFile"
///The type of file format the file is in, placed after filename. PNG, TXT, ect. This would be NewFile.XXX
var/filetype = "XXX"
///How much GQ storage space the file will take to store. Integers only!
var/size = 1
///Whether the file may be deleted. Setting to TRUE prevents deletion/renaming/etc.
var/undeletable = FALSE
///The computer file's personal ID
var/uid
///Static ID to ensure all IDs are unique.
var/static/file_uid = 0
///The modular computer hosting the file.
var/obj/item/modular_computer/computer
/datum/computer_file/New()
..()
uid = file_uid++
/datum/computer_file/Destroy(force)
if(computer)
computer.remove_file(src)
computer = null
return ..()
// Returns independent copy of this file.
/datum/computer_file/proc/clone(rename = FALSE)
var/datum/computer_file/temp = new type
temp.undeletable = undeletable
temp.size = size
if(rename)
temp.filename = filename + "(Copy)"
else
temp.filename = filename
temp.filetype = filetype
return temp
/**
* Called when examining a modular computer
* Args:
* Source - The tablet that's being examined
* User - Person examining the computer
*
* note: please replace this with signals when hdd's are removed and program's New() already has the tablet set.
*/
/datum/computer_file/proc/on_examine(obj/item/modular_computer/source, mob/user)
return null
/// Called when attacking a tablet with an item, checking if any application uses it. Return TRUE to cancel the attack chain.
/datum/computer_file/proc/application_attackby(obj/item/attacking_item, mob/living/user)
return FALSE
/**
* Implement this when your program has an object that the user can eject.
*
* Examples include ejecting cells AI intellicards.
* Arguments:
* * user - The mob requesting the eject.
* * forced - Whether we are forced to eject everything (usually by the app being deleted)
*/
/datum/computer_file/proc/try_eject(mob/living/user, forced = FALSE)
return FALSE