Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into IPCs
  • Loading branch information
Pspritechologist committed Oct 20, 2023
2 parents a63ba88 + a728624 commit 5e50224
Show file tree
Hide file tree
Showing 122 changed files with 581 additions and 28,026 deletions.
12 changes: 1 addition & 11 deletions Content.IntegrationTests/Tests/PostMapInitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,9 @@ public sealed class PostMapInitTest

private static readonly string[] GameMaps =
{
"Angle",
"Arena",
"CentComm",
"Dev",
"Glacier",
"Hammurabi",
"Lighthouse",
"Northway",
"Ovni",
"Pebble",
"Shoukou",
"TheHive",
"Tortuga",
"ParkStation",
};

/// <summary>
Expand Down
48 changes: 42 additions & 6 deletions Content.IntegrationTests/Tests/PrototypeSaveTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,51 @@ public sealed class PrototypeSaveTest
// Don't add to this list unless you have a good reason
// Or it is just temporary because tests stopped working and now master has too many broken entities.

// Sorry, I'm adding to the list :)
"ClothingOuterPurpleCoat",
"MagicMedipen",
"Sleeper",
// TODO: I don't want to figure out what's wrong with these right now - Death
"SleeperPod",
"SleeperParty",
"SurveillanceCameraService",
"BenchParkMiddle",
"MobRevenant",
"SurveillanceCameraEngineering",
"ChairCarp",
"SurveillanceCameraConstructed",
"BenchParkRight",
"SiliconChargerIndustrial",
"Sleeper",
"SurveillanceCameraGeneral",
"BenchSofaCorpLeft",
"BenchSofaMiddle",
"WeaponFlamethrower",
"SurveillanceCameraCommand",
"BenchSofaCorpCorner",
"BenchPewLeft",
"BenchParkBambooMiddle",
"SleeperClockwork",
"ChairBrass",
"BenchSteelMiddle",
"BenchParkBambooLeft",
"SurveillanceCameraSecurity",
"BenchSteelLeft",
"BenchPewRight",
"BenchParkLeft",
"ClothingOuterPurpleCoat",
"BenchSteelWhiteMiddle",
"BenchSteelWhiteRight",
"BenchSofaCorner",
"SleeperParty",
"SurveillanceCameraScience",
"BenchSofaLeft",
"BenchPewMiddle",
"BenchSofaCorpRight",
"BenchSteelRight",
"BenchSteelWhiteLeft",
"BenchSofaRight",
"BenchParkBambooRight",
"SurveillanceCameraMedical",
"SurveillanceCameraSupply",
"SleeperSyndicate",
"WeaponFlamethrower",
"BenchSofaCorpMiddle",
"MobObserverTelegnostic",
};

[Test]
Expand Down
4 changes: 2 additions & 2 deletions Content.Server/Administration/Systems/AdminVerbSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ private void AddDebugVerbs(GetVerbsEvent<Verb> args)
var player = actor.PlayerSession;

