Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Add missing stimulants to All Nighter, make this handled by the reagents and not the quirk #2682

Merged
merged 1 commit into from
Mar 31, 2024

Conversation

Steals-The-PRs
Copy link
Collaborator

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:

  • coffee
  • +cafe latte
  • +soy latte
  • +ice coffee
  • +hot ice coffee
  • +pumpkin latte

Alcoholic coffee derivatives:

  • +kahlua
  • +konococo rumtini
  • +irish coffee
  • +thirteen loko

Tea &derivatives:

  • tea
  • +iced tea
  • +letter t
  • +arnold palmer

Energy drinks &derivatives:

  • monkey energy
  • volt energy
  • +space mountain wind
  • +demons blood

Stimulants (drug subtype)

  • aranesp
  • bath salts
  • blastoff
  • methamphetamine
  • pumpup
  • +kronkaine

Stimulants (medicine subtype)

  • stimulants
  • +ephedrine

Powders (if you're insane)

  • +coffee powder
  • +tea powder

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:

…the reagents and not the quirk (#1736)

* Add missing stimulants to All Nighter, make this handled by the reagents and not the quirk (#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:

<details>
  <summary>All Nighter Reagents, Complete List</summary>
  
### Coffee &derivatives:
- coffee
- +cafe latte
- +soy latte
- +ice coffee
- +hot ice coffee
- +pumpkin latte
### Alcoholic coffee derivatives:
- +kahlua
- +konococo rumtini
- +irish coffee
- +thirteen loko
### Tea &derivatives:
- tea
- +iced tea
- +letter t
- +arnold palmer
### Energy drinks &derivatives:
- monkey energy
- volt energy
- +space mountain wind
- +demons blood
### Stimulants (drug subtype)
- aranesp
- bath salts
- blastoff
- methamphetamine
- pumpup
- +kronkaine
### Stimulants (medicine subtype)
- stimulants
- +ephedrine
### Powders (if you're insane)
- +coffee powder
- +tea powder

</details>

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
:cl:
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:

* Add missing stimulants to All Nighter, make this handled by the reagents and not the quirk

---------

Co-authored-by: _0Steven <[email protected]>
@mogeoko mogeoko merged commit ea11def into master Mar 31, 2024
24 checks passed
@mogeoko mogeoko deleted the upstream-mirror-1736 branch March 31, 2024 15:51
AnywayFarus added a commit that referenced this pull request Mar 31, 2024
Iajret pushed a commit that referenced this pull request Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants