No more bullshit
This commit is contained in:
@@ -11,6 +11,7 @@ using Content.Shared.Weapons.Melee;
|
|||||||
using Content.Shared.Weapons.Melee.Events;
|
using Content.Shared.Weapons.Melee.Events;
|
||||||
using Robust.Shared.Audio.Systems;
|
using Robust.Shared.Audio.Systems;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
|
using Content.Shared.Mobs.Systems;
|
||||||
|
|
||||||
namespace Content.Shared._White.Blocking;
|
namespace Content.Shared._White.Blocking;
|
||||||
|
|
||||||
@@ -21,16 +22,17 @@ public sealed class MeleeBlockSystem : EntitySystem
|
|||||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||||
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
|
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
|
||||||
[Dependency] private readonly StatusEffectsSystem _statusEffect = default!;
|
[Dependency] private readonly StatusEffectsSystem _statusEffect = default!;
|
||||||
|
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
SubscribeLocalEvent<HandsComponent, MeleeBlockAttemptEvent>(OnBlockAttempt,
|
SubscribeLocalEvent<HandsComponent, MeleeBlockAttemptEvent>(OnBlockAttempt,
|
||||||
after: new[] {typeof(BlockingSystem)});
|
after: new[] { typeof(BlockingSystem) });
|
||||||
SubscribeLocalEvent<MeleeWeaponComponent, MeleeHitEvent>(OnHit,
|
SubscribeLocalEvent<MeleeWeaponComponent, MeleeHitEvent>(OnHit,
|
||||||
before: new[] {typeof(StaminaSystem), typeof(MeleeThrowOnHitSystem)},
|
before: new[] { typeof(StaminaSystem), typeof(MeleeThrowOnHitSystem) },
|
||||||
after: new[] {typeof(BackstabSystem)});
|
after: new[] { typeof(BackstabSystem) });
|
||||||
SubscribeLocalEvent<MeleeBlockComponent, ExaminedEvent>(OnExamine);
|
SubscribeLocalEvent<MeleeBlockComponent, ExaminedEvent>(OnExamine);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,6 +78,9 @@ public sealed class MeleeBlockSystem : EntitySystem
|
|||||||
if (TryComp(uid.Value, out ItemToggleComponent? toggle) && !toggle.Activated)
|
if (TryComp(uid.Value, out ItemToggleComponent? toggle) && !toggle.Activated)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!_mobStateSystem.IsAlive(ent))
|
||||||
|
return;
|
||||||
|
|
||||||
_audio.PlayPredicted(block.BlockSound, ent, args.Attacker);
|
_audio.PlayPredicted(block.BlockSound, ent, args.Attacker);
|
||||||
_popupSystem.PopupPredicted(Loc.GetString("melee-block-event-blocked"), ent, args.Attacker);
|
_popupSystem.PopupPredicted(Loc.GetString("melee-block-event-blocked"), ent, args.Attacker);
|
||||||
_damageable.TryChangeDamage(uid.Value, args.Damage);
|
_damageable.TryChangeDamage(uid.Value, args.Damage);
|
||||||
|
|||||||
Reference in New Issue
Block a user