Skip to content

Commit

Permalink
vpm
Browse files Browse the repository at this point in the history
  • Loading branch information
Rxup committed Feb 8, 2024
1 parent 4a7820e commit e8f694c
Show file tree
Hide file tree
Showing 18 changed files with 711 additions and 11 deletions.
1 change: 1 addition & 0 deletions Content.Client/Antag/AntagStatusIconSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public override void Initialize()
SubscribeLocalEvent<Shared.Backmen.Flesh.FleshCultistComponent, GetStatusIconsEvent>(GetIcon);
SubscribeLocalEvent<Shared.Backmen.Blob.BlobObserverComponent, GetStatusIconsEvent>(GetIcon);
SubscribeLocalEvent<Shared.Backmen.Blob.BlobCarrierComponent, GetStatusIconsEvent>(GetIcon);
SubscribeLocalEvent<Shared.Backmen.Vampiric.BkmVampireComponent, GetStatusIconsEvent>(GetIcon);
//end-backmen: antag
}

Expand Down
33 changes: 33 additions & 0 deletions Content.Client/Backmen/Vampiric/BloodSuckerSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using Content.Shared.Antag;
using Content.Shared.Backmen.Blob;
using Content.Shared.Backmen.Vampiric;
using Content.Shared.Ghost;
using Content.Shared.StatusIcon.Components;

namespace Content.Client.Backmen.Vampiric;

public sealed class BloodSuckerSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<BkmVampireComponent, CanDisplayStatusIconsEvent>(OnCanShowVampireIcon);
}

private void OnCanShowVampireIcon<T>(EntityUid uid, T comp, ref CanDisplayStatusIconsEvent args) where T : IAntagStatusIconComponent
{
args.Cancelled = !CanDisplayIcon(args.User, comp.IconVisibleToGhost);
}

/// <summary>
/// The criteria that determine whether a client should see Rev/Head rev icons.
/// </summary>
private bool CanDisplayIcon(EntityUid? uid, bool visibleToGhost)
{
if (visibleToGhost && HasComp<GhostComponent>(uid))
return true;

return HasComp<BkmVampireComponent>(uid);
}
}
5 changes: 4 additions & 1 deletion Content.Server/Backmen/Vampiric/BloodSuckedComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ namespace Content.Server.Backmen.Vampiric;
/// </summary>
[RegisterComponent]
public sealed partial class BloodSuckedComponent : Component
{}
{
[ViewVariables]
public EntityUid? BloodSucker;
}
Loading

0 comments on commit e8f694c

Please sign in to comment.