Add variables to CluwneComponent, allowing for admeme customizing. Also localized two strings. (#40466)
* Add variables to cluwne component, update to the new style, add unremovable option to setoutfit. * not nullable, shorthand * Add comments, address reviews * why, was i drunk? * Apply suggestions from code review --------- Co-authored-by: Jessica M <jessica@maybe.sh> Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
using Robust.Shared.Audio;
|
||||
using Content.Shared.Chat.Prototypes;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Roles;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
namespace Content.Shared.Cluwne;
|
||||
@@ -12,22 +15,74 @@ public sealed partial class CluwneComponent : Component
|
||||
/// <summary>
|
||||
/// timings for giggles and knocks.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField]
|
||||
public TimeSpan DamageGiggleCooldown = TimeSpan.FromSeconds(2);
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
/// <summary>
|
||||
/// Amount of genetic damage dealt when they revert
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public DamageSpecifier RevertDamage = new()
|
||||
{
|
||||
DamageDict = new()
|
||||
{
|
||||
{ "Genetic", 300.0 },
|
||||
},
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Chance that the Cluwne will be knocked over and paralyzed.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public float KnockChance = 0.05f;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
/// <summary>
|
||||
/// Chance that the Cluwne will randomly giggle
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public float GiggleRandomChance = 0.1f;
|
||||
|
||||
[DataField("emoteId", customTypeSerializer: typeof(PrototypeIdSerializer<EmoteSoundsPrototype>))]
|
||||
public string? EmoteSoundsId = "Cluwne";
|
||||
/// <summary>
|
||||
/// Enable random emoting?
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public bool RandomEmote = true;
|
||||
|
||||
/// <summary>
|
||||
/// Emote sound collection that the Cluwne should use.
|
||||
/// </summary>
|
||||
[DataField("emoteId")]
|
||||
public ProtoId<EmoteSoundsPrototype>? EmoteSoundsId = "Cluwne";
|
||||
|
||||
/// <summary>
|
||||
/// Emote to use for the Cluwne Giggling
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public ProtoId<AutoEmotePrototype>? AutoEmoteId = "CluwneGiggle";
|
||||
|
||||
/// <summary>
|
||||
/// Message to popup when the Cluwne is transformed
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public LocId TransformMessage = "cluwne-transform";
|
||||
|
||||
/// <summary>
|
||||
/// Name prefix for the Cluwne.
|
||||
/// Example "Urist McHuman" will be "Cluwned Urist McHuman"
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public LocId NamePrefix = "cluwne-name-prefix";
|
||||
|
||||
/// <summary>
|
||||
/// Outfit ID that the cluwne will spawn with.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public ProtoId<StartingGearPrototype> OutfitId = "CluwneGear";
|
||||
|
||||
/// <summary>
|
||||
/// Amount of time cluwne is paralyzed for when falling over.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField]
|
||||
public float ParalyzeTime = 2f;
|
||||
|
||||
/// <summary>
|
||||
@@ -36,6 +91,21 @@ public sealed partial class CluwneComponent : Component
|
||||
[DataField("spawnsound")]
|
||||
public SoundSpecifier SpawnSound = new SoundPathSpecifier("/Audio/Items/bikehorn.ogg");
|
||||
|
||||
[DataField("knocksound")]
|
||||
/// <summary>
|
||||
/// Emote to use for the cluwne giggling
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public LocId GiggleEmote = "cluwne-giggle-emote";
|
||||
|
||||
/// <summary>
|
||||
/// Sound to play when the Cluwne is knocked over and paralyzed
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public SoundSpecifier KnockSound = new SoundPathSpecifier("/Audio/Items/airhorn.ogg");
|
||||
|
||||
/// <summary>
|
||||
/// Emote thats used when the cluwne getting knocked over
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public LocId KnockEmote = "cluwne-knock-emote";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user