Commit Graph

1289 Commits

Author SHA1 Message Date
Unit2E
01f1262e64 Fixes strange reagent spawning plants when added to trays (#72964)
## About The Pull Request

Strange reagent is supposed to spawn pine trees and killer tomatoes when
added to hydroponics trays (with plants in them), but it didn't have a
location to do it, runtiming instead.

## Why It's Good For The Game

Makes the funny work, fixing the described runtime.

fixes #72963
2023-01-27 15:29:35 -06:00
Tim
fd85f5c67f Buff scythes, goats, and plantbgone vs PLANT biotypes (#72889)
## About The Pull Request
This buffs scythes, goats, and plantbgone vs PLANT biotypes:

- Scythes now deal x1.5 damage to venus flytraps (3 hits to kill)
- Scythes now target the flower bud vines
- Goats now target flower bud vines and deal 15 damage to PLANT biotypes
- Goats have a eating sound whenever they bite PLANT biotypes
- Plantbgone now does 2 dmg per unit to PLANT biotypes (10 dmg per
spray)
- Plantbgone now has a 75% chance to remove weeds and deals large damage
to flower buds
- Weed control crates now come with a pair of leather gloves
- Golems are immune to thorn effects
- Any kind of thick glove material will prevent thorn effects when
attacking
- Flower buds will now take x4 damage from fire and sharp weapons
(unless they have fire trait)
- Regular scythes are now a sharp object

Also this fixes a few runtimes with spacevines and nulls. The bane
element now accepts `mob_biotypes` bitflags as an argument.

## Why It's Good For The Game
Before my changes:

- Plant-b-gone was doing 0.4 dmg per unit to PLANT biotypes (2 dmg per
spray)
- Scythes took 5 hits to kill venus flytraps
- Goats only affected podpeople
- Flower bud vines were being ignored by weed killing code
- Plantbgone only had a 50% chance to remove weeds (and this was very
inconsistent due to RNG)
- Botanical gloves and thick gloves didn't protect from thorns
- Golems were getting pierced by thorns despite having pierce immunity
- Flower buds were not taking the x4 damage like they should have been
- Regular scythes were not a sharp object, but other scythes
(chaplain's, megafauna loot) were sharp

This makes the weed killer crate more effective since people were
complaining about it being worthless vs vines and flower buds. These
changes give people more options to respond to threats vs plants.

## Changelog
🆑
add: Add a pair of leather gloves to weed control crate
balance: Mobs with the PLANT biotypes (venus flytraps, pod people,
killer tomatoes) are now much weaker vs scythes, goats, and plantbgone.
balance: Plantbgone is now more effective at destroying weeds.
balance: Regular scythes are now a sharp object
fix: Fixed scythes, goats, and plantbgone not affecting flower bud
vines.
fix: Thick and botanical gloves not protecting from thorns
fix: Golems not having pierce immunity from thorns
fix: Runtime where vines tried to spread into null turf
fix: Runtime where null vines that were destroyed were trying to spread
to nearby turfs
soundadd: Add eat food sound when goats eat plants
code: Improved goat targeting code
code: The bane element now accepts `mob_biotypes` bitflags as an
argument.
/🆑
2023-01-26 14:29:48 -08:00
Jeremiah
872e64fb05 Adds spaces around logical operators (#72603)
## About The Pull Request
Part of a prior PR that was closed (#72562). This version does not add
the check in CI.
## Why It's Good For The Game
The work is already done, so I figured why not.
## Changelog
N/A Nothing player facing

Co-authored-by: Jeremiah Snow <jlsnow301@pm.me>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2023-01-16 16:56:35 -08:00
John Willard
6d757e8bec Autounlock techwebs are shared between machines that use them. (#72515)
## About The Pull Request

Did you know that for every Autolathe, Limbgrower, Biogenerator, ORM,
and Smelter that was built, an entire new techweb was made? The average
round has 2 ORMs (smelters count) if not more from ORM deconstruction
objective, 2 biogenerators, several autolathes and generally 0-1
limbgrower, I think there's more techwebs being created than we need.

Creating a whole techweb was a pretty terrible way to optimize this, so
I made a global list that stores these techwebs. Created on demand,
these autounlocking techwebs now share between the machines that use
them. It also generate all hacked nodes which will be visible if the
machine is hacked, instead of 'researching' them for each hacked
individual machine.

The 'specialized' techweb subtype was removed because its sole purpose
was to allow autounlocking to be a subtype of it. Now autounlocking is
just the direct subtype. I also removed mechfab autounlocking type
because it wasn't used, mechfabs use techwebs directly.

Autolathes and Limbgrowers now locally store 'imported designs' which
are things uploaded from technology disks. Outside of this, the
autounlocking techweb subtype now stores 'hacked designs' which unlocks
when the machine is emagged.
While doing this, I saw ORMs and Biogenerators had disks you can insert
into them, but I did not find anything that can actually be uploaded to
them (I saw Alien Alloys as a possibility, but there's no such disk to
allow uploading this alloy to the machine, and I didn't think an entire
system for 1 single alloy was worth keeping around), so I removed this
unused feature from both machines.

I merged 'Hacked' and 'Emagged' categories because they served the same
purpose, 'hacked' being on hacked autolathes and 'emagged' being on
hacked (emagged) limbgrowers.

Tech disk techwebs (which is created every time a disk is made, however
I hope to change this in the future) into it's own subtype, so admins
understand where its from when looking in VV panel (because I was
confused when I saw them at first).

``autolathe_crafted`` proc was removed because it was entirely unused
too.

Now it looks like this, which I consider an improvement:

![image](https://user-images.githubusercontent.com/53777086/211052875-9215a84d-fb04-450b-a120-4d0316cec6ff.png)

## Why It's Good For The Game

We no longer initialize a brand new techweb for no reason whatsoever.
Each techweb made is making entire lists of experiments and research
papers, all of which is never to be seen in-game and is completely
useless to the player. Cutting down on these techwebs is a good first
step to this needless initializing.

## Changelog

🆑
qol: Removed the tech disk part of the ORM's UI as it was entirely
unused, now it's a little more compact with less scrolling needed.
refactor: Autolathes, Limb growers, Biogenerators, ORMs and Smelters now
share techwebs with other machines of their types, rather than all make
new techwebs each time. This means they only build their nodes once,
including hacked ones. Instead of researching nodes on hacking the
machine, they now show hacked ones depending on if it's hacked.
/🆑

Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>
2023-01-14 17:54:46 -08:00
SyncIt21
ec5c9dfd10 Stock Part Datumization Complete (#72559)
So i accidently reverted all my commits in #72511 when resolving a merge
conflict So ummm yeah fuck my bad anyway

## About The Pull Request
Finishes what was started in #71693 and completes the
[initiative](https://github.com/tgstation/dev-cycles-initiative/issues/1)

Except for `obj/item/stock_parts/cell` and its subtypes. All machines
now use `datum/stock_part` for its requested components & component
parts

Not sure if i caught every machine & stuff in the game so merge with
caution
## Changelog
🆑
code: datum stock part for every obj stock part
refactor: all machines & dependent experiments to use datum stock parts
/🆑
2023-01-11 07:53:36 -08:00
Paxilmaniac
d46eea7593 Makes a few previously microwave only cooking options also doable in an oven (#72473)
## About The Pull Request

Make the following list of things that can only be cooked in the
microwave currently also able to be cooked in an oven:

Uncooked rice
Raw spaghetti

Wet leather (YUM!)

Aloe
Onion slices
Cheese curds
Eggs, rotten or not
Ready donk
## Why It's Good For The Game

We've already got stuff that's microwave-oven interchangeable (donk
pockets), sometimes you don't have a microwave and you're just locked
out of more than a few recipes because something that could easily be
made in an oven isn't coded to be. The simple solution is just not have
that be the case.
## Changelog
🆑
qol: A few recipes that were microwave only (like boiling rice, heating
ready donk, so on) can now also be made in an oven
/🆑
2023-01-07 20:37:50 +01:00
Unit2E
d9ec8b6c76 Makes the juice of death berries poisonous, like poison berry's (#72443)
Found out poison berry juice existed from the wiki and code diving,
however, only poison berries juice into it. Death berries, despite their
stronger poison, juice into normal berry juice instead. This changes
that to have death berries also juice into poisoned juice.

Mostly a consistency change, it doesn't make sense for the berry with
the stronger poison to not juice into something poisonous as well, when
a berry that's less poisonous does do so. For transparency's sake, this
will make the death berry marginally stronger, as with plant traits you
can get the juiced reagent inside of a plant without juicing it.
2023-01-05 14:12:44 -06:00
Mothblocks
f54dcda1c0 afterattack now returns a flag if it's reasonable to suspect the user intends to act on an item (#72320)
Necessary for #72292 to work effectively, and probably not very useful
out of that context. Split out of its own PR because this is long and
boring.

I want to make sure that we're catching actual mistakes there, and not
just experiencing side effects of how shitty the attack chain is.
2023-01-04 21:10:41 -08:00
Andrew
fd1ea8d5b5 Biogen shows default reagent container icons instead of beakers (#72247)
## About The Pull Request

With the new crafting menu some reagents now have default container
assigned.
I applied these to visualize reagents in biogen UI too.

<img alt="060ybChTkI"
src="https://user-images.githubusercontent.com/3625094/209483256-e4159a05-46ae-47b8-bc42-9d003cf6c303.png">

## Why It's Good For The Game

Better representation of a reagent.

## Changelog

🆑
qol: Biogenerator shows default reagent containers instead of beakers
/🆑
2023-01-03 21:20:30 -08:00
kawoppi
3094b8aa34 adds reagents splashing animation (#72231)
## About The Pull Request
Adds animations for splashing reagents on stuff. Both when combat mode +
right clicking something, and when throwing the reagent container at
something. The slosh sound now also plays in both these cases, because
it seemed weird that these were lacking sounds. There's also an
animation for splashing reagents into hydroponics trays.

default splash animation:
![default](https://user-images.githubusercontent.com/94711066/209586106-1c64bef2-ce1c-40e0-af12-8b17e40efd4c.gif)
splash animation when targeting turfs:
![floor](https://user-images.githubusercontent.com/94711066/209586125-c9eee1b0-96fc-4dd2-9b7b-4715f87d8842.gif)
animation for pouring reagents into hydroponics trays:
![hydroponics](https://user-images.githubusercontent.com/94711066/209586127-669be1d0-5fb8-4ae3-a611-7bde9876dcdc.gif)
(they all get recolored by the reagents)

[new demo video!](https://youtu.be/PuoOmbc3-Nc)

~~[old demo video](https://youtu.be/SfHrINpIidk)
[old extra demo because i forgot to record it the first
time](https://youtu.be/CscgltRpE64)~~
## Why It's Good For The Game
Visual and auditory feedback for splashing things and getting splashed
(with potentially dangerous chemicals). Also looks neat when watering
your plants.
## Changelog
🆑
add: added reagent splashing animation for spilling reagents on things
add: added reagent splashing animation for spilling reagents onto floors
add: added reagent splashing animation for pouring reagents into
hydroponics trays
soundadd: slosh sound now plays when spilling reagents on things, both
directly and by throwing
/🆑
2023-01-03 18:19:57 -08:00
ShizCalev
747dfd49d9 [ready] unit tests all worn icons (#72370)
Fixes #71692

🆑 ShizCalev
code: Added a unit test for ALL worn icons.
fix: Fixed a bunch of broken worn icons!
/🆑
2023-01-03 12:57:56 -08:00
tattle
5c97b13e18 Food code sweepups + heart boxes have more chocolate variety (#72127)
- Chocolate boxes now contain bonbons (formerly tiny chocolates),
truffles, and peanut butter cups
- Slices of bread now taste like their respective breads instead of
tasting "indescribable"
- Fiesta skewers have food categories now
- Misc food file has had more split out of it into sweets.dm,
vegetables.dm, and packaged.dm
- Removed a bunch of redundant food_reagent code
- Changed the sugar in clown cakes' food_reagents to banana juice
- Increased the amount of vitamin in pound cakes (it's four whole cakes
and the amount of vitamin doesn't go up?)
2022-12-30 00:28:00 +00:00
Time-Green
a9d530dc71 Unfuckies pod blood (#72323)
I broke it in #72220
Thanks to @Fikou for catching this
list(variable = 0.1) doesnt work on byond, so I last-minute improvised
and changed it to
list("[variable]" = 0.1), using a string instead of a typepath. I
already tested it thoroughly so decided it was probably good without
thinking of it anymore

🆑
fix: fixes pod blood I swear
/🆑

Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
2022-12-30 00:54:58 +01:00
Salex08
3731cb489d Botany fix and clean up (#72234)
## About The Pull Request

On local server I found out that hydroponic trays had weird behaviours.
Forexample:
If you use radium on trays, the subtype of radium which is uranium would
also get in effect meaning:
You add radium to the tray and get radium AND uranium effect on it.
Radium wasnt the only reagent others would show the same effect.
So I fixed them

I also cleaned up some code bits, there were some inconsistency with the
on_hydroponics_apply proc, I made them all consistent. There was also
for some reason a duplicate on_hydroponics_apply proc for blood reagent
one of them was unfinshed

## Why It's Good For The Game

Botany will behave correctly and the code is more cleaned up

## Changelog

🆑
fix: using chemicals on botany wont have unrelated side effects
/🆑
2022-12-28 18:43:20 -08:00
Time-Green
019029e0b2 Fixes infinite replicapodspawns (#72220)
Max() was being used incorrectly here, it doesn't support assoc lists

This caused the pod to runtime and never go away if there were any
reagents and gave infinite respawns

Closes #67182


https://user-images.githubusercontent.com/7501474/209433613-f63d3355-78d8-46be-9fce-9a612a75f4c3.mp4

🆑
fix: replicapods no longer sometimes have infinite spawns
/🆑

Also thanks to randomdudefromtherim for reporting this
2022-12-28 01:59:39 +01:00
Andrew
0818d6ae4c Crafting/Cooking menu update (#71779)
## About The Pull Request

Updated crafting menu, adding a lot of new functions and recipes that
were not in the crafting menu before.

<img alt="cult"
src="https://user-images.githubusercontent.com/3625094/206009533-aec3a1dd-cbe5-45eb-8515-1b75fabb65c5.PNG">

<img alt="nH77dLyyGx"
src="https://user-images.githubusercontent.com/3625094/206009786-b6706f70-0599-40bf-b051-8f499de43abd.png">


![image](https://user-images.githubusercontent.com/3625094/206623881-12d8abfc-de5e-458e-a01c-3daac8dbe9bd.png)


https://user-images.githubusercontent.com/3625094/206009841-738e4a03-0660-45b7-8d83-15eeb6501967.mp4

## Why It's Good For The Game

It is easier to use, and it has a lot of recipes that were spread
throughout the game, some of which weren't even on the wiki.
Crafting and cooking now count about 1200 recipes in total, including
conditionally available ones.

## Changelog

🆑
qol: Rewrote the crafting/cooking menu UI
qol: Split crafting and cooking menus in two different menus
qol: Crafting is no longer blocking the entire UI, only the "Make"
buttons are disabled
qol: Added stack crafting recipes to the crafting menu
qol: Added cooking recipes that were absent in the crafting menu before
(tool recipes, machine recipes, reactions)
qol: Added option to search recipes by title
qol: Added option to filter recipes by required materials/ingredients
qol: Added food types to the cooking menu, highlighting diet of your
species (liked, disliked foods)
qol: Added total nutrition value of the result to the cooking menu
qol: Added option to filter cooking recipes by the food type of the
resulting food
qol: Added "Can make" category that lists all currently craftable
recipes throughout all categories
refactor: changed categories and reshuffled some items in them
code: Reagents now have default container to get an icon from the
reagent datum
code: Objects now have `desc_controls` var for OOC information about
mouse controls that are visible on examine, but not in the description
fix: Fixed alignment on many food icons
fix: Fixed missing icon for beef stroganoff
/🆑

Co-authored-by: tattle <66640614+dragomagol@users.noreply.github.com>
2022-12-25 12:27:49 -08:00
MidoriWroth
ff9cc56576 Food expansion 5: The big one! (#71914)
add: Adds 32 new foods!
2022-12-19 19:00:22 -05:00
Mothblocks
75439c71f2 Smoothing groups optimization, save 265ms with configs, more on production & w/ space ruins (#71989)
This one is fun.

On every /turf/Initialize and /atom/Initialize, we try to set
`smoothing_groups` and `canSmoothWith` to a cached list of bitfields. At
the type level, these are specified as lists of IDs, which are then
`Join`ed in Initialize, and retrieved from the cache (or built from
there).

The problem is that the cache only misses about 60 times, but the cache
hits more than a hundred thousand times. This means we eat the cost of
`Join` (which is very very slow, because strings + BYOND), as well as
the preliminary `length` checks, for every single atom.

Furthermore, as you might remember, if you have any list variable set on
a type, it'll create a hidden `(init)` proc to create the list. On
turfs, that costs us about 60ms.

This PR does a cool trick where we can completely eliminate the `Join`
*and* the lists at the cost of a little more work when building the
cache.

The trick is that we replace the current type definitions with this:

```patch
- smoothing_groups = list(SMOOTH_GROUP_TURF_OPEN, SMOOTH_GROUP_FLOOR_ASH)
- canSmoothWith = list(SMOOTH_GROUP_FLOOR_ASH, SMOOTH_GROUP_CLOSED_TURFS)
+ smoothing_groups = SMOOTH_GROUP_TURF_OPEN + SMOOTH_GROUP_FLOOR_ASH
+ canSmoothWith = SMOOTH_GROUP_FLOOR_ASH + SMOOTH_GROUP_CLOSED_TURFS
```

These defines, instead of being numbers, are now segments of a string,
delimited by commas.

For instance, if ASH used to be 13, and CLOSED_TURFS used to be 37, this
used to equal `list(13, 37)`. Now, it equals `"13,37,"`.

Then, when the cache misses, we take that string, and treat it as part
of a JSON list, and decode it from there. Meaning:

```java
// Starting value
"13,37,"

// We have a trailing comma, so add a dummy value
"13,37,0"

// Make it an array
"[13,37,0]"

// Decode
list(13, 37, 0)

// Chop off the dummy value
list(13, 37) // Done!
```

This on its own eliminates 265ms *without space ruins*, with the
combined savings of turf/Initialize, atom/Initialize, and the hidden
(init) procs that no longer exist.

Furthermore, there's some other fun stuff we gain from this approach
emergently.

We previously had a difference between `S_TURF` and `S_OBJ`. The idea is
that if you have any smoothing groups with `S_OBJ`, then you will gain
the `SMOOTH_OBJ` bitflag (though note to self, I need to check that the
cost of adding this is actually worth it). This is achieved by the fact
that `S_OBJ` simply takes the last turf, and adds onto that, meaning
that if the biggest value in the sorting groups is greater than that,
then we know we're going to be smoothing to objects.

This new method provides a limitation here. BYOND has no way of
converting a number to a string at compile time, meaning that we can't
evaluate `MAX_S_TURF + offset` into a string. Instead, in order to
preserve the nice UX, `S_OBJ` now instead opts to make the numbers
negative. This means that what used to be something like:

```dm
smoothing_groups = list(SMOOTH_GROUP_ALIEN_RESIN, SMOOTH_GROUP_ALIEN_WEEDS)
```

...which may have been represented as

```dm
smoothing_groups = list(15, MAX_S_TURF + 3)
```

...will now become, at compile time:

```dm
smoothing_groups = "15,-3,"
```

Except! Because we guarantee smoothing groups are sorted through unit
testing, this is actually going to look like:

```dm
smoothing_groups = "-3,15,"
```

Meaning that we can now check if we're smoothing with objects just by
checking if `smoothing_groups[1] == "-"`, as that's the only way that is
possible. Neat!

Furthermore, though much simpler, what used to be `if
(length(smoothing_groups))` (and canSmoothWith) on every single
atom/Initialize and turf/Initialize can now be `if (smoothing_groups)`,
since empty strings are falsy. `length` is about 15% slower than doing
nothing, so in procs as hot as this, this gives some nice gains just on
its own.

For developers, very little changes. Instead of using `list`, you now
use `+`. The order might change, as `S_OBJ` now needs to come first, but
unit tests will catch you if you mess up. Also, you will notice that all
`S_OBJ` have been increased by one. This is because we used to have
`S_TURF(0)` and `S_OBJ(0)`, but with this new trick, -0 == 0, and so
they conflicted and needed to be changed.
2022-12-17 02:34:31 -08:00
Andrew
c5e6aa44eb Natural booze (#71842)
## About The Pull Request

Makes fermented booze take quality and power from the endurance and
lifespan stats of the fruit.
These are the most neglected plant stats, and usually plants that have
these high by default, do not have much nutriments.

This change makes fermented drinks a bit more desirable because your
effort is reflected in their stats. And you get better mood buff by
making them higher.

Fruit wine and other reagents get a "Natural" prefix when made through
fermentation.


![image](https://user-images.githubusercontent.com/3625094/206508903-c3ff85d2-c904-4a12-ae23-422604d87edf.png)

I consider turning it into a more general solution so that dispensed
drinks will also have purity and if the barman wants to aim for an
absolute quality cocktail, he may want to cooperate with botany like
chef does.

## Why It's Good For The Game

Fermented drinks are now a bit special compared to the free booze
dispenser variants.

## Changelog

🆑
add: Fermented drinks give mood buffs according to the stats of
fermented fruit
/🆑
2022-12-11 13:13:32 +00:00
Andrew
e59bbde0f3 Biomass overlay thresholds use sine function (#71859)
In recent PRs, biogen cap got raised to 5000 units, which is far more
than people usually have during most shifts.

This makes the biomass overlay icons pointless, because it will always
have the same icon untill you go above 714 biomass, which is higher than
the previous cap and more than anyone needs for normal tasks.

I made the overlay use sine interpolation to make the icon change faster
at lower levels, but slower when the visual cap is near.

Linear thresholds (Old):
Min biomass at 1, 714, 1428, 2142, 2856, 3570, 4285

Sine thresholds (new):
Min biomass at 1, 440, 930, 1420, 1940, 2560, 3300
2022-12-11 04:45:30 -05:00
Andrew
c2ab9ce99b IV drip injects only to injectable things (#71709)
## About The Pull Request

Previous PR https://github.com/tgstation/tgstation/pull/71217 made IV
drip work with any containers which, after a while led to some undesired
cases.

People could add reagents to medipens, making them free hypospray.
Refilling extinguishers with things other than water. And just
sabotaging pills, patches, etc.

Now IV drips inject only into injectable containers.

I added INJECTABLE flag to a few other things that were not originally
injectable - hydroponic trays, smoke machine, chem separator. May later
whitelist some other items that may be injectable by logic, but don't
lead to undesired accidents.


![image](https://user-images.githubusercontent.com/3625094/205488795-c2482b44-6296-4514-81de-36a69b0dffad.png)

## Why It's Good For The Game

Free sleepy pens are not OK. 

## Changelog

🆑
fix: IV drip now injects only into injectable things
/🆑
2022-12-05 12:48:19 +01:00
Andrew
cf1107fbec Fermentation and barrel refactoring (#71475)
## About The Pull Request

The barrel was essentially a grinder that also added a lot of wine on
top of other reagents. Now it converts only nutriment and vitamin into
the wine.

Also the Auto-Distilling Composition plant gene didn't make fruit wine
and gave only half of the distilled drink volume.

- Now the fermentation is consistent and it happens in one place - the
`ferment()` proc of the plant. Both gene and barrel use it.
- Added some sounds and ballon alerts.
- Increased the barrel volume to 600, as other stationary reagent
containers have even more.


https://user-images.githubusercontent.com/3625094/203582992-8d31cff6-15bd-416f-b2fb-c7a0f6cfbcb4.mp4

## Why It's Good For The Game

Barrels are cute, we should use them more.

## Changelog

🆑
qol: barrel works with the plant bag now
balance: barrel volume increased to 600 units
fix: barrel now properly converts nutriments into wine
fix: added 4% nutriments to sugar cane, to allow rum creation
refactor: barrel logic and fermentation refactoring
/🆑
2022-12-01 19:38:26 -08:00
Time-Green
46be216cc0 Ultra-modularizes podperson hair restyling (#71381)
Refactors podperson restyling completely
You no longer need to be a podperson to be restyled, anyone with pod
hair can have their hair restyled
You can also restyle just their head
Or just the hair

Also fixes limbs storing external organs, and two other things but I
forgot
Secateurs now also work on right-click

Cool video displaying the whole thing:

https://discord.com/channels/326822144233439242/326831214667235328/1043612744269705288

🆑
refactor: Refactors podperson hair. You can now restyle it on any
species
qol: You can restyle podperson hair on the person, their decapitated
head or straight on the hair organ
code: Restyling is now completely modular, you can make any external
organ easily restylable
fix: Fixes external organ harddel because limbs would keep the reference
on drop_organs
/🆑
2022-12-01 16:44:49 -08:00
GoldenAlpharex
a753229ee2 Biogen Refactor and Code Cleanup, Faster Biomass Conversion and No More Biomass Cap! (#71563)
## About The Pull Request
So, I looked at the Biogenerator code and there was just, _so_ much old
and undocumented code, that I just spazzed out and started documenting
and refactoring everything. There's now a lot less usage of contents
lookups and for loops, and _almost_ everything is documented, now, too.

As for the changes, as you can see in the title, I made biomass
conversion faster. How much faster, you ask? 5 times faster with default
parts, up to 20 times faster with the best parts. It was painfully slow,
and that's not fun for anyone.

I also lifted the biomass cap. It wasn't useful, it wasn't fun, and
Melbert didn't really agree with it either. However, I enjoyed the look
of the biomass going up, so I gave it a max visual amount of 5000, so
you get to see it gradually filling up as you put your first 5000
biomass in. After that, you do you, chief. Watch the funny numbers go up
all you want.

I also improved the maths so that it wasn't just rounding stuff
constantly, and also gave a little bit more insight on how much biomass
everything would cost you, down to two decimals. If there's no decimals,
it won't show them, however.


<details>
<summary>Here's what that looks like now:</summary>
That's one screenshot per different decimal places, there's no trailing
zeros because I think we can all universally agree that those look bad
in this kind of setting.


![image](https://user-images.githubusercontent.com/58045821/204120744-a8c398dc-7c19-4ee0-a8cb-5615f1dce1ea.png)

![image](https://user-images.githubusercontent.com/58045821/204120749-90aae203-bdb8-4322-a657-bb4fd313d808.png)

![image](https://user-images.githubusercontent.com/58045821/204120755-8bed494d-0d70-4b4a-afa2-413610089f6d.png)

</details>

There's now also more information displayed when you examine the biogen,
namely, how many items it has stored, and how many it can hold. I also
fixed the formatting a bit, so it looks ever so slightly cleaner.

Other than that, I just improved the code everywhere I saw it to be
fitting, there shouldn't be any single-letter variables in there
anymore, and the code should be more spaced out. Honestly, at this
point, I wrote most of this code six hours ago so I don't remember all
of it, and I'm too lazy to go through and check what I've changed again.
Diff and changelog are there for that.

## Why It's Good For The Game
So, I'll be honest, there were two big reasons that motivated me to do
this. First of all, the biomass cap. That was a little silly, anyone
that has spent more than one shift in Hydroponics knows that you usually
only put Watermelons in the biomass generator as they're usually the
thing that nets you the most biomass. Botanists will generally stock the
fridges first, and if they have a lot of excess, they'll put it in the
generator if they want, but that's rarely what was done. I've talked
with @MrMelbert about it and he gave me the go-ahead, as can be seen
here:


![image](https://user-images.githubusercontent.com/58045821/204115174-fb2610c0-61c5-44e1-845e-cc6925ee33e6.png)

The other reason was the excruciatingly slow processing speed, which
I've fixed. So we're good now. :)

## Changelog

🆑 GoldenAlpharex
refactor: Went through and refactored a lot of the old code of the
biogenerator, and made multiple improvements to its logic, which should
hopefully make it behave more consistently. Nearly all of it is now also
fully documented, so as to make it easier for anyone else that has to
sift through it in the future.
qol: The biogenerator now processes items five times faster, up to 20
times faster if properly upgraded!
qol: The biogenerator is no longer capped on biomass. Its visuals will
change up until 5000 biomass, but you're free to go as high as you'd
like with it! Sky's the limit!
fix: Fixed the logic of the biogenerator that would make it so the
amount of biomass used for recipes was wildly inconsistent. Now, there's
no more back-end rounding up, it's all on the front end when it needs to
be, so there's no loss or gain of biomass when there shouldn't be.
spellcheck: Fixed a capitalization issue with the seaweed sheets in the
biogenerator recipes.
spellcheck: Fixed multiple inconsistencies between the messages sent to
your chat by the biogenerator.
/🆑
2022-11-29 21:45:53 +01:00
Andrew
4fa1d25380 Biogen backend optimization and bugfix (#71460)
## About The Pull Request

In previous PR I didn't touch the backend much, but I've learned that
while loop the biogen was using is not very good when we have the
`process()`.
I replaced that with a cleaner `process(delta_time)`, it should also be
less resource intensive.
No real player-facing changes.

Also fixed a bug with non-stackable items not spawning more than 1 copy
on purchase. This was working on dev branch but somehow broke recently.

And increased the size of the most important buttons slightly, while I
was at it:

![image](https://user-images.githubusercontent.com/3625094/203447298-bdfedd49-ae90-41e4-81a8-668efd0b41dd.png)

## Changelog
🆑
fix: biogenerator now properly gives non-stackable items
refactor: biogenerator backend optimization
/🆑

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2022-11-25 08:53:28 +00:00
Sol N
c9415b99de Gives bread and cake slice_types and adds screentip verbs to proccessed foods (#71449)
## About The Pull Request
 
A side effect of my pizza PR #71202 I added contextual screentips as
part of processable.dm. In doing this, I noticed that with a few
exceptions, almost every single bread and cake type copies the proc
exactly the same for every single child of cake or bread, so I put the
proc on the parent of bread and cake and gave them slice_types, making
them more similar to pizza.dm

For everything else I've changed the default that I put in
processable.dm into "slice" or "cut" for things that use the knife and
"flatten" for things that use the rolling pin.

Finally, you can slice bread with saws now, because I think its silly
that only pizza gets this luxury.

## Why It's Good For The Game

Because it wasnt the focus of #71202 I didn't mess with screentips
outside of the pizza file a lot, but now that it's merged I figure I
should go and do that.
As Bread and Cake's processables are almost fully standardized it seems
silly for them to call on the proc 12 times in the same document so I
did this, which also allows for more versatility in editing how they
work as well allow people to, if they want to, add more tool behaviours
in the future without adding in 12 lines of code. Also means that people
who want to add new cake or bread have one less thing to do.

## Changelog

🆑
add: you can saw bread with a saw into bread slices
qol: added screentip verbs to a bunch of food files
code: bread and cake now have slice types and all only have one call on
the processable.dm proc
/🆑
2022-11-24 09:17:21 +01:00
Andrew
75377fbcd3 [NO GBP] Biogen power usage hotfix (#71443)
## About The Pull Request

Fixes the active power usage for biogenerator (300kw -> 3kw active
usage) because of wrong time conversion change in
https://github.com/tgstation/tgstation/pull/71175

There is also another bug with biogen, that looks like a regression of
some other PR as it wasn't there before the merge:
`build_path(drop_location(), amount)` ignores amount for non-stackable
items. Not sure why it got broken.

## Changelog
🆑
fix: biogenerator active power usage fix
/🆑
2022-11-22 22:13:52 +01: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
Andrew
590847bdf7 Biogenerator tweaks, leather makes more belts and clothing (#71175)
## About The Pull Request

### Revamped the biogenerator UI:


https://user-images.githubusercontent.com/3625094/200973283-b703f21b-c747-493e-98d9-043eef86d410.mp4

### Changed biogenerator icon to use layers and see the biomass level:


https://user-images.githubusercontent.com/3625094/201396065-caeaa412-6676-46f6-875e-efa2dca34985.mp4

### Biogenerator rebalance:

- Now you don't need the beaker to print solid products.
- Biogenerator now accepts all food, not just plants.
- Biogenerator now treats all nutriment subtypes as nutriments, so
vitamins and proteins also turn into biomass.
- Biomass now has the same units as other reagents (you get 5 biomass
from 5 nutrient with tier 1 parts).
- Doubled the cost of all items and reagents. (biomass generation
reduced by 10 and prices - by 5)
- Chemicals output amounts are now in units and you can select how much
you want to output exactly. It will not let you specify more than the
size of container or above 50 units with one button click.
- Reduced the amount of stored items and introduced a limit to the
biomass, both tied to the matter bin tier.

### Recipes changes:

Made biogenerator more dumb by moving the clothing out from the
biogenerator designs, and extending leather recipes instead.

The biogenerator is a grinder/recycler style machine so it doesn't make
sense that it outputs clothing.
Also you need to make leather to craft the toolbelt, while you can't do
the same to craft job-specific belts.
Now you can print leather in biogenerator and craft the leather clothing
by using the leather in-hand.
And the rice hat is now crafted from bamboo, instead of biogenerator.

Also added paper to the biogenerator recipes as it makes stuff from
cellulose and barely anyone knows that you can craft paper from 1 log
and 50 water. And paper is needed in large quantities to craft some
items, like paper frames.

And it doesn't output a pack of rolling paper. It's dumb now. It prints
the rolling paper sheets instead.

## Why It's Good For The Game

Biogenerator had terrible UX and backend logic. I didn't improve much on
BE though, but now it should be less frustrating to use.

Also I hate how biogenerator is superior to all other means of obtaining
its products. It doesn't make sense to grow and grind wheat, for
instance, when you can just throw shit into biogenerator and get the
flour fast. And the costs are ridiculous - you can get a couple of
bottles of fertilizers just from one medium potato.

It honestly begs for more nerfing, at least to make the nutriment -
chemicals exchange rate 1:1.

The reason for the biomass cap is because people use it as a sink for
veggies and generate infinite biomass. Maybe the limit will make them
care more about the part upgrade and offload some of the veggies to the
fridge for the Cook.

Also it was weird that biogenerator could tailor some things, while
others have to be crafted in-hand. Now you can print leather and craft
all types of belts and leather clothing.

## Changelog
🆑
refactor: biogenerator UI revamped
qol: biogenerator no longer requires beaker for materials, monkey cubes
and nori
balance: biogenerator accepts all food, not just plants
balance: biogenerator treats all nutriment subtypes as nutriments
(vitamins, protein, etc.)
balance: biogenerator product prices doubled
balance: biogenerator biomass storage is limited depending on the level
of matter bins
balance: cowboy boots recipe moved from crafting to leather recipes
balance: leather clothing & belt recipes moved from biogenerator to
leather recipes
balance: rice hat recipe moved from biogenerator to bamboo recipes
balance: biogenerator now outputs rolling paper sheets instead of a pack
add: biogenerator can now print paper
imageadd: biogenerator icons now use overlays, have emissive layer and
indicate the biomass volume
/🆑
2022-11-21 20:57:13 -08:00
Andrew
3c7870b7f6 Better Seed Extractor UI (#71204)
## About The Pull Request

Added icons to the seed extractor, indicators that show the stat value
relative to maximum possible value, tooltips to the stats, list of
traits and reagents.


![image](https://user-images.githubusercontent.com/3625094/201560469-7d44122b-7abd-4c3d-a76d-79fd26d36cb7.png)

There is also an ability to sort and filter the table now:


https://user-images.githubusercontent.com/3625094/201498368-9d620f99-28d3-4197-b73e-cd65d8285334.mp4

And an ability to scrap unneeded seeds:


https://user-images.githubusercontent.com/3625094/202563846-420f395b-d4a0-4ebc-88a9-df74c9c8ca1c.mp4

## Why It's Good For The Game

It wasn't very informative with just numbers, especially if you don't
know is it 5 out of 10 or 5 out of 100.

## Changelog

🆑
qol: new seed extractor UI 
/🆑

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: tattle <66640614+dragomagol@users.noreply.github.com>
2022-11-19 21:23:28 +00:00
tattle
d14229bbf5 Gives growing plant icons custom offsets (#71209)
## About The Pull Request
Right now most growing plants have an 8 pixel gap at the bottom, to
account for the offset of either soil or a hydroponics tray. This limits
plants to being, at most, 24 pixels high.

Some current plants go below 8 pixels, and so their offsets have been
adjusted accordingly. Also removes some unused mold and vine sprites.

## Why It's Good For The Game
Spriters have more freedom to have their plants be taller or more
dangly.

## Changelog
No player-facing changes

Co-authored-by: tattle <article.disaster@gmail.com>
2022-11-15 23:34:48 -08:00
GoldenAlpharex
75ff0f1080 Fixes plants showing up as errors when made into cells when their icon isn't in the same file as the other plants (#71247)
Basically, any cell made from a plant that didn't have its icon located
at the same place as all the other plant icons would turn into an error
(with the proper battery overlay though) when turned into a botanical
cell.

This fixes that, which means that it'll be one less thing to think about
when `harvest.dmi` gets eventually split into multiple files.
2022-11-15 23:02:24 +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
MrMelbert
fc7c967ac5 Funny merge skew from banana (#71039)
When a food feature PR and a food refactor come together, and get merged
without re-running checks, something very funny happens.

A merge skew. 

Edible component uses inherent component so this is fine.
2022-11-03 21:37:24 +00:00
MrMelbert
1ac4a67c27 Chefs can now kiss food they make to make it with love. (And a lot of cooking refactoring) (#70409)
About The Pull Request

    Adds a skillchip to the chef's vendor. This vendor allows the chef to kiss their food to deliver a chef's kiss.
        Chef's kissing your food will add the "love" reagent to the food, which makes people much happier when they eat it. Be careful, overdosing on love can cause heart attacks.

    Refactors microwaving.
        Separates microwaving out of the edible component and makes it its own element, like grillable and bakeable.
        Also removes some magic numbers from microwave code.

    Code improvements all around baking and grilling code.

    Refactors edible component inheritance.
        Inheriting the edible component is now a viable way to cleanly add food types, flags, and callbacks. This makes it much much easier to change the values of an edible item without adding hacky signals / procs / getcomponent.

Why It's Good For The Game

Emergent chef gameplay.
Being able to further enhance your food with mood buffs.
Better code.
Changelog

cl Melbert
add: Chefs can now make food with love. They can purchase a skillchip from their vendor which enhances their kiss emote. Using your kiss on food you create will add a special reagent to it which makes it nicer.
refactor: Separated Microwavable from the Edible component, refactored microwave act to accompany this
refactor: Refactored how grilled items are generated
refactor: Refactored how silver slime food items are generated
refactor: Refactored how edible items inherit new edible statuses
code: Removed some magic numbers from microwaves
code: General code improvements for grillable / bakeable / etc
/cl
2022-11-04 09:45:01 +13:00
Striders13
55e5c5be67 Clowns will now always like bananas. (#70919)
## About The Pull Request
Clown's liver makes them like bananas, ignoring their racial food
preferences.

## Why It's Good For The Game
I don't think clown moths should vomit from eating bananas. They are
clowns, after all.
Also clowns are healed from eating them, so it's a bit silly that they
vomit from their funny medicine.

## Changelog


🆑
balance: Non-human clowns enjoy eating bananas now.
/🆑
2022-10-31 22:05:18 -07:00
MrMelbert
6a0fe4fe8c Fixes improper hydro attack_hand_econdary return (#70542) 2022-10-19 00:54:52 -07:00
san7890
2878345ebb Swaps sleep() to use SECONDS define, changes some sleep(1) to sleep(1 TICKS) (#70452) 2022-10-18 21:25:23 -07:00
Wallem
87e75f1c42 Adds a bar to the biogen to show how full a container is (#70407)
About The Pull Request

Adds a bar to the UI of the biogen to show how full the container inside is
2022-10-08.23-47-27.mp4

I tidied it up a little bit but forgot to record it so here's a screenshot of how it looks now
image
Why It's Good For The Game

Helpful so you don't have to keep doing math over how many u's of reagents you'll have room for in a container
Changelog

cl Wallem
qol: The Biogen will show how full the container inside it is
/cl
2022-10-14 11:18:14 +13:00
MrMelbert
3a3f833a9d Holymelons are more melon-like (#70411)
Holymelons inherent some melon stuff
2022-10-13 14:29:25 -04:00
Shadyyy66
5311150c37 Töchtaüse Juicer Fix (#70289)
Töchtaüse berry juicer fix

removed grind_results since it's redundant and removed the itching powder reagent from the juice_results variable. Added nutriment to Töchtaüse berries for juicing purposes
2022-10-12 17:43:27 -07:00
ShizCalev
7048110298 Inhands var hardsetting (#70364) 2022-10-07 19:08:09 -07:00
Twaticus
c7dde06668 [MDB Ignore]Hats DMI split (#70060)
Splits head dmi into separate files for both mob and obj icons. Kept similar to suit split categorization + some more. New files include beanie, bio, chaplain, costume, cowboy, default, hats(softcaps, fedoras, head caps, generic hats), helmet(helmets and other armored headgear/hoods), spacehelm, utility(hardhats, mostly work related hats), wizard.
Moves animal/pet head sitting icons to 1 folder, pets_head.dmi
Renames PAI head sitting icon file to pai_head.dmi
2022-10-06 21:37:06 -07:00
Aki Ito
01a8366543 Fixes Hydroponics Water Adding (#70280)
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2022-10-05 12:09:15 -07:00
ShizCalev
1a32f60cf4 [ready] adds unit test for missing inhand icons. fixes a bunch of missing inhand icons (#70037)
fix: Fixed a bunch of missing inhand icons.
fix: Fixed cables in electrical toolboxes not randomizing their colors.
fix: Fixed the wrong colored icon showing when trying to make cable cuffs out of cables.
fix: The collectable SWAT helmet is now using the proper icon again!
refactor: Pipecleaners and power cables now share a unified color system, so they're once again available in ALL the same colors.
imageadd: Updated the screwdriver belt overlay to represent the newer sprite.
imageadd: Added a bunch of new inhand icons. Special thanks to Twaticus for doing the helmets! <3
fix: Wirecutters now have an icon when inside a belt again!
admin: Added a new omnitool subtype that allows you to spawn all items in a typepath!
fix: Explorer gaskmasks now properly reflect their adjusted state when held.
fix: Fixed balaclavas having the wrong icon when pulled up.
fix: Fixed the base energy sword (admin spawn only) being invisible.
fix: The rainbow energy sword is now a little bit more rainbowy!
fix: Fixed an tk exploit with orange handcuffed shoes.
fix: The traitor outfit in the select equipment panel is now actually functional!
2022-10-04 10:20:24 -07: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
MrMelbert
45516f4741 Adds macros to help with common set_- and adjust_timed_status_effect uses (#69951)
* Adds helpers for status effect application
2022-09-24 11:04:26 -04:00