-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
720 additions
and
89 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
Content.Client/_White/Overlays/MindSlave/MindSlaveIconsSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
using Content.Client.Overlays; | ||
using Content.Shared._White.Implants.MindSlave; | ||
using Content.Shared.StatusIcon; | ||
using Content.Shared.StatusIcon.Components; | ||
using Robust.Client.Player; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Client._White.Overlays.MindSlave; | ||
|
||
public sealed class MindSlaveIconsSystem : EquipmentHudSystem<MindSlaveComponent> | ||
{ | ||
[Dependency] private readonly IPrototypeManager _prototype = default!; | ||
[Dependency] private readonly IPlayerManager _player = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<MindSlaveComponent, GetStatusIconsEvent>(OnGetStatusIconsEvent); | ||
} | ||
|
||
private void OnGetStatusIconsEvent( | ||
EntityUid uid, | ||
MindSlaveComponent mindSlaveComponent, | ||
ref GetStatusIconsEvent args) | ||
{ | ||
if (!IsActive | ||
|| args.InContainer | ||
|| !TryComp(_player.LocalEntity, out MindSlaveComponent? ownerMindSlave)) | ||
return; | ||
|
||
var mindSlaveIcon = MindSlaveIcon(uid, ownerMindSlave); | ||
args.StatusIcons.AddRange(mindSlaveIcon); | ||
} | ||
|
||
private IEnumerable<StatusIconPrototype> MindSlaveIcon(EntityUid uid, MindSlaveComponent mindSlave) | ||
{ | ||
var result = new List<StatusIconPrototype>(); | ||
string iconType; | ||
var netUid = GetNetEntity(uid); | ||
|
||
if (mindSlave.Master == netUid) | ||
{ | ||
iconType = mindSlave.MasterStatusIcon; | ||
} | ||
else if (mindSlave.Slaves.Contains(netUid)) | ||
{ | ||
iconType = mindSlave.SlaveStatusIcon; | ||
} | ||
else | ||
{ | ||
return result; | ||
} | ||
|
||
if (_prototype.TryIndex<StatusIconPrototype>(iconType, out var mindslaveIcon)) | ||
result.Add(mindslaveIcon); | ||
|
||
return result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
Content.Server/_White/Melee/BloodAbsorb/BloodAbsorbComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace Content.Server._White.Melee.BloodAbsorb; | ||
|
||
[RegisterComponent] | ||
public sealed partial class BloodAbsorbComponent : Component | ||
{ | ||
[DataField] | ||
public bool BloodLust; | ||
|
||
[DataField] | ||
public int MinAbsorb = 1; | ||
|
||
[DataField] | ||
public int MaxAbsorb = 20; | ||
|
||
[DataField] | ||
public float AbsorbModifierOnHeavy = 0.7f; | ||
} |
Oops, something went wrong.