From 315c5643154065b594f89bbbacaf37632503f56b Mon Sep 17 00:00:00 2001 From: Rane <60792108+Elijahrane@users.noreply.github.com> Date: Thu, 15 Sep 2022 15:37:54 -0400 Subject: [PATCH] starting TC penalties for powerful roles (#11111) * starting TC based on role * actually just remove all the job changes * reviews * moment --- Content.Server/GameTicking/Rules/TraitorRuleSystem.cs | 3 +++ Content.Shared/Roles/JobPrototype.cs | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs b/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs index 29b7b91895..24f413dceb 100644 --- a/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs @@ -184,6 +184,9 @@ public sealed class TraitorRuleSystem : GameRuleSystem var startingBalance = _cfg.GetCVar(CCVars.TraitorStartingBalance); + if (mind.CurrentJob != null) + startingBalance = Math.Max(startingBalance - mind.CurrentJob.Prototype.AntagAdvantage, 0); + if (!_uplink.AddUplink(mind.OwnedEntity!.Value, startingBalance)) return false; diff --git a/Content.Shared/Roles/JobPrototype.cs b/Content.Shared/Roles/JobPrototype.cs index 300870bcaa..14bd3548bb 100644 --- a/Content.Shared/Roles/JobPrototype.cs +++ b/Content.Shared/Roles/JobPrototype.cs @@ -53,6 +53,13 @@ namespace Content.Shared.Roles [DataField("weight")] public int Weight { get; private set; } + /// + /// A numerical score for how much easier this job is for antagonists. + /// For traitors, reduces starting TC by this amount. Other gamemodes can use it for whatever they find fitting. + /// + [DataField("antagAdvantage")] + public int AntagAdvantage = 0; + [DataField("startingGear", customTypeSerializer: typeof(PrototypeIdSerializer))] public string? StartingGear { get; private set; }