* Sign/plaque contextual screentips and file reorganizing (#73246)
## About The Pull Request
This PR adds contextual screen tips to signs and plaques based on the
held tool. Wrenches unfasten, and welders repair. Behaves the same with
plaques, but plaques also get a screentip for using a fountain pen on
them if they can be engraved. Also adds a tip to editable-item signs
with a pen out.
Tested to avoid issues with posters from cropping up, and it appears to
still behave correctly with paper posters, which are apparently a type
of sign. Go figure.

I've also reorganized the sign and plaque files to follow our more
standard object hierarchy of base type -> inherited procs -> subtype
specific procs, where these were interspersed throughout the file. I did
however leave the armor datums below the object, as they appear to
follow new convention.
## Why It's Good For The Game
Screentips avoid ambiguity and improve readability of construction. Easy
improvement.
Plus, improves consistency of the signs file layout-wise.
## Changelog
🆑
qol: Adds screentips to both signs and plaque construction/modification.
/🆑
* Sign/plaque contextual screentips and file reorganizing
---------
Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com>
* Adds examine, balloon alert & screen tips for Meat Spike Frame (#73126)
## About The Pull Request
- Examining a meat spike frame will tell how you can either deconstruct
it with an welding tool or add spikes to it with iron rods
- Examining a meat spike will tell you how to remove its spikes and how
to basically use it
- A balloon alert will pop up if you don't have enough iron rods to add
spikes to a meat spike frame
- Screen tips when holding the correct tool are displayed
## Why It's Good For The Game
New players don't have to wiki this and honestly i got confused the
first time i used it so there is that. More information basically
## Changelog
🆑
qol: examining a meat spike frame & meat spike will tell you about
itself
/🆑
---------
Co-authored-by: MrMelbert <51863163+MrMelbert@ users.noreply.github.com>
Co-authored-by: John Willard <53777086+JohnFulpWillard@ users.noreply.github.com>
Co-authored-by: san7890 <the@ san7890.com>
* Adds examine, balloon alert & screen tips for Meat Spike Frame
---------
Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@ users.noreply.github.com>
Co-authored-by: John Willard <53777086+JohnFulpWillard@ users.noreply.github.com>
Co-authored-by: san7890 <the@ san7890.com>
* Fixes freezers locking automatically when closed. (#73253)
## About The Pull Request
Took a little while to figure out what was going on, Freezers override
close() but never return true when they successfully close which results
in the code for locking the freezer being called right after closing it.
## Why It's Good For The Game
Fixes an oversight.
## Changelog
🆑
fix: Freezer no longer lock automatically when closed.
/🆑
* Fixes freezers locking automatically when closed.
---------
Co-authored-by: NamelessFairy <40036527+NamelessFairy@users.noreply.github.com>
* Fix a merge skew on armor datums (#72909)
And also add a check grep to find it in the future
* fix linters
* damn youuuu
---------
Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>
* Tram Mk. IV hotfixes [NO GBP] (#73243)
## About The Pull Request
Fixes some little issues in
https://github.com/tgstation/tgstation/pull/73057
- tram doors only crush people if either emagged (100%) or
malfunctioning (15%)
- emag works on tram doors
- crossing signals use correct amount of power, increased brightness
- crossing signals and destination signs consume power when idle
- green static crossing signal shuts off when power lost
- left/right emag icons are swapped
- tram bench override shouldn't override all benches | Fixes
https://github.com/tgstation/tgstation/issues/73250
- reduced damage from tram door crushing (60 > 45)
## Changelog
🆑 LT3
fix: Fixed motion sensors on tram doors, they will now crush you much
less often!
balance: Reduced damage from being crushed by tram doors
code: Un-nested emag blacklist
code: emag works properly on tram doors
fix: Backwards tram door sparks animation
fix: Tram displays power consumption
fix: Tram crossing signals power consumption
balance: Increased brightness on tram crossing signals
fix: West Wing NW/SW and East Wing NE/SE crossing signals now shut off
when power is lost
fix: Tram benches don't override standard benches
fix: Reduced saturation and brightness of standard bench
/🆑
---------
Co-authored-by: Zephyr <12817816+ZephyrTFA@ users.noreply.github.com>
* Tram Mk. IV hotfixes [NO GBP]
---------
Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com>
Co-authored-by: Zephyr <12817816+ZephyrTFA@ users.noreply.github.com>
* Converts blindness and nearsightedness to status effects, scratches some VERY dumb blindness handling that resulted in mobs becoming "incurably" blind
* Fixes the conflicts and makes shit compile!
* Fixes other things that didn't show up because I hadn't updated
* Fixes the lints.
* Okay NOW it's ready (please don't add anything else that touches blindness I beg you)
---------
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
Tram Mk. IV (#73057)
- After one too many tram malfunctions, Nanotrasen's insurance provider
finally sprung the cash for a new tram. Made with the latest in
lightweight materials, there's more capacity than ever before to shuttle
your crew around the station.
https://user-images.githubusercontent.com/83487515/215639768-3f7fcb84-cfd2-4efe-b578-998197651f13.mp4
- Consolidates all the tram turfs, objs, and structures into respective
.dm files because they were haphazardly spread everywhere.
- Fixes tram doors playing open/close animations when they're already in
the correct state, corrects timing for when they change density.
- Tram now correctly has an operating status and will stop functioning
when power is lost.
- Call buttons no longer dispatch a tram that doesn't have power.
- Fix for emergency exit when tram has no power.
- Running at closing tram doors is a gamble, you may be crushed
- Fixes https://github.com/tgstation/tgstation/issues/73125
Looks nice, more space, tram doors demand a pound of flesh.
🆑 LT3
imageadd: Nanotrasen's insurance provider finally sprung the cash for a
new tram. Made with the latest in lightweight and mostly* non-flammable
materials, travel in comfort and style!
code: All tram components are now organised based on type
code: Tram is now aware if it has power or not
del: Removed movement slowdown running on tram plates
fix: Tram call buttons will not work calling an unpowered tram
fix: Tram doors will no longer cycle open/closed when they're already in
the correct position
fix: Fixed an edge case where running onto the tram you bounce off the
open door as if it was closed
fix: Unpowered tram doors can only be forced into the open position
fix: Westbound travel shows the correct controls animation
add: Tram doors take a chunk of flesh if you run at them last minute
qol: Reduced duration of amber stage on tram crossing signals
/🆑
Malfunctioning AIs whos brain is removed from the core and rehomed in another core will retain their law 0. (#73047)
## About The Pull Request
Currently if you are able to deconstruct a malfunctioning AI, such as
through methods that gib AIs, rehoming the AI in a new core results in
it losing its law 0, but it retains its antagonist datum and combat
upgrades. This is due to the law 0 only being generated when the AIs
gains the antag datum, I've made it so that when a brain with the
malfunctioning AI datum is inserted into an AI core it will re-produce
its law 0.
## Why It's Good For The Game
"Exploit"(?) that could be used to de-malf AIs patched and should cause
less confusion for malf AI players since they wont end up in a situation
where they have no law 0 but have all other malf AI components.
## Changelog
🆑
fix: Removing a malf AIs brain and inserting it into a new core
no-longer clears its zeroth law
/🆑
Co-authored-by: NamelessFairy <40036527+NamelessFairy@users.noreply.github.com>
Fixes extinguisher cabinet examine saying to alt-click to toggle (it is now right-click) (#72955)
Fixed fire cabinet examine text falsely saying to alt-click to
open/close; it now has contextual screentips, and uses balloon alerts
when relevant
Co-authored-by: OrionTheFox <76465278+OrionTheFox@users.noreply.github.com>
* adds atmospheric gloves, small resprite of firefighter gear, repaths stupid glove paths (#72736)
repaths a lot of gloves off /color because they were incredibly stupid
firefighter gear has gotten an update (it doesnt cover hands anymore
though, you need something else)
firefighter helmets no longer hide your mask or glasses

fixed engine goggles starting with darkness vision
to the atmos lockers adds atmospheric gloves, a pair of thick (chunky
fingers) gloves that are fireproof and fire protective, slightly shock
resistant and let you fireman carry people faster.
atmospheric firefighter helmets now are a subtype of welding hardhats,
you can enable a welding visor.
welding hardhats change mode with right click instead of altclick
im not a good spriter but i think this resprite makes them fit nicer
with other engi equipment
lets me firefighter rp
🆑
add: Atmospheric Gloves, thick gloves that are fully fireproof and fire
protective and let you fireman carry people faster.
fix: fixes engine goggles starting with darkness vision
qol: firefighter helmets can now enable a welding visor
qol: welding hardhats change mode with right click instead of altclick
balance: firesuits no longer protect your hands
/🆑
* Makes shit compile
* Updates the digi and snouted stuff to match the new sprites (thanks Halcyon!)
* Fixes a whole ton more issues that popped up
---------
Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
* Fixes toilet bongs, and fixes a serious bug in the crafting system (#72893)
The PR everyone has been waiting for...fixed toilet bong crafting. Now
you can craft them just as before using the new crafting system.

In attempting to fix this I encountered one of the gnarliest, nastiest,
meanest and most infuriatingly difficult to debug bugs I have come
across so far. And it's existed for as long as the crafting system has,
but due to unique circumstances it has been allowed to go unnoticed this
whole time.
Technical details below. Full list of changes here:
- crafting recipes can now contain structures as part of their
requirements
- removed deprecated var 'additional_req_tex' and changed text to use
the 'steps' list instead so they actually show in the gui
- toilet bongs are now passable terrain like normal toilets are
- fixed an atrocious bug with crafting that was by pure coincidence not
causing any problems
- this bug would prevent any recipes that did not contain a material
from deleting properly
- this bug would also cause any recipes that are supposed to use but not
consume machinery to consume them regardless
---
Basically, the bug that took me hours upon hours of debugging and
head-scratching to find is this:
from crafting.dm:
```
main_loop:
for(var/path_key in requirements)
amt = R.reqs[path_key] || R.machinery[path_key]
if(!amt)//since machinery can have 0 aka CRAFTING_MACHINERY_USE - i.e. use it, don't consume it!
continue main_loop
```
specifically this line:
`amt = R.reqs[path_key] || R.machinery[path_key] `
The culprit ended up being that if you do machinery[path_key] on an
empty list, it can lead to very unexpected behavior (see: EXITING THE
FUNCTION without actually doing anything).
I spent so much time thinking that item deletion wasn't working because
amt was being set to 0, false, or null perhaps when no, it wasn't that.
The function was just exiting out even before the (!amt) check due to
the atrocities committed by someone before me.
Setting amt = `R.reqs[path_key] || R.machinery[path_key]` on the other
hand always evaluates to a positive integer (either the successfully
retrieved reqs amt, or a 1 from the OR expression). It was only by
coincidence that the code did what it was supposed to, because:
1) Every single recipe has R_reqs, so the first part will never cause
the function-exiting failure because the list is never empty.
2) As for the second part of the expression, there are no recipes that
make use of CRAFTING_MACHINERY_USE, so the fact that machinery[path_key]
was never actually being accessed and thus set to a var (which is what
causes the function to exit) didn't matter.
So these two things together have basically allowed a really bad bug to
go unnoticed this whole time. I only noticed it because when trying to
add a third part to the expression it just did not work at all how you
would expect.
The solution is rather simply to add a check like so:
```
main_loop:
for(var/path_key in requirements)
amt = R.reqs?[path_key] || R.machinery?[path_key]
if(!amt)//since machinery can have 0 aka CRAFTING_MACHINERY_USE - i.e. use it, don't consume it!
continue main_loop
```
Fixes https://github.com/Skyrat-SS13/Skyrat-tg/issues/18732 .
Fixes a bug with crafting that would inevitably torment someone else as
soon as they tried to add the right kind of recipe, if that hasn't
already happened by now.
<details>
<summary>Toilet bongs are back baby!!</summary>

</details>
🆑
fix: toilet bongs crafting recipes
fix: fixed crafting itself
refactor: cleaned up some old code in the recipes file, added support
for structures in recipes
/🆑
* Update tgui/packages/tgui/interfaces/PersonalCrafting.tsx
Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>
* Update tgui/packages/tgui/interfaces/PersonalCrafting.tsx
Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>
Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>
Moves mining points from the ID to the bank account (+credit type shown on order console) (#72726)
## About The Pull Request
Mining points are now stored on the ID's bank accounts instead of the
individual IDs, bringing them on-par with credits. This allows miners to
safely replace their ID and keep their mining points just like they can
for their credits.
I also added the cost type on Produce Consoles, so people using them
will know whether they're using mining points or credits.
Because all IDs have a bank account by default, this won't be a problem
to Golems or the like.
## Why It's Good For The Game
1. It's more clear to the player what type of credit is being used in
the order console
2. Mining points being tied to the ID is no longer needed as all IDs
have a bank account
3. Brings mining points up to the same standard as credits.
## Changelog
🆑
qol: Mining points is now tied to bank accounts instead of individual
IDs, so they transfer over in cases of an ID replacement.
/🆑
Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
Layering: Fixes wires and pipes on lattice catwalk, glass floor [NO GBP] (#72703)
## About The Pull Request
- Fixes https://github.com/tgstation/tgstation/issues/72894
- Fixes layering for wiring and disposal pipes on lattice-based catwalk.
(Goes on top.) Wiring and pipes on floor-based catwalk. (Goes
underneath.)
- Glass floor shifted to show wires/pipe underneath it.
- Moves tram plaque to the game plane, layered underneath tossed
objects.
## Why It's Good For The Game
Wiring the solars looks weird with the wrong layering.
## Changelog
🆑 LT3
fix: Wires and pipes again rest on top of lattice catwalk
/🆑
Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com>
Exempts horrible goose from tram hit counter (#72811)
Tram hitting the goose increments the hit counter, this fixes it so
mobs without clients don't increase the Tram's hit counter.
Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com>
You can no longer climb ladders from anchored buckleables (#72808)
This PR prevents you from climbing ladders while buckled to something
that is anchored. You can still climb while buckled to non-anchored
things like wheelchairs or people.
Co-authored-by: Ryll Ryll <3589655+Ryll-Ryll@users.noreply.github.com>
Fixes strange geyser and geyser regen (#72221)
Called the random reagent code after it was initialized
Registered the reagent del/remove signal on the geyser, not the reagent
datum of the geyser
Closes#72037🆑
fix: Strange geysers have random reagents again
fix: Geysers regen reagents again
/🆑
Co-authored-by: Time-Green <timkoster1@hotmail.com>
* Moves extinguisher cabinet open/close to right click (#72735)
## About The Pull Request
Changes the open/close of extinguisher cabinets from AltClick() to
attack_hand_secondary() to make it more intuitive to use
## Why It's Good For The Game
If closing extinguisher cabinets is easier to do people will be more
encouraged to clean up after themselves and put the extinguishers back.
## Changelog
🆑
qol: Extinguisher cabiners are now opened and closed with right click
instead of alt+click.
/🆑
* Moves extinguisher cabinet open/close to right click
Co-authored-by: Thunder12345 <Thunder12345@users.noreply.github.com>
* Cutting the Burdened Cheese Part 1: Removes free burden points from removing unnecessary or cosmetic organs. (#71938)
Burdened organs now only count for the main organs only. Cyberimplants
don't count, alien organs don't count, etc. This is because someone
could get a bunch of extra organs, and then take the burdened sect and
remove them for free burden points.
Useless organs for species also do not count (stomachs given to species
that do not hunger, for instance)
Removes the error on burden points clamping on negative values. This can
happen when someone previously disabled takes burden sect.
Cheese is being used to bypass the unique gameplay goals burdened sect
provides. Will throw another pr when fikou finishes bat mutants ;)
🆑
fix: Removed some cheese strategies from burdened sect.
/🆑
Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
* Modular!
* Aaaaaa
Co-authored-by: tralezab <40974010+tralezab@users.noreply.github.com>
Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
Co-authored-by: Funce <funce.973@gmail.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>
* Completely Culls req_access_txt/req_one_access_txt (#72281)
Hey there,
Now that every instance of `req_access` and `req_one_access` is a list
of strings, there is absolutely no reason for
req_access_txt/req_access_one_txt to exist. In fact, any instance where
they were still used in the codebase was very convoluted and was very
broken! Don't worry, I fixed it all out, and life is good.
I also dmdoc the surviving access variables, because those were missing.
I went on the side of caution and made a more verbose documentation with
an example just to have people really grasp this (it took me a while to
actually get it)
I believe that we changed _everything_ over to the
req_access/req_one_access system earlier this year in VV, but the
problem is that _new mappers don't understand the difference between the
two systems_. In fact, the "txt" system is completely redundant since
all it does is transition stuff to the "base" system. So, let's just
completely cull the one that's all but deprecated and ensure this
confusion no longer arises. The whole purpose of "txt" seemed to be to
convert the access, but it's all pointless now that we can just read the
list directly.
I'm also 99% certain that the "access check" on vending machines broke
(and didn't seem to have correct logic in the first place? I
legitimately couldn't find a case where it could fail in testing, so I
changed that up), and that's fixed up now. Let me know if I was clueless
there. I know it's short-circuiting now as opposed to "all must be
true", but it just didn't work.
* Completely Culls req_access_txt/req_one_access_txt
* oh the misery
* makes them use the thing that actually works
* test to see if engineering access is breaking it
* Revert "test to see if engineering access is breaking it"
This reverts commit 3cc2c554ff18f435a51601782e64c76193298db7.
* Fix access checks when req_access is null (#72458)
## About The Pull Request
Fixes#72450 - This seems to be an oversight in some of the access
refactors we've been through recently. When there was an assumption in
`check_access_list()` that `req_access` would always be a list, and that
if it was not something terrible had gone wrong and the door should
default to public access.
With the cleanup of the _txt access vars and the introduction of mapping
access helpers, this assumption is no longer true. `req_access` will be
null when multiple helpers are painted onto the same door, so we need to
handle that properly. Thanks to @MrMelbert for spitting out the attached
fix in mapping general and letting me PR it after testing.
This really needs a suite of unit tests around it. San has helpfully
volunteered to work on that for three hours before getting frustrated.
## Why It's Good For The Game
No more public access to engineering lobby, lathe, etc.
## Changelog
🆑 Vire, MrMelbert
fix: The engineering lobby and lathe are no longer public access
fix: Doors will no longer be treated as public access when they have
multiple accesses set on them
/🆑
Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: Paxilmaniac <paxilmaniac@gmail.com>
Co-authored-by: Vire <66576896+Maurukas@users.noreply.github.com>
Co-authored-by: Tastyfish <crazychris32@gmail.com>
Add lints for idiomatic balloon alert usage (#72280)
Adds lints for `balloon_alert(span_xxx(...))` (which is always wrong),
and balloon alert where the first letter is a capital (which is usually
wrong). Fixes everything that failed them. As a reminder, abbreviations
like "AI" and "GPS" shouldn't be capitalized in a balloon alert.
In cases where this is intentional for flavor (there was one case), you
can `UNLINT` like so:
Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>
* Headpikes now use proper grammar when referencing their spear type (#72626)
## About The Pull Request
When creating a name for the headpike structure, the spear name is now
used, rather than just a reference to the spear itself. This led to
funky grammar and ruined immersion etc etc.
## Why It's Good For The Game
Closes#72583.
## Changelog
🆑
spellcheck: Head-spears are now named properly when using alternate
spear types.
/🆑
* Headpikes now use proper grammar when referencing their spear type
Co-authored-by: Rhials <Datguy33456@gmail.com>
* Side mounted tram controls (#72193)
Continuation of https://github.com/tgstation/tgstation/pull/72047 this
part was left out until it could be done using directional map helpers.
- Side mounts the tram controls freeing up the middle space for
shenanigans or whatever, and you can hit the controls faster from either
side of the tram.
- Emergency exit feature, doors can be forced open when the tram has
lost power.
- Accessible spots for wheelchairs (Ian's injured, you know!)

- Looks like a tram direction sign instead of an awkward center placed
computer. Build an ice cream or illicit drugs shop or something in the
middle. Frees up space.
- You don't get stuck on an unpowered tram if you don't have a crowbar.
🆑 LT3
imageadd: Tram controls are now side mounted, freeing up space. Even
better, you now have two of them!
imageadd: Added a new accessible space on the tram for wheelchairs
fix: Removed duplicate tram plate/platforms
code: Tram has its own floor subtype for the walls and windows
add: Emergency exit feature added for people who are silly enough to not
carry a crowbar
/🆑
* floors.dmi
* [ready] unit tests all worn icons (#72370)
Fixes#71692🆑 ShizCalev
code: Added a unit test for ALL worn icons.
fix: Fixed a bunch of broken worn icons!
/🆑
* [ready] unit tests all worn icons
* Should have fixed most of the failures now
* Here, hopefully that should fix what was left
* Okay maybe it just hadn't been fixed yet
* I can be a bit dumb sometimes
* Okay, now it's going to work, I promise
* I'm so tired of this
Co-authored-by: ShizCalev <ShizCalev@users.noreply.github.com>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>
* Converts drowsy and eye blur to status effects, striking yet another two carbon level status vars
* merge conflicts
* adjust_eye_blur and set_eye_blur_if_lower
* adjust drowsiness overdoses
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: tastyfish <crazychris32@gmail.com>
* Crafting/Cooking menu update
* Yeeted away all of the merge conflicts, time to fix the code
* Okay, now it compiles, and after testing, it seems to work just fine
* Actually, early addition of an upstream fix, so those that don't have hunger can still open the cooking menu
* Fixes the units tests by removing the extra comma in the Stuffed Muli Pod recipe
Co-authored-by: Andrew <mt.forspam@gmail.com>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>
* Tram collision counter hazard lights (#72406)
## About The Pull Request
To the best of Nanotrasen's ability, valuable crew members are still
getting hit by the tram. To further encourage safe practices, a new
indicator with hazard lights has been installed outside medbay. It will
flash when tram collisions are occurring during times of lax safety for
extra visibility.

## Why It's Good For The Game
Go for the high score.
## Changelog
🆑 LT3
imageadd: Hazard lights added to the tram collision counter
/🆑
* Tram collision counter hazard lights
Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com>
* Fixes being able to instantly create dense grilles (#72449)
🆑
fix: Fixes being able to instantly create dense grilles
/🆑
Co-authored-by: tattle <66640614+dragomagol@ users.noreply.github.com>
* Fixes being able to instantly create dense grilles
Co-authored-by: Iamgoofball <iamgoofball@gmail.com>
Co-authored-by: tattle <66640614+dragomagol@ users.noreply.github.com>
* Smoothing groups optimization, save 265ms with configs, more on production & w/ space ruins (#71989)
This one is fun.
On every /turf/Initialize and /atom/Initialize, we try to set
`smoothing_groups` and `canSmoothWith` to a cached list of bitfields. At
the type level, these are specified as lists of IDs, which are then
`Join`ed in Initialize, and retrieved from the cache (or built from
there).
The problem is that the cache only misses about 60 times, but the cache
hits more than a hundred thousand times. This means we eat the cost of
`Join` (which is very very slow, because strings + BYOND), as well as
the preliminary `length` checks, for every single atom.
Furthermore, as you might remember, if you have any list variable set on
a type, it'll create a hidden `(init)` proc to create the list. On
turfs, that costs us about 60ms.
This PR does a cool trick where we can completely eliminate the `Join`
*and* the lists at the cost of a little more work when building the
cache.
The trick is that we replace the current type definitions with this:
```patch
- smoothing_groups = list(SMOOTH_GROUP_TURF_OPEN, SMOOTH_GROUP_FLOOR_ASH)
- canSmoothWith = list(SMOOTH_GROUP_FLOOR_ASH, SMOOTH_GROUP_CLOSED_TURFS)
+ smoothing_groups = SMOOTH_GROUP_TURF_OPEN + SMOOTH_GROUP_FLOOR_ASH
+ canSmoothWith = SMOOTH_GROUP_FLOOR_ASH + SMOOTH_GROUP_CLOSED_TURFS
```
These defines, instead of being numbers, are now segments of a string,
delimited by commas.
For instance, if ASH used to be 13, and CLOSED_TURFS used to be 37, this
used to equal `list(13, 37)`. Now, it equals `"13,37,"`.
Then, when the cache misses, we take that string, and treat it as part
of a JSON list, and decode it from there. Meaning:
```java
// Starting value
"13,37,"
// We have a trailing comma, so add a dummy value
"13,37,0"
// Make it an array
"[13,37,0]"
// Decode
list(13, 37, 0)
// Chop off the dummy value
list(13, 37) // Done!
```
This on its own eliminates 265ms *without space ruins*, with the
combined savings of turf/Initialize, atom/Initialize, and the hidden
(init) procs that no longer exist.
Furthermore, there's some other fun stuff we gain from this approach
emergently.
We previously had a difference between `S_TURF` and `S_OBJ`. The idea is
that if you have any smoothing groups with `S_OBJ`, then you will gain
the `SMOOTH_OBJ` bitflag (though note to self, I need to check that the
cost of adding this is actually worth it). This is achieved by the fact
that `S_OBJ` simply takes the last turf, and adds onto that, meaning
that if the biggest value in the sorting groups is greater than that,
then we know we're going to be smoothing to objects.
This new method provides a limitation here. BYOND has no way of
converting a number to a string at compile time, meaning that we can't
evaluate `MAX_S_TURF + offset` into a string. Instead, in order to
preserve the nice UX, `S_OBJ` now instead opts to make the numbers
negative. This means that what used to be something like:
```dm
smoothing_groups = list(SMOOTH_GROUP_ALIEN_RESIN, SMOOTH_GROUP_ALIEN_WEEDS)
```
...which may have been represented as
```dm
smoothing_groups = list(15, MAX_S_TURF + 3)
```
...will now become, at compile time:
```dm
smoothing_groups = "15,-3,"
```
Except! Because we guarantee smoothing groups are sorted through unit
testing, this is actually going to look like:
```dm
smoothing_groups = "-3,15,"
```
Meaning that we can now check if we're smoothing with objects just by
checking if `smoothing_groups[1] == "-"`, as that's the only way that is
possible. Neat!
Furthermore, though much simpler, what used to be `if
(length(smoothing_groups))` (and canSmoothWith) on every single
atom/Initialize and turf/Initialize can now be `if (smoothing_groups)`,
since empty strings are falsy. `length` is about 15% slower than doing
nothing, so in procs as hot as this, this gives some nice gains just on
its own.
For developers, very little changes. Instead of using `list`, you now
use `+`. The order might change, as `S_OBJ` now needs to come first, but
unit tests will catch you if you mess up. Also, you will notice that all
`S_OBJ` have been increased by one. This is because we used to have
`S_TURF(0)` and `S_OBJ(0)`, but with this new trick, -0 == 0, and so
they conflicted and needed to be changed.
* Sorting how did I miss it
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: Funce <funce.973@gmail.com>
* refreshes syndi-kits and syndicate surplus crates, introduces shared limited stock
* merge conflict
* Surplus balance, Consolidated our surplus crate and the new tg one to just use our stats
* use upstream surplus loot crates
* syndicrate
Co-authored-by: Sol N <116288367+flowercuco@users.noreply.github.com>
Co-authored-by: tastyfish <crazychris32@gmail.com>
* Alien closets deconstruct into alien alloy (#72452)
## About The Pull Request
The other day I found a rare alien locker in maint, hooray!
Deconstructed it to get the alloy, and was instead met with iron. Booo.
## Why It's Good For The Game
Alien lockers should deconstruct into the mineral used to craft them.
## Changelog
🆑 Tattle
fix: alien closets now deconstruct into alien alloy
/🆑
Co-authored-by: tattle <article.disaster@ gmail.com>
* Alien closets deconstruct into alien alloy
Co-authored-by: tattle <66640614+dragomagol@users.noreply.github.com>
Co-authored-by: tattle <article.disaster@ gmail.com>