Melee refactor (#10897)
Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
using Content.Server.CombatMode;
|
||||
using Content.Server.NPC.Components;
|
||||
using Content.Server.Weapon.Melee.Components;
|
||||
using Content.Shared.MobState;
|
||||
using Content.Shared.MobState.Components;
|
||||
using Content.Shared.Weapons.Melee;
|
||||
|
||||
namespace Content.Server.NPC.Systems;
|
||||
|
||||
@@ -64,7 +64,7 @@ public sealed partial class NPCCombatSystem
|
||||
return;
|
||||
}
|
||||
|
||||
if (weapon.CooldownEnd > _timing.CurTime)
|
||||
if (weapon.NextAttack > _timing.CurTime)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -84,6 +84,6 @@ public sealed partial class NPCCombatSystem
|
||||
return;
|
||||
}
|
||||
|
||||
_interaction.DoAttack(component.Owner, targetXform.Coordinates, false, component.Target);
|
||||
_melee.AttemptLightAttack(component.Owner, weapon, component.Target);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
using Content.Server.Interaction;
|
||||
using Content.Server.Weapon.Ranged.Systems;
|
||||
using Content.Server.Weapons.Ranged.Systems;
|
||||
using Content.Shared.CombatMode;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Weapons.Melee;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
@@ -17,6 +18,7 @@ public sealed partial class NPCCombatSystem : EntitySystem
|
||||
[Dependency] private readonly GunSystem _gun = default!;
|
||||
[Dependency] private readonly InteractionSystem _interaction = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly SharedMeleeWeaponSystem _melee = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
|
||||
public override void Initialize()
|
||||
|
||||
Reference in New Issue
Block a user