diff --git a/Content.Client/Weapons/Melee/MeleeWeaponSystem.Effects.cs b/Content.Client/Weapons/Melee/MeleeWeaponSystem.Effects.cs index 0bccd5b1b39..89715089695 100644 --- a/Content.Client/Weapons/Melee/MeleeWeaponSystem.Effects.cs +++ b/Content.Client/Weapons/Melee/MeleeWeaponSystem.Effects.cs @@ -94,6 +94,10 @@ public sealed partial class MeleeWeaponSystem } } + /// + /// Makes the sprite move in a slash motion around the player. + /// For example for wide swing animations. + /// private Animation GetSlashAnimation(Entity sprite, Angle arc, Angle spriteRotation, float length, float offset) { var startRotation = sprite.Comp.Rotation + (arc * 0.5f); @@ -105,7 +109,6 @@ public sealed partial class MeleeWeaponSystem startRotation += spriteRotation; endRotation += spriteRotation; - sprite.Comp.NoRotation = true; return new Animation() { @@ -141,6 +144,10 @@ public sealed partial class MeleeWeaponSystem }; } + /// + /// Makes the sprite move in a thrust motion from the player towards the target, then slightly pulls back. + /// For example for spears. + /// private Animation GetThrustAnimation(Entity sprite, float offset, Angle spriteRotation, float length) { var startOffset = sprite.Comp.Rotation.RotateVec(new Vector2(0f, 0f)); @@ -170,6 +177,10 @@ public sealed partial class MeleeWeaponSystem }; } + /// + /// Makes the sprite slowly fade by gradually reducing its alpha value. + /// Used at the end of attack animations so that the weapon sprite does not abruptly disappears. + /// private Animation GetFadeAnimation(SpriteComponent sprite, float start, float end) { return new Animation @@ -193,6 +204,7 @@ public sealed partial class MeleeWeaponSystem /// /// Get the sprite offset animation to use for mob lunges. + /// This is applied to the attacker to show who is attacking. /// private Animation GetLungeAnimation(Vector2 direction) { @@ -230,7 +242,7 @@ public sealed partial class MeleeWeaponSystem if (arcComponent.User == null || EntityManager.Deleted(arcComponent.User)) continue; - Vector2 targetPos = TransformSystem.GetWorldPosition(arcComponent.User.Value); + var targetPos = TransformSystem.GetWorldPosition(arcComponent.User.Value); if (arcComponent.Offset != Vector2.Zero) {