Move entity effects definitions to shared (#35614)
* Move entity effects to shared * relocate spawning to server * Generic version of EntityEffect for just raising event. * genericise everything * oops forgot to push you * some condensation * finish rebas * unwhite the space * oops forgot nuke * bad rebase fix * useless annotations begone --------- Co-authored-by: EmoGarbage404 <retron404@gmail.com>
This commit is contained in:
committed by
GitHub
parent
7ba81173bd
commit
bf41de18aa
43
Content.Shared/EntityEffects/Effects/Emote.cs
Normal file
43
Content.Shared/EntityEffects/Effects/Emote.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using Content.Shared.Chat.Prototypes;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
namespace Content.Shared.EntityEffects.Effects;
|
||||
|
||||
/// <summary>
|
||||
/// Tries to force someone to emote (scream, laugh, etc). Still respects whitelists/blacklists and other limits unless specially forced.
|
||||
/// </summary>
|
||||
public sealed partial class Emote : EventEntityEffect<Emote>
|
||||
{
|
||||
/// <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>
|
||||
[DataField]
|
||||
public bool ShowInChat;
|
||||
|
||||
/// <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>
|
||||
[DataField]
|
||||
public bool Force = false;
|
||||
|
||||
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
||||
{
|
||||
if (!ShowInGuidebook)
|
||||
return null; // JUSTIFICATION: Emoting is mostly flavor, so same reason popup messages are not in here.
|
||||
|
||||
return Loc.GetString("reagent-effect-guidebook-emote", ("chance", Probability), ("emote", EmoteId));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user