From 630a7a78edac8477be3f9c98ab2c12c8700ad4cc Mon Sep 17 00:00:00 2001 From: no <165581243+pissdemon@users.noreply.github.com> Date: Tue, 7 May 2024 03:48:16 +0200 Subject: [PATCH] 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 HashSets * 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 --- Content.Client/Entry/EntryPoint.cs | 1 + .../Controls/Roles/GhostRoleEntryButtons.xaml | 2 +- .../Roles/GhostRoleEntryButtons.xaml.cs | 65 +++- .../Controls/Roles/GhostRolesEntry.xaml.cs | 2 +- .../Ghost/Controls/Roles/GhostRolesEui.cs | 24 +- .../Controls/Roles/GhostRolesWindow.xaml | 4 +- .../Controls/Roles/GhostRolesWindow.xaml.cs | 4 +- .../Ghost/Controls/Roles/MakeGhostRoleEui.cs | 19 +- .../Controls/Roles/MakeGhostRoleWindow.xaml | 18 + .../Roles/MakeGhostRoleWindow.xaml.cs | 121 +++++- .../Roles/Components/GhostRoleComponent.cs | 10 +- .../Components/GhostRoleRaffleComponent.cs | 58 +++ Content.Server/Ghost/Roles/GhostRoleSystem.cs | 344 +++++++++++++++++- .../Roles/MakeRaffledGhostRoleCommand.cs | 127 +++++++ .../Roles/Raffles/GhostRoleRaffleConfig.cs | 35 ++ .../GhostRoleRaffleDeciderPrototype.cs | 20 + .../Roles/Raffles/IGhostRoleRaffleDecider.cs | 28 ++ .../Raffles/RngGhostRoleRaffleDecider.cs | 27 ++ .../Ghost/Roles/UI/GhostRolesEui.cs | 20 +- .../Ghost/Roles/GhostRolesEuiMessages.cs | 61 +++- .../Roles/Raffles/GhostRoleRaffleSettings.cs | 30 ++ .../GhostRoleRaffleSettingsPrototype.cs | 22 ++ Resources/Locale/en-US/ghost/ghost-gui.ftl | 11 + .../Entities/Markers/Spawners/ghost_roles.yml | 12 + .../Prototypes/Entities/Mobs/NPCs/animals.yml | 6 + .../Entities/Mobs/NPCs/behonker.yml | 2 + .../Prototypes/Entities/Mobs/NPCs/carp.yml | 2 + .../Entities/Mobs/NPCs/elemental.yml | 2 + .../Entities/Mobs/NPCs/hellspawn.yml | 2 + .../Entities/Mobs/NPCs/regalrat.yml | 2 + .../Entities/Mobs/NPCs/revenant.yml | 2 + .../Prototypes/Entities/Mobs/NPCs/silicon.yml | 6 + .../Prototypes/Entities/Mobs/NPCs/slimes.yml | 8 + .../Prototypes/Entities/Mobs/NPCs/xeno.yml | 2 + .../Entities/Mobs/Player/dragon.yml | 4 + .../Entities/Mobs/Player/familiars.yml | 2 + .../Entities/Mobs/Player/guardian.yml | 8 + .../Entities/Mobs/Player/humanoid.yml | 36 ++ .../Entities/Mobs/Player/skeleton.yml | 6 + .../Objects/Consumable/Food/Baked/bread.yml | 4 +- .../Objects/Consumable/Food/Baked/cake.yml | 2 + .../reinforcement_teleporter.yml | 6 + .../Prototypes/GhostRoleRaffles/deciders.yml | 3 + .../Prototypes/GhostRoleRaffles/settings.yml | 15 + 44 files changed, 1136 insertions(+), 49 deletions(-) create mode 100644 Content.Server/Ghost/Roles/Components/GhostRoleRaffleComponent.cs create mode 100644 Content.Server/Ghost/Roles/MakeRaffledGhostRoleCommand.cs create mode 100644 Content.Server/Ghost/Roles/Raffles/GhostRoleRaffleConfig.cs create mode 100644 Content.Server/Ghost/Roles/Raffles/GhostRoleRaffleDeciderPrototype.cs create mode 100644 Content.Server/Ghost/Roles/Raffles/IGhostRoleRaffleDecider.cs create mode 100644 Content.Server/Ghost/Roles/Raffles/RngGhostRoleRaffleDecider.cs create mode 100644 Content.Shared/Ghost/Roles/Raffles/GhostRoleRaffleSettings.cs create mode 100644 Content.Shared/Ghost/Roles/Raffles/GhostRoleRaffleSettingsPrototype.cs create mode 100644 Resources/Prototypes/GhostRoleRaffles/deciders.yml create mode 100644 Resources/Prototypes/GhostRoleRaffles/settings.yml diff --git a/Content.Client/Entry/EntryPoint.cs b/Content.Client/Entry/EntryPoint.cs index 47f11ee161..25490874e9 100644 --- a/Content.Client/Entry/EntryPoint.cs +++ b/Content.Client/Entry/EntryPoint.cs @@ -118,6 +118,7 @@ namespace Content.Client.Entry _prototypeManager.RegisterIgnore("wireLayout"); _prototypeManager.RegisterIgnore("alertLevels"); _prototypeManager.RegisterIgnore("nukeopsRole"); + _prototypeManager.RegisterIgnore("ghostRoleRaffleDecider"); _componentFactory.GenerateNetIds(); _adminManager.Initialize(); diff --git a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleEntryButtons.xaml b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleEntryButtons.xaml index 92e38e35e0..ffde5d69f7 100644 --- a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleEntryButtons.xaml +++ b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleEntryButtons.xaml @@ -5,7 +5,7 @@ Text="{Loc 'ghost-roles-window-request-role-button'}" StyleClasses="OpenRight" HorizontalAlignment="Left" - SetWidth="150"/> + SetWidth="300"/>