Damage on high speed effect (#18566)
This commit is contained in:
@@ -1,33 +1,40 @@
|
||||
using Content.Server.Damage.Systems;
|
||||
using Content.Shared.Damage;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
||||
|
||||
namespace Content.Server.Damage.Components
|
||||
namespace Content.Server.Damage.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Should the entity take damage / be stunned if colliding at a speed above MinimumSpeed?
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(DamageOnHighSpeedImpactSystem))]
|
||||
public sealed class DamageOnHighSpeedImpactComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Should the entity take damage / be stunned if colliding at a speed above MinimumSpeed?
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
internal sealed class DamageOnHighSpeedImpactComponent : Component
|
||||
{
|
||||
[DataField("minimumSpeed")]
|
||||
public float MinimumSpeed { get; set; } = 20f;
|
||||
[DataField("factor")]
|
||||
public float Factor { get; set; } = 0.5f;
|
||||
[DataField("soundHit", required: true)]
|
||||
public SoundSpecifier SoundHit { get; set; } = default!;
|
||||
[DataField("stunChance")]
|
||||
public float StunChance { get; set; } = 0.25f;
|
||||
[DataField("stunMinimumDamage")]
|
||||
public int StunMinimumDamage { get; set; } = 10;
|
||||
[DataField("stunSeconds")]
|
||||
public float StunSeconds { get; set; } = 1f;
|
||||
[DataField("damageCooldown")]
|
||||
public float DamageCooldown { get; set; } = 2f;
|
||||
[DataField("minimumSpeed"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public float MinimumSpeed = 20f;
|
||||
|
||||
internal TimeSpan LastHit = TimeSpan.Zero;
|
||||
[DataField("speedDamageFactor"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public float SpeedDamageFactor = 0.5f;
|
||||
|
||||
[DataField("damage", required: true)]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public DamageSpecifier Damage = default!;
|
||||
}
|
||||
[DataField("soundHit", required: true), ViewVariables(VVAccess.ReadWrite)]
|
||||
public SoundSpecifier SoundHit = default!;
|
||||
|
||||
[DataField("stunChance"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public float StunChance = 0.25f;
|
||||
|
||||
[DataField("stunMinimumDamage"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public int StunMinimumDamage = 10;
|
||||
|
||||
[DataField("stunSeconds"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public float StunSeconds = 1f;
|
||||
|
||||
[DataField("damageCooldown"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public float DamageCooldown = 2f;
|
||||
|
||||
[DataField("lastHit", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
|
||||
public TimeSpan LastHit = TimeSpan.Zero;
|
||||
|
||||
[DataField("damage", required: true), ViewVariables(VVAccess.ReadWrite)]
|
||||
public DamageSpecifier Damage = default!;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user