Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…-station-14 into 2024-12-22-cargo-destinations
  • Loading branch information
whatston3 committed Dec 22, 2024
2 parents 795770c + 70a205f commit 6bacb6a
Show file tree
Hide file tree
Showing 88 changed files with 2,499 additions and 401 deletions.
4 changes: 2 additions & 2 deletions Content.IntegrationTests/PoolSettings.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#nullable enable
#nullable enable

using Robust.Shared.Random;

Expand Down Expand Up @@ -93,7 +93,7 @@ public sealed class PoolSettings
/// <summary>
/// Frontier: the preset to run the game in.
/// Set to secret for upstream tests to mimic upstream behaviour.
/// If you need to check adventure game rule things, set this to Adventure.
/// If you need to check adventure game rule things, set this to nfadventure or nfpirate.
/// </summary>
public string GameLobbyDefaultPreset { get; set; } = "secret";

Expand Down
8 changes: 4 additions & 4 deletions Content.Server/AlertLevel/AlertLevelSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,7 @@ public void SetLevel(EntityUid station, string level, bool playSound, bool annou
return;
// End Frontier

if (!Resolve(station, ref dataComponent) // Frontier: remove component
|| component.AlertLevels == null
if (component.AlertLevels == null // Frontier: remove component, resolve station to data component later
|| !component.AlertLevels.Levels.TryGetValue(level, out var detail)
|| component.CurrentLevel == level)
{
Expand All @@ -196,7 +195,7 @@ public void SetLevel(EntityUid station, string level, bool playSound, bool annou
component.CurrentLevel = level;
component.IsLevelLocked = locked;

var stationName = dataComponent.EntityName;
//var stationName = dataComponent.EntityName; // Frontier: remove station name

var name = level.ToLower();

Expand Down Expand Up @@ -232,8 +231,9 @@ public void SetLevel(EntityUid station, string level, bool playSound, bool annou
}
}

if (announce)
if (announce && Resolve(station, ref dataComponent)) // Frontier: add Resolve for dataComponent
{
var stationName = dataComponent.EntityName; // Frontier: moved down
_chatSystem.DispatchStationAnnouncement(station, announcementFull, playDefaultSound: playDefault,
colorOverride: detail.Color, sender: stationName);
}
Expand Down
19 changes: 19 additions & 0 deletions Content.Server/Light/EntitySystems/EmergencyLightSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public override void Initialize()
SubscribeLocalEvent<AlertLevelChangedEvent>(OnAlertLevelChanged);
SubscribeLocalEvent<EmergencyLightComponent, ExaminedEvent>(OnEmergencyExamine);
SubscribeLocalEvent<EmergencyLightComponent, PowerChangedEvent>(OnEmergencyPower);

SubscribeLocalEvent<EmergencyLightComponent, MapInitEvent>(OnMapInit); // Frontier
}

private void OnEmergencyPower(Entity<EmergencyLightComponent> entity, ref PowerChangedEvent args)
Expand Down Expand Up @@ -245,4 +247,21 @@ private void TurnOn(Entity<EmergencyLightComponent> entity, Color color)
_appearance.SetData(entity.Owner, EmergencyLightVisuals.On, true);
_ambient.SetAmbience(entity.Owner, true);
}

// Frontier: ensure the lights are accurate to the station
private void OnMapInit(Entity<EmergencyLightComponent> entity, ref MapInitEvent ev)
{
if (!TryComp<AlertLevelComponent>(_sectorService.GetServiceEntity(), out var alert))
return;

if (alert.AlertLevels == null || !alert.AlertLevels.Levels.TryGetValue(alert.CurrentLevel, out var details))
return;

entity.Comp.ForciblyEnabled = details.ForceEnableEmergencyLights;
if (details.ForceEnableEmergencyLights)
TurnOn(entity, details.EmergencyLightColor);
else
TurnOff(entity, details.EmergencyLightColor);
}
// End Frontier
}
1 change: 0 additions & 1 deletion Content.Server/Shipyard/Systems/ShipyardSystem.Consoles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Content.Server.Radio.EntitySystems;
using Content.Server._NF.Bank;
using Content.Server.Shipyard.Components;
using Content.Shared._NF.GameRule;
using Content.Shared.Bank.Components;
using Content.Shared.Shipyard.Events;
using Content.Shared.Shipyard.BUI;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using Content.Shared.Procedural;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;

namespace Content.Server._NF.GameRule.Components;

[RegisterComponent, Access(typeof(NfAdventureRuleSystem))]
public sealed partial class AdventureRuleComponent : Component
[RegisterComponent, Access(typeof(NFAdventureRuleSystem))]
public sealed partial class NFAdventureRuleComponent : Component
{
public List<EntityUid> NFPlayerMinds = new();
public List<EntityUid> CargoDepots = new();
Expand Down
Loading

0 comments on commit 6bacb6a

Please sign in to comment.