Revert 'Revert 'Solution Entities'' (#23168)
This commit is contained in:
@@ -10,10 +10,10 @@ namespace Content.Server.Chemistry.ReagentEffectConditions
|
||||
/// </summary>
|
||||
public sealed partial class Temperature : ReagentEffectCondition
|
||||
{
|
||||
[DataField("min")]
|
||||
[DataField]
|
||||
public float Min = 0;
|
||||
|
||||
[DataField("max")]
|
||||
[DataField]
|
||||
public float Max = float.PositiveInfinity;
|
||||
public override bool Condition(ReagentEffectArgs args)
|
||||
{
|
||||
|
||||
@@ -9,10 +9,10 @@ namespace Content.Server.Chemistry.ReagentEffectConditions;
|
||||
[UsedImplicitly]
|
||||
public sealed partial class HasTag : ReagentEffectCondition
|
||||
{
|
||||
[DataField("tag", customTypeSerializer: typeof(PrototypeIdSerializer<TagPrototype>))]
|
||||
[DataField(customTypeSerializer: typeof(PrototypeIdSerializer<TagPrototype>))]
|
||||
public string Tag = default!;
|
||||
|
||||
[DataField("invert")]
|
||||
[DataField]
|
||||
public bool Invert = false;
|
||||
|
||||
public override bool Condition(ReagentEffectArgs args)
|
||||
|
||||
@@ -7,16 +7,14 @@ namespace Content.Server.Chemistry.ReagentEffectConditions
|
||||
{
|
||||
public sealed partial class MobStateCondition : ReagentEffectCondition
|
||||
{
|
||||
|
||||
|
||||
[DataField("mobstate")]
|
||||
public MobState mobstate = MobState.Alive;
|
||||
[DataField]
|
||||
public MobState Mobstate = MobState.Alive;
|
||||
|
||||
public override bool Condition(ReagentEffectArgs args)
|
||||
{
|
||||
if (args.EntityManager.TryGetComponent(args.SolutionEntity, out MobStateComponent? mobState))
|
||||
{
|
||||
if (mobState.CurrentState == mobstate)
|
||||
if (mobState.CurrentState == Mobstate)
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -25,7 +23,7 @@ namespace Content.Server.Chemistry.ReagentEffectConditions
|
||||
|
||||
public override string GuidebookExplanation(IPrototypeManager prototype)
|
||||
{
|
||||
return Loc.GetString("reagent-effect-condition-guidebook-mob-state-condition", ("state", mobstate));
|
||||
return Loc.GetString("reagent-effect-condition-guidebook-mob-state-condition", ("state", Mobstate));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,13 +11,13 @@ namespace Content.Server.Chemistry.ReagentEffectConditions
|
||||
/// </summary>
|
||||
public sealed partial class OrganType : ReagentEffectCondition
|
||||
{
|
||||
[DataField("type", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<MetabolizerTypePrototype>))]
|
||||
[DataField(required: true, customTypeSerializer: typeof(PrototypeIdSerializer<MetabolizerTypePrototype>))]
|
||||
public string Type = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Does this condition pass when the organ has the type, or when it doesn't have the type?
|
||||
/// </summary>
|
||||
[DataField("shouldHave")]
|
||||
[DataField]
|
||||
public bool ShouldHave = true;
|
||||
|
||||
public override bool Condition(ReagentEffectArgs args)
|
||||
|
||||
@@ -13,14 +13,14 @@ namespace Content.Server.Chemistry.ReagentEffectConditions
|
||||
/// </summary>
|
||||
public sealed partial class ReagentThreshold : ReagentEffectCondition
|
||||
{
|
||||
[DataField("min")]
|
||||
[DataField]
|
||||
public FixedPoint2 Min = FixedPoint2.Zero;
|
||||
|
||||
[DataField("max")]
|
||||
[DataField]
|
||||
public FixedPoint2 Max = FixedPoint2.MaxValue;
|
||||
|
||||
// TODO use ReagentId
|
||||
[DataField("reagent")]
|
||||
[DataField]
|
||||
public string? Reagent;
|
||||
|
||||
public override bool Condition(ReagentEffectArgs args)
|
||||
|
||||
@@ -9,10 +9,10 @@ namespace Content.Server.Chemistry.ReagentEffectConditions
|
||||
/// </summary>
|
||||
public sealed partial class SolutionTemperature : ReagentEffectCondition
|
||||
{
|
||||
[DataField("min")]
|
||||
[DataField]
|
||||
public float Min = 0.0f;
|
||||
|
||||
[DataField("max")]
|
||||
[DataField]
|
||||
public float Max = float.PositiveInfinity;
|
||||
public override bool Condition(ReagentEffectArgs args)
|
||||
{
|
||||
|
||||
@@ -7,10 +7,10 @@ namespace Content.Server.Chemistry.ReagentEffectConditions
|
||||
{
|
||||
public sealed partial class TotalDamage : ReagentEffectCondition
|
||||
{
|
||||
[DataField("max")]
|
||||
[DataField]
|
||||
public FixedPoint2 Max = FixedPoint2.MaxValue;
|
||||
|
||||
[DataField("min")]
|
||||
[DataField]
|
||||
public FixedPoint2 Min = FixedPoint2.Zero;
|
||||
|
||||
public override bool Condition(ReagentEffectArgs args)
|
||||
|
||||
Reference in New Issue
Block a user