* Adds new different reaction types. - Adds touch, injection and ingestion reactions for entities. - Adds tile reactions. - Removes GasSprayerComponent in favor of SprayComponent. - Gives fire extinguishers a safety. - Gives spray puffs a sprite. - Improved spray and fire extinguisher in general. - Fire extinguisher now ACTUALLY puts out fires. Amazing, eh? - Fire extinguisher sprays three 'clouds' at once. - Spraying flammable chemicals at fire makes them worse. Whoops! - Gives spray and fire extinguisher their classic sounds. - Most chemicals now don't make puddles. Too bad! - Space lube now makes a very slippery puddle. Honk. - Spraying water (or using a fire extinguisher) on existing puddles makes them bigger. * Fix solution tests * food base now has solution container with noexamine caps
50 lines
1.8 KiB
C#
50 lines
1.8 KiB
C#
using Content.Server.GameObjects.Components.Fluids;
|
|
using Content.Server.GameObjects.Components.Movement;
|
|
using Content.Shared.Chemistry;
|
|
using Content.Shared.Interfaces.Chemistry;
|
|
using JetBrains.Annotations;
|
|
using Robust.Shared.Log;
|
|
using Robust.Shared.Map;
|
|
using Robust.Shared.Serialization;
|
|
|
|
namespace Content.Server.Chemistry.TileReactions
|
|
{
|
|
[UsedImplicitly]
|
|
public class SpillTileReaction : ITileReaction
|
|
{
|
|
private float _launchForwardsMultiplier = 1f;
|
|
private float _requiredSlipSpeed = 6f;
|
|
private float _paralyzeTime = 1f;
|
|
private bool _overflow;
|
|
|
|
public void ExposeData(ObjectSerializer serializer)
|
|
{
|
|
// If you want to modify more puddle/slippery values, add them here.
|
|
serializer.DataField(ref _paralyzeTime, "paralyzeTime", 1f);
|
|
serializer.DataField(ref _launchForwardsMultiplier, "launchForwardsMultiplier", 1f);
|
|
serializer.DataField(ref _requiredSlipSpeed, "requiredSlipSpeed", 6f);
|
|
serializer.DataField(ref _overflow, "overflow", false);
|
|
}
|
|
|
|
public ReagentUnit TileReact(TileRef tile, ReagentPrototype reagent, ReagentUnit reactVolume)
|
|
{
|
|
if (reactVolume < 5) return ReagentUnit.Zero;
|
|
|
|
// TODO Make this not puddle smear.
|
|
var puddle = tile.SpillAt(new Solution(reagent.ID, reactVolume), "PuddleSmear", _overflow, false);
|
|
|
|
if (puddle != null)
|
|
{
|
|
var slippery = puddle.Owner.GetComponent<SlipperyComponent>();
|
|
slippery.LaunchForwardsMultiplier = _launchForwardsMultiplier;
|
|
slippery.RequiredSlipSpeed = _requiredSlipSpeed;
|
|
slippery.ParalyzeTime = _paralyzeTime;
|
|
|
|
return reactVolume;
|
|
}
|
|
|
|
return ReagentUnit.Zero;
|
|
}
|
|
}
|
|
}
|