Entity Reagent Reactions v2 (#3714)

* Refactors reactions to be more POWERFUL and DATA-ORIENTED
This commit is contained in:
Vera Aguilera Puerto
2021-03-26 12:02:41 +01:00
committed by GitHub
parent 6739d6a6a9
commit a6f04e22e4
25 changed files with 333 additions and 140 deletions

View File

@@ -12,7 +12,7 @@ using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Nutrition
{
[RegisterComponent]
public class CreamPiedComponent : SharedCreamPiedComponent, IReagentReaction, IThrowCollide
public class CreamPiedComponent : SharedCreamPiedComponent, IThrowCollide
{
private bool _creamPied;
@@ -38,19 +38,6 @@ namespace Content.Server.GameObjects.Components.Nutrition
CreamPied = false;
}
ReagentUnit IReagentReaction.ReagentReactTouch(ReagentPrototype reagent, ReagentUnit volume)
{
switch (reagent.ID)
{
case "chem.SpaceCleaner":
case "chem.Water":
Wash();
break;
}
return ReagentUnit.Zero;
}
void IThrowCollide.HitBy(ThrowCollideEventArgs eventArgs)
{
if (eventArgs.Thrown.Deleted || !eventArgs.Thrown.TryGetComponent(out CreamPieComponent? creamPie)) return;