* -Added Crayons + CrayonBox -Can set any crayon state and color -Added CrayonDecals * Allows to cycle through decals (not the final thing) * ItemStatus * -UI (WIP) -Selection thing works -Changed some shitty state names * -Icons -Changed decal name * Pure Texture Grid * Charges * -Reach check -Toggle interface on use * Can't draw on windows anymore * UI now shows selected decal and color * -UseSound -Nullable * Remove unused imports * -Rotation -Made decal abstract * Remove some duplicate images * Space Cleaner cleans * Loc Title Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com> * Review adressed Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
40 lines
1.2 KiB
C#
40 lines
1.2 KiB
C#
using Content.Server.GameObjects.Components;
|
|
using Content.Server.Utility;
|
|
using Content.Shared.Chemistry;
|
|
using Content.Shared.Interfaces.Chemistry;
|
|
using Robust.Shared.Interfaces.Serialization;
|
|
using Robust.Shared.Map;
|
|
using Robust.Shared.Serialization;
|
|
using System.Linq;
|
|
|
|
namespace Content.Server.Chemistry.TileReactions
|
|
{
|
|
public class CleanTileReaction : ITileReaction
|
|
{
|
|
void IExposeData.ExposeData(ObjectSerializer serializer)
|
|
{
|
|
}
|
|
|
|
ReagentUnit ITileReaction.TileReact(TileRef tile, ReagentPrototype reagent, ReagentUnit reactVolume)
|
|
{
|
|
var entities = tile.GetEntitiesInTileFast().ToArray();
|
|
var amount = ReagentUnit.Zero;
|
|
foreach (var entity in entities)
|
|
{
|
|
if (entity.TryGetComponent(out CleanableComponent cleanable))
|
|
{
|
|
var next = amount + cleanable.CleanAmount;
|
|
// Nothing left?
|
|
if (reactVolume < next)
|
|
break;
|
|
|
|
amount = next;
|
|
entity.Delete();
|
|
}
|
|
}
|
|
|
|
return amount;
|
|
}
|
|
}
|
|
}
|