Files
Bubberstation/code/game/atom/_atom.dm
SpaceLoveSs13 ba5c112a86 Huge Mirror fixes (#27488)
* Fixes incorrect operator usage in mecha code (#82570)

## About The Pull Request

I completely screwed up and told the original PR author of #82415
(9922d2f237) to use the `XOR` operator
instead of the `OR` operator (I wasn't thinking right for some reason
when I was reading the ref), anyways this PR just fixes that because I
misled the contributor into doing something that wasn't correct and
actually would BREAK functionality instead.

* Fixes TGUI debugging tools (#82569)

This project doesn't interfere with the game logic and aims to fix
multiple debugging features that are currently broken. Unfortunately,
kitchen sink and debug layout became broken after migration to Redux.
This PR aims to fix those features.

* Removes unused code for HTML UIs (#82589)

## About The Pull Request

This is the final PR for https://hackmd.io/XLt5MoRvRxuhFbwtk4VAUA that
I've been slowly inching towards the past few months.

This removes ``updateDialog``, ``updateUsrDialog``, ``IN_USE``,
``INTERACT_MACHINE_SET_MACHINE``, and everything surrounding it. Also
fixes advanced camera consoles not booting you off when you're moved out
of reach.

We called ``check_eye`` on mob life whenever they had their machine var
set, but their machine var would never be set to anything that actually
used it, which I found to be a little funny but was also probably my
fault.

## Why It's Good For The Game

This is poor and unmaintained code used for HTML UIs that we no longer
need thanks to TGUI, we should get rid of it to encourage the use of
TGUI in the future instead.

## Changelog


🆑
fix: Advanced camera consoles now boots you off when you're moved out of
reach.
/🆑

* Fixes a variety of input stalling exploits (#82577)

## About The Pull Request

Fixes the following input stalling exploits (maybe missed some): 

- Changing GPS tag 
- Setting teleporter destination
- Request Console Reply
- Various AI law board interactions
- Note, I used `is_holding` but technically this means these fail with
telekinesis. I can swap them to `can_perform_action(...)`, which allows
TK, but I noticed some places explicitly deny TK interactions with Ai
law boards. Not sure which is preferred.
- Borg Rename Board
- Plumbing Machines and Ducts
- APCs and SMES terminal placements
- Stargazers Telepathy
- Go Go Gadget Hat

## Changelog

🆑 Melbert
fix: You can't change the GPS tag of something unless you can actually
use the GPS
fix: You can't set the teleporter to a location unless you can actually
use the teleporter
fix: You can't reply to request console requests unless you can actually
use the console
fix: You can't update AI lawboards unless you're actually holding them 
fix: You can't update a borg rename board unless you're actually holding
it
fix: You can't mess with plumbing machines unless you can actually use
them
fix: You can't recolor / relayer ducts unless you're actually holding
them
fix: You can't magically wire APCs and SMESs unless you're right by them
fix: You can't use Stargazer Telepathy on people who you can't see
fix: You can't configure the Inspector Hat unless you can actually use
it
/🆑

* [NO GBP] Power outage operation fixes for chem master (#82591)

## About The Pull Request
- If the chem master runs out of power mid printing, it will properly
stop the printing process and its animation
- When transferring reagents it correctly checks if we have enough power
without forcing it

## Changelog
🆑
fix: chem master properly shuts down if it loses power mid printing and
won't transfer reagents for the same
/🆑

* Refactor renaming UNIQUE_RENAME items from the pen to an element (#82491)

## About The Pull Request

So a bit ago someone in code_general wanted to make plushies renamable,
but learnt that just adding the `UNIQUE_RENAME` flag wouldn't work as
pens would murder the plushie and only THEN let you rename it. I noted
refactoring both pens and plushies to use the new
`item_interaction(...)` procs would Just Solve This, but, well, they
didn't really have any coding experience.

But, hey, renaming being hardcoded to the pens has annoyed me ever since
I laid my eyes upon the hot mess that is paperwork code.
So here we are!

### We're making it an element.

There's not really much to this, this is mostly the same code but moved
to an element and with some minor cleanups.

First, we move it all from `/obj/item/pen` to a new element we called
`/datum/element/tool_renaming`. With this, instead of having it proc on
`/obj/item/pen/afterattack(...)`, we register it to proc on the
`COMSIG_ITEM_INTERACTING_WITH_ATOM` signal.

6e36ed9840/code/__DEFINES/dcs/signals/signals_atom/signals_atom_x_act.dm (L59-L62)
Secondly, we realize the code is just going through each if statement
regardless of whether the previous was correct.

6e36ed9840/code/modules/paperwork/pen.dm (L225-L258)
And, as we're dealing with text, just make it a switch statement
instead.
```dm
switch(pen_choice)
		if("Rename")
			(...)

		if("Description")
			(...)

		if("Reset")
			(...)
```
Then, we replace all single letter variables with descriptive ones,
replace the if-elses with early returns, and make it actually return
item interaction flags.

Finally, we slap this onto the pen, and we're done.
Now we can slap it onto other fitting renaming tools, and it uses the
proper item interaction system.
## Why It's Good For The Game

I feel it's generally better to not hardcode this to just pens, we have
plenty other writing utensils and possible renaming tools.
It's also a bit cleaner than before.
Apart from that, moves it from using `afterattack(...)` to the proper
item interaction chain by using `COMSIG_ITEM_INTERACTING_WITH_ATOM`,
which should reduce janky interactions.
## Changelog
🆑
refactor: Instead of being hardcoded to the pen, renaming items is now
an element. Currently only pens have this, and functionality should be
the same, but please report it if you find any items that were renamable
but now aren't.
/🆑

* Adds various quality of life changes for cooking to make it less click intensive. (#82566)

## About The Pull Request

- Increases tray item size by 1 item.

- Ranges and griddles can now be fed from trays.

Click when closed => fill soup pot.
Click when open => fill associated oven tray.
Right click when open => fill tray from oven tray
Click griddle => fill griddle surface.
Right click => fill tray from griddle surface

- Martian batter is now 5u of each ingredient into 10u of batter.

Hopefully will make it bug out less where it makes far fewer reagents
than it is supposed to, fixing reagents, or well soups specifically...
is out of scope for this PR.

- Adds the ability to print soup pots and large trays from the service
lathe

Soup pot: 5 Iron sheets, 0.4 bluespace crystal (given their size of
200U)
Large serving tray: 2 iron sheets

## Why It's Good For The Game

Makes cooking a lot less tedious. Especially for people with low
precision when it comes to filling oven trays. This also bring the
behavior up to parity with how you can click microwaves with trays to
fill them, ditto for the food processor. It also allows chef to use the
whole capacity of an oven, as previously you couldn't easily click 6
cake batters or other giant sprites onto the tiny tray.

The tray is now sized to be able to easily feed a griddle 8 items.

## Changelog

🆑
qol: chef equipment can now deposit and withdraw to/from trays!
qol: chef now has access to griddle and oven sized trays!
qol: service can now print soup pots
/🆑

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>

* Removes grid usage + heavy refactors (#82571)

## About The Pull Request
Grid has been deprecated for quite some time and we still use it. I
won't completely remove the component, this way downstreams won't
immediately suffer, but I can remove it from usage.

Some of these UIs had issues with them and as a hobby project I've
refactored them into typescript / rebuilt them. Airlock electronics, for
instance, looks substantially better.

<details>
<summary>before/after as requested</summary>

current airlock electronics scrolls into oblivion

![6RJ29HCPob](https://github.com/tgstation/tgstation/assets/42397676/ba82bc20-40fa-4af0-b709-7c8846c25652)

updated
![Screenshot 2024-04-11
164321](https://github.com/tgstation/tgstation/assets/42397676/05507e06-6305-4175-8476-778c345f02c8)

</details>

## Why It's Good For The Game
Code improvement + probably UI bug fixes
## Changelog
🆑
fix: Airlock electronics and other access-config type UIs should look
much better.
/🆑

* modular fixes

* [No GBP] Removes cogbar from some stealthy actions (#82593)

Issue brought some missed hidden actions to my attention.

I left cogbars in for _breaking_ handcuffs because resisting is sort of
a gray area. On one hand, you don't want someone to see you doing it; on
the other, there is a visible warning that you started doing it. So,
meet in the the middle, breaking handcuffs is still visible while
resisting isn't.
Closes #82583
Cogbars are not intended to ruin stealth
🆑
fix: Deviants buffed: Rogue shoelacing, pickpocketing and restraint
resisting no longer give cogbar icons.
/🆑

* [NO GBP] ...Remember to add SIGNAL_HANDLER (#82630)

## About The Pull Request

Just realized I forgot to add `SIGNAL_HANDLER` to the all-nighter
`on_removed_limb(...)` proc, even though it handles signals.
## Why It's Good For The Game


fe26373572/code/__DEFINES/dcs/helpers.dm (L9-L11)

* React cleanup (#82607)

## About The Pull Request
- No defaultHooks in react. Might fix issues where pages were not
scrollable on hover.
- createRef in a functional component. should be useref

## Why It's Good For The Game
Code improvement

* Security photobooths have their own ID (#82628)

## About The Pull Request

Prevents the HoP's photobooth button from connecting to the security
photobooth via having the same ID.

## Why It's Good For The Game

I forgot to add this when I made the security photobooth but it's
important that by default without any varedits, the HoP and security
photobooths stay separate.

## Changelog

🆑
fix: The HoP's photobooth button is now consistently connected to the
HoP's photobooth.
/🆑

* Fix buckled alert unbuckling not working properly (#82627)

## About The Pull Request

So funny thing, while trying to reproduce a different issue on the
current master, I coincidentally let my local instance start without
reading, latejoined on the shuttle, and I noticed it wasn't letting me
unbuckle as easily.

Looking into this a bit later, it seems as if it's a line #82593
accidentally changed while moving around the
`/mob/living/carbon/resist_buckle()` proc's flow.

fe26373572/code/modules/mob/living/carbon/carbon.dm (L238-L241)
While before it was
```dm
/mob/living/carbon/resist_buckle()
	if(HAS_TRAIT(src, TRAIT_RESTRAINED))
		(...)
	else
		buckled.user_unbuckle_mob(src,src)
```
Just changing this to `buckled.user_unbuckle_mob(src, src)` fixes this.
## Why It's Good For The Game

Fixes buckled alert unbuckling not working properly.
Fixes #82627.

## Changelog
🆑
fix: Clicking the buckled alert unbuckles you again.
/🆑

* Advanced camera consoles correctly deactivates when something happens to it or the user (#82619)

## About The Pull Request
- Fixes #82520

1. The eye deactivates when the machine is destroyed/deleted
2. The eye deactivates when the machine loses power
3. The computer constantly moniters the users status inside `process()`
and will deactivate when anything happens to them. Its not enough to
just hook onto to the mobs `COMSIG_MOVABLE_MOVED` signal. Literarly
anything can happen to them so we have to check constantly for any
changes

## Changelog
🆑
fix: advanced camera consoles correctly deactivate when something
happens(no proximity, no power etc) to its user
/🆑

* Oven tray checks for ovens (#82615)

## About The Pull Request
- Fixes #82610

Only oven trays have this proc not serving trays or other stuff
![Screenshot
(408)](https://github.com/tgstation/tgstation/assets/110812394/4867cc14-9df3-4398-9d2d-f8e38b5f0da9)

Also oven trays have a null atom storage which prevents it from being
put back in the oven after taking it out. So we remove that check

## Changelog
🆑
fix: you can put back the oven tray after you take it out
fix: only oven trays are allowed in ovens preventing baked food runtimes
/🆑

* Living Limb fixes (feat: Basic mobs attack random body zones again) (#82556)

## About The Pull Request

Reworks Living Limb code to fix a bunch of runtimes and issues I saw
while testing Bioscrambler.
Specifically, the contained mobs are now initialised via element
following attachment so that signal registration can occur at the
correct time. This allows limbs to function correctly when added from
nullspace via admin panel or bioscrambler.

Secondarily (and more wide-ranging) at some point (probably #79563) we
inadvertently made basic mobs only attack the target's chest instead of
spreading damage.
This is problematic for Living Flesh which can only attach itself to
damaged limbs but was left unable to attack damaged limbs.

I've fixed this in a way which is maybe stupid: adding an element which
randomises attack zone pre-attack.
Living limbs also limit this to _only_ limbs (although it will fall back
to chest if you have no limbs at all).
This is _technically_ still different, the previous behaviour used
`adjustBruteLoss` and `adjustFireLoss` and would spread the damage
across your entire body, but there isn't a route to that via the new
interface and this seems close enough.

## Changelog

🆑
fix: Living Limbs created by Bioscrambler will be alive.
fix: Living Limbs can once more attach themselves to your body.
balance: Living Limbs will prioritise attacking your limbs.
fix: Basic Mobs will once again spread their damage across body zones
instead of only attacking your chest.
/🆑

* RPG Loot: Revisited & READY (#82533)

Revival of #72881

A new alt click window with a tarkov-y loading spinner. Replaces the
object item window in stat panel.

<details>
<summary>vids</summary>

toggleable grouping:

![syAA5zf6RK](https://github.com/tgstation/tgstation/assets/42397676/c89b372d-29f6-4ebe-895d-f73bbdc41c19)

now lists the floor as first obj:

![abc](https://github.com/tgstation/tgstation/assets/42397676/cd8dc962-2ac7-41bf-a5d3-b9e926116b06)

in action:

![dreamseeker_IkrPKt2QZt](https://github.com/tgstation/tgstation/assets/42397676/1f990aa0-60f0-47e7-9d93-b63e35d05273)

</details>

- search by name
- 515 image generator is much faster than alt click menu
- opening a gargantuan amount of items shouldnt freeze your screen
- groups similar items together in stacks by default, toggleable
- shows tile as first item
- <kbd>Shift</kbd> and <kbd>Ctrl</kbd> compatible with LMB
🖱️
- RMB points points at items (sry i could not get MMB working)
- key <kbd>Esc</kbd> to exit the window.

For devs:
- A new image generation tech.
- An error refetch mechanic to the Image component
- It does not "smart track" the items being added to the pile, just
reopen or refresh. This was a design decision.

Honestly I just dislike the stat panel

Fixes #53824

Fixes

![image](https://github.com/tgstation/tgstation/assets/42397676/0e50faab-7d4d-4bf7-8c5b-4ac28547bfbd)

🆑
add: Added a loot window for alt-clicking tiles.
del: Removed the item browser from the stat panel.
/🆑

---------

Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>
Co-authored-by: AnturK <AnturK@users.noreply.github.com>
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>

* Reverts parts of #82602 (nodeath checks) (#82637)

## About The Pull Request

Reverts the nodeath checks of #82602

I opened a review thinking these checks were sus and the PR author said
they would remove them, but it was merged before that happened.

TL;DR 

1. I just noticed this now but it only affects carbons / humans it
doesn't even cover living or any other subtypes
2. Kinda sus. Some code intentionally skips checking nodeath (I guess?
Like removing the brain for example) so we would need a larger audit of
this rather than haphazardly throwing it in.

* Fixes to battle arcade (#82620)

## About The Pull Request

Added gear for world nine, removed the "Gear" gear that did nothing.
Made counterattacks to kill an enemy properly kill the enemy.
I renamed some gear items to fit the theme of the area they are unlocked
in just as a small thing.

## Why It's Good For The Game

Closes https://github.com/tgstation/tgstation/issues/82613

## Changelog

🆑
fix: Battle arcade's higher levels no longer gives you a "Gear" gear,
and counterattacks can now properly kill enemies.
/🆑

* Fixes SMES terminal placing under the SMES and not under the player (#82665)

## About The Pull Request

Changes `src` to`user` to get intended behavior.

* Birdshot: Toy crate (#82633)

## About The Pull Request
Gives the clown+mime their toy crate.
## Why It's Good For The Game
*honk*

* tram ai sat starts with a full smes (#82646)

## About The Pull Request

consistency and also this is fixes a bug introduced by that one power
refactor

## Why It's Good For The Game

bug bad

## Changelog
🆑
fix: tramstation AI sat starts full
/🆑

* [no gbp] Space Ruin bioscramblers shouldn't chase people around (#82649)

## About The Pull Request

See title
They wouldn't lock on to people on the station from a space ruin, but
would to whoever entered their z level the second it was entered.
Also fixes bug where I changed `status_flags` to `status_effects` for
some reason which isn't where you look for godmode

## Why It's Good For The Game

We have a space ruin whcih several (coreless) anomalies spawn on, the
bioscrambler was put as an option because it was already immortal. It's
weird though to zone into the ruin and immediately have every anomaly in
there lock onto you, the best intended effect is probably for these ones
specifically not to be bloodthirsty.
We kind of only care about that behaviour on the station.

## Changelog

🆑
fix: Anomalous Research ruin Bioscrambler anomalies won't home in on
targets
fix: Bioscrambler won't randomly drop its target for no reason
/🆑

* Sunders the many unused sprites and organizes what's left in structures.dmi (#82658)

## About The Pull Request
Hello again, I noticed the /obj/structures.dmi file had a lot of unused
stuff like tables from two generations ago, so I changed some stuff
around:
- Many unused, old icons deleted, mostly window variants used in old
smoothing systems I imagine
- Reorganized many sprites in the file so they're more grouped together
- Tweaked some barricade sprite naming to be consistent/standardized,
and to let others know they're not _too_ old...
- Fixed a misnomer that I believe was making directional tinted windows
look like frosted windows

## Why It's Good For The Game
Saves on file space, and satisfies your brain's pattern recognition bits

### Spriting
Old: 

![image](https://github.com/tgstation/tgstation/assets/143908044/0717940e-787e-40ee-85e2-0a0c5ebc0837)

New:

![image](https://github.com/tgstation/tgstation/assets/143908044/3954ba3b-b261-4700-986a-d30f3aa0e2a6)
also good lord those linen bin sprites are a crime

## Changelog
🆑
fix: Probably fixed directional tinted windows looking like directional
frosted windows
image: Deleted a bunch of unused structure sprites
/🆑

* Birdshot Wall Sanity Pass (#82598)

## About The Pull Request

Cleans up minor artifacting in the Birdshot Sec-Tram Closed Turfs

## Why It's Good For The Game

Someone definitely didn't mean to place some machines under Closed
Turfs. This barely qualifies as player facing.

## Changelog

🆑
fix: Cleans up some rocks on Birdshot
/🆑

* [NO GBP] Fixes deconstruction of closets & crates under a special case (#82612)

## About The Pull Request
So if a closet/crate has the `NO_DEBRIS_AFTER_DECONSTRUCTION` set on it
and if someone/something is still inside, then after deconstruction they
get deleted rather than getting dumped out first.

Could cause potential hard delete of mobs & stuff. We don't want to deal
with that

## Changelog
🆑
fix: closets & crates will dump all contents out first before deleting
itself regardless of `NO_DEBRIS_AFTER_DECONSTRUCTION` thus not for e.g.
hard deleting mobs inside it
/🆑

* Fixes ordinance lab igniter in IceBox (#82595)

## About The Pull Request
- Fixes #82294

Basically the same idea of merging ordanance lab with the burn chamber
so they share the same apc as already implemented in #82322

## Changelog
🆑
fix: Ordinance lab igniter in Icebox works again 
/🆑

* Birdshot: engi wardrope. (#82639)

## About The Pull Request

Add engi wardrope on Birdshot.

## Why It's Good For The Game

Birdshot doesn't have engi wardrope.

🆑
fix: Birdshot now have engi wardrope
/🆑

* Gives shadow walk a new, spookier, and shorter sound effect that no longer ignores walls (#82689)

## About The Pull Request

This gives shadow walk a snazzy new sound effect for entering/exiting
jaunt.


https://github.com/tgstation/tgstation/assets/28870487/c25f720f-5bad-4063-8d6e-140fd41bd740

This also has the sounds it plays no longer passes through walls.
## Why It's Good For The Game

The ethereal_entrance/exit sound effects are drawn out, and pretty
grating. They work for the other jaunts they're used for because a jaunt
typically lasts longer than the sound itself. Nightmares are frequently
dancing in and out of jaunt, and the sound effects for entering/exiting
tend to overlap. It gets loud and annoying really fast.

This sound effect is quicker, spookier, and more distinct.

As for making the sound not ignore walls, I think it's pretty dumb how
easy it is to detect the spooky scary shadow antag just by sitting in
your department. It takes a lot of the initial fear and paranoia they
have the potential for is wasted when Joe Geneticist can hear them
messing around in their territory without having to leave their chair.
## Changelog
🆑 Rhials
sound: Nightmare has a new sound effect for entering/exiting shadow
jaunt. It also no longer can be heard through walls.
/🆑

* [MIRROR] Alt click refactor (#2029)

* Alt click refactor

* Some early conflict removal

* Big modular refactor

* Update console.dm

* Update paper.dm

---------

Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>
Co-authored-by: Mal <13398309+vinylspiders@users.noreply.github.com>

* Yeets `ATTACK_QDELETED`, fixes welding torches not using fuel on attacking non-mobs (2 year old bug)  (#82694)

## About The Pull Request

- Deletes `ATTACK_QDELETED`
- May have been necessary in the past but it's pointless now. All it
does is clutter the attack chain. Perish.

- Fixes welders not using fuel on attacking non-mobs
- #65762 "fixed" welders consuming fuel on clicking turfs by adding an
`isliving` check and not an `ismovable` check?


## Changelog

🆑 Melbert
fix: Blobs may rejoice, welding torches now consume fuel when attacking
objects again after two years.
/🆑

* electric_welder fire

* Quirks, which give items, now have quirk_item arg specified as obj/item, instead of being just a var (#82650)

## About The Pull Request
quirk_item is now /obj/item, since it will allow for calling procs or
getting variables from this item

It's required for non-modular translation to call for item's name to
remove articles

## Why It's Good For The Game
It's always an item, and if it's a path, it's already checked for it.
Better usage in the future.

* turns martial arts gloves into a component (#82599)

sleeping carp gloves also work on mind init

this means for the sake of deathmatch you dont have to put them off and
on

fixes #82321

🆑
fix: you no longer need to put your sleeping carp gloves off and on in
Deathmatch to get the martial art
/🆑

---------

Co-authored-by: san7890 <the@san7890.com>

* Regal Rats can now tear down posters (#82673)

## About The Pull Request

i was fixing something on bagil and someone who was playing a regal rat
(after the round ended) said they wanted to be able to tear down posters
as a regal rat so i decided to code it because it made sense.

it's an element so literally any mob can tear down posters but i can't
think of any other mobs that would make sense to let it tear down
posters so we'll leave it just for _The Champion of All Mislaid
Creatures_ for now
## Why It's Good For The Game

Regal Rats should be all about sludgemaxxing and fucking up maintenance
to make it look even more grody than it should be. Being able to tear up
those disgusting and well-drawn posters to leave behind nothing but
scraps fits that motif. The element has a `do_after()` just to make sure
His Holiness doesn't accidentally tear down his posters while clicking
(i think all mobs should have this but that's a different issue man)

also includes some code improvement and user feedback in some failure
cases that already existed in the code.
## Changelog
🆑
add: Regal Rats are now able to tear down those colorful posters those
weird grey creatures keep spackling up on the walls of their rightful
domain.
/🆑

* Adds "Strong Stomach" quirk, a core CDDA/PZ quirk we've sorely been missing. Also Deviant Tastes dirty food re-nerf. (#82562)

## About The Pull Request

- Adds Strong Stomach quirk. 
   - 4 points
   - You can eat dirty food without risk of getting disease. 
- You suffer less negative effects from vomiting. Vomit stuns you for
half the duration, and you lose half as much nutrition.

- Reverts https://github.com/tgstation/tgstation/pull/76864 , integrates
its effects into Strong Stomach instead.

## Why It's Good For The Game

- Lotta people (namely Lizards and sometimes Felines with Deviant
Tastes) run gimmicks involving them being a gremlin person and eating
trash off the ground, and it's rather hard to accomplish this now since
it makes you a public medbay enemy # 1. This quirk should give them an
option to avoid that.
- Also (as mentioned in the title) both CDDA and PZ have this trait and
I can't believe we're missing it! This is something in
modifiable-character-traits/quirks-101.

- I moved the effects from #76864 to this quirk because 1. I thought it
was more fitting and 2. I thought the original PR was kinda wack for
what is (generally) a neutral quirk.

## Changelog

🆑 Melbert
add: Adds the Strong Stomach quirk, which allows you to eat grimy food
without worry about disease, and makes you a bit more resilient to the
effects of vomiting.
del: Deviant Tastes no longer prevents you from getting a negative
moodlet from eating dirty food. Strong Stomach does that now.
/🆑

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>

* Remove several functions from collections.js which have ES5 equivalents (#82417)

* Makes it EVEN EASIER to work with atom item interactions ft. "Leaf and Branch" & "Death to Chains" (#82625)

* apc fix

* Gulag Adjustments Two (#82561)

## About The Pull Request

I have received feedback that after the prior changes in #81971, the
gulag is still a little bit too subject to RNG.
The main culprit (as in my previous PR) is Iron being kind of cheap and
the fact that unlike the old Gulag you no longer have any way of
headhunting more valuable materials (everything appears as boulders on
your ore scanner).

My solution to this is wider than the last one of tweaking point values,
but also much simpler:
Just make every boulder you mine be worth the same amount of points
regardless of what is inside of it.

On the average test I made I could comfortably mine about 40-45 boulders
in ten minutes.
We'll make some adjustments to that rather than leaving 40 as the target
number;
Most players upon being teleported to the gulag are going to spend a few
minutes whining and bemoaning their fate instead of getting straight to
work. I had the benefit of being able to make sure my run started as
soon as a storm ended so I wouldn't need any kind of midpoint break. I
was also always the only person playing on my local instance, there
hadn't been any other pesky prisoners before me who had already mined
out all the nearest available deposits. And of course, let us not
forget, I am an MLG master league ss13 player who was surely performing
well above average.

So we'll round that down to: Each boulder is worth 33 points, meaning
you need to collect 31 boulders to complete a 1000 point (roughly ten
minute) sentence.

How do I ensure that every boulder is worth the same amount of points?
Well it's pretty easy.
One boulder = one material sheet. One material sheet = 33 points.
Simple.

"Now Jacquerel", I hear you not saying because you don't want me to know
about this thing you would prefer to do instead of hitting rocks
outside; "if I simply smash all of the tables and microwaves and botany
trays and bed in the gulag I can easily get like 65 sheets of Iron,
which is almost enough to buy the freedom for two entire people!"
Unfortunately I knew you were going to try and do that and the prisoner
point machine will only give you points for material sheets which have
been printed from the material smelter (well, any material smelter
actually but you should probably use the one in the gulag). You'll be
able to tell because if you examine a valid material sheet it will
mention a little maker's mark on it, which is absent in the beat-up iron
that you get from smashing furniture to bits.

Also glass is worth 0 points. Don't waste time digging up that shit. 

As glass has had all of its point value removed, I have added a "work
pit" to the gulag to compensate. You can pull boulders out of this
indefinitely via effort, however it also stamcrits you every time.
It's not very fun to do this, but that's because I would prefer you to
go find the rocks out in the field instead. This is a last resort.
You can do this if there's no boulders left to mine or if you really
really really hate mining and would rather very slowly click on one tile
repeatedly to get your boulders instead.
As a tiny bonus doing this gives workout experience.

This isn't a totally ideal solution but I think it'll do for now.

## Why It's Good For The Game

What we want out of the gulag is:
- Something where officers can vaguely approximate an expected sentence
duration.
- A task that requires players to actually be spending that time doing
something to get out of here.
- Produces at least some amount of useful materials.

In I think roughly that order.
I hope this change accomplishes all three of these in a way that is
somewhat predictable rather than throwing darts at a board.

## Changelog

🆑
balance: Gulag mining has been rebalanced so that every boulder is worth
the same amount of points to mine for a prisoner regardless of what it
contains, and should be more consistent.
add: A vent which boulders can be hauled out of by hand has been added
to the gulag which you can use if there's nothing left to mine. It is
very slow, but at least it gives you a workout...
/🆑

* stone

* Makes test merge bot continue with other PRs if updating one fails. (#82717)

Right now updating
https://github.com/tgstation/tgstation/pull/81089#issuecomment-1907296233
fails because it exceeds github character limit for comments.

This will make it work until backed is updated.

* Fixes the RnD console by adding a removed import (#82750)

## About The Pull Request
The 'map' import was removed from this file by #82417 but it's still
used in place in code. This re-adds the import

## Why It's Good For The Game
Fixes RnD consoles

## Changelog
🆑
fix: Fixed RnD consoles not being able to be opened.
/🆑

Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>

* Fixes cargo import (#82755)

## About The Pull Request
One of the imports got removed and there were no warnings... Man if only
there were a technology that could warn us in advance
## Why It's Good For The Game
UI fixes
## Changelog
🆑
fix: Fixed a bluescreen in cargo console
/🆑

* fixes

* Fixes, fixes.

* Pre-emptive mirror of https://github.com/tgstation/tgstation/pull/82892

* Turf weakref persists in changeturf / Fix plasma cutters  (#82906)

## About The Pull Request

Turf references don't change so logically, turf weakrefs wouldn't change
if the turf changes.

By not doing this this can cause bugs: See #82886 . (This Fixes #82886) 

(Projectiles hold a list of weakrefs to atoms hit to determine what they
have already hit.

Because turf weakrefs reset, we could "hit" the same turf twice if it
destroyed the turf.

Old behavior - this was fine but now that they're weakrefs, we get two
weakref datums in the list that point to the same ref.)

Less hacky alternative to #82901 . (Closes #82901) 

## Changelog

🆑 Melbert
fix: Plasma cutters work again
/🆑

---------

Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: Interception&? <137328283+intercepti0n@users.noreply.github.com>
Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
Co-authored-by: _0Steven <42909981+00-Steven@users.noreply.github.com>
Co-authored-by: Ketrai <zottielolly@gmail.com>
Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>
Co-authored-by: Jacquerel <hnevard@gmail.com>
Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>
Co-authored-by: AnturK <AnturK@users.noreply.github.com>
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Iajret <8430839+Iajret@users.noreply.github.com>
Co-authored-by: vect0r <71346830+Vect0r2@users.noreply.github.com>
Co-authored-by: jimmyl <70376633+mc-oofert@users.noreply.github.com>
Co-authored-by: AMyriad <143908044+AMyriad@users.noreply.github.com>
Co-authored-by: Zytolg <33048583+Zytolg@users.noreply.github.com>
Co-authored-by: Xackii <120736708+Xackii@users.noreply.github.com>
Co-authored-by: Rhials <28870487+Rhials@users.noreply.github.com>
Co-authored-by: NovaBot <154629622+NovaBot13@users.noreply.github.com>
Co-authored-by: Mal <13398309+vinylspiders@users.noreply.github.com>
Co-authored-by: larentoun <31931237+larentoun@users.noreply.github.com>
Co-authored-by: Arthri <41360489+Arthri@users.noreply.github.com>
Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
Co-authored-by: Useroth <37159550+Useroth@users.noreply.github.com>
2024-04-28 22:24:01 +02:00

963 lines
35 KiB
Plaintext

/**
* The base type for nearly all physical objects in SS13
* Lots and lots of functionality lives here, although in general we are striving to move
* as much as possible to the components/elements system
*/
/atom
layer = TURF_LAYER
plane = GAME_PLANE
appearance_flags = TILE_BOUND|LONG_GLIDE
/// pass_flags that we are. If any of this matches a pass_flag on a moving thing, by default, we let them through.
var/pass_flags_self = NONE
///First atom flags var
var/flags_1 = NONE
///Intearaction flags
var/interaction_flags_atom = NONE
var/flags_ricochet = NONE
///When a projectile tries to ricochet off this atom, the projectile ricochet chance is multiplied by this
var/receive_ricochet_chance_mod = 1
///When a projectile ricochets off this atom, it deals the normal damage * this modifier to this atom
var/receive_ricochet_damage_coeff = 0.33
///Reagents holder
var/datum/reagents/reagents = null
///all of this atom's HUD (med/sec, etc) images. Associative list of the form: list(hud category = hud image or images for that category).
///most of the time hud category is associated with a single image, sometimes its associated with a list of images.
///not every hud in this list is actually used. for ones available for others to see, look at active_hud_list.
var/list/image/hud_list = null
///all of this atom's HUD images which can actually be seen by players with that hud
var/list/image/active_hud_list = null
///HUD images that this atom can provide.
var/list/hud_possible
///How much this atom resists explosions by, in the end
var/explosive_resistance = 0
///vis overlays managed by SSvis_overlays to automaticaly turn them like other overlays.
var/list/managed_vis_overlays
/// Lazylist of all images (or atoms, I'm sorry) (hopefully attached to us) to update when we change z levels
/// You will need to manage adding/removing from this yourself, but I'll do the updating for you
var/list/image/update_on_z
/// Lazylist of all overlays attached to us to update when we change z levels
/// You will need to manage adding/removing from this yourself, but I'll do the updating for you
/// Oh and note, if order of addition is important this WILL break that. so mind yourself
var/list/image/update_overlays_on_z
///Cooldown tick timer for buckle messages
var/buckle_message_cooldown = 0
///Last fingerprints to touch this atom
var/fingerprintslast
/// Radiation insulation types
var/rad_insulation = RAD_NO_INSULATION
/// The icon state intended to be used for the acid component. Used to override the default acid overlay icon state.
var/custom_acid_overlay = null
var/datum/wires/wires = null
///Light systems, both shouldn't be active at the same time.
var/light_system = COMPLEX_LIGHT
///Range of the light in tiles. Zero means no light.
var/light_range = 0
///Intensity of the light. The stronger, the less shadows you will see on the lit area.
var/light_power = 1
///Hexadecimal RGB string representing the colour of the light. White by default.
var/light_color = COLOR_WHITE
/// Angle of light to show in light_dir
/// 360 is a circle, 90 is a cone, etc.
var/light_angle = 360
/// What angle to project light in
var/light_dir = NORTH
///Boolean variable for toggleable lights. Has no effect without the proper light_system, light_range and light_power values.
var/light_on = TRUE
/// How many tiles "up" this light is. 1 is typical, should only really change this if it's a floor light
var/light_height = LIGHTING_HEIGHT
///Bitflags to determine lighting-related atom properties.
var/light_flags = NONE
///Our light source. Don't fuck with this directly unless you have a good reason!
var/tmp/datum/light_source/light
///Any light sources that are "inside" of us, for example, if src here was a mob that's carrying a flashlight, that flashlight's light source would be part of this list.
var/tmp/list/light_sources
/// Last name used to calculate a color for the chatmessage overlays
var/chat_color_name
/// Last color calculated for the the chatmessage overlays
var/chat_color
/// A luminescence-shifted value of the last color calculated for chatmessage overlays
var/chat_color_darkened
// Use SET_BASE_PIXEL(x, y) to set these in typepath definitions, it'll handle pixel_x and y for you
///Default pixel x shifting for the atom's icon.
var/base_pixel_x = 0
///Default pixel y shifting for the atom's icon.
var/base_pixel_y = 0
// Use SET_BASE_VISUAL_PIXEL(x, y) to set these in typepath definitions, it'll handle pixel_w and z for you
///Default pixel w shifting for the atom's icon.
var/base_pixel_w = 0
///Default pixel z shifting for the atom's icon.
var/base_pixel_z = 0
///Used for changing icon states for different base sprites.
var/base_icon_state
///Icon-smoothing behavior.
var/smoothing_flags = NONE
///What directions this is currently smoothing with. IMPORTANT: This uses the smoothing direction flags as defined in icon_smoothing.dm, instead of the BYOND flags.
var/smoothing_junction = null //This starts as null for us to know when it's first set, but after that it will hold a 8-bit mask ranging from 0 to 255.
///Smoothing variable
var/top_left_corner
///Smoothing variable
var/top_right_corner
///Smoothing variable
var/bottom_left_corner
///Smoothing variable
var/bottom_right_corner
///What smoothing groups does this atom belongs to, to match canSmoothWith. If null, nobody can smooth with it. Must be sorted.
var/list/smoothing_groups = null
///List of smoothing groups this atom can smooth with. If this is null and atom is smooth, it smooths only with itself. Must be sorted.
var/list/canSmoothWith = null
///AI controller that controls this atom. type on init, then turned into an instance during runtime
var/datum/ai_controller/ai_controller
/// forensics datum, contains fingerprints, fibres, blood_dna and hiddenprints on this atom
var/datum/forensics/forensics
/// How this atom should react to having its astar blocking checked
var/can_astar_pass = CANASTARPASS_DENSITY
///whether ghosts can see screentips on it
var/ghost_screentips = FALSE
/// Flags to check for in can_perform_action. Used in alt-click checks
var/interaction_flags_click = NONE
/**
* Top level of the destroy chain for most atoms
*
* Cleans up the following:
* * Removes alternate apperances from huds that see them
* * qdels the reagent holder from atoms if it exists
* * clears the orbiters list
* * clears overlays and priority overlays
* * clears the light object
*/
/atom/Destroy(force)
if(alternate_appearances)
for(var/current_alternate_appearance in alternate_appearances)
var/datum/atom_hud/alternate_appearance/selected_alternate_appearance = alternate_appearances[current_alternate_appearance]
selected_alternate_appearance.remove_atom_from_hud(src)
if(reagents)
QDEL_NULL(reagents)
if(forensics)
QDEL_NULL(forensics)
if(atom_storage)
QDEL_NULL(atom_storage)
orbiters = null // The component is attached to us normaly and will be deleted elsewhere
// Checking length(overlays) before cutting has significant speed benefits
if (length(overlays))
overlays.Cut()
LAZYNULL(managed_overlays)
if(ai_controller)
QDEL_NULL(ai_controller)
if(light)
QDEL_NULL(light)
if (length(light_sources))
light_sources.Cut()
if(smoothing_flags & SMOOTH_QUEUED)
SSicon_smooth.remove_from_queues(src)
return ..()
/atom/proc/handle_ricochet(obj/projectile/ricocheting_projectile)
var/turf/p_turf = get_turf(ricocheting_projectile)
var/face_direction = get_dir(src, p_turf) || get_dir(src, ricocheting_projectile)
var/face_angle = dir2angle(face_direction)
var/incidence_s = GET_ANGLE_OF_INCIDENCE(face_angle, (ricocheting_projectile.Angle + 180))
var/a_incidence_s = abs(incidence_s)
if(a_incidence_s > 90 && a_incidence_s < 270)
return FALSE
if((ricocheting_projectile.armor_flag in list(BULLET, BOMB)) && ricocheting_projectile.ricochet_incidence_leeway)
if((a_incidence_s < 90 && a_incidence_s < 90 - ricocheting_projectile.ricochet_incidence_leeway) || (a_incidence_s > 270 && a_incidence_s -270 > ricocheting_projectile.ricochet_incidence_leeway))
return FALSE
var/new_angle_s = SIMPLIFY_DEGREES(face_angle + incidence_s)
ricocheting_projectile.set_angle(new_angle_s)
return TRUE
/// Whether the mover object can avoid being blocked by this atom, while arriving from (or leaving through) the border_dir.
/atom/proc/CanPass(atom/movable/mover, border_dir)
SHOULD_CALL_PARENT(TRUE)
SHOULD_BE_PURE(TRUE)
if(SEND_SIGNAL(src, COMSIG_ATOM_TRIED_PASS, mover, border_dir) & COMSIG_COMPONENT_PERMIT_PASSAGE)
return TRUE
if(mover.movement_type & PHASING)
return TRUE
. = CanAllowThrough(mover, border_dir)
// This is cheaper than calling the proc every time since most things dont override CanPassThrough
if(!mover.generic_canpass)
return mover.CanPassThrough(src, REVERSE_DIR(border_dir), .)
/// Returns true or false to allow the mover to move through src
/atom/proc/CanAllowThrough(atom/movable/mover, border_dir)
SHOULD_CALL_PARENT(TRUE)
//SHOULD_BE_PURE(TRUE)
if(mover.pass_flags & pass_flags_self)
return TRUE
if(mover.throwing && (pass_flags_self & LETPASSTHROW))
return TRUE
return !density
/**
* Is this atom currently located on centcom (or riding off into the sunset on a shuttle)
*
* Specifically, is it on the z level and within the centcom areas.
* You can also be in a shuttle during endgame transit.
*
* Used in gamemode to identify mobs who have escaped and for some other areas of the code
* who don't want atoms where they shouldn't be
*
* Returns TRUE if this atom is on centcom or an escape shuttle, or FALSE if not
*/
/atom/proc/onCentCom()
var/turf/current_turf = get_turf(src)
if(!current_turf)
return FALSE
// This doesn't necessarily check that we're at central command,
// but it checks for any shuttles which have finished are still in hyperspace
// (IE, stuff like the whiteship which fly off into the sunset and "escape")
if(is_reserved_level(current_turf.z))
return on_escaped_shuttle(ENDGAME_TRANSIT)
// From here on we only concern ourselves with people actually on the centcom Z
if(!is_centcom_level(current_turf.z))
return FALSE
if(istype(current_turf.loc, /area/centcom))
return TRUE
// Finally, check if we're on an escaped shuttle
return on_escaped_shuttle()
/**
* Is the atom in any of the syndicate areas
*
* Either in the syndie base, or any of their shuttles
*
* Also used in gamemode code for win conditions
*
* Returns TRUE if this atom is on the syndicate recon base, any of its shuttles, or an escape shuttle, or FALSE if not
*/
/atom/proc/onSyndieBase()
var/turf/current_turf = get_turf(src)
if(!current_turf)
return FALSE
// Syndicate base is loaded in a reserved level. If not reserved, we don't care.
if(!is_reserved_level(current_turf.z))
return FALSE
var/static/list/syndie_typecache = typecacheof(list(
/area/centcom/syndicate_mothership, // syndicate base itself
/area/shuttle/assault_pod, // steel rain
/area/shuttle/syndicate, // infiltrator
))
if(is_type_in_typecache(current_turf.loc, syndie_typecache))
return TRUE
// Finally, check if we're on an escaped shuttle
return on_escaped_shuttle()
/**
* Checks that we're on a shuttle that's escaped
*
* * check_for_launch_status - What launch status do we check for? Generally the two you want to check for are ENDGAME_LAUNCHED or ENDGAME_TRANSIT
*
* Returns TRUE if this atom is on a shuttle which is escaping or has escaped, or FALSE otherwise
*/
/atom/proc/on_escaped_shuttle(check_for_launch_status = ENDGAME_LAUNCHED)
var/turf/current_turf = get_turf(src)
if(!current_turf)
return FALSE
for(var/obj/docking_port/mobile/mobile_docking_port as anything in SSshuttle.mobile_docking_ports)
if(mobile_docking_port.launch_status != check_for_launch_status)
continue
for(var/area/shuttle/shuttle_area as anything in mobile_docking_port.shuttle_areas)
if(shuttle_area == current_turf.loc)
return TRUE
return FALSE
/**
* Is the atom in an away mission
*
* Must be in the away mission z-level to return TRUE
*
* Also used in gamemode code for win conditions
*/
/atom/proc/onAwayMission()
var/turf/current_turf = get_turf(src)
if(!current_turf)
return FALSE
if(is_away_level(current_turf.z))
return TRUE
return FALSE
/**
* Ensure a list of atoms/reagents exists inside this atom
*
* Goes throught he list of passed in parts, if they're reagents, adds them to our reagent holder
* creating the reagent holder if it exists.
*
* If the part is a moveable atom and the previous location of the item was a mob/living,
* it calls the inventory handler transferItemToLoc for that mob/living and transfers the part
* to this atom
*
* Otherwise it simply forceMoves the atom into this atom
*/
/atom/proc/CheckParts(list/parts_list, datum/crafting_recipe/current_recipe)
SEND_SIGNAL(src, COMSIG_ATOM_CHECKPARTS, parts_list, current_recipe)
if(!parts_list)
return
for(var/part in parts_list)
if(istype(part, /datum/reagent))
if(!reagents)
reagents = new()
reagents.reagent_list.Add(part)
else if(ismovable(part))
var/atom/movable/object = part
if(isliving(object.loc))
var/mob/living/living = object.loc
living.transferItemToLoc(object, src)
else
object.forceMove(src)
SEND_SIGNAL(object, COMSIG_ATOM_USED_IN_CRAFT, src)
parts_list.Cut()
///Take air from the passed in gas mixture datum
/atom/proc/assume_air(datum/gas_mixture/giver)
return null
///Remove air from this atom
/atom/proc/remove_air(amount)
return null
///Return the current air environment in this atom
/atom/proc/return_air()
if(loc)
return loc.return_air()
else
return null
///Return the air if we can analyze it
/atom/proc/return_analyzable_air()
return null
/atom/proc/Bumped(atom/movable/bumped_atom)
set waitfor = FALSE
SEND_SIGNAL(src, COMSIG_ATOM_BUMPED, bumped_atom)
/// Convenience proc to see if a container is open for chemistry handling
/atom/proc/is_open_container()
return is_refillable() && is_drainable()
/// Is this atom injectable into other atoms
/atom/proc/is_injectable(mob/user, allowmobs = TRUE)
return reagents && (reagents.flags & (INJECTABLE | REFILLABLE))
/// Can we draw from this atom with an injectable atom
/atom/proc/is_drawable(mob/user, allowmobs = TRUE)
return reagents && (reagents.flags & (DRAWABLE | DRAINABLE))
/// Can this atoms reagents be refilled
/atom/proc/is_refillable()
return reagents && (reagents.flags & REFILLABLE)
/// Is this atom drainable of reagents
/atom/proc/is_drainable()
return reagents && (reagents.flags & DRAINABLE)
/** Handles exposing this atom to a list of reagents.
*
* Sends COMSIG_ATOM_EXPOSE_REAGENTS
* Calls expose_atom() for every reagent in the reagent list.
*
* Arguments:
* - [reagents][/list]: The list of reagents the atom is being exposed to.
* - [source][/datum/reagents]: The reagent holder the reagents are being sourced from.
* - methods: How the atom is being exposed to the reagents. Bitflags.
* - volume_modifier: Volume multiplier.
* - show_message: Whether to display anything to mobs when they are exposed.
*/
/atom/proc/expose_reagents(list/reagents, datum/reagents/source, methods=TOUCH, volume_modifier=1, show_message=TRUE)
. = SEND_SIGNAL(src, COMSIG_ATOM_EXPOSE_REAGENTS, reagents, source, methods, volume_modifier, show_message)
if(. & COMPONENT_NO_EXPOSE_REAGENTS)
return
SEND_SIGNAL(source, COMSIG_REAGENTS_EXPOSE_ATOM, src, reagents, methods, volume_modifier, show_message)
for(var/datum/reagent/current_reagent as anything in reagents)
. |= current_reagent.expose_atom(src, reagents[current_reagent])
SEND_SIGNAL(src, COMSIG_ATOM_AFTER_EXPOSE_REAGENTS, reagents, source, methods, volume_modifier, show_message)
/// Are you allowed to drop this atom
/atom/proc/AllowDrop()
return FALSE
///Is this atom within 1 tile of another atom
/atom/proc/HasProximity(atom/movable/proximity_check_mob as mob|obj)
return
/// Sets the wire datum of an atom
/atom/proc/set_wires(datum/wires/new_wires)
wires = new_wires
///Return true if we're inside the passed in atom
/atom/proc/in_contents_of(container)//can take class or object instance as argument
if(ispath(container))
if(istype(src.loc, container))
return TRUE
else if(src in container)
return TRUE
return FALSE
/**
* Checks the atom's loc and calls update_held_items on it if it is a mob.
*
* This should only be used in situations when you are unable to use /datum/element/update_icon_updates_onmob for whatever reason.
* Check code/datums/elements/update_icon_updates_onmob.dm before using this. Adding that to the atom and calling update_appearance will work for most cases.
*
* Arguments:
* * mob/target - The mob to update the icons of. Optional argument, use if the atom's loc is not the mob you want to update.
*/
/atom/proc/update_inhand_icon(mob/target = loc)
SHOULD_CALL_PARENT(TRUE)
if(!istype(target))
return
target.update_held_items()
SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_INHAND_ICON, target)
/**
* An atom we are buckled or is contained within us has tried to move
*
* Default behaviour is to send a warning that the user can't move while buckled as long
* as the [buckle_message_cooldown][/atom/var/buckle_message_cooldown] has expired (50 ticks)
*/
/atom/proc/relaymove(mob/living/user, direction)
if(SEND_SIGNAL(src, COMSIG_ATOM_RELAYMOVE, user, direction) & COMSIG_BLOCK_RELAYMOVE)
return
if(buckle_message_cooldown <= world.time)
buckle_message_cooldown = world.time + 25
balloon_alert(user, "can't move while buckled!")
return
/**
* A special case of relaymove() in which the person relaying the move may be "driving" this atom
*
* This is a special case for vehicles and ridden animals where the relayed movement may be handled
* by the riding component attached to this atom. Returns TRUE as long as there's nothing blocking
* the movement, or FALSE if the signal gets a reply that specifically blocks the movement
*/
/atom/proc/relaydrive(mob/living/user, direction)
return !(SEND_SIGNAL(src, COMSIG_RIDDEN_DRIVER_MOVE, user, direction) & COMPONENT_DRIVER_BLOCK_MOVE)
///returns the mob's dna info as a list, to be inserted in an object's blood_DNA list
/mob/living/proc/get_blood_dna_list()
if(get_blood_id() != /datum/reagent/blood)
return
return list("ANIMAL DNA" = "Y-")
///Get the mobs dna list
/mob/living/carbon/get_blood_dna_list()
if(get_blood_id() != /datum/reagent/blood)
return
var/list/blood_dna = list()
if(dna)
blood_dna[dna.unique_enzymes] = dna.blood_type
else
blood_dna["UNKNOWN DNA"] = "X*"
return blood_dna
/mob/living/carbon/alien/get_blood_dna_list()
return list("UNKNOWN DNA" = "X*")
/mob/living/silicon/get_blood_dna_list()
return
///to add a mob's dna info into an object's blood_dna list.
/atom/proc/transfer_mob_blood_dna(mob/living/injected_mob)
// Returns 0 if we have that blood already
var/new_blood_dna = injected_mob.get_blood_dna_list()
if(!new_blood_dna)
return FALSE
var/old_length = GET_ATOM_BLOOD_DNA_LENGTH(src)
add_blood_DNA(new_blood_dna)
if(GET_ATOM_BLOOD_DNA_LENGTH(src) == old_length)
return FALSE
return TRUE
///to add blood from a mob onto something, and transfer their dna info
/atom/proc/add_mob_blood(mob/living/injected_mob)
var/list/blood_dna = injected_mob.get_blood_dna_list()
if(!blood_dna)
return FALSE
return add_blood_DNA(blood_dna)
///Is this atom in space
/atom/proc/isinspace()
if(isspaceturf(get_turf(src)))
return TRUE
else
return FALSE
/**
* If someone's trying to dump items onto our atom, where should they be dumped to?
*
* Return a loc to place objects, or null to stop dumping.
*/
/atom/proc/get_dumping_location()
return null
/**
* the vision impairment to give to the mob whose perspective is set to that atom
*
* (e.g. an unfocused camera giving you an impaired vision when looking through it)
*/
/atom/proc/get_remote_view_fullscreens(mob/user)
return
/**
* the sight changes to give to the mob whose perspective is set to that atom
*
* (e.g. A mob with nightvision loses its nightvision while looking through a normal camera)
*/
/atom/proc/update_remote_sight(mob/living/user)
return
/**
* Hook for running code when a dir change occurs
*
* Not recommended to use, listen for the [COMSIG_ATOM_DIR_CHANGE] signal instead (sent by this proc)
*/
/atom/proc/setDir(newdir)
SHOULD_CALL_PARENT(TRUE)
if (SEND_SIGNAL(src, COMSIG_ATOM_PRE_DIR_CHANGE, dir, newdir) & COMPONENT_ATOM_BLOCK_DIR_CHANGE)
newdir = dir
return
SEND_SIGNAL(src, COMSIG_ATOM_DIR_CHANGE, dir, newdir)
dir = newdir
SEND_SIGNAL(src, COMSIG_ATOM_POST_DIR_CHANGE, dir, newdir)
if(smoothing_flags & SMOOTH_BORDER_OBJECT)
QUEUE_SMOOTH_NEIGHBORS(src)
/**
* Wash this atom
*
* This will clean it off any temporary stuff like blood. Override this in your item to add custom cleaning behavior.
* Returns true if any washing was necessary and thus performed
* Arguments:
* * clean_types: any of the CLEAN_ constants
*/
/atom/proc/wash(clean_types)
SHOULD_CALL_PARENT(TRUE)
if(SEND_SIGNAL(src, COMSIG_COMPONENT_CLEAN_ACT, clean_types) & COMPONENT_CLEANED)
return TRUE
// Basically "if has washable coloration"
if(length(atom_colours) >= WASHABLE_COLOUR_PRIORITY && atom_colours[WASHABLE_COLOUR_PRIORITY])
remove_atom_colour(WASHABLE_COLOUR_PRIORITY)
return TRUE
return FALSE
///Where atoms should drop if taken from this atom
/atom/proc/drop_location()
var/atom/location = loc
if(!location)
return null
return location.AllowDrop() ? location : location.drop_location()
/**
* An atom has entered this atom's contents
*
* Default behaviour is to send the [COMSIG_ATOM_ENTERED]
*/
/atom/Entered(atom/movable/arrived, atom/old_loc, list/atom/old_locs)
SEND_SIGNAL(src, COMSIG_ATOM_ENTERED, arrived, old_loc, old_locs)
SEND_SIGNAL(arrived, COMSIG_ATOM_ENTERING, src, old_loc, old_locs)
/**
* An atom is attempting to exit this atom's contents
*
* Default behaviour is to send the [COMSIG_ATOM_EXIT]
*/
/atom/Exit(atom/movable/leaving, direction)
// Don't call `..()` here, otherwise `Uncross()` gets called.
// See the doc comment on `Uncross()` to learn why this is bad.
if(SEND_SIGNAL(src, COMSIG_ATOM_EXIT, leaving, direction) & COMPONENT_ATOM_BLOCK_EXIT)
return FALSE
return TRUE
/**
* An atom has exited this atom's contents
*
* Default behaviour is to send the [COMSIG_ATOM_EXITED]
*/
/atom/Exited(atom/movable/gone, direction)
SEND_SIGNAL(src, COMSIG_ATOM_EXITED, gone, direction)
///Return atom temperature
/atom/proc/return_temperature()
return
/atom/proc/process_recipes(mob/living/user, obj/item/processed_object, list/processing_recipes)
//Only one recipe? use the first
if(processing_recipes.len == 1)
StartProcessingAtom(user, processed_object, processing_recipes[1])
return
//Otherwise, select one with a radial
ShowProcessingGui(user, processed_object, processing_recipes)
///Creates the radial and processes the selected option
/atom/proc/ShowProcessingGui(mob/living/user, obj/item/processed_object, list/possible_options)
var/list/choices_to_options = list() //Dict of object name | dict of object processing settings
var/list/choices = list()
for(var/list/current_option as anything in possible_options)
var/atom/current_option_type = current_option[TOOL_PROCESSING_RESULT]
choices_to_options[initial(current_option_type.name)] = current_option
var/image/option_image = image(icon = initial(current_option_type.icon), icon_state = initial(current_option_type.icon_state))
choices += list("[initial(current_option_type.name)]" = option_image)
var/pick = show_radial_menu(user, src, choices, radius = 36, require_near = TRUE)
if(!pick)
return
StartProcessingAtom(user, processed_object, choices_to_options[pick])
/atom/proc/StartProcessingAtom(mob/living/user, obj/item/process_item, list/chosen_option)
var/processing_time = chosen_option[TOOL_PROCESSING_TIME]
to_chat(user, span_notice("You start working on [src]."))
if(process_item.use_tool(src, user, processing_time, volume=50))
var/atom/atom_to_create = chosen_option[TOOL_PROCESSING_RESULT]
var/list/atom/created_atoms = list()
var/amount_to_create = chosen_option[TOOL_PROCESSING_AMOUNT]
for(var/i = 1 to amount_to_create)
var/atom/created_atom = new atom_to_create(drop_location())
if(custom_materials)
created_atom.set_custom_materials(custom_materials, 1 / amount_to_create)
created_atom.pixel_x = pixel_x
created_atom.pixel_y = pixel_y
if(i > 1)
created_atom.pixel_x += rand(-8,8)
created_atom.pixel_y += rand(-8,8)
created_atom.OnCreatedFromProcessing(user, process_item, chosen_option, src)
created_atoms.Add(created_atom)
to_chat(user, span_notice("You manage to create [amount_to_create] [initial(atom_to_create.gender) == PLURAL ? "[initial(atom_to_create.name)]" : "[initial(atom_to_create.name)][plural_s(initial(atom_to_create.name))]"] from [src]."))
SEND_SIGNAL(src, COMSIG_ATOM_PROCESSED, user, process_item, created_atoms)
UsedforProcessing(user, process_item, chosen_option)
return
/atom/proc/UsedforProcessing(mob/living/user, obj/item/used_item, list/chosen_option)
qdel(src)
return
/atom/proc/OnCreatedFromProcessing(mob/living/user, obj/item/work_tool, list/chosen_option, atom/original_atom)
SHOULD_CALL_PARENT(TRUE)
SEND_SIGNAL(src, COMSIG_ATOM_CREATEDBY_PROCESSING, original_atom, chosen_option)
if(user.mind)
ADD_TRAIT(src, TRAIT_FOOD_CHEF_MADE, REF(user.mind))
///Connect this atom to a shuttle
/atom/proc/connect_to_shuttle(mapload, obj/docking_port/mobile/port, obj/docking_port/stationary/dock)
return
/atom/proc/intercept_zImpact(list/falling_movables, levels = 1)
SHOULD_CALL_PARENT(TRUE)
. |= SEND_SIGNAL(src, COMSIG_ATOM_INTERCEPT_Z_FALL, falling_movables, levels)
///Setter for the `density` variable to append behavior related to its changing.
/atom/proc/set_density(new_value)
SHOULD_CALL_PARENT(TRUE)
if(density == new_value)
return
. = density
density = new_value
///Setter for the `base_pixel_x` variable to append behavior related to its changing.
/atom/proc/set_base_pixel_x(new_value)
if(base_pixel_x == new_value)
return
. = base_pixel_x
base_pixel_x = new_value
pixel_x = pixel_x + base_pixel_x - .
///Setter for the `base_pixel_y` variable to append behavior related to its changing.
/atom/proc/set_base_pixel_y(new_value)
if(base_pixel_y == new_value)
return
. = base_pixel_y
base_pixel_y = new_value
pixel_y = pixel_y + base_pixel_y - .
// Not a valid operation, turfs and movables handle block differently
/atom/proc/set_explosion_block(explosion_block)
return
/**
* Returns true if this atom has gravity for the passed in turf
*
* Sends signals [COMSIG_ATOM_HAS_GRAVITY] and [COMSIG_TURF_HAS_GRAVITY], both can force gravity with
* the forced gravity var.
*
* micro-optimized to hell because this proc is very hot, being called several times per movement every movement.
*
* HEY JACKASS, LISTEN
* IF YOU ADD SOMETHING TO THIS PROC, MAKE SURE /mob/living ACCOUNTS FOR IT
* Living mobs treat gravity in an event based manner. We've decomposed this proc into different checks
* for them to use. If you add more to it, make sure you do that, or things will behave strangely
*
* Gravity situations:
* * No gravity if you're not in a turf
* * No gravity if this atom is in is a space turf
* * Gravity if the area it's in always has gravity
* * Gravity if there's a gravity generator on the z level
* * Gravity if the Z level has an SSMappingTrait for ZTRAIT_GRAVITY
* * otherwise no gravity
*/
/atom/proc/has_gravity(turf/gravity_turf)
if(!isturf(gravity_turf))
gravity_turf = get_turf(src)
if(!gravity_turf)//no gravity in nullspace
return FALSE
var/list/forced_gravity = list()
SEND_SIGNAL(src, COMSIG_ATOM_HAS_GRAVITY, gravity_turf, forced_gravity)
SEND_SIGNAL(gravity_turf, COMSIG_TURF_HAS_GRAVITY, src, forced_gravity)
if(length(forced_gravity))
var/positive_grav = max(forced_gravity)
var/negative_grav = min(min(forced_gravity), 0) //negative grav needs to be below or equal to 0
//our gravity is sum of the most massive positive and negative numbers returned by the signal
//so that adding two forced_gravity elements with an effect size of 1 each doesnt add to 2 gravity
//but negative force gravity effects can cancel out positive ones
return (positive_grav + negative_grav)
var/area/turf_area = gravity_turf.loc
return !gravity_turf.force_no_gravity && (SSmapping.gravity_by_z_level[gravity_turf.z] || turf_area.has_gravity)
/**
* Used to set something as 'open' if it's being used as a supplypod
*
* Override this if you want an atom to be usable as a supplypod.
*/
/atom/proc/setOpened()
return
/**
* Used to set something as 'closed' if it's being used as a supplypod
*
* Override this if you want an atom to be usable as a supplypod.
*/
/atom/proc/setClosed()
return
///Called after the atom is 'tamed' for type-specific operations, Usually called by the tameable component but also other things.
/atom/proc/tamed(mob/living/tamer, obj/item/food)
return
/**
* Used to attempt to charge an object with a payment component.
*
* Use this if an atom needs to attempt to charge another atom.
*/
/atom/proc/attempt_charge(atom/sender, atom/target, extra_fees = 0)
return SEND_SIGNAL(sender, COMSIG_OBJ_ATTEMPT_CHARGE, target, extra_fees)
///Passes Stat Browser Panel clicks to the game and calls client click on an atom
/atom/Topic(href, list/href_list)
. = ..()
if(!usr?.client)
return
var/client/usr_client = usr.client
var/list/paramslist = list()
if(href_list["statpanel_item_click"])
switch(href_list["statpanel_item_click"])
if("left")
paramslist[LEFT_CLICK] = "1"
if("right")
paramslist[RIGHT_CLICK] = "1"
if("middle")
paramslist[MIDDLE_CLICK] = "1"
else
return
if(href_list["statpanel_item_shiftclick"])
paramslist[SHIFT_CLICK] = "1"
if(href_list["statpanel_item_ctrlclick"])
paramslist[CTRL_CLICK] = "1"
if(href_list["statpanel_item_altclick"])
paramslist[ALT_CLICK] = "1"
var/mouseparams = list2params(paramslist)
usr_client.Click(src, loc, null, mouseparams)
return TRUE
/atom/MouseEntered(location, control, params)
SSmouse_entered.hovers[usr.client] = src
/// Fired whenever this atom is the most recent to be hovered over in the tick.
/// Preferred over MouseEntered if you do not need information such as the position of the mouse.
/// Especially because this is deferred over a tick, do not trust that `client` is not null.
/atom/proc/on_mouse_enter(client/client)
SHOULD_NOT_SLEEP(TRUE)
var/mob/user = client?.mob
if (isnull(user))
return
///SKYRAT EDIT ADDITION BEGIN
// Face directions on combat mode. No procs, no typechecks, just a var for speed
if(user.face_mouse)
user.face_atom(src)
///SKYRAT EDIT ADDITION END
// Screentips
var/datum/hud/active_hud = user.hud_used
if(!active_hud)
return
var/screentips_enabled = active_hud.screentips_enabled
if(screentips_enabled == SCREENTIP_PREFERENCE_DISABLED || flags_1 & NO_SCREENTIPS_1)
active_hud.screentip_text.maptext = ""
return
active_hud.screentip_text.maptext_y = 10 // 10px lines us up with the action buttons top left corner
var/lmb_rmb_line = ""
var/ctrl_lmb_ctrl_rmb_line = ""
var/alt_lmb_alt_rmb_line = ""
var/shift_lmb_ctrl_shift_lmb_line = ""
var/extra_lines = 0
var/extra_context = ""
if(isliving(user) || isovermind(user) || isaicamera(user) || (ghost_screentips && isobserver(user)))
var/obj/item/held_item = user.get_active_held_item()
if (flags_1 & HAS_CONTEXTUAL_SCREENTIPS_1 || held_item?.item_flags & ITEM_HAS_CONTEXTUAL_SCREENTIPS)
var/list/context = list()
var/contextual_screentip_returns = \
SEND_SIGNAL(src, COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM, context, held_item, user) \
| (held_item && SEND_SIGNAL(held_item, COMSIG_ITEM_REQUESTING_CONTEXT_FOR_TARGET, context, src, user))
if (contextual_screentip_returns & CONTEXTUAL_SCREENTIP_SET)
var/screentip_images = active_hud.screentip_images
// LMB and RMB on one line...
var/lmb_text = build_context(context, SCREENTIP_CONTEXT_LMB, screentip_images)
var/rmb_text = build_context(context, SCREENTIP_CONTEXT_RMB, screentip_images)
if (lmb_text != "")
lmb_rmb_line = lmb_text
if (rmb_text != "")
lmb_rmb_line += " | [rmb_text]"
else if (rmb_text != "")
lmb_rmb_line = rmb_text
// Ctrl-LMB, Ctrl-RMB on one line...
if (lmb_rmb_line != "")
lmb_rmb_line += "<br>"
extra_lines++
if (SCREENTIP_CONTEXT_CTRL_LMB in context)
ctrl_lmb_ctrl_rmb_line += build_context(context, SCREENTIP_CONTEXT_CTRL_LMB, screentip_images)
if (SCREENTIP_CONTEXT_CTRL_RMB in context)
if (ctrl_lmb_ctrl_rmb_line != "")
ctrl_lmb_ctrl_rmb_line += " | "
ctrl_lmb_ctrl_rmb_line += build_context(context, SCREENTIP_CONTEXT_CTRL_RMB, screentip_images)
// Alt-LMB, Alt-RMB on one line...
if (ctrl_lmb_ctrl_rmb_line != "")
ctrl_lmb_ctrl_rmb_line += "<br>"
extra_lines++
if (SCREENTIP_CONTEXT_ALT_LMB in context)
alt_lmb_alt_rmb_line += build_context(context, SCREENTIP_CONTEXT_ALT_LMB, screentip_images)
if (SCREENTIP_CONTEXT_ALT_RMB in context)
if (alt_lmb_alt_rmb_line != "")
alt_lmb_alt_rmb_line += " | "
alt_lmb_alt_rmb_line += build_context(context, SCREENTIP_CONTEXT_ALT_RMB, screentip_images)
// Shift-LMB, Ctrl-Shift-LMB on one line...
if (alt_lmb_alt_rmb_line != "")
alt_lmb_alt_rmb_line += "<br>"
extra_lines++
if (SCREENTIP_CONTEXT_SHIFT_LMB in context)
shift_lmb_ctrl_shift_lmb_line += build_context(context, SCREENTIP_CONTEXT_SHIFT_LMB, screentip_images)
if (SCREENTIP_CONTEXT_CTRL_SHIFT_LMB in context)
if (shift_lmb_ctrl_shift_lmb_line != "")
shift_lmb_ctrl_shift_lmb_line += " | "
shift_lmb_ctrl_shift_lmb_line += build_context(context, SCREENTIP_CONTEXT_CTRL_SHIFT_LMB, screentip_images)
if (shift_lmb_ctrl_shift_lmb_line != "")
extra_lines++
if(extra_lines)
extra_context = "<br><span class='subcontext'>[lmb_rmb_line][ctrl_lmb_ctrl_rmb_line][alt_lmb_alt_rmb_line][shift_lmb_ctrl_shift_lmb_line]</span>"
//first extra line pushes atom name line up 11px, subsequent lines push it up 9px, this offsets that and keeps the first line in the same place
active_hud.screentip_text.maptext_y = -1 + (extra_lines - 1) * -9
if (screentips_enabled == SCREENTIP_PREFERENCE_CONTEXT_ONLY && extra_context == "")
active_hud.screentip_text.maptext = ""
else
//We inline a MAPTEXT() here, because there's no good way to statically add to a string like this
active_hud.screentip_text.maptext = "<span class='context' style='text-align: center; color: [active_hud.screentip_color]'>[name][extra_context]</span>"
/**
* This proc is used for telling whether something can pass by this atom in a given direction, for use by the pathfinding system.
*
* Trying to generate one long path across the station will call this proc on every single object on every single tile that we're seeing if we can move through, likely
* multiple times per tile since we're likely checking if we can access said tile from multiple directions, so keep these as lightweight as possible.
*
* For turfs this will only be used if pathing_pass_method is TURF_PATHING_PASS_PROC
*
* Arguments:
* * to_dir - What direction we're trying to move in, relevant for things like directional windows that only block movement in certain directions
* * pass_info - Datum that stores info about the thing that's trying to pass us
*
* IMPORTANT NOTE: /turf/proc/LinkBlockedWithAccess assumes that overrides of CanAStarPass will always return true if density is FALSE
* If this is NOT you, ensure you edit your can_astar_pass variable. Check __DEFINES/path.dm
**/
/atom/proc/CanAStarPass(to_dir, datum/can_pass_info/pass_info)
if(pass_info.pass_flags & pass_flags_self)
return TRUE
. = !density