Skip to content

Commit

Permalink
Station AI, Nanotrasen Representative, Administrative Assistant and B…
Browse files Browse the repository at this point in the history
…lueshield (#151)

🆑 sleepyapril, EE and Goob contributors
- add: Blueshield Officer is now playable.
- add: Nanotrasen Representative is now playable.
- add: Administrative Assistant is now playable.
- add: Station AI is now playable.
- tweak: Put all of the above on every map.
  • Loading branch information
sleepyyapril authored Jan 12, 2025
2 parents bf31678 + 3df474e commit 0fe31f6
Show file tree
Hide file tree
Showing 371 changed files with 21,496 additions and 28,024 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-docfx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup .NET Core
uses: actions/[email protected]
with:
dotnet-version: 8.0.100
dotnet-version: 9.0.x

- name: Install dependencies
run: dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-map-renderer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Setup .NET Core
uses: actions/[email protected]
with:
dotnet-version: 8.0.100
dotnet-version: 9.0.x

- name: Install dependencies
run: dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-test-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Setup .NET Core
uses: actions/[email protected]
with:
dotnet-version: 8.0.100
dotnet-version: 9.0.x

- name: Install dependencies
run: dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup .NET Core
uses: actions/[email protected]
with:
dotnet-version: 8.0.100
dotnet-version: 9.0.x

- name: Get Engine Tag
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Setup .NET Core
uses: actions/[email protected]
with:
dotnet-version: 8.0.100
dotnet-version: 9.0.x

- name: Install dependencies
run: dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/yaml-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Setup .NET Core
uses: actions/[email protected]
with:
dotnet-version: 8.0.100
dotnet-version: 9.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
Expand Down
5 changes: 5 additions & 0 deletions Content.Client/Materials/MaterialSiloSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
using Content.Shared.Materials;

namespace Content.Client.Materials;

public sealed class MaterialSiloSystem : SharedMaterialSiloSystem;
3 changes: 2 additions & 1 deletion Content.Client/Materials/MaterialStorageSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ public override bool TryInsertMaterialEntity(EntityUid user,
EntityUid toInsert,
EntityUid receiver,
MaterialStorageComponent? storage = null,
MaterialSiloUtilizerComponent? utilizer = null,
MaterialComponent? material = null,
PhysicalCompositionComponent? composition = null)
{
if (!base.TryInsertMaterialEntity(user, toInsert, receiver, storage, material, composition))
if (!base.TryInsertMaterialEntity(user, toInsert, receiver, storage, utilizer, material, composition))
return false;
_transform.DetachParentToNull(toInsert, Transform(toInsert));
return true;
Expand Down
1 change: 1 addition & 0 deletions Content.Client/Materials/UI/MaterialStorageControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
HorizontalExpand="True"
VerticalExpand="True">
<BoxContainer Name="MaterialList" Orientation="Vertical">
<Label Name="ConnectToSiloLabel" Text="{Loc 'lathe-menu-connected-to-silo-message'}" Align="Center"/>
<Label Name="NoMatsLabel" Text="{Loc 'lathe-menu-no-materials-message'}" Align="Center"/>
</BoxContainer>
</ScrollContainer>
21 changes: 20 additions & 1 deletion Content.Client/Materials/UI/MaterialStorageControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public sealed partial class MaterialStorageControl : ScrollContainer
{
[Dependency] private readonly IEntityManager _entityManager = default!;

private readonly MaterialSiloSystem _materialSilo;

private EntityUid? _owner;

private Dictionary<string, int> _currentMaterials = new();
Expand All @@ -23,6 +25,8 @@ public MaterialStorageControl()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);

_materialSilo = _entityManager.System<MaterialSiloSystem>();
}

public void SetOwner(EntityUid owner)
Expand All @@ -44,7 +48,22 @@ protected override void FrameUpdate(FrameEventArgs args)
}

var canEject = materialStorage.CanEjectStoredMaterials;
var mats = materialStorage.Storage.Select(pair => (pair.Key.Id, pair.Value)).ToDictionary();

