Commit Graph

816 Commits

Author SHA1 Message Date
Ghom
14fb86e3e8 Mutation code cleanup, mutations now have sources to avoid concurrency problems. (#91346)
## About The Pull Request
This PR aims to clean or bring up to date portions of code about dna,
the dna console and mutations. This includes taking care of or removing
some of the awful choices like the pratically useless
`datum/mutation/human` pathing, or the class variable, in favor of using
sources to avoid potential issues with extraneous sources of a mutation.

The files changed are over a hundred just because I removed the
`datum/mutation/human` path, but the actual bulk of the code is mainly
shared between the datum/dna.dm, _mutations.dm and dna_console.dm.

## Why It's Good For The Game
Mutation shitcode is hurting my future plans for infusions a little.
Also it's a much needed refactor. Drafted 'till I'm sure it works
without issues.

## Changelog

🆑
refactor: Refactored mutation code backend. Report any issue.
/🆑
2025-06-08 13:57:10 +02:00
Bloop
2bae025bfe Audits wash/cleaning signals + refactors wash() to ensure no needless mob updates occur (#91259)
## About The Pull Request

This has the potential to create a lot of needless mob updates which is
not great. Now should only update a mob's clothing if it was actually
washed.

This PR

1) ensures that all wash() procs return a bitflag.
2) ensures that `wash()` proccalls which result in expensive operations
like icon updates only do so when it is necessary

## Why It's Good For The Game

Updating mob sprites is expensive, and doing it when nothing has been
changed is bad.

## Changelog

Nothing really player facing
2025-06-02 18:54:53 +00:00
Ghom
4f6727024d Crafting refactor, implementing materials (#89465)
## About The Pull Request
My original plan was to just implement materials into crafting so that
items would inherit the materials of their components, allowing for some
interesting stuff if the material flags of the item allow it. However to
my dismay crafting is a pile of old tech debt, starting from the old
`del_reqs` and `CheckParts` which still contain lines about old janky
bandaids that are no longer in use nor reachable, up to the
`customizable_reagent_holder` component which has some harddel issues
when your custom food is sliced, and items used in food recipes not
being deleted and instead stored inside the result with no purpose as
well as other inconsistencies like stack recipes that transfer materials
having counterparts in the UI that don't do that.

EDIT: Several things have come up while working on this, so I apologise
that it ended up changing over 100+ files. I managed to atomize some of
the changes, but it's a bit tedious.

EDIT: TLDR because I was told this section is too vague and there's too
much going on. This PR:
- Improves the dated crafting code (not the UI).
- replaced `atom/CheckParts` and `crafting_recipe/on_craft_completion`
with `atom/on_craft_completion`.
- Reqs used in food recipes are now deleted by default and not stored
inside the result (they did nothing).
- Renames the customizable_reagent_holder comp and improves it (No
harddels/ref issues).
- Adds a unit test that tries to craft all recipes to see what's wrong
(it skips some of the much more specific reqs for now).
- In the unit test is also the code to make sure materials of the
crafted item and a non-crafted item of the same type are roughly the
same, so far only applied to food.
- Some mild material/food refactoring around the fact that food item
code has been changed to support materials.

## Why It's Good For The Game
Improving the backbone of the crafting system. Also materials and food
code.

## Changelog

🆑
refactor: Refactored crafting backend. Report possible pesky bugs.
balance: the MEAT backpack (from the MEAT cargo pack) may be a smidge
different because of code standardization.
/🆑
2025-06-01 16:37:43 -07:00
John Willard
c51ee7efa5 Cyborgs now use storage datum (#90927)
## About The Pull Request

This moves Cyborgs onto using storage datums, removing the remenants of
the shitcode that was Cyborg inventory. It's now done mostly by
equipping/unequipping/storage items, much like how other mobs do.
This allows borgs to take advantage of more hand support stuff and
things like ``dropped()``, so borgs no longer have to copy paste drop
code to ``cyborg_unequip``

It also:
- Removes ``CYBORG_ITEM_TRAIT``
- Removes all borg items being ``NODROP``


https://github.com/user-attachments/assets/11442a10-3443-41f2-8c72-b38fb0126cdb

## Why It's Good For The Game

Currently borgs are able to have their entire inventory open and a bag
below it, which I thought was a little weird. I always assumed they WERE
storage items, so I guess I'm doing it myself.
Cyborgs using storage code makes it easier for contributors to actually
do stuff with, without risking breaking everything. It also hopefully
will make borg items more resilient against breaking in the future, now
that we're not relying on nodrop.
Also just brings them more in line with other mobs, all of which make
use of storages.

## Changelog

🆑
refactor: Cyborg's modules now use storage (so opening a bag will close
modules instead of overlap one over the other).
qol: Observers can now see Cyborg's inventories (like they can for
humans).
/🆑

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2025-06-01 01:26:53 +00:00
SmArtKar
b4061f1800 [MDB IGNORE] Blood Refactor Chapter 2: Collector's Edition (#91054)
## About The Pull Request

Refactors most of blood handling code untouched by #90593 and completely
rewrites all blood decals, components and reagents.

