Skip to content

Commit

Permalink
Merge branch 'master' into captain_sabre
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian16199 authored Jan 1, 2024
2 parents 949d9ea + df92f0f commit 532d948
Show file tree
Hide file tree
Showing 22 changed files with 6,911 additions and 35 deletions.
79 changes: 79 additions & 0 deletions Content.IntegrationTests/Tests/DeltaV/CrimeassistTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
using System.Linq;
using Content.Shared.DeltaV.CartridgeLoader.Cartridges;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;

namespace Content.IntegrationTests.Tests.DeltaV;

[TestFixture]
public sealed class CrimeAssistTest
{
[Test]
public async Task CrimeAssistValid()
{
await using var pair = await PoolManager.GetServerClient();
var server = pair.Server;
await server.WaitIdleAsync();

var prototypeManager = server.ResolveDependency<IPrototypeManager>();
var allProtos = prototypeManager.EnumeratePrototypes<CrimeAssistPage>().ToArray();

await server.WaitAssertion(() =>
{
foreach (var proto in allProtos)
{
if (proto.LocKey != null)
{
Assert.That(Loc.TryGetString(proto.LocKey, out var _),
$"CrimeAssistPage {proto.ID} has invalid LocKey {proto.LocKey}!");
}

if (proto.LocKeyTitle != null)
{
Assert.That(Loc.TryGetString(proto.LocKeyTitle, out var _),
$"CrimeAssistPage {proto.ID} has invalid LocKeyTitle {proto.LocKeyTitle}!");
}

if (proto.LocKeyDescription != null)
{
Assert.That(Loc.TryGetString(proto.LocKeyDescription, out var _),
$"CrimeAssistPage {proto.ID} has invalid LocKeyDescription {proto.LocKeyDescription}!");
}

if (proto.LocKeySeverity != null)
{
Assert.That(Loc.TryGetString(proto.LocKeySeverity, out var _),
$"CrimeAssistPage {proto.ID} has invalid LocKeySeverity {proto.LocKeySeverity}!");
}

if (proto.LocKeyPunishment != null)
{
Assert.That(Loc.TryGetString(proto.LocKeyPunishment, out var _),
$"CrimeAssistPage {proto.ID} has invalid LocKeyPunishment {proto.LocKeyPunishment}!");
}

if (proto.OnStart != null)
{
Assert.That(allProtos.Any(p => p.ID == proto.OnStart),
$"CrimeAssistPage {proto.ID} has invalid OnStart {proto.OnStart}!");
}

if (proto.OnYes != null)
{
Assert.That(allProtos.Any(p => p.ID == proto.OnYes),
$"CrimeAssistPage {proto.ID} has invalid OnYes {proto.OnYes}!");
}

if (proto.OnNo != null)
{
Assert.That(allProtos.Any(p => p.ID == proto.OnNo),
$"CrimeAssistPage {proto.ID} has invalid OnNo {proto.OnNo}!");
}
}
});

await pair.CleanReturnAsync();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Content.Server.StationEvents.Events;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;

namespace Content.Server.StationEvents.Components;

[RegisterComponent, Access(typeof(PirateRadioSpawnRule))]
public sealed partial class PirateRadioSpawnRuleComponent : Component
{
[DataField("PirateRadioShuttlePath")]
public string PirateRadioShuttlePath = "Maps/Shuttles/pirateradio.yml";

[DataField("additionalRule")]
public EntityUid? AdditionalRule;
}
39 changes: 39 additions & 0 deletions Content.Server/DeltaV/StationEvents/Events/PirateRadioSpawnRule.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using Robust.Server.GameObjects;
using Robust.Server.Maps;
using Robust.Shared.Map;
using Content.Server.GameTicking;
using Content.Server.GameTicking.Rules;
using Content.Server.GameTicking.Rules.Components;
using Content.Server.StationEvents.Components;
using Content.Server.RoundEnd;

namespace Content.Server.StationEvents.Events;

public sealed class PirateRadioSpawnRule : StationEventSystem<PirateRadioSpawnRuleComponent>
{
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly MapLoaderSystem _map = default!;
[Dependency] private readonly GameTicker _gameTicker = default!;
[Dependency] private readonly TraitorRuleSystem _TraitorRuleSystem = default!;

protected override void Started(EntityUid uid, PirateRadioSpawnRuleComponent component, GameRuleComponent gameRule, GameRuleStartedEvent args)
{
base.Started(uid, component, gameRule, args);

var shuttleMap = _mapManager.CreateMap();
var options = new MapLoadOptions
{
LoadMap = true,
};

_map.TryLoad(shuttleMap, component.PirateRadioShuttlePath, out _, options);
}

protected override void Ended(EntityUid uid, PirateRadioSpawnRuleComponent component, GameRuleComponent gameRule, GameRuleEndedEvent args)
{
base.Ended(uid, component, gameRule, args);

if (component.AdditionalRule != null)
GameTicker.EndGameRule(component.AdditionalRule.Value);
}
}
15 changes: 15 additions & 0 deletions Resources/Changelog/DeltaVChangelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1278,3 +1278,18 @@ Entries:
message: Added a fluffy tail for the felinids.
id: 191
time: '2023-12-30T22:05:52.0000000+00:00'
- author: DarkenedSynergy
changes:
- type: Fix
message: Fixed logistics airlocks looking like engineering airlocks when opened.
id: 192
time: '2023-12-31T16:23:10.0000000+00:00'
- author: DangerRevolution and VMSolidus
changes:
- type: Add
message: >-
Rumours say that Syndicate Agents have cracked encoded communications!
Added the Syndicate Listening Post to the Syndicate's arsenal of
espionage!
id: 193
time: '2023-12-31T16:48:27.0000000+00:00'
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
ghost-role-information-nukie-mouse-name = Nuclear Operative Mouse
ghost-role-information-nukie-mouse-description = A Nuclear Operative reinforcement for the Syndicate.
ghost-role-information-nukie-mouse-rules = Normal syndicate antagonist rules apply. Work with whoever called you in, and don't harm them.
The crew is allowed to kill you without warning.
You are allowed to attack the crew and destroy the station without provocation.
The crew is allowed to kill you without warning.
You are allowed to attack the crew and destroy the station without provocation.
ghost-role-information-listeningop-name = Listening Post Operative
ghost-role-information-listeningop-description = You are a Listening Post operative. Get into range, observe the station, intercept communications and assist any operatives in the area!
ghost-role-information-listeningop-rules = You are a Syndicate Operative tasked with the continuous reporting and monitoring of the station and its activities, as well as assisting any fellow operatives who may be aboard the station. As an antagonist, do whatever is required for you to complete this task. Make sure your station doesn't fall into enemy hands and DO NOT abandon your station! Hide your existence at any cost!
Loading

0 comments on commit 532d948

Please sign in to comment.