Commit Graph

1738 Commits

Author SHA1 Message Date
Jacquerel
3536d0df62 Arms memory management (#75378)
## About The Pull Request

Fixes #75251 
Fixes #75376
Fixes #75377 
Fixes #75394

uh... I think?

Here's the thing, is that golem arms are not actually particularly
different to other kinds of arms, so I have been struggling to find a
reason that this test is flaking _only_ for golem arms, in relation to a
list that I didn't touch.
My best guess is that the reason they're sometimes sticking to the
"available hands" list is related to golems not being dismemberable and
thereby skipping the code path which would remove a removed arm from the
hand list, which sounds plausible except that nightmares are also
NODISMEMBER and don't have the same problem.

Regardless, I made some boilerplate for when you give someone an arm
which registers to the destruction and dismember signals and removes
them from your available hand list when either of those things happen
under any circumstances, whereas before it was reliant on passing
through a much more specific pipeline.

Notably the text which set this also remarked `We only want to do this
if the limb being removed is the active hand part.` which certainly does
not sound true to me (although it does for the other line scoped inside
that if check) and now also isn't, but this didn't seem to be widely
affecting arms in general anyway.

I couldn't replicate the test failing after making these changes but as
a flaky result that doesn't really tell us very much because to some
extent it might just have been down to luck.

## Why It's Good For The Game

Memory management, hopefully will stop randomly triggering CI failures.

## Changelog

Not player facing
2023-05-12 21:01:09 -06:00
Bloop
8fa6242c66 Refactors High Luminosity Eyes, fixes a ton of bugs related to it as well as qol improvements (#75040)
## About The Pull Request

The high luminosity eyes item was extremely out of date, broken, and
full of copy paste code from atom lighting. Which is a shame because
they were cool.

On top of all that it was using a special light effect that was not very
performant. I got rid of all that, hooked it into atom lighting as a new
light type, and gave it a new TGUI as well because the old ui prompts
were not great either.

You can now pick a color at random if you want. You can also set the
color and range before surgically implanting them. No more being forced
to go through the color picker when you just want to change the range.

Functionally they should pretty much should be the same as before with
some bonus features (see below).


![dreamseeker_nDeLNyOOG2](https://user-images.githubusercontent.com/13398309/235325530-105fe82e-ecc8-4dc4-9c84-143cc6519688.gif)

Closes https://github.com/tgstation/tgstation/issues/61041
Closes https://github.com/Skyrat-SS13/Skyrat-tg/issues/14685

This is 100% completed. I just finished fixing the slight translation
bug when going from 0->1 range (see above gif) and that was the last
thing on my bucket list. I happy enough with this at this point in time.

---

EDIT: 

I have decided to add in one last new feature, and that is...
independent settings for eye color.

<details> <summary>You can now set eye color independently if you
wish</summary>


![dreamseeker_j32B2S4yXQ](https://user-images.githubusercontent.com/13398309/235412568-ffa8e424-8624-4462-9f6f-77c1513aa773.gif)

</details>

The eye color does not modify the light color in any way when set in
this manner, but it can be used for cosmetic purposes.

Kind of makes the item more like cybereyes from cyberpunk, which I think
are pretty neat!

</details>

### What I've done, in more detail:

- refactored high luminosity eyes so they use the atom lighting system
instead of the way they were doing it before
- the new light type, `MOVABLE_LIGHT_BEAM` behaves similarly to
directional lights, with some slight differences. it reuses the same
lighting overlay sprites but scales them vertically to produce a more
focused effect. The result can be seen above. This is in contrast to the
old way, which spawned `range` number of individual 32x32 overlays and
moved them around. This way should perform better as well as be more
maintainable.
- added a new TGUI interface for high luminosity eyes with buttons for
range, a text field for a color hex, a color picker and randomizer
- made the eye overlay emissive when the light is turned on
- range goes from 0 to 5. at range 0, the light overlay is turned off
and you are left with just the emissive eyes.
- added a cosmetic functionality to this item that lets you change the
color of your eyes independently of the lighting (and each other)
- fixed a bug with directional flashlights sometimes not updating their
lighting overlay if you pick them up without changing your direction
---

### Other Misc Fixes

Being able to dynamically set range back and forth exposed some logic
issues that had existed with directional light overlays and I have fixed
those. That is why there are some edits in that file that may not appear
readily obvious why they are there.

Apart from that, two other bugs that come to mind:
1) eye code was supposed to keep track of the eye color you had before
you got new eyes, but it was overwriting that every time you ran
refresh().
2) lighting was supposed to be turning off the light when range is set
to 0, but it was not doing that properly.

And of course besides that, there may have been a few instances of
finding typos/tidying up code

## Why It's Good For The Game

The code for this was like 6 years old and in desperate need of
updating. Now it works, and has a nicer UI.

## Changelog

🆑
fix: high luminosity eyes light overlays now follow the user correctly
qol: high luminosity eyes now have a tgui menu so you no longer have to
go through the color picker every time you want to change the range.
they also have a new setting that lets you change the color of your eyes
independently of the light color. You can now have cybernetic
heterochromia if you want
fix: directional flashlights when picked up will now always update their
cast light direction correctly no matter what dir you are facing
refactor: refactors high luminosity eye code to better make use of the
atom lighting system, adding a new light type 'MOVABLE_LIGHT_BEAM'
/🆑
2023-05-09 15:42:11 -07:00
Time-Green
b0e02715b8 Makes organs not double on delimbing (#75220)
A bugfix and a refactor from a while back kinda clashed and caused some
weird behaviour. Extorgans would be double-referencd upon delimbing and
feature restyling looked at the wrong list (technically the right list
at the time because stuff was a bit fucked)

🆑
fix: Loose limbs will not duplicate organs anymore
/🆑
2023-05-08 10:26:56 -07:00
Jacquerel
1a918a2e14 Golem Rework (#74197)
This PR implements this design document:
https://hackmd.io/@Y6uzGFDGSXKRaWDNicSiEg/BkRr176st
Put briefly, this will remove every existing golem subtype and
consolidate golems into a single species with cool new sprites.
NOT implemented from that PR is the ability to eat Telecrystals, I
couldn't come up with an appropriate visual that can stack with the
existing ones, but that should be a reasonably trivial add for a future
artist & developer.

New Golems have a food-based mechanic where their hunger decays pretty
quickly and can only be replenished by eating minerals. They start
moving slower as they get hungrier, until eventually they become
completely immobilised and need to be rescued.
Eating different kinds of minerals will visually change your sprite and
give you a special effect in a similar way to old golems, but temporary.
While transformed, you can't eat any other kind of mineral which would
transform you (but can still consume glass).
To see the full list of effects, look at the hackmd above.

In service of these sprites working I have refactored the
`species/offset_features` feature by killing it and delegating that
responsibility to limbs instead. Rather than applying an offset to items
due to your species, it is due to your weird head or arms. This makes
overall more sense to me, but it inflates the code changes in this PR
somewhat.
It doesn't make a lot of sense to atomise unfortunately because that
code also seemed to be entirely unused until I tried to use it in this
PR, so you wouldn't be able to tell if my changes broke anything. I
might make a downstream sad by doing this.

All of the actual numbers in this PR are made up and only loosely
tested, it will need some testmerges to gather feedback about whether it
sucks or not.

Other relevant changes:
I reworked how bioscrambling works based off bodypart bodytypes, to
automatically exclude golem limbs in either direction. There's really no
way to have those work on humans or vice versa. Organs still fly though.
2023-05-07 22:45:20 +00:00
MrMelbert
fdd7ed4d4c Fixes prosthetic limbs leaving the old one behind (#75176)
## About The Pull Request

Fixes #75153
Caused by #75050 

`Note: the old limb gets sent to nullspace during try_attach_limb`
...This assertion is completely wrong, and I'm not sure where it came
from. Perhaps it's different on their downstream.

`try_attach_limb` does not care about limbs that occupy the same body
zone and will happy attach itself, giving you two left arms or two right
legs.

`del_and_replace_bodypart` handles this by deleting the existing limb,
`return_and_replace_bodypart` did not handle this whatsoever. So I added
that missing handling.

I'm not sure if we *actually want* `try_attach_limb` to disregard limbs
that occupy that slot already. It seems like weird behavior but also
consumers should probably know what they're doing in regards to that?

While I was here, I made both prosthetic related quirks use `special =
TRUE`. The application of these limbs are supposed to be quick swapping
no-side-effects, since it's done at mob creation, so it should be using
special.

## Why It's Good For The Game

Three arms is bad, okay?

## Changelog

🆑 Melbert
fix: Fixed Prosthetic Quirk not removing the limb before giving the
prosthetic
/🆑
2023-05-07 12:03:19 +02:00
John Willard
1674f25725 New Medical job: The Coroner (#75065)
## About The Pull Request

HackMD: https://hackmd.io/RE9uRwSYSjCch17-OQ4pjQ?view

Feedback link: https://tgstation13.org/phpBB/viewtopic.php?f=10&t=33972

Adds a Coroner job to the game, they work in the Medical department and
have their office in the Morgue.
I was inspired to make this after I had played my first round on
Paradise and messed around in there. The analyzer is copied from there
(https://github.com/ParadiseSS13/Paradise/pull/20957), and their
jumpsuit is also mostly stolen from it (i just copied the color scheme
onto our own suits).

Coroners can perform autopsies on people to see their stats, like this

![image](https://user-images.githubusercontent.com/53777086/235369225-805d482c-56c0-441c-9ef8-a42d0a0192bc.png)

They have access to Medbay, and on lowpop will get Pharmacy (to make
their own formaldehyde). They also have their own Secure Morgue access
for their office (doubles as a surgery room because they are edgelords
or whatever) and the secure morgue trays.

Secure Morgue trays spawn with their beepers off and is only accessible
by them, the CMO, and HoS. It's used to morgue Antagonists. Security's
own morgue trays have been removed.

The job in action


https://cdn.discordapp.com/attachments/950489581151735849/1102297675669442570/2023-04-30_14-16-06.mp4

### Surgery changes

Autopsies are a Surgery, and I tried to intertwine this with the
Dissection surgery.
Dissections and Autopsies both require the Autopsy scanner to perform
them, however you can only perform one on any given body. Dissections
are for experiments, Autopsies is for the paper of information.

Dissected bodies now also give a ~20% surgery speed boost, this was
added at the request of Fikou as a way to encourage Doctors to let the
Coroner do their job before reviving a body.
I also remember the Medical skill, which allowed Doctors to do surgery
faster on people, and I hope that this can do something like that
WITHOUT adding the potential for exploiting, which led to the skill's
downfall.

### Morgue Improvements

Morgue trays are no longer named with pens, they instead will steal the
name of the last bodybag to be put in them.

Morgue trays are also removed from Brig Medical areas and Robotics, now
they have to bring their corpses to the Morgue where the Coroner can
keep track and ensure records are properly updated.

### Sprite credits

I can't fit it all in the Changelog, so this is who made what

McRamon
- Autopsy scanner

Tattax 
- Table clock sprites and in-hands

CoiledLamb
- Coroner jumpsuits & labcoats (inhand, on sprite, and their respective
alternatives)
- Coroner gloves
- CoronerDrobe (the vending machine)

## Why It's Good For The Game

This is mostly explained in the hackmd, but the goal of this is:

1. Increase the use of the Medical Records console.
2. Add a new and interesting way for Detectives to uncover mysteries.
3. Add a more RP-flavored role in Medical that still has mechanics tied
behind it.

## Changelog

🆑 JohnFulpWillard, sprites by McRamon, tattax, and Lamb
add: The Coroner, a new Medical role revolving around dead corpses and
autopsies.
add: The Coroner's Autopsy Scanner, used for discovering the cause for
someone's death, listing their wounds, the causes of them, their
reagents, and diseases (including stealth ones!)
qol: Morgue Trays are now named after the bodybags inside of them.
balance: The morgue now has 'Secure' morgue trays which by default don't
beep.
balance: Security Medical area and Robotics no longer have their own
morgue trays.
balance: Dissected bodies now have faster surgery speed. Autopsies also
count as dissections, however they're mutually exclusive.
/🆑

---------

Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
2023-05-05 21:31:28 -04:00
Rhials
c5dce84be8 Deadchat Announcement Variety Pack 1 (#75140)
## About The Pull Request

Adds announce_to_ghosts()/notify_ghosts() calls to a bunch of different
things.

**THIS INCLUDES:**
- Powersink being activated/reaching critical (explosion) heat capacity.
- His Grace being awoken.
- Hot Potatoes being armed.
- Ascension Rituals being completed.
- Eyesnatcher victims.
- Ovens exploding as a result of the Aurora Caelus event.
- Wizard Imposter spawns.
- Rock-Paper-Scissors with death as the result of Helbital consumption.
- BSA impact sites.
- Spontaneous Appendicitis.
- The purchasing of a badass syndie balloon.
- The Supermatter beginning to delaminate.

This was everything that I could think of that would be worth announcing
to deadchat. These were all chosen with consideration to questions like
"how easy would it be to spam deadchat with this?" and "will observers
actually see the interesting thing happen, or just the aftermath?".

Not gonna lie, I've really become an observer main as of recently. Maybe
that's being reflected in my recent PRs. Who's to say? Deadchat
Announcement Variety Pack 2 will probably never come out. Sorry.
## Why It's Good For The Game

Gives deadchat a better indiciation of when/where something **REALLY
FUNNY** is about to happen. Draws attention to certain things that are
likely to gather an audience anyways, but sooner (for your viewing
pleasure). In simple terms, it helps the observers observe things
better.

Some cases, such as the aurora caelus or helbitaljanken, are occurrences
so rare that they deserve the audience.
## Changelog
🆑 Rhials
qol: Observers now recieve an alert when a powersink is activated/about
to explode.
qol: His Grace being awoken now alerts observers, to give you a
headstart on your murderbone ghost ring.
qol: Ascension Rituals being completed will also alert observers, for
basically the same reason.
qol: Arming a hot potato will now alert observers. Catch!
qol: Eyesnatcher victims will now notify observers, and invite them to
laugh at their state of misery and impotence.
qol: Observers will be notified of any acute references to The Simpsons
or other 20th Television America copyright properties.
qol: Wizard Imposter spawns alert observers, much like any other ghost
role event should.
qol: Playing Rock-Paper-Scissors with death will now alert the observers
and invite them to watch. Better not choke!
qol: Observers now get an orbit link for BSA impact sites. Why does it
keep teleporting me to the AI upload??
qol: Spontaneous Appendicitis now alerts deadchat. 
qol: The purchasing of a badass syndie balloon now alerts deadchat. You
might not be any more powerful, but at least you have an audience.
qol: When beginning to delaminate, the Supermatter will alert observers
and invite them to watch the fireworks.
/🆑
2023-05-05 17:34:46 +01:00
ArcaneMusic
f2fd69a49a Minerals have been refactored so costs and minerals in items are now in terms of mineral defines. (#75052)
Ladies, Gentlemen, Gamers. You're probably wondering why I've called you
all here (through the automatic reviewer request system). So, mineral
balance! Mineral balance is less a balance and more of a nervous white
dude juggling spinning plates on a high-wire on his first day. The fact
it hasn't failed after going on this long is a miracle in and of itself.

This PR does not change mineral balance. What this does is moves over
every individual cost, both in crafting recipes attached to an object
over to a define based system. We have 3 defines:

`sheet_material_amount=2000` . Stock standard mineral sheet. This being
our central mineral unit, this is used for all costs 2000+.
`half_sheet_material_amount=1000` . Same as above, but using iron rods
as our inbetween for costs of 1000-1999.
`small_material_amount=100` . This hits 1-999. This covers... a
startlingly large amount of the codebase. It's feast or famine out here
in terms of mineral costs as a result, items are either sheets upon
sheets, or some fraction of small mats.

Shout out to riot darts for being the worst material cost in the game. I
will not elaborate.

Regardless, this has no functional change, but it sets the groundwork
for making future changes to material costs much, MUCH easier, and moves
over to a single, standardized set of units to help enforce coding
standards on new items, and will bring up lots of uncomfortable balance
questions down the line.

For now though, this serves as some rough boundaries on how items costs
are related, and will make adjusting these values easier going forward.

Except for foam darts.

I did round up foam darts.

Adjusting mineral balance on the macro scale will be as simple as
changing the aforementioned mineral defines, where the alternative is a
rats nest of magic number defines. ~~No seriously, 11.25 iron for a foam
dart are you kidding me what is the POINT WHY NOT JUST MAKE IT 11~~

Items individual numbers have not been adjusted yet, but we can
standardize how the conversation can be held and actually GET SOMEWHERE
on material balance as opposed to throwing our hands up or ignoring it
for another 10 years.
2023-05-03 14:44:51 +00:00
Bloop
5401d0798f Removes the random prosthetic quirk from the character preview page (#75050)
## About The Pull Request

The prosthetic limb quirk chooses a random limb to make prosthetic at
roundstart.

It was extremely buggy with the way quirks are displayed and the way the
dummy preview works and would frequently carry over to other characters
and not update correctly.

<details>
<summary>Eventually you end up getting this if you switch enough times
</summary>


![hDq983y2T0](https://user-images.githubusercontent.com/13398309/235334283-d4fc4c1f-c1de-4460-b6f7-7ef95a587cb4.gif)

</details>

I started fixing the issue when I realized this really shouldn't be
shown on the dummy to begin with, because what you see on the dummy will
not necessarily be what you get at roundstart. It's misleading.

I did however leave part of the fix that I was working on, because I
think it is useful to be able to undo the quirk via adminnery.

Closes https://github.com/Skyrat-SS13/Skyrat-tg/issues/20791

## Why It's Good For The Game
## Changelog
🆑
fix: prosthetic limb quirk will no longer display a prosthetic on your
character preview because it is buggy and hardly ever matches what you
end up getting upon spawning
code: removing the prosthetic limb quirk will restore your original limb
/🆑
2023-05-01 20:13:10 -06:00
carlarctg
129c74c945 EMPs on robotic limbs will now disable them for 4-8 seconds rather than causing a 10-20 second full stun (#74570)
## About The Pull Request

EMPs on robotic limbs will now disable them for 10-20 seconds rather
than causing a 10-20 second full stun on the user. Additionally, they
will damage the limb for a little brute and some burn.

Arm EMPs don't do anything special as the limb being disabled already
drops items.

Leg EMPs cause a 10-20 second knockdown, only really applicable if
there's only one robotic leg as two disabled legs KD you anyways.

Chest EMPs cause a 3-6 second standing-up paralyze, visible to the
player by a quite noticeable shaking of their body.

Head EMPs break the optical transponder circuits for 7.5-15 seconds,
effectively giving the user nightmare goggles vision with green instead
of red as the only remaining color.

Tacit approval for the PR at least existing.

![image](https://user-images.githubusercontent.com/53100513/230537462-b06d0bb5-0607-4f83-954c-6b2a0bcdc635.png)
## Why It's Good For The Game

Robotic limbs are not so strong that a glancing EMP that may not even
have been directed at you should stun you for ten, TEN seconds, or
worse, twenty. This is basically legacy stunning from the days of
super-stuns on soap, stunbatons, etc. The code for it was last touched
six years ago.

**_The stats as shown above are not even close to final. I really don't
know or care what the right stats should be in the end. and I'm fine
with making them a 10-20 second timer again. I just put some
reasonable-seeming numbers in as a placeholder. EMPs could also still
cause a short stun if that is deemed necessary. Hell, that could be the
chest effect!_**
## Changelog
🆑
balance: EMPs on robotic limbs will now disable them for 10-20 seconds
rather than causing a 10-20 second full stun on the user. Additionally,
they will damage the limb for a little brute and some burn.
EMPs on robotic limbs will now disable them for 10-20 seconds rather
than causing a 10-20 second full stun on the user. Additionally, they
will damage the limb for a little brute and some burn.
balance: Arm EMPs don't do anything special as the limb being disabled
already drops items.
balance: Leg EMPs cause a 10-20 second knockdown, only really applicable
if there's only one robotic leg as two disabled legs KD you anyways.
balance: Chest EMPs cause a 3-6 second standing-up paralyze, visible to
the player by a quite noticeable shaking of their body.
balance: Head EMPs break the optical transponder circuits for 7.5-15
seconds, effectively giving the user nightmare goggles vision with green
instead of red as the only remaining color.
/🆑
2023-04-28 20:24:40 +00:00
Fikou
007bf54446 skeletons healing off milk works like it used to 3 years ago (#74470)
## About The Pull Request
skeletons healing off milk was changed in the pr that made stomachs be
what handles chems
this doesnt acutally work and its been broken for 3 years 
so we just revert back to the old way of doing it

## Why It's Good For The Game
its over

## Changelog
🆑
fix: skeletons get boosted heals from milk again
/🆑
2023-04-26 11:38:08 +12:00
MrMelbert
ed2f04f486 Experiment with replacing weakrefs in AI blackboard with deleting signals, ideally making it easier to work with and harder to cause hard deletes (#74791)
## About The Pull Request

Replaces weakref usage in AI blackboards with deleting signals

All blackboard var setting must go through setters rather than directly

## Why It's Good For The Game

This both makes it a ton easier to develop AI for, and also makes it
harder for hard deletes to sneak in, as has been seen with recent 515
prs showing hard deletes in AI blackboards

(To quantify "making it easier to develop AI", I found multiple bugs in
existing AI code due to the usage of weakrefs.)

I'm looking for `@Jacquerel` `@tralezab` 's opinions on the matter, also
maybe `@LemonInTheDark` if they're interested

## Changelog

🆑 Melbert
refactor: Mob ai refactored once again
/🆑
2023-04-23 17:07:17 -06:00
tralezab
5c1c0ca682 Fixes body purist headrevs from getting mad at their implant by making them unaware of it (#74346)
## About The Pull Request

Body purists no longer mind implants with a special trait for "hidden
implants". This special trait is replacing the "syndicate implant"
variable and was just used to hide certain implants from medical
scanners.

## Why It's Good For The Game

fixes #74180

## Changelog
🆑
fix: Body purist headrevs having a bad time with their implant
/🆑
2023-04-17 23:38:49 +02:00
ChungusGamer666
8d82924187 Implanted foreign bodyparts will resist being removed on species change (#74701)
## About The Pull Request

Title.
Also, to make bodypart code slightly nicer, I retooled some variables to
be part of a new bitfield called bodypart_flags.

## Why It's Good For The Game

We've been trying to move away from the species datum for limb stuff
precisely because of funny shenanigans like this, no?

## Changelog

🆑
refactor: Implanted foreign limbs will no longer be wiped by species
change.
/🆑
2023-04-14 20:50:22 +02:00
oranges
4c48966ff8 Renames delta time to be a more obvious name (#74654)
This tracks the seconds per tick of a subsystem, however note that it is
not completely accurate, as subsystems can be delayed, however it's
useful to have this number as a multiplier or ratio, so that if in
future someone changes the subsystem wait time code correctly adjusts
how fast it applies effects

regexes used

git grep --files-with-matches --name-only 'DT_PROB' | xargs -l sed -i
's/DT_PROB/SPT_PROB/g'
git grep --files-with-matches --name-only 'delta_time' | xargs -l sed -i
's/delta_time/seconds_per_tick/g'
2023-04-11 21:31:07 -07:00
John Willard
865e616a45 Sleep immune will make you immune to N2O (#74647)
## About The Pull Request

Currently sleep immunity makes you immune to the sleeping status effect.
I was originally gonna do the same for Unconscious, but I don't think we
want sleep immunity to block all instances of that


![image](https://user-images.githubusercontent.com/53777086/230962330-682c996f-fced-4251-9a69-6a08f16bb382.png)

## Why It's Good For The Game

If you're immune to sleep, you shouldn't be falling asleep from the
sleepy gas. N2O setting you unconscious is meant as a way to give
players a chance at getting away/putting internals on, before being put
to sleep, however if you're immune to sleep, you'll endlessly fall
unconscious.

## Changelog

🆑
fix: People immune to sleep will not fall asleep from N2O
/🆑
2023-04-11 08:09:05 -07:00
ChungusGamer666
06836fc20a android bodyparts no longer immune to species change (#74580)
## About The Pull Request

fixes https://github.com/tgstation/tgstation/issues/72771

## Why It's Good For The Game

more consistent species changing behavior

admittedly this is a bitch of a patchwork fix and surgically implanted
limbs should be flagged as such to prevent being boofed by species
changes, but ah well this is good enough for now

## Changelog

🆑
fix: Transforming into an android and then back into another species
will no longer leave you with permanent robotic limbs
/🆑
2023-04-09 17:07:57 -06:00
carlarctg
5f9acdddbf Activating arm implant items in hand now automatically retracts and opens the radial menu (#74300)
## About The Pull Request

Activating arm implant items in hand now automatically retracts and
opens the radial menu. Only if there's more than one item in the list

### Mapping March

Ckey to receive rewards: N/A

## Why It's Good For The Game

Makes these neat implants less unbelievably clunky to use, making 'em
actually worthwhile. Welders don't work so well but you can still right
click in your hand.

## Changelog

🆑
qol: Activating arm implant items in hand now automatically retracts and
opens the radial menu, unless it's a welding tool.
/🆑
2023-04-08 20:44:16 +01:00
Tim
4397d63a55 Split weapons_and_items.dmi icons into their own categories (#74363)
## About The Pull Request
This sprite file had been a dumping ground for miscellaneous sprites for
the past decade. It's bloated and full of random kinds of icons and even
has a few unused ones. It's time to reorganize them into their own
separate dmi's based on theme.

## Why It's Good For The Game
Better organization and easier access when looking for stuff.

## Changelog
🆑
imageadd: Split all icons in weapons_and_items.dmi to their own
categories
imagedel: Removed some unused icons
/🆑
2023-04-06 08:30:57 +12:00
Bloop
101f905454 Fixes the emissive blockers from the body parts layering over everything (#74362)
## About The Pull Request

As it says, this PR will stop bodypart emissive blockers from layering
over all the things.

This will fix any emissives that were not displaying on clothing, such
as the safety vest.

Fixes https://github.com/Skyrat-SS13/Skyrat-tg/issues/19531

https://github.com/tgstation/tgstation/issues/62442 and
https://github.com/tgstation/tgstation/issues/64098 are not fixed by
this, these are separate issues.

## Why It's Good For The Game

The pretty lights return to dazzle us once more.

<details>
<summary>Safety vest emissives</summary>
  

![dreamseeker_6vwaJOkpHR](https://user-images.githubusercontent.com/13398309/228765863-0ef65eff-60c9-496d-b289-6723716d1b2c.gif)

</details>

## Changelog

🆑
fix: fixes emissives blocker layering issue that was causing emissives
on clothing to not display at all
/🆑



Lemon: I am curious about when this became an issue, since it seems inconsistent with what I'd expect

I know this was working last year, around early fall, from screenshots. But beyond that, no clue. It happened sometime between now and then.

FLOAT_LAYER is very untrustworthy, I wish Lummox would add some debugging var that shows the last layer it was rendered on or something because there is really no way to see what it's doing reliably. But for now explicitly setting the layer might be a good idea for stuff like this.
2023-03-31 21:43:57 -07:00
san7890
ccef887efe Lints Against Unmanaged Local Defines (#74333)
# MAINTAINER - USE THE BUTTON THAT SAYS "MERGE MASTER" THEN SET THE PR
TO AUTO-MERGE! IT'S MUCH EASIER FOR ME TO FIX THINGS BEFORE THEY SKEW
RATHER THAN AFTER THE FACT.

## About The Pull Request

Hey there,

This took a while to do, but here's the gist:

Python file now regexes every file in `/code` except for those that have
some valid reason to be tacking on more global defines. Some of those
reasons are simply just that I don't have the time right now (doing what
you see in this PR took a few hours) to refactor and parse what should
belong and what should be thrown out. For the time being though, this PR
will at least _halt_ people making the mistake of not `#undef`ing any
files they `#define` "locally", or within the scope of a file.

Most people forget to do this and this leads to a lot of mess later on
due to how many variables can be unmanaged on the global level. I've
made this mistake, you've made this mistake, it's a common thing. Let's
automatically check for it so it can be fixed no-stress.

Scenarios this PR corrects:

* Forgetting to undef a define but undeffing others.
* Not undeffing any defines in your file.
* Earmarking a define as a "file local" define, but not defining it.
* Having a define be a "file local" define, but having it be used
elsewhere.
* Having a "local" define not even be in the file that it only shows up
in.
* Having a completely unused define*

(* I kept some of these because they seemed important... Others were
junked.)
## Why It's Good For The Game

If you wanna use it across multiple files, no reason to not make it a
global define (maybe there's a few reasons but let's assume that this is
the 95% case).

Let me know if you don't like how I re-arranged some of the defines and
how you'd rather see it be implemented, and I'd be happy to do that.
This was mostly just "eh does it need it or not" sorta stuff.

I used a pretty cool way to detect if we should use the standardized
GitHub "error" output, you can see the results of that here
https://github.com/san7890/bruhstation/actions/runs/4549766579/jobs/8022186846#step:7:792
## Changelog
Nothing that really concerns players.

(I fixed up all this stuff using vscode, no regexes beyond what you see
in the python script. sorry downstreams)
2023-03-29 10:17:03 -07:00
LemonInTheDark
a773c346be Fixes ploux, adds conversion support to breath code (#74316)
## About The Pull Request

I uh, didn't realize how ploux actually did the 8x oxygen thing
Adds support for converting between gases when breathing

## Why It's Good For The Game

Closes #74298

## Changelog
🆑
fix: Breathing pluoxium works again
/🆑
2023-03-28 23:16:28 -06:00
Zephyr
ecbcef778d Refactors Regenerate Organs, and a few organ helpers (#74219)
## About The Pull Request

Refactors regenerate organs to be slightly more intelligent in handling
organ changes and replacements.
Noteably:
- We don't remove organs that were modified by the owner; such as
changing out your heart for a cybernetic
- We early break out of the for loop if they aren't supposed to have an
organ there and remove it
- We check for the organ already being correct, and just healing it and
continuing if it is

Also changes the names of some of the organ helpers into snake_case
### Mapping March
Ckey to receive rewards: N/A

## Why It's Good For The Game
## Changelog

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
2023-03-26 17:54:36 +01:00
LemonInTheDark
2e5bfe5be6 Refactors and optimizes breath code (Saves 12% of carbon/Life()) (#74230)
## About The Pull Request

### How things work

As things currently stand, when a mob breaths several things happen
(simplified to focus on the stupid)

We assert the existance of all possible breathable gases, and pull
partial pressures for them
Then we walk through all possible interactions lungs could have with
these gases, one by one, and see if they're happening or not
As we go we are forced to cleanup potential alerts caused by the
previous breath, even if those effects never actually happen
At the end we clear out all the unused gas ids, and handle the
temperature of the breath.

### What sucks

There's I'd say 3 different types of gas reactions.

- You can "need" a gas to survive. o2, n2 and plasma all fall into this
category
- A gas can do something to you while it's in your system. This applies
to most gas types
- Variation on the previous, some gases do cleanup when they're not in
your system, or when there isn't much of them in the first place

The main headache here is that second one, constantly cleaning up
potential side effects sucks, and fixing it would require a lot of dummy
variables

There's other suckage too.

Needing to constantly check for a gas type even if it isn't there is
stupid, and leads to wasted time It's also really annoying to do
subtypes in this system.
There is what amounts to a hook proc you can override, but you can't
override the reaction to a gas type.
It also just like, sucks to add new gases. one mega proc smells real
stupid.

### Improvements

In the interest of speed:

- I'd like to build a system that doesn't require manually checking for
gas
- Reacting to gas "disappearing" should be promoted by the system,
instead of being hacky.
- I would like to avoid needing to assert the existence of all possible
gases, as this is slow on both the assert and the garbage collect.

In the interest of dev ergonomics:

- It should be easy to define a new gas reaction 
- It should be easy for subtypes to implement their own gas reactions.
The current method of vars on the lung is all tangled up and not really
undoable as of now, but I'd like to not require it
- It should be possible to fully override how a gas is handled

### What I've Done

Lungs have 3 lists of proc paths stored on them

Each list handles a different way the lung might want to interact with a
gas.
There's a list for always processing on a gas (we use this for stuff
that's breathed), a list for handling a gas in our breath, and a list
for reacting to a gas previously being in our breath, but not any more.

Lungs fill out these lists using a helper proc during Initialize()
Then, when it comes time to breath, we loop over the gas in the breath
and react to it.
We also keep track of the previous list of partial pressures, which we
calculate for free here, and use that to figure out when to call the
loss reactions.

This proc pattern allows for overrides, easy reactions to removals,
lower indentation code and early returns, and better organization of
signal handlers

It's also significantly faster. Ballpark 4x faster

### Misc

Removes support for breathing co2, and dying from n2 poisoning. 
They were both unused, and I think it's cringe to clutter these procs
even further

Added "do we even have oxyloss" checks to most cases of passive
breathing.
This is a significant save, since redundant adjustoxy's are decently
expensive at the volume of calls we have here.

Fixes a bug with breathing out if no gas is passed in, assigning a var
to another var doesn't perform a copy

Rewrote breathe_gas_volume() slightly to insert gas into an immutable
mix stored on the lung, rather then one passed in
This avoids passing of a gas_mixture around just to fill a hole. 

I may change my mind on this, since it would be nice to have support for
temperature changing from a hot/cold breath.
Not gonna be done off bodytemp tho lord no.

Uses merge() instead of a hard coded version to move the gas ids over. 
This is slightly slower with lower gas counts but supports more things
in future and is also just easier to read.

## Why It's Good For The Game

Faster, easier to work with and read (imo)

Profiles: 

[breath_results_old.txt](https://github.com/tgstation/tgstation/files/11068247/breath_results_old.txt)

[breath_results_pre_master.txt](https://github.com/tgstation/tgstation/files/11068248/breath_results_new.txt)

[breath_results_new.txt](https://github.com/tgstation/tgstation/files/11068349/breath_results_new.txt)

(These profiles were initially missing #73026. Merging this brings the
savings from 16% to 12%. Life is pain)

---------

Co-authored-by: san7890 <the@san7890.com>
2023-03-26 00:21:05 -06:00
Timberpoes
f5e30da403 Fixes cliented brainmobs being sent to the gem room when their amputated head is reattached to a body. (#74227)
## About The Pull Request

Fixes #74126

Hi vsauce, Timberpoes here!

Brains are being sent the gem room. But why???? *musical sting*

Issue was caused by #73026

![image](https://user-images.githubusercontent.com/24975989/227698989-76e96198-b000-44d5-8c71-65721f25f9df.png)

This early return added to brain Insert is the root cause.

Let's have a butcher's at some code, eh?


![image](https://user-images.githubusercontent.com/24975989/227699118-217bc7a2-160c-41a0-b75e-ef389c43f538.png)

Here we have a parent call in `. = ..()` and then a check for brains and
brainmobs to do some special snowflake stuff before
`brain.Insert(new_head_owner)`.

This causes a problem. But WHY???????

Well... The parent call already inserts the brain, but without any
snowflake stuff done.


![image](https://user-images.githubusercontent.com/24975989/227699193-2bb29dce-c92d-4253-aa78-4f771d765bf2.png)

The parent call returns and the child proc
`/obj/item/bodypart/head/try_attach_limb()` which mashes the brainmob
into the brain and slams the `brain.Insert()` proc a **second** time.

This is a bug. But it worked despite being a bug, because the brain's
Insert proc would still do logic even if the Insert was technically not
successful.

But... We come back to this again:

![image](https://user-images.githubusercontent.com/24975989/227701040-a98b0ae7-1221-431a-8cc5-d47061372f7a.png)

If the new early return for the parent call is FALSEy, it stops all that
wonderful brainmob code from being executed.


![image](https://user-images.githubusercontent.com/24975989/227699367-c6aafcf1-8c50-41fe-b90d-820cd8cd1618.png)

... And ITS parent call is FALSE because `owner == receiver` is now
TRUE, as it was set the first time `Insert()` was called all the way
back in `/obj/item/bodypart/proc/try_attach_limb()`.

So the first `brain.Insert()` call in the parent
`/obj/item/bodypart/proc/try_attach_limb()` succeeds, but brainmob
related code isn't executed because the head bodypart hasn't set up the
brain's state correctly at this point.

And the second `brain.Insert()` call in the child
`/obj/item/bodypart/head/try_attach_limb()` which occurs after the
brain's state is correctly set, now fails because of an early return
when the insertion fails (the owner is already the receiver).

So, the old code only worked because it was bugged. Fixing the bug where
it worked, created a bug where it didn't.

But wait, why the gem room?

Well, since all the code that handled qdeleting the brainmob failed, it
persisted in the brain **even after the brain was inserted into the
body**. Where does the body store all of its organs? That's right, it
transfers them all to ~~the balls~~ nullspace!


![image](https://user-images.githubusercontent.com/24975989/227700676-47b8d7ef-b77d-42f8-996a-fa994136d501.png)

And what is the brainmob? A mob! And what did it have? A client! And
what happens when cliented mobs find themselves in nullspace when a
Life() tick happens? A vacation to the gem room!

I have opted for a very simple fix. I've moved the code into
`/obj/item/organ/internal/brain/Insert()`. It now checks to see if it's
in a head when it's inserted into the new brain_owner. If it is, the
brain handles setting up its own state so it can successfully transfer.

`brain.Insert()` only gets called once instead of twice and the
snowflake behaviour is no longer controlled by the head.

In my testing of shearing off heads of guest clients and reattaching
them, this fixes the bug without any gem room errors on the other
clients.
## Why It's Good For The Game

Feex.
## Changelog
🆑
fix: Having your severed, brain-filled head reattached to a body no
longer teleports your brain to the mythical Gem Room.
/🆑
2023-03-25 13:59:22 -06:00
Sol N
805617c0b9 Prosthesis organ manipulation no longer makes you harm target when you use incorrect tool (#74184)
## About The Pull Request

currently if someone is in surgery you can only harm them with a
surgical tool if you are in combat mode
the way the check works is that it only applies to tools that have the
SURGICAL_TOOL item flag

prosthesis organ manipulation is the only surgery that uses normal
engineering tools, and because it involves steps with normal tools, it
means that if you forget or misclick you can easily hurt someone with
the wrong tool

this makes that not happen anymore

## Why It's Good For The Game

i feel like it makes sense for the surgery that uses engineering tools
as surgery tools to treat engineering tools as them, with the same
considerations with regards to only having you bludgeon the patient if
you wanted to

## Changelog

🆑
qol: Prosthesis organ manipulation now warns you if you are using the
incorrect engineering tool
/🆑
2023-03-23 22:15:10 +00:00
Jacquerel
e000cb0b29 Bioscrambler scrambles your organs again (#74177)
## About The Pull Request


![image](https://user-images.githubusercontent.com/7483112/226889819-931b82c0-2d3a-4896-a1b4-30a25b9e3e68.png)

It looks like this task has fallen to me.

The reason this was originally removed was threefold:
- Having your brain replaced would ghost you.
- Having your lungs replaced would often instantly kill you in a way
that people would take a long time to notice.
- Several abstract or otherwise inappropriate organs could end up inside
someone.

I have solved all three of these problems using a blacklist.

Lungs are simply never touched. Brains, sadly, are also never touched. 
We _can_ modify your brain without ghosting you and originally I
implemented it that way, but the fact of the matter is that having your
brain scrambled is essentially irreversible except via DNA infuser, if
you had your brain replaced with a monkey brain which renders you unable
to use complex machinery (or worse, a Psyker brain) there is very little
that can be done about it.
If people think that this is good to have anyway I can put it back in
but it's probably for the best to leave it off.

I moved the code that the DNA infuser used to safely implant a brain
into a proc on organs when I originally expected that brain replacement
would be a feature of this PR, but I've left it there in case anything
else wants to do convenient brain replacement in the future (or already
does and can be updated to use this method).

The reason I didn't use a _white_list is because it seems like this list
would easily become incredibly long and nobody would maintain it. A
blacklist is slightly less safe, but reviewing the list it generates it
seems fine.

I also noted that the anomaly and the armour both implemented exactly
the same code in two places, so I moved that into a proc on `carbon`
instead. Now you don't need to apply changes in two places, and if
anything else needs to do this in the future once anyone adds literally
any items which use a bioscrambler core as material then it's easy for
them too.

Finally I scrubbed all cybernetics from the list and also made the
anomaly not affect cybernetics.
No strong reason for this one, just seemed like how it should work given
that it's also blocked by bio armour.

## Why It's Good For The Game

The bioscrambler in its current state doesn't do a whole lot, half of
the things it changes are invisible under your clothes and often won't
come up as a mechanical change unless you have developed chunky fingers
or a sunlight allergy.
This makes them somewhat more potentially dangerous and means people who
are negatively effected might turn up at medbay asking for new eyes or a
new stomach.
Like the Dimensional anomaly it also introduces somewhat of a gamble
feature. Some of the things on the list are _good_, and standing next to
it might help you rather than harm you. Or more likely, both. As the
infuser mechanic continues to add new organs with benefits and downsides
it also makes this anomaly more interesting.

Finally this gives the bioscrambler reactive armour a purpose, because
now it means that people attacking you have a chance to spontaneously
grow cat ears or snail eyes.

## Changelog

🆑
add: Bioscrambler anomalies will once again swap your organs with other
organs.
balance: Bioscrambler anomalies no longer affect synthetic parts.
/🆑
2023-03-23 16:03:42 -06:00
san7890
a6f49ed542 Refactors Suiciding Variable Into Trait (#74150)
## About The Pull Request

Firstly, this var was on `/mob`, even though only `/mob/living` and
`/mob/dead` could have ever used it, so who knows how much needless
memory it was consuming on stuff such as `oranges_ear` that would never
ever ever use something like this.

Edit: okay instead of memory it just polluted variable edit windows for
all /mob when it didn't need to. I like having a slim VV window

Secondly, it's a technical improvement over the previous system as we
are able to "track" where a suicide originates from, and how we can
track that from mob-to-mob-to-mob. Previously, the boolean `suiciding`
would only inform us if they had ever been connected to a mob that had
ever committed suicide, but now we are able to precisely determine which
mob gave them the trait that they must now apparently bear until the
round restarts.

## Why It's Good For The Game

Less memory usage, more indepth ability to track suicides in case you
really need that dexterity. Currently no implemented code could benefit
from using it, but it would be pretty neat if someone could figure out a
way to have someone be guilt-tripped whenever they look into a mirror
and seeing the reflection of their past life? This PR won't actually
help you code that and it'll probably require a bit more work, but it's
a possibility of some cool interactions you can do when you have this
information available to you.


![image](https://user-images.githubusercontent.com/34697715/226506321-550c37e7-5de8-4f9f-9ceb-4bf9b1052597.png)

## Changelog

🆑
refactor: Some aspects of how we track suicides from your living mob to
your observer have changed- please do let us know if anything has broken
via a GitHub Issue Report.
/🆑

There's probably some technical improvements that can be made in some
parts of the code I reworked to accommodate this change, do let me know
if you spot any easy ones (or fuckups). a lot of excess comes from the
fact that any step in the TRAIT framework trusts that you are passing in
a valid datum (or subtype) so that's a thing
2023-03-21 20:06:45 -04:00
Jack Edge
26c601147d Update surgery pain messages: grammar, spelling (#74113)
A number of "OH NO WHY IS THIS HAPPENING" surgery pain messages have
been tweaked for grammar and spelling. (For example, you no longer have
statements like "you can no longer feel your the liver anymore".)
2023-03-20 12:35:26 -06:00
Dani Glore
f9fe79a307 Organ Unit Tests & Bugfixes (#73026)
## About The Pull Request

This PR adds a new unit test for all organs, a new unit test for lungs,
and includes improvements for the existing breath and organ_set_bonus
tests. Using the tests, I was able to root out bugs in the organs. This
PR includes an advanced refactor of several developer-facing functions.
This PR certainly represents a "quality pass" for organs which will make
them easier to develop from now on.

### Synopsis of changes:
1. Fixed many fundamental bugs in organ code, especially in
`Insert()`/`Remove()` and their overrides.
2. Added two new procs to `/obj/item/organ` named `on_insert` and
`on_remove`, each being called after `Insert()`/`Remove()`.
3. Added `organ_effects` lazylist to `/obj/item/organ`. Converted
`organ_traits` to lazylist. 2x less empty lists per organ.
4. Adding `SHOULD_CALL_PARENT(TRUE)` to `Insert()`/`Remove()` was very
beneficial to stability and overall code health.
5. Created unit test `organ_sanity` for all usable organs in the game.
Tests insertion and removal.
6. Created unit test `lungs_sanity` for
`/obj/item/organ/internal/lungs`.
7. Improved `breath_sanity` unit tests with additional tests and
conditions.
8. Improved `organ_set_bonus_sanity` unit tests with better
documentation and maintainable code.

---

### Granular bug/fix list:

- A lot of organs are overriding `Insert()` to apply unique
side-effects, but aren't checking the return value of the parent proc
which causes the activation of side-effects even if the insertion
technically fails. I noticed the use-case of applying "unique
side-effects" is repeated across a lot of organs in the game, and by
overriding `Insert()` the potential for bugs is very high; I solved this
problem with inversion-of-control by adding two new procs to
`/obj/item/organ` named `on_insert` and `on_remove`, each being called
after `Insert()` and `Remove()` succeed.
- Many organs, such as abductor "glands", cursed heart, demon heart,
alien hive-node, alien plasma-vessel, etc, were not returning their
parent's `Insert()` proc return value at all, and as a result those
organs `Insert()`s were always returning `null`. I have been mopping
those bugs up in my last few PRs, and now the unit test reveals it all.
Functions such as those in surgery expect a truthy value to be returned
from `Insert()` to represent insertion success, and otherwise it
force-moves the organ out of the mob.
- Fixed abductor "glands" which had a hard-del bug due to their
`Remove()` not calling the parent proc.
- Fixed cybernetic arm implants which had a hard-del bug due to
`Remove()` not resetting their `hand` variable to `null`.
- Fixed lungs gas exchange implementation, which was allowing exhaled
gases to feedback into the inhaled gases, which caused Humans to inhale
much more gas than intended and not exhale expected gases.

### Overview of the `organ_sanity` unit test:

- The new `organ_sanity` unit test gathers all "usable" organs in the
game and tests to see if their `Insert()` and `Remove()` functions
behave as we expect them to.
- Some organs, such as the Nightmare Brain, cause the mob's species to
change which subsequently swaps out all of their organs; the unit test
accounts for these organs via the typecache `species_changing_organs`.
- Some organs are not usable in-game and can't be unit tested, so the
unit test accounts for them via the typecache `test_organ_blacklist`.

### Overview of the `lungs_sanity` unit test:

- This unit test focuses on `/obj/item/organ/internal/lungs` including
Plasmaman and Ashwalker lungs. The test focuses on testing the lungs'
`check_breath()` proc.
- The tests are composed of calling `check_breath` with different gas
mixes to test breathing and suffocation.
- Includes gas exchange test for inhaled/exhaled gases, such as O2 to
CO2.

### Improvements to the `breath_sanity` unit tests:

- Added additional tests for suffocation with empty internals, pure
Nitrogen internals, and a gas-less turf.
- Includes slightly more reliable tests for internals tanks.

## Why It's Good For The Game

**Organs and Lungs were mostly untested. Too many refactors have been
submitted without the addition of unit tests to prove the code works at
all.** Time to stop. _Time to get some help_. Due to how bad the code
health is in organs, any time we've tried to work with them some sort of
bug caused them to blow up in our faces. I am trying to fix some of that
by establishing some standard testing for organs. These tests have
revealed and allowed me to fix lot of basic developer errors/oversights,
as well as a few severe bugs.


![image](https://user-images.githubusercontent.com/17753498/220251281-07ef598f-355b-43a9-afd6-1de9690831da.png)

## Changelog

🆑 A.C.M.O.
fix: Fixed lungs gas exchange implementation, so you always inhale and
exhale the correct gases.
fix: Fixed a large quantity of hard-deletes which were being caused by
organs and cybernetic organs.
fix: Fixed many organs which were applying side-effects regardless of
whether or not the insertion failed.
code: Added unit tests for Organs.
code: Added unit tests for Lungs.
code: Improved unit tests for breathing.
code: Improved unit tests for DNA Infuser organs.
/🆑
2023-03-18 17:20:28 -07:00
san7890
bf6f81a9b5 Implements AddTraits and RemoveTraits procs for adding/removing multiple traits + swag unit test (#74037)
On the tin, doing it like this means we can reduce our overall line
fingerprint whenever we have to add two or more traits from the same
source on the same target. Especially helps when we get to the 4+ range
of traits, a breath of fresh air even.

Doesn't mean we have to do for loops, as that's already handled within
the define as well. I replaced some of the checks with `length()`
checks, let me know if I should switch it over to something else (maybe
`islist()`)? We stack_trace whenever we're not passed a list reference
on purpose, and sometimes var/lists are null by default (or just empty,
making this redundant).
## Why It's Good For The Game

I commonly feel the urge to write "use `AddTraits()`" or something in
reviews, then am sad when I remember it doesn't exist. I will no longer
be sad.

Can ensure a lot more trait safety as well by using static lists- when
both ADD_TRAIT_LIST and REMOVE_TRAIT_LIST re-use the same list, you are
confident (from a static point of view) that everything that you want to
be adding/removing works.

I may have missed a few things where this could be used, but both macros
implemented in this PR still use the same framework that was being used
in the last four years- so stuff won't break if left untouched. Just a
nifty new tool for developers.

also fixed up some code in the area, numerous bugs were found and
exploded
2023-03-18 01:57:06 +00:00
Zephyr
c43da443d1 Resolves mutant species keeping old organs they shouldn't have (#73728)
## About The Pull Request

regenerate organs never removed invalid organs when regenerating
## Why It's Good For The Game

Fixes https://github.com/tgstation/tgstation/issues/73640
adds a unit test to prevent regressions in the future

## Changelog
🆑
fix: Plasmamen don't have hearts, again
/🆑
2023-03-18 01:43:48 +00:00
Rhials
9bdb194539 Gives the chainsaw start/stop/loop SFX, makes the arm-mounted chainsaw a subtype of a regular chainsaw (#73996)
## About The Pull Request

The chainsaw now has an audio loop, as well as SFX for starting and
stopping. I'm pretty confident that I did the attribution stuff
correctly.


https://user-images.githubusercontent.com/28870487/225054900-4bf87ee7-9245-4004-b414-77d0e6e83a7c.mp4

I think this came out well. It may be a bit loud, but I wanted the
volume to be about the same as how the chainsaw slash sound comes out.
Audio stuff isn't really my forte, so let me know if anything sounds
off, or if any adjustments should be made.

To make this work for the mounted chainsaw (more specifically, the
abstract object that enters your hand), it has been made into a chainsaw
subtype. An updatepaths script has been included in the event that
someone has a map where the former path was included (why??).
## Why It's Good For The Game

Makes the chainsaw more menacing. It's one of the most powerful and
beloved pieces of crew weaponry, in addition to being a fucking
chainsaw. If you aren't keen on walking around the hallways with the
chainsaw loop playing like the badass you are, you can always just keep
it off until you get into a fight.

Gives an extra bit of immersion for those special moments where you get
to chainsaw someone to death.
## Changelog
🆑
soundadd: The chainsaw now has SFX for starting, stopping, and idling.
/🆑
2023-03-17 18:33:14 -06:00
Sealed101
dd780e88e2 Cleans up ..() usage in organs' Insert() and Remove() (#74055)
## About The Pull Request
fumbled around while investigating #74047 and turns out there's other
organs that have the same issue as the reported alien organs in that
issue. went around and replaced parent calls where applicable
(cursed/demonic hearts, flashlight eyes, alien organs, abductor glands)

## Why It's Good For The Game
Fixes #74047
Considerably less ghost internal organs, hopefully less unreported jank
on removing organs

## Changelog
🆑
fix: fixed a few internal organs acting wonky on inserting/removing
(some xenomorph organs, abductor glands, flashlight eyes, demon/cursed
hearts)
/🆑
2023-03-17 18:23:29 -06:00
Zephyr
333d2ed5d4 Medical Borg Surgical Processor is now used to start surgeries (#73993)
## About The Pull Request

Makes it so that the surgical processor is now used to start surgeries
instead of the surgical drapes.
This makes it less confusing for new players who download surgeries and
then cannot figure out how to actually use them.
Previously you had to have the module and the drapes active at the same
time, now just the module.
## Why It's Good For The Game

Quality of life for medical borgs, and also not a noob trap anymore.
## Changelog
🆑
add: Surgical Processor upgrade for medical cyborgs can now be used to
start surgeries.
balance: You no longer need to use two module slots for starting
surgeries with the surgical processor.
/🆑
2023-03-17 17:53:51 -06:00
Sealed101
2717dea3af Cyborg surgery processor shows downloaded surgeries & equip requirement on examine (#73992)
Surgery processor can download surgeries to be accessed without a
surgical computer. However, it does not tell the player that it needs to
be actually in one of the three equipped modules to let the cyborg
actually use those surgeries without relying on a surgical computer.

This PR addresses that + makes it show downloaded surgeries.

Players should be able to use the processor without any complications or
misinterpretations of its intended function. Being able to check
downloaded surgeries for something specific on the go can be handy.
2023-03-15 19:16:57 +00:00
Time-Green
9843c23657 Replaces internal_organs with organs (#73918)
Internal_organs now also contains external organs, so the naming was
incorrect

Requested by @tralezab in #72734

Also removed some now incorrect 'as anythings' that assumed everything
in the internal_organs list was an internal_organ (which is a lie since
I put extorgans in there which means runtimes and unintentionakl
behaviour

🆑
fix: fixes deadly harvesting just taking harmless extorgans
code: renames internal_organs to organs now that it can also contain
external_organs
/🆑
2023-03-14 18:33:35 -06:00
GoldenAlpharex
267b4a8d80 Fixes limbs not storing their external organs like they should be (#73951)
## About The Pull Request

That's about it, really. It was messing up the bodytypes, but nobody
noticed because that's not exactly something /tg/ uses much. Downstream,
it's another story, however.

## Why It's Good For The Game
Things going where they're meant to go is definitely a good thing, I
think we can all agree on this.

## Changelog

🆑 GoldenAlpharex
fix: Fixes limbs not properly storing their external organs, resulting
in issues when calculating the bodytypes.
/🆑
2023-03-13 22:52:52 -06:00
vect0r
d1b596a7ff Ethereal involuntary discharge fix (#73919)
## About The Pull Request

fixes #73911 

## Why It's Good For The Game

Double text = bad

## Changelog
🆑
fix: Ethereal discharge no longer alerts you twice that you did it.
/🆑
2023-03-12 19:57:11 -06:00
SgtHunk
c30a4644e8 Fixes robotic wings not having the correct sprite (#73869)
## About The Pull Request

The robotic wings sprite override was instead using the megamoth one
because of a repeated variable

## Why It's Good For The Game

v1 wings are now real again


![imagen](https://user-images.githubusercontent.com/68669754/224090005-74ad90ed-b0b1-4874-90e3-b668e0d6b1cc.png)


## Changelog

🆑
fix: Androids now properly have robotic wings instead of moth wings.
/🆑
2023-03-10 23:11:27 +01:00
GoldenAlpharex
387738fdc9 Fixes the arguments of bodypart_overlay's color_image() and its lack of early returns in subtypes (#73710)
## About The Pull Request
That's about it, really. Just something inconsistent I noticed while
fixing the bodypart_overlay refactor downstream. Might as well get
everyone to benefit from it.

## Why It's Good For The Game
Less runtimes == more better

Also less confusing for future coders that might touch this proc and go
"why are the arguments not what I was expecting???"

## Changelog

🆑 GoldenAlpharex
fix: Fixed some potential future runtimes relatively to the new bodypart
overlay system's coloring procs.
/🆑
2023-03-10 17:49:51 +00:00
MrMelbert
8284a7faab Fixes some invisible inhands from the transforming component (#73807)
## About The Pull Request

The original issue caused by #70037
Esword issue caused by #73716

Originally the transforming component did not override the inhand icon
state of the the item on its own (instead putting the onus on the item
itself if they wanted unique behavior). It was changed to always update
inhand icon state, most of which don't have one

I don't really like this fix, it should be explicit "I want inhand to
change" and not default, but this will work for now

Also the PR that fixed the Jaws issue didn't actually set the var they
created

Fixes #73805
Fixes #73711 (Actually)

## Why It's Good For The Game

Invisible sword bad

## Changelog

🆑 Melbert
fix: Fixed a eswords, some tools, and some other misc. items from being
invisible while extended / active
fix: Teleshields and other misc items not extending in hand when active
fix: Switchblades click on extend again
fix: Pendrivers click on extend
/🆑
2023-03-07 22:11:35 -07:00
GoldenAlpharex
85d04418be Fixes can_draw_on_bodypart on horns and podpeople hair (#73771)
## About The Pull Request
That's about it, really. When I was refactoring downstream, I found this
out, and I figured out that it wasn't intended. Now it's fixed!

## Why It's Good For The Game
Less bugs means it's better.

## Changelog

🆑 GoldenAlpharex
fix: Fixed some issues with podpeople hair and horns not being drawn
under the right circumstances all the time.
/🆑
2023-03-05 10:37:30 +01:00
tralezab
8d6091214f Adds Gondola Mutants + Progression to DNA Infuser + QoL (#73730)
Gondolas make you into the ultimate observer.
```diff
+Happy and Zenlike
+Can hug people to pacify them
-Pacified themselves
-Can't hold anything much larger than a pen
-Mute
```
Having every gondola organ at once allows you to survive crazy
environmental conditions!

DNA Infuser Entries are now split into three tiers. Starting at tier 1,
you unlock the next tier by infusing someone until they get a bonus at
the maximum tier allowed. Planning on adding a tier three, eventually.

Fly, Fox, Moth, and Felinid are tier zero
Rat, Carp, and Goliath are tier one
Gondola is tier two

DNA Infuser now prints a failure reason when you mess up.

As we've added a few more fluff dna infusions and I'm not venturing into
a harder dna mutant to obtain, I wanted to finally put in some
progression I've wanted for awhile. Now, people won't ignore tier 0 and
1 as much as that tier has to be used in some way to reach tier 2. As we
add stronger and stronger DNA mutants from rarer and deadlier mobs,
we're going to want to make sure people don't just skip easy mutants and
get something wild at the 20 minute mark.
2023-03-04 18:28:34 +00:00
MrMelbert
1f897ac44e Fixes an issue with nightmare revival, Unit tests some fully heal stuff (#73612)
## About The Pull Request

- Same issue as Ethereals. Owner was `null`ed because the heart was
recreated. I opted for a more permanent solution, that being introducing
a new flag to avoid recreating organs.

- Adds some unit tests for fully heal stuff to make sure it works. 

## Why It's Good For The Game

More cases of revival working as expected

## Changelog

🆑 Melbert
fix: Nightmare revival acts less funky - stops it from re-creating the
Light Eater.
/🆑

---------

Co-authored-by: san7890 <the@san7890.com>
2023-03-01 00:11:52 -07:00
RikuTheKiller
3241872f24 Makes dead metabolization work properly (#73665)
## About The Pull Request

So, currently, on_mob_dead() metabolization is very barebones. It can't
overdose and doesn't work when your liver is failing or you simply don't
have one. It's been completely neglected and isn't up-to-date on all the
fixes done to on_mob_life() and general metabolization.

This PR moves on_mob_dead() into the general metabolization chain and
gives it it's own handling proc in the life cycle called
handle_dead_metabolization() which simply calls metabolize() with dead
and liverless. Sadly your liver doesn't work when you're dead, though
self consuming reagents will still pass through due to my previous fixes
to reagent processing.
## Why It's Good For The Game

Not having desynchronized updates on the metabolization procs is good
for the sake of code quality, readability and futureproofing.

Making a proc do what it's supposed to is also a pretty good change.
## Changelog
🆑
fix: Reagents metabolize properly when dead. (If they're supposed to.)
/🆑
2023-03-01 00:10:29 -07:00
itseasytosee
8ab74525c1 Brings the monkey back down (body horror edition/addition.) (#73325)
## About The Pull Request
Let me paint you a story.
A long time ago monkeys once rested their feet on the floor, this was a
time of bliss and peace. But sometime around the horrors of making
monkeys subtypes of humans did an atrocity occur.

![image](https://user-images.githubusercontent.com/55666666/217657059-5c960ab4-c3de-493c-ac12-28de99b43d7f.png)
**The monkeys were moved up.**
I thought this was bad, and alot of people on the forum tended to agree
with me

![image](https://user-images.githubusercontent.com/55666666/217657707-120354c7-b1a5-4d93-8813-8e10e142bd92.png)
This was do to some purpose of adjusting them so it could be easier to
fit item sprites onto them instead of preforming the hours of work
refractoring to make the heights of the items dynamic and adjustable. A
simple pixel shift may have sufficed, but you see, such a change would
NEVER allow the frankensteining of monkey and human features together.
This is that refractor.

In essence, the following is now true.
A top_offset can now be generated for a human based on a varible on
their chest and legs. By default, and as is true with human legs and
chests, this variable is ZERO by default. Monkey legs and chest have
NEGATIVE values proportionate and onto how much smaller their sprite is
compared to humans. Other bodyparts, as well as any other accociated
overlays, or clothing will automatically be offset to this axis. THIS
MEANS THAT MONKEYS ARE ON THE FLOOR. But is means something else too.
Something more freakish,


![image](https://user-images.githubusercontent.com/55666666/217659439-bc0b1a35-76c8-4490-b869-770180605822.png)
**What abominable monsters**, unreachable by players as long as we can't
stitch monkeys and humans together (oh but just wait until the feature
freeze ends)
Oh but you might be thinking, if legs can make a mob go down.
can it make a mob

**go**
**up??**

**OH NO**


![image](https://user-images.githubusercontent.com/55666666/217707042-0d53022f-d93a-4262-a5ce-ef15a99eb897.png)

![image](https://user-images.githubusercontent.com/55666666/217707060-779f5901-ab90-4a64-9ca7-0b147e24f099.png)

![image](https://user-images.githubusercontent.com/55666666/217707821-23d7457c-5881-40ae-8d9d-c9fbd645aba6.png)

These lads are stepping, and have been implemented solely for proof of
concept as a way to flex the system I have created and remain
inaccessible without admin intervention.

But really, when all is said and done, all this PR does in terms of
player facing changes is move the monkey back down.

![image](https://user-images.githubusercontent.com/55666666/217708365-b6922a6d-08d0-4267-8713-4f8dac29038e.png)
Oh and fixed monkey husked which have been broken for who knows how
long.

![image](https://user-images.githubusercontent.com/55666666/217708464-5a9b6f89-4223-4ae5-a21e-3a274a9f8db8.png)
## Why It's Good For The Game
The monkey is restored to its original position. Tools now exist to have
legs and torsos of varying heights. Monkey Husking is fixed.
## Changelog
🆑 itseasytosee
fix: Monkeys ues the proper husk sprites.
imageadd: The monkey has been moved back down to its lower, more
submissive position.
refactor: Your bodyparts are now dynamically rendered at a height
relevant to the length of your legs and torso, what does this mean for
you? Not much to be honest, but you might see a monkey pop up a bit if
you cut its legs off.
admin: The Tallboy is here
/🆑

---------

Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
Co-authored-by: san7890 <the@san7890.com>
2023-02-27 09:35:07 +01:00
SuperSlayer
273dcbde82 Fixes strong arm implant bugs (#73605)
## About The Pull Request

Fixes strong arm implant introduced in
https://github.com/tgstation/tgstation/pull/73043 stunlocking people and
stacking with hulk attacks

## Why It's Good For The Game

Stunlocking or any other negative effects from throwing were not an
intended thing, this PR fixes it.

Stacking with hulk attacks also wasn't an intended feature.

## Changelog
🆑
fix: Fixes strong arm implant attacks stunlocking people
fix: Strong arm implant attacks no longer stack with hulk attacks
/🆑

---------

Co-authored-by: ATH1909 <42606352+ATH1909@users.noreply.github.com>
2023-02-25 23:57:53 -07:00
SuperSlayer
6ad7ea6bb9 Adds new combat cybernetic implant (#73043)
## About The Pull Request

Adds arm empower implant to the game - a cybernetic implant that will
make your punches deal 13 damage(normal human attacks deal between 1 and
10 damage), and throw your target away(doesn't work if you are lying
down) like a baseball bat does. It is inserted into your arm, and it
works only for the arm it is inserted into.

As an EMP effect it would cause you to fall under your target, or get
paralyzed due to muscle spasms.

## Why It's Good For The Game

Expands the implant system and adds more things to stuff into yourself
if you want to roleplay as a cool robo man.

## Changelog

🆑
add: Added a new cybernetic implant that increases punch damage of a
human
/🆑

---------

Co-authored-by: san7890 <the@san7890.com>
2023-02-20 15:53:11 -07:00
Jacquerel
296ca23aa1 Most actions cannot be used while incapacitated (#73513)
## About The Pull Request

Fixes #39775
The `TRAIT_INCAPACITATED` trait is intended to block you from acting but
does not inherently block actions. Actions only check for "conscious",
"has available hands", "immobile", or "lying down".
Most actions still _can't_ be used while incapacitated. This is because
most actions are spells, most spells have invocations, and you can't
talk while you are incapacitated. This is silly.

I have resolved this by adding a new flag which blocks actions while
incapacitated. This is somewhat redundant with "conscious" because most
sources of that also make you incapacitated but not _always_, you might
want the specificity.

I have tried to be discerning about where this flag is applied, it is
not in all cases (for instance you can still swallow implanted pills
while incapacitated and such), but it's not only possible but I can't
really avoid implementing this without it being a balance change in
_some_ cases,

Actions this effects are things such as:
Xenomorph Tail Sweep, Lesser Magic Missile (cult constucts), Heretic
Shadow Cloak, the Smoke spell in general, Conjuring (but not firing)
Infinite Guns, Mime spells

Times when these actions will no longer be available but were previously
are such times as when the mob is:
Stamina Crit, Stunned, Paralysis, and Time Stopped.

## Why It's Good For The Game

The incapacitated trait is applied by effects which should block acting
but still permits several actions which logically would be prevented.
This fortunately hasn't come up too often due to the high ratio of
actions with invocations, but it feels bad to stun someone and then have
them still able to perform an action they logically wouldn't be able to
take while stunned.
This is especially egregious in the case of Time Stop (the only way to
stun a lot of the mobs effected by this) but that's a rare pick on a
rare antagonist and would also rarely be used on these mobs, so a bit of
an edge case.

## Changelog

🆑
fix: Many spell-like abilities which could be stunned, paralysed, or
frozen in time now cannot be.
/🆑
2023-02-20 15:47:31 -07:00