diff --git a/Content.Client/Weapons/Melee/MeleeWeaponSystem.cs b/Content.Client/Weapons/Melee/MeleeWeaponSystem.cs index be4bb02cbb..2f7f09ae98 100644 --- a/Content.Client/Weapons/Melee/MeleeWeaponSystem.cs +++ b/Content.Client/Weapons/Melee/MeleeWeaponSystem.cs @@ -103,7 +103,7 @@ public sealed partial class MeleeWeaponSystem : SharedMeleeWeaponSystem } // If it's an unarmed attack then do a disarm - if (weaponUid == entity) + if (weapon.AltDisarm && weaponUid == entity) { EntityUid? target = null; @@ -128,7 +128,7 @@ public sealed partial class MeleeWeaponSystem : SharedMeleeWeaponSystem return; } - // Otherwise do heavy attack if it's a weapon. + // Otherwise do heavy attack. // Start a windup if (weapon.WindUpStart == null) diff --git a/Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs b/Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs index 4bb83425e2..866dcddb5c 100644 --- a/Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs +++ b/Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs @@ -15,6 +15,14 @@ namespace Content.Shared.Weapons.Melee; [RegisterComponent, NetworkedComponent] public sealed class MeleeWeaponComponent : Component { + // TODO: This is becoming bloated as shit. + // This should just be its own component for alt attacks. + /// + /// Does this entity do a disarm on alt attack. + /// + [DataField("altDisarm"), ViewVariables(VVAccess.ReadWrite)] + public bool AltDisarm = true; + /// /// Should the melee weapon's damage stats be examinable. /// diff --git a/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs b/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs index ed158cd788..7253699721 100644 --- a/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs +++ b/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs @@ -460,6 +460,11 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem case LightAttackEvent light: if (!Blocker.CanAttack(user, light.Target)) return false; + + // Can't self-attack if you're the weapon + if (weaponUid == light.Target) + return false; + break; case DisarmAttackEvent disarm: if (!Blocker.CanAttack(user, disarm.Target)) diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/carp.yml b/Resources/Prototypes/Entities/Mobs/NPCs/carp.yml index bf045e5987..f781a27b4f 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/carp.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/carp.yml @@ -56,6 +56,7 @@ - id: FoodMeatFish amount: 2 - type: MeleeWeapon + altDisarm: false hidden: true angle: 0 animation: WeaponArcBite diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/xeno.yml b/Resources/Prototypes/Entities/Mobs/NPCs/xeno.yml index 4eb7081b4f..a00444fe50 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/xeno.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/xeno.yml @@ -64,6 +64,7 @@ - type: Bloodstream bloodReagent: FluorosulfuricAcid - type: MeleeWeapon + altDisarm: false hidden: true angle: 0 soundHit: diff --git a/Resources/Prototypes/Entities/Mobs/Player/dragon.yml b/Resources/Prototypes/Entities/Mobs/Player/dragon.yml index c3ddbf7bc2..4b6c7c38e2 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/dragon.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/dragon.yml @@ -97,6 +97,7 @@ path: /Audio/Animals/space_dragon_roar.ogg soundPerceivedByOthers: false # A 75% chance for a loud roar would get old fast. - type: MeleeWeapon + altDisarm: false hidden: true soundHit: path: /Audio/Weapons/Xeno/alien_claw_flesh3.ogg