Add reflection for crystals (#16426)
This commit is contained in:
@@ -14,7 +14,6 @@ using Robust.Shared.Physics.Events;
|
||||
|
||||
namespace Content.Server.Projectiles;
|
||||
|
||||
[UsedImplicitly]
|
||||
public sealed class ProjectileSystem : SharedProjectileSystem
|
||||
{
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
@@ -47,7 +46,6 @@ public sealed class ProjectileSystem : SharedProjectileSystem
|
||||
var otherName = ToPrettyString(otherEntity);
|
||||
var direction = args.OurBody.LinearVelocity.Normalized;
|
||||
var modifiedDamage = _damageableSystem.TryChangeDamage(otherEntity, component.Damage, component.IgnoreResistances, origin: component.Shooter);
|
||||
component.DamagedEntity = true;
|
||||
var deleted = Deleted(otherEntity);
|
||||
|
||||
if (modifiedDamage is not null && EntityManager.EntityExists(component.Shooter))
|
||||
@@ -68,11 +66,19 @@ public sealed class ProjectileSystem : SharedProjectileSystem
|
||||
_sharedCameraRecoil.KickCamera(otherEntity, direction);
|
||||
}
|
||||
|
||||
if (component.DeleteOnCollide)
|
||||
{
|
||||
QueueDel(uid);
|
||||
var ev = new ProjectileCollideEvent(uid, false);
|
||||
RaiseLocalEvent(args.OtherEntity, ref ev);
|
||||
|
||||
if (component.ImpactEffect != null && TryComp<TransformComponent>(component.Owner, out var xform))
|
||||
if (!ev.Cancelled)
|
||||
{
|
||||
component.DamagedEntity = true;
|
||||
|
||||
if (component.DeleteOnCollide)
|
||||
{
|
||||
QueueDel(uid);
|
||||
}
|
||||
|
||||
if (component.ImpactEffect != null && TryComp<TransformComponent>(uid, out var xform))
|
||||
{
|
||||
RaiseNetworkEvent(new ImpactEffectEvent(component.ImpactEffect, xform.Coordinates), Filter.Pvs(xform.Coordinates, entityMan: EntityManager));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user