Files
Bubberstation/code/modules/research
_0Steven 9741d78233 Refactors a large chunk of xenobio console code. (#91628)
## About The Pull Request

So a previous pr of mine caused #91625, because xenobio consoles
actually implement their own weird shift click signals:

9447820886/code/modules/research/xenobiology/xenobio_camera.dm (L389-L398)
So! I decided I might as well clean up some of the related code!
...And then I continued doing so, as I found more issues.

Anyhow, this is broadly just a cleanup of some old code, trying to avoid
some of the older issues.

Notable changes:
- We no longer keep a list of all connected xenobio consoles on the
monkey recycler, and instead use weakrefs on the xenobio console. Much
cleaner, and lets us easily avoid some of the bugs not properly the old
system not properly cleaning up after itself had caused.
- There was a lot of unnecessary getting of the user's remote control
eye followed by getting the associated xenobio console followed by
calling procs on that var:
9447820886/code/modules/research/xenobiology/xenobio_camera.dm (L408-L412)
This tries to minimize that to places where it's actually necessary, and
moves getting the `remote_eye` to the `validate_area(...)` proc itself.
This is now called `validate_turf(...)`, and no longer has the eye
parameter.
- A lot of `to_chat(...)` messages have been kept, just supplemented
with balloon alerts, because the additional information oftentimes feed
better to have.
- `attackby(...)` has been refactored to `item_interaction(...)` and
split into three `[item]_act(...)` procs.
- The click interactions have all been renamed into snake_case into the
format of `[type]_click_[target](...)`, with a core signal handler proc
selecting between such based on the clicked target. Good riddance
`COMSIG_XENO_SLIME_CLICK_SHIFT` and `COMSIG_XENO_TURF_CLICK_SHIFT`
- Moved checking for the connected recycler to a new
`can_recycle_monkeys(...)` proc, and checking whether we can recycle a
monkey to `can_recycle_target_monkey(...)` to keep those checks in one
place, instead of scattered wherever. For similar reasons the monkey
handling code has been split off into
`try_recycle_monkeys_on_turf(...)`, `try_recycle_target_monkey(...)`,
and `recycle_monkey(...)`

## Why It's Good For The Game

Fixes #91625.
Less jank.

## Changelog

🆑
refactor: Refactored xenobio console item interaction and click code.
Please report any issues!
fix: When using the xenobio console, you no longer examine slimes/turfs
when trying to deposit or pick up slimes.
fix: Xenobio consoles properly check whether the turf they're
interacting with is visible to cameras when deciding whether to block
interaction, rather than whether the turf of the remote control eye
itself is obscured by static.
fix: Using a xenobio console and ctrl-clicking on a tile with dead
monkeys on it without a connected monkey recycler no longer runtimes.
fix: Destroying a monkey recycler that was once linked to a xenobio
console but no longer is no longer disconnects the currently linked
monkey recycler from those xenobio consoles.
fix: Multiple monkey recyclers mapped into the same xenobiology area no
longer enter a weird state of half-connection with the mapped in xenobio
consoles.
qol: Adds screentips to the xenobio console's item interactions.
qol: More xenobio console item or click interactions have balloon alert
feedback.
/🆑
2025-07-11 18:04:56 -04:00
..
2025-06-26 20:12:17 -04:00