using Content.Server.Body.Components; using Content.Server.Limbus.Traits.Components; using Content.Server.Vampiric; using Content.Shared.Body.Components; using Content.Shared.Body.Systems; namespace Content.Server.Limbus.Traits; public sealed class VampirismSystem : EntitySystem { [Dependency] private readonly SharedBodySystem _body = default!; public override void Initialize() { SubscribeLocalEvent(OnInitVampire); } private void OnInitVampire(Entity ent, ref MapInitEvent args) { EnsureBloodSucker(ent); if (!TryComp(ent, out var body) || !_body.TryGetBodyOrganEntityComps((ent, body), out var comps)) return; foreach (var entity in comps) { if (!TryComp(entity.Owner, out var stomach)) continue; entity.Comp1.MetabolizerTypes = ent.Comp.MetabolizerPrototypes; if (ent.Comp.SpecialDigestible is {} whitelist) stomach.SpecialDigestible = whitelist; } } private void EnsureBloodSucker(Entity uid) { if (HasComp(uid)) return; AddComp(uid, new BloodSuckerComponent { Delay = uid.Comp.SuccDelay, InjectWhenSucc = false, // The code for it is deprecated, might wanna make it inject something when (if?) it gets reworked UnitsToSucc = uid.Comp.UnitsToSucc, WebRequired = false }); } }