Added a component that lets ranged weapons make melee attacks. (#29484)

This commit is contained in:
Sigil
2025-02-20 14:52:28 +07:00
committed by GitHub
parent 1079da4600
commit 3ce81d35be
2 changed files with 78 additions and 40 deletions

View File

@@ -0,0 +1,22 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Weapons.Melee.Components;
/// <summary>
/// This is used to allow ranged weapons to make melee attacks by right-clicking.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, Access(typeof(SharedMeleeWeaponSystem))]
public sealed partial class AltFireMeleeComponent : Component
{
[DataField, AutoNetworkedField]
public AltFireAttackType AttackType = AltFireAttackType.Light;
}
[Flags]
public enum AltFireAttackType : byte
{
Light = 0, // Standard single-target attack.
Heavy = 1 << 0, // Wide swing.
Disarm = 1 << 1
}