* Code is ready but item now spawning * Prototype of SeveralExplosive component * Remaked to FlashExplosiveComponent using * Done. But i feel myself retarted * Remaked. Looks good * Full loaded prototype added * Throwing in progress. Fatal error is here * I forgot about shared * Sloth refactor * Delayed spawning and fix crashes * Full clusterbang code. * Removed useless variable and tuned delay * Delete wrong in CreamPiedComponent * Now yaml is code quality followed * Reworked to GetLevel with bugs * Never forget resources, guys * RoundToLevels added. Now it works. * New textures and sloth refactor is returned * Now it's TryGetComponent * Visualizer maximum fix and look fix * Logging and no max and min check * Removed max grenades sending * vizualizer is better now * GrenadesMax removed * grammar, checks, NextFloat and no more try catch * Unused using removed Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
using Content.Shared.GameObjects.Components.Explosion;
|
|
using JetBrains.Annotations;
|
|
using Robust.Client.GameObjects;
|
|
using Robust.Client.Interfaces.GameObjects.Components;
|
|
using Robust.Shared.Utility;
|
|
using YamlDotNet.RepresentationModel;
|
|
|
|
namespace Content.Client.GameObjects.Components.Explosion
|
|
{
|
|
[UsedImplicitly]
|
|
// ReSharper disable once InconsistentNaming
|
|
public class ClusterFlashVisualizer : AppearanceVisualizer
|
|
{
|
|
private string _state;
|
|
|
|
public override void LoadData(YamlMappingNode node)
|
|
{
|
|
base.LoadData(node);
|
|
if (node.TryGetNode("state", out var state))
|
|
{
|
|
_state = state.AsString();
|
|
}
|
|
}
|
|
|
|
public override void OnChangeData(AppearanceComponent component)
|
|
{
|
|
base.OnChangeData(component);
|
|
|
|
if (!component.Owner.TryGetComponent<ISpriteComponent>(out var sprite))
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (component.TryGetData(ClusterFlashVisuals.GrenadesCounter, out int grenadesCounter))
|
|
{
|
|
sprite.LayerSetState(0, $"{_state}-{grenadesCounter}");
|
|
}
|
|
}
|
|
}
|
|
}
|