More artifacts triggers and tweaks (#6723)

Co-authored-by: mirrorcult <lunarautomaton6@gmail.com>
This commit is contained in:
Alex Evgrashin
2022-02-19 22:16:49 +03:00
committed by GitHub
parent 162af7add5
commit 6eeaa81131
32 changed files with 347 additions and 61 deletions

View File

@@ -14,6 +14,8 @@ using Content.Server.Inventory;
using Content.Server.Mind.Commands;
using Content.Server.Mind.Components;
using Content.Server.Players;
using Content.Server.Xenoarchaeology.XenoArtifacts;
using Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Components;
using Content.Shared.Administration;
using Content.Shared.Body.Components;
using Content.Shared.Database;
@@ -47,6 +49,7 @@ namespace Content.Server.Administration
[Dependency] private readonly EuiManager _euiManager = default!;
[Dependency] private readonly ExplosionSystem _explosions = default!;
[Dependency] private readonly GhostRoleSystem _ghostRoleSystem = default!;
[Dependency] private readonly ArtifactSystem _artifactSystem = default!;
private readonly Dictionary<IPlayerSession, EditSolutionsEui> _openSolutionUis = new();
@@ -100,6 +103,29 @@ namespace Content.Server.Administration
});
}
// XenoArcheology
if (TryComp<ArtifactComponent>(args.Target, out var artifact))
{
// make artifact always active (by adding timer trigger)
args.Verbs.Add(new Verb()
{
Text = Loc.GetString("artifact-verb-make-always-active"),
Category = VerbCategory.Admin,
Act = () => EntityManager.AddComponent<ArtifactTimerTriggerComponent>(args.Target),
Disabled = EntityManager.HasComponent<ArtifactTimerTriggerComponent>(args.Target),
Impact = LogImpact.High
});
// force to activate artifact ignoring timeout
args.Verbs.Add(new Verb()
{
Text = Loc.GetString("artifact-verb-activate"),
Category = VerbCategory.Admin,
Act = () => _artifactSystem.ForceActivateArtifact(args.Target, component: artifact),
Impact = LogImpact.High
});
}
// TeleportTo
args.Verbs.Add(new Verb
{