Adds IThrowCollide, Creaming people with cream pies and tactical stun baton throws (#2122)
This commit is contained in:
committed by
GitHub
parent
db32180942
commit
4c34a12c67
@@ -28,7 +28,7 @@ using Robust.Shared.ViewVariables;
|
||||
namespace Content.Server.GameObjects.Components.Weapon.Melee
|
||||
{
|
||||
[RegisterComponent]
|
||||
public class StunbatonComponent : MeleeWeaponComponent, IUse, IExamine, IMapInit, IInteractUsing
|
||||
public class StunbatonComponent : MeleeWeaponComponent, IUse, IExamine, IMapInit, IInteractUsing, IThrowCollide
|
||||
{
|
||||
[Dependency] private readonly IRobustRandom _robustRandom = default!;
|
||||
|
||||
@@ -282,5 +282,15 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
|
||||
component.EjectCell(user);
|
||||
}
|
||||
}
|
||||
|
||||
public void DoHit(ThrowCollideEventArgs eventArgs)
|
||||
{
|
||||
if (!Activated || Cell == null || !Cell.TryUseCharge(EnergyPerUse) || !eventArgs.Target.TryGetComponent(out StunnableComponent stunnable))
|
||||
return;
|
||||
|
||||
EntitySystem.Get<AudioSystem>().PlayAtCoords("/Audio/Weapons/egloves.ogg", Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
|
||||
|
||||
stunnable.Paralyze(_paralyzeTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user