decelerator nerf and projectile penetration mini refactor (#24032)

* decelerator nerf and projectile fix

* datafield name difference

* forgot to add component

* missed datafield styling

* comment made summary

* CanPenetrateComponent and CollisionLayer check.

* Small comment changes
This commit is contained in:
Arendian
2024-01-15 00:39:09 +01:00
committed by GitHub
parent f9a57dc11e
commit 04a8761bb6
7 changed files with 154 additions and 38 deletions

View File

@@ -5,9 +5,7 @@ using Content.Shared.Camera;
using Content.Shared.Damage;
using Content.Shared.Database;
using Content.Shared.Projectiles;
using Robust.Server.GameObjects;
using Robust.Shared.Physics.Events;
using Content.Shared.Mobs.Components;
using Robust.Shared.Player;
namespace Content.Server.Projectiles;
@@ -71,17 +69,11 @@ public sealed class ProjectileSystem : SharedProjectileSystem
component.DamagedEntity = true;
if (component.CanPenetrate)
{
component.DamagedEntity = false;
var afterProjectileHitEvent = new AfterProjectileHitEvent(component.Damage, target, args.OtherFixture);
RaiseLocalEvent(uid, ref afterProjectileHitEvent);
if (component.DeleteOnCollide && !HasComp<MobStateComponent>(target))
QueueDel(uid);
}
else if (component.DeleteOnCollide)
{
if (component.DeleteOnCollide)
QueueDel(uid);
}
if (component.ImpactEffect != null && TryComp<TransformComponent>(uid, out var xform))
{