Make energy swords use RgbLightController (#7344)
This commit is contained in:
@@ -183,10 +183,13 @@ namespace Content.Server.Light.EntitySystems
|
||||
_actionSystem.SetToggled(component.ToggleAction, false);
|
||||
_activeLights.Remove(component);
|
||||
component.LastLevel = null;
|
||||
component.Dirty(EntityManager);
|
||||
Dirty(component);
|
||||
|
||||
if (TryComp(component.Owner, out AppearanceComponent? appearance))
|
||||
appearance.SetData(ToggleableLightVisuals.Enabled, false);
|
||||
|
||||
if (makeNoise)
|
||||
SoundSystem.Play(Filter.Pvs(component.Owner), component.TurnOffSound.GetSound(), component.Owner);
|
||||
SoundSystem.Play(Filter.Pvs(component.Owner, entityManager: EntityManager), component.TurnOffSound.GetSound(), component.Owner);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -197,7 +200,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
|
||||
if (!_powerCell.TryGetBatteryFromSlot(component.Owner, out var battery))
|
||||
{
|
||||
SoundSystem.Play(Filter.Pvs(component.Owner), component.TurnOnFailSound.GetSound(), component.Owner);
|
||||
SoundSystem.Play(Filter.Pvs(component.Owner, entityManager: EntityManager), component.TurnOnFailSound.GetSound(), component.Owner);
|
||||
_popup.PopupEntity(Loc.GetString("handheld-light-component-cell-missing-message"), component.Owner, Filter.Entities(user));
|
||||
return false;
|
||||
}
|
||||
@@ -207,7 +210,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
// Simple enough.
|
||||
if (component.Wattage > battery.CurrentCharge)
|
||||
{
|
||||
SoundSystem.Play(Filter.Pvs(component.Owner), component.TurnOnFailSound.GetSound(), component.Owner);
|
||||
SoundSystem.Play(Filter.Pvs(component.Owner, entityManager: EntityManager), component.TurnOnFailSound.GetSound(), component.Owner);
|
||||
_popup.PopupEntity(Loc.GetString("handheld-light-component-cell-dead-message"), component.Owner, Filter.Entities(user));
|
||||
return false;
|
||||
}
|
||||
@@ -219,7 +222,10 @@ namespace Content.Server.Light.EntitySystems
|
||||
component.LastLevel = GetLevel(component);
|
||||
Dirty(component);
|
||||
|
||||
SoundSystem.Play(Filter.Pvs(component.Owner), component.TurnOnSound.GetSound(), component.Owner);
|
||||
if (TryComp(component.Owner, out AppearanceComponent? appearance))
|
||||
appearance.SetData(ToggleableLightVisuals.Enabled, true);
|
||||
|
||||
SoundSystem.Play(Filter.Pvs(component.Owner, entityManager: EntityManager), component.TurnOnSound.GetSound(), component.Owner);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user