Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -58,7 +58,7 @@ public sealed class TransformableContainerSystem : EntitySystem
|
||||
&& _prototypeManager.TryIndex(reagentId.Value.Prototype, out ReagentPrototype? proto))
|
||||
{
|
||||
var metadata = MetaData(entity.Owner);
|
||||
var val = Loc.GetString("transformable-container-component-glass", ("name", proto.LocalizedName));
|
||||
var val = Loc.GetString("transformable-container-component-glass", ("reagent", proto.LocalizedName));
|
||||
_metadataSystem.SetEntityName(entity.Owner, val, metadata);
|
||||
_metadataSystem.SetEntityDescription(entity.Owner, proto.LocalizedDescription, metadata);
|
||||
entity.Comp.CurrentReagent = proto;
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.Nutrition.Components;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Server.Chemistry.ReagentEffectConditions
|
||||
{
|
||||
public sealed partial class Hunger : ReagentEffectCondition
|
||||
{
|
||||
[DataField]
|
||||
public float Max = float.PositiveInfinity;
|
||||
|
||||
[DataField]
|
||||
public float Min = 0;
|
||||
|
||||
public override bool Condition(ReagentEffectArgs args)
|
||||
{
|
||||
if (args.EntityManager.TryGetComponent(args.SolutionEntity, out HungerComponent? hunger))
|
||||
{
|
||||
var total = hunger.CurrentHunger;
|
||||
if (total > Min && total < Max)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override string GuidebookExplanation(IPrototypeManager prototype)
|
||||
{
|
||||
return Loc.GetString("reagent-effect-condition-guidebook-total-hunger",
|
||||
("max", float.IsPositiveInfinity(Max) ? (float) int.MaxValue : Max),
|
||||
("min", Min));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user