-
Notifications
You must be signed in to change notification settings - Fork 8
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
9 changed files
with
95 additions
and
49 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Content.Shared.Damage; | ||
using Robust.Shared.Player; | ||
|
||
namespace Content.Client._SSS.UserInterface; | ||
|
||
public sealed partial class SSSStatusUISystem : EntitySystem | ||
{ | ||
[Dependency] private readonly ISharedPlayerManager _playerManager = default!; | ||
|
||
public event Action<Entity<DamageableComponent>>? OnPlayerDamageChanged; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<DamageableComponent, DamageChangedEvent>(OnDamageChanged); | ||
} | ||
|
||
private void OnDamageChanged(Entity<DamageableComponent> ent, ref DamageChangedEvent args) | ||
{ | ||
var (uid, damagable) = ent; | ||
|
||
if (uid == _playerManager.LocalEntity) | ||
{ | ||
OnPlayerDamageChanged?.Invoke(ent); | ||
} | ||
} | ||
} |
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
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
30 changes: 30 additions & 0 deletions
30
Content.Shared/_SSS/SuspicionGameRule/SuspicionRuleEvents.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,30 @@ | ||
using Content.Shared._SSS.SuspicionGameRule.Components; | ||
using Robust.Shared.Serialization; | ||
|
||
namespace Content.Shared._SSS.SuspicionGameRule; | ||
|
||
|
||
[Serializable, NetSerializable] | ||
public sealed class SuspicionRuleTimerUpdate(TimeSpan endTime) : EntityEventArgs | ||
{ | ||
public TimeSpan EndTime = endTime; | ||
} | ||
|
||
[Serializable, NetSerializable] | ||
public sealed class SuspicionRulePreroundStarted(TimeSpan preroundEndTime) : EntityEventArgs | ||
{ | ||
public TimeSpan PreroundEndTime = preroundEndTime; | ||
} | ||
|
||
[Serializable, NetSerializable] | ||
public sealed class SuspicionRuleUpdateRole(SuspicionRole newRole) : EntityEventArgs | ||
{ | ||
public readonly SuspicionRole NewRole = newRole; | ||
} | ||
|
||
[Serializable, NetSerializable] | ||
public sealed class SuspicionRulePlayerSpawn : EntityEventArgs | ||
{ | ||
public SuspicionGameState GameState; | ||
public TimeSpan EndTime; | ||
} |