Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Content.Shared/Body/Components/StomachComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,12 @@ public sealed partial class StomachComponent : Component
/// </summary>
[DataField]
public bool IsSpecialDigestibleExclusive = true;

// ADT-Tweak start
/// <summary>
/// Items matching this whitelist are never digestible by this stomach, overriding everything else.
/// </summary>
[DataField]
public EntityWhitelist? SpecialDigestibleBlacklist = null;
// ADT-Tweak end
}
13 changes: 13 additions & 0 deletions Content.Shared/Nutrition/EntitySystems/IngestionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ public bool IsDigestibleBy(EntityUid food, List<Entity<StomachComponent>> stomac
{
foreach (var ent in stomachs)
{
// ADT-Tweak-Start: чёрный список желудка важнее белого
if (_whitelistSystem.IsWhitelistPass(ent.Comp.SpecialDigestibleBlacklist, food))
continue;
// ADT-Tweak-End
// We need one stomach that can digest our special food.
if (_whitelistSystem.IsWhitelistPass(ent.Comp.SpecialDigestible, food))
return true;
Expand All @@ -207,6 +211,10 @@ public bool IsDigestibleBy(EntityUid food, List<Entity<StomachComponent>> stomac
{
foreach (var ent in stomachs)
{
// ADT-Tweak-Start: чёрный список желудка важнее белого
if (_whitelistSystem.IsWhitelistPass(ent.Comp.SpecialDigestibleBlacklist, food))
continue;
// ADT-Tweak-End
// We need one stomach that can digest normal food.
if (ent.Comp.SpecialDigestible == null
|| !ent.Comp.IsSpecialDigestibleExclusive
Expand Down Expand Up @@ -236,6 +244,11 @@ public bool IsDigestibleBy(EntityUid food, Entity<StomachComponent> stomach)
if (ev.Universal)
return true;

// ADT-Tweak-Start: чёрный список желудка важнее белого
if (_whitelistSystem.IsWhitelistPass(stomach.Comp.SpecialDigestibleBlacklist, food))
return false;
// ADT-Tweak-End

if (ev.SpecialDigestion)
return _whitelistSystem.IsWhitelistPass(stomach.Comp.SpecialDigestible, food);

Expand Down
9 changes: 7 additions & 2 deletions Resources/Prototypes/Body/Species/moth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,16 @@
- ClothMade
- Paper
- Pill
# ADT-Tweak start: моли могут есть фрукты, овощи, и вайтлистнутую еду
# ADT-Tweak start: моли едят любую еду, кроме мяса и снеков
- Fruit
- Vegetable
- ADTMothFriendlyFood
# ADT-Tweak end
isSpecialDigestibleExclusive: false
specialDigestibleBlacklist:
tags:
- Meat
- FoodSnack
# ADT-Tweak end

- type: entity
parent: [OrganBaseLiver, OrganMothInternal, OrganAnimalMetabolizer] # ADT-tweak removed OrganSpriteHumanInternal
Expand Down
Loading