// Delete verb
if (_groupController.CanCommand(player, "deleteentity"))
if (_toolshed.ActivePermissionController?.CheckInvokable(new CommandSpec(_toolshed.GetCommand("delete"), null), player, out _) ?? false)
{
Verb verb = new()
{
Expand All @@ -236,7 +236,7 @@ private void AddDebugVerbs(GetVerbsEvent<Verb> args)
}

// Rejuvenate verb
if (_groupController.CanCommand(player, "rejuvenate"))
if (_toolshed.ActivePermissionController?.CheckInvokable(new CommandSpec(_toolshed.GetCommand("rejuvenate"), null), player, out _) ?? false)
{
Verb verb = new()
{
Expand Down
4 changes: 2 additions & 2 deletions Content.Server/Administration/UI/AdminAnnounceEui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ public sealed class AdminAnnounceEui : BaseEui
[Dependency] private readonly IAdminManager _adminManager = default!;
[Dependency] private readonly IChatManager _chatManager = default!;
[Dependency] private readonly IPrototypeManager _proto = default!;
private readonly AnnouncerSystem _announcerSystem;
private readonly AnnouncerSystem _announcerSystem; // Parkstation-RandomAnnouncers
private readonly ChatSystem _chatSystem;

public AdminAnnounceEui()
{
IoCManager.InjectDependencies(this);
_chatSystem = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<ChatSystem>();
_announcerSystem = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<AnnouncerSystem>();
_announcerSystem = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<AnnouncerSystem>(); // Parkstation-RandomAnnouncers
}

public override void Opened()
Expand Down
6 changes: 5 additions & 1 deletion Content.Server/AlertLevel/AlertLevelSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public sealed class AlertLevelSystem : EntitySystem
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly ChatSystem _chatSystem = default!;
[Dependency] private readonly StationSystem _stationSystem = default!;
[Dependency] private readonly AnnouncerSystem _announcerSystem = default!;
[Dependency] private readonly AnnouncerSystem _announcerSystem = default!; // Parkstation-RandomAnnouncers
[Dependency] private readonly IConfigurationManager _cfg = default!;

// Until stations are a prototype, this is how it's going to have to be.
Expand Down Expand Up @@ -173,6 +173,7 @@ public void SetLevel(EntityUid station, string level, bool playSound, bool annou
// var playDefault = false;
if (playSound)
{
// Parkstation-RandomAnnouncers Start
// if (detail.Sound != null)
// {
// var filter = _stationSystem.GetInOwningStation(station);
Expand All @@ -184,14 +185,17 @@ public void SetLevel(EntityUid station, string level, bool playSound, bool annou
// }

_announcerSystem.SendAnnouncementAudio($"alert{level}", _stationSystem.GetInOwningStation(station));
// Parkstation-RandomAnnouncers End
}

if (announce)
{
// Parkstation-RandomAnnouncers Start
// _chatSystem.DispatchStationAnnouncement(station, announcementFull, playDefaultSound: playDefault,
// colorOverride: detail.Color, sender: stationName);

_announcerSystem.SendAnnouncementMessage($"alert{level}", announcementFull, stationName, detail.Color, station);
// Parkstation-RandomAnnouncers End
}

RaiseLocalEvent(new AlertLevelChangedEvent(station, level));
Expand Down
3 changes: 2 additions & 1 deletion Content.Server/Atmos/EntitySystems/AtmosphereSystem.Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Content.Server.Cargo.Systems;
using Content.Shared.Atmos;
using Content.Shared.Atmos.Components;
using Content.Shared.Maps; // Parkstation-ReinforcedReinforcedTiles
using Robust.Shared.Map.Components;
using Dependency = Robust.Shared.IoC.DependencyAttribute;

Expand Down Expand Up @@ -111,7 +112,7 @@ private AtmosDirection GetBlockedDirections(MapGridComponent mapGrid, Vector2i i
/// <param name="tile">The indices of the tile.</param>
private void PryTile(MapGridComponent mapGrid, Vector2i tile)
{
if (!mapGrid.TryGetTileRef(tile, out var tileRef))
if (!mapGrid.TryGetTileRef(tile, out var tileRef) || tileRef.Tile.GetContentTileDefinition().Reinforced) // Parkstation-ReinforcedReinforcedTiles
return;

_tile.PryTile(tileRef);
Expand Down
6 changes: 5 additions & 1 deletion Content.Server/Communications/CommunicationsConsoleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public sealed class CommunicationsConsoleSystem : EntitySystem
[Dependency] private readonly StationSystem _stationSystem = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly AnnouncerSystem _announcerSystem = default!;
[Dependency] private readonly AnnouncerSystem _announcerSystem = default!; // Parkstation-RandomAnnouncers
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;

private const int MaxMessageLength = 256;
Expand Down Expand Up @@ -273,16 +273,20 @@ private void OnAnnounceMessage(EntityUid uid, CommunicationsConsoleComponent com
msg += "\n" + Loc.GetString("comms-console-announcement-sent-by") + " " + author;
if (comp.AnnounceGlobal)
{
// Parkstation-RandomAnnouncers Start
// _chatSystem.DispatchGlobalAnnouncement(msg, title, announcementSound: comp.AnnouncementSound, colorOverride: comp.AnnouncementColor);
_announcerSystem.SendAnnouncement("announce", Filter.Broadcast(), msg, title, comp.AnnouncementColor);
// Parkstation-RandomAnnouncers End

if (message.Session.AttachedEntity != null)
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"{ToPrettyString(message.Session.AttachedEntity.Value):player} has sent the following global announcement: {msg}");

return;
}
// Parkstation-RandomAnnouncers Start
// _chatSystem.DispatchStationAnnouncement(uid, msg, title, colorOverride: comp.AnnouncementColor);
_announcerSystem.SendAnnouncement("announce", Filter.Broadcast(), msg, title, comp.AnnouncementColor);
// Parkstation-RandomAnnouncers End

if (message.Session.AttachedEntity != null)
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"{ToPrettyString(message.Session.AttachedEntity.Value):player} has sent the following station announcement: {msg}");
Expand Down
1 change: 0 additions & 1 deletion Content.Server/Entry/IgnoredComponents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ public static class IgnoredComponents
"ItemStatus",
"Marker",
"GuidebookControlsTest",
"GuidebookBook",
"GuideHelp",
"Clickable",
"Icon",
Expand Down
3 changes: 3 additions & 0 deletions Content.Server/Fluids/EntitySystems/AbsorbentSystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Content.Server.Chemistry.EntitySystems;
using Content.Server.Popups;
using Content.Server.SimpleStation14.EndOfRoundStats.MopUsed; // Parkstation-EndOfRoundStats
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.FixedPoint;
Expand Down Expand Up @@ -213,6 +214,8 @@ private bool TryPuddleInteract(EntityUid user, EntityUid used, EntityUid target,
puddleSolution.AddReagent(PuddleSystem.EvaporationReagent, split.Volume);
absorberSoln.AddSolution(split, _prototype);

RaiseLocalEvent(new MopUsedStatEvent(user, split.Volume)); // Parkstation-EndOfRoundStats

_solutionSystem.UpdateChemicals(used, absorberSoln);
_solutionSystem.UpdateChemicals(target, puddleSolution);
_audio.PlayPvs(absorber.PickupSound, target);
Expand Down
4 changes: 3 additions & 1 deletion Content.Server/GameTicking/GameTicker.RoundFlow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Content.Server.GameTicking
public sealed partial class GameTicker
{
[Dependency] private readonly ITaskManager _taskManager = default!;
[Dependency] private readonly AnnouncerSystem _announcerSystem = default!;
[Dependency] private readonly AnnouncerSystem _announcerSystem = default!; // Parkstation-RandomAnnouncers

private static readonly Counter RoundNumberMetric = Metrics.CreateCounter(
"ss14_round_number",
Expand Down Expand Up @@ -563,13 +563,15 @@ private void AnnounceRound()

var proto = _robustRandom.Pick(options);

// Parkstation-RandomAnnouncers Start
// if (proto.Message != null)
// _chatSystem.DispatchGlobalAnnouncement(Loc.GetString(proto.Message), playSound: true);
//
// if (proto.Sound != null)
// SoundSystem.Play(proto.Sound.GetSound(), Filter.Broadcast());

_announcerSystem.SendAnnouncement(proto.ID, Filter.Broadcast(), Loc.GetString(proto.Message ?? "game-ticker-welcome-to-the-station"));
// Parkstation-RandomAnnouncers End
}
}

Expand Down
4 changes: 3 additions & 1 deletion Content.Server/Nyanotrasen/Fugitive/FugitiveSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public sealed class FugitiveSystem : EntitySystem
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly StunSystem _stun = default!;
[Dependency] private readonly AudioSystem _audioSystem = default!;
[Dependency] private readonly AnnouncerSystem _announcerSystem = default!;
[Dependency] private readonly AnnouncerSystem _announcerSystem = default!; // Parkstation-RandomAnnouncers
[Dependency] private readonly MindSystem _mindSystem = default!;

public override void Initialize()
Expand All @@ -63,8 +63,10 @@ public override void Update(float frameTime)
{
if (cd.AnnounceTime != null && _timing.CurTime > cd.AnnounceTime)
{
// Parkstation-RandomAnnouncers Start
// _chat.DispatchGlobalAnnouncement(Loc.GetString("station-event-fugitive-hunt-announcement"), sender: Loc.GetString("fugitive-announcement-GALPOL"), colorOverride: Color.Yellow);
_announcerSystem.SendAnnouncement("commandreport", Filter.Broadcast(), Loc.GetString("station-event-fugitive-hunt-announcement"), Loc.GetString("fugitive-announcement-GALPOL"), Color.Yellow);
// Parkstation-RandomAnnouncers End

foreach (var console in EntityQuery<CommunicationsConsoleComponent>())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;

namespace Content.Server.Salvage.Expeditions;
Expand Down Expand Up @@ -44,11 +45,8 @@ public sealed class SalvageExpeditionComponent : SharedSalvageExpeditionComponen
/// <summary>
/// Sound that plays when the mission end is imminent.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("sound")]
public SoundSpecifier Sound = new SoundPathSpecifier("/Audio/Misc/tension_session.ogg")
{
Params = AudioParams.Default.WithVolume(-5),
};
[ViewVariables(VVAccess.ReadWrite), DataField("sound", customTypeSerializer: typeof(PrototypeIdSerializer<SoundCollectionPrototype>))] // Parkstation-ExpeditionMusic
public string Sound = "ExpeditionCountdownDefault"; // Parkstation-ExpeditionMusic

/// <summary>
/// The difficulty this mission had or, in the future, was selected.
Expand Down
8 changes: 7 additions & 1 deletion Content.Server/Salvage/SalvageSystem.Runner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems;
using Content.Shared.Salvage.Expeditions;
using Robust.Shared.Audio;
using Robust.Shared.Map.Components;
using Robust.Shared.Player;
using Robust.Shared.Random;
using Robust.Shared.Utility;

namespace Content.Server.Salvage;
Expand Down Expand Up @@ -164,7 +166,11 @@ private void UpdateRunner()
else if (comp.Stage < ExpeditionStage.MusicCountdown && remaining < TimeSpan.FromMinutes(2))
{
// TODO: Some way to play audio attached to a map for players.
comp.Stream = _audio.PlayGlobal(comp.Sound, Filter.BroadcastMap(Comp<MapComponent>(uid).MapId), true);
// Parkstation-ExpeditionMusic Start
if (_prototypeManager.TryIndex<SoundCollectionPrototype>(comp.Sound, out var sound))
comp.Stream = _audio.PlayGlobal(new SoundPathSpecifier(_random.Pick(sound.PickFiles), AudioParams.Default.WithVolume(-6)),
Filter.BroadcastMap(Comp<MapComponent>(uid).MapId), true);
// Parkstation-ExpeditionMusic End
comp.Stage = ExpeditionStage.MusicCountdown;
Dirty(comp);
Announce(uid, Loc.GetString("salvage-expedition-announcement-countdown-minutes", ("duration", TimeSpan.FromMinutes(2).Minutes)));
Expand Down
48 changes: 27 additions & 21 deletions Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem
[Dependency] private readonly ShuttleSystem _shuttle = default!;
[Dependency] private readonly StationSystem _station = default!;
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
[Dependency] private readonly AnnouncerSystem _announcer = default!;
[Dependency] private readonly AnnouncerSystem _announcer = default!; // Parkstation-RandomAnnouncers

private ISawmill _sawmill = default!;

Expand Down Expand Up @@ -188,15 +188,17 @@ public void CallEmergencyShuttle(EntityUid stationUid, StationEmergencyShuttleCo
if (targetGrid == null)
{
_logger.Add(LogType.EmergencyShuttle, LogImpact.High, $"Emergency shuttle {ToPrettyString(stationUid)} unable to dock with station {ToPrettyString(stationUid)}");
// Parkstation-RandomAnnouncers Start
// _chatSystem.DispatchStationAnnouncement(stationUid, Loc.GetString("emergency-shuttle-good-luck"), playDefaultSound: false);
// // TODO: Need filter extensions or something don't blame me.
// _audio.PlayGlobal("/Audio/Misc/notice1.ogg", Filter.Broadcast(), true);
// // TODO: Need filter extensions or something don't blame me.
// _audio.PlayGlobal("/Audio/Misc/notice1.ogg", Filter.Broadcast(), true);

_announcer.SendAnnouncement("shuttledock", Filter.Broadcast(),
Loc.GetString("emergency-shuttle-good-luck"),
Loc.GetString("comms-console-announcement-title-centcom"));
return;
}
_announcer.SendAnnouncement("shuttledock", Filter.Broadcast(),
Loc.GetString("emergency-shuttle-good-luck"),
Loc.GetString("comms-console-announcement-title-centcom"));
// Parkstation-RandomAnnouncers End
return;
}

var xformQuery = GetEntityQuery<TransformComponent>();

Expand All @@ -205,24 +207,28 @@ public void CallEmergencyShuttle(EntityUid stationUid, StationEmergencyShuttleCo
if (TryComp<TransformComponent>(targetGrid.Value, out var targetXform))
{
var angle = _dock.GetAngle(stationShuttle.EmergencyShuttle.Value, xform, targetGrid.Value, targetXform, xformQuery);
// Parkstation-RandomAnnouncers Start
// _chatSystem.DispatchStationAnnouncement(stationUid, Loc.GetString("emergency-shuttle-docked", ("time", $"{_consoleAccumulator:0}"), ("direction", angle.GetDir())), playDefaultSound: false);
_announcer.SendAnnouncementMessage("shuttledock",
Loc.GetString("emergency-shuttle-docked",("time", $"{_consoleAccumulator:0}"), ("direction", angle.GetDir())),
Loc.GetString("comms-console-announcement-title-centcom"));
}
_announcer.SendAnnouncementMessage("shuttledock",
Loc.GetString("emergency-shuttle-docked",("time", $"{_consoleAccumulator:0}"), ("direction", angle.GetDir())),
Loc.GetString("comms-console-announcement-title-centcom"));
// Parkstation-RandomAnnouncers End
}

_logger.Add(LogType.EmergencyShuttle, LogImpact.High, $"Emergency shuttle {ToPrettyString(stationUid)} docked with stations");
// TODO: Need filter extensions or something don't blame me.
// Parkstation-RandomAnnouncers Start
// _audio.PlayGlobal("/Audio/Announcements/shuttle_dock.ogg", Filter.Broadcast(), true);
_announcer.SendAnnouncementAudio("shuttledock", Filter.Broadcast());
}
else
{
if (TryComp<TransformComponent>(targetGrid.Value, out var targetXform))
{
var angle = _dock.GetAngle(stationShuttle.EmergencyShuttle.Value, xform, targetGrid.Value, targetXform, xformQuery);
_chatSystem.DispatchStationAnnouncement(stationUid, Loc.GetString("emergency-shuttle-nearby", ("direction", angle.GetDir())), playDefaultSound: false);
}
_announcer.SendAnnouncementAudio("shuttledock", Filter.Broadcast());
// Parkstation-RandomAnnouncers End
}
else
{
if (TryComp<TransformComponent>(targetGrid.Value, out var targetXform))
{
var angle = _dock.GetAngle(stationShuttle.EmergencyShuttle.Value, xform, targetGrid.Value, targetXform, xformQuery);
_chatSystem.DispatchStationAnnouncement(stationUid, Loc.GetString("emergency-shuttle-nearby", ("direction", angle.GetDir())), playDefaultSound: false);
}

_logger.Add(LogType.EmergencyShuttle, LogImpact.High, $"Emergency shuttle {ToPrettyString(stationUid)} unable to find a valid docking port for {ToPrettyString(stationUid)}");
// TODO: Need filter extensions or something don't blame me.
Expand Down
Loading

0 comments on commit 5e50224

Please sign in to comment.