diff --git a/Content.Server/_Amour/InteractionPanel/Interactions.cs b/Content.Server/_Amour/InteractionPanel/Interactions.cs index 544ef22310..eccea62a36 100644 --- a/Content.Server/_Amour/InteractionPanel/Interactions.cs +++ b/Content.Server/_Amour/InteractionPanel/Interactions.cs @@ -42,31 +42,28 @@ public sealed class Interactions : EntitySystem private void OnSlapButt(EntityUid uid, InteractionPanelComponent component, InteractionBeginningEvent args) { - if(!TryComp(uid,out var moverComponent)) - return; + var rotation = (Transform(args.Target).LocalPosition - Transform(args.Performer).LocalPosition)*0.5f; - var viewerRot = moverComponent.TargetRelativeRotation; - var rotation = (Transform(args.Performer).LocalRotation - viewerRot).ToWorldVec()*0.25f; - - - _animationSystem.Play(uid,new AnimationData() + var animation = new Shared._Amour.Animation.Animation() { Length = TimeSpan.FromSeconds(0.5), AnimationTracks = { new AnimationTrackData() { - ComponentType = "SpriteComponent", + ComponentType = "Sprite", Property = "Offset", InterpolationMode = AnimationInterpolationMode.Cubic, KeyFrames = { - _animationSystem.KeyFrame(Vector2.Zero,0), - _animationSystem.KeyFrame(rotation,0.150f), - _animationSystem.KeyFrame(Vector2.Zero,0.250f) + _animationSystem.KeyFrame(Vector2.Zero, 0), + _animationSystem.KeyFrame(rotation, 0.100f), + _animationSystem.KeyFrame(Vector2.Zero, 0.250f) } } } - }); + }; + + _animationSystem.Play(uid,animation); } } diff --git a/Content.Shared/_Amour/Animation/AnimationData.cs b/Content.Shared/_Amour/Animation/AnimationData.cs index 899e090f17..7a043cb091 100644 --- a/Content.Shared/_Amour/Animation/AnimationData.cs +++ b/Content.Shared/_Amour/Animation/AnimationData.cs @@ -3,26 +3,31 @@ using Robust.Shared.Serialization; namespace Content.Shared._Amour.Animation; -[DataDefinition,Serializable,NetSerializable,Virtual] -public partial class AnimationData +[DataDefinition,Serializable,NetSerializable] +public abstract partial class AnimationData +{ + [DataField] public TimeSpan Length = TimeSpan.Zero; + [DataField] public List AnimationTracks = new(); +} + +[DataDefinition,Serializable,NetSerializable] +public sealed partial class Animation : AnimationData { - [DataField] public TimeSpan Length; - [DataField] public List AnimationTracks; } [DataDefinition, Serializable, NetSerializable] public sealed partial class AnimationTrackData { - [DataField] public string ComponentType; - [DataField] public string Property; - [DataField] public AnimationInterpolationMode InterpolationMode; - [DataField] public List KeyFrames; + [DataField] public string ComponentType = "Sprite"; + [DataField] public string Property = "Scale"; + [DataField] public AnimationInterpolationMode InterpolationMode = AnimationInterpolationMode.Previous; + [DataField] public List KeyFrames = new(); } [DataDefinition, Serializable, NetSerializable] public sealed partial class AnimationKeyData { - [DataField] public string Value; - [DataField] public float KeyTime; + [DataField] public string Value = "0"; + [DataField] public float KeyTime = 0; } diff --git a/Resources/Prototypes/_Amour/Interactions/interaction.yml b/Resources/Prototypes/_Amour/Interactions/interaction.yml index 58eaed9767..e4cbb81583 100644 --- a/Resources/Prototypes/_Amour/Interactions/interaction.yml +++ b/Resources/Prototypes/_Amour/Interactions/interaction.yml @@ -2,5 +2,6 @@ id: SlapButt checks: - !type:HasSmallDistance + - !type:CantInteractSelf beginningMessages: - interaction-butt-slap