Melee refactor (#10897)

Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2022-09-29 15:51:59 +10:00
committed by GitHub
parent c583b7b361
commit f51248ecaa
140 changed files with 2440 additions and 1824 deletions

View File

@@ -198,12 +198,9 @@ namespace Content.Shared.Interaction
if (target != null && Deleted(target.Value))
return;
// TODO COMBAT Consider using alt-interact for advanced combat? maybe alt-interact disarms?
if (!altInteract && TryComp(user, out SharedCombatModeComponent? combatMode) && combatMode.IsInCombatMode)
if (TryComp(user, out SharedCombatModeComponent? combatMode) && combatMode.IsInCombatMode)
{
// Wide attack if there isn't a target or the target is out of range, click attack otherwise.
var shouldWideAttack = target == null || !InRangeUnobstructed(user, target.Value);
DoAttack(user, coordinates, shouldWideAttack, target);
// Eat the input
return;
}
@@ -300,12 +297,6 @@ namespace Content.Shared.Interaction
checkAccess: false);
}
public virtual void DoAttack(EntityUid user, EntityCoordinates coordinates, bool wideAttack,
EntityUid? targetUid = null)
{
// TODO PREDICTION move server-side interaction logic into the shared system for interaction prediction.
}
public void InteractUsingRanged(EntityUid user, EntityUid used, EntityUid? target,
EntityCoordinates clickLocation, bool inRangeUnobstructed)
{