Shadow anomaly returns (#24629)
* content * add cat * ambient * I FORGOT HEARTS! * fix ambient * some fixes * canCollide: false * connect to damageable * pi * remove fx * some fixes * *sad bruh* * hazed * Update base_shadow.yml
This commit is contained in:
@@ -31,6 +31,7 @@ namespace Content.Server.Flash
|
||||
[Dependency] private readonly SharedChargesSystem _charges = default!;
|
||||
[Dependency] private readonly EntityLookupSystem _entityLookup = default!;
|
||||
[Dependency] private readonly IGameTiming _timing = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
[Dependency] private readonly SharedInteractionSystem _interaction = default!;
|
||||
[Dependency] private readonly InventorySystem _inventory = default!;
|
||||
[Dependency] private readonly PopupSystem _popup = default!;
|
||||
@@ -150,27 +151,23 @@ namespace Content.Server.Flash
|
||||
public void FlashArea(EntityUid source, EntityUid? user, float range, float duration, float slowTo = 0.8f, bool displayPopup = false, SoundSpecifier? sound = null)
|
||||
{
|
||||
var transform = EntityManager.GetComponent<TransformComponent>(source);
|
||||
var mapPosition = transform.MapPosition;
|
||||
var flashableEntities = new List<EntityUid>();
|
||||
var mapPosition = _transform.GetMapCoordinates(transform);
|
||||
var flashableQuery = GetEntityQuery<FlashableComponent>();
|
||||
|
||||
foreach (var entity in _entityLookup.GetEntitiesInRange(transform.Coordinates, range))
|
||||
{
|
||||
if (!flashableQuery.HasComponent(entity))
|
||||
if (!flashableQuery.TryGetComponent(entity, out var flashable))
|
||||
continue;
|
||||
|
||||
flashableEntities.Add(entity);
|
||||
}
|
||||
|
||||
foreach (var entity in flashableEntities)
|
||||
{
|
||||
// Check for unobstructed entities while ignoring the mobs with flashable components.
|
||||
if (!_interaction.InRangeUnobstructed(entity, mapPosition, range, CollisionGroup.Opaque, (e) => flashableEntities.Contains(e) || e == source))
|
||||
if (!_interaction.InRangeUnobstructed(entity, mapPosition, range, flashable.CollisionGroup, (e) => e == source))
|
||||
continue;
|
||||
|
||||
// They shouldn't have flash removed in between right?
|
||||
Flash(entity, user, source, duration, slowTo, displayPopup, flashableQuery.GetComponent(entity));
|
||||
}
|
||||
|
||||
if (sound != null)
|
||||
{
|
||||
_audio.PlayPvs(sound, source, AudioParams.Default.WithVolume(1f).WithMaxDistance(3f));
|
||||
|
||||
Reference in New Issue
Block a user