-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into captain_sabre
- Loading branch information
Showing
22 changed files
with
6,911 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
Content.Server/DeltaV/StationEvents/Components/PirateRadioSpawnRuleComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
39
Content.Server/DeltaV/StationEvents/Events/PirateRadioSpawnRule.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
Resources/Locale/en-US/deltav/ghost/roles/ghost-role-component.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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! |
Oops, something went wrong.