mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-16 21:17:39 +03:00
let FlashArea be called from shared (#30343)
* let FlashArea be called from shared * untroll --------- Co-authored-by: deltanedas <@deltanedas:kde.org> Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com> (cherry picked from commit 84062da1289b760ee8714239322ae07b74e6187c)
This commit is contained in:
@@ -16,6 +16,7 @@ namespace Content.Client.Flash
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly IGameTiming _timing = default!;
|
||||
|
||||
private readonly SharedFlashSystem _flash;
|
||||
private readonly StatusEffectsSystem _statusSys;
|
||||
|
||||
public override OverlaySpace Space => OverlaySpace.WorldSpace;
|
||||
@@ -27,6 +28,7 @@ namespace Content.Client.Flash
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
_shader = _prototypeManager.Index<ShaderPrototype>("FlashedEffect").InstanceUnique();
|
||||
_flash = _entityManager.System<SharedFlashSystem>();
|
||||
_statusSys = _entityManager.System<StatusEffectsSystem>();
|
||||
}
|
||||
|
||||
@@ -41,7 +43,7 @@ namespace Content.Client.Flash
|
||||
|| !_entityManager.TryGetComponent<StatusEffectsComponent>(playerEntity, out var status))
|
||||
return;
|
||||
|
||||
if (!_statusSys.TryGetTime(playerEntity.Value, SharedFlashSystem.FlashedKey, out var time, status))
|
||||
if (!_statusSys.TryGetTime(playerEntity.Value, _flash.FlashedKey, out var time, status))
|
||||
return;
|
||||
|
||||
var curTime = _timing.CurTime;
|
||||
|
||||
@@ -28,7 +28,6 @@ using Content.Shared.Traits.Assorted.Components;
|
||||
using Content.Shared.Eye.Blinding.Systems;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
|
||||
namespace Content.Server.Flash
|
||||
{
|
||||
internal sealed class FlashSystem : SharedFlashSystem
|
||||
@@ -174,7 +173,7 @@ namespace Content.Server.Flash
|
||||
}
|
||||
}
|
||||
|
||||
public void FlashArea(Entity<FlashComponent?> source, EntityUid? user, float range, float duration, float slowTo = 0.8f, bool displayPopup = false, float probability = 1f, SoundSpecifier? sound = null, float stunTime = 0f, float knockdownTime = 0f) // WD EDIT
|
||||
public override void FlashArea(Entity<FlashComponent?> source, EntityUid? user, float range, float duration, float slowTo = 0.8f, bool displayPopup = false, float probability = 1f, SoundSpecifier? sound = null, float stunTime = 0f, float knockdownTime = 0f) // WD EDIT
|
||||
{
|
||||
var transform = Transform(source);
|
||||
var mapPosition = _transform.GetMapCoordinates(transform);
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
using Content.Shared.Flash.Components;
|
||||
using Content.Shared.StatusEffect;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Flash
|
||||
namespace Content.Shared.Flash;
|
||||
|
||||
public abstract class SharedFlashSystem : EntitySystem
|
||||
{
|
||||
public abstract class SharedFlashSystem : EntitySystem
|
||||
public ProtoId<StatusEffectPrototype> FlashedKey = "Flashed";
|
||||
|
||||
public virtual void FlashArea(Entity<FlashComponent?> source, EntityUid? user, float range, float duration, float slowTo = 0.8f, bool displayPopup = false, float probability = 1f, SoundSpecifier? sound = null, float stunTime = 0f, float knockdownTime = 0f) // WD EDIT
|
||||
{
|
||||
[ValidatePrototypeId<StatusEffectPrototype>]
|
||||
public const string FlashedKey = "Flashed";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user