RCD + research unlock test (#13062)
This commit is contained in:
59
Content.IntegrationTests/Tests/ResearchTest.cs
Normal file
59
Content.IntegrationTests/Tests/ResearchTest.cs
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Content.Shared.Lathe;
|
||||||
|
using Content.Shared.Research.Prototypes;
|
||||||
|
using NUnit.Framework;
|
||||||
|
using Robust.Shared.Prototypes;
|
||||||
|
|
||||||
|
namespace Content.IntegrationTests.Tests;
|
||||||
|
|
||||||
|
[TestFixture]
|
||||||
|
public sealed class ResearchTest
|
||||||
|
{
|
||||||
|
[Test]
|
||||||
|
public async Task AllTechPrintableTest()
|
||||||
|
{
|
||||||
|
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings {NoClient = true});
|
||||||
|
var server = pairTracker.Pair.Server;
|
||||||
|
|
||||||
|
var protoManager = server.ResolveDependency<IPrototypeManager>();
|
||||||
|
|
||||||
|
await server.WaitAssertion(() =>
|
||||||
|
{
|
||||||
|
var allEnts = protoManager.EnumeratePrototypes<EntityPrototype>();
|
||||||
|
var allLathes = new HashSet<LatheComponent>();
|
||||||
|
foreach (var proto in allEnts)
|
||||||
|
{
|
||||||
|
if (proto.Abstract)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!proto.TryGetComponent<LatheComponent>(out var lathe))
|
||||||
|
continue;
|
||||||
|
allLathes.Add(lathe);
|
||||||
|
}
|
||||||
|
|
||||||
|
var latheTechs = new HashSet<string>();
|
||||||
|
foreach (var lathe in allLathes)
|
||||||
|
{
|
||||||
|
if (lathe.DynamicRecipes == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
foreach (var recipe in lathe.DynamicRecipes)
|
||||||
|
{
|
||||||
|
if (!latheTechs.Contains(recipe))
|
||||||
|
latheTechs.Add(recipe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var tech in protoManager.EnumeratePrototypes<TechnologyPrototype>())
|
||||||
|
{
|
||||||
|
foreach (var recipe in tech.UnlockedRecipes)
|
||||||
|
{
|
||||||
|
Assert.That(latheTechs, Does.Contain(recipe), $"Recipe \"{recipe}\" cannot be unlocked on any lathes.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
await pairTracker.CleanReturnAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -38,7 +38,7 @@ technologies-industrial-engineering = Industrial engineering
|
|||||||
technologies-industrial-engineering-description = A refresher course on modern engineering technology.
|
technologies-industrial-engineering-description = A refresher course on modern engineering technology.
|
||||||
|
|
||||||
technologies-rapid-upgrade = Rapid upgrade
|
technologies-rapid-upgrade = Rapid upgrade
|
||||||
technologies-rapid-upgrade-description = The ability to quickly upgrade the station like never before.
|
technologies-rapid-upgrade-description = The ability to quickly improve the station like never before.
|
||||||
|
|
||||||
technologies-material-sheet-printing = Material sheet printing
|
technologies-material-sheet-printing = Material sheet printing
|
||||||
technologies-material-sheet-printing-description = Print those sheets!
|
technologies-material-sheet-printing-description = Print those sheets!
|
||||||
|
|||||||
@@ -357,8 +357,6 @@
|
|||||||
- ElectromagneticTheory
|
- ElectromagneticTheory
|
||||||
- IndustrialEngineering
|
- IndustrialEngineering
|
||||||
unlockedRecipes:
|
unlockedRecipes:
|
||||||
- RCD
|
|
||||||
- RCDAmmo
|
|
||||||
- PowerDrill
|
- PowerDrill
|
||||||
- SMESMachineCircuitboard
|
- SMESMachineCircuitboard
|
||||||
- PowerComputerCircuitboard
|
- PowerComputerCircuitboard
|
||||||
@@ -390,10 +388,12 @@
|
|||||||
icon:
|
icon:
|
||||||
sprite: Objects/Specific/Research/rped.rsi
|
sprite: Objects/Specific/Research/rped.rsi
|
||||||
state: icon
|
state: icon
|
||||||
requiredPoints: 7500
|
requiredPoints: 10000
|
||||||
requiredTechnologies:
|
requiredTechnologies:
|
||||||
- ElectricalEngineering
|
- ElectricalEngineering
|
||||||
unlockedRecipes:
|
unlockedRecipes:
|
||||||
|
- RCD
|
||||||
|
- RCDAmmo
|
||||||
- RPED
|
- RPED
|
||||||
|
|
||||||
- type: technology
|
- type: technology
|
||||||
|
|||||||
@@ -267,6 +267,14 @@
|
|||||||
- type: StaticPrice
|
- type: StaticPrice
|
||||||
price: 100
|
price: 100
|
||||||
|
|
||||||
|
- type: entity
|
||||||
|
id: RCDEmpty
|
||||||
|
parent: RCD
|
||||||
|
suffix: Empty
|
||||||
|
components:
|
||||||
|
- type: RCD
|
||||||
|
ammo: 0
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
name: RCD Ammo
|
name: RCD Ammo
|
||||||
parent: BaseItem
|
parent: BaseItem
|
||||||
|
|||||||
@@ -171,6 +171,7 @@
|
|||||||
- MiningDrill
|
- MiningDrill
|
||||||
- ConveyorBeltAssembly
|
- ConveyorBeltAssembly
|
||||||
- AppraisalTool
|
- AppraisalTool
|
||||||
|
- RCD
|
||||||
- RCDAmmo
|
- RCDAmmo
|
||||||
- HydroponicsToolScythe
|
- HydroponicsToolScythe
|
||||||
- HydroponicsToolHatchet
|
- HydroponicsToolHatchet
|
||||||
|
|||||||
@@ -115,7 +115,7 @@
|
|||||||
icon:
|
icon:
|
||||||
sprite: Objects/Tools/rcd.rsi
|
sprite: Objects/Tools/rcd.rsi
|
||||||
state: icon
|
state: icon
|
||||||
result: RCD
|
result: RCDEmpty
|
||||||
completetime: 4
|
completetime: 4
|
||||||
materials:
|
materials:
|
||||||
Steel: 1000
|
Steel: 1000
|
||||||
|
|||||||
Reference in New Issue
Block a user