* Use new Subs.CVar helper Removes manual config OnValueChanged calls, removes need to remember to manually unsubscribe. This both reduces boilerplate and fixes many issues where subscriptions weren't removed on entity system shutdown. * Fix a bunch of warnings * More warning fixes * Use new DateTime serializer to get rid of ISerializationHooks in changelog code. * Get rid of some more ISerializationHooks for enums * And a little more * Apply suggestions from code review Co-authored-by: 0x6273 <0x40@keemail.me> --------- Co-authored-by: 0x6273 <0x40@keemail.me>
43 lines
1.5 KiB
C#
43 lines
1.5 KiB
C#
using Content.Shared.Explosion.EntitySystems;
|
|
using Content.Shared.Chemistry.Components;
|
|
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Shared.Explosion.Components;
|
|
|
|
/// <summary>
|
|
/// Creates a smoke cloud when triggered, with an optional solution to include in it.
|
|
/// No sound is played incase a grenade is stealthy, use <see cref="SoundOnTriggerComponent"/> if you want a sound.
|
|
/// </summary>
|
|
[RegisterComponent, NetworkedComponent, Access(typeof(SharedSmokeOnTriggerSystem))]
|
|
public sealed partial class SmokeOnTriggerComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// How long the smoke stays for, after it has spread.
|
|
/// </summary>
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
public float Duration = 10;
|
|
|
|
/// <summary>
|
|
/// How much the smoke will spread.
|
|
/// </summary>
|
|
[DataField(required: true), ViewVariables(VVAccess.ReadWrite)]
|
|
public int SpreadAmount;
|
|
|
|
/// <summary>
|
|
/// Smoke entity to spawn.
|
|
/// Defaults to smoke but you can use foam if you want.
|
|
/// </summary>
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
public ProtoId<EntityPrototype> SmokePrototype = "Smoke";
|
|
|
|
/// <summary>
|
|
/// Solution to add to each smoke cloud.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// When using repeating trigger this essentially gets multiplied so dont do anything crazy like omnizine or lexorin.
|
|
/// </remarks>
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
public Solution Solution = new();
|
|
}
|