Merge remote-tracking branch 'upstream/master' into upstream
# Conflicts: # Content.Client/_Ohio/UI/AnimatedBackgroundControl.cs # Resources/Prototypes/_White/AnimatedLobbyScreens/lobbyScreens.yml
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Content.Server.Temperature.Components;
|
||||
using Content.Server.Temperature.Systems;
|
||||
using Content.Shared.Changeling;
|
||||
using Content.Shared.Movement.Components;
|
||||
using Content.Shared.Movement.Systems;
|
||||
|
||||
@@ -20,7 +21,9 @@ public sealed class LowTemperatureSlowdownSystem : EntitySystem
|
||||
private void OnMoveSpeedRefresh(EntityUid uid, TemperatureComponent component,
|
||||
RefreshMovementSpeedModifiersEvent args)
|
||||
{
|
||||
var modifier = !component.Slowdown ? 1f : GetSpeedModifier(component.CurrentTemperature);
|
||||
var modifier = HasComp<VoidAdaptationComponent>(uid) || !component.Slowdown
|
||||
? 1f
|
||||
: GetSpeedModifier(component.CurrentTemperature);
|
||||
args.ModifySpeed(modifier, modifier);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace Content.Server._White.Lighting;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed partial class PointLightBatteryComponent : Component
|
||||
{
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public bool RequireBattery = true;
|
||||
}
|
||||
30
Content.Server/_White/Lighting/PointLightBatterySystem.cs
Normal file
30
Content.Server/_White/Lighting/PointLightBatterySystem.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Content.Shared.Lightning;
|
||||
using Content.Shared.PowerCell;
|
||||
using Content.Shared.PowerCell.Components;
|
||||
|
||||
namespace Content.Server._White.Lighting;
|
||||
|
||||
public sealed class PointLightBatterySystem : SharedLightningSystem
|
||||
{
|
||||
[Dependency] private readonly SharedPointLightSystem _pointLightSystem = default!;
|
||||
[Dependency] private readonly SharedPowerCellSystem _cell = default!;
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<PointLightBatteryComponent, PowerCellChangedEvent>(OnBatteryLoose);
|
||||
}
|
||||
|
||||
private void OnBatteryLoose(EntityUid uid, PointLightBatteryComponent component, PowerCellChangedEvent args)
|
||||
{
|
||||
if (!component.RequireBattery)
|
||||
return;
|
||||
|
||||
if (!_pointLightSystem.TryGetLight(uid, out var pointLightComponent))
|
||||
return;
|
||||
|
||||
var isBatteryCharged = _cell.HasDrawCharge(uid);
|
||||
_pointLightSystem.SetEnabled(uid, isBatteryCharged && !args.Ejected, pointLightComponent);
|
||||
|
||||
RaiseLocalEvent(uid, new PointLightToggleEvent(isBatteryCharged && !args.Ejected), true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user