Merge branch 'master-upstream' into expl_int_analyzer

# Conflicts:
#	Content.Server/GameObjects/Components/Body/Part/BodyPartComponent.cs
#	Content.Server/GameObjects/Components/Botany/PlantHolderComponent.cs
#	Content.Server/GameObjects/Components/Chemistry/PillComponent.cs
#	Content.Server/GameObjects/Components/Interactable/TilePryingComponent.cs
#	Content.Server/GameObjects/Components/Items/FloorTileItemComponent.cs
#	Content.Server/GameObjects/Components/Items/RCD/RCDAmmoComponent.cs
#	Content.Server/GameObjects/Components/Items/RCD/RCDComponent.cs
#	Content.Server/GameObjects/Components/Medical/HealingComponent.cs
#	Content.Server/GameObjects/Components/Power/WirePlacerComponent.cs
#	Content.Shared/Chemistry/Solution.cs
This commit is contained in:
Paul
2021-02-04 17:50:28 +01:00
499 changed files with 6357 additions and 8689 deletions

View File

@@ -4,6 +4,8 @@ using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Robust.Shared.Analyzers;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Serialization;
using Robust.Shared.IoC;
using Robust.Shared.Maths;
@@ -91,7 +93,7 @@ namespace Content.Shared.Chemistry
return "";
}
var majorReagent = Contents.OrderByDescending(reagent => reagent.Quantity).First(); ;
var majorReagent = Contents.OrderByDescending(reagent => reagent.Quantity).First();
return majorReagent.ReagentId;
}
@@ -316,6 +318,20 @@ namespace Content.Shared.Chemistry
return newSolution;
}
public void DoEntityReaction(IEntity entity, ReactionMethod method)
{
var proto = IoCManager.Resolve<IPrototypeManager>();
foreach (var (reagentId, quantity) in _contents.ToArray())
{
if (!proto.TryIndex(reagentId, out ReagentPrototype reagent))
continue;
var removedAmount = reagent.ReactionEntity(entity, method, quantity);
RemoveReagent(reagentId, removedAmount);
}
}
[Serializable, NetSerializable]
public readonly struct ReagentQuantity: IComparable<ReagentQuantity>
{