Stunnable New Status and Cleanup (#38618)
Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> Co-authored-by: pa.pecherskij <pa.pecherskij@interfax.ru>
This commit is contained in:
committed by
GitHub
parent
2b2b9b11b8
commit
e85bc1bb8c
@@ -1,8 +1,6 @@
|
||||
using Content.Server.Stunnable.Components;
|
||||
using Content.Shared.Standing;
|
||||
using Content.Shared.StatusEffect;
|
||||
using Content.Shared.Movement.Systems;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Physics.Dynamics;
|
||||
using Content.Shared.Throwing;
|
||||
using Robust.Shared.Physics.Events;
|
||||
|
||||
@@ -12,6 +10,7 @@ namespace Content.Server.Stunnable
|
||||
internal sealed class StunOnCollideSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly StunSystem _stunSystem = default!;
|
||||
[Dependency] private readonly MovementModStatusSystem _movementMod = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -22,15 +21,19 @@ namespace Content.Server.Stunnable
|
||||
|
||||
private void TryDoCollideStun(EntityUid uid, StunOnCollideComponent component, EntityUid target)
|
||||
{
|
||||
if (!TryComp<StatusEffectsComponent>(target, out var status))
|
||||
return;
|
||||
_stunSystem.TryUpdateStunDuration(target, component.StunAmount);
|
||||
|
||||
_stunSystem.TryStun(target, component.StunAmount, component.Refresh, status);
|
||||
_stunSystem.TryKnockdown(target, component.KnockdownAmount, component.Refresh, component.AutoStand, force: true);
|
||||
|
||||
_stunSystem.TryKnockdown(target, component.KnockdownAmount, component.Refresh, component.AutoStand);
|
||||
|
||||
_stunSystem.TrySlowdown(target, component.SlowdownAmount, component.Refresh, component.WalkSpeedModifier, component.SprintSpeedModifier, status);
|
||||
_movementMod.TryUpdateMovementSpeedModDuration(
|
||||
target,
|
||||
MovementModStatusSystem.TaserSlowdown,
|
||||
component.SlowdownAmount,
|
||||
component.WalkSpeedModifier,
|
||||
component.SprintSpeedModifier
|
||||
);
|
||||
}
|
||||
|
||||
private void HandleCollide(EntityUid uid, StunOnCollideComponent component, ref StartCollideEvent args)
|
||||
{
|
||||
if (args.OurFixtureId != component.FixtureID)
|
||||
|
||||
Reference in New Issue
Block a user