From: slarticodefast <161409025+slarticodefast@users.noreply.github.com> Date: Fri, 21 Jun 2024 05:42:17 +0000 (+0200) Subject: fix initial infected icons and add a briefing to the character menu (#29259) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=d62dddcfcb7d031f8525b5248040af260fe372f6;p=space-station-14.git fix initial infected icons and add a briefing to the character menu (#29259) --- diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs b/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs index 4103b8a8aa..28918e960e 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs @@ -21,6 +21,9 @@ public sealed partial class AdminVerbSystem [ValidatePrototypeId] private const string DefaultTraitorRule = "Traitor"; + [ValidatePrototypeId] + private const string DefaultInitialInfectedRule = "Zombie"; + [ValidatePrototypeId] private const string DefaultNukeOpRule = "LoneOpsSpawn"; @@ -63,6 +66,20 @@ public sealed partial class AdminVerbSystem }; args.Verbs.Add(traitor); + Verb initialInfected = new() + { + Text = Loc.GetString("admin-verb-text-make-initial-infected"), + Category = VerbCategory.Antag, + Icon = new SpriteSpecifier.Rsi(new("/Textures/Interface/Misc/job_icons.rsi"), "InitialInfected"), + Act = () => + { + _antag.ForceMakeAntag(targetPlayer, DefaultInitialInfectedRule); + }, + Impact = LogImpact.High, + Message = Loc.GetString("admin-verb-make-initial-infected"), + }; + args.Verbs.Add(initialInfected); + Verb zombie = new() { Text = Loc.GetString("admin-verb-text-make-zombie"), diff --git a/Content.Server/GameTicking/Rules/ZombieRuleSystem.cs b/Content.Server/GameTicking/Rules/ZombieRuleSystem.cs index 95d1f791ef..e91931300e 100644 --- a/Content.Server/GameTicking/Rules/ZombieRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/ZombieRuleSystem.cs @@ -2,6 +2,7 @@ using Content.Server.Antag; using Content.Server.Chat.Systems; using Content.Server.GameTicking.Rules.Components; using Content.Server.Popups; +using Content.Server.Roles; using Content.Server.RoundEnd; using Content.Server.Station.Components; using Content.Server.Station.Systems; @@ -35,9 +36,27 @@ public sealed class ZombieRuleSystem : GameRuleSystem { base.Initialize(); + SubscribeLocalEvent(OnGetBriefing); + SubscribeLocalEvent(OnGetBriefing); SubscribeLocalEvent(OnZombifySelf); } + private void OnGetBriefing(EntityUid uid, InitialInfectedRoleComponent component, ref GetBriefingEvent args) + { + if (!TryComp(uid, out var mind) || mind.OwnedEntity == null) + return; + if (HasComp(uid)) // don't show both briefings + return; + args.Append(Loc.GetString("zombie-patientzero-role-greeting")); + } + + private void OnGetBriefing(EntityUid uid, ZombieRoleComponent component, ref GetBriefingEvent args) + { + if (!TryComp(uid, out var mind) || mind.OwnedEntity == null) + return; + args.Append(Loc.GetString("zombie-infection-greeting")); + } + protected override void AppendRoundEndText(EntityUid uid, ZombieRuleComponent component, GameRuleComponent gameRule, ref RoundEndTextAppendEvent args) { diff --git a/Resources/Locale/en-US/administration/antag.ftl b/Resources/Locale/en-US/administration/antag.ftl index 535659f27e..587c038557 100644 --- a/Resources/Locale/en-US/administration/antag.ftl +++ b/Resources/Locale/en-US/administration/antag.ftl @@ -1,5 +1,6 @@ verb-categories-antag = Antag ctrl admin-verb-make-traitor = Make the target into a traitor. +admin-verb-make-initial-infected = Make the target into an Initial Infected. admin-verb-make-zombie = Zombifies the target immediately. admin-verb-make-nuclear-operative = Make target into a lone Nuclear Operative. admin-verb-make-pirate = Make the target into a pirate. Note this doesn't configure the game rule. @@ -7,8 +8,9 @@ admin-verb-make-head-rev = Make the target into a Head Revolutionary. admin-verb-make-thief = Make the target into a thief. admin-verb-text-make-traitor = Make Traitor +admin-verb-text-make-initial-infected = Make Initial Infected admin-verb-text-make-zombie = Make Zombie admin-verb-text-make-nuclear-operative = Make Nuclear Operative admin-verb-text-make-pirate = Make Pirate admin-verb-text-make-head-rev = Make Head Rev -admin-verb-text-make-thief = Make Thief \ No newline at end of file +admin-verb-text-make-thief = Make Thief diff --git a/Resources/Prototypes/GameRules/events.yml b/Resources/Prototypes/GameRules/events.yml index f8f2ef49e7..3e63ad0283 100644 --- a/Resources/Prototypes/GameRules/events.yml +++ b/Resources/Prototypes/GameRules/events.yml @@ -277,7 +277,7 @@ duration: 60 maxDuration: 120 - type: PowerGridCheckRule - + - type: entity parent: BaseGameRule id: SolarFlare @@ -404,6 +404,7 @@ maxInitialInfectedGrace: 450 - type: ZombifyOnDeath - type: IncurableZombie + - type: InitialInfected mindComponents: - type: InitialInfectedRole prototype: InitialInfected diff --git a/Resources/Prototypes/GameRules/roundstart.yml b/Resources/Prototypes/GameRules/roundstart.yml index 923a011460..a7b749a35f 100644 --- a/Resources/Prototypes/GameRules/roundstart.yml +++ b/Resources/Prototypes/GameRules/roundstart.yml @@ -244,6 +244,7 @@ - type: PendingZombie - type: ZombifyOnDeath - type: IncurableZombie + - type: InitialInfected mindComponents: - type: InitialInfectedRole prototype: InitialInfected