This repository has been archived by the owner on Nov 1, 2024. It is now read-only.
forked from new-frontiers-14/frontier-station-14
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
612b74c
commit cfd8d2d
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
Content.Server/Corvax/ArtifactDebug/ArtifactActivatingDebugSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components; | ||
using Content.Server.Xenoarchaeology.XenoArtifacts.Events; | ||
using Content.Shared.Interaction.Events; | ||
|
||
namespace Content.Server.Corvax.Debug; | ||
|
||
public sealed class ArtifactActivatingDebugSystem : EntitySystem | ||
{ | ||
public override void Initialize() | ||
{ | ||
SubscribeLocalEvent<ThrowArtifactComponent, UseInHandEvent>(OnUseInHand); | ||
} | ||
|
||
private void OnUseInHand(EntityUid entity, ThrowArtifactComponent component, UseInHandEvent e) | ||
{ | ||
RaiseLocalEvent<ArtifactActivatedEvent>(entity, new()); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
Content.Server/Corvax/ArtifactDebug/SpawnThrowArtifactItemCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using Content.Server.Administration; | ||
using Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components; | ||
using Content.Shared.Administration; | ||
using Content.Shared.Mind; | ||
using Content.Shared.Players; | ||
using Robust.Shared.Console; | ||
using Robust.Shared.Map; | ||
|
||
namespace Content.Server.Corvax.Debug; | ||
|
||
[AdminCommand(AdminFlags.Debug)] | ||
public sealed class SpawnThrowArtifactItemCommand : IConsoleCommand | ||
{ | ||
[Dependency] private readonly EntityManager _manager = default!; | ||
|
||
public string Command => "spawnthrowartifactitem"; | ||
|
||
public string Description => "Spawns item that can emit ThrowArtifact."; | ||
|
||
public string Help => $"Usage: {Command}"; | ||
|
||
public void Execute(IConsoleShell console, string arg, string[] args) | ||
{ | ||
if (console.Player is null || !_manager.TryGetComponent<MindComponent>(console.Player.GetMind(), out var mind) || mind.CurrentEntity is null) | ||
return; | ||
|
||
var entity = _manager.SpawnEntity("ToyNuke", new EntityCoordinates(mind.CurrentEntity.Value, new())); | ||
|
||
_manager.AddComponent<ThrowArtifactComponent>(entity); | ||
} | ||
} |