* Add AutoEmote comp/system * Reduce groan chance so it's the same as before Old code did 0.2 and then 0.5, now it's just one Prob(0.1) * Fix typo, curTime var, don't log Resolve * Maybe fix pausing? * Fix mistake * Update NextEmoteTime if an auto emote is removed * Fix stuff Get CurTime outside update loop Use MapInit instead of ComponentInit Fix a typo in a comment Debug assert prototype ID in RemoveEmote Do += PausedTime in OnUnpaused Add prototype as arg to ResetTimer to avoid an indexing
34 lines
930 B
C#
34 lines
930 B
C#
namespace Content.Server.Zombies;
|
|
|
|
/// <summary>
|
|
/// Indicates a zombie that is "alive", i.e not crit/dead.
|
|
/// Causes it to emote when damaged.
|
|
/// TODO: move this to generic EmoteWhenDamaged comp/system.
|
|
/// </summary>
|
|
[RegisterComponent]
|
|
public sealed class ActiveZombieComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// What emote to preform.
|
|
/// </summary>
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
public string GroanEmoteId = "Scream";
|
|
|
|
/// <summary>
|
|
/// Minimum time between groans.
|
|
/// </summary>
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
public TimeSpan DamageGroanCooldown = TimeSpan.FromSeconds(2);
|
|
|
|
/// <summary>
|
|
/// Chance to groan.
|
|
/// </summary>
|
|
public float DamageGroanChance = 0.5f;
|
|
|
|
/// <summary>
|
|
/// The last time the zombie groaned from taking damage.
|
|
/// </summary>
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
public TimeSpan LastDamageGroan = TimeSpan.Zero;
|
|
}
|