[MIRROR] Add missing stimulants to All Nighter, make this handled by the reagents and not the quirk #2682
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Mirrored on Nova: NovaSector/NovaSector#1736
Original PR: tgstation/tgstation#82306
About The Pull Request
So while playing with All Nighter, I noticed lattes don't actually count for fueling my character's crippling coffee addiction.
Looking into it, this is true, the list for which reagents count as stimulants for All Nighter is quite small:
https://github.com/tgstation/tgstation/blob/fa0ef6b4b6f58b62bad5a105fb3b66d239859c1b/code/datums/quirks/negative_quirks/all_nighter.dm#L25-L37
And importantly, includes none of the coffee or tea derivatives.
But, in the process of adding everything I thought would have a high enough caffeine content, this list ended up quite big.
More than doubled in size big.
Which is bad, because when you haven't slept the quirk loops over every single reagent in that list to check if you have it, every single process call.
https://github.com/tgstation/tgstation/blob/fa0ef6b4b6f58b62bad5a105fb3b66d239859c1b/code/datums/quirks/negative_quirks/all_nighter.dm#L84-L101
Soooo, ideally, we probably don't want that.
But hey, upshot, we have this whole system for reagents to just give you a trait while metabolized and remove it when you're done.
https://github.com/tgstation/tgstation/blob/fa0ef6b4b6f58b62bad5a105fb3b66d239859c1b/code/modules/reagents/chemistry/reagents.dm#L77-L78
So we make a trait called
TRAIT_STIMULATED
, check for that, and have each reagent on the list apply it while metabolized.Now, if we ever feel like it, we can also have other non-reagent stuff add that trait and have it Just Work.
For ease of reading, the full list of reagents this makes All Nighter work with is as follows, where
+
denotes it's newly added:All Nighter Reagents, Complete List
Coffee &derivatives:
Alcoholic coffee derivatives:
Tea &derivatives:
Energy drinks &derivatives:
Stimulants (drug subtype)
Stimulants (medicine subtype)
Powders (if you're insane)
Note, kahlua is added as it's a coffee liqueur and does contain a not insignificant amount of caffeine, but due to its lower caffeine levels I decided its derivatives would be too diluted to matter for the sake of our poor hasn't-slept-all-night spaceman.
Why It's Good For The Game
In play it's annoying and unexpected that it works to drink tea but not iced tea and coffee but not latte, not the third arguably energy drink, and neither do some of the stimulants work. These inconsistencies would drive me mad if I actually played more than I coded.
Either way, this lets you fuel your sleep deprivation in style.
Code-wise, I imagine using a trait applied on start of metabolization is much saner than looping over and checking for every reagent in the list every process tick, especially with a bigger list.
Changelog
🆑 00-Steven
code: Whether something counts as a stimulant to All Nighter is now handled by the reagent itself when metabolized, for everyone's sanity. Side-effect, you need a liver to process stimulants for All Nighter.
balance: Fuel your sleep deprivation in style! Made more reagents work with All Nighter. This includes all coffee/tea variants, a few other drinks that would have a high enough caffeine level, kronkaine, ephedrine, and in case you're insane you can straight up eat coffee or tea grounds.
/:cl: