Wire action cleanup (#13496)
This commit is contained in:
@@ -5,16 +5,11 @@ using Content.Shared.Wires;
|
||||
|
||||
namespace Content.Server.Arcade;
|
||||
|
||||
[DataDefinition]
|
||||
public sealed class ArcadePlayerInvincibleWireAction : BaseToggleWireAction
|
||||
{
|
||||
private string _text = "MNGR";
|
||||
protected override string Text
|
||||
{
|
||||
get => _text;
|
||||
set => _text = value;
|
||||
}
|
||||
private Color _color = Color.Purple;
|
||||
public override string Name { get; set; } = "wire-name-arcade-invincible";
|
||||
|
||||
public override Color Color { get; set; } = Color.Purple;
|
||||
|
||||
public override object? StatusKey { get; } = SharedSpaceVillainArcadeComponent.Indicators.HealthManager;
|
||||
|
||||
@@ -32,27 +27,24 @@ public sealed class ArcadePlayerInvincibleWireAction : BaseToggleWireAction
|
||||
&& !arcade.PlayerInvincibilityFlag;
|
||||
}
|
||||
|
||||
public override StatusLightData? GetStatusLightData(Wire wire)
|
||||
public override StatusLightState? GetLightState(Wire wire)
|
||||
{
|
||||
var lightState = StatusLightState.Off;
|
||||
|
||||
if (IsPowered(wire.Owner) && EntityManager.TryGetComponent<SpaceVillainArcadeComponent>(wire.Owner, out var arcade))
|
||||
if (EntityManager.TryGetComponent<SpaceVillainArcadeComponent>(wire.Owner, out var arcade))
|
||||
{
|
||||
lightState = arcade.PlayerInvincibilityFlag || arcade.EnemyInvincibilityFlag
|
||||
return arcade.PlayerInvincibilityFlag || arcade.EnemyInvincibilityFlag
|
||||
? StatusLightState.BlinkingSlow
|
||||
: StatusLightState.On;
|
||||
}
|
||||
|
||||
return new StatusLightData(
|
||||
_color,
|
||||
lightState,
|
||||
_text);
|
||||
return StatusLightState.Off;
|
||||
}
|
||||
}
|
||||
|
||||
[DataDefinition]
|
||||
public sealed class ArcadeEnemyInvincibleWireAction : BaseToggleWireAction
|
||||
{
|
||||
public override string Name { get; set; } = "wire-name-player-invincible";
|
||||
public override Color Color { get; set; } = Color.Purple;
|
||||
|
||||
public override object? StatusKey { get; } = null;
|
||||
|
||||
public override void ToggleValue(EntityUid owner, bool setting)
|
||||
|
||||
@@ -5,17 +5,11 @@ using Content.Shared.Wires;
|
||||
|
||||
namespace Content.Server.Arcade;
|
||||
|
||||
[DataDefinition]
|
||||
public sealed class ArcadeOverflowWireAction : BaseToggleWireAction
|
||||
{
|
||||
private Color _color = Color.Red;
|
||||
private string _text = "LMTR";
|
||||
protected override string Text
|
||||
{
|
||||
get => _text;
|
||||
set => _text = value;
|
||||
}
|
||||
|
||||
public override Color Color { get; set; } = Color.Red;
|
||||
public override string Name { get; set; } = "wire-name-arcade-overflow";
|
||||
|
||||
public override object? StatusKey { get; } = SharedSpaceVillainArcadeComponent.Indicators.HealthLimiter;
|
||||
|
||||
public override void ToggleValue(EntityUid owner, bool setting)
|
||||
@@ -32,20 +26,15 @@ public sealed class ArcadeOverflowWireAction : BaseToggleWireAction
|
||||
&& !arcade.OverflowFlag;
|
||||
}
|
||||
|
||||
public override StatusLightData? GetStatusLightData(Wire wire)
|
||||
public override StatusLightState? GetLightState(Wire wire)
|
||||
{
|
||||
var lightState = StatusLightState.Off;
|
||||
|
||||
if (IsPowered(wire.Owner) && EntityManager.HasComponent<SpaceVillainArcadeComponent>(wire.Owner))
|
||||
if (EntityManager.HasComponent<SpaceVillainArcadeComponent>(wire.Owner))
|
||||
{
|
||||
lightState = !GetValue(wire.Owner)
|
||||
return !GetValue(wire.Owner)
|
||||
? StatusLightState.BlinkingSlow
|
||||
: StatusLightState.On;
|
||||
}
|
||||
|
||||
return new StatusLightData(
|
||||
_color,
|
||||
lightState,
|
||||
_text);
|
||||
return StatusLightState.Off;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user