Skip to content

Detritivore Trait - #117

Merged
Dirius77 merged 19 commits into
TheDenSS14:masterfrom
portfiend:feat/detritivore-trait
Jul 1, 2026
Merged

Detritivore Trait#117
Dirius77 merged 19 commits into
TheDenSS14:masterfrom
portfiend:feat/detritivore-trait

Conversation

@portfiend

@portfiend portfiend commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

About the PR

This PR ports the Detritivore trait from TheDenSS14/TheDen#684.

Entities with a detritivorous diet can derive hunger from gastrotoxin, mold, vent crud, and reprocessed material (trash) without being poisoned.

In addition, reprocessed material was given a new poison metabolism for non-Vox/non-Detritivores.

Why / Balance

Required for these PRs:

Technical details

AddMetabolizerTrait is a new trait function that adds metabolizerTypes to all metabolizing organs of an entity that pass a certain whitelist. (You can, for example, make it only affect the heart or lungs, or whatever). This sends an event to the extended MetabolismSystem to add or remove metabolizers respectively when the trait is added/removed.

Detritivore trait adds the "Detritivore" type to all metabolizing organs.

A new set of organs with both "Detritivore" and "Animal" metabolisms were added. This was given to rats (like the Rat King) and mice.

The following metabolisms were added:

  • Detritivores are not poisoned by gastrotoxin and sate hunger from it at 0.5x rate.
  • Detritivores are not poisoned by mold and sate hunger from it at 0.5x rate.
  • Detritivores are not poisoned by vent crud and sate hunger from it at 0.25x rate.
  • Detritivores sate hunger from reprocessed material at 0.25x rate. Non-vox and non-Detritivores take 2 poison damage per 0.5 unit of reprocessed trash.
  • Detritivores are not poisoned by uncooked proteins, and can derive hunger from it, similar to animals.

I'll deal with trait balance later

Test plan

  • Pick the "Detritivore" trait in character editor and spawn in
  • Eat rotten meat, moldy bread, maybe sip on reprocessed material (trash) and vent crud. Should not poison you.
  • Do the same to an unmodified non-Vox urist - they should be poisoned.
  • While you're at it, remove the trait from yourself with self traits:remove Detritivore and try guzzling trash and mold again. You should be made horribly sick.
  • Mice and rat kings should have the Detritivore diet.

Media

image

ill handle trait balance later

Metabolisms

image image image image image

Gameplay

Injecting 15u gastrotoxin each into detritivore and non-detritivore reptilian

image

Removing detritivore trait from self and injecting 15u gastrotoxin

image image

Requirements

  • I have read and am following the Macrocosm Pull Request Conventions.
  • I have tested this pull request and written instructions on how to test it.
  • I have added media to this PR or it does not require an in-game showcase.

Licensing

  • All code in this pull request can be licensed to MIT.
  • (OPTIONAL) I give permission to seeing this feature upstreamed to Macrocosm in the future.

Breaking changes

mice have a BaseMobDetritivore parent that changes their organs
BaseMobRat also had its organs changed
these mobs will be unusable for "animal organ"-type recipes specifically

Changelog

🆑

  • add: You can select the "Detritivore" trait in the character editor to be able to consume gastrotoxin, mold, reprocessed material (trash), and vent crud safely.
  • add: Reprocessed material (trash) is now poisonous to non-Vox and non-Detritivores.
  • add: Mice and rats are now detritivores.

@portfiend
portfiend marked this pull request as ready for review June 29, 2026 13:41
@portfiend

Copy link
Copy Markdown
Contributor Author

ready for review

@Dirius77 Dirius77 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something also feels weird to me about adding Detritivore to the lungs. It shouldn't mechanically do anything, but in all the other cases the metabolizer is only on every organ because it's the species metabolizer, in this case it feels weird to put the metabolizer on an organ that it shouldn't be impacting at all.

Comment thread Content.Shared/_DEN/Metabolism/MetabolizerSystem.cs
Comment thread Content.Shared/_DEN/Metabolism/MetabolizerSystem.cs
@portfiend
portfiend requested a review from Dirius77 July 1, 2026 12:24
@portfiend

Copy link
Copy Markdown
Contributor Author

i think its fine to keep detritivore on lungs for consistency, personally, because breathing is metabolism, and maybe someone wants to add like Toxic Mold Gas later or something. at the moment animal lungs aren't used for anything specific, so

@Dirius77
Dirius77 merged commit b9f3066 into TheDenSS14:master Jul 1, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants