buzz buzz (#5490)
* buzz buzz * Darn now i'm all out of periods thanks mirror fix toy issue * desc edits. * rng and alphabee * adds some missed parens
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.Tag;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
namespace Content.Server.Chemistry.ReagentEffectConditions;
|
||||
|
||||
[UsedImplicitly]
|
||||
public class HasTag : ReagentEffectCondition
|
||||
{
|
||||
[DataField("tag", customTypeSerializer: typeof(PrototypeIdSerializer<TagPrototype>))]
|
||||
public string Tag = default!;
|
||||
|
||||
[DataField("invert")]
|
||||
public bool Invert = false;
|
||||
|
||||
public override bool Condition(ReagentEffectArgs args)
|
||||
{
|
||||
if (args.EntityManager.TryGetComponent<TagComponent>(args.SolutionEntity, out var tag))
|
||||
return tag.HasTag(Tag) ^ Invert;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user