Adds new different reaction types. (#2114)
* 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
This commit is contained in:
committed by
GitHub
parent
37d6ca556f
commit
69059eac80
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using Content.Server.Atmos;
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Shared.Chemistry;
|
||||
using Content.Shared.Interfaces.Chemistry;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Server.Chemistry.TileReactions
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class FlammableTileReaction : ITileReaction
|
||||
{
|
||||
private float _temperatureMultiplier = 1.25f;
|
||||
|
||||
public void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
serializer.DataField(ref _temperatureMultiplier, "temperatureMultiplier", 1.15f);
|
||||
}
|
||||
|
||||
public ReagentUnit TileReact(TileRef tile, ReagentPrototype reagent, ReagentUnit reactVolume)
|
||||
{
|
||||
if (reactVolume <= ReagentUnit.Zero || tile.Tile.IsEmpty) return ReagentUnit.Zero;
|
||||
var tileAtmos = tile.GridIndices.GetTileAtmosphere(tile.GridIndex);
|
||||
if (tileAtmos == null || !tileAtmos.Hotspot.Valid) return ReagentUnit.Zero;
|
||||
tileAtmos.Air.Temperature *= MathF.Max(_temperatureMultiplier * reactVolume.Float(), 1f);
|
||||
tileAtmos.Air.React(tileAtmos);
|
||||
return reactVolume;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user