Metabolism tweaks / metabolism 4.0 (#5246)

* Metabolism tweaks

* use MetabolismArgs and convert ReagentEntityReactions into ReagentEffects

* fork forgor 💀

* fixes
This commit is contained in:
mirrorcult
2021-11-10 03:11:28 -07:00
committed by GitHub
parent 6486e07077
commit 747f02f3f3
41 changed files with 328 additions and 291 deletions

View File

@@ -1,7 +1,9 @@
using System;
using System.Collections.Generic;
using Content.Shared.Chemistry.Reagent;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
namespace Content.Shared.Chemistry.Reaction
{
@@ -10,7 +12,20 @@ namespace Content.Shared.Chemistry.Reaction
{
public override string Name => "Reactive";
[DataField("reactions", true, serverOnly:true)]
public ReagentEntityReaction[] Reactions { get; } = Array.Empty<ReagentEntityReaction>();
[DataField("reactions", required: true, readOnly: true, serverOnly: true)]
public List<ReactiveReagentEffectEntry> Reactions { get; } = default!;
}
[DataDefinition]
public class ReactiveReagentEffectEntry
{
[DataField("methods")]
public HashSet<ReactionMethod> Methods = default!;
[DataField("reagents", customTypeSerializer: typeof(PrototypeIdHashSetSerializer<ReagentPrototype>))]
public HashSet<string>? Reagents = null;
[DataField("effects", required: true)]
public List<ReagentEffect> Effects = default!;
}
}