Dictionary<string, int> mats;
if (_entityManager.TryGetComponent<MaterialSiloUtilizerComponent>(_owner, out var utilizer) && utilizer.Silo.HasValue)
{
var silo = _materialSilo.GetSiloStorage(_owner.Value);
mats = silo != null
? silo.Value.Comp.Storage.Select(pair => (pair.Key.Id, pair.Value)).ToDictionary()
: materialStorage.Storage.Select(pair => (pair.Key.Id, pair.Value)).ToDictionary();
ConnectToSiloLabel.Visible = silo != null;
}
else
{
mats = materialStorage.Storage.Select(pair => (pair.Key.Id, pair.Value)).ToDictionary();
ConnectToSiloLabel.Visible = false;
}

if (_currentMaterials.Equals(mats))
return;

Expand Down
3 changes: 2 additions & 1 deletion Content.Client/Weather/WeatherSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ protected override void Run(EntityUid uid, WeatherData weather, WeatherPrototype
return;
}

if (!Timing.IsFirstTimePredicted || weatherProto.Sound == null)
if (!Timing.IsFirstTimePredicted || weatherProto.Sound == null
|| weather.Stream is not null) // Don't ever generate more than one weather sound.
return;

var playStream = _audio.PlayGlobal(weatherProto.Sound, Filter.Local(), true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ await server.WaitAssertion(() =>
{
playerUid = serverPlayerManager.Sessions.Single().AttachedEntity.GetValueOrDefault();
#pragma warning disable NUnit2045 // Interdependent assertions.
Assert.That(playerUid, Is.Not.EqualTo(default));
Assert.That(playerUid, Is.Not.EqualTo(default(EntityUid)));
// Making sure it exists
Assert.That(entManager.HasComponent<AlertsComponent>(playerUid));
#pragma warning restore NUnit2045
Expand Down
6 changes: 3 additions & 3 deletions Content.IntegrationTests/Tests/PostMapInitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@
using Content.Server.Spawners.Components;
using Content.Server.Station.Components;
using Content.Shared.CCVar;
using Content.Shared.Roles;
using Robust.Server.GameObjects;
using Robust.Shared.Configuration;
using Robust.Shared.ContentPack;
using Robust.Shared.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Prototypes;
using FastAccessors;
using Robust.Shared.Utility;
using YamlDotNet.RepresentationModel;

Expand Down Expand Up @@ -65,7 +63,8 @@ public sealed class PostMapInitTest
"Submarine", //DeltaV
"Gax",
"Rad",
"Europa"
"Europa",
"Meta"
};

/// <summary>
Expand Down Expand Up @@ -253,6 +252,7 @@ await server.WaitPost(() =>
// This is done inside gamemap test because loading the map takes ages and we already have it.
var spawnPoints = entManager.EntityQuery<SpawnPointComponent>()
.Where(x => x.SpawnType == SpawnPointType.Job)
.Where(x => x.Job!.JobEntity == null)
.Select(x => x.Job!.ID);

jobs.ExceptWith(spawnPoints);
Expand Down
2 changes: 1 addition & 1 deletion Content.PatreonParser/Content.PatreonParser.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,11 @@ public partial class UpstreamMerge : Migration
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql("DROP TABLE IF EXISTS ProileLoadouts;");

migrationBuilder.AddForeignKey(
name: "FK_loadout_profile_profile_id",
table: "loadout",
column: "profile_id",
principalTable: "profile",
principalColumn: "profile_id",
onDelete: ReferentialAction.Cascade);
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_loadout_profile_profile_id",
table: "loadout");

migrationBuilder.CreateTable(
name: "ProfileLoadout",
columns: table => new
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,11 @@ public partial class UpstreamMerge : Migration
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql("DROP TABLE IF EXISTS ProileLoadouts;");

migrationBuilder.AddForeignKey(
name: "FK_loadout_profile_profile_id",
table: "loadout",
column: "profile_id",
principalTable: "profile",
principalColumn: "profile_id",
onDelete: ReferentialAction.Cascade);
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_loadout_profile_profile_id",
table: "loadout");

migrationBuilder.CreateTable(
name: "ProfileLoadout",
columns: table => new
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Animals/Components/UdderComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ internal sealed partial class UdderComponent : Component
/// <summary>
/// The solution to add reagent to.
/// </summary>
[DataField]
[ViewVariables]
public Entity<SolutionComponent>? Solution = null;

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Animals/Components/WoolyComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public sealed partial class WoolyComponent : Component
/// <summary>
/// The solution to add reagent to.
/// </summary>
[DataField]
[ViewVariables(VVAccess.ReadOnly)]
public Entity<SolutionComponent>? Solution;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,6 @@ public sealed partial class ReagentProducerAnomalyComponent : Component
/// <summary>
/// Solution where the substance is generated
/// </summary>
[DataField("solutionRef")]
[ViewVariables]
public Entity<SolutionComponent>? Solution = null;
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public sealed partial class GasCondenserComponent : Component
/// <summary>
/// The solution that gases are condensed into.
/// </summary>
[DataField]
[ViewVariables]
public Entity<SolutionComponent>? Solution = null;

/// <summary>
Expand Down
54 changes: 0 additions & 54 deletions Content.Server/Autovote/AutoVoteSystem.cs

This file was deleted.

12 changes: 6 additions & 6 deletions Content.Server/Body/Components/BloodstreamComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,22 +160,22 @@ public sealed partial class BloodstreamComponent : Component
/// <summary>
/// Internal solution for blood storage
/// </summary>
[DataField]
public Entity<SolutionComponent>? BloodSolution = null;
[ViewVariables]
public Entity<SolutionComponent>? BloodSolution;

/// <summary>
/// Internal solution for reagent storage
/// </summary>
[DataField]
public Entity<SolutionComponent>? ChemicalSolution = null;
[ViewVariables]
public Entity<SolutionComponent>? ChemicalSolution;

/// <summary>
/// Temporary blood solution.
/// When blood is lost, it goes to this solution, and when this
/// solution hits a certain cap, the blood is actually spilled as a puddle.
/// </summary>
[DataField]
public Entity<SolutionComponent>? TemporarySolution = null;
[ViewVariables]
public Entity<SolutionComponent>? TemporarySolution;

/// <summary>
/// Variable that stores the amount of status time added by having a low blood level.
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Body/Components/LungComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public sealed partial class LungComponent : Component
/// <summary>
/// The solution on this entity that these lungs act on.
/// </summary>
[DataField]
[ViewVariables]
public Entity<SolutionComponent>? Solution = null;

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions Content.Server/Body/Components/StomachComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public sealed partial class StomachComponent : Component
/// <summary>
/// The solution inside of this stomach this transfers reagents to the body.
/// </summary>
[DataField]
public Entity<SolutionComponent>? Solution = null;
[ViewVariables]
public Entity<SolutionComponent>? Solution;

/// <summary>
/// What solution should this stomach push reagents into, on the body?
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Body/Systems/InternalsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private void OnStartingGear(EntityUid uid, InternalsComponent component, ref Sta
return; // already connected

// Can the entity breathe the air it is currently exposed to?
if (_respirator.CanMetabolizeInhaledAir(uid))
if (!TryComp(uid, out RespiratorComponent? respirator) || _respirator.CanMetabolizeInhaledAir((uid, respirator)))
return;

var tank = FindBestGasTank(uid);
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Botany/Components/PlantHolderComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,6 @@ public sealed partial class PlantHolderComponent : Component
[ViewVariables(VVAccess.ReadWrite), DataField("solution")]
public string SoilSolutionName = "soil";

[DataField]
[ViewVariables]
public Entity<SolutionComponent>? SoilSolution = null;
}
1 change: 0 additions & 1 deletion Content.Server/Botany/Systems/MutationSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Content.Shared.Chemistry.Reagent;
using System.Linq;
using Content.Shared.Atmos;
using FastAccessors;

namespace Content.Server.Botany;

Expand Down
Loading

0 comments on commit 0fe31f6

Please sign in to comment.