Предательский нож (#112)
* - add: Add betrayal knife. * - tweak: Small size.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Linq;
|
||||
using Content.Client.Gameplay;
|
||||
using Content.Shared._White.BetrayalDagger;
|
||||
using Content.Shared.CombatMode;
|
||||
using Content.Shared.Effects;
|
||||
using Content.Shared.Hands.Components;
|
||||
@@ -129,6 +130,28 @@ public sealed partial class MeleeWeaponSystem : SharedMeleeWeaponSystem
|
||||
return;
|
||||
}
|
||||
|
||||
// WD START
|
||||
if (HasComp<BlinkComponent>(weaponUid))
|
||||
{
|
||||
if (!_xformQuery.TryGetComponent(entity, out var userXform) ||
|
||||
!Timing.IsFirstTimePredicted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var targetMap = coordinates.ToMap(EntityManager, TransformSystem);
|
||||
|
||||
if (targetMap.MapId != userXform.MapID)
|
||||
return;
|
||||
|
||||
var userPos = TransformSystem.GetWorldPosition(userXform);
|
||||
var direction = targetMap.Position - userPos;
|
||||
|
||||
RaiseNetworkEvent(new BlinkEvent(GetNetEntity(weaponUid), direction));
|
||||
return;
|
||||
}
|
||||
// WD END
|
||||
|
||||
ClientHeavyAttack(entity, coordinates, weaponUid, weapon);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user