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:
mirrorcult
2021-09-17 07:16:11 -07:00
committed by GitHub
parent 078a62762f
commit 62f6c8dd8e
36 changed files with 719 additions and 161 deletions

View File

@@ -228,7 +228,23 @@ namespace Content.Shared.Hands.Components
}
}
private bool TryGetHandHoldingEntity(IEntity entity, [NotNullWhen(true)] out Hand? handFound)
/// <summary>
/// Returns the number of hands that have no items in them.
/// </summary>
/// <returns></returns>
public int GetFreeHands()
{
int acc = 0;
foreach (var hand in Hands)
{
if (hand.HeldEntity == null)
acc += 1;
}
return acc;
}
public bool TryGetHandHoldingEntity(IEntity entity, [NotNullWhen(true)] out Hand? handFound)
{
handFound = null;
@@ -418,6 +434,7 @@ namespace Content.Shared.Hands.Components
Logger.Error($"{nameof(SharedHandsComponent)} on {Owner} could not remove {heldEntity} from {handContainer}.");
return;
}
OnHeldEntityRemovedFromHand(heldEntity, hand.ToHandState());
HandsModified();