* Mega Antag Refactor * last minute delta save * more workshopping * more shit * ok tested this for once * okkkkk sure * generic delays for starting rules * well darn * nukies partially * ouagh * ballin' faded and smonkin wed * obliterated the diff * Spread my arms and soak up congratulations * I've got plenty of love, but nothing to show for it * but there’s too much sunlight Shining on my laptop monitor, so I Can’t see anything with any amount of clarity * ok this junk * OOK! * fubar * most of sloth's review * oh boy * eek * hell yea! * ASDFJASDJFvsakcvjkzjnhhhyh
52 lines
1.5 KiB
C#
52 lines
1.5 KiB
C#
using Content.Server.Destructible.Thresholds;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
|
|
|
namespace Content.Server.GameTicking.Components;
|
|
|
|
/// <summary>
|
|
/// Component attached to all gamerule entities.
|
|
/// Used to both track the entity as well as store basic data
|
|
/// </summary>
|
|
[RegisterComponent]
|
|
public sealed partial class GameRuleComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// Game time when game rule was activated
|
|
/// </summary>
|
|
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
|
|
public TimeSpan ActivatedAt;
|
|
|
|
/// <summary>
|
|
/// The minimum amount of players needed for this game rule.
|
|
/// </summary>
|
|
[DataField]
|
|
public int MinPlayers;
|
|
|
|
/// <summary>
|
|
/// A delay for when the rule the is started and when the starting logic actually runs.
|
|
/// </summary>
|
|
[DataField]
|
|
public MinMax? Delay;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Raised when a rule is added but hasn't formally begun yet.
|
|
/// Good for announcing station events and other such things.
|
|
/// </summary>
|
|
[ByRefEvent]
|
|
public readonly record struct GameRuleAddedEvent(EntityUid RuleEntity, string RuleId);
|
|
|
|
/// <summary>
|
|
/// Raised when the rule actually begins.
|
|
/// Player-facing logic should begin here.
|
|
/// </summary>
|
|
[ByRefEvent]
|
|
public readonly record struct GameRuleStartedEvent(EntityUid RuleEntity, string RuleId);
|
|
|
|
/// <summary>
|
|
/// Raised when the rule ends.
|
|
/// Do cleanup and other such things here.
|
|
/// </summary>
|
|
[ByRefEvent]
|
|
public readonly record struct GameRuleEndedEvent(EntityUid RuleEntity, string RuleId);
|