Files
OldThink/Content.Server/Ame/EntitySystems/AmeShieldingSystem.cs
Remuchi a38166ed0f [Tweak] Баланс да (#39)
* tweak: hardsuits size ginormous -> huge

* tweak: made common hardsuits slow less

* tweak: materails&coils are smaller

* tweak: AME parts in crate 9 ->18

* tweak: increase ame efficiency 10x

* Revert "tweak: increase ame efficiency 10x"

This reverts commit add91b3b42db78efd37c9a9099911803c72caf71.

* tweak: increased ame injection amount

* tweak: static storage disabled by default

* tweak: show loco above head disabled by default

* tweak: melee attacks system changed

* add: removed alt attack from stunbaton

* add: stamina damage on heavy attack

* tweak: reduced changeling gamerule chance

* tweak: reduced total armblade damage 40 -> 34. Added structural damage

* tweak: limited tentacle gun range

* fix: fixed windoors damagegroups

* fix: fix functions localization
2024-02-11 14:16:07 +00:00

42 lines
1.4 KiB
C#

using Content.Server.Ame.Components;
using Content.Shared.Ame;
using Robust.Server.GameObjects;
namespace Content.Server.Ame.EntitySystems;
public sealed class AmeShieldingSystem : EntitySystem
{
[Dependency] private readonly AppearanceSystem _appearanceSystem = default!;
[Dependency] private readonly PointLightSystem _pointLightSystem = default!;
public void SetCore(EntityUid uid, bool value, AmeShieldComponent? shield = null)
{
if (!Resolve(uid, ref shield))
return;
if (value == shield.IsCore)
return;
shield.IsCore = value;
_appearanceSystem.SetData(uid, AmeShieldVisuals.Core, value);
if (!value)
UpdateCoreVisuals(uid, 0, false, shield);
}
public void UpdateCoreVisuals(EntityUid uid, int injectionStrength, bool injecting, AmeShieldComponent? shield = null)
{
if (!Resolve(uid, ref shield))
return;
if (!injecting)
{
_appearanceSystem.SetData(uid, AmeShieldVisuals.CoreState, AmeCoreState.Off);
_pointLightSystem.SetEnabled(uid, false);
return;
}
_pointLightSystem.SetRadius(uid, Math.Clamp(injectionStrength, 1, 12));
_pointLightSystem.SetEnabled(uid, true);
_appearanceSystem.SetData(uid, AmeShieldVisuals.CoreState, injectionStrength > 3 ? AmeCoreState.Strong : AmeCoreState.Weak);
}
}