adds the ability to "mix" solutions (reactions caused by using an item on a solution holder) (#13015)
* everything for mixing aside from yaml changes * add recipe and canmix to bottles and the holy mixer tag to the bible * fixes as a result of testing * remove unused usings * remove emptylines that are not required Co-authored-by: 0x6273 <0x40@keemail.me> * more empty line removal! Co-authored-by: 0x6273 <0x40@keemail.me> * add single space between if statement and condition Co-authored-by: 0x6273 <0x40@keemail.me> * fixes indentation on TryGetMixableSolution * raise new AfterMixingEvent after attempting to mix a solution * before mixing event and attempt get mixable solution event * update reaction tests to be a beaker that can be mixed, and then pass a mixer component in to simulate mixing * make two more beaker types mixable, add attribute for mixing feedback * bible mix message * mixing feedback on success * updates test to use SpawnEntity over new as per feedback Co-authored-by: 0x6273 <0x40@keemail.me>
This commit is contained in:
committed by
GitHub
parent
a497167e45
commit
c046666578
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Content.Server.Chemistry.EntitySystems;
|
||||
using Content.Server.Engineering.Components;
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.Reaction;
|
||||
using NUnit.Framework;
|
||||
@@ -23,7 +24,8 @@ namespace Content.IntegrationTests.Tests.Chemistry
|
||||
- type: SolutionContainerManager
|
||||
solutions:
|
||||
beaker:
|
||||
maxVol: 50";
|
||||
maxVol: 50
|
||||
canMix: true";
|
||||
[Test]
|
||||
public async Task TryAllTest()
|
||||
{
|
||||
@@ -58,6 +60,14 @@ namespace Content.IntegrationTests.Tests.Chemistry
|
||||
}
|
||||
|
||||
solutionSystem.SetTemperature(beaker, component, reactionPrototype.MinimumTemperature);
|
||||
|
||||
if (reactionPrototype.MixingCategories != null)
|
||||
{
|
||||
var dummyEntity = entityManager.SpawnEntity(null, MapCoordinates.Nullspace);
|
||||
var mixerComponent = entityManager.AddComponent<ReactionMixerComponent>(dummyEntity);
|
||||
mixerComponent.ReactionTypes = reactionPrototype.MixingCategories;
|
||||
solutionSystem.UpdateChemicals(beaker, component, true, mixerComponent);
|
||||
}
|
||||
});
|
||||
|
||||
await server.WaitIdleAsync();
|
||||
|
||||
Reference in New Issue
Block a user