* 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
69 lines
2.2 KiB
C#
69 lines
2.2 KiB
C#
using JetBrains.Annotations;
|
|
using Robust.Client.GameObjects;
|
|
using Robust.Client.Graphics;
|
|
using Robust.Client.Interfaces.GameObjects.Components;
|
|
using Robust.Client.Interfaces.ResourceManagement;
|
|
using Robust.Client.ResourceManagement;
|
|
using Robust.Shared.GameObjects.Components.Renderable;
|
|
using Robust.Shared.IoC;
|
|
using Robust.Shared.Log;
|
|
using Robust.Shared.Utility;
|
|
using System;
|
|
using Content.Shared.GameObjects.Components.Atmos;
|
|
using YamlDotNet.RepresentationModel;
|
|
|
|
namespace Content.Client.GameObjects.Components.Atmos
|
|
{
|
|
[UsedImplicitly]
|
|
public class SiphonVisualizer : AppearanceVisualizer
|
|
{
|
|
private RSI _siphonRSI;
|
|
|
|
public override void LoadData(YamlMappingNode node)
|
|
{
|
|
base.LoadData(node);
|
|
|
|
var rsiString = node.GetNode("siphonRSI").ToString();
|
|
var rsiPath = SharedSpriteComponent.TextureRoot / rsiString;
|
|
try
|
|
{
|
|
var resourceCache = IoCManager.Resolve<IResourceCache>();
|
|
var resource = resourceCache.GetResource<RSIResource>(rsiPath);
|
|
_siphonRSI = resource.RSI;
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
Logger.ErrorS("go.siphonvisualizer", "Unable to load RSI '{0}'. Trace:\n{1}", rsiPath, e);
|
|
}
|
|
}
|
|
|
|
public override void OnChangeData(AppearanceComponent component)
|
|
{
|
|
base.OnChangeData(component);
|
|
|
|
if (!component.Owner.TryGetComponent(out ISpriteComponent sprite))
|
|
{
|
|
return;
|
|
}
|
|
if (!component.TryGetData(SiphonVisuals.VisualState, out SiphonVisualState siphonVisualState))
|
|
{
|
|
return;
|
|
}
|
|
|
|
var siphonBaseState = "scrub";
|
|
siphonBaseState += siphonVisualState.SiphonEnabled ? "On" : "Off";
|
|
|
|
sprite.LayerMapReserveBlank(Layer.SiphonBase);
|
|
var baseSiphonLayer = sprite.LayerMapGet(Layer.SiphonBase);
|
|
sprite.LayerSetRSI(baseSiphonLayer, _siphonRSI);
|
|
sprite.LayerSetState(baseSiphonLayer, siphonBaseState);
|
|
sprite.LayerSetVisible(baseSiphonLayer, true);
|
|
}
|
|
|
|
private enum Layer
|
|
{
|
|
SiphonBase,
|
|
}
|
|
}
|
|
}
|