Crossbow (#327)
* Add powered crossbow * Add spear embedding (#18578) * Add spear embedding * fuck this copy-paste * Juicier * the river * Add crossbow embedding * Fix crossbow construction * Finish crossbow * Remove unused --------- Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
21
Content.Client/White/Crossbow/DrawableVisualizerSystem.cs
Normal file
21
Content.Client/White/Crossbow/DrawableVisualizerSystem.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Content.Shared.Weapons.Ranged.Systems;
|
||||
using Content.Shared.White.Crossbow;
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
namespace Content.Client.White.Crossbow;
|
||||
|
||||
public sealed class DrawableSystem : VisualizerSystem<DrawableComponent>
|
||||
{
|
||||
protected override void OnAppearanceChange(EntityUid uid, DrawableComponent component, ref AppearanceChangeEvent args)
|
||||
{
|
||||
if (args.Sprite == null)
|
||||
return;
|
||||
|
||||
var drawn = args.AppearanceData.TryGetValue(DrawableVisuals.Drawn, out var drawnObj) && drawnObj is true;
|
||||
|
||||
var hasAmmo = args.AppearanceData.TryGetValue(AmmoVisuals.AmmoCount, out var ammoCount) && (int) ammoCount > 0;
|
||||
|
||||
var state = drawn ? "drawn" : hasAmmo ? "loaded" : "base";
|
||||
args.Sprite.LayerSetState(0, state);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user