Rework eshield (#470)
This commit is contained in:
@@ -32,6 +32,11 @@ public sealed partial class ReflectComponent : Component
|
||||
|
||||
[DataField("soundOnReflect")]
|
||||
public SoundSpecifier? SoundOnReflect = new SoundPathSpecifier("/Audio/Weapons/Guns/Hits/laser_sear_wall.ogg");
|
||||
|
||||
// WD START
|
||||
[DataField("damageOnReflect"), ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
|
||||
public bool DamageOnReflect;
|
||||
// WD END
|
||||
}
|
||||
|
||||
[Flags]
|
||||
|
||||
@@ -2,6 +2,7 @@ using System.Diagnostics.CodeAnalysis;
|
||||
using System.Numerics;
|
||||
using Content.Shared.Administration.Logs;
|
||||
using Content.Shared.Audio;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.Hands;
|
||||
using Content.Shared.Inventory;
|
||||
@@ -35,6 +36,7 @@ public sealed class ReflectSystem : EntitySystem
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
[Dependency] private readonly InventorySystem _inventorySystem = default!;
|
||||
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -123,6 +125,12 @@ public sealed class ReflectSystem : EntitySystem
|
||||
|
||||
if (Resolve(projectile, ref projectileComp, false))
|
||||
{
|
||||
if (reflect.DamageOnReflect) // WD
|
||||
{
|
||||
_damageableSystem.TryChangeDamage(reflector, projectileComp.Damage, projectileComp.IgnoreResistances,
|
||||
origin: projectileComp.Shooter);
|
||||
}
|
||||
|
||||
_adminLogger.Add(LogType.BulletHit, LogImpact.Medium, $"{ToPrettyString(user)} reflected {ToPrettyString(projectile)} from {ToPrettyString(projectileComp.Weapon)} shot by {projectileComp.Shooter}");
|
||||
|
||||
projectileComp.Shooter = user;
|
||||
|
||||
Reference in New Issue
Block a user