* Adjust objects to tabletop when wrenched (#75671)

## About The Pull Request
Added a variable to `/obj/` that can be set to adjust the object sprite
when it mapspawns or being wrenched on top of a table.
Set this variable for some popular tabletop machines, removing the
default `pixel_y` offsets for some of them.
Also moved the wrenching logic to /obj/. It was under machinery for some
reason.
## Why It's Good For The Game
Did you ever unwrench something from the table by accident and then was
annoyed that you can't revet it back?
## Changelog
🆑
qol: Objects have a variable to adjust them visually when they're
wrenched or spawned on a table
refactor: Removed redundant code that had similar purpose, moved `obj`
wrenching logic into the `objs.dm`
qol: food/slime processor can be moved on table and adjusts to it when
wrenched
/🆑
* Adjust objects to tabletop when wrenched
---------
Co-authored-by: Andrew <mt.forspam@gmail.com>
* Book patches (#75565)
## About The Pull Request
1. Fixes#75555 knives already have their `sharpness = SHARP_EDGED` so
there's no need to explicitly type check for them and overall that if
condition was just a mind blender, so it's better now
2. Fixes#75577 bibles can convert other bibles again and will not
attempt to store it inside. Carrying over the fix that was implemented
in #73137
## Changelog
🆑
fix: wire cutter's can carve out book's again.
fix: bibles can convert other bibles
/🆑
---------
Co-authored-by: carlarctg <53100513+carlarctg@ users.noreply.github.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
* Book patches
---------
Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
Co-authored-by: carlarctg <53100513+carlarctg@ users.noreply.github.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
* Allows the book binder to remember font typing (#75007)
use that for book binding
## About The Pull Request
Closes https://github.com/tgstation/tgstation/issues/74996
## Why It's Good For The Game
## Changelog
🆑
fix: Bookbinder no longer takes your pen's font and throws it out the
nearest window
/🆑
* Allows the book binder to remember font typing
---------
Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>
* Books now render Markdown, fixing paper importing (#74902)
## About The Pull Request
Books didn't render markdown and instead just dumped the raw contents,
(after a html encode), into the window.
Changes them to use tgui and support markdown rendering.
## Why It's Good For The Game
Books should should look the same as the paper used to make them.
## Changelog
🆑
fix: Book's no longer take your formatting and throw it out the window.
refactor: Book display and rendering
/🆑
---------
Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@ users.noreply.github.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
* Books now render Markdown, fixing paper importing
---------
Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>
Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@ users.noreply.github.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
* Adds book burning (#74873)
## About The Pull Request
For some reason, unlike other paper items, you couldn't ignite books
with a lighter or other hot item.
Now, you can!
(Also made it so the odd obscure mechanic of cutting pages out of books
can be done by any sharp item, not just wirecutters or knives)
## Why It's Good For The Game
Consistency.
~~Burning copies of WGW.~~
## Changelog
🆑
add: Books can now be burned just like any other paper item.
add: You can cut pages out of books with any sharp item, not just knives
or wirecutters.
/🆑
---------
Co-authored-by: san7890 <the@ san7890.com>
* Adds book burning
---------
Co-authored-by: ChungusGamer666 <82850673+ChungusGamer666@users.noreply.github.com>
Co-authored-by: san7890 <the@ san7890.com>
* Machines can now be pried open multiple times and maintain their initial densities (#74163)
## About The Pull Request
These changes fix how machines are pried open with crowbars. Currently,
most machines can be pried open, but many of them have no method for
being closed again. This means they can be pried once, and then never
again (as their internal logic has them stuck in an "open" state).
Additionally, the densities of these machines is also inconsistent, as
density is tied to the procs for opening/closing machines (open =
non-dense, closed = dense). Thus, these new changes allow desired
densities to be passed to `open_machine()` and `close_machine()`, as
well as `default_pry_open()`, meaning that atypical machine densities
can be maintained (e.g. machines that should remain dense when open, or
non-dense when closed).
I've also added a `close_after_pry` boolean parameter to the
`default_pry_open()` proc, which determines whether to immediately close
a machine after opening it. This is useful for machines that don't
really have a use case for remaining open, often lacking a sprite to
represent this state as well.
* Note: Opening and immediately closing machines with this boolean will
still drop their contents onto the floor, but will now immediately
"close" in their logic, allowing for further prying attempts in the
future.
It's worth noting that this implements default density values for these
procs, which match the existing behavior for machines, so as to
(hopefully) not disrupt existing or expected machine behavior.
Two caveats to these changes currently exist:
1. On machines that immediately close after prying, the prying action
can now be spammed to the chat with repeated clicking. I'm uncertain if
this needs some sort of spam protection or if it's fine as is.
2. I've only been able to manually test this code. I'd love to write
unit tests for it, as it affects a lot of different machines, but don't
know where to begin with DM Unit Testing (or which files would be good
examples to reference in the code base).
* Note: I did manually test each and every machine that calls
`default_pry_open()` and they all seem to be working correctly. (Except
for `obj/machinery/plumbing/sender`, but that doesn't seem to need
prying, as it has no contents to drop, only reagents.)
As always, let me know if any improvements/changes should be made.
This closes#26833.
## Why It's Good For The Game
These changes allow crowbar prying to correctly occur multiple times on
any machine, which is intended behavior. It prevents player confusion
that could occur when a machine couldn't be pried open a second time
during a shift, even though it had previously been pried before, forcing
players to question themselves. (Are they missing something? Did they
perform the action a different way last time? Is the machine actually
still powered on instead of off? Etc.)
These changes also maintain the correct density for machines after
prying, preventing scenarios where a machine might behave differently
once it had been pried open. (An example of this was being able to walk
through a smartfridge after prying it open.) Additionally, players are
no longer required to know/use workarounds (such as machine disassembly)
to retrieve a powered-off machine's contents.
Overall, these changes improve consistency around machines, creating
more scenarios where they behave as players would expect.
## Changelog
🆑
fix: machines can now be pried open more than once.
fix: machines now have the correct density when pried open.
/🆑
---------
Co-authored-by: san7890 <the@ san7890.com>
* Machines can now be pried open multiple times and maintain their initial densities
* wew
---------
Co-authored-by: Antonio Tosti <5588048+atosti@users.noreply.github.com>
Co-authored-by: san7890 <the@ san7890.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
* [no gbp] removes all duplicate armor datums (#72354)
closes#72348
Title
My bad
Heres the script I used this time if you want to
```cs
var baseDir = Environment.CurrentDirectory;
var allFiles = Directory.EnumerateFiles($@"{baseDir}\code", "*.dm", SearchOption.AllDirectories).ToList();
var known = new Dictionary<string, List<KeyValuePair<string, int>>>();
foreach (var file in allFiles)
{
var fileLines = File.ReadAllLines(file);
for (var i = 0; i < fileLines.Length; i++)
{
var line = fileLines[i];
if (line.StartsWith("/datum/armor/"))
{
var armorName = line.Replace("/datum/armor/", "").Trim();
if (!known.ContainsKey(armorName))
known[armorName] = new List<KeyValuePair<string, int>>();
var knownList = known[armorName];
knownList.Add(new KeyValuePair<string, int>(file, i));
}
}
}
Console.WriteLine($"There are {known.Sum(d => d.Value.Count)} duplicate armor datums.");
var duplicates = new Dictionary<string, List<int>>();
foreach (var (_, entries) in known)
{
var actuals = entries.Skip(1).ToList();
foreach (var actual in actuals)
{
if (!duplicates.ContainsKey(actual.Key))
duplicates[actual.Key] = new List<int>();
duplicates[actual.Key].Add(actual.Value);
}
}
Console.WriteLine($"There are {duplicates.Count} files to update.");
foreach (var (file, idxes) in duplicates)
{
var fileContents = File.ReadAllLines(file).ToList();
foreach (var idx in idxes.OrderByDescending(i => i))
{
string line;
do
{
line = fileContents[idx];
fileContents.RemoveAt(idx);
}
while (!String.IsNullOrWhiteSpace(line));
}
File.WriteAllLines(file, fileContents);
}
```
* modular
Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>
* Implements Cooldown On Uploading Books to Newscaster (#72112)
## About The Pull Request
Hey there,
Pretty much on the tin. We implement a cooldown on the backend for a set
amount of time to prevent people spamming the newscaster channel with a
shitload of books (rather than have absolutely no safeguards against
it), and then pipe information to the UI for user feedback.
## Why It's Good For The Game
Fixes#71290
In case you weren't already aware, letting users absolutely wreck the
shit out of player's chat via newscaster spam (all newscasters forcesay
a message when something's uploaded to it) as well as just fill the shit
up of a channel with various vulgarities isn't a really good thing.
## Changelog
🆑
fix: To prevent spam, there is now a cooldown on being able to upload
assorted books into the newscaster's channel feed.
/🆑
Let me know if the cooldown seems too long, not hard to change.
* Implements Cooldown On Uploading Books to Newscaster
Co-authored-by: san7890 <the@san7890.com>
* Adds falling hazard element, beware of falling tools, wear your hardhat, comically timed piano falling on the clown (#70970)
## About The Pull Request
https://user-images.githubusercontent.com/82386923/199180691-6605c8cc-e8aa-490e-ab65-909d45d12ca0.mp4
Do note that the damage in this video is extremely exaggerated compared
to what the normal value is.
## Why It's Good For The Game
All these signs about engineers needing to wear their hardhat, and for
what? For the assistant dropping toolboxes onto them from above, that's
what! Also allows people to do as god intended by allowing them to drop
pianos on people.
## Changelog
🆑
add: A variety of items, mainly tools, around the station might hurt if
they fall on your head, remember to wear your hardhat and to avoid
standing under large red X marks on the ground with a piano hanging
above them.
/🆑
Co-authored-by: MrMelbert <51863163+MrMelbert@ users.noreply.github.com>
* Adds falling hazard element, beware of falling tools, wear your hardhat, comically timed piano falling on the clown
* Made anvil and large mortar falling hazards
Co-authored-by: Paxilmaniac <82386923+Paxilmaniac@users.noreply.github.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@ users.noreply.github.com>
Co-authored-by: Tastyfish <crazychris32@gmail.com>
Adds Sabrage (#70755)
This PR adds an interaction to champagne bottles that allows the user to
pull off the cork with an edged (for code purposes, sharp) item. The
sharper the item, the better your chance is to pull the stunt off.
Minimum force is 5, which lets you do it with a captain's pen, for
instance. It's slower than just removing the cork by hand, as to
simulate the player removing the foil before taking the swing. Heads of
staff get a +20% chance to succeed due to being officers in some
capacity. A skillchip that can be bought from the Library Play Room
vendor increases the chance by +35%. Failing the stunt will smash the
bottle in your hands, spilling the contents all over you. This will
produce a bottle with the neck broken off, instead of its bottom.
Pulling the stunt off provides a weak mood buff for the user, and a
weaker mood buff for any witnesses. However, if someone else pulls the
sabrage off after you, you will get your success buff removed. Think of
it like pulling any other stunt and challenging someone else to do it,
only for them to succeed as well. Makes you bitter, doesn't it? Failing
the stunt also produces a weak mood debuff to the user.
Co-authored-by: Sealed101 <75863639+Sealed101@users.noreply.github.com>
* Fixes issues with printing posters from the library management computer (#70471)
## About The Pull Request
Posters are kind of insane and they require that the poster item have
either a poster_type defined in the type or that you pass the structure
version of the poster to /new() otherwise they don't work. The weird
thing is that the structure needs to be in the contents of the item too,
or it again won't work (it won't remove the poster from your hands when
placing it). I fixed it so all you need to do is pass the structure
version of the poster to /new() on the item and it will move the
structure to the contents of the item if needed. It's still a bit insane
but it's better than it was and it fixed the bug.
Also SSLibrary.printable_posters was grabbing the directional mapping
helper of the random poster and so when you printed it and placed it,
you'd get confusing results. I made a quick fix to stop that from
happening.
## Why It's Good For The Game
Bug fixes are generally good things.
Fixes#70382Fixes#66504
## Changelog
🆑 VexingRaven
fix: Fixed posters printed from the library console staying in your hand
when you place them
fix: Fixed Random Official Poster printed from the library console
always placing the west-facing variant no matter where you place it
/🆑
* Fixes issues with printing posters from the library management computer
Co-authored-by: VexingRaven <msgerbs@users.noreply.github.com>
* BCIs are now stored in the manipulation chamber's contents, instead of nullspace (#70350)
Fixes a bug where MMIs would be sent into the nullspace room when in an MMI component inside of a BCI that is inserted into a BCI manipulation chamber.
Stores the BCI in the chamber's contents, instead of nullspace, allowing the MMI to talk, the BCI to still act as it would normally and overall just solves the issue and maybe some others alongside it.
Fixes#70349
* BCIs are now stored in the manipulation chamber's contents, instead of nullspace
Co-authored-by: RikuTheKiller <88713943+RikuTheKiller@users.noreply.github.com>
* Bureaucracy logging (#69554)
Sent fax messages' contents and printing out books is now logged to paper.log.
Renaming fax machines is logged to game.log (and to individual players' logs).
Mostly because I was annoyed earlier looking for who printed out books. And then faxes seemed like a logical continuation.
Plus it seems like an interesting way to see how often certain books are printed out!
* Bureaucracy logging
Co-authored-by: tattle <66640614+dragomagol@users.noreply.github.com>
* Fixes runtime from bookshelves being maploaded in after SSlibrary is done instantiating (#69425)
* Fixes runtime with bookshelves loading.
- If a bookshelf is maploaded after the library subsystem is instantiated, it runtimes due to shelves_to_load being null, and no books are loaded. So, if a bookcase is maploaded after SSinit is done initializing, just load the shelf in init.
* Needs to be asyncronous.
* Fixes runtime from bookshelves being maploaded in after SSlibrary is done instantiating
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
* Updates the book scanner sprite (#69176)
Improves the book scanner sprite and adds a sound when scanning a book
* Updates the book scanner sprite
Co-authored-by: Wallem <66052067+Wallemations@users.noreply.github.com>
* Replaces the mood component with a mood datum
* Fixes merge conflicts and updates all of our mood events to use the new mood datums
Co-authored-by: Seth Scherer <supernovaa41@gmx.com>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
* Fixes 118(give or take) cases of mapload not being passed to initilaize (#69107)
fixes 114 cases of mapload not being passed to initilaize
* Fixes 118(give or take) cases of mapload not being passed to initilaize
* Fixes a lot (give or take) cases of mapload not being passed to initilaize
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: Tom <8881105+tf-4@users.noreply.github.com>
* [MDB Ignore][Bounty][Complete Refactor] Papercode Redux: Too Many Damn Files <Map Conflict Edition>
* Fixes merge conflicts and compilation errors, alongside fixing the joker card to make it fully functional again
* Fixed a bunch of info variables in map files
* Alright this is why I wanted this merged yesterday
Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
* Tsu's Brand Spanking New Storage: or, How I Learned To Pass Github Copilot As My Own Code
* Delete storage.dm
* yippee
* shit
* holy shit i am stupid
* more fixes
* fuck
* woops
* This tail refactor turned into an organ refactor. Funny how that works.
* Firstly, fixing all the conflicts.
* Fixes all our maps (hopefully)
* Actually, this should fix pod people hair :)
* Almost everything is working, just two major things to fix
* Fixed a certain kind of external organ
* Cleaning up some more stuff
* Turned tail_cat into tail because why the fuck are they separate?
* Moved all the tails into tails.dmi because that was just dumb to have like 3 in a different file
* Adds relevant_layers to organs to help with rendering
* Makes stored_feature_id also check mutant_bodyparts
* Fixes the icon_state names of ALL the tails (pain)
* Fixes wagging, gotta refactor most mutant bodyparts later on
* I Love Added Failures
* Fixed some organs that slipped through my searches
* This could possibly fix the CI for this?
* It doesn't look like it did fix it
* This will make it pass, even if it's ugly as sin.
* Fixed Felinids having a weird ghost tail
* Fixes instances of snouts and tails not being properly colored
Co-authored-by: Kapu1178 <75460809+Kapu1178@users.noreply.github.com>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
* Fix books to only give mood bonus when read the first time (#66371)
* Fix book rereading exploit
* Refactor book_title_read to be for mind datum
* Remove reader var from on_read
* Add sanity check for mind
* Fix books to only give mood bonus when read the first time
Co-authored-by: Tim <timothymtorres@gmail.com>
* Anomaly expansion - part 1 - Hallucination anomaly (#66392)
New anomaly, the hallucination anomaly. It has small bursts of hallucinations while alive followed by a big one in the moment of the end.
More anomalies are fun, i'm planning to add more of these
added the hallucination anomaly, spawnrate similar to the flux one, can spawn from the SM if eer are over 5000, can spawn when the SM delams (higher rate than the grav one), you can make the hallucination reactive armor
* Anomaly expansion - part 1 - Hallucination anomaly
* Update hud.dm
Co-authored-by: Ghilker <42839747+Ghilker@users.noreply.github.com>
Co-authored-by: Zonespace <41448081+Zonespace27@users.noreply.github.com>
* Arconomy Adjacent Content: Newscaster Refactor Omega
* Fixed all of the issues that resulted from the repathing
* Fixed our modularized priority_announce.dm
* Deleted newscaster.dm because it was still there due to two comments that weren't overly important
* Fixed merge conflicts for delta
* Fixed a bunch of skyrat maps so they compile :)
* I forgor a few more maps
* Add newscaster_bounty for our newscaster sprite (#12344)
Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
Co-authored-by: Tastyfish <crazychris32@gmail.com>