Make combat feel 100x better with this one simple trick (#8231)
This commit is contained in:
@@ -107,7 +107,6 @@ namespace Content.Client.EscapeMenu.UI.Tabs
|
||||
|
||||
AddHeader("ui-options-header-interaction-basic");
|
||||
AddButton(EngineKeyFunctions.Use);
|
||||
AddButton(ContentKeyFunctions.WideAttack);
|
||||
AddButton(ContentKeyFunctions.UseItemInHand);
|
||||
AddButton(ContentKeyFunctions.AltUseItemInHand);
|
||||
AddButton(ContentKeyFunctions.ActivateItemInWorld);
|
||||
|
||||
@@ -46,7 +46,6 @@ namespace Content.Client.Input
|
||||
human.AddFunction(ContentKeyFunctions.SmartEquipBackpack);
|
||||
human.AddFunction(ContentKeyFunctions.SmartEquipBelt);
|
||||
human.AddFunction(ContentKeyFunctions.MouseMiddle);
|
||||
human.AddFunction(ContentKeyFunctions.WideAttack);
|
||||
human.AddFunction(ContentKeyFunctions.ArcadeUp);
|
||||
human.AddFunction(ContentKeyFunctions.ArcadeDown);
|
||||
human.AddFunction(ContentKeyFunctions.ArcadeLeft);
|
||||
|
||||
@@ -39,8 +39,6 @@ namespace Content.Server.Interaction
|
||||
SubscribeNetworkEvent<DragDropRequestEvent>(HandleDragDropRequestEvent);
|
||||
|
||||
CommandBinds.Builder
|
||||
.Bind(ContentKeyFunctions.WideAttack,
|
||||
new PointerInputCmdHandler(HandleWideAttack))
|
||||
.Bind(ContentKeyFunctions.TryPullObject,
|
||||
new PointerInputCmdHandler(HandleTryPullObject))
|
||||
.Register<InteractionSystem>();
|
||||
@@ -128,21 +126,6 @@ namespace Content.Server.Interaction
|
||||
}
|
||||
#endregion
|
||||
|
||||
private bool HandleWideAttack(ICommonSession? session, EntityCoordinates coords, EntityUid uid)
|
||||
{
|
||||
// client sanitization
|
||||
if (!ValidateClientInput(session, coords, uid, out var userEntity))
|
||||
{
|
||||
Logger.InfoS("system.interaction", $"WideAttack input validation failed");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (TryComp(userEntity, out CombatModeComponent? combatMode) && combatMode.IsInCombatMode)
|
||||
DoAttack(userEntity.Value, coords, true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Entity will try and use their active hand at the target location.
|
||||
/// Don't use for players
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace Content.Shared.Input
|
||||
[KeyFunctions]
|
||||
public static class ContentKeyFunctions
|
||||
{
|
||||
public static readonly BoundKeyFunction WideAttack = "WideAttack";
|
||||
public static readonly BoundKeyFunction UseItemInHand = "ActivateItemInHand";
|
||||
public static readonly BoundKeyFunction AltUseItemInHand = "AltActivateItemInHand";
|
||||
public static readonly BoundKeyFunction ActivateItemInWorld = "ActivateItemInWorld";
|
||||
|
||||
@@ -192,7 +192,9 @@ namespace Content.Shared.Interaction
|
||||
// TODO COMBAT Consider using alt-interact for advanced combat? maybe alt-interact disarms?
|
||||
if (!altInteract && TryComp(user, out SharedCombatModeComponent? combatMode) && combatMode.IsInCombatMode)
|
||||
{
|
||||
DoAttack(user, coordinates, false, target);
|
||||
// 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);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,9 +17,6 @@ binds:
|
||||
type: State
|
||||
key: MouseLeft
|
||||
canFocus: true
|
||||
- function: WideAttack
|
||||
type: State
|
||||
key: Space
|
||||
- function: ShowDebugMonitors
|
||||
type: Toggle
|
||||
key: F3
|
||||
|
||||
Reference in New Issue
Block a user