uncloak ninja after attacking (#20892)
* raise MeleeAttackEvent on the user after swinging * add disable bool to RevealNinja * uncloak ninja after attacking --------- Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
7
Content.Shared/Weapons/Melee/Events/MeleeAttackEvent.cs
Normal file
7
Content.Shared/Weapons/Melee/Events/MeleeAttackEvent.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Content.Shared.Weapons.Melee.Events;
|
||||
|
||||
/// <summary>
|
||||
/// Event raised on the user after attacking with a melee weapon, regardless of whether it hit anything.
|
||||
/// </summary>
|
||||
[ByRefEvent]
|
||||
public record struct MeleeAttackEvent(EntityUid Weapon);
|
||||
@@ -426,6 +426,9 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
DoLungeAnimation(user, weapon.Angle, GetCoordinates(attack.Coordinates).ToMap(EntityManager, TransformSystem), weapon.Range, animation);
|
||||
}
|
||||
|
||||
var attackEv = new MeleeAttackEvent(weaponUid);
|
||||
RaiseLocalEvent(user, ref attackEv);
|
||||
|
||||
weapon.Attacking = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user