Blindness networking (#36623)
* Blindness networking Nothing actually sets this. * Update Content.Shared/Traits/Assorted/PermanentBlindnessComponent.cs --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
@@ -5,10 +5,13 @@ namespace Content.Shared.Traits.Assorted;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is used for making something blind forever.
|
/// This is used for making something blind forever.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[RegisterComponent, NetworkedComponent]
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||||
public sealed partial class PermanentBlindnessComponent : Component
|
public sealed partial class PermanentBlindnessComponent : Component
|
||||||
{
|
{
|
||||||
[ViewVariables(VVAccess.ReadWrite), DataField]
|
/// <summary>
|
||||||
public int Blindness = 0; // How damaged should their eyes be. Set 0 for maximum damage.
|
/// How damaged should their eyes be? Set 0 for maximum damage.
|
||||||
|
/// </summary>
|
||||||
|
[DataField, AutoNetworkedField]
|
||||||
|
public int Blindness = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public sealed class PermanentBlindnessSystem : EntitySystem
|
|||||||
|
|
||||||
private void OnExamined(Entity<PermanentBlindnessComponent> blindness, ref ExaminedEvent args)
|
private void OnExamined(Entity<PermanentBlindnessComponent> blindness, ref ExaminedEvent args)
|
||||||
{
|
{
|
||||||
if (args.IsInDetailsRange && !_net.IsClient && blindness.Comp.Blindness == 0)
|
if (args.IsInDetailsRange && blindness.Comp.Blindness == 0)
|
||||||
{
|
{
|
||||||
args.PushMarkup(Loc.GetString("permanent-blindness-trait-examined", ("target", Identity.Entity(blindness, EntityManager))));
|
args.PushMarkup(Loc.GetString("permanent-blindness-trait-examined", ("target", Identity.Entity(blindness, EntityManager))));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user