* ion storm event prototype + locale * add lawsets * use lawsets, make borgs ion storm targets * ion storm rule and ion storm target * lawset prototype * use lawsets * update silicon law system to use lawsets and support ion storm event * new toys * fix * more fix * fixy * ion storm admin logging * assigning laws makes borg provide its own laws, other stuff * 1h reoccurence * 50% chance * better call saul * emagLaws is required * add announcment audio * fixy * family friendly gaming * fixy * address reviews * fixy * more fixy and no erp * pro --------- Co-authored-by: deltanedas <@deltanedas:kde.org>
55 lines
1.8 KiB
C#
55 lines
1.8 KiB
C#
using Content.Shared.Random;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Shared.Silicons.Laws.Components;
|
|
|
|
/// <summary>
|
|
/// During the ion storm event, this entity will have <see cref="IonStormLawsEvent"/> raised on it if it has laws.
|
|
/// New laws can be modified in multiple ways depending on the fields below.
|
|
/// </summary>
|
|
[RegisterComponent]
|
|
public sealed partial class IonStormTargetComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// <see cref="WeightedRandomPrototype"/> for a random lawset to possibly replace the old one with.
|
|
/// </summary>
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
public ProtoId<WeightedRandomPrototype> RandomLawsets = "IonStormLawsets";
|
|
|
|
/// <summary>
|
|
/// Chance for this borg to be affected at all.
|
|
/// </summary>
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
public float Chance = 0.5f;
|
|
|
|
/// <summary>
|
|
/// Chance to replace the lawset with a random one
|
|
/// </summary>
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
public float RandomLawsetChance = 0.25f;
|
|
|
|
/// <summary>
|
|
/// Chance to remove a random law.
|
|
/// </summary>
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
public float RemoveChance = 0.1f;
|
|
|
|
/// <summary>
|
|
/// Chance to replace a random law with the new one, rather than have it be a glitched-order law.
|
|
/// </summary>
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
public float ReplaceChance = 0.1f;
|
|
|
|
/// <summary>
|
|
/// Chance to shuffle laws after everything is done.
|
|
/// </summary>
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
public float ShuffleChance = 0.1f;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Raised on an ion storm target to modify its laws.
|
|
/// </summary>
|
|
[ByRefEvent]
|
|
public record struct IonStormLawsEvent(SiliconLawset Lawset);
|