Merge remote-tracking branch 'upstream/master' into ed-23-07-2024-upstream
# Conflicts: # .github/PULL_REQUEST_TEMPLATE.md # Content.Client/Clothing/ClientClothingSystem.cs # Content.Client/Hands/Systems/HandsSystem.cs # Content.IntegrationTests/Tests/PostMapInitTest.cs # Content.Shared/Hands/Components/HandsComponent.cs # Content.Shared/Inventory/InventoryComponent.cs # Content.Shared/Storage/StorageComponent.cs # Resources/Prototypes/Accents/word_replacements.yml # Resources/Prototypes/Entities/Mobs/Player/human.yml # Resources/Prototypes/Maps/Pools/default.yml # Resources/Prototypes/Maps/fland.yml # Resources/Prototypes/Maps/oasis.yml # Resources/Prototypes/Maps/packed.yml # Resources/Prototypes/Maps/saltern.yml
This commit is contained in:
@@ -121,21 +121,25 @@ public sealed class InjectorSystem : SharedInjectorSystem
|
||||
if (!SolutionContainers.TryGetSolution(injector.Owner, injector.Comp.SolutionName, out _, out var solution))
|
||||
return;
|
||||
|
||||
var actualDelay = MathHelper.Max(injector.Comp.Delay, TimeSpan.FromSeconds(1));
|
||||
float amountToInject;
|
||||
var actualDelay = injector.Comp.Delay;
|
||||
FixedPoint2 amountToInject;
|
||||
if (injector.Comp.ToggleState == InjectorToggleMode.Draw)
|
||||
{
|
||||
// additional delay is based on actual volume left to draw in syringe when smaller than transfer amount
|
||||
amountToInject = Math.Min(injector.Comp.TransferAmount.Float(), (solution.MaxVolume - solution.Volume).Float());
|
||||
amountToInject = FixedPoint2.Min(injector.Comp.TransferAmount, (solution.MaxVolume - solution.Volume));
|
||||
}
|
||||
else
|
||||
{
|
||||
// additional delay is based on actual volume left to inject in syringe when smaller than transfer amount
|
||||
amountToInject = Math.Min(injector.Comp.TransferAmount.Float(), solution.Volume.Float());
|
||||
amountToInject = FixedPoint2.Min(injector.Comp.TransferAmount, solution.Volume);
|
||||
}
|
||||
|
||||
// Injections take 0.5 seconds longer per 5u of possible space/content
|
||||
actualDelay += TimeSpan.FromSeconds(amountToInject / 10);
|
||||
// First 5u(MinimumTransferAmount) doesn't incur delay
|
||||
actualDelay += injector.Comp.DelayPerVolume * FixedPoint2.Max(0, amountToInject - injector.Comp.MinimumTransferAmount).Double();
|
||||
|
||||
// Ensure that minimum delay before incapacitation checks is 1 seconds
|
||||
actualDelay = MathHelper.Max(actualDelay, TimeSpan.FromSeconds(1));
|
||||
|
||||
|
||||
var isTarget = user != target;
|
||||
|
||||
Reference in New Issue
Block a user