Wieldable/two-handed weapons (#4554)
* wielding kinda works * rough out all the edges, wielding works nicely * popups + loc * increase damage & extra damage against whitelist * small fixes * forgot to actually do that * reviews * reviews + thing * use resistances and not extradamageagainstwhitelist * slashy * make increasedamageonwield and melee hit events work with modifiersets * Silly individual
This commit is contained in:
@@ -122,6 +122,8 @@ namespace Content.Shared.Pulling.Components
|
||||
}
|
||||
}
|
||||
|
||||
valuePuller.Pulling = Owner;
|
||||
|
||||
// Continue with pulling process.
|
||||
|
||||
var pullAttempt = new PullAttemptMessage(pullerPhysics, _physics);
|
||||
@@ -241,7 +243,7 @@ namespace Content.Shared.Pulling.Components
|
||||
|
||||
Puller = puller;
|
||||
|
||||
if (Puller != puller)
|
||||
if(Puller != puller)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -266,6 +268,11 @@ namespace Content.Shared.Pulling.Components
|
||||
_physics.RemoveJoint(_pullJoint);
|
||||
}
|
||||
|
||||
if (user != null && user.TryGetComponent<SharedPullerComponent>(out var puller))
|
||||
{
|
||||
puller.Pulling = null;
|
||||
}
|
||||
|
||||
_pullJoint = null;
|
||||
Puller = null;
|
||||
return true;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Content.Shared.Movement.Components;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.ViewVariables;
|
||||
using Component = Robust.Shared.GameObjects.Component;
|
||||
|
||||
namespace Content.Shared.Pulling.Components
|
||||
@@ -11,14 +12,15 @@ namespace Content.Shared.Pulling.Components
|
||||
|
||||
private IEntity? _pulling;
|
||||
|
||||
public float WalkSpeedModifier => Pulling == null ? 1.0f : 0.75f;
|
||||
public float WalkSpeedModifier => _pulling == null ? 1.0f : 0.75f;
|
||||
|
||||
public float SprintSpeedModifier => Pulling == null ? 1.0f : 0.75f;
|
||||
public float SprintSpeedModifier => _pulling == null ? 1.0f : 0.75f;
|
||||
|
||||
[ViewVariables]
|
||||
public IEntity? Pulling
|
||||
{
|
||||
get => _pulling;
|
||||
private set
|
||||
set
|
||||
{
|
||||
if (_pulling == value)
|
||||
{
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using Content.Shared.Alert;
|
||||
using Content.Shared.Hands;
|
||||
using Content.Shared.Physics.Pull;
|
||||
using Content.Shared.Pulling.Components;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Shared.Pulling
|
||||
namespace Content.Shared.Pulling.Systems
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public sealed class SharedPullerSystem : EntitySystem
|
||||
@@ -15,6 +16,21 @@ namespace Content.Shared.Pulling
|
||||
|
||||
SubscribeLocalEvent<SharedPullerComponent, PullStartedMessage>(PullerHandlePullStarted);
|
||||
SubscribeLocalEvent<SharedPullerComponent, PullStoppedMessage>(PullerHandlePullStopped);
|
||||
SubscribeLocalEvent<SharedPullerComponent, VirtualItemDeletedEvent>(OnVirtualItemDeleted);
|
||||
}
|
||||
|
||||
private void OnVirtualItemDeleted(EntityUid uid, SharedPullerComponent component, VirtualItemDeletedEvent args)
|
||||
{
|
||||
if (component.Pulling == null)
|
||||
return;
|
||||
|
||||
if (component.Pulling == EntityManager.GetEntity(args.BlockingEntity));
|
||||
{
|
||||
if (ComponentManager.TryGetComponent<SharedPullableComponent>(args.BlockingEntity, out var comp))
|
||||
{
|
||||
comp.TryStopPull(EntityManager.GetEntity(uid));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void PullerHandlePullStarted(
|
||||
|
||||
Reference in New Issue
Block a user