Animals make hearts when you pet them (#20859)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Server.Interaction.Components;
|
||||
|
||||
@@ -40,6 +41,18 @@ public sealed partial class InteractionPopupComponent : Component
|
||||
[DataField("interactFailureSound")]
|
||||
public SoundSpecifier? InteractFailureSound;
|
||||
|
||||
/// <summary>
|
||||
/// a prototype that will spawn upon successful interaction (as planned only for special effects)
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public EntProtoId? InteractSuccessSpawn;
|
||||
|
||||
/// <summary>
|
||||
/// a prototype that will spawn upon failure interaction (as planned only for special effects)
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public EntProtoId? InteractFailureSpawn;
|
||||
|
||||
/// <summary>
|
||||
/// Chance that an interaction attempt will succeed.
|
||||
/// 1 = always play "success" popup and sound.
|
||||
|
||||
@@ -58,6 +58,9 @@ public sealed class InteractionPopupSystem : EntitySystem
|
||||
|
||||
if (component.InteractSuccessSound != null)
|
||||
sfx = component.InteractSuccessSound.GetSound();
|
||||
|
||||
if (component.InteractSuccessSpawn != null)
|
||||
Spawn(component.InteractSuccessSpawn, Transform(uid).MapPosition);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -66,6 +69,9 @@ public sealed class InteractionPopupSystem : EntitySystem
|
||||
|
||||
if (component.InteractFailureSound != null)
|
||||
sfx = component.InteractFailureSound.GetSound();
|
||||
|
||||
if (component.InteractFailureSpawn != null)
|
||||
Spawn(component.InteractFailureSpawn, Transform(uid).MapPosition);
|
||||
}
|
||||
|
||||
if (component.MessagePerceivedByOthers != null)
|
||||
|
||||
Reference in New Issue
Block a user