2023-01-25 17:29:41 +01:00
|
|
|
using Content.Shared.Chat.Prototypes;
|
2023-06-04 16:45:02 -04:00
|
|
|
using Robust.Shared.Prototypes;
|
2023-01-25 17:29:41 +01:00
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
|
|
|
|
|
2025-05-23 12:32:22 -04:00
|
|
|
namespace Content.Shared.EntityEffects.Effects;
|
2023-01-25 17:29:41 +01:00
|
|
|
|
|
|
|
|
/// <summary>
|
2025-05-19 13:23:38 -05:00
|
|
|
/// Tries to force someone to emote (scream, laugh, etc). Still respects whitelists/blacklists and other limits unless specially forced.
|
2023-01-25 17:29:41 +01:00
|
|
|
/// </summary>
|
2025-05-23 12:32:22 -04:00
|
|
|
public sealed partial class Emote : EventEntityEffect<Emote>
|
2023-01-25 17:29:41 +01:00
|
|
|
{
|
2025-05-19 13:23:38 -05:00
|
|
|
/// <summary>
|
|
|
|
|
/// The emote the entity will preform.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("emote", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<EmotePrototype>))]
|
|
|
|
|
public string EmoteId;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// If the emote should be recorded in chat.
|
|
|
|
|
/// </summary>
|
2023-12-29 04:47:43 -08:00
|
|
|
[DataField]
|
2023-01-25 17:29:41 +01:00
|
|
|
public bool ShowInChat;
|
|
|
|
|
|
2025-05-19 13:23:38 -05:00
|
|
|
/// <summary>
|
|
|
|
|
/// If the forced emote will be listed in the guidebook.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField]
|
|
|
|
|
public bool ShowInGuidebook;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// If true, the entity will preform the emote even if they normally can't.
|
|
|
|
|
/// </summary>
|
2024-06-03 18:45:00 -05:00
|
|
|
[DataField]
|
|
|
|
|
public bool Force = false;
|
|
|
|
|
|
2023-06-04 16:45:02 -04:00
|
|
|
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
2025-05-19 13:23:38 -05:00
|
|
|
{
|
|
|
|
|
if (!ShowInGuidebook)
|
|
|
|
|
return null; // JUSTIFICATION: Emoting is mostly flavor, so same reason popup messages are not in here.
|
|
|
|
|
|
2025-06-03 10:55:15 -05:00
|
|
|
var emotePrototype = prototype.Index<EmotePrototype>(EmoteId);
|
|
|
|
|
return Loc.GetString("reagent-effect-guidebook-emote", ("chance", Probability), ("emote", Loc.GetString(emotePrototype.Name)));
|
2025-05-19 13:23:38 -05:00
|
|
|
}
|
2023-01-25 17:29:41 +01:00
|
|
|
}
|