Self-attack nerfs (#17845)

This commit is contained in:
metalgearsloth
2023-07-07 18:45:37 +10:00
committed by GitHub
parent c1fe000a7b
commit ee2a3216d6
6 changed files with 18 additions and 2 deletions

View File

@@ -103,7 +103,7 @@ public sealed partial class MeleeWeaponSystem : SharedMeleeWeaponSystem
} }
// If it's an unarmed attack then do a disarm // If it's an unarmed attack then do a disarm
if (weaponUid == entity) if (weapon.AltDisarm && weaponUid == entity)
{ {
EntityUid? target = null; EntityUid? target = null;
@@ -128,7 +128,7 @@ public sealed partial class MeleeWeaponSystem : SharedMeleeWeaponSystem
return; return;
} }
// Otherwise do heavy attack if it's a weapon. // Otherwise do heavy attack.
// Start a windup // Start a windup
if (weapon.WindUpStart == null) if (weapon.WindUpStart == null)

View File

@@ -15,6 +15,14 @@ namespace Content.Shared.Weapons.Melee;
[RegisterComponent, NetworkedComponent] [RegisterComponent, NetworkedComponent]
public sealed class MeleeWeaponComponent : Component public sealed class MeleeWeaponComponent : Component
{ {
// TODO: This is becoming bloated as shit.
// This should just be its own component for alt attacks.
/// <summary>
/// Does this entity do a disarm on alt attack.
/// </summary>
[DataField("altDisarm"), ViewVariables(VVAccess.ReadWrite)]
public bool AltDisarm = true;
/// <summary> /// <summary>
/// Should the melee weapon's damage stats be examinable. /// Should the melee weapon's damage stats be examinable.
/// </summary> /// </summary>

View File

@@ -460,6 +460,11 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
case LightAttackEvent light: case LightAttackEvent light:
if (!Blocker.CanAttack(user, light.Target)) if (!Blocker.CanAttack(user, light.Target))
return false; return false;
// Can't self-attack if you're the weapon
if (weaponUid == light.Target)
return false;
break; break;
case DisarmAttackEvent disarm: case DisarmAttackEvent disarm:
if (!Blocker.CanAttack(user, disarm.Target)) if (!Blocker.CanAttack(user, disarm.Target))

View File

@@ -56,6 +56,7 @@
- id: FoodMeatFish - id: FoodMeatFish
amount: 2 amount: 2
- type: MeleeWeapon - type: MeleeWeapon
altDisarm: false
hidden: true hidden: true
angle: 0 angle: 0
animation: WeaponArcBite animation: WeaponArcBite

View File

@@ -64,6 +64,7 @@
- type: Bloodstream - type: Bloodstream
bloodReagent: FluorosulfuricAcid bloodReagent: FluorosulfuricAcid
- type: MeleeWeapon - type: MeleeWeapon
altDisarm: false
hidden: true hidden: true
angle: 0 angle: 0
soundHit: soundHit:

View File

@@ -97,6 +97,7 @@
path: /Audio/Animals/space_dragon_roar.ogg path: /Audio/Animals/space_dragon_roar.ogg
soundPerceivedByOthers: false # A 75% chance for a loud roar would get old fast. soundPerceivedByOthers: false # A 75% chance for a loud roar would get old fast.
- type: MeleeWeapon - type: MeleeWeapon
altDisarm: false
hidden: true hidden: true
soundHit: soundHit:
path: /Audio/Weapons/Xeno/alien_claw_flesh3.ogg path: /Audio/Weapons/Xeno/alien_claw_flesh3.ogg