use weighted random for ninja threats (#20469)

* change threats to be weighted random and a little cleanup

* ninja rule stores weighted random id for threats

* move threats out of the rule and into weighted random

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2023-09-25 04:16:09 +01:00
committed by GitHub
parent 2616cb69e8
commit 91a157d7ed
6 changed files with 44 additions and 23 deletions

View File

@@ -1,6 +1,8 @@
using Content.Server.Ninja.Systems;
using Content.Shared.Communications;
using Content.Shared.Random;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
namespace Content.Server.GameTicking.Rules.Components;
@@ -15,7 +17,7 @@ public sealed partial class NinjaRuleComponent : Component
/// List of threats that can be called in. Copied onto <see cref="CommsHackerComponent"/> when gloves are enabled.
/// </summary>
[DataField(required: true)]
public List<Threat> Threats = new();
public ProtoId<WeightedRandomPrototype> Threats = string.Empty;
/// <summary>
/// Sound played when making the player a ninja via antag control or ghost role