From: slarticodefast <161409025+slarticodefast@users.noreply.github.com> Date: Thu, 27 Mar 2025 17:04:25 +0000 (+0100) Subject: Add paradox clone to admin antag control (#36105) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=7c44038f637a55fc4593cafc2697aa7f4378f974;p=space-station-14.git Add paradox clone to admin antag control (#36105) * make paradox clone receive the original's objectives * antag control verb * rename verb --- diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs b/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs index b8a05c3e8f..79c5c86fe1 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs @@ -1,9 +1,11 @@ using Content.Server.Administration.Commands; using Content.Server.Antag; +using Content.Server.GameTicking; using Content.Server.GameTicking.Rules.Components; using Content.Server.Zombies; using Content.Shared.Administration; using Content.Shared.Database; +using Content.Shared.Humanoid; using Content.Shared.Mind.Components; using Content.Shared.Roles; using Content.Shared.Verbs; @@ -17,6 +19,7 @@ public sealed partial class AdminVerbSystem { [Dependency] private readonly AntagSelectionSystem _antag = default!; [Dependency] private readonly ZombieSystem _zombie = default!; + [Dependency] private readonly GameTicker _gameTicker = default!; [ValidatePrototypeId] private const string DefaultTraitorRule = "Traitor"; @@ -36,6 +39,8 @@ public sealed partial class AdminVerbSystem [ValidatePrototypeId] private const string PirateGearId = "PirateGear"; + private readonly EntProtoId _paradoxCloneRuleId = "ParadoxCloneSpawn"; + // All antag verbs have names so invokeverb works. private void AddAntagVerbs(GetVerbsEvent args) { @@ -157,5 +162,29 @@ public sealed partial class AdminVerbSystem Message = string.Join(": ", thiefName, Loc.GetString("admin-verb-make-thief")), }; args.Verbs.Add(thief); + + var paradoxCloneName = Loc.GetString("admin-verb-text-make-paradox-clone"); + Verb paradox = new() + { + Text = paradoxCloneName, + Category = VerbCategory.Antag, + Icon = new SpriteSpecifier.Rsi(new("/Textures/Interface/Misc/job_icons.rsi"), "ParadoxClone"), + Act = () => + { + var ruleEnt = _gameTicker.AddGameRule(_paradoxCloneRuleId); + + if (!TryComp(ruleEnt, out var paradoxCloneRuleComp)) + return; + + paradoxCloneRuleComp.OriginalBody = args.Target; // override the target player + + _gameTicker.StartGameRule(ruleEnt); + }, + Impact = LogImpact.High, + Message = string.Join(": ", paradoxCloneName, Loc.GetString("admin-verb-make-paradox-clone")), + }; + + if (HasComp(args.Target)) // only humanoids can be cloned + args.Verbs.Add(paradox); } } diff --git a/Content.Server/GameTicking/Rules/Components/ParadoxCloneRuleComponent.cs b/Content.Server/GameTicking/Rules/Components/ParadoxCloneRuleComponent.cs index 143659748a..e28a0bc35f 100644 --- a/Content.Server/GameTicking/Rules/Components/ParadoxCloneRuleComponent.cs +++ b/Content.Server/GameTicking/Rules/Components/ParadoxCloneRuleComponent.cs @@ -22,12 +22,19 @@ public sealed partial class ParadoxCloneRuleComponent : Component [DataField] public EntProtoId GibProto = "MobParadoxTimed"; + /// + /// Entity of the original player. + /// Gets randomly chosen from all alive players if not specified. + /// + [DataField] + public EntityUid? OriginalBody; + /// /// Mind entity of the original player. /// Gets assigned when cloning. /// [DataField] - public EntityUid? Original; + public EntityUid? OriginalMind; /// /// Whitelist for Objectives to be copied to the clone. diff --git a/Content.Server/GameTicking/Rules/ParadoxCloneRuleSystem.cs b/Content.Server/GameTicking/Rules/ParadoxCloneRuleSystem.cs index 8a5cab85b8..ab8864caaa 100644 --- a/Content.Server/GameTicking/Rules/ParadoxCloneRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/ParadoxCloneRuleSystem.cs @@ -47,28 +47,42 @@ public sealed class ParadoxCloneRuleSystem : GameRuleSystem(clone.Value); - targetComp.Target = playerToClone.Owner; // set the kill target + targetComp.Target = ent.Comp.OriginalMind; // set the kill target var gibComp = EnsureComp(clone.Value); gibComp.SpawnProto = ent.Comp.GibProto; @@ -78,17 +92,16 @@ public sealed class ParadoxCloneRuleSystem : GameRuleSystem ent, ref AfterAntagEntitySelectedEvent args) { - if (ent.Comp.Original == null) + if (ent.Comp.OriginalMind == null) return; if (!_mind.TryGetMind(args.EntityUid, out var cloneMindId, out var cloneMindComp)) return; - _mind.CopyObjectives(ent.Comp.Original.Value, (cloneMindId, cloneMindComp), ent.Comp.ObjectiveWhitelist, ent.Comp.ObjectiveBlacklist); + _mind.CopyObjectives(ent.Comp.OriginalMind.Value, (cloneMindId, cloneMindComp), ent.Comp.ObjectiveWhitelist, ent.Comp.ObjectiveBlacklist); } } diff --git a/Resources/Locale/en-US/administration/antag.ftl b/Resources/Locale/en-US/administration/antag.ftl index ef4ad98c7c..1433cc1dc4 100644 --- a/Resources/Locale/en-US/administration/antag.ftl +++ b/Resources/Locale/en-US/administration/antag.ftl @@ -6,6 +6,7 @@ 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. admin-verb-make-head-rev = Make the target into a Head Revolutionary. admin-verb-make-thief = Make the target into a thief. +admin-verb-make-paradox-clone = Create a Paradox Clone ghost role of the target. admin-verb-text-make-traitor = Make Traitor admin-verb-text-make-initial-infected = Make Initial Infected @@ -14,5 +15,6 @@ 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 +admin-verb-text-make-paradox-clone = Create Paradox Clone admin-overlay-antag-classic = ANTAG diff --git a/Resources/Textures/Interface/Misc/job_icons.rsi/ParadoxClone.png b/Resources/Textures/Interface/Misc/job_icons.rsi/ParadoxClone.png new file mode 100644 index 0000000000..6d1add3d21 Binary files /dev/null and b/Resources/Textures/Interface/Misc/job_icons.rsi/ParadoxClone.png differ diff --git a/Resources/Textures/Interface/Misc/job_icons.rsi/meta.json b/Resources/Textures/Interface/Misc/job_icons.rsi/meta.json index e2a26933fc..f6cc4d99e1 100644 --- a/Resources/Textures/Interface/Misc/job_icons.rsi/meta.json +++ b/Resources/Textures/Interface/Misc/job_icons.rsi/meta.json @@ -1,7 +1,7 @@ { "version": 1, "license": "CC-BY-SA-3.0", - "copyright": "Taken from https://github.com/vgstation-coders/vgstation13/blob/e71d6c4fba5a51f99b81c295dcaec4fc2f58fb19/icons/mob/screen1.dmi | Brigmedic icon made by PuroSlavKing (Github) | Zombie icon made by RamZ | Zookeper by netwy (discort) | Rev and Head Rev icon taken from https://tgstation13.org/wiki/HUD and edited by coolmankid12345 (Discord) | Mindshield icon taken from https://github.com/tgstation/tgstation/blob/ce6beb8a4d61235d9a597a7126c407160ed674ea/icons/mob/huds/hud.dmi | Admin recolored from MedicalIntern by TsjipTsjip | StationAi resprite to 8x8 size by lunarcomets | Service Worker resprite by anno_midi (Discord) and spanky-spanky (Github) | service icons darkened by frobnic8 (Discord and Github)", + "copyright": "Taken from https://github.com/vgstation-coders/vgstation13/blob/e71d6c4fba5a51f99b81c295dcaec4fc2f58fb19/icons/mob/screen1.dmi | Brigmedic icon made by PuroSlavKing (Github) | Zombie icon made by RamZ | Zookeper by netwy (discort) | Rev and Head Rev icon taken from https://tgstation13.org/wiki/HUD and edited by coolmankid12345 (Discord) | Mindshield icon taken from https://github.com/tgstation/tgstation/blob/ce6beb8a4d61235d9a597a7126c407160ed674ea/icons/mob/huds/hud.dmi | Admin recolored from MedicalIntern by TsjipTsjip | StationAi resprite to 8x8 size by lunarcomets | Service Worker resprite by anno_midi (Discord) and spanky-spanky (Github) | service icons darkened by frobnic8 (Discord and Github) | paradoxClone taken from tg station at commit https://github.com/tgstation/tgstation/commit/d0db1ff267557017ae7bde68e6490e70cbb6e42f and modifed by slarticodefast (Github)", "size": { "x": 8, @@ -191,6 +191,9 @@ }, { "name": "Admin" + }, + { + "name": "ParadoxClone" } ] }