* 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 VentVisualizer : AppearanceVisualizer
|
|
{
|
|
private RSI _ventRSI;
|
|
|
|
public override void LoadData(YamlMappingNode node)
|
|
{
|
|
base.LoadData(node);
|
|
|
|
var rsiString = node.GetNode("ventRSI").ToString();
|
|
var rsiPath = SharedSpriteComponent.TextureRoot / rsiString;
|
|
try
|
|
{
|
|
var resourceCache = IoCManager.Resolve<IResourceCache>();
|
|
var resource = resourceCache.GetResource<RSIResource>(rsiPath);
|
|
_ventRSI = resource.RSI;
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
Logger.ErrorS("go.ventvisualizer", "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(VentVisuals.VisualState, out VentVisualState ventVisualState))
|
|
{
|
|
return;
|
|
}
|
|
|
|
var ventBaseState = "vent";
|
|
ventBaseState += ventVisualState.VentEnabled ? "On" : "Off";
|
|
|
|
sprite.LayerMapReserveBlank(Layer.VentBase);
|
|
var baseVentLayer = sprite.LayerMapGet(Layer.VentBase);
|
|
sprite.LayerSetRSI(baseVentLayer, _ventRSI);
|
|
sprite.LayerSetState(baseVentLayer, ventBaseState);
|
|
sprite.LayerSetVisible(baseVentLayer, true);
|
|
}
|
|
|
|
private enum Layer
|
|
{
|
|
VentBase,
|
|
}
|
|
}
|
|
}
|