CatStation/Content.Server/GameTicking/Rules/ServerTraitorRuleSystem.cs
Princess Cheeseballs 2c6ffecf62
Move GameTicker to Shared (#45834)
* Scope creep my ass

* why was this shit not pushed????

* gone...

* fix that

* review plus buildd

* asfsafsafsafsafas

* grug

* burber

* I'll fix this later

* shrimply die

* also this

* it's snerf or snuthin

* assaads

* round snend

* aaaa

* fix this shit for real

* actually, don't start GameRules until MapInit now that I think aboot it.

* forgot u

* don't actually need this part nullable

* Deffer comp removal

* one liner

* do that too

* chungus

* Honestly makes more sense here, plus WHY are we doing all that shit on "GameRuleAdded" rather than GameRuleStarted(?)

* deferred removal :V

* aaaaaaaaaaaaaaa

* whhop

* Whoop

* better

* landmine that I placed for myself then forgot about lmao

* cleanup

* FUCKING `!`

* gotovo

* amogus

* please don't check by metadata I beg

* waawsasfdfsasfa

* sfafsasfafsas

* fdsaasffsasfa

* code

* fix

* fasasffasfasfsad

* chungaas

* I may be stupid

* gra

* graaaaaaaaaaaaaaaaa

* comment

* gra

* clearing is not predicted and would require major refactors, so don't cache on client.

* lame shit :P

* last holes

* nukeopsfsafsasafsfafsa

* why  was that shit public bruh

* bubrbgwahrghfaka

* dynamic

* revert change that did nothing lmao
2026-09-16 19:34:19 +00:00

60 lines
2.1 KiB
C#

using Content.Server.Objectives;
using Content.Server.Traitor.Uplink;
using Content.Shared.FixedPoint;
using Content.Shared.PDA;
using Content.Shared.GameTicking.Rules;
using Content.Shared.GameTicking.Rules.Components;
namespace Content.Server.GameTicking.Rules;
public sealed partial class ServerTraitorRuleSystem : TraitorRuleSystem
{
[Dependency] private UplinkSystem _uplink = default!;
public override void Initialize()
{
base.Initialize();
Log.Level = LogLevel.Debug;
}
protected override (Note[]?, string) RequestUplink(EntityUid traitor, FixedPoint2 startingBalance, string briefing)
{
var pda = _uplink.FindUplinkTarget(traitor);
Log.Debug($"MakeTraitor {ToPrettyString(traitor)} - Uplink add");
var uplinked = _uplink.AddUplink(traitor, startingBalance, out var code, pda, giveDiscounts: true, bindToPda: false);
if (code != null && uplinked == AddUplinkResult.Pda)
{
Log.Debug($"MakeTraitor {ToPrettyString(traitor)} - Uplink is PDA");
// If giveUplink is false the uplink code part is omitted
briefing = string.Format("{0}\n{1}",
briefing,
Loc.GetString("traitor-role-uplink-code-short", ("code", string.Join("-", code).Replace("sharp", "#"))));
return (code, briefing);
}
if (uplinked == AddUplinkResult.Implant)
{
Log.Debug($"MakeTraitor {ToPrettyString(traitor)} - Uplink is implant");
briefing += "\n" + Loc.GetString("traitor-role-uplink-implant-short");
}
else
{
Log.Error($"MakeTraitor failed on {ToPrettyString(traitor)} - No uplink could be added");
}
return (null, briefing);
}
// TODO: AntagCodewordsComponent
[SubscribeLocalEvent]
private void OnObjectivesTextPrepend(EntityUid uid, TraitorRuleComponent comp, ref ObjectivesTextPrependEvent args)
{
if(comp.GiveCodewords)
args.Text += "\n" + Loc.GetString("traitor-round-end-codewords", ("codewords", string.Join(", ", Codeword.GetCodewords(comp.CodewordFactionPrototypeId))));
}
}