- add: more interaction shit
This commit is contained in:
@@ -46,8 +46,11 @@ public sealed class SharebleAnimationSystem : SharedAnimationSystem
|
||||
|
||||
public override void Play(EntityUid uid,AnimationData data, string animationId = "funny")
|
||||
{
|
||||
if(_animation.HasRunningAnimation(uid,animationId))
|
||||
return;
|
||||
if (_animation.HasRunningAnimation(uid, animationId))
|
||||
{
|
||||
Logger.Error($"Entity {ToPrettyString(uid)} has running animation {animationId}");
|
||||
_animation.Stop(uid,animationId);
|
||||
}
|
||||
|
||||
var animation = ParseAnimation(data);
|
||||
_animation.Play(uid,animation,animationId);
|
||||
|
||||
@@ -19,6 +19,7 @@ public sealed class InteractionPanelEui : BaseEui
|
||||
_interactionPanelWindow = new UI.InteractionPanelWindow();
|
||||
_interactionPanelWindow.OnClose += () => SendMessage(new CloseEuiMessage());
|
||||
_interactionPanelWindow.OnInteraction += InteractionPanelWindowOnInteraction;
|
||||
_interactionPanelWindow.OnUpdateRequired += () => SendMessage(new InteractionUpdateMessage());
|
||||
}
|
||||
|
||||
private void InteractionPanelWindowOnInteraction(string id)
|
||||
|
||||
@@ -6,10 +6,21 @@ using Robust.Client.UserInterface.XAML;
|
||||
namespace Content.Client._Amour.InteractionPanel.UI;
|
||||
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class InteractionPanelButton : ContainerButton
|
||||
public sealed partial class InteractionPanelButton : Button
|
||||
{
|
||||
public event Action<string>? OnInteraction;
|
||||
|
||||
private Color _color = Color.White;
|
||||
public Color Color
|
||||
{
|
||||
get => _color;
|
||||
set
|
||||
{
|
||||
_color = value;
|
||||
ModulateSelfOverride = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string _interactionId = "Interaction";
|
||||
public string InteractionId
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:controls1="clr-namespace:Content.Client.UserInterface.Controls"
|
||||
xmlns:ui="clr-namespace:Content.Client._Amour.InteractionPanel.UI"
|
||||
Title="{Loc 'interaction-panel-title'}"
|
||||
MinSize="400 500">
|
||||
MinSize="500 500">
|
||||
<BoxContainer Orientation="Vertical" Margin="5 5 5 5">
|
||||
<BoxContainer Orientation="Vertical" Margin="5 20 5 20" HorizontalAlignment="Stretch" HorizontalExpand="True">
|
||||
<BoxContainer HorizontalAlignment="Center" HorizontalExpand="True">
|
||||
@@ -35,8 +35,16 @@
|
||||
|
||||
<PanelContainer StyleClasses="LowDivider" />
|
||||
|
||||
<BoxContainer Orientation="Vertical" Margin="5 20 5 20" Name="Interactions">
|
||||
<BoxContainer Margin="5 5 5 5" Orientation="Horizontal">
|
||||
<CheckBox Margin="5 0 5 0" Name="DisCheckbox"/>
|
||||
<Label Margin="5 0 5 0" Text="{Loc 'interaction-hide-unvisible'}"/>
|
||||
</BoxContainer>
|
||||
<Button Margin="5 5 5 5" Text="Update"/>
|
||||
|
||||
<ScrollContainer HorizontalExpand="True" VerticalExpand="True">
|
||||
<BoxContainer Orientation="Vertical" Margin="5 20 5 20" Name="Interactions">
|
||||
</BoxContainer>
|
||||
</ScrollContainer>
|
||||
|
||||
</BoxContainer>
|
||||
</ui:InteractionPanelWindow>
|
||||
|
||||
@@ -1,33 +1,65 @@
|
||||
using Content.Shared._Amour.InteractionPanel;
|
||||
using System.Linq;
|
||||
using Content.Shared._Amour.InteractionPanel;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client._Amour.InteractionPanel.UI;
|
||||
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class InteractionPanelWindow : DefaultWindow
|
||||
{
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
public event Action<string>? OnInteraction;
|
||||
|
||||
public event Action? OnUpdateRequired;
|
||||
|
||||
public Dictionary<string, int> Groups = new();
|
||||
|
||||
public InteractionPanelWindow()
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
DisCheckbox.OnPressed += _ => OnUpdateRequired?.Invoke();
|
||||
}
|
||||
|
||||
public void AddButton(string id)
|
||||
public void AddButton(InteractionEntry entry)
|
||||
{
|
||||
if(!_prototypeManager.TryIndex<InteractionPrototype>(entry.Prototype, out var prototype)
|
||||
|| !_prototypeManager.TryIndex(prototype.Group, out var groupPrototype))
|
||||
return;
|
||||
|
||||
if (!Groups.TryGetValue(prototype.Group, out var box))
|
||||
return;
|
||||
|
||||
if(DisCheckbox.Pressed && !entry.Enabled)
|
||||
return;
|
||||
|
||||
var btn = new InteractionPanelButton();
|
||||
btn.InteractionId = id;
|
||||
btn.OnInteraction += _id => OnInteraction?.Invoke(_id);
|
||||
Interactions.AddChild(btn);
|
||||
btn.Color = groupPrototype.Color;
|
||||
btn.InteractionId = entry.Prototype;
|
||||
btn.OnInteraction += id => OnInteraction?.Invoke(id);
|
||||
|
||||
btn.Disabled = !entry.Enabled;
|
||||
|
||||
Interactions.GetChild(box).AddChild(btn);
|
||||
}
|
||||
|
||||
public void Update(InteractionState state)
|
||||
{
|
||||
Interactions.Children.Clear();
|
||||
|
||||
Groups.Clear();
|
||||
foreach (var prototype in _prototypeManager.EnumeratePrototypes<InteractionGroupPrototype>().OrderBy(p => p.Priority))
|
||||
{
|
||||
var box = new BoxContainer();
|
||||
Interactions.AddChild(box);
|
||||
box.Orientation = BoxContainer.LayoutOrientation.Vertical;
|
||||
Groups.Add(prototype.ID,Interactions.ChildCount - 1);
|
||||
}
|
||||
|
||||
TargetView.SetEntity(state.Target);
|
||||
PerformerView.SetEntity(state.Performer);
|
||||
|
||||
|
||||
@@ -36,13 +36,15 @@ public sealed class InteractionPanelEui : BaseEui
|
||||
if (_entityManager.TryGetComponent<ArousalComponent>(User, out var arousalComponent))
|
||||
arousal = (byte) (arousalComponent.Arousal / 100 * 255);
|
||||
|
||||
var availableActions = new HashSet<string>();
|
||||
var availableActions = new HashSet<InteractionEntry>();
|
||||
foreach (var protoId in Target.Comp.ActionPrototypes)
|
||||
{
|
||||
if(!_prototypeManager.TryIndex(protoId,out var prototype)
|
||||
|| !prototype.Checks.All(check => check.IsAvailable(User,Target,_entityManager)))
|
||||
if(!_prototypeManager.TryIndex(protoId,out var prototype))
|
||||
continue;
|
||||
availableActions.Add(protoId);
|
||||
|
||||
var isAvailable = prototype.Checks.All(check => check.IsAvailable(User, Target, _entityManager));
|
||||
|
||||
availableActions.Add(new InteractionEntry(protoId,isAvailable));
|
||||
}
|
||||
|
||||
|
||||
@@ -52,9 +54,16 @@ public sealed class InteractionPanelEui : BaseEui
|
||||
public override void HandleMessage(EuiMessageBase msg)
|
||||
{
|
||||
base.HandleMessage(msg);
|
||||
if (msg is InteractionSelectedMessage selectedMessage && Target.Comp.ActionPrototypes.Contains(selectedMessage.Id))
|
||||
|
||||
switch (msg)
|
||||
{
|
||||
_entityManager.System<InteractionPanelSystem>().Interact(User.Owner,Target.Owner,selectedMessage.Id);
|
||||
case CloseEuiMessage:
|
||||
return;
|
||||
case InteractionSelectedMessage selectedMessage when Target.Comp.ActionPrototypes.Contains(selectedMessage.Id):
|
||||
_entityManager.System<InteractionPanelSystem>().Interact(User.Owner,Target.Owner,selectedMessage.Id);
|
||||
break;
|
||||
}
|
||||
|
||||
StateDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
using System.Linq;
|
||||
using Content.Server.Access.Systems;
|
||||
using Content.Server.Chat.Managers;
|
||||
using Content.Server.Chat.Systems;
|
||||
using Content.Server.DoAfter;
|
||||
using Content.Server.EUI;
|
||||
using Content.Shared._Amour.Hole;
|
||||
using Content.Shared._Amour.InteractionPanel;
|
||||
using Content.Shared.Carrying;
|
||||
using Content.Shared.Chat;
|
||||
using Content.Shared.DoAfter;
|
||||
using Content.Shared.Emoting;
|
||||
using Content.Shared.Fluids;
|
||||
using Content.Shared.Humanoid;
|
||||
using Content.Shared.Mind;
|
||||
using Content.Shared.Random.Helpers;
|
||||
@@ -15,6 +21,7 @@ using Robust.Shared.Audio;
|
||||
using Robust.Shared.Enums;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Server._Amour.InteractionPanel;
|
||||
@@ -28,18 +35,36 @@ public sealed class InteractionPanelSystem : EntitySystem
|
||||
[Dependency] private readonly ChatSystem _chatSystem = default!;
|
||||
[Dependency] private readonly AudioSystem _audioSystem = default!;
|
||||
[Dependency] private readonly IRobustRandom _robustRandom = default!;
|
||||
[Dependency] private readonly IdCardSystem _cardSystem = default!;
|
||||
[Dependency] private readonly IChatManager _chatManager = default!;
|
||||
[Dependency] private readonly DoAfterSystem _doAfterSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<InteractionPanelComponent,GetVerbsEvent<Verb>>(OnVerb);
|
||||
SubscribeLocalEvent<InteractionPanelComponent,ComponentInit>(OnInit);
|
||||
SubscribeLocalEvent<InteractionPanelComponent,PanelDoAfterEvent>(OnPanel);
|
||||
}
|
||||
|
||||
private void OnPanel(EntityUid uid, InteractionPanelComponent component, PanelDoAfterEvent args)
|
||||
{
|
||||
component.IsBlocked = false;
|
||||
if(args.Cancelled
|
||||
|| !_prototypeManager.TryIndex<InteractionPrototype>(args.Prototype, out var prototype)
|
||||
|| !TryComp<InteractionPanelComponent>(args.Target, out var targetInteractionPanelComponent))
|
||||
return;
|
||||
|
||||
Interact(new Entity<InteractionPanelComponent>(uid,component),new Entity<InteractionPanelComponent>(args.Target.Value,targetInteractionPanelComponent),prototype,false);
|
||||
}
|
||||
|
||||
private void OnInit(EntityUid uid, InteractionPanelComponent component, ComponentInit args)
|
||||
{
|
||||
component.Timeout = _gameTiming.CurTime;
|
||||
component.EndTime = _gameTiming.CurTime;
|
||||
|
||||
if (_prototypeManager.TryIndex(component.ActionListPrototype, out var prototype))
|
||||
{
|
||||
component.ActionPrototypes.AddRange(prototype.Prototypes);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnVerb(EntityUid uid, InteractionPanelComponent component, GetVerbsEvent<Verb> args)
|
||||
@@ -74,14 +99,69 @@ public sealed class InteractionPanelSystem : EntitySystem
|
||||
|| target.Comp.IsActive || target.Comp.IsBlocked
|
||||
|| user.Comp.Timeout > _gameTiming.CurTime
|
||||
|| target.Comp.Timeout > _gameTiming.CurTime
|
||||
|| !_prototypeManager.TryIndex(protoId, out var prototype)
|
||||
|| !prototype.Checks.All(check => check.IsAvailable(user!,target!,EntityManager)))
|
||||
|| !_prototypeManager.TryIndex(protoId, out var prototype))
|
||||
return;
|
||||
|
||||
foreach (var check in prototype.Checks.Where(check => !check.IsAvailable(user!, target!, EntityManager)))
|
||||
{
|
||||
if(!_playerManager.TryGetSessionByEntity(user,out var session))
|
||||
return;
|
||||
|
||||
var message = ParseMessage(target, $"interaction-fail-{check.GetType().Name.ToLower()}");
|
||||
_chatManager.ChatMessageToOne(ChatChannel.Emotes,message,message,EntityUid.Invalid,false,session.Channel);
|
||||
return;
|
||||
}
|
||||
|
||||
if (prototype.BeginningTimeout == TimeSpan.Zero)
|
||||
{
|
||||
Interact(user!,target!,prototype);
|
||||
return;
|
||||
}
|
||||
|
||||
user.Comp.IsBlocked = true;
|
||||
|
||||
if(prototype.PreBeginMessages.Count > 0)
|
||||
{
|
||||
_chatSystem.TrySendInGameICMessage(user,
|
||||
ParseMessage(target,_robustRandom.Pick(prototype.PreBeginMessages)),
|
||||
InGameICChatType.Emote,
|
||||
false);
|
||||
}
|
||||
|
||||
_doAfterSystem.TryStartDoAfter(new DoAfterArgs(
|
||||
EntityManager,
|
||||
user,
|
||||
prototype.BeginningTimeout,
|
||||
new PanelDoAfterEvent(prototype.ID),user,target
|
||||
)
|
||||
{
|
||||
BreakOnDamage = true,
|
||||
BreakOnTargetMove = true,
|
||||
BreakOnUserMove = true,
|
||||
BreakOnHandChange = true
|
||||
});
|
||||
}
|
||||
|
||||
private void Interact(Entity<InteractionPanelComponent> user,
|
||||
Entity<InteractionPanelComponent> target, InteractionPrototype prototype, bool hasChecked = true)
|
||||
{
|
||||
if (!hasChecked)
|
||||
{
|
||||
foreach (var check in prototype.Checks.Where(check => !check.IsAvailable(user!, target!, EntityManager)))
|
||||
{
|
||||
if(!_playerManager.TryGetSessionByEntity(user,out var session))
|
||||
return;
|
||||
|
||||
var message = ParseMessage(target, $"interaction-fail-{check.GetType().Name.ToLower()}");
|
||||
_chatManager.ChatMessageToOne(ChatChannel.Emotes,message,message,EntityUid.Invalid,false,session.Channel);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
user.Comp.Timeout = _gameTiming.CurTime + prototype.Timeout;
|
||||
user.Comp.EndTime = _gameTiming.CurTime + prototype.EndTime;
|
||||
user.Comp.IsActive = true;
|
||||
user.Comp.CurrentAction = protoId;
|
||||
user.Comp.CurrentAction = prototype.ID;
|
||||
user.Comp.CurrentPartner = new Entity<InteractionPanelComponent>(target,target.Comp);
|
||||
|
||||
if(prototype.BeginningMessages.Count > 0)
|
||||
@@ -95,7 +175,12 @@ public sealed class InteractionPanelSystem : EntitySystem
|
||||
if (prototype.BeginningSound is not null)
|
||||
_audioSystem.PlayPvs(prototype.BeginningSound, user);
|
||||
|
||||
RaiseLocalEvent(user,new InteractionBeginningEvent(protoId,user!,target!));
|
||||
foreach (var action in prototype.BeginningActions)
|
||||
{
|
||||
action.Run(user!,target!,EntityManager);
|
||||
}
|
||||
|
||||
RaiseLocalEvent(user,new InteractionBeginningEvent(prototype.ID,user,target));
|
||||
}
|
||||
|
||||
private string GetName(EntityUid target)
|
||||
@@ -124,6 +209,7 @@ public sealed class InteractionPanelSystem : EntitySystem
|
||||
{
|
||||
base.Update(frameTime);
|
||||
var query = EntityQueryEnumerator<InteractionPanelComponent>();
|
||||
|
||||
while (query.MoveNext(out var uid, out var component))
|
||||
{
|
||||
if(component.EndTime > _gameTiming.CurTime || !component.IsActive)
|
||||
@@ -134,6 +220,8 @@ public sealed class InteractionPanelSystem : EntitySystem
|
||||
continue;
|
||||
}
|
||||
|
||||
var user = new Entity<InteractionPanelComponent>(uid, component);
|
||||
|
||||
if (_prototypeManager.TryIndex(component.CurrentAction, out var prototype))
|
||||
{
|
||||
if (prototype.EndingMessages.Count > 0)
|
||||
@@ -147,12 +235,17 @@ public sealed class InteractionPanelSystem : EntitySystem
|
||||
|
||||
if (prototype.EndingSound is not null)
|
||||
_audioSystem.PlayPvs(prototype.EndingSound, uid);
|
||||
|
||||
foreach (var action in prototype.EndingActions)
|
||||
{
|
||||
action.Run(user,component.CurrentPartner.Value,EntityManager);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
component.IsActive = false;
|
||||
RaiseLocalEvent(uid, new InteractionEndingEvent(component.CurrentAction,
|
||||
new Entity<InteractionPanelComponent>(uid,component),
|
||||
user,
|
||||
component.CurrentPartner.Value));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System.Numerics;
|
||||
using Content.Server._Amour.Animation;
|
||||
using Content.Server._Amour.Crawl;
|
||||
using Content.Server.Pulling;
|
||||
using Content.Shared._Amour.Animation;
|
||||
using Content.Shared._Amour.InteractionPanel;
|
||||
using Robust.Shared.Animations;
|
||||
@@ -8,7 +10,9 @@ namespace Content.Server._Amour.InteractionPanel;
|
||||
|
||||
public sealed class Interactions : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly CrawlSystem _crawlSystem = default!;
|
||||
[Dependency] private readonly SharebleAnimationSystem _animationSystem = default!;
|
||||
[Dependency] private readonly PullingSystem _pullingSystem = default!;
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<InteractionPanelComponent,InteractionBeginningEvent>(OnBegin);
|
||||
@@ -33,36 +37,12 @@ public sealed class Interactions : EntitySystem
|
||||
|
||||
switch (args.Id)
|
||||
{
|
||||
case "SlapButt":
|
||||
OnSlapButt(uid,component,args);
|
||||
case "PullTarget" :
|
||||
_pullingSystem.TryStartPull(uid, args.Target);
|
||||
break;
|
||||
case "CrawlTarget" :
|
||||
_crawlSystem.EnableCrawl(args.Target);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnSlapButt(EntityUid uid, InteractionPanelComponent component, InteractionBeginningEvent args)
|
||||
{
|
||||
var rotation = (Transform(args.Target).LocalPosition - Transform(args.Performer).LocalPosition)*0.5f;
|
||||
|
||||
var animation = new Shared._Amour.Animation.Animation()
|
||||
{
|
||||
Length = TimeSpan.FromSeconds(0.5),
|
||||
AnimationTracks =
|
||||
{
|
||||
new AnimationTrackData()
|
||||
{
|
||||
ComponentType = "Sprite",
|
||||
Property = "Offset",
|
||||
InterpolationMode = AnimationInterpolationMode.Cubic,
|
||||
KeyFrames =
|
||||
{
|
||||
_animationSystem.KeyFrame(Vector2.Zero, 0),
|
||||
_animationSystem.KeyFrame(rotation, 0.100f),
|
||||
_animationSystem.KeyFrame(Vector2.Zero, 0.250f)
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
_animationSystem.Play(uid,animation);
|
||||
}
|
||||
}
|
||||
|
||||
102
Content.Shared/_Amour/InteractionPanel/Actions/Animations.cs
Normal file
102
Content.Shared/_Amour/InteractionPanel/Actions/Animations.cs
Normal file
@@ -0,0 +1,102 @@
|
||||
using System.Numerics;
|
||||
using Content.Shared._Amour.Animation;
|
||||
using Robust.Shared.Animations;
|
||||
|
||||
namespace Content.Shared._Amour.InteractionPanel.Actions;
|
||||
|
||||
[DataDefinition, Serializable]
|
||||
public sealed partial class RequireAnimation : IInteractionAction
|
||||
{
|
||||
[DataField] public float k0 = 0f;
|
||||
[DataField] public float k1 = 0f;
|
||||
[DataField] public float k2 = 0f;
|
||||
[DataField] public float k3 = 0f;
|
||||
[DataField] public float Length;
|
||||
[DataField] public int Repeat = 1;
|
||||
|
||||
private void AnimateSomeShit(EntityUid uid, EntityUid target, IEntityManager entityManager)
|
||||
{
|
||||
var animationSystem = entityManager.System<SharedAnimationSystem>();
|
||||
|
||||
var rotation = (entityManager.GetComponent<TransformComponent>(target).LocalPosition - entityManager.GetComponent<TransformComponent>(uid).LocalPosition)*0.5f;
|
||||
|
||||
if (Length == 0)
|
||||
{
|
||||
Length = k0 + k1 + k2 + k3;
|
||||
}
|
||||
|
||||
var animation = new Shared._Amour.Animation.Animation()
|
||||
{
|
||||
Length = TimeSpan.FromSeconds(Length*Repeat),
|
||||
AnimationTracks =
|
||||
{
|
||||
new AnimationTrackData()
|
||||
{
|
||||
ComponentType = "Sprite",
|
||||
Property = "Offset",
|
||||
InterpolationMode = AnimationInterpolationMode.Cubic,
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
for (var i = 0; i < Repeat; i++)
|
||||
{
|
||||
animation.AnimationTracks[0].KeyFrames.Add(animationSystem.KeyFrame(Vector2.Zero, k0));
|
||||
animation.AnimationTracks[0].KeyFrames.Add( animationSystem.KeyFrame(rotation, k1));
|
||||
animation.AnimationTracks[0].KeyFrames.Add(animationSystem.KeyFrame(rotation, k2));
|
||||
animation.AnimationTracks[0].KeyFrames.Add(animationSystem.KeyFrame(Vector2.Zero, k3));
|
||||
}
|
||||
|
||||
animationSystem.Play(uid,animation);
|
||||
}
|
||||
|
||||
public void Run(Entity<InteractionPanelComponent> user, Entity<InteractionPanelComponent> target, IEntityManager entityManager)
|
||||
{
|
||||
AnimateSomeShit(user,target,entityManager);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[DataDefinition, Serializable]
|
||||
public sealed partial class RequireHorizontalAnimation : IInteractionAction
|
||||
{
|
||||
[DataField] public int Repeat = 6;
|
||||
[DataField] public Vector2 Shift = new (0, 0.5f);
|
||||
|
||||
public void Run(Entity<InteractionPanelComponent> user, Entity<InteractionPanelComponent> target, IEntityManager entityManager)
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
var animationSystem = entityManager.System<SharedAnimationSystem>();
|
||||
|
||||
var rotation = (entityManager.GetComponent<TransformComponent>(target).LocalPosition - entityManager.GetComponent<TransformComponent>(user).LocalPosition)*0.5f;
|
||||
|
||||
var animation = new Shared._Amour.Animation.Animation()
|
||||
{
|
||||
Length = TimeSpan.FromSeconds(0.5*Repeat + 0.25),
|
||||
AnimationTracks =
|
||||
{
|
||||
new AnimationTrackData()
|
||||
{
|
||||
ComponentType = "Sprite",
|
||||
Property = "Offset",
|
||||
InterpolationMode = AnimationInterpolationMode.Cubic,
|
||||
KeyFrames =
|
||||
{
|
||||
animationSystem.KeyFrame(Vector2.Zero,0)
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
for (var i = 0; i < Repeat; i++)
|
||||
{
|
||||
animation.AnimationTracks[0].KeyFrames.Add(animationSystem.KeyFrame(rotation-Shift*0.5f,0.25f));
|
||||
animation.AnimationTracks[0].KeyFrames.Add(animationSystem.KeyFrame(rotation-Shift,0.25f));
|
||||
}
|
||||
|
||||
animation.AnimationTracks[0].KeyFrames.Add(animationSystem.KeyFrame(Vector2.Zero,0.25f));
|
||||
animationSystem.Play(user,animation);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Content.Shared._Amour.InteractionPanel.Actions;
|
||||
|
||||
public interface IInteractionAction
|
||||
{
|
||||
public void Run(Entity<InteractionPanelComponent> user,
|
||||
Entity<InteractionPanelComponent> target, IEntityManager entityManager);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Content.Shared._Amour.InteractionPanel.Checks;
|
||||
|
||||
public interface IInteractionCheck
|
||||
{
|
||||
public bool IsAvailable(Entity<InteractionPanelComponent> user,
|
||||
Entity<InteractionPanelComponent> target,IEntityManager entityManager);
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
using Content.Shared._Amour.Crawl;
|
||||
|
||||
namespace Content.Shared._Amour.InteractionPanel.Checks;
|
||||
|
||||
public sealed class InteractSelf : IInteractionCheck
|
||||
@@ -15,3 +17,19 @@ public sealed class CantInteractSelf: IInteractionCheck
|
||||
return user != target;
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class IsUserCrawl : IInteractionCheck
|
||||
{
|
||||
public bool IsAvailable(Entity<InteractionPanelComponent> user, Entity<InteractionPanelComponent> target, IEntityManager entityManager)
|
||||
{
|
||||
return entityManager.HasComponent<CrawlComponent>(user);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class IsTargetCrawl : IInteractionCheck
|
||||
{
|
||||
public bool IsAvailable(Entity<InteractionPanelComponent> user, Entity<InteractionPanelComponent> target, IEntityManager entityManager)
|
||||
{
|
||||
return entityManager.HasComponent<CrawlComponent>(target);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
using Content.Shared._Amour.Hole;
|
||||
|
||||
namespace Content.Shared._Amour.InteractionPanel;
|
||||
|
||||
public interface IInteractionCheck
|
||||
{
|
||||
public bool IsAvailable(Entity<InteractionPanelComponent> user,
|
||||
Entity<InteractionPanelComponent> target,IEntityManager entityManager);
|
||||
}
|
||||
|
||||
public sealed class BasicCheck : IInteractionCheck
|
||||
{
|
||||
public bool IsAvailable(Entity<InteractionPanelComponent> user, Entity<InteractionPanelComponent> target, IEntityManager entityManager)
|
||||
{
|
||||
Logger.Debug("MEWO!!");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
15
Content.Shared/_Amour/InteractionPanel/InteractionDoAfter.cs
Normal file
15
Content.Shared/_Amour/InteractionPanel/InteractionDoAfter.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using Content.Shared.DoAfter;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared._Amour.InteractionPanel;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed partial class PanelDoAfterEvent : SimpleDoAfterEvent
|
||||
{
|
||||
[DataField] public string Prototype;
|
||||
|
||||
public PanelDoAfterEvent(string prototype)
|
||||
{
|
||||
Prototype = prototype;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared._Amour.InteractionPanel;
|
||||
|
||||
[Prototype("interactionGroup")]
|
||||
public sealed class InteractionGroupPrototype : IPrototype
|
||||
{
|
||||
[IdDataField] public string ID { get; private set; } = default!;
|
||||
[DataField] public Color Color;
|
||||
[DataField] public int Priority;
|
||||
}
|
||||
@@ -15,5 +15,6 @@ public sealed partial class InteractionPanelComponent : Component
|
||||
[ViewVariables] public Entity<InteractionPanelComponent>? CurrentPartner;
|
||||
|
||||
[DataField] public List<ProtoId<InteractionPrototype>> ActionPrototypes = new();
|
||||
[DataField] public ProtoId<InteractionListPrototype> ActionListPrototype;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,16 +15,20 @@ public sealed class InteractionSelectedMessage : EuiMessageBase
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable,NetSerializable]
|
||||
public sealed class InteractionUpdateMessage : EuiMessageBase
|
||||
{
|
||||
}
|
||||
|
||||
[Serializable,NetSerializable]
|
||||
public sealed class InteractionState: EuiStateBase
|
||||
{
|
||||
public NetEntity Performer { get; }
|
||||
public NetEntity Target { get; }
|
||||
public HashSet<string> AvailableInteractions;
|
||||
public HashSet<InteractionEntry> AvailableInteractions;
|
||||
public byte? Arousal;
|
||||
|
||||
public InteractionState(NetEntity performer, NetEntity target, HashSet<string> availableInteractions, byte? arousal)
|
||||
public InteractionState(NetEntity performer, NetEntity target, HashSet<InteractionEntry> availableInteractions, byte? arousal)
|
||||
{
|
||||
Performer = performer;
|
||||
Target = target;
|
||||
@@ -33,3 +37,15 @@ public sealed class InteractionState: EuiStateBase
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class InteractionEntry
|
||||
{
|
||||
public string Prototype;
|
||||
public bool Enabled;
|
||||
|
||||
public InteractionEntry(string prototype, bool enabled)
|
||||
{
|
||||
Prototype = prototype;
|
||||
Enabled = enabled;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
using Content.Shared.Actions;
|
||||
|
||||
namespace Content.Shared._Amour.InteractionPanel;
|
||||
|
||||
public sealed class InteractionPanelSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
using Content.Shared._Amour.InteractionPanel.Actions;
|
||||
using Content.Shared._Amour.InteractionPanel.Checks;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization;
|
||||
@@ -13,12 +15,23 @@ public sealed partial class InteractionPrototype : IPrototype
|
||||
[DataField] public SoundSpecifier? BeginningSound;
|
||||
[DataField] public SoundSpecifier? EndingSound;
|
||||
|
||||
[DataField] public List<string> PreBeginMessages = new();
|
||||
[DataField] public List<string> BeginningMessages = new();
|
||||
[DataField] public List<string> EndingMessages = new();
|
||||
|
||||
[DataField] public List<IInteractionCheck> Checks = new();
|
||||
[DataField] public List<IInteractionAction> BeginningActions = new();
|
||||
[DataField] public List<IInteractionAction> EndingActions = new();
|
||||
|
||||
[DataField] public TimeSpan EndTime = TimeSpan.Zero;
|
||||
[DataField] public TimeSpan Timeout = TimeSpan.FromSeconds(3);
|
||||
[DataField] public TimeSpan BeginningTimeout = TimeSpan.Zero;
|
||||
[DataField] public ProtoId<InteractionGroupPrototype> Group = "Safe";
|
||||
}
|
||||
|
||||
[Prototype("interactionList")]
|
||||
public sealed class InteractionListPrototype : IPrototype
|
||||
{
|
||||
[IdDataField] public string ID { get; private set; } = default!;
|
||||
[DataField] public List<ProtoId<InteractionPrototype>> Prototypes = new List<ProtoId<InteractionPrototype>>();
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
anus-inspect = Проинспектировать анус
|
||||
anus-insert = Засунуть внутрь
|
||||
anus-inspecting = Вы чувствете, будто кто-то копается в вашей заднице!
|
||||
anus-no-access = Похоже, что нет доступа к заднице
|
||||
anus-blowing = Вы чувствуете,как разрывается анус!
|
||||
anus-inserting = Вы чувствуете, будто что-то проталкивают к вашей заднице!
|
||||
@@ -1,6 +0,0 @@
|
||||
interaction-name-slapbutt = шлёпнуть по попке
|
||||
interaction-butt-slap1 = шлёпает попку { $target }
|
||||
interaction-butt-slap2 = со всей силы бьёт по жопе { $target }
|
||||
interaction-butt-slap3 = шлёпает попку { $target }
|
||||
|
||||
interaction-panel-title = Панель взаимодействий
|
||||
28
Resources/Locale/ru-RU/_amour/interactions/interaction.ftl
Normal file
28
Resources/Locale/ru-RU/_amour/interactions/interaction.ftl
Normal file
@@ -0,0 +1,28 @@
|
||||
interaction-name-slapbutt = шлёпнуть по попке
|
||||
interaction-name-crawltarget = толкнуть на пол
|
||||
interaction-name-dickinbutt = выебать в очко
|
||||
interaction-name-dickinvagina = выебать в вагину
|
||||
interaction-name-itemonbutt = засунуть вещь в очко
|
||||
interaction-name-itemonvagina = засунуть вещь в вагину
|
||||
interaction-name-itemonpenis = засунуть вещь в член
|
||||
interaction-name-lickdick = отлизать мужсокй половой орган
|
||||
interaction-name-lickvagina = отлизать вагину
|
||||
interaction-name-lickface = отлизать лицо
|
||||
interaction-name-kissmouth = поцеловать в губы
|
||||
interaction-name-kissneck = поцеловать в шею
|
||||
interaction-name-kissface = поцеловать в лицо
|
||||
interaction-name-combhead = погладить по голове
|
||||
interaction-name-combears = погладить за ушком
|
||||
interaction-name-combbutt = погладить по попе
|
||||
interaction-name-pulltarget = держать за ручку
|
||||
interaction-name-sitwithbutt = насадить на своё очко хуй
|
||||
interaction-name-sitwithvagina = насадить на свою вагину хуй
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
interaction-butt-slap1 = шлёпает попку { $target }
|
||||
interaction-butt-slap2 = со всей силы бьёт по жопе { $target }
|
||||
interaction-butt-slap3 = шлёпает попку { $target }
|
||||
|
||||
2
Resources/Locale/ru-RU/_amour/interactions/ui.ftl
Normal file
2
Resources/Locale/ru-RU/_amour/interactions/ui.ftl
Normal file
@@ -0,0 +1,2 @@
|
||||
interaction-panel-title = Панель взаимодействий
|
||||
interaction-hide-unvisible = Спрятать недоступные действия
|
||||
@@ -267,8 +267,7 @@
|
||||
- type: Arousal
|
||||
- type: Crawlable
|
||||
- type: InteractionPanel
|
||||
actionPrototypes:
|
||||
- SlapButt
|
||||
actionListPrototype: Humanoid
|
||||
|
||||
- type: entity
|
||||
save: false
|
||||
|
||||
@@ -5,7 +5,305 @@
|
||||
checks:
|
||||
- !type:HasSmallDistance
|
||||
- !type:CantInteractSelf
|
||||
beginningActions:
|
||||
- !type:RequireAnimation
|
||||
k0: 0
|
||||
k1: 0.1
|
||||
k3: 0.25
|
||||
beginningMessages:
|
||||
- interaction-butt-slap1
|
||||
- interaction-butt-slap2
|
||||
- interaction-butt-slap3
|
||||
group: Moderate
|
||||
|
||||
- type: interaction
|
||||
id: CrawlTarget
|
||||
beginningTimeout: 5
|
||||
checks:
|
||||
- !type:HasSmallDistance
|
||||
- !type:CantInteractSelf
|
||||
preBeginMessages:
|
||||
- interaction-crawl-before1
|
||||
beginningMessages:
|
||||
- interaction-crawl1
|
||||
- interaction-crawl2
|
||||
- interaction-crawl3
|
||||
group: Safe
|
||||
|
||||
- type: interaction
|
||||
id: DickInButt
|
||||
checks:
|
||||
- !type:HasSmallDistance
|
||||
- !type:CantInteractSelf
|
||||
- !type:UserHasPenis
|
||||
#- !type:TargetHasButt
|
||||
beginningSound:
|
||||
path: /Audio/Effects/Emotes/clap1.ogg
|
||||
beginningActions:
|
||||
- !type:RequireAnimation
|
||||
k0: 0
|
||||
k1: 0.1
|
||||
k3: 0.25
|
||||
repeat: 12
|
||||
beginningMessages:
|
||||
- interaction-butt-fuck1
|
||||
- interaction-butt-fuck2
|
||||
- interaction-butt-fuck3
|
||||
group: Danger
|
||||
|
||||
- type: interaction
|
||||
id: DickInVagina
|
||||
checks:
|
||||
- !type:HasSmallDistance
|
||||
- !type:CantInteractSelf
|
||||
- !type:UserHasPenis
|
||||
- !type:TargetHasVagina
|
||||
beginningSound:
|
||||
path: /Audio/Effects/Emotes/clap1.ogg
|
||||
beginningMessages:
|
||||
- interaction-butt-fuck1
|
||||
- interaction-butt-fuck2
|
||||
- interaction-butt-fuck3
|
||||
group: Danger
|
||||
|
||||
- type: interaction
|
||||
id: ItemOnButt
|
||||
checks:
|
||||
- !type:HasSmallDistance
|
||||
- !type:TargetHasButt
|
||||
beginningMessages:
|
||||
- interaction-butt-put1
|
||||
- interaction-butt-put2
|
||||
- interaction-butt-put3
|
||||
group: Danger
|
||||
|
||||
- type: interaction
|
||||
id: ItemOnVagina
|
||||
checks:
|
||||
- !type:HasSmallDistance
|
||||
- !type:TargetHasVagina
|
||||
beginningMessages:
|
||||
- interaction-vagina-put1
|
||||
- interaction-vagina-put2
|
||||
- interaction-vagina-put3
|
||||
group: Danger
|
||||
|
||||
|
||||
- type: interaction
|
||||
id: ItemOnPenis
|
||||
checks:
|
||||
- !type:HasSmallDistance
|
||||
- !type:TargetHasPenis
|
||||
beginningMessages:
|
||||
- interaction-penis-put1
|
||||
- interaction-penis-put2
|
||||
- interaction-penis-put3
|
||||
group: Extreme
|
||||
|
||||
|
||||
- type: interaction
|
||||
id: SitWithButt
|
||||
checks:
|
||||
- !type:HasSmallDistance
|
||||
- !type:TargetHasPenis
|
||||
#- !type:UserHasButt
|
||||
- !type:IsTargetCrawl
|
||||
beginningSound:
|
||||
path: /Audio/Effects/Emotes/clap1.ogg
|
||||
beginningActions:
|
||||
- !type:RequireHorizontalAnimation
|
||||
beginningMessages:
|
||||
- interaction-sit-butt1
|
||||
- interaction-sit-butt2
|
||||
- interaction-sit-butt3
|
||||
group: Danger
|
||||
|
||||
|
||||
- type: interaction
|
||||
id: SitWithVagina
|
||||
checks:
|
||||
- !type:HasSmallDistance
|
||||
- !type:TargetHasPenis
|
||||
- !type:UserHasVagina
|
||||
- !type:IsTargetCrawl
|
||||
beginningSound:
|
||||
path: /Audio/Effects/Emotes/clap1.ogg
|
||||
beginningActions:
|
||||
- !type:RequireHorizontalAnimation
|
||||
beginningMessages:
|
||||
- interaction-sit-vagina1
|
||||
- interaction-sit-vagina2
|
||||
- interaction-sit-vagina3
|
||||
group: Danger
|
||||
|
||||
- type: interaction
|
||||
id: LickDick
|
||||
checks:
|
||||
- !type:HasSmallDistance
|
||||
- !type:TargetHasPenis
|
||||
beginningSound:
|
||||
path: /Audio/White/Felinid/lick.ogg
|
||||
beginningActions:
|
||||
- !type:RequireHorizontalAnimation
|
||||
beginningMessages:
|
||||
- interaction-dick-lick1
|
||||
- interaction-dick-lick2
|
||||
- interaction-dick-lick3
|
||||
group: Danger
|
||||
|
||||
- type: interaction
|
||||
id: LickVagina
|
||||
checks:
|
||||
- !type:HasSmallDistance
|
||||
- !type:TargetHasVagina
|
||||
beginningSound:
|
||||
path: /Audio/White/Felinid/lick.ogg
|
||||
beginningAction:
|
||||
- !type:RequireHorizontalAnimation
|
||||
beginningMessages:
|
||||
- interaction-vagina-lick1
|
||||
- interaction-vagina-lick2
|
||||
- interaction-vagina-lick3
|
||||
group: Danger
|
||||
|
||||
- type: interaction
|
||||
id: LickFace
|
||||
checks:
|
||||
- !type:CantInteractSelf
|
||||
- !type:HasSmallDistance
|
||||
beginningActions:
|
||||
- !type:RequireAnimation
|
||||
k0: 0
|
||||
k1: 0.1
|
||||
k2: 0.75
|
||||
k3: 0.25
|
||||
beginningMessages:
|
||||
- interaction-face-lick1
|
||||
- interaction-face-lick2
|
||||
- interaction-face-lick3
|
||||
group: Danger
|
||||
|
||||
- type: interaction
|
||||
id: KissMouth
|
||||
checks:
|
||||
- !type:CantInteractSelf
|
||||
- !type:HasSmallDistance
|
||||
beginningSound:
|
||||
collection: Kiss
|
||||
beginningActions:
|
||||
- !type:RequireAnimation
|
||||
k0: 0
|
||||
k1: 0.1
|
||||
k2: 0.75
|
||||
k3: 0.25
|
||||
beginningMessages:
|
||||
- interaction-mouth-kiss1
|
||||
- interaction-mouth-kiss2
|
||||
- interaction-mouth-kiss3
|
||||
group: Moderate
|
||||
|
||||
- type: interaction
|
||||
id: KissNeck
|
||||
checks:
|
||||
- !type:CantInteractSelf
|
||||
- !type:HasSmallDistance
|
||||
beginningSound:
|
||||
collection: Kiss
|
||||
beginningActions:
|
||||
- !type:RequireAnimation
|
||||
k0: 0
|
||||
k1: 0.1
|
||||
k2: 0.75
|
||||
k3: 0.25
|
||||
beginningMessages:
|
||||
- interaction-neck-kiss1
|
||||
- interaction-neck-kiss2
|
||||
- interaction-neck-kiss3
|
||||
group: Moderate
|
||||
|
||||
- type: interaction
|
||||
id: KissFace
|
||||
checks:
|
||||
- !type:CantInteractSelf
|
||||
- !type:HasSmallDistance
|
||||
beginningSound:
|
||||
collection: Kiss
|
||||
beginningActions:
|
||||
- !type:RequireAnimation
|
||||
k0: 0
|
||||
k1: 0.1
|
||||
k2: 0.75
|
||||
k3: 0.25
|
||||
beginningMessages:
|
||||
- interaction-face-kiss1
|
||||
- interaction-face-kiss2
|
||||
- interaction-face-kiss3
|
||||
group: Moderate
|
||||
|
||||
|
||||
- type: interaction
|
||||
id: CombHead
|
||||
checks:
|
||||
- !type:CantInteractSelf
|
||||
- !type:HasSmallDistance
|
||||
beginningSound:
|
||||
path: /Audio/White/Interactions/ches.ogg
|
||||
beginningActions:
|
||||
- !type:RequireAnimation
|
||||
k0: 0
|
||||
k1: 0.1
|
||||
k2: 0.75
|
||||
k3: 0.25
|
||||
beginningMessages:
|
||||
- interaction-head-comb1
|
||||
- interaction-head-comb2
|
||||
- interaction-head-comb3
|
||||
group: Safe
|
||||
|
||||
- type: interaction
|
||||
id: CombEars
|
||||
checks:
|
||||
- !type:CantInteractSelf
|
||||
- !type:HasSmallDistance
|
||||
beginningSound:
|
||||
path: /Audio/White/Interactions/ches.ogg
|
||||
beginningActions:
|
||||
- !type:RequireAnimation
|
||||
k0: 0
|
||||
k1: 0.1
|
||||
k2: 0.75
|
||||
k3: 0.25
|
||||
beginningMessages:
|
||||
- interaction-ears-comb1
|
||||
- interaction-ears-comb2
|
||||
- interaction-ears-comb3
|
||||
group: Safe
|
||||
|
||||
- type: interaction
|
||||
id: CombButt
|
||||
checks:
|
||||
- !type:HasSmallDistance
|
||||
beginningSound:
|
||||
path: /Audio/White/Interactions/ches.ogg
|
||||
beginningActions:
|
||||
- !type:RequireAnimation
|
||||
k0: 0
|
||||
k1: 0.1
|
||||
k2: 0.75
|
||||
k3: 0.25
|
||||
beginningMessages:
|
||||
- interaction-butt-comb1
|
||||
- interaction-butt-comb2
|
||||
- interaction-butt-comb3
|
||||
group: Moderate
|
||||
|
||||
- type: interaction
|
||||
id: PullTarget
|
||||
checks:
|
||||
- !type:CantInteractSelf
|
||||
- !type:HasSmallDistance
|
||||
beginningMessages:
|
||||
- interaction-pull1
|
||||
- interaction-pull2
|
||||
- interaction-pull3
|
||||
group: Safe
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
- type: interactionGroup
|
||||
id: Safe
|
||||
color: "#4E4E50"
|
||||
priority: 0
|
||||
|
||||
- type: interactionGroup
|
||||
id: Moderate
|
||||
color: "#394053"
|
||||
priority: 1
|
||||
|
||||
- type: interactionGroup
|
||||
id: Danger
|
||||
color: "#950740"
|
||||
priority: 2
|
||||
|
||||
- type: interactionGroup
|
||||
id: Extreme
|
||||
color: "#C3073F"
|
||||
priority: 3
|
||||
23
Resources/Prototypes/_Amour/Interactions/interactionList.yml
Normal file
23
Resources/Prototypes/_Amour/Interactions/interactionList.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
- type: interactionList
|
||||
id: Humanoid
|
||||
prototypes:
|
||||
- SlapButt
|
||||
- LickFace
|
||||
- DickInButt
|
||||
- DickInVagina
|
||||
- ItemOnButt
|
||||
- ItemOnVagina
|
||||
- ItemOnPenis
|
||||
- LickVagina
|
||||
- LickDick
|
||||
- LickFace
|
||||
- KissMouth
|
||||
- KissNeck
|
||||
- KissFace
|
||||
- CombHead
|
||||
- CombEars
|
||||
- CombButt
|
||||
- PullTarget
|
||||
- CrawlTarget
|
||||
- SitWithButt
|
||||
- SitWithVagina
|
||||
Reference in New Issue
Block a user