- Blood types now have behavioral flags which allow them to control
where they leave decals/DNA/viruses. Oil no longer transfers DNA and
viruses with it, while podpeople water-blood doesn't leave visible
decals on turfs and items, but still can be picked up by DNA scanners.
- Multiple blood types have received unique handling - liquid
electricity blood now glows in the dark, oil trails are flammable and
lube ones are slippery. Oil blood can be restored with fuel, lube with
silicon and slime with stable plasma (as normal plasma already passively
regenerates their blood), instead of everything using iron. Saline
solution only supplements on iron-based blood and won't do anything to
help with bloodloss for species who rely on different blood types.
(Roundstart this applies only to Ethereals)
- All blood logic has been moved away from the blood reagent itself into
a blood element that is assigned to the blood reagent by default, and to
any reagent that's drawn from a mob as their "blood" (in
``transfer_blood_to``). This means that blood you draw from lizards will
be green and have lizard's blood description instead of mentioning red
blood cells, Ethereal "blood" will actually contain their DNA and genes,
etc.
- Refactored all blood decals. Blood states are no more, everything is
now handled via blood DNA. Credits to MrMelbert and Maplestation, as a
significant amount of code has been taken from
https://github.com/MrMelbert/MapleStationCode/pull/436 and many of his
followup PRs. Oil and xenomorph splatters are now subtypes of blood,
blood drying is now animated, blood trails now curve and can be
diagonal.
- Rewrote bloodysoles and bloody_spreader components, credits to Melbert
again for the former, while latter now makes more sense with its
interactions. Bloody soles no longer share blood DNA with your hands.
- Ported Melbert's bloody footprint sprites and bot-blood-spreading
functionality.
- Removed all species-side reagent interactions, instead they're handled
by said species' livers. (This previously included exotic blood
handling, thus the removal)
- Slightly optimized human rendering by removing inbetween overlay
holders for clothing when they're not needed.
- Blood-transmitted diseases will now get added to many more decals than
before.
- Cleaned up and partially refactored replica pods, fixed an issue where
monkeys/manipulators were unable to harvest mindless pods.
- Exotic bloodtype on species now automatically assigns their blood
reagent, without the need to assign them separately.
- Clown mobs now bleed (with colorful reagent instead of blood during
april fools), and so do vatbeasts (lizard blood)
- Implemented generic procs for handling bleeding checks, all sorts of
scanners now also correctly call your blood for what it is.
- Podpeople's guts are now lime-green like their organs, instead of
being weirdly greyish like their water-blood. (Their bleeding overlays
are still grey, as they're bleeding water)
- Slimepeople now can bleed. Their jelly is pale purple in color, but
their wound overlays copy their body color.
- Injecting/spraying/splashing/etc mob with a reagent preserves its
data, so you could theoretically recycle fine wines from someone's
bloodstream
- Fixed burdened chaplain's sect never actually giving a blessing when
applying effects, and giving a blessing when nothing can be healed.
Inverted check strikes again.

- Closes #91039 

#### Examples

A lot of blood here has dried, visually the blood colors are almost
exactly the same as before either of the blood refactors.


![dreamseeker_BSP7FE9pRB](https://github.com/user-attachments/assets/45711fa0-ae65-4ec2-9e89-753fa7dd876f)

![dreamseeker_zyv9ssh5VN](https://github.com/user-attachments/assets/7b112854-b7e3-4bfe-b78b-199a55b5b051)
2025-05-31 19:38:07 -05:00
Jeremiah
9db2f6916b Sets prettier to run on the repo (#91379)
## About The Pull Request
Prettier (an auto formatter) is set to only run within the tgui folder
currently. This removes that limitation, allowing it to automatically
format all supported files in the repo (.js, .html, .yml
[etc](https://prettier.io/docs/))

I made a few exceptions for bundled and generated files
## Why It's Good For The Game
I'm of the opinion that code should look uniform and am lazy enough to
want CTRL-S to format files without having to think beyond that
## Changelog
2025-05-29 21:23:59 -07:00
Bloop
cb51a652a9 Adds automatic GAGS icon generation for mapping and the loadout menu (#90940)
## About The Pull Request

Revival of https://github.com/tgstation/tgstation/pull/86482, which is
even more doable now that we have rustg iconforge generation.

What this PR does:

- Sets up every single GAGS icon in the game to have their own preview
icon autogenerated during compile. This is configurable to not run
during live. The icons are created in `icons/map_icons/..`
- This also has the side effect of providing accurate GAGS icons for
things like the loadout menu. No more having to create your own
previews.


![FOuGL6ofxC](https://github.com/user-attachments/assets/e5414971-7f13-4883-9f7f-a8a212b46fe8)

<details><summary>Mappers rejoice!</summary>


![StrongDMM_1oeMSoRHXT](https://github.com/user-attachments/assets/83dcfe4c-31be-4953-98f3-dff90268bbc4)


![StrongDMM_uyqu3CggPn](https://github.com/user-attachments/assets/7896f99e-2656-40e1-a9da-3a513882365a)

</details>

<details><summary>Uses iconforge so it does not take up much time during
init</summary>


![dreamdaemon_u4Md3Dqwge](https://github.com/user-attachments/assets/17baaff8-5d5e-4a4d-ba8f-9dd548024155)

</details>

---

### Copied from https://github.com/tgstation/tgstation/pull/86482 as
this still applies:

Note for Spriters:

After you've assigned the correct values to vars, you must run the game
through init on your local machine and commit the changes to the map
icon dmi files. Unit tests should catch all cases of forgetting to
assign the correct vars, or not running through init.

Note for Server Operators:

In order to not generate these icons on live I've added a new config
entry which should be disabled on live called GENERATE_ASSETS_IN_INIT in
the config.txt


## Why It's Good For The Game

No more error icons in SDMM and loadout.

## Changelog

🆑
refactor: preview icons for greyscale items are now automatically
generated, meaning you can see GAGS as they actually appear ingame while
mapping or viewing the loadout menu.
/🆑

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2025-05-24 15:21:02 -07:00
OrbisAnima
0720e6493e Fishing Fixes - Explosive and NPC fishing relegated to only Industrial fishing (#90990)
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

Places a check to see if there is a fishing count regen list, and
creates a new one if there is not. Then apply a 30 minutes regen on
things that have no regen listed.

Removes explosions and NPC's from fishing both message in a bottle and
unique items.

Adjust the tables of Lavaland and Icemoon maps. Made sure both fishing
sources have skeleton keys, tendril chests and runite on both tables, to
equalize the fishing experience a bit.

Removes the failing conditions to the Unit Tests related to fishing, as
they depended on this base npc behaviour. I dont have the knowledge to
fix the UT beyond that.

## Why It's Good For The Game

<!-- Argue for the merits of your changes and how they benefit the game,
especially if they are controversial and/or far reaching. If you can't
actually explain WHY what you are doing will improve the game, then it
probably isn't good for the game in the first place. -->

Fixes #90972 

Unique Stuff is good to spawn only for players, not for soulless npc's
and random explosions.

If the rounds extend, is good for content to still exist instead of
being lost forever. Gives the chance to players to persevere should the
round last that long.

We had a lot of duds on Lavaland compared to Icemoon, this just
equalizes it.

Adds Runite to fishing in Lavaland as its used to make Runite fishng
rods, which are good for fishing, it also doesnt alter the balance of
the game like adamantium does.

Tendril Crates on the Icemoon equalizes the loot pool, and makes for an
unique approach to artifacts, albeit slow and super rng based.

Having Skeleton keys appear along with the crates means not only miners
get some juice of the whole ordeal, which to be fair miners rarely sit
down and fish if they want a tendril chest, they just go and get it.

Tests:

Been a test merge since Feb 20 with no issues reported on downstream:
https://github.com/NovaSector/NovaSector/pull/4916

also local: 

![image](https://github.com/user-attachments/assets/daa5558e-cd26-4fdd-8aee-c597c79e9f29)


## Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and its effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->

🆑
add: To future proof and in case we get long rounds, all limited fishing
items regenerate after 30 minutes if they dont have a regeneration time.
add: Skeleton keys, Tendril chests, Runite can be found in Lava and
Plasma lakes now, although they are rare!
balance: Explosions and NPC's no longer nets you uniques from fishing...
Fish if you want them!
/🆑

<!-- Both 🆑's are required for the changelog to work! You can put
your name to the right of the first 🆑 if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
2025-05-21 23:24:27 +00:00
MrMelbert
f245d8ab79 Screenshot Tests Airlocks (#91203)
## About The Pull Request

Tests that both normal and glass airlocks, and some of their overlays
work.
2025-05-20 12:07:13 +03:00
SyncIt21
5682423c4c Simplifies borg omnitool test (#91026)
## About The Pull Request
Makes the unit test much more light weight & faster

Testing individual tools in the toolkit is redundant, We only need to
test 1 & can know the others will work for all borg model types as we
only need to check if it reaches the attack chain or not

## Changelog

🆑
code: borg omnitool unit test is much faster
/🆑

---------

Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
2025-05-17 16:19:18 +00:00
MrMelbert
685ca9db69 [MDB Ignore] Damp Rag can now get dirty / Repaths damp rag (it's no longer a cup) (#90700)
## About The Pull Request

- Damp rag is now no longer god's perfect cleaning tool. After blood,
the damp rag will collect it, and after cleaning a lot of blood, you can
no longer clean with the rag until you wash it in a sink (or with
cleaner or however you want)
- This means the rag will collect DNA in it as you clean, which gives
detectives an opportunity to investigate.
- It also means the DNA it collects will occasionally spread onto you,
meaning you will have to clean your gloves or hands.
- Cleaning vomit and such is (currently) unaffected (and does not dirty
the rag).
- Diseases are not currently transferred to the rag (but this would be
fun to add)

- Gauze now gets dirty when using it to wrap bleeding wounds. This is
just visual, though blood DNA gets transferred. It can be washed in a
sink.

- Removed gauze on sink / cloth on sink interaction.
   - Can't really wash gauze with it, plus it's redundant.

- Damp rag is no longer a cup.

## Why It's Good For The Game

Damp rag is just "soap without any downsides", which is kinda lame. 
I thought about going a step further and making it require you wet it
first but then it just becomes "mop but small" which is also lame.

Instead, you're required to clean it, which gives janitors / crewmembers
an alternate cleaning method:
- Soap: Small, finite, limited. Can't be replenished.
- Cleaner: Small, finite, even more limited, ranged. Can be refilled
with chemistry's help.
- Mop: Large, infinite, limited. Needs a water bucket.
- Damp Rag: Small, infinite, limited. Need to clean it after a few goes.

## Changelog

🆑 Melbert
balance: Damp Rags can now get dirty when using them to clean blood,
passing blood DNA along.
add: Gauze now gets dirty when apply it to actively bleeding wounds.
Doesn't spread disease or anything, just passes blood DNA. It can be
cleaned in a sink.
del: Removed cloth on sink / gauze on sink interaction to make rags.
Just use the crafting menu
/🆑
2025-05-16 13:49:27 -07:00
SmArtKar
352c7ecdd7 Refactors ITEM_SLOT_BACKPACK and ITEM_SLOT_BELTPACK out of inventory code (#90869)
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request

So yesterday I've spotted that we had wrong SLOTS_AMT value set, and
went a bit down a rabbit hole and found how abhorrent our
ITEM_SLOT_BACKPACK and ITEM_SLOT_BELTPACK usage is. They're not real
inventory slots, but just "hints" at items being located in backpacks or
belts, or instructions to put an item into a belt/backpack. This PR
rewrites all usages of them as "hints", and adds an equip_to_storage
proc used to equip an item into a storage positioned in a certain slot,
so ``equip_to_slot_if_possible(item, ITEM_SLOT_BACKPACK)`` is now
``equip_to_storage(item, ITEM_SLOT_BACK)``

## Why It's Good For The Game

Its really stupid and we shouldn't have those as slot flags,
ITEM_SLOT_HANDS at least makes sense but those two are just absurd.
Should make equipping things into non-backpack storage a bit easier too,
in case we end up going through with the idea of suit/uniform pockets
being a major part of player inventory.

## Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and its effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->

🆑
refactor: Refactored how backpack and belt contents are handled in mob
inventory code, report any issues with lingering item effects or
inability to equip things into them!
/🆑

<!-- Both 🆑's are required for the changelog to work! You can put
your name to the right of the first 🆑 if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
2025-05-15 01:07:41 +01:00
SmArtKar
0694edc174 Fixes potential edgecases with human limb initialization (#90945)
Human initialization calls species' ``create_fresh_body``, which calls
carbon ``create_bodyparts``, which adds bodyparts directly using
``add_bodypart`` to bypass a lot of unnecessary update calls inside of
that proc. However, this also bypasses 3 comsigs, and bodypart sorting,
which means that order of bodyparts set in
``bodyparts``/``replace_body`` could determine how the mob would spawn
and render until they had a limb reattached to them, and some
bodypart-owned effects like organ set bonuses wouldn't apply on mobs
when they were added from their species.

I've just added a ``lazy`` arg to ``try_attach_limb`` which makes it
only check for limb validity, attach the limb and early return after
sending relevant comsigs without doing any of the updating.
2025-05-04 23:14:19 -04:00
John Willard
008a0c7a86 adds a naked person into unit tests (#90942)
## About The Pull Request

Working on https://github.com/tgstation/tgstation/pull/90711 I noticed I
got a screenshot test error because limbs weren't being rendered
properly, which is cool, however I got this alert from antagonist icon
screenshot tests, for Changelings.
That's when I noticed we don't actually have any screenshot tests to
ensure limbs look the same, so I'm adding a naked person.

## Why It's Good For The Game

If for some reason Changeling's icons are changed or removed, we won't
have any way to tell limb icons randomly break one day because all our
screenshotted mobs are clothed.

## Changelog

Nothing player-facing
2025-05-02 10:13:01 +02:00
Bloop
1d76567535 Fix area contents unit test (#90872) 2025-04-30 17:05:08 -07:00
Bloop
3d01e86e29 There will be (colorful) blood: datumizes bloodtypes, greyscales blood sprites, and fixes a lot of inconsistencies with gibs and forensic data (#90593)
## About The Pull Request


This PR:

- Converts all of the blood types into their own datums, which can be
set up to have their own colors, descriptions, and other fun unique
properties. For example, the clown blood that is constantly randomizing
itself.

- Converts all the blood decals into greyscale, which in turn eliminates
the need for separate xeno sprites. They both use the same ones now.

- Audit of blood splatters/gibs/bodyparts/organs to make sure that they
are getting the correct forensic data applied to them.

- For the admins: Adds a clown blood smite.

My primary goal with was to make the appearance of the new sprites look
almost indistinguishable to the original ones.

I consider this a "first pass", as in there are still some further
refactors I would like to do on the backend side, but am satisfied with
it enough to push it forward as a first step towards a better blood
system! I didn't want to do too much at once because of A) fatigue and
B) easier to test things to make sure I'm not breaking something
important this way.

This has been test-merged on Nova for over a week now and has been going
great, so I finally got around to upstreaming the bones to TG. Although
I did test it a bit you may want to TM it just in case I missed some
things when copying it over.
2025-04-28 00:57:59 -05:00
TiviPlus
50d2533ccb Look up/down now track with the thing you're inside (#90668)
## About The Pull Request
Woaw usable with mechs now!!!
https://github.com/tgstation/TerraGov-Marine-Corps/pull/17693

## Changelog
🆑
fix: Look up/down now track with the thing you're inside instead of
staying in one spot
/🆑

---------

Co-authored-by: TiviPlus <572233640+TiviPlus@users.noreply.com>
2025-04-26 02:18:49 -07:00
Ghom
339616ae78 You can now interact with held mobs beside wearing them (feat: "minor" melee attack chain cleanup) (#90080)
## About The Pull Request
People can now pet held mothroaches and pugs if they want to, or use
items on them, hopefully without causing many issues. After all, it only
took about a couple dozen lines of code to make...

...Oh, did the 527 files changed or the 850~ lines added/removed perhaps
catch your eye? Made you wonder if I accidentally pushed the wrong
branch? or skewed something up big time? Well, nuh uh. I just happen to
be fed up with the melee attack chain still using stringized params
instead of an array/list. It was frankly revolting to see how I'd have
had to otherwise call `list2params` for what I'm trying to accomplish
here, and make this PR another tessera to the immense stupidity of our
attack chain procs calling `params2list` over and over and over instead
of just using that one call instance from `ClickOn` as an argument. It's
2025, honey, wake up!

I also tried to replace some of those single letter vars/args but there
are just way too many of them.

## Why It's Good For The Game
Improving old code. And I want to be able to pet mobroaches while
holding them too.

## Changelog

🆑
qol: You can now interact with held mobs in more ways beside wearing
them.
/🆑
2025-04-23 20:18:26 +00:00
Ghom
32de880995 Fixing two (three?) issues related to fishing. (#90740)
## About The Pull Request
Updating the code, fixing a couple issues steeming from fishing.

## Why It's Good For The Game
This should fix #90594 (I think?!), fix #90712 and fix #88514.

## Changelog

🆑
fix: Fixed moonfish eggs appearing like huge errors inside aquariums.
fix: Fixed starfish suicide sometimes not deleting you.
/🆑
2025-04-23 20:38:58 +01:00
Ghom
de0d79ccc2 Removes the debug box full of fish that doesn't work anymore. (#90739) 2025-04-23 00:06:16 +02:00
MrMelbert
67dd51be79 Reworks language translations. Add partial language understanding. Bilingual update. (#90252)
## About The Pull Request

Fixes #89445 (well, technically. It fixes the bug associated but these
`say`s should really be emotes.)

Three things:

1. Reworks how language translation works.

Rather than scrambling a sentence into a language entirely, sentences
are now scrambled on a per-word basis.

Additionally, the 1000 most common words of a language are *never*
re-scrambled across the duration of a round. Once it's set it's set in
stone.

Example: (Sample / Old / New)


![image](https://github.com/user-attachments/assets/69be41fa-bc40-45f0-bd80-e24e799c9f38)

This allows for a number of things:

- More consistent translations, making it (more) viable to actually
"teach" someone words for something
- Maintaining emphasis such as caps (but not `||`, `++`, or `__` - at
least not yet)
- The following:

2. Adds partial language understanding

Some languages can understand portions of other languages.


![image](https://github.com/user-attachments/assets/b6eee2c7-f564-437b-8c7a-bd1d88a9b680)

This pr adds the following:
- Those who understand Beachtongue can understand 50% of Common and 33%
of Uncommon words.
- Those who understand Common can understand 33% of Beachtongue and 20%
of Uncommon words.
- Those who understand Uncommon can understand 20% of Common and 20% of
Beachtongue words.

3. Bilingual quirk has been expanded to accomodate these changes.

There are now two more preferences:
- Language Speakable
- You can toggle this, so you only understand the language, rather than
understand AND speak.
- Language Skill
- If you choose to be unable to speak the language, you can set how much
of the language you can understand, down to 10%.

## Why It's Good For The Game

Playing around languages is fun, but due to the way our translation
works, ALL context is immediately lost for what the other person may be
saying.

If the other person is shouting in all caps? Output language is normal
chatting. This is lame!

Even if someone is unable to understand you, there's a LOT you can
convey just by how you speak, and getting that across in game is quite
difficult when all translations get mauled so badly.

So this changes that. 

- Emphasis like caps lock is maintained, so you see someone shouting in
caps in a foreign language you can probably intuit something is wrong
(but not what is wrong!)
- Some languages can gleam bits of other languages, so you MIGHT be able
to pick out context if you pay close attention
- "Brother" languages will now feel more like "brothers" and not
completely divergent
- You can even "teach" someone words in your language - at least the
most common words! (Until next round)

## Changelog

🆑 Melbert
add: Languages can now have partial understanding of other languages.
More common English words are more likely to be mutually understood.
add: Those who understand Beachtongue can understand 50% of Common and
33% of Uncommon words.
add: Those who understand Common can understand 33% of Beachtongue and
20% of Uncommon words.
add: Those who understand Uncommon can understand 20% of Common and 20%
of Beachtongue words.
add: Bilingual quirk: You can now choose between being able to speak or
not speak the language
add: Bilingual quirk: You can now choose to have partial understanding
of your language, rather than full.
qol: If you speak in ALL CAPS in a foreign language, the translated
words will also be ALL CAPS.
qol: Many more forms of punctuation are now conveyed across
translations.
qol: The 1000 most common English words will now never be scrambled when
translating into other languages for the duration of the round. This
means you can actually "learn" some words if you are especially
attentive! (Until the next round at least)
refactor: Refactored language translations. Report if you see any super
odd looking translations.
fix: Force-says forcing you to speak common (such as cult invocations)
will now correctly force you to speak common (even if you don't know
common)
/🆑
2025-04-13 22:01:33 +01:00
MrMelbert
af0d361465 Demolition mod is inverted vs "soft" structures like spider webs (#90464) 2025-04-13 11:08:17 +02:00
SmArtKar
44c968f75e Adds a unit test for techweb design presence, puts some missing designs into protolathes (#90219)
## About The Pull Request

Adds a unit test that checks that all designs are accessible through
some source, be it techweb, disks, or innate designs. Certain designs,
like pocket extinguishers, entertainment screens, etc, that have been
present in autolathes but not in the techweb despite having PROTOLATHE
flag assigned have been put into protolathes (where it made sense,
otherwise the flag was removed).
An important change is that restaurant portals are now printable, and
thus can be constructed and deconstructed. Indestructible portals have
been a major gripe of mine for a while, and I don't see a solid reason
for keeping them indestructible if they can easily be printed from the
service protolathe.

Closes #90212

## Why It's Good For The Game

Initial argument for keeping portals unbreakable was to prevent people
from griefing the chef/bartender, but by that logic we can make most
machinery unbreakable too. I don't think that having an unbreakable
portal is good if its locking us out from allowing chefs/bartenders to
reorder or even outright reposition their lunchroom/bar.

## Changelog

🆑
balance: Restaurant portals can now be printed, constructed and
deconstructed. They're also no longer completely invulnerable.
/🆑
2025-04-03 08:05:08 +02:00
RikuTheKiller
4ee5cb9dcc Allows setting tick_interval on status effects to 0, effectively passing process() straight to tick() (#90248)
## About The Pull Request

Adds STATUS_EFFECT_AUTO_TICK, a define with a value of 0 that just makes
process() call tick() every time.

## Why It's Good For The Game

An unambiguous way to make tick() consistent with process() is quite
nice.
Sometimes you just have a status effect that only needs to run every
0.2s or every 2s. (past cases downstream)
Other times you have a status effect that is reliant on being in sync
with process() (my case downstream that started this PR)
2025-04-01 12:29:57 -05:00
SmArtKar
6b83a91956 Revert "Refactor for storage initialization & organization (#89543)" (#90332)
## About The Pull Request

Reverts the storage initialization refactor and all subsequent related
PRs.
The original PR is below our standards both for code quality and
testing, and is majorly flawed at its core. This has been discussed with
other maintainers and headcoder(s?) over on discord. A lot of changes
from the PR could be brought over later, but in its current state it
should not have been merged.

- Closes #90322
- Closes #90313
- Closes #90315
- Closes #90320
- Closes #90312
- Closes #90344

## Why It's Good For The Game

This PR causes a series of major issues which cannot be resolved without
either completely rewriting a lot of the original PR, or bad code.
Not matching our standards is grounds for not merging a PR, and the fact
that a PR should not have been merged is a reason for a revert.

## Changelog
🆑
fix: Fixed a series of storage-related bugs caused by a refactor PR.
/🆑
2025-03-30 21:30:31 +00:00
SmArtKar
bdfe18fbad Blacklists certain RNG-dependant crates from testing (#90333)
## About The Pull Request

Blacklists dumpster, hide, random toys, contraband and random medical
equipment crates from the cargo_crate_sanity unit test. These crates are
innately random, and while we have to be aware of potentially having
their average be over their price, we cannot (sanely) test for that
(without spawning a thousand crates, and even then we're affected by
random). The whole point of these crates is gambling on their value.

Closes #90328 
Closes #90314
Closes #90298
Closes #90253
Closes #90216
Closes #90181
Closes #90178

## Changelog

Not player facing
2025-03-30 21:12:30 +02:00
MrMelbert
4a4f6db8f9 Fix storage whitelists / blacklists being ignored in some contexts (#90231)
## About The Pull Request

It did not return FALSE unless it was set to print messages.

Fixes #90226

## Changelog

🆑 Melbert
fix: Fix storage whitelists / blacklists being ignored in some contexts
(hotkeys)
/🆑
2025-03-25 21:24:39 -07:00
Ghom
523b0b37e8 Simplifies fish traits inheritability a little (#90014)
## About The Pull Request
I'm thinking of removing some of the redundant or unnecessary bad design
from fishing, especially aquariums, which are definitely a bit fringe
and difficult to attend to on top of other stuff. However I don't have
all time of the world so I'd rather start small, even if it isn't the
main obstacle (which is keeping fish alive and getting them to reproduce
in the first place).

Thinking about it, the fact that some traits have a chance not to be
passed down to the offspring even if both parents have them is plain bad
and it's led situations where I couldn' tell if it was a bug or a
feature. The solution? Forgo the probability check for traits shared by
both parents.

## Why It's Good For The Game
Clearly that was bad design. 

## Changelog

🆑
balance: Made fish traits inheritability easier. They're now guaranteed
to be passed down to offsprings if both parents have them.
/🆑
2025-03-22 11:39:39 +01:00
OrionTheFox
38dc2369ef Adds GAGS fedoras, updates all other fedora sprites to match the Detective's (+ other related tweaks) (#90132)
## About The Pull Request
First just to get it out of the way, yippee, greyscale fedoras.
Available in the Clothesmate. Now you can make a hat to match those
custom buttondowns+suitjackets we already have.

![image](https://github.com/user-attachments/assets/98f1c53b-058e-4244-ac04-45197da6ccba)

However, because so many of the fedoras pair with other sprites, I
couldn't just make all of them greyscale. Then they wouldn't quite
match!
So I've updated them all - most of the on-mobs are just slight tweaks to
shading so they (as mentioned) match the detective fedora.
The obj sprites were also changed - most are the newer sprite (again,
detective's) but I opted to keep the Reporter and Curator fedoras as
slightly updated old ones because those in particular feel cooler to
have the wide-brims and the angle.


![image](https://github.com/user-attachments/assets/904a0da8-a134-4629-b8ea-56ee07b6ed18)


**Additional changes you might notice in the screenshot:**
- Beige Suit had its contrast just _barely_ tweaked to match the fedora.
- Carpskin hat has like 3px changed because they were stray/inconsistent
- Curator's `treasure hunter jacket` had its color changed to pair with
the hat. As it was, the hat being the same color would have been near
identical to the detective's, and this actually matches up with the
intended reference better too. (Plus it inadvertently matches the boots)
- All the hats are down 1px to match the detective. With hair masks, it
looks a **lot** better over hair now...
<details><summary>However, for spritetainer's curiosity, this is the
comparison of how it'd look if they were all up 1px</summary>


![image](https://github.com/user-attachments/assets/36a99466-05ab-4474-ae40-19ec190a0b1b)

</details>

<details><summary>I also had to slightly alter the mask because it
originally cut off 1px too much.
No visual change on the only other hat that uses it (the sec helmet)
</summary>


![image](https://github.com/user-attachments/assets/13d95e08-87aa-4bce-9c8b-bb5420f0f3b1)

</details>
## Why It's Good For The Game

**Greyscale Fedoras**
We #love customization. Players can already make their own suits, why
not their own hats to match?

**All the resprites**
Having all of the fedoras looking similar is nice, especially with the
onmob sprites' shading and obj sprites' shapes. Helps players associate
the items with each other better. Plus, the curator's was _really_
soulful.

As for the curator's jacket, I feel having it not be as similar to the
detective's palette will make it stand out more as the unique item it
is. It's a treasure hunter. Give them the admiration they deserve.

**Height/Hairmask**
The height is consistency - one fedora being lower than the other is
confusing and almost looks like a bug.
The hairmask solves the issue that lowering them previously caused - no
more severe clipping with hair.
## Changelog
🆑
add: Added greyscale Fedoras, available in the Clothesmate!
image: Resprited most of the Fedoras - now they'll all be much more
consistent with the detective's updated and sleek ones. They also all
have a hairmask now, so hair will no longer clip with them!
image: To pair with this, the Beige suit has been just slightly tweaked
and the Curator's "Treasure Hunter Jacket" entirely recolored to better
match their fedoras.
/🆑
2025-03-22 03:24:19 -04:00
SmArtKar
64cf28cc4f Adds bodypart visuals for different implants, improves eye color/blinking handling (#90010)
## About The Pull Request

Added visual overlays for all arm implants, HUD implants (not the
headrev one), internal thrusters, breathing tube, nutriment pumps and
reviver implant.


![dreamseeker_wd79oYLszL](https://github.com/user-attachments/assets/76582c23-8639-4261-8414-622a0419dc5b)

![dreamseeker_MnlpCHD0nQ](https://github.com/user-attachments/assets/c4692105-0435-401b-aa30-66a33a813fc4)

![dreamseeker_nLJrSPGC63](https://github.com/user-attachments/assets/5b43a1a6-45d6-454e-9348-c119db3cfb43)

Additionally, added a wrapper for eye color setting which solves the
issue where non-pref sourced eyecolors got reset after changing them,
and changed how blinking works so now update_body calls don't force you
to blink.

## Why It's Good For The Game

Gives you incredible drip (which makes augments feel more impactful) and
allows others to see if you have certain important augments (reviver)
that could matter.
As for technical changes, both were required for this to HUDs to work
nicely and fix some bugs as a side effect.

## Changelog
🆑
add: Certain implants now have visuals when implanted
fix: You no longer blink when you adjust your clothing
fix: Fixed an issue where some NPC/midround humans would not get their
eye color set correctly
/🆑
2025-03-17 19:09:55 +01:00
SmArtKar
845ed7459e Bravo Six, Going Dark: Refactors client colors to fix dupe issues and support filters (#89843)
## About The Pull Request

Completely refactored how client colors are handled. Now they're similar
to traits, having a source associated with them. Instead of adding and
removing by strict type (which makes client colors prone to getting
duplicated and not cleaned up) you remove a filter associated with a
specific source. Adding another client color with the same source as an
already existing one will replace the existing one if its of a different
type, or do nothing if they're the same (unless force is set to TRUE).
Client colors can also force filter splitting, putting all colors that
come before them, themselves, and all colors after them into separate
filters - this is useful to prevent mixing in filters which are supposed
to remove a certain color.

<details>

<summary>Example of how Perceptomatrix and nightmare vision goggles
combined before this PR:</summary>


![dreamseeker_fBOse2i0jq](https://github.com/user-attachments/assets/fb164e1f-ce8b-4a8c-8820-5db25e710056)

And this is after, as you can see nightmare vision effect's red is only
slightly tinted by perceptomatix instead of being literally halved.


![dreamseeker_U6A24fetK8](https://github.com/user-attachments/assets/8d8b3eb5-9f53-4646-bc56-0f5897013c6f)

</details>

Additionally, added support for custom filters (and not just colors) to
client color code to allow us to work with more colorspaces.

Also fixed weird blindness behavior, so this also 
Closes #89787

## Why It's Good For The Game

Makes code less ass to work with, fixes weird color mixing, etc.

## Changelog
🆑
fix: Fixed perceptomatix helmet allowing you to see even when
unconscious
refactor: Refactored how client colors are handled, ensuring that
certain effects like nightmare goggles don't disappear when another
vision-affecting piece of clothing is worn.
/🆑
2025-03-17 11:35:11 +00:00
SSensum13
cb8b669b1b Pointblank shots in combat mode! (#89799)
## About The Pull Request

This PR will allow you to shoot guns pointblank in combat mode by
remaping melee only attack to RMB in combat mode. You still can hold
people on a gunpoint, just use non combat mode to do so.

## Why It's Good For The Game

I think it's much more convenient and intuitive to be able to shoot
pointblank in combat mode.

## Changelog

🆑
qol: Now you can shoot guns pointblank in combat mode! If you want to
attack melee only: use combat mode + right mouse button.
/🆑

---------

Co-authored-by: Sensum <121913313+SSensum@users.noreply.github.com>
2025-03-17 02:07:21 +01:00
SmArtKar
d23f0c6557 Fixes a reagent exposure test flaky (#90053)
## About The Pull Request

I'm highly confused as to A) why this was flaky B) how this even worked
before, converted this to use proper healing/health adjustment methods,
also incorrect feedback in inhalation tests

## Changelog

Not player facing
2025-03-16 17:41:02 +01:00
itsmeow
93a2b723da IconForge: rust-g GAGS (250x faster edition) (#89590)
## About The Pull Request

Offloads GAGS generation to rust-g IconForge.

**Key Notes**

- The builtin GAGS editor still uses the 'legacy' generation to allow
for debugging.
- Does not support `color_matrix` layer type, which is currently not
used by any GAGS configs. Will do nothing if used.
- Does not support `or` blending mode, which is currently not used by
any GAGS configs. Will error if used.
- Has some 'quirks' compared to BYOND when it comes to mixing icon
states with different dir/frame amounts. BYOND will just silently handle
these and it's basically undefined behavior because what should you
expect BYOND to do? IconForge will spit errors out instead. So this PR
also fixes a few of those cases.

Functions by writing output to `tmp/gags/gags-[...].dmi`, copying that
output into the RSC and assigning the file object to `icon`.

Saves ~1.7s init by reducing worst-case GAGS icon generation from 250ms
to 1ms.

Also optimizes `icon_exists` by using `rustg_dmi_icon_states` for file
icons, saving ~60ms. Would have more savings if not for json_decode as
well as DMI parsing in rust being somewhat slow. Perhaps having
`rustg_dmi_icon_states` share a cache with IconForge could reduce this
cost, however I'd still recommend limiting these tests to unit tests
(https://github.com/tgstation/dev-cycles-initiative/issues/34),
especially for GAGS configs. I'm not sure they're worth 700ms.

Saves another ~400ms by replacing `md5asfile` with `rustg_hash_file` in
`/datum/greyscale_config/proc/Refresh`

Savings are likely even higher when combined with #89478, due to
spritesheets sharing a parsed DMI cache with GAGS. This means GAGS will
spend less time parsing icons synchronously and can generate output
faster. Tracy tests with this combo seem to yield ~2sec savings instead
of ~1.7sec

Total savings: ~2.16sec to ~2.46sec

- Ports https://github.com/BeeStation/BeeStation-Hornet/pull/10455
- Resolves https://github.com/tgstation/dev-cycles-initiative/issues/9



## Why It's Good For The Game

GAGS go zoooom

<details>
<summary>GAGS Working Ingame</summary>


![image](https://github.com/user-attachments/assets/28df25a5-bdf0-4a63-a6cf-b15f85467b23)


![image](https://github.com/user-attachments/assets/6a9dab46-5814-47ea-ad9b-f5ec84a6333d)

</details>

<details>
<summary>GetColoredIconByType</summary>


![image](https://github.com/user-attachments/assets/1698729f-1101-4413-bfb3-0922b389c347)

</details>

<details>
<summary>icon_exists</summary>


![image](https://github.com/user-attachments/assets/9e72c6aa-287f-4ce3-8dbe-9d3bebf3a762)

</details>


<details>
<summary>Refresh</summary>


![image](https://github.com/user-attachments/assets/18c15073-a294-4db6-bdd0-cdc7d8682221)

</details>


## Changelog
🆑
tweak: Optimized GAGS using rust-g IconForge, reducing worst-case
generation time to 1ms
/🆑
2025-03-13 20:59:12 -04:00
ArcaneMusic
5624a33c26 Adds a unit test for Cargo Crates to prevent infinite credit oversights. (#89023)
## About The Pull Request

I was kinda shocked that we didn't have something for this considering
that it's an unspoken rule of cargo to check that a crate does not sell
back for more than it's price and that the one comment saying to do so
has been doing some heavy lifting for the last 12 years.

I'm a novice when it comes to unit testing specifically so hopefully the
smoothing out that needs to be done should be fairly quick.

*Edit (2/22/25):*
The following changes were also made in order to allow for this unit
test to work smoothly:

Exports now have a market define added to them, as the purpose of this
unit test is to test exports that occur on the station, bought from
supply and then sold back to supply. As such, these market defines
exclude exports specific to pirates (since the cargo shuttle cannot sell
living mobs back, preventing you from making 10k per parrot crate.).

I've also added the `abstract` variable to some export datums, to
signify that a given export is either variable, or not meant to be
compared against the value of it's own container, such as with gas
canister's base export value as their export datums are generated
dynamically. (The subtypes are not abstract, however.)

The verb, `/mob/living/verb/tally_physical_credits()` has been changed
to `/mob/living/proc/tally_physical_credits()`, because that's my B and
does effect some economy back end but it's a one line fix so I just
absent-mindedly fixed it here instead of atomizing it out. I can
one-line it otherwise.

Mulebots now no longer runtime on spawn as they set their own to their
own `get_turf` as opposed to pulling their `loc`.

A few supply packs have had their prices bumped up slightly to actually
pass the test itself:

* `/datum/supply_pack/misc/candles_bulk`
* `/datum/supply_pack/security/armor`
* `/datum/supply_pack/security/helmets`
* `/datum/supply_pack/security/baton`

## Why It's Good For The Game

Prevents future infinite credit bugs that could have been missed by
simply checking the sale value in game.

## Changelog

🆑
fix: To prevent infinite sales issues, security helmets, armors, and
batons packs now all cost 600 credits, up from 400.
fix: Candle packs now cost 400 credits, up from 300, and candles now
sell for 12.25 cr each.
/🆑

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2025-03-13 23:26:53 +01:00
Ghom
7c703fc712 Food types are now passed down when cooking from recipes. (#89706)
## About The Pull Request
~~I have some beef with the cooking system.~~

Cooking recipes are coded in a way that disregard the possibility for
their components to have different foodtype flags than the ones you
would find normally find.
For example, if I wanted to make corned beef, but instead of a standard
steak, I used a killer tomato "steak", the result would still have the
meat food type, even if none of the components has it.

I've had to resort to a few hacky lines of code to manipulate the food
types from the edible component, but that can be easily fixed if #89687
is merged.

## Why It's Good For The Game
This also makes cooking recipes less strict about their food types and
can help us spot inconsistencies with recipes.

## Changelog

🆑
qol: Food types are now passed down when cooking from recipes. For
example, a plate of corned "beef" made from giant killer tomato slabs no
longer counts as meat but only vegetables now.
fix: Fixed a metric ton of inconsistencies with food types and recipes.
fix: Dank-pockets (the weed variant) can now be microwaved.
/🆑
2025-03-13 20:06:35 +01:00
SmArtKar
eb2796831b [MDB Ignore] Refactors pills, patches, and generalizes stomach contents, nothing to see here. (#89549)
## About The Pull Request

Currently patches are a subtype of pills, and while they have the
``dissolveable`` var set to FALSE, barely anything checks it (because
people don't expect patches to be pills in disguise) so we end up
patches being dissolveable and implantable, which is far from ideal.
Both have been moved into an ``/obj/item/reagent_containers/applicator``
class, which handles their common logic and helps handling cases where
either one fits. As for gameplay changes:
* Pills no longer dissolve instantly, instead adding their contents to
your stomach after 3 seconds (by default). You can increase the timer by
dropping sugar onto them to thicken their coating, 1s per 1u applied, up
to a full minute. Coating can also be dissolved with water, similarly
-1s per 1u applied. Pills with no coating will work like before.
* Patches now only take half as long to apply (1.5s), but also slowly
trickle in their reagents instead of instantly applying all of them.
This is done via embedding so you could theoretically (if you get lucky)
stick a ranged patch at someone, although they are rather quick to rip
off. The implementation and idea itself are separate, but the idea for
having a visual display has been taken from
https://github.com/Monkestation/Monkestation2.0/pull/2558.

![dreamseeker_Ywd4jQcy3t](https://github.com/user-attachments/assets/7ce0e549-9ecd-4a8a-98ea-12e00754bdd9)
* In order to support the new pill mechanics, stomachs have received
contents. Pills and items that you accidentally swallow now go into your
stomach instead of your chest cavity, and may damage it if they're
sharp, requiring having them surgically cut out (cut the stomach open
with a scalpel, then cauterize it to mend the incision). Or maybe you
can get a bacchus's blessing, or a geneticist hulk to gut punch you,
that may also work. Alien devour ability also uses this system now. If
you get a critical slashing wound on your chest contents of your cut
apart stomach (if a surgeon forgot to mend it, or if you ate too much
glass shard for breakfast) may fall out. However, spacemen with the
strong stomach trait can eat as much glass cereal as they want.

Pill duration can also be chosen in ChemMaster when you have a pill
selected, 0 to 30 seconds.

![image](https://github.com/user-attachments/assets/1f40210e-74dd-49c2-8093-432a747ac8dd)

## Why It's Good For The Game

Patches and pills are extremely similar in their implemenation, former
being a worse version of sprays and pills, with only change being that
pills cannot be applied through helmets while patches and sprays ignore
both. This change makes them useful for separate cases, and allows
reenactment of some classic... movie, scenes, with the pill change. As
for stomach contents, this was probably the sanest way of implementing
pill handling, and everything else (item swallowing and cutting stomachs
open to remove a cyanide pill someone ate before it dissolves) kind of
snowballed from there. I pray to whatever gods that are out there that
this won't have some extremely absurd and cursed interactions (it
probably will).

## Changelog
🆑
add: Instead of dissolving instantly, pills now activate after 4
seconds. This timer can be increased by using a dropper filled with
sugar on them, 1s added per 1u dropped.
add: Patches now stick to you and slowly bleed their reagents, instead
of being strictly inferior to both pills and sprays.
add: Items that you accidentally swallow now go into your stomach
contents.
refactor: Patches are no longer considered pills by the game
refactor: All stomachs now have contents, instead of it being exclusive
to aliens. You can cut open a stomach to empty it with a scalpel, and
mend an existing incision with a cautery.
/🆑
2025-03-13 17:31:37 +01:00
Bloop
c9c39dcf5b Adds one more space ruin area type to excluded areas for mapload space verification (#89867)
## About The Pull Request

Tin. This looks like an oversight that this wasn't in here. This is the
area type used for hidden space ruins.

## Why It's Good For The Game

Less CI failures for overhanging lattices in space.
2025-03-08 13:40:19 -06:00
SmArtKar
8bc74ce874 Resprites all eyes and gives cybernetic eyes unique sprites (#89841) 2025-03-06 21:17:01 -05:00
Ghom
9154e28668 unblacklists botany fruits and vegetables from unit tests. (#89683)
## About The Pull Request
subtypes of `/obj/item/food/grown` have no reason to not be spawned by
the `create_and_destroy` unit test, which prevents us from knowing if a
type fruit or veggie doesn't have a set seed in the tests. The only path
that needs to be blacklisted is the common `/obj/item/food/grown` path
itself, since its seed variable needs to remain null so that we can be
warned about any subtype that hasn't overriden that value.
This PR also removes the `/obj/item/food/grown/shell` path which serves
no purpose anymore.

## Why It's Good For The Game
Backend improvements. Atomizing changes from my refactor.

## Changelog
N/A
2025-03-05 14:24:35 +01:00
itsmeow
cc335e7e9e IconForge: rust-g Spritesheet Generation (#89478)
## About The Pull Request

Replaces the asset subsystem's spritesheet generator with a rust-based
implementation (https://github.com/tgstation/rust-g/pull/160).

This is a rough port of
https://github.com/BeeStation/BeeStation-Hornet/pull/10404, but it
includes fixes for some cases I didn't catch that apply on TG.

(FWIW we've been using this system on prod for over a year and
encountered no major issues.)

### TG MAINTAINER NOTE


![image](https://github.com/user-attachments/assets/53bd2b44-9bb5-42d2-b33f-093651edebc0)

### Batched Spritesheets

`/datum/asset/spritesheet_batched`: A version of the spritesheet system
that collects a list of `/datum/universal_icon`s and sends them off to
rustg asynchronously, and the generation also runs on another thread, so
the game doesn't block during realize_spritesheet. The rust generation
is about 10x faster when it comes to actual icon generation, but the
biggest perk of the batched spritesheets is the caching system.

This PR notably does not convert a few things to the new spritesheet
generator.

- Species and antagonist icons in the preferences view because they use
getFlatIcon ~~which can't be converted to universal icons~~.
- Yes, this is still a *massive* cost to init, unfortunately. On Bee, I
actually enabled the 'legacy' cache on prod and development, which you
can see in my PR. That's why I added the 'clear cache' verb and the
`unregister()` procs, because it can force a regeneration at runtime. I
decided not to port this, since I think it would be detrimental to the
large amount of contributors here.
- It is *technically* possible to port parts of this to the uni_icon
system by making a uni_icon version of getFlatIcon. However, some
overlays use runtime-generated icons which are ~~completely unparseable
to IconForge, since they're stored in the RSC and don't exist as files
anywhere~~. This is most noticeable with things like hair (which blend
additively with the hair mask on the server, thus making them invisible
to `get_flat_uni_icon`). It also doesn't help that species and antag
icons will still need to generate a bunch of dummies and delete them to
even verify cache validity.
- It is actually possible to write the RSC icons to the filesystem
(using fcopy) and reference them in IconForge. However, I'm going to
wait on doing this until I port my GAGS implementation because it
requires GAGS to exist on the filesystem as well.

#### Caching

IconForge generates a cache based on the set of icons used, all
transform operations applied, and the source DMIs of each icon used
within the spritesheet. It can compare the hashes and invalidate the
cache automatically if any of these change. This means we can enable
caching on development, and have absolutely no downsides, because if
anything changes, the cache invalidates itself.

The caching has a mean cost of ~5ms and saves a lot of time compared to
generating the spritesheet, even with rust's faster generation. The main
downside is that the cache still requires building the list of icons and
their transforms, then json encoding it to send to rustg.

Here's an abbreviated example of a cache JSON. All of these need to
match for the cache to be valid. `input_hash` contains the transform
definitions for all the sprites in the spritesheet, so if the input to
iconforge changes, that hash catches it. The `sizes` and `sprites` are
loaded into DM.

```json
{
	"input_hash": "99f1bc67d590e000",
	"dmi_hashes": {
		"icons/ui/achievements/achievements.dmi": "771200c75da11c62"
	},
	"sizes": [
		"76x76"
	],
	"sprites": {
		"achievement-rustascend": {
			"size_id": "76x76",
			"position": 1
		}
	},
	"rustg_version": "3.6.0",
	"dm_version": 1
}
```

### Universal Icons

Universal icons are just a collection of DMI, Icon State, and any icon
transformation procs you apply (blends, crops, scales). They can be
convered to DM icons via `to_icon()`. I've included an implementation of
GAGS that produces universal icons, allowing GAGS items to be converted
into them. IconForge can read universal icons and add them to
spritesheets. It's basically just a wrapper that reimplements BYOND icon
procs.

### Other Stuff

Converts some uses of md5asfile within legacy spritesheets to use
rustg_hash_file instead, improving the performance of their generation.

Fixes lizard body markings not showing in previews, and re-adds eyes to
the ethereal color preview. This is a side effect of IconForge having
*much* better error handling than DM icon procs. Invalid stuff that gets
passed around will error instead of silently doing nothing.

Changes the CSS used in legacy spritesheet generation to split
`background: url(...) no-repeat` into separate props. This is necessary
for WebView2, as IE treats these properties differently - adding
`background-color` to an icon object (as seen in the R&D console) won't
work if you don't split these out.

Deletes unused spritesheets and their associated icons (condiments
spritesheet, old PDA spritesheet)

## Why It's Good For The Game

If you press "Character Setup", the 10-13sec of lag is now approximately
0.5-2 seconds.

Tracy profile showing the time spent on get_asset_datum. I pressed the
preferences button during init on both branches. Do note that this was
ran with a smart cache HIT, so no generation occurred.


![image](https://github.com/user-attachments/assets/3efa71ab-972b-4f5a-acab-0892496ef999)

Much lower worst-case for /datum/asset/New (which includes
`create_spritesheets()` and `register()`)


![image](https://github.com/user-attachments/assets/9ad8ceee-7bd6-4c48-b5f3-006520f527ef)

Here's a look at the internal costs from rustg - as you can see
`generate_spritesheet()` is very fast:


![image](https://github.com/user-attachments/assets/e6892c28-8c31-4af5-96d4-501e966d0ce9)

### Comparison for a single spritesheet - chat spritesheet:

**Before**


![image](https://github.com/user-attachments/assets/cbd65787-42ba-4278-a45c-bd3d538da986)

**After**


![image](https://github.com/user-attachments/assets/d750899a-bd07-4b57-80fb-420fcc0ae416)

## Changelog

🆑
fix: Fixed lizard body markings and ethereal feature previews in the
preference menu missing some overlays.
refactor: Optimized spritesheet asset generation greatly using rustg
IconForge, greatly reducing post-initialization lag as well as reducing
init times and saving server computation.
config: Added 'smart' asset caching, for batched rustg IconForge
spritesheets. It is persistent and suitable for use on local, with
automatic invalidation.
add: Added admin verbs - Debug -> Clear Smart/Legacy Asset Cache for
spritesheets.
fix: Fixed R&D console icons breaking on WebView2/516
/🆑
2025-03-03 14:58:27 +01:00
SmArtKar
f40bb684b1 Fixes an old simplemob damage bug (#89759)
## About The Pull Request

Literally every single bit of our code assumes that adjustXLoss returns
the total health delta (old_damage - new_damage), so negative values
when damage was taken and positive when it was healed, ***except***
simplemobs had this inverted for (supposedly) two years. Yeah. This
broke crushers, mending touch and slime feeding - not sure if anything
else was screwed due to this.

Closes #87550

## Why It's Good For The Game


![despair-suffer](https://github.com/user-attachments/assets/cc18bc20-2fd5-48fc-833e-046433185ec5)

## Changelog
🆑
fix: Fixed inconsistent crusher trophy droprates
/🆑
2025-03-03 20:26:52 +11:00
Ghom
da31ea158c The edible component now uses DUPE_SOURCE mode (#89687)
## About The Pull Request
The edible component now uses DUPE_SOURCE mode, which is needed to avoid
conflicts between sources. This includes some other tidbits from my
refactor like renaming dcs/flags.dm to ds/declarations.dm (in virtue of
the fact it doesn't only contain flags anymore even before this PR),
meat materials giving protein and fat reagents to affected atoms instead
of generic nutriment and oil, and the pizza material no longer
containing meat, because margherita pizza, which the material is
extracted from, doesn't contain meat either. The pepperonis were
magically conjured space bs.

## Why It's Good For The Game
There are multiple sources of the edible component and we don't want
issues with that. Also atomizing stuff from my refactor.

## Changelog

🆑
balance: objects made out of meat are no longer classified as gross food
on top of being raw and meaty, and actually contain protein and fat
instead of standard nutriment and oil.
balance: the pizza material stacks, crafted with margherita pizza and
rollig pin mind you, no longer magically contain pepperoni.
/🆑
2025-03-02 13:15:08 +01:00
SmArtKar
889c6dc9fd Implements a quirk spawn validity unit test and fixes a runtime preventing cyborg dogtag quirk from working roundstart (#89728)
## About The Pull Request

Fixes a roundstart-exclusive runtime in the cyborg dogtag quirk, makes
sure that spawning with a fishing toolbox (from a settler quirk) doesn't
runtime and implements a unit test which ensures that all quirks set up
correctly for ***both*** roundstart and latejoin mobs. The cyborg tag
issue is just too stupid and may float up again, considering how easy it
is to accidentally fetch owner's client instead of using the passed one.

## Changelog
🆑
fix: Cyborg pre-screening dogtags should once again be given to crew
with the quirk of the same name.
/🆑
2025-02-28 19:00:47 +01:00
Ghom
d3a56bf429 [NO GBP] Fixes lobstrosities being able to fish other lobstrosities yet again. (#89580) 2025-02-22 11:45:12 +01:00
EnterTheJake
7809f0f501 Introduces 6 New Heretic sideknowledges, 1 new spell to Blade Path. + changes to the Research Tree. (#89169)
## About The Pull Request

Introduces 6 new Heretic Sideknowledges.

**Warren King's Welcome:** Starting side-knowledge, Grants to the
Heretic's id Maints and External Airlock access.

**Phylactery Of Damnation:** T1 Knowledge, located between Imperfect
Ritual and Keykeeper's Burden, creates a bottle that can Siphon a small
quantity of blood from your victim, (they'll still feel a tiny prick).


![potion_red](https://github.com/user-attachments/assets/b000300a-2f2c-47f1-9fd3-b9d8e0f4f587)

**Ether Of The Newborn:** T2 knowledge, replaces Curse Of Paralysis slot
in the tree (Inbetween Mark of Madness and Moonlight Amulette).


![potion_green](https://github.com/user-attachments/assets/bc45c69f-4a16-4879-b788-661112e35638)

1 use potion, fully restores the inbiber to full health, removes any
sort of affliction,trauma,disease or implant at the cost of knocking the
user out for 1 minute.

**Codex Morbus:** T3 knowledge, located between Caretaker's Refuge and
Ringleader's RIse.


![codex
gif](https://github.com/user-attachments/assets/8a15dc78-30b9-4a21-93eb-bafbeebd59a4)


![Codex Morbius
Final](https://github.com/user-attachments/assets/04c8739c-5c65-4246-9408-3cbdbc57a164)


Upgrade of the Codex Cicatrix, draws and siphons runes and essences a
bit faster, can be used on a rune to curse a crewmember, provided their
blood is on the rune or on the Heretic.

**Greaves Of The Prophet:** T3 knowledge, located between Entropic Plume
and Wolves Among Sheep.



![Greaves](https://github.com/user-attachments/assets/287b592e-b771-40ed-99b3-25820550d6a0)

They work as magical magboots minus the slowdown; they confer full
immunity to slips (yes, even space lube).

**Rust Sower Grenade:** T2 knowledge, replaces curse of corrosion in the
tree (between Aggressive Spread and Star Blast).



![Rustsower](https://github.com/user-attachments/assets/297f045c-38c3-4ed0-9046-52d797610339)

Eldritch grenade, Releases a smoke that rusts all affected turfs, blinds
whoever doesn't have mask protection and utterly annihilates silicons,
mechs, augs and bots.

Video Showcase: https://www.youtube.com/watch?v=H1GeO7MYFek

**New Blade Path Spell: Wolves Among Sheep**

Video Showcase: https://www.youtube.com/watch?v=2LsmUiQzpzA

- Briefly transforms the surrounding the heretic into an arena.

- Both The Heretic and Crew members caught inside the spell cannot leave
or change z level until the spell expires.

- The arena is impassable to outsiders.

- Everyone caught inside the spell receives a special buff that makes
them immune to most enviromental hazards and all forms of Crowd Control
while blocking teleportation.

- Non Heretics are granted a temporary Heretic Blade and an antag datum.

- Scoring a critical hit grants the winner the ability to leave the
arena, Critting the heretic fully dissolves the spell.

- Critting yourself doesn't remove the debuff.

- The Heretic receives a heal upon critting someone.

- Breaking a blade while inside the arena will rip off your arm
regardless if you are crew or a Heretic.

- 2 minutes cooldown.

- Replaces Furious Steel as the last spell unlocked pre-ascension.


Lastly as you may have guessed, curses have been completely refactored,
they are now bound to the new item (Codex Morbus), are no longer
empowered by blood but require it as a reagent.

Curse of Corrosion and Paralysis have been rebalanced to be slightly
stronger than they were at their base value now that they can no longer
be empowered.

2 new curses have be introduced.

**Curse Of Indulgence:** tanks the target hunger, makes them a carnivore
and drastically increases their hunger decay rate, lasts 8 minutes.

**Curse Of Transmogrification:** Allows the Heretic to change the
target's Race(minus plasmamen for obvious reasons), lasts until the
Codex Morbus is destroyed.

Lastly the Blade Heretic tree has been shuffled a bit to introduce the
new spell.

Stance Of the Torn Champion has been **TEMPORARILY** Removed, it will
come back in a later PR.

Code by me and Xander

Sprites by INFRARED_BARON and OrcaCora.

Lore tibids by NecromancerAnne.

## Why It's Good For The Game

The following is an atomisation of The Heretic Knowledge Rework I'm
currently working on alongside Edge (Heretic's Grandaddy).

Given the whole PR was probably going to be impossibly big to review; I
asked Melbert If could introduce the new knowledges first, so here we
are.

Do not stress the locations of these knowledges in the tree; While they
do fill what few empty slots we still have, it doesn't change the fact
that the Heretic tree is an incomprehensible mess and will soon be
reworked.

**Warren King's Welcome:**

Not having mantainence access as an antag sucks.

Arguably it sucks even more for Heretics as they are required to find
some place discrete in order to be able to cast their rituals.

It's not unusual for the station to be so crowded, that setting up a
base in space is the only option, the external access helps with that a
little bit.

**Phylactery Of Damnation and Codex Morbus**

Explaining them in the same paragraph as they are intended to be used
together.

Curses might as well not exist in their current state.

The process of cursing a crewmember is way too machineous, annoying, and
nowhere near as affective as simply running to your victim and smacking
it with your blade.

All Curses have now been bundled to the new Codex, they no longer
require X reagents, only a drip of the victim's blood.

That's when the phylactery comes into play.

Victims still feel "a tiny prick" upon being juiced, so beware.

**Ether Of The Newborn:** The point of this knowledge is to serve as a
backup plan to "random bullshittery".


It's not really fun rolling one bad trauma or disease and have it
completely invalidate your Heretic round.

We already have potions that either heal or provide remedies against
wounds/limb loss, the Ether is supposed to be an extreme solution, hence
why it causes a 1 minute sleep upon consumption.

**Greaves Of The Prophet:** Heretic to this day is fairly lacking when
it comes to passive immunities or tools we grant to most of our core
antagonists.

Specifically, for a melee-focused antagonist, a total lack of antislip
is kinda lame, being one of the most common defense tools employed by
the crew against newbie antagonist players.

Given these cannot be concealed unlike the traitor counterpart and how
far down the tree they are, i felt like making them lube resistant was a
unique twist and sensible for what's essentialy our core progression
antagonist.

**Rust Sower Grenade:** directly inspired by the 40k Blight Grenades.

The Rust Sower nades serve a double purpose.

1) They introduce a new form of area Denial available to all heretic
paths.

2) They confer to non Rust Heretics a way to deal with the so hated
Silicon Menace.

I'm of the not-so-unpopular school of thought of "Mechs and Silicons
have had it too good for too long".

A massive chunk of our threat roster gets to this day completely shut
down by mechs.

I feel like it was about time to make everything Inorganic feel afraid
again.

To make it a bit more fair, these grenades have a fairly long detonation
timer and have been given a couple of unique SFX.


**Wolves Among Sheep**

Even after the last batch of Changes, Blade Heretic still felt a bit
uninspired to me.

The path is still essentialy just about running at people and stabbing
them in the face.

While that's part of the appreal, I'd reckon it's still lacking a bit on
the eldritch side of things.

Trapping opponents into an arena when they are forced to either engage
you or betray their friends to escape can create some potentially
interesting story-telling.

It also warps the ,oh, so beloathed stun meta we live in by forcing
participants to resort to lethal weaponry.

Ultimately, this is supposed to be a high risk/high reward spell, if you
trap 5 people arm them with heretic blades, and make them all fully stun
immune, you are likely gonna get lynched.

To free up a slot in the tree I **TEMPORARILY** Removed Stance of the
Torn champion, it will come back in my nextish pr, so don't worry about
it too much.

## Changelog

🆑
add: New Heretic starting Side-Knowdge Warren King's Welcome
add: New Heretic T1 Side knowledge, Phylactery Of Damnation.
add: New Heretic T2 Side knowledge, Ether Of The Newborn.
add: New Heretic T3 Side knowledge, Codex Morbus.
add: New Heretic T2 Side knowledge, Rust Sower grenade.
add: New Heretic T3 Side knowledge, Greaves Of The Prophet.
add: New Blade Path Spell, Wolves Among Sheep.
balance: Heretic curses have been removed from the tree and bundled in
the new Knowledge, Codex Morbus.
balance: Blade Path tree has been shuffled a bit, all spells have been
moved up by one tier to make space for the new spell.
removal: Stance Of The Torn Champion has been removed.
/🆑

---------

Co-authored-by: Xander3359 <66163761+Xander3359@users.noreply.github.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: carlarctg <53100513+carlarctg@users.noreply.github.com>
Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2025-02-17 11:15:20 +01:00
Ghom
e6c03fec85 Fixing issues with non-human mobs that can fish (#89434)
## About The Pull Request
This PR fixes an issue that has been reported about the profound fisher
trait, because even then, a projectile is fired that may hit things
other than the intended target, making it impossible for the mob to
continue fishing if the abstract fishing rod hooks on something else. To
fix this we just need to skip the projectile stuff and go straight to
the `hook_hit` call ~~also allowing someone to fish on oneself (eg.
through the fishing spot generated by the organ manip surgery)~~.

Also dealt with a few other issues like a "interrupted!" balloon alert
being sent after the minigame is already completed, fritterish icons,
layering of the float, a bad signal and a redundant check meant to stop
explosions from spawning fishing loot from chasms (because someone
forgot to add the relative flag).

## Why It's Good For The Game
This should fix #88974 and other stuff as well

## Changelog

🆑
fix: Trying to fish on an adjacent spot won't end up hitting other
things on the same turf (provided you actually click the fishing spot
and not other things).
fix: Fixing the icon state for the "fritterish" fish variants.
/🆑
2025-02-16 17:44:44 +11:00
Jacquerel
23ac16411d Removes Secondary & Final Objectives from Traitors (#89466)
## About The Pull Request


![image](https://github.com/user-attachments/assets/cb0bffb3-33be-4fb1-baec-a4d0f4a4cd57)
Pre-discussed with @Watermelon914, this PR removes Secondary & Final
Objectives from all Traitors, rather than just midround ones. It also
removes all of the surrounding supporting code.
Randomly assigned Primary Objectives still exist, I just used the
ability to rewrite mine to take the screenshot.

In terms of final objectives, the surrounding items that were available
still exist but don't necessarily have sources.
If anyone has good ideas for readding these in some other form it can be
done in future PRs.

It also allows all traitors to buy the Contractor kit, previously
limited to midround traitors which lacked secondary objectives, because
now all traitors lack secondary objectives.

This essentially limits all traitors to a maximum of 20 TC (16 if they
spawn with an uplink implant). Currently I don't foresee that they
strictly need any additional way of gaining TC during a round as 20 is
quite sufficient, but it may take some time to adjust and get used to it
after such a long time of having access to more. If we need to adjust
the starting value or add a slow drip of more points over time or
something, that can be done in followup PRs.

This also removes the ability to recreate your uplink added by my
beautiful wife in #74315
This was part of the progression traitor design document, but ultimately
probably a bad idea as it essentially made traitors impossible to
properly disarm. You will once more just need to carefully protect your
uplink.

**This does not remove the threat/progression system**. 
Like midround traitors, all Reputation requirements on gear are now
simple timelocks, most of which will have elapsed by the time 30 minutes
have passed.

**Finally** this PR also adds Romerol to the traitor uplink for 25 TC
and 30 minutes of reputation, as a treat (and because I removed the
final objective that previously granted it).

## Why It's Good For The Game

We've tried this system for a long time (3 years last month!) and while
I think it had a lot of promise, enabled some cool moments, and also
solved several of the problems it set out to solve, overall I think some
of the behaviours it has encouraged in players have been overall
negative for the game.
While the _game systems_ are fine, even quite fun and cool (especially
final objectives) I am of the opinion that having them in the game
creates a net negative purely in the way that they react with players'
_brains_, creating incentives towards behaviour we don't actually want
people to pursue.

While it's hard-to-impossible to prove any of this with hard data, there
has been a prevailing feeling for some time among many (though certainly
not all) people that the simple fact of _having_ a constant drip-feed of
objective available to players leads directly to less interesting
antagonist play. While certainly nobody is _forced_ to do secondary
objectives you are directly and quite strongly rewarded for doing so,
doing so efficiently, and doing so in a way which makes sure that nobody
(alive) sees you do it. This leads to a tendency to play defensively and
try to maximise the number of tasks you can complete in one round, which
also has a knock-on effect of generally minimising the number of people
you attempt to interact with in a round (unless you are killing them).

Even people who _intend_ on doing some more interesting gimmick can fall
into this trap, as "having more tools" is always useful for anyone who
is intending on any kind of plan at all, but then executing on the
secondary objectives again incentivises you to lay low, not interact
with anyone, be efficient, and then reduces the time you are spending
doing the thing that's your actual plan for the round. Removing the
ever-present temptation to fish for extra TC leaves "doing whatever your
actual plan is" as the sole thing to optimise.

Final Objectives too have created unfortunate psychological effects
between crewsided players and other antagonists. Because of the _threat_
(no matter how remote, Final Objectives have always been tuned to be
appropriately rare) that leaving any antagonist alone will cause them to
snowball by acquiring more power, it starts to feel foolish to respond
to any threat with less than the maximum possible level of force even if
they seem relatively innocuous in the moment. This even has an effect on
other non-progression antagonists, as traitors are the most common
antagonist type and how people treat them is going to be their default
level of reaction to most other station threats.

While there has always been the promise of expanding the system with
novel and exciting objectives that leverage appearing mid-round to do
something unique, we've taken very little advantage of that over time.
Most objectives we have added that didn't boil down to "kill someone,
with a twist" have been somewhat unsuccessful, serving either as ways to
get yourself arrested and killed for no reason or ways to get free
telecrystals by doing something the crew don't really care about
stopping you from doing. The option still exists to add more roundstart
objectives to traitors, if someone suddenly has a great idea that would
fit in this space.

The ideal outcome of making this change is a slight relaxation of crew
attitude towards feeling like their only option after catching an
antagonist that isn't sandbagging is to permanently remove them from the
round (although it's fine to do this still in many scenarios), and a
broadening of traitorous activity which is not purely focused on
collecting as many checkboxes as possible and might give people more
time to roleplay with other players, not worrying that this time could
have been more efficiently spent pursuing a different secondary goal.
I don't anticipate or desire that this will prevent traitors from
killing anyone (or even stop them from killing people they don't have a
specific objective to kill), I just want to remove the FOMO from
people's minds.

Also this gives us something to talk about at the coder townhall meeting
on the 22nd.

## Changelog

🆑
del: Misplaced or stolen traitor uplinks can no longer be recreated
using a radio code and special device, guard yours carefully or buy a
backup implant.
del: Roundstart traitors can no longer take on additional objectives in
order to earn additional Telecrystals and fast-forward any unlock timers
on items. They also cannot earn the ability to complete a Final
Objective.
balance: Roundstart traitors can now buy the Contractor Kit from their
traitor uplink, rather than only midround traitors.
add: Traitors can buy Romerol for 25 TC, after 30 minutes of time has
passed in a round.
/🆑
2025-02-14 12:46:56 +00:00
MichiRecRoom
344d3b6266 Optimizes /proc/icon_exists() (#89357)
## About The Pull Request
This PR reimplements https://github.com/tgstation/tgstation/pull/71538
atop `master`. Quoting the original PR:

> Every `icon_exists()` call will cache the entire file. Past me didn't
realise _why_ file opts were so expensive, but I do now. This is
immeasurably slower on a single call, and _significantly_ faster on
subsequent calls to the same file.

I attempted to handle some of the review comments that were posted
there, by splitting screaming functionality into its own proc.

* `if(icon_state in icon_states(file))` and `if(!(icon_state in
icon_states(file)))` were refactored to use `icon_exists(file,
icon_state)`.
* Where screaming was seemingly wanted (and where there wasn't a more
descriptive error inside the `if` block), I refactored them to use
`icon_exists_or_scream(file, icon_state)`
* The exception to the above was under
`/datum/unit_test/turf_icons/Run()` and
`/datum/unit_test/worn_icons/Run()`, where `icon_states()` was being
passed a mode flag. Given that this is only used in unit tests (where
performance isn't a priority), I opted to leave these be.

Additionally, I revised the documentation comment for
`/proc/icon_exists()`, as I felt it was a bit vague currently.

## Why It's Good For The Game
https://youtu.be/Z9G1Mf6TZRs

## Changelog
No player-facing changes (hopefully).

---------

Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
2025-02-05 20:00:27 +01:00
Jacquerel
940e2d31cf tgstation is back online and you are a horrible goose (#89204)
## About The Pull Request

Converts geese to basic mobs.
Nobody else did this one because two separate other developers have said
they started and then examining what the goose does made them feel
mildly ill, but I am stronger.

I will admit though I wasn't 100% committed to making it work exactly
the same way, I rewrote the entire system to use interfaces I like more
(read: I put all this shit in a status effect which means any mob can be
given the ability to vomit out everything in its contents) and if that
means the behaviour is only "inspired by" that didn't bother me that
much.

**Geese:**
- Wander randomly around.
- Peck people who attack them.
- Occasionally start pecking other nearby animals for absolutely no
reason.
- Eat any food they randomly wander within one tile of, but don't seek
it out further than that.
- Eat anything made of plastic that they randomly wander within one tile
of.
- Choke to death over 30 seconds if they eat anything made of plastic.
- Vomit out whatever it was that they choked on when they die.
- Honk (this is new).

The more famous subtype of goose is Birdboat. Birdboat is a unique goose
present on several maps with some additional behaviour.

**Birdboat:**
- Is chill and doesn't start pecking people for no reason.
- Is occasionally possessed by ghosts.
- Builds up an internal vomit-meter as he eats things. Moving around and
just sort of generally hanging will start rolling dice to find out when
Birdboat's tummy gets upset.
- May start vomiting instead of choking to death on plastic, thereby
saving his own life.
- Vomits out everything that he just ate while running around, making a
mess of the floor.
- Starts eating everything he just vomited out again.

Unlike regular geese who just eat your food and it's gone, Birdboat's
miraculous digestion preserves all of the food he eats so if he consumes
the entire kitchen counter it will eventually come back out again the
way it went in. Although you might not want to eat it any more.

The precise way in which this manifests may be slightly different, but
largely this is also what these animals did before.

Other stuff:

I noticed a bunch of find/set behaviours were not setting a search
range? I think that means they were never finding anything?
I did not actually test any of them to see if they were broken, but it's
possible that a bunch of broken AI behaviours like "climbing trees" may
now actually start triggering because they have a search radius greater
than an orange of 0.

I added "keep this in contents instead of deleting it" as a parameter
for generic eating and slapped it on the goldgrub, as it is used in two
places and may end up being used in more.

## Why It's Good For The Game

This kills off the last user of the `retaliate` subtype and makes our
list so so much closer to finish.
It's like... a couple of bots, a handful of oddballs (I'll probably
handle these soon), and then just the mining bosses and minibosses to
go.

If you give a human the vomit goose ability (now that I made it work on
any mob) they will eject all their organs and body parts via the mouth
until they die, if you don't do the brain or heart first you can vomit
your own head off.

## Changelog

🆑
refactor: Geese have been moved to the basic mob subsystem, please
report any unusual behaviour.
/🆑

---------

Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
2025-01-27 14:54:34 +02:00