Files
OldThink/Content.Server/Disease/Effects/DiseaseAddComp.cs
Ripmorld 13b208a5f1 Disease stages (#8405)
* Added the stages , time to implelement them

* adjusted the zombie code to fit within the new staged system

* because I forgot it starts at 0

* mmmm Mistaken

* Removed unused comp

* removed DiseaseBuildup comp from IgnoredComponents.cs

* Resolved review

* Delete IgnoredComponents.cs

* Resolved review

* resolved review

Co-authored-by: wrexbe <81056464+wrexbe@users.noreply.github.com>
Co-authored-by: wrexbe <wrexbe@protonmail.com>
2022-06-22 13:41:17 -07:00

23 lines
658 B
C#

using Content.Shared.Disease;
using JetBrains.Annotations;
namespace Content.Server.Disease.Effects;
[UsedImplicitly]
public sealed class DiseaseAddComp : DiseaseEffect
{
[DataField("comp")]
public string? Comp = null;
public override void Effect(DiseaseEffectArgs args)
{
if (Comp == null) return;
EntityUid uid = args.DiseasedEntity;
Component newComponent = (Component) IoCManager.Resolve<IComponentFactory>().GetComponent(Comp);
newComponent.Owner = uid;
if (!args.EntityManager.HasComponent(uid, newComponent.GetType()))
args.EntityManager.AddComponent(uid, newComponent);
}
}