Add ghost role raffles (#26629)

* Add ghost role raffles

* GRR: Fix dialogue sizing, fix merge

* GRR: Add raffle deciders (winner picker)

* GRR: Make settings prototype based with option to override

* GRR: Use Raffles folder and namespace

* GRR: DataFieldify and TimeSpanify

* GRR: Don't actually DataFieldify HashSet<ICommonSession>s

* GRR: add GetGhostRoleCount() + docs

* update engine on branch

* Ghost role raffles: docs, fix window size, cleanup, etc

* GRR: Admin UI

* GRR: Admin UI: Display initial/max/ext of selected raffle settings proto

* GRR: Make a ton of roles raffled
This commit is contained in:
no
2024-05-07 03:48:16 +02:00
committed by GitHub
parent 6685146a1e
commit 630a7a78ed
44 changed files with 1138 additions and 51 deletions

View File

@@ -0,0 +1,30 @@
namespace Content.Server.Ghost.Roles.Raffles;
/// <summary>
/// Defines settings for a ghost role raffle.
/// </summary>
[DataDefinition]
public sealed partial class GhostRoleRaffleSettings
{
/// <summary>
/// The initial duration of a raffle in seconds. This is the countdown timer's value when the raffle starts.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField(required: true)]
public uint InitialDuration { get; set; }
/// <summary>
/// When the raffle is joined by a player, the countdown timer is extended by this value in seconds.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField(required: true)]
public uint JoinExtendsDurationBy { get; set; }
/// <summary>
/// The maximum duration in seconds for the ghost role raffle. A raffle cannot run for longer than this
/// duration, even if extended by joiners. Must be greater than or equal to <see cref="InitialDuration"/>.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField(required: true)]
public uint MaxDuration { get; set; }
}