Commit Graph

69 Commits

Author SHA1 Message Date
Jeremiah
8e3f635b98 Alt click refactor (#82656)
## About The Pull Request
Rewrites how alt click works. 
Based heavily on #82625. What a cool concept, it flows nicely with
#82533.

Fixes #81242 
(tm bugs fixed)
Fixes #82668

<details><summary>More info for devs</summary>

Handy regex used for alt click s&r:
`AltClick\((.*).*\)(\n\t.*\.\.\(\))?`
`click_alt($1)` (yes I am aware this only copies the first arg. there
are no other args!)

### Obj reskins
No reason for obj reskin to check on every single alt click for every
object. It applies to only a few items.
- Moved to obj/item
- Made into signal
- Added screentips

### Ventcrawling
Every single atmospherics machine checked for ventcrawling capability on
alt click despite only 3 objects needing that functionality. This has
been moved down to those individual items.
</details>

## Why It's Good For The Game
For players: 
- Alt clicking should work more logically, not causing double actions
like eject disk and open item window
- Added context menus for reskinnable items
- Removed adjacency restriction on loot panel

For devs:
- Makes alt click interactions easier to work with, no more click chain
nonsense and redundant guard clauses.
- OOP hell reduced
- Pascal Case reduced
- Glorious snake case

## Changelog
🆑
add: The lootpanel now works at range.
add: Screentips for reskinnable items.
fix: Alt click interactions have been refactored, which may lead to
unintentional changes to gameplay. Report any issues, please.
/🆑
2024-04-16 17:48:03 -06:00
san7890
c403a6eccc Wraps lowertext() to ensure proper stringification. (#82442)
## About The Pull Request

Fixes #82440

This PR just creates a new macro, `LOWER_TEXT()` (yes the irony is not
lost on me) to wrap around all calls of `lowertext()` and ensure that
whatever we input into that proc will be stringified using the `"[]"`
(or `tostring()` for the nerds) operator. very simple.

I also added a linter to enforce this (and prevent all forms of
regression) because I think that machines should do the menial work and
we shouldn't expect maintainers to remember this, let me know if you
disagree. if there is a time when it should be opted out for some
reason, the linter does respect it if you wrap your input with the
`UNLINT()` function.
2024-04-10 12:19:43 -07:00
MrMelbert
0dc6b71a87 Change setting item weight class to a setter to patch some weight class related shenanigans (#82494)
## About The Pull Request

Fixes #81052 
Fixes #58008

Setting weight class of items is now done via `update_weight_class`.

I updated as many occurrences of manually setting `w_class` as I could
find but I may have missed some. Let me know if you know of any I
missed.

This is done to allow datums to react to an item having its weight class
changed.

Humans and atom storage are two such datums which now react to having an
item in its contents change weight class, to allow it to expel items
that grow to a weight class beyond what is normally allowed.

## Changelog

🆑 Melbert
fix: You can't fit items which are normally too large for a storage by
fitting it in the storage when it is small, then growing it to a larger
size.
/🆑
2024-04-08 19:01:30 -06:00
SyncIt21
33234b5037 Storage items won't hold abstract/hologram items (#82132)
## About The Pull Request
- Fixes #82019

Yeah you can't put stuff that don't exist inside storage items that
actually exist.

## Changelog
🆑
fix: abstract(like the dual hand thingy on your hand) & hologram things
can't be put inside storage items
/🆑

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
2024-03-26 14:58:13 -06:00
ViktorKoL
1f2bf04e75 fix return_inv() returning a null sometimes, causing get_all_gear() to runtime (#81344)
## About The Pull Request

Fixes the return_inv() proc of datum/storage returning a null in
addition to inventory items. This caused get_all_gear() proc of
mob/living to runtime at times, because it would try to recursively
access a null's inventory...
## Why It's Good For The Game

Bugs bad.
## Changelog
🆑
fix: fix heretic's rust mark failing to damage any items if the victim
has any container on them with another item inside, and maybe other bugs
of similar nature
/🆑
2024-02-08 22:37:14 +01:00
MrMelbert
12afcb911e Comprehensive cleanup of storage datum, replaces the weakrefs with just refs (because they were managed already) (#81120)
## About The Pull Request

- Large amount of storage datum cleanup.
   - Documentation.
   - Maybe more consistent use of parent vs real_location. 
   - Removes the weakrefs, replaces it with just references.
      - These were already managed references anyways so why bother?
- Removes a bunch of arguments no one used and would ever used so only
the most useful args are left.
 
- Some bugfixes. 

## Why It's Good For The Game

Aiming to make storage easier to work with. The whole intent of this was
to bugfix the whole "weight class" thing that keeps popping up but I had
to do this first.

## Changelog

🆑 Melbert
fix: When placing an item into storage (such as backpacks), all nearby
mobs now get a message, rather than just the first mob.
fix: TGC decks of cards should act a bit less odd when looking inside.  
refactor: Refactored a bit of storage, cleaned up a fair bit of its
code. Let me know if you notice anything funky about storage (like
backpacks).
/🆑
2024-02-05 11:42:03 -08:00
distributivgesetz
f8b41f9442 Changes occurrences of recieve in code to receive (#80065)
## About The Pull Request

I've stumbled across this enough to finally go through the entire
codebase and fix it. I left out changelogs simply because rewriting
history logs is bad.
## Why It's Good For The Game

I find it pretty annoying because I stumble across words that are
misspelled for a few seconds, and I'm likely not the only one who feels
like this. Less spelling mistakes in code are better.
## Changelog
🆑
spellcheck: Occurrences of "recieve" has been changed to "receive".
/🆑
2023-12-02 14:50:57 -07:00
Xackii
3b56ebf1f9 Chameleon projector can be used on storage items. (#79263)
## About The Pull Request

Fix bug that you can't use chameleon projector on items with
datum/storage(backpacks, box, holsters etc). Now you can right-click on
it to copy icon.

## Why It's Good For The Game

https://github.com/tgstation/tgstation/issues/55143#issue-749661132

## Changelog
🆑
fix: chameleon projector now can copy icon for storage items(backpacks,
box, holsters etc) using right-click on it.
/🆑
2023-10-31 14:48:33 +00:00
Fikou
e7bae1c468 surgical trays no longer animate when opened (#79192)
## About The Pull Request
it looks stupid


## Changelog
🆑
fix: surgical trays no longer animate when opened
/🆑
2023-10-23 17:23:25 -06:00
lizardqueenlexi
1b8bcd0365 Basic drones (#79109)
## About The Pull Request

Fixes #68825
Fixes #72249
Fixes #70184

Converts maintenance drones to use the basic mob framework. As drones
don't use AI, this was mostly a perfunctory conversion, but I took the
opportunity to clean up drone code a bit and fixed a few bugs.

Noteworthy changes:
- Drones now have a `can_unhack` field. This is set to FALSE on
syndrones, because unhacking them doesn't make them stop being evil but
does cause some weirdness. Syndrones are unused right now, but you never
know.
- Drones use the Dextrous component for hand-having.
- Drones no longer have an internal ID card, instead being given
all-access with the `simple_access` component.
- Picking up drones now works the same as for other mobs, instead of
pointlessly copying the code into `attack_hand`. As a consequence, it is
now possible to punch drones if you want to for some reason.
- Drones can now reboot/cannibalize dead drones without being in combat
mode.
- Cannibalizing a drone that contains a client no longer runtimes - the
client is ghosted ahead of time.
- Drones now have TRAIT_ADVANCEDTOOLUSER, allowing them to properly
interact with machines.
- Trying to screwdriver a dead drone now gives a balloon alert about why
you can't do that.

In addition to these changes, I cleaned up the code quite a bit,
organizing things better and placing more useful comments throughout.
And removing a hell of a lot of single-letter variable names.

I will note that this PR does _not_ address #72129. The issue there is
that sprites for drones-as-hats are entirely nonexistent, and I'm not a
spriter. It shouldn't be too hard to fix if someone makes dronehat
sprites, though!

## Why It's Good For The Game
Kills 8 more simple animals.

In addition to that, drones were clearly a bit neglected, so this fixes
them up a bit and makes the code a little bit clearer. Maybe not that
much clearer, but it's something. It certainly leaves them in a better
place for further work if anyone wants to do that. Plus, a bunch of bugs
and other jankiness are fixed now, which is nice.

## Changelog
🆑
refactor: Maintenance Drones now use the basic mob framework. This
shouldn't come with any noticeable gameplay changes, but please report
any bugs.
fix: Drones can now interact normally with electrified doors.
fix: Drones' built-in tools can no longer be placed in storage objects
and/or thrown on the floor.
fix: Drones can now perform right-click interactions correctly, such as
deconstructing reinforced windows.
fix: Drones can now reboot or cannibalize other drones without being in
combat mode.
/🆑
2023-10-21 23:36:48 +00:00
carlarctg
cd030b0690 Adds 'Bloody Spreader' component that bloodies everything it touches (#78743)
## About The Pull Request

Adds 'Bloody Spreader' component that bloodies everything it touches!

For example inserting an item into it if it is a storage item. Or
entering it if it's a turf, or bumping onto it, or... you get the point,
hopefully.

Added this component to the MEAT backpack, meat slabs, bouncy castles,
meateor fluff, meateor heart, and the heretic sanguine blade.

Gave most of these the blood walk component as well, which spreads blood
if it's dragged around.

Meat slabs contain a limited amount of both components, eventually they
will 'dry out'.
## Why It's Good For The Game

Meat isn't meaty and squelchy enough, this will make it meatier. It also
makes the janitor suffer.
## Changelog
🆑
code: Adds 'Bloody Spreader' component that bloodies everything it
touches!
code: For example inserting an item into it if it is a storage item. Or
entering it if it's a turf, or bumping onto it, or... you get the point,
hopefully.
add: Added this component to the MEAT backpack, meat slabs, bouncy
castles, meateor fluff, meateor heart, and the heretic sanguine blade.
add: Gave most of these the blood walk component as well, which spreads
blood if it's dragged around.
add: Meat slabs contain a limited amount of both components, eventually
they will 'dry out'.
code: Added a signal for when an item is entered into storage.
/🆑
2023-10-19 21:03:09 +02:00
YehnBeep
2b010ab599 Autopsy scanners fit in surgery trays (#78835)
## About The Pull Request

This enables surgery trays to hold autopsy scanners

<details>
<summary>
Screenshot
</summary>


![image](https://github.com/tgstation/tgstation/assets/86855173/2fb2930c-7875-417a-8a1e-03fd8b3aeb75)
(Scanner not included)

</details>

## Why It's Good For The Game

Since it is a tool used in a surgery's step, I feel it makes sense that
the autopsy tray (and surgery trays as a whole) should be able to hold
this item and it potentially means less switching between containers.

## Changelog

🆑
qol: The autopsy tray (and surgery trays) can now hold the autopsy
scanner
/🆑
2023-10-09 11:57:02 -06:00
Tim
d6f79f4427 Refactor gib code to use bitflags and have documentation (#78754)
## About The Pull Request
This takes all the gib related procs:
- `gib()`
- `spawn_gibs()` 
- `spill_organs()`
- `spread_bodyparts()`

And adds heavy documentation that communicates what the procs are used
for and how the different bitflags affect them. The difference is
noticeable:

`gib(TRUE, FALSE, FALSE, null)` vs `gib(DROP_ORGANS|DROP_BODYPARTS)`

The code is now much more legible which is important considering it's
used in a lot of places!

Another robust change, is that we had several places in the code where
there were double negatives like so:

```
/mob/living/carbon/spill_organs(no_brain, no_organs, no_bodyparts)
	if(!no_bodyparts) // DOUBLE NEGATIVES ARE BAD M'KAY?!?
		// do stuff here
```

This is a mindfuck to untangle. I inverted a lot of these parts so we
don't lose our sanity.

Last thing that was changed was a big `if()` loop in the `spill_organ()`
proc. This was refactored to just be a simple `for` loop with `continue`
statements where we needed to skip enabled bitflags. It's now shorter
and cleaner than before.

The only slight gameplay change this affects is that gibbing a mob now
guarantees to drop all items unless the `DROP_ITEMS` bitflag is
deliberately omitted. Some places like admin gib self, we don't want
this to happen.

## Why It's Good For The Game
Gib code is very old. (~15 years) People kept adding more arguments to
the procs when it should have been a bitflag initially. By doing it this
way, there is more flexibility and readability when it comes to adding
new code in the future.

## Changelog
🆑
refactor: Refactor gib code to be more robust.
qol: Gibbing a mob will result in all items being dropped instead of
getting deleted. There are a few exceptions (like admin gib self) where
this will not take place.
/🆑
2023-10-06 13:12:22 +01:00
Lamb
3c0159b143 replaces surgical and coroner duffels with surgery trays and medical carts, resprites razor (#77975)
## About The Pull Request
replaces all instances of surgical duffels with surgery trays, and all
coroner duffels with morgue surgical trays.
they contain about the same items, with surgical trays/carts also having
bone gel and tape, since their list of holdable items is much more
limited.
the surgery tray is a diagetic storage unit that displays any surgery
tool it's holding in a small, almost world-state esque form on top of
it. it can be carried around by dragging it on to yourself, but it will
slow you down like an unzipped duffel would. it can also be deployed by
activating it, and pulled around, but it will roll noisily in the
process.
currently, all tool tiers are supported - from alien, to advanced, to
cruel, to normal.

![image](https://github.com/tgstation/tgstation/assets/110322848/5b31767e-de27-4352-b2bf-89cde06a7b5c)
here you can see just a few of the possible combinations of tools -
default, default morgue, advanced, and alien. but any combination of
these tools should work together somewhat cleanly, as you can see here:

![image](https://github.com/tgstation/tgstation/assets/110322848/12ae3501-44bc-41a5-b4f4-d01c05cc6038)
also adds a medical razor variant, because otherwise they wouldn't fit
with the look of the other tools on the tray, before and after here:

![image](https://github.com/tgstation/tgstation/assets/110322848/c71af9ed-e9bb-40ff-81b8-0395d8afdf5a)
## Why It's Good For The Game
having constantly visible tool storage like this means you don't have to
worry about the one tool you need from the bag being stolen - if it is,
you can see it before an operation starts, and plan around that! it also
gives a little flexibility to mappers - if they'd like a more mobile
cart for their medbay, or if they'd like the somewhat stationary tray.
it also plain looks cool, and isn't quite as clunky as a duffelbag would
be.
## Changelog
🆑
add: adds medical carts and surgery trays
image: gives the surgery razor a unique sprite
/🆑

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: JohnFulpWillard <53777086+JohnFulpWillard@users.noreply.github.com>
Co-authored-by: Jacquerel <hnevard@gmail.com>
2023-09-04 00:58:11 +02:00
Paxilmaniac
e3a22f5e91 Reflavors the Mosin to be a surplus rifle from the past IC 200 years, rather than from 670 years ago in game. Allergy warning: May contain microscopic silverscale buff (#77169)
image: The Mosin-Nagant has been given new sprites and a reflavor, looking for the old rifle? Look for the Sakhno Precision Rifle.
balance: The tiniest balance thing, but since Silverscales use the Sakhno-Zhihao rifle, which has a scope on it, their main weapon now has a scope.
2023-08-15 00:47:32 -04:00
Ghom
0210f67241 Fixing BoH bombing being doable with just one BoH. (#77243)
## About The Pull Request
BoH-bombing is supposed to require two bags to be achievable.

## Why It's Good For The Game
Fixing an easy and amusing bug, except being the one fixing it fills me
with an ounce of remorse, so you could say it's not all that easy. This
will fix #77204.

## Changelog

🆑
fix: BoH bombing now correctly requires two bags to be done.
/🆑
2023-08-02 15:04:51 +02:00
Watermelon914
69827604c4 Improves the RPG loot wizard event. (#77218)
## About The Pull Request
As the title says. Adds a bunch more stat changes to various different
items and a somewhat simple way of modifying them whilst minimizing
side-effects as much as possible.
Added a new negative curse of polymorph suffix that can randomly
polymorph you once you pick up the item.
Curse of hunger items won't start on items that are not on a turf.
Curse of polymorph will only activate when equipped.

Bodyparts, two-handed melees, bags, guns and grenades, to name a few,
have a bunch of type-specific stat changes depending on their quality.

Some items won't gain fantasy suffixes during the RPG loot event, like
stacks, chairs and paper, to make gamifying the stats a bit harder.
I'm sure there'll still be other ways to game the event, but it's not
that big of a deal since these are the easiest ways to game it.
High level items also have a cool unusual effect aura

## Why It's Good For The Game
Makes the RPG item event cooler. Right now, it's a bit lame since
everything only gains force value and wound bonus on attack. This makes
the statistic increases more type-based and make it interesting to use

It's okay for some items to be powerful since this is a wizard event and
a very impactful one too. By making the curse of hunger items not spawn
on people, it'll also make it a less painful event too.

## Changelog
🆑
add: Expanded the RPG loot wizard event by giving various different
items their own statistic boost.
/🆑

---------

Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
2023-07-31 17:09:53 +00:00
Ghom
d9c8bd9bae [READY] Fishing and aquarium expansion. (#76531)
Listing the changes, off the top of my head:
- Resprited fishing rods, hooks, and the worm bait!
- Added a new, telescopic fishing rod, that can be bought as a goodie.
The master rod is also telescopic now.
- Added a couple hooks. One that lets you move the bait up and down,
otherwise keeping it in place, and another that stops the fish from
escaping, but slowly kills it. The former from the bepis fishing tech
node, the latter frm the black market.
- Added a fishing skill and relative legendary reward: A fishing hat,
like the one that recites "women fear me, fish fear me"
- You can now stop fishing by activating the fishing rod in your hand,
and stops it from stealing all clicks on other things if it isn't in
your active hand.
- Reworked fishing traits into fish traits, which can apply to fish
after it has been caught.
- Expanded the fish breeding system. Traits may be passed down to
offsprings, and offsprings may evolve (mutate?) into different kind of
fishes if conditions when conditions are met.
- Added half a dozen new fishes, each with its own traits: lubefish,
sludgefish (and its purple variant), slimefish, unmarine bonemass and
unmarine mastodon. Also, holodeck fish, as a joke.
- New traits: lubed skin, parthenogenesis, toxic (new reagent), toxin
immunity, predator, necrophage, no mating, crossbreeder, aggressive and
revival. Converted Emulsijack's ability and Donkfish's yuckiness into
traits as well.
- Added a fish analyzer that you can scan aquariums and fishes with.
- Fish can now be blended if you really want to. The number of reagents
from blending, w_class, and the number of fillets you get from cutting
fish now scale with size and weight.
- fish feed is no longer infinite (but it should still be plenty).
- Implemented temperature requirements for aquarium fish.
- You can now buy (dead) fish from the black market for dirt cheap.
- Last but now least, toilets are now valid fishing spots.
2023-07-27 22:50:36 +02:00
carlarctg
1e27ce031b Syndicate Duffelbag Rerework (#77060)
## About The Pull Request

Syndicate duffelbags can fit 2 extra bulky items, down from three.

Reduced syndicate duffelbag's unzipped slowdown from '1' to '0.3', and
set its zipping-up sped to 0.5, same as unzipping.

Added the following items to the Syndicate Duffelbag bulky exception
list: Greentext, mech removal tool, gibtonite, skub, golem shells, mech
ammo. Roughly sorted the list by item category.

Fixed the syndie surgery duffelbag having more items than it can hold by
removing the redundant surgical drill (Upgraded cauteries can turn into
one anyways)

Any storage item with a can_hold description can be examined twice to
see what it can hold now.

## Why It's Good For The Game

> Syndicate duffelbags can fit 2 extra bulky items, down from three.

> Reduced syndicate duffelbag's unzipped slowdown from '1' to '0.3', and
set its zipping-up sped to 0.5, same as unzipping.

For most intents and purposes, it seems the syndicate duffelbag has gone
from 'bland upgrade to backpack', to 'useless'. This is especially made
apparent because it isn't exactly shown to the player that these
duffelbags can carry bulky items (I didn't even know about it until I
was making this PR!)

The extra bulky item hold concept is great, but I have my issues with
the item as-is that I seek to fix with this PR. There are TONS of issues
with being unable to access your bag quickly, which is twice as relevant
when your bag is an incredibly conspicious traitor item. Sure, you can
have it in your hand, but then why even have it in the first place?

That's why I want to reduce the slowdown significantly. '1' slowdowns
are thrown around the whole game like they're reasonable (galoshes,
water back-tanks, biosuits) - they aren't. '1' slowdown is CRIPPLING. It
makes you frustratingly slow and effectively destroys any combat
maneuvering you can do. This is very relevant for a traitorious item.

The zip speed helps one use the duffelbag as a storage item dynamically,
letting the item be an actual trade-off rather than mostly a downside.
Gives you a reason to use it rather than just buying a smuggler satchel
for more storage.

Of course these are some hefty buffs, so I lowered the bulky storage to
make up for it. I can bring it back up to 3 if wanted.

> Added the following items to the Syndicate Duffelbag bulky exception
list: Greentext, mech removal tool, gibtonite, skub, golem shells, mech
ammo. Roughly sorted the list by item category.

Some traitorious items that felt like they should be allowed in.
Honestly, I think this shouldn't even be an exception hold except for
blacklisting clearly bonkers things like backpacks, but whatevs.

> Any storage item with a can_hold description can be examined twice to
see what it can hold now.

Generalization is awesome. Hardcoding is cringe!

## Changelog

🆑
balance: Syndicate duffelbags can fit 2 extra bulky items, down from
three.
balance: Reduced syndicate duffelbag's unzipped slowdown from '1' to
'0.3', and set its zipping-up sped to 0.5, same as unzipping.
add: Added the following items to the Syndicate Duffelbag bulky
exception list: Greentext, mech removal tool, gibtonite, skub, golem
shells, mech ammo. Roughly sorted the list by item category.
fix: Fixed the syndie surgery duffelbag having more items than it can
hold by removing the redundant surgical drill (Upgraded cauteries can
turn into one anyways)
qol: Any storage item with a can_hold description can be examined twice
to see what it can hold now.
fix: The parent crayon's name is 'crayon' to prevent any weirdness with
things that show the parent type's name.
/🆑
2023-07-26 17:43:22 +01:00
Lufferly
2eb0c65743 balloon alerts for storage failures (#76779)
## About The Pull Request

Adds some balloon alerts for when you fail to put something in storage
items (when there is not enough room, item is too big, etc.)
Also adds some balloon alerts for when you fail with a duffelbag (if
it's zipped it will say "closed!", and failure alerts if you move when
zipping/unzipping)

## Why It's Good For The Game

Balloon alerts are immediately obvious and leave no residue, which is
good for failing to put something into a bag, as you probably don't
really care to look back on it in the future, and want to immediately
know why you cant put it in. I chose not to add balloon alerts for
putting things in storage successfully for a couple reasons. For balloon
alerts, they would be too long, but they hold fairly useful information
so I don't want to cut down the messages. Also just having something
like "placed" looked really bad in my opinion. I also can see what you
or others put in their bag theoretically being useful to look back on. I
think the compromise of storage failures and successes being held in
different places (balloon alerts vs in chat) is fine, but if others
disagree I can change it or just close this.

## Changelog

🆑 Seven
qol: Added some balloon alerts for failing to place items in storage
containers
/🆑

---------

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2023-07-19 10:09:17 +02:00
John Willard
06ca7a4481 Hud screens now set hud owner in Initialize. (#76772)
## About The Pull Request

Adds an arg in huds' screens to add the hud owner in the Initialize,
instead of manually setting it every time we need to.
This is already done in ``New()`` for lobby screens, which I left intact
as lobby screens are used for new players, and are given out before
atoms are Initialized. Everything else, however, uses Initialize, so it
does not mess with any other args in their own Initializes (like the
Escape menu).
This also allows us to set the screens' HUDs as a private var, to ensure
this won't be messed with in the future.
Lastly I replaced instances of ``client`` with ``cannon_client`` to be
consistent with a lot of other parts of hud code.

## Why It's Good For The Game

Huds are easy to break when they do not have a hud owner, and for
something as important as that I believe it should be something you
opt-out of when you don't want it, rather than something you opt-into by
manually setting hud owner every time.
This cuts down on a lot of copy paste in hud code for humans, aliens,
etc.

## Changelog

🆑
refactor: Huds now have their hud owner set in Initialize
/🆑
2023-07-16 21:00:22 +02:00
LemonInTheDark
8c2c72b0ed Duiffel Spotfix (#76442)
## About The Pull Request

Gives duffelbags their proper slot count
They inherited this from backpacks, but I sorta just forgot about that

[Creates "levels" of locked objects, uses that to make locked duffels
work](c613c00f62)

[c613c00](c613c00f62)

Turns locked into something that holds defines, this makes life a lot
easier.
Requires a lot of boilerplate because of how many uses of these procs
there are and all the passthrough and shit.

Adds a few outfit subtypes to avoid this class of failure in future.

Renames the args in a few but not all touched procs, one thing at a time

Closes #76407
Closes #76430 Had the lock check in the wrong place
Closes #76441 GOD I HATE TK SO MUCH

Wrote half the pr without glasses so if it's weird gimme some grace
yeah?

## Changelog
🆑
fix: Fixes some fuck with duffelbags, them not holding enough + issues
with spawning gear in them (job shit and all)
/🆑
2023-07-01 15:36:26 +01:00
LemonInTheDark
03c964ac45 Reworks Duffel Bags (Zippers) (#76313)
## About The Pull Request

Reworks duffel bags in line with oranges proposed plan.


![image](https://github.com/tgstation/tgstation/assets/58055496/126743dd-d7b8-47e0-bdd8-a0caec39c515)

Basically, instead of just making you slower all the time, they make you
slower while you have them open, but give you the same speed while
they're closed.
As a trade off, opening and closing them takes time, 2.1 seconds
(matches the sound) and 0.5 respectively.


https://github.com/tgstation/tgstation/assets/58055496/555d2cd0-038e-4b0b-a693-0c66dac16f5b

[Adds support for limiting extra storage, uses it to make syndie stuff
cool](d0b2bbf937)

[d0b2bbf](d0b2bbf937)

Syndicate bags currently ignore downsides by just ignoring the slowdown,
but that's kinda boring so let's just buff em instead.

They now support holding a limited amount of bulky items (3), filtered
down to things that would otherwise constitute going loud (or otherwise
be useful to carry around as a loudish traitor)

I may have gone a bit overboard on what I whitelisted here, lemme know
yeah?

I also did some fenangling with backpack uses of create_storage, I don't
like this pattern it was a bad idea I think.

## Why It's Good For The Game

I'm unsure if these delays enough, I think any length of time is decent
since it means you need to stop moving and focus on it for a bit.
My hope is this will make them a proper sidegrade, rather then something
that goes unused/acts as newbie bait

## Changelog
🆑
balance: Duffelbags will now only make you slow while they are unzipped.
As a tradeoff, you now need to stand still and zip/unzip them to access
their contents/not move real slow.
/🆑

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
2023-06-29 21:44:09 +12:00
Ghom
6b007f758b Replaces ammo_casing/caseless and bullet/reusable with elements. (#76335)
The reusable and caseless types only purposes are the behaviors of
deleting the casing when fired and spawning a new object when the
projectile ultimately reaches its maximum range or hits a target, both
of which are easily "elementizable". Also, I don't like those barely
filled sub-folders in the projectile module, and the fact we've
divergent reusable and single use arrow types.
2023-06-28 01:14:59 +00:00
LemonInTheDark
ae5a4f955d Pulls apart the vestiges of components still hanging onto signals (#75914)
## About The Pull Request

Signals were initially only usable with component listeners, which while
no longer the case has lead to outdated documentation, names, and a
similar location in code.

This pr pulls the two apart. Partially because mso thinks we should, but
also because they really aren't directly linked anymore, and having them
in this midstate just confuses people.

[Renames comp_lookup to listen_lookup, since that's what it
does](102b79694f)

[Moves signal procs over to their own
file](33d07d01fd)

[Renames the PREQDELETING and QDELETING comsigs to drop the parent bit
since they can hook to more then just comps
now](335ea4ad08)

[Does something similar to the attackby comsigs (PARENT ->
ATOM)](210e57051d)

[And finally passes over the examine
signals](65917658fb)

## Why It's Good For The Game

Code makes more sense, things are better teased apart, s just good imo

## Changelog
🆑
refactor: Pulled apart the last vestiges of names/docs directly linking
signals to components
/🆑
2023-06-09 06:14:31 +00:00
SyncIt21
bb6aee565f Bluespace poly crystals can be used to complete machine frames (#75692)
## About The Pull Request
Fixes #47650

Either by hand or by RPED you can now use blue space poly crystal to
finish a machine. If you are using a RPED then it will attempt to look
for singular bluespace crystals first and only if it cannot find it will
it then look for the bluespace poly crystals

Also removed some redundant types from the RPED allowed bluespace types
list cause they were not necessary

## Changelog
🆑
fix: bluespace poly crystals can be used to complete machine frames
either by hand or by RPED
/🆑
2023-05-31 14:31:03 -04:00
Andrew
e884b1da73 Spess army knife (#75537)
Adds a rare maintenance loot - Spess Knife which is a tool that can be
transformed into screwdriver, knife, wirecutters... and others by
accident.
2023-05-29 20:33:36 +00:00
carlarctg
2a8869abf1 Shoe storage can now fit box cutters, pills, and toy pistol magazines. (#74762)
## About The Pull Request

Shoe storage can now fit box cutters, pills, and toy pistol magazines.

All of these have better-or-equal similar items that can already be
fitted in.

Box cutters - Switchblades (Better in every way)
Pills - Syringes and Medipens (Mostly sidegrades)
Toy magazines - Actual pistol magazines
## Why It's Good For The Game

More stuff you can shove into your shoes, consistency with similar
items. Honestly I'm not too fond of this strange whitelist system,
wouldn't a blacklist be better and more intuitive?

If there's any items you want me to add, comment below with them.
## Changelog
🆑
qol: Shoe storage can now fit box cutters, pills, and toy pistol
magazines.
/🆑
2023-04-17 20:54:00 -06:00
NamelessFairy
8a45b50254 Fixes two bugs with removing cards from a tgc deck. (#74658)
## About The Pull Request

Fixes: #72697

Fixes transferring cards to a binder resulting in zero card decks.
Fixes transferring cards to the floor not working at all.
## Why It's Good For The Game

Bugfixes!
## Changelog
🆑
fix: Removing cards from TGC decks by pouring them on the floor/into
binders should now function correctly.
/🆑
2023-04-12 21:36:14 -06:00
Jacquerel
966b8e5fd8 March into Mapness: Meateor (#74070) 2023-03-31 19:40:29 -07:00
LemonInTheDark
33d9a0338f Reworks trashbags slightly (#73761)
## About The Pull Request

I'm a bit sad about the state of trashbags. 
They're very clunky to use, so they almost never get touched. S
depressing. Let's try and fix that.

Let's make em fit in the belt slot (again), but as a tradeoff we'll make
it harder to pull one thing from your bag.
We'll give it a say, 1.5 second delay, so you can't quickdraw from em.
If you try and dump them out into something else, we'll throw any
spillover on the ground below you

I'm also doing some general code cleanup here. Making procs more
readable, vars more direct, removing some old legacy stuff.
I've added a remove_single proc to hook into via subtype, which takes a
mob as input. this has required placing extra requirement on some helper
procs, but fortunately it's not something they're unable to meet.

My hope is this will make garbage bags usable without being stupid.

## Why It's Good For The Game

I don't see these get used at all, cause they're a pain to carry around.
They got gimped because people were using them as infinite storage for
shotgun shells and other small items.
I've made using them for this sort of thing hard and slow, so I think we
oughta be fine. If not I'll do some more touching, maybe give the
autodrop a delay.

## Changelog
🆑
balance: The janitor's trashbag now fits on his belt. In exchange,
taking something out of it sends a visible message, and has a delay.
/🆑

---------

Co-authored-by: san7890 <the@san7890.com>
2023-03-14 16:39:24 -06:00
Tim
a1ada2c9ef Refactor, improve, and rename canUseTopic to be can_perform_action (#73434)
This builds on what #69790 did and improved the code even further.
Notable things:
- `Topic()` is a deprecated proc in our codebase (replaced with
Javascript tgui) so it makes sense to rename `canUseTopic` to
`can_perform_action` which is more straightforward in what it does.
- Positional and named arguments have been converted into a easier to
use `action_bitflag`
- The bitflags adds some new checks you can use like: `NEED_GRAVITY |
NEED_LITERACY | NEED_LIGHT` when you want to perform an action.
- Redundant, duplicate, or dead code has been removed.
- Fixes several runtimes where `canUseTopic` was being called without a
proper target (IV drips, gibber, food processor)
- Better documentation for the proc and bitflags with examples
2023-02-16 20:22:14 -05:00
NamelessFairy
9907bc2032 Fixes belts not updating their overlays when transferring their contents to another storage item. (#73251)
## About The Pull Request

When you drag and drop a belt to another storage item it transfers all
its contents but retains its overlays. This PR calls update appearance
at the end of storage to storage transfers so this shouldn't occur
again.
## Why It's Good For The Game

Bug fix, belts appearing to have things on them which they don't is bad.
## Changelog
🆑
fix: Transferring objects from a belt to another storage object now
removes those objects from the belts visuals.
/🆑
2023-02-06 12:57:30 -07:00
SyncIt21
6465c632b2 RPED can pick up & install circuit boards in machine frames (#72540) 2023-01-10 01:09:47 -08:00
Hatterhat
46b114dc3b RPED tier-based parts dumping (#72386)
## About The Pull Request

![image](https://user-images.githubusercontent.com/31829017/210158760-9784fc06-f49c-45a3-b020-23c54507d471.png)
Dumping out an RPED (by using it inhand - clickdrag dumping unaffected)
causes it to calculate and drop the lowest tier of parts. Emptying
further can be done by just using it inhand more.

Directly inspired by
https://github.com/Citadel-Station-13/Citadel-Station-13/pull/13763.

The implementation probably sucks. I know I was told to use an
associated list but then I forgot how to approach that and decided to
slap together the current implementation. Sorry.


https://user-images.githubusercontent.com/31829017/210158742-cae83430-bd9f-407f-a0fa-f11975d15d4c.mp4

## Why It's Good For The Game
Decluttering your part exchanger is as easy as pressing Z or whatever
you do to dump out a storage item inhand.

## Changelog
🆑
qol: Rapid Part Exchange Devices and their bluespace variants now
automatically drop their current lowest tier of parts, instead of all of
their parts.
/🆑

Co-authored-by: Hatterhat <Hatterhat@users.noreply.github.com>
2023-01-06 17:29:49 -08:00
Wallem
a2aa79a242 Right-clicking a Cigarette pack takes out a cigarette, while Alt-Clicking takes out a lighter (if there is one) (#72104)
## About The Pull Request
Right-clicking a Cigarette pack takes out a cigarette, while
Alt-Clicking takes out a lighter. If there's no lighter, then it just
takes out a cigarette instead.
## Why It's Good For The Game
Currently, if you put your lighter in the cigarette pack, then trying to
fish it out requires you to take out the packet and mill through all the
cigarettes until you get to the lighter.
This fixes that while still keeping the quick and easy functionality.

## Changelog
🆑 Wallem
qol: Smokers rejoice, you no longer need to mill through your cigarette
packet to get your lighter out. Alt-Click a cigarette packet to extract
a lighter from it, if you've put it in there. Right-Clicking will still
take out a cigarette.
/🆑
2022-12-27 19:53:24 -08:00
Fikou
6a23bce095 premium internals now increase the slots of your internals box (#71440)
## About The Pull Request
premium internals boxes from the station trait now get 2 more slots and
have a slightly bigger sprite
also lowers the trait's weight a bit, making it equal to most other
traits.

![image](https://user-images.githubusercontent.com/23585223/203337272-ea75ae4b-111e-4adb-8598-c9cba4c4e47b.png)


## Why It's Good For The Game
the main reason im doing this is because this trait messes with anything
people wanna do to survival boxes, cause it takes up 2 slots, so you
have to account for that whenever youre making a subtype that you wanna
fill with more stuff, you cant really do that (currently an issue with
the nukie medical pr)
the other reason is station traits should affect the gameplay a bit more
than "wow i have 2 items i can normally get from an emergency toolbox",
a larger box doesnt change that much but its something.

## Changelog
🆑
balance: premium internals station trait now increases the slots of your
internals box
/🆑
2022-11-25 11:35:50 -08:00
SyncIt21
00544e5e91 RPED can now install certain stack components and display more verbose part information (#71102)
**Note :** Rehashed & cleaned up version of PR
[#71064](https://github.com/tgstation/tgstation/pull/71064). That one
contained unrelated commits and was so bad to the point it had be
labeled with DNM. This is the clean version of it.

## About The Pull Request
Rapid part exchange device RPED & Bluespace version of it BRPED can now

A) pick up 4 types of materials
  - glass sheets[max 30]
  - plasteel[max 30]
  - cable coil[max 30]
- Bluespace[ore,refined,artificial,stack] total sum of all these should
not exceed 30
 and install them in an incomplete machine frame

B)display more verbose part information[number of parts for each type
including for stack components]

## Why It's Good For The Game

A)Some machines types such as

- [thermo
machines](https://tgstation13.org/wiki/Machines#Freezer.2FHeater)
- [electrolyzers](https://tgstation13.org/wiki/Machines#Electrolyzer)
- crystallizer=10 cable pieces , 10 glass sheets , 5 plasteel sheets

All require either cable ,glass or plasteel. Usually you have to carry
these components inside your backpack which occupy space there and later
take it out from there and install it manually by hand and then use RPED
or BRPED on the machine frame.

This feature now combines these 2 steps into 1 step thus making
installing machine frames much faster and you also saves space inside
your backpack as these are now carried inside the RPED itself

You need to insert the exact stack type capacity available inside the
RPED for it to work i.e. if you pick up 5 glass sheets then later you
need a stack of exactly 25 glass sheets to complete the stack. This is
easier from a coding perspective so we don't have to deal with
subtracting & updating appearances of the remaining stack on the ground
or the user hand.

B) When using the RPED or BRPED to display machine part information
these are the new formats

Using an RPED on an thermo machine
![Screenshot
(42)](https://user-images.githubusercontent.com/110812394/199978302-bf2e16a8-4f73-4467-be60-4a4fa2ef6468.png)

Using an RPED on the crystallizer
![Screenshot
(43)](https://user-images.githubusercontent.com/110812394/199978628-6fb0bf2b-978c-490d-a2e1-e5d1d72b460d.png)

##Change Log
🆑
add: checks while inserting stack materials into an RPED and their
amounts
code: sorting of RPED part components to sort stack materials by their
ratings
del: old way of displaying parts when clicking on an machine frame with
it
add:new way of displaying part info which displays number of parts
including for stack materials
/🆑

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2022-11-24 20:43:42 +00:00
Fikou
eb06b4c841 you get access to the next storage ui row 1 item earlier (#71445)
## About The Pull Request
the next ui storage row spawns when your last row is full, rather than
when theres enough items that its needed

![image](https://user-images.githubusercontent.com/23585223/203356246-afab63f8-a302-4f0c-a1ff-cadd45da32bc.png)
not when its full or missing slots though

![image](https://user-images.githubusercontent.com/23585223/203357844-14a4b80e-26dd-4814-98b9-1556e0a95e29.png)

![image](https://user-images.githubusercontent.com/23585223/203357904-54c499e5-8003-4bd2-a757-26bb6bc53e1d.png)


## Why It's Good For The Game
its annoying especially with the doctors special medkit, cause youll be
storing stuff in it and if you take out enough items to where its just 7
left, the row closes and you need to go back to the backpacks storage ui
to put stuff back in

## Changelog
🆑
qol: you get access to the next storage ui row 1 item earlier
/🆑
2022-11-23 11:01:59 -08:00
Mothblocks
fa7688d043 Save 0.6-0.7s of init time by splitting registering lists of signals into its own proc, and optimizing QDELETED (#71056)
- Makes QDELETED use isnull(x) instead of !x, giving about 0.2 to 0.25s
of speed.
- Make disposal constructs only update icon state rather than go through
expensive overlay code. Unfortunately did not have much effect, but is
something they should've been doing nonetheless.
- Makes RegisterSignal only take signals directly as opposed to
allocating a fresh list of signals. Very few consumers actually used
this and it costs about 0.4s. Also I think this is just a bad API anyway
and that separate procs are important

`\bRegisterSignal\((.*)list\(` replaced with `RegisterSignals($1list(`
2022-11-22 07:40:05 +00:00
AnturK
4d6a8bc537 515 Compatibility (#71161)
Makes the code compatible with 515.1594+

Few simple changes and one very painful one.
Let's start with the easy:
* puts call behind `LIBCALL` define, so call_ext is properly used in 515
* Adds `NAMEOF_STATIC(_,X)` macro for nameof in static definitions since
src is now invalid there.
* Fixes tgui and devserver. From 515 onward the tmp3333{procid} cache
directory is not appened to base path in browser controls so we don't
check for it in base js and put the dev server dummy window file in
actual directory not the byond root.
* Renames the few things that had /final/ in typepath to ultimate since
final is a new keyword

And the very painful change:
`.proc/whatever` format is no longer valid, so we're replacing it with
new nameof() function. All this wrapped in three new macros.
`PROC_REF(X)`,`TYPE_PROC_REF(TYPE,X)`,`GLOBAL_PROC_REF(X)`. Global is
not actually necessary but if we get nameof that does not allow globals
it would be nice validation.
This is pretty unwieldy but there's no real alternative.
If you notice anything weird in the commits let me know because majority
was done with regex replace.

@tgstation/commit-access Since the .proc/stuff is pretty big change.

Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2022-11-15 03:50:11 +00:00
tattle
ad5debaaa1 Add investigate_deaths (#71112)
## About The Pull Request
Adds INVESTIGATE_DEATHS, an investigate category intended to better show
causes of death.


![image](https://user-images.githubusercontent.com/66640614/200142461-c17b5e51-1116-4eef-bbfb-49bc024c0953.png)


![image](https://user-images.githubusercontent.com/66640614/200147306-09bef76e-68c6-4f0a-bdf9-0211eb274e66.png)

Also makes suicide_act take a `mob/living` as an argument instead of a
`mob`, and some minor style improvements since apparently I hate
atomicity.

## Why It's Good For The Game
Inspired by a mysterious death and dusting. More logging and leads for
admins investigating deaths.

Also fixes #59028

## Changelog
🆑 Tattle
admin: added investigate deaths to shed some more light on unusual
demises, dustings, and gibbings
/🆑

Co-authored-by: tattle <article.disaster@gmail.com>
2022-11-07 16:22:37 -08:00
GuillaumePrata
c945234491 [NO GBP] Add a 2 second cooldown for ore bag balloon alerts (#71133)
## About The Pull Request
And removes an extra `to_chat` message for when your ore bag is full and
can't put ore in using the `silent_for_user` system.
## Why It's Good For The Game
I have been moving the chat messages that miners get bombarded every
shift away from their chat bar and into balloon alerts with the goal of
making the chat be a cleaner place for miners, as it is their only way
to interact with the station while down at lavaland.

People have been complaining that it was too much, which is fair. I've
been work on a mini rework on how ore bags function and a cleaner
feedback with ore icons falling into the bag, but I'm just not happy
with how it works now so I will restart on it.

Until I get that sorted, I added a 2 second cooldown on the balloon
alerts for picking up ore as a middle ground, it provides good feedback
for new players while not being as distracting.
## Changelog
🆑 Guillaume Prata
qol: Ore bag balloon alerts have a 2 second cooldown now and a spammy
message (hopefully the last) it send to your chat about being full was
removed
/🆑
2022-11-07 11:33:00 -08:00
GuillaumePrata
2625fb80d0 Adds a silent_for_user var to mute storage messages only for the user. (#70941)
## About The Pull Request
We have a `silent` var that makes storing/removing items from a backpack
not send a message to anyone's chat.
This adds a midway point, silent messages only for the user to cut on
spam/unnecessary messages while other players still keep them to prevent
free stealth shenanigans.

For now the only storage item I have given this new variable is the ore
bag for miners, as even with #70487 miners still have to deal with a lot
of pointless messages getting in the way of radio chatter.
## Why It's Good For The Game
Less pointless spam.
You mined the ore, you stepped on it, you get a balloon alert explaining
what happened.
There is no reason to also send the default storing/removing message to
your chat.

it can also be easily ported to other backpack/boxes/bags, I personally
would want it on basically any storage but that would hurt on new
player's feedback, so it is a conversation for another PR.
## Changelog
🆑 Guillaume Prata
qol: Ore bags are "silent" for the wearer and won't send pointless chat
messages about what has been stored/removed from it. Other players will
still get a chat message, so miners can't get away with surprise plasma
ore bombs.

/🆑
2022-11-04 01:03:07 -07:00
MrMelbert
70db96c46f Convert mouse and rat to basic mobs (#70728)
* Converts mice and rats to basic mobs

* Update paths

* Fixes

* Tweaks

* .

* Use helpers

* Unit test

* Correct the targeting

* Fixes the unit test?

* Fixes the unit test

* Docs

* update the path script with pr id

* Faction check tweak

* Review

* AHH
2022-10-28 08:49:17 -04:00
DannyBoy3642
960a245c7a Allows flasks to be stored in shoe pockets (#70680)
* Added flasks to pocket.dm shoes

Adds flasks to the valid item storage list for jackboots, clown shoes, and other similar shoes

* Added flasks to pockets.dm shoes

Adds flasks to the valid item list for storage inside jackboots, clown shoes, and similar shoes

Co-authored-by: AeronaDF <aeronadf@gmail.com>
2022-10-21 18:10:59 -04:00
GoblinBackwards
5156834f16 Fixes mining modsuit storage breaking after recharging it with plasma (#70558)
* Adds QDELETED check to inserting items to storage
2022-10-19 16:05:12 +02:00
John Willard
91f02f2a6b canUseTopic now uses TRUE/FALSE instead of defines that just say TRUE (#69790)
* canUseTopic now uses TRUE/FALSE instead of defines that just say TRUE

The most idiotic thing I've seen is canUseTopic's defines, they literally just define TRUE, you can use it however you want, it doesn't matter, it just means TRUE. You can mix and match the args and it will set that arg to true, despite the name.

It's so idiotic I decided to remove it, so now I can reclaim a little bit of my sanity.
2022-10-01 09:47:52 -07:00
John Willard
243231eb48 Properly checks flags with & instead of == (#70130)
* Makes flags properly check themselves

Byond ref: https://www.byond.com/docs/ref/#/operator/&
Basically, flags should use & instead of ==
We can have more than 1 slot on any item, so it's preferred that we do this instead. Even if it doesn't immediately fix any problems, it's something that should be the standard anyways to prevent it from ever being a problem.

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
2022-09-27 21:51:45 +00:00
LemonInTheDark
23bfdec8f4 Multiz Rework: Human Suffering Edition (Contains PLANE CUBE) (#69115)
About The Pull Request

I've reworked multiz. This was done because our current implementation of multiz flattens planes down into just the openspace plane. This breaks any effects we attach to plane masters (including lighting), but it also totally kills the SIDE_MAP map format, which we NEED for wallening (A major 3/4ths resprite of all wall and wall adjacent things, making them more then one tile high. Without sidemap we would be unable to display things both in from of and behind objects on map. Stupid.)

This required MASSIVE changes. Both to all uses of the plane var for reasons I'll discuss later, and to a ton of different systems that interact with rendering.

I'll do my best to keep this compact, but there's only so much I can do. Sorry brother.
Core idea

OK: first thing.
vis_contents as it works now squishes the planes of everything inside it down into the plane of the vis_loc.
This is bad. But how to do better?

It's trivially easy to make copies of our existing plane masters but offset, and relay them to the bottom of the plane above. Not a problem. The issue is how to get the actual atoms on the map to "land" on them properly.

We could use FLOAT_PLANE to offset planes based off how they're being seen, in theory this would allow us to create lens for how objects are viewed.
But that's not a stable thing to do, because properly "landing" a plane on a desired plane master would require taking into account every bit of how it's being seen, would inherently break this effect.

Ok so we need to manually edit planes based off "z layer" (IE: what layer of a z stack are you on).

That's the key conceit of this pr. Implementing the plane cube, and ensuring planes are always offset properly.
Everything else is just gravy.
About the Plane Cube

Each plane master (except ones that opt out) is copied down by some constant value equal to the max absolute change between the first and the last plane.
We do this based off the max z stack size detected by SSmapping. This is also where updates come from, and where all our updating logic will live.

As mentioned, plane masters can choose to opt out of being mirrored down. In this case, anything that interacts with them assuming that they'll be offset will instead just get back the valid plane value. This works for render targets too, since I had to work them into the system as well.

Plane masters can also be temporarily hidden from the client's screen. This is done as an attempt at optimization, and applies to anything used in niche cases, or planes only used if there's a z layer below you.
About Plane Master Groups

BYOND supports having different "maps" on screen at once (IE: groups of items/turfs/etc)
Plane masters cannot cover 2 maps at once, since their location is determined by their screen_loc.
So we need to maintain a mirror of each plane for every map we have open.

This was quite messy, so I've refactored it (and maps too) to be a bit more modular.

Rather then storing a list of plane masters, we store a list of plane master group datums.
Each datum is in charge of the plane masters for its particular map, both creating them, and managing them.

Like I mentioned, I also refactored map views. Adding a new mapview is now as simple as newing a /atom/movable/screen/map_view, calling generate_view with the appropriate map id, setting things you want to display in its vis_contents, and then calling display_to on it, passing in the mob to show ourselves to.

Much better then the hardcoded pattern we used to use. So much duplicated code man.

Oh and plane master controllers, that system we have that allows for applying filters to sets of plane masters? I've made it use lookups on plane master groups now, rather then hanging references to all impacted planes. This makes logic easier, and prevents the need to manage references and update the controllers.

image

In addition, I've added a debug ui for plane masters.
It allows you to view all of your own plane masters and short descriptions of what they do, alongside tools for editing them and their relays.

It ALSO supports editing someone elses plane masters, AND it supports (in a very fragile and incomplete manner) viewing literally through someone else's eyes, including their plane masters. This is very useful, because it means you can debug "hey my X is yorked" issues yourself, on live.

In order to accomplish this I have needed to add setters for an ungodly amount of visual impacting vars. Sight flags, eye, see_invis, see_in_dark, etc.

It also comes with an info dump about the ui, and plane masters/relays in general.

Sort of on that note. I've documented everything I know that's niche/useful about our visual effects and rendering system. My hope is this will serve to bring people up to speed on what can be done more quickly, alongside making my sin here less horrible.
See https://github.com/LemonInTheDark/tgstation/blob/multiz-hell/.github/guides/VISUALS.md.
"Landing" planes

Ok so I've explained the backend, but how do we actually land planes properly?
Most of the time this is really simple. When a plane var is set, we need to provide some spokesperson for the appearance's z level. We can use this to derive their z layer, and thus what offset to use.

This is just a lot of gruntwork, but it's occasionally more complex.
Sometimes we need to cache a list of z layer -> effect, and then use that.
Also a LOT of updating on z move. So much z move shit.

Oh. and in order to make byond darkness work properly, I needed to add SEE_BLACKNESS to all sight flags.
This draws darkness to plane 0, which means I'm able to relay it around and draw it on different z layers as is possible. fun darkness ripple effects incoming someday

I also need to update mob overlays on move.
I do this by realiizing their appearances, mutating their plane, and then readding the overlay in the correct order.

The cost of this is currently 3N. I'm convinced this could be improved, but I've not got to it yet.
It can also occasionally cause overlays to corrupt. This is fixed by laying a protective ward of overlays.Copy in the sand, but that spell makes the compiler confused, so I'll have to bully lummy about fixing it at some point.
Behavior changes

We've had to give up on the already broken gateway "see through" effect. Won't work without managing gateway plane masters or something stupid. Not worth it.
So instead we display the other side as a ui element. It's worse, but not that bad.

Because vis_contents no longer flattens planes (most of the time), some uses of it now have interesting behavior.
The main thing that comes to mind is alert popups that display mobs. They can impact the lighting plane.
I don't really care, but it should be fixable, I think, given elbow grease.

Ah and I've cleaned up layers and plane defines to make them a bit easier to read/reason about, at least I think.
Why It's Good For The Game
<visual candy>

Fixes #65800
Fixes #68461
Changelog

cl
refactor: Refactored... well a lot really. Map views, anything to do with planes, multiz, a shit ton of rendering stuff. Basically if you see anything off visually report it
admin: VV a mob, and hit View/Edit Planes in the dropdown to steal their view, and modify it as you like. You can do the same to yourself using the Edit/Debug Planes verb
/cl
2022-09-27 20:11:04 +13:00