This reverts commit 40e2e78e0f.
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Collections.Generic;
|
||||
using Content.Shared.Administration.Logs;
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.Converters;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.FixedPoint;
|
||||
using JetBrains.Annotations;
|
||||
@@ -21,32 +18,26 @@ namespace Content.Shared.Chemistry.Reagent
|
||||
/// </summary>
|
||||
[ImplicitDataDefinitionForInheritors]
|
||||
[MeansImplicitUse]
|
||||
[JsonConverter(typeof(UniversalJsonConverter<ReagentEffect>))]
|
||||
public abstract class ReagentEffect
|
||||
{
|
||||
[JsonPropertyName("id")] private protected string _id => this.GetType().Name;
|
||||
/// <summary>
|
||||
/// The list of conditions required for the effect to activate. Not required.
|
||||
/// </summary>
|
||||
[JsonPropertyName("conditions")]
|
||||
[DataField("conditions")]
|
||||
public ReagentEffectCondition[]? Conditions;
|
||||
|
||||
/// <summary>
|
||||
/// What's the chance, from 0 to 1, that this effect will occur?
|
||||
/// </summary>
|
||||
[JsonPropertyName("probability")]
|
||||
[DataField("probability")]
|
||||
public float Probability = 1.0f;
|
||||
|
||||
[JsonIgnore]
|
||||
[DataField("logImpact")]
|
||||
public virtual LogImpact LogImpact { get; } = LogImpact.Low;
|
||||
|
||||
/// <summary>
|
||||
/// Should this reagent effect log at all?
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
[DataField("shouldLog")]
|
||||
public virtual bool ShouldLog { get; } = false;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using Content.Shared.Converters;
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
@@ -8,11 +7,8 @@ namespace Content.Shared.Chemistry.Reagent
|
||||
{
|
||||
[ImplicitDataDefinitionForInheritors]
|
||||
[MeansImplicitUse]
|
||||
[JsonConverter(typeof(UniversalJsonConverter<ReagentEffectCondition>))]
|
||||
public abstract class ReagentEffectCondition
|
||||
{
|
||||
[JsonPropertyName("id")] private protected string _id => this.GetType().Name;
|
||||
|
||||
public abstract bool Condition(ReagentEffectArgs args);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using Content.Shared.Administration.Logs;
|
||||
using Content.Shared.Body.Prototypes;
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.Reaction;
|
||||
using Content.Shared.Converters;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Robust.Shared.GameObjects;
|
||||
@@ -32,9 +30,6 @@ namespace Content.Shared.Chemistry.Reagent
|
||||
[DataField("name")]
|
||||
public string Name { get; } = string.Empty;
|
||||
|
||||
[DataField("group")]
|
||||
public string Group { get; } = "Unknown";
|
||||
|
||||
[DataField("parent", customTypeSerializer:typeof(PrototypeIdSerializer<ReagentPrototype>))]
|
||||
public string? Parent { get; private set; }
|
||||
|
||||
@@ -144,20 +139,17 @@ namespace Content.Shared.Chemistry.Reagent
|
||||
}
|
||||
|
||||
[DataDefinition]
|
||||
[JsonConverter(typeof(UniversalJsonConverter<ReagentEffectsEntry>))]
|
||||
public class ReagentEffectsEntry
|
||||
{
|
||||
/// <summary>
|
||||
/// Amount of reagent to metabolize, per metabolism cycle.
|
||||
/// </summary>
|
||||
[JsonPropertyName("rate")]
|
||||
[DataField("metabolismRate")]
|
||||
public FixedPoint2 MetabolismRate = FixedPoint2.New(0.5f);
|
||||
|
||||
/// <summary>
|
||||
/// A list of effects to apply when these reagents are metabolized.
|
||||
/// </summary>
|
||||
[JsonPropertyName("effects")]
|
||||
[DataField("effects", required: true)]
|
||||
public ReagentEffect[] Effects = default!;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user