Files
wwdpublic/Content.Server/Vampire/Injector/BloodSuckerGlandInjectorSystem.cs
VMSolidus 981b7dd9e3 Rebase Blood Drinker System, Arachne, Oneirophage (#438)
# Description
This is a simple rebase of the Blood Drinker System, and its related
features that have been commented out and/or omitted due to its lack of
rebase. I am NOT substantially updating any of this code at this time,
outside of the barest minimum updates needed to make it run in the first
place. The reason I am doing this is that I require the Blood Drinker
system functional as a prerequisite for future features, and I will
update or refactor it when needed.

Arachne are still pending a Full Rework, but that is beyond the scope of
this PR.

# TODO

- [x] Make the code functional
- [x] Port Arachne
- [x] Uncomment Oneirophages
- [x] Re-add Oneirophage midround event

# Changelog

🆑
- add: Arachne have been reimplemented!
- add: Oneirophages are back!

---------

Signed-off-by: VMSolidus <evilexecutive@gmail.com>
2024-08-05 21:52:32 -07:00

40 lines
1.3 KiB
C#

using Content.Server.Popups;
using Content.Shared.Interaction;
namespace Content.Server.Vampiric
{
public sealed class BloodSuckerGlandInjectorSystem : EntitySystem
{
[Dependency] private readonly PopupSystem _popupSystem = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<BloodSuckerGlandInjectorComponent, AfterInteractEvent>(OnAfterInteract);
}
private void OnAfterInteract(EntityUid uid, BloodSuckerGlandInjectorComponent component, AfterInteractEvent args)
{
if (component.Used)
return;
if (!args.CanReach)
return;
if (!TryComp<BloodSuckerComponent>(args.Target, out var bloodSuckerComponent))
return;
// They already have one.
if (bloodSuckerComponent.InjectWhenSucc)
return;
bloodSuckerComponent.InjectWhenSucc = true;
bloodSuckerComponent.InjectReagent = component.InjectReagent;
bloodSuckerComponent.UnitsToInject = component.UnitsToInject;
component.Used = true;
QueueDel(uid);
_popupSystem.PopupEntity(Loc.GetString("bloodsucker-glands-throb"), args.Target.Value, args.Target.Value);
}
}
}