-
Notifications
You must be signed in to change notification settings - Fork 361
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 Carrying_system
- Loading branch information
Showing
128 changed files
with
232,711 additions
and
371 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
Content.Client/Nyanotrasen/CartridgeLoader/Cartridges/GlimmerMonitorUiFragment.xaml.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
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
72 changes: 72 additions & 0 deletions
72
Content.IntegrationTests/Tests/Nyanotrasen/Oracle/OracleTest.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,72 @@ | ||
#nullable enable | ||
using NUnit.Framework; | ||
using System.Threading.Tasks; | ||
using Content.Shared.Item; | ||
using Content.Shared.Mobs.Components; | ||
using Content.Server.Research.Oracle; | ||
using Content.Shared.Chemistry.Components; | ||
using Robust.Shared.GameObjects; | ||
using Robust.Shared.Map; | ||
using Robust.Shared.Prototypes; | ||
|
||
|
||
/// <summary> | ||
/// The oracle's request pool is huge. | ||
/// We need to test everything that the oracle could request can be turned in. | ||
/// </summary> | ||
namespace Content.IntegrationTests.Tests.Oracle | ||
{ | ||
[TestFixture] | ||
[TestOf(typeof(OracleSystem))] | ||
public sealed class OracleTest | ||
{ | ||
[Test] | ||
public async Task AllOracleItemsCanBeTurnedIn() | ||
{ | ||
await using var pairTracker = await PoolManager.GetServerClient(); | ||
var server = pairTracker.Server; | ||
// Per RobustIntegrationTest.cs, wait until state is settled to access it. | ||
await server.WaitIdleAsync(); | ||
|
||
var mapManager = server.ResolveDependency<IMapManager>(); | ||
var prototypeManager = server.ResolveDependency<IPrototypeManager>(); | ||
var entityManager = server.ResolveDependency<IEntityManager>(); | ||
var entitySystemManager = server.ResolveDependency<IEntitySystemManager>(); | ||
|
||
var oracleSystem = entitySystemManager.GetEntitySystem<OracleSystem>(); | ||
var oracleComponent = new OracleComponent(); | ||
|
||
var testMap = await pairTracker.CreateTestMap(); | ||
|
||
await server.WaitAssertion(() => | ||
{ | ||
var allProtos = oracleSystem.GetAllProtos(oracleComponent); | ||
var coordinates = testMap.GridCoords; | ||
|
||
Assert.That((allProtos.Count > 0), "Oracle has no valid prototypes!"); | ||
|
||
foreach (var proto in allProtos) | ||
{ | ||
var spawned = entityManager.SpawnEntity(proto, coordinates); | ||
|
||
Assert.That(entityManager.HasComponent<ItemComponent>(spawned), | ||
$"Oracle can request non-item {proto}"); | ||
|
||
Assert.That(!entityManager.HasComponent<SolutionTransferComponent>(spawned), | ||
$"Oracle can request reagent container {proto} that will conflict with the fountain"); | ||
|
||
Assert.That(!entityManager.HasComponent<MobStateComponent>(spawned), | ||
$"Oracle can request mob {proto} that could potentially have a player-set name."); | ||
} | ||
|
||
// Because Server/Client pairs can be re-used between Tests, we | ||
// need to clean up anything that might affect other tests, | ||
// otherwise this pair cannot be considered clean, and the | ||
// CleanReturnAsync call would need to be removed. | ||
mapManager.DeleteMap(testMap.MapId); | ||
}); | ||
|
||
await pairTracker.CleanReturnAsync(); | ||
} | ||
} | ||
} |
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
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
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
79 changes: 79 additions & 0 deletions
79
Content.Server/Nyanotrasen/Research/Oracle/OracleComponent.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,79 @@ | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Server.Research.Oracle; | ||
|
||
[RegisterComponent] | ||
public sealed partial class OracleComponent : Component | ||
{ | ||
public const string SolutionName = "fountain"; | ||
|
||
[ViewVariables] | ||
[DataField("accumulator")] | ||
public float Accumulator; | ||
|
||
[ViewVariables] | ||
[DataField("resetTime")] | ||
public TimeSpan ResetTime = TimeSpan.FromMinutes(10); | ||
|
||
[DataField("barkAccumulator")] | ||
public float BarkAccumulator; | ||
|
||
[DataField("barkTime")] | ||
public TimeSpan BarkTime = TimeSpan.FromMinutes(1); | ||
|
||
[ViewVariables(VVAccess.ReadWrite)] | ||
public EntityPrototype DesiredPrototype = default!; | ||
|
||
[ViewVariables(VVAccess.ReadWrite)] | ||
public EntityPrototype? LastDesiredPrototype = default!; | ||
|
||
[DataField("rewardReagents")] | ||
public static IReadOnlyList<string> RewardReagents = new[] | ||
{ | ||
"LotophagoiOil", "LotophagoiOil", "LotophagoiOil", "LotophagoiOil", "LotophagoiOil", "Wine", "Blood", "Ichor" | ||
}; | ||
|
||
[DataField("demandMessages")] | ||
public IReadOnlyList<string> DemandMessages = new[] | ||
{ | ||
"oracle-demand-1", | ||
"oracle-demand-2", | ||
"oracle-demand-3", | ||
"oracle-demand-4", | ||
"oracle-demand-5", | ||
"oracle-demand-6", | ||
"oracle-demand-7", | ||
"oracle-demand-8", | ||
"oracle-demand-9", | ||
"oracle-demand-10", | ||
"oracle-demand-11", | ||
"oracle-demand-12" | ||
}; | ||
|
||
[DataField("rejectMessages")] | ||
public IReadOnlyList<string> RejectMessages = new[] | ||
{ | ||
"ἄγνοια", | ||
"υλικό", | ||
"ἀγνωσία", | ||
"γήινος", | ||
"σάκλας" | ||
}; | ||
|
||
[DataField("blacklistedPrototypes")] | ||
[ViewVariables(VVAccess.ReadOnly)] | ||
public IReadOnlyList<string> BlacklistedPrototypes = new[] | ||
{ | ||
"Drone", | ||
"QSI", | ||
"HandTeleporter", | ||
"BluespaceBeaker", | ||
"ClothingBackpackHolding", | ||
"ClothingBackpackSatchelHolding", | ||
"ClothingBackpackDuffelHolding", | ||
"TrashBagOfHolding", | ||
"BluespaceCrystal", | ||
"InsulativeHeadcage", | ||
"CrystalNormality", | ||
}; | ||
} |
Oops, something went wrong.