Special digestion & kudzu-eating (#16061)

This commit is contained in:
Kara
2023-05-03 19:49:25 -07:00
committed by GitHub
parent fb61af886c
commit 133cbcbe88
16 changed files with 190 additions and 63 deletions

View File

@@ -1,9 +1,11 @@
using Content.Server.Body.Systems;
using Content.Server.Nutrition.EntitySystems;
using Content.Shared.FixedPoint;
using Content.Shared.Whitelist;
namespace Content.Server.Body.Components
{
[RegisterComponent, Access(typeof(StomachSystem))]
[RegisterComponent, Access(typeof(StomachSystem), typeof(FoodSystem))]
public sealed class StomachComponent : Component
{
public float AccumulatedFrameTime;
@@ -20,12 +22,6 @@ namespace Content.Server.Body.Components
[DataField("bodySolutionName")]
public string BodySolutionName = BloodstreamComponent.DefaultChemicalsSolutionName;
/// <summary>
/// Initial internal solution storage volume
/// </summary>
[DataField("initialMaxVolume", readOnly: true)]
public readonly FixedPoint2 InitialMaxVolume = FixedPoint2.New(50);
/// <summary>
/// Time in seconds between reagents being ingested and them being
/// transferred to <see cref="BloodstreamComponent"/>
@@ -33,6 +29,12 @@ namespace Content.Server.Body.Components
[DataField("digestionDelay")]
public float DigestionDelay = 20;
/// <summary>
/// A whitelist for what special-digestible-required foods this stomach is capable of eating.
/// </summary>
[DataField("specialDigestible")]
public EntityWhitelist? SpecialDigestible = null;
/// <summary>
/// Used to track how long each reagent has been in the stomach
/// </summary>

View File

@@ -16,7 +16,6 @@ namespace Content.Server.Body.Systems
public override void Initialize()
{
SubscribeLocalEvent<StomachComponent, ComponentInit>(OnComponentInit);
SubscribeLocalEvent<StomachComponent, ApplyMetabolicMultiplierEvent>(OnApplyMetabolicMultiplier);
}
@@ -87,11 +86,6 @@ namespace Content.Server.Body.Systems
component.AccumulatedFrameTime = component.UpdateInterval;
}
private void OnComponentInit(EntityUid uid, StomachComponent component, ComponentInit args)
{
_solutionContainerSystem.EnsureSolution(uid, DefaultSolutionName, component.InitialMaxVolume, out _);
}
public bool CanTransferSolution(EntityUid uid, Solution solution,
SolutionContainerManagerComponent? solutions = null)
{