From 48c7e71853887f29de7e77d399044a713d9608c9 Mon Sep 17 00:00:00 2001 From: FN Date: Tue, 30 Apr 2024 20:54:42 +0700 Subject: [PATCH 1/5] Fix TileSystem.PryTile --- Content.Shared/Maps/ContentTileDefinition.cs | 2 ++ Content.Shared/Maps/TileSystem.cs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/Content.Shared/Maps/ContentTileDefinition.cs b/Content.Shared/Maps/ContentTileDefinition.cs index a0c2ead1863..b925488259e 100644 --- a/Content.Shared/Maps/ContentTileDefinition.cs +++ b/Content.Shared/Maps/ContentTileDefinition.cs @@ -45,6 +45,8 @@ public sealed partial class ContentTileDefinition : IPrototype, IInheritingProto [DataField] public PrototypeFlags DeconstructTools { get; set; } = new(); + public bool CanCrowbar => DeconstructTools.Contains(PryingToolQuality); + // Delta V [DataField("canShovel")] public bool CanShovel { get; private set; } //Delta V diff --git a/Content.Shared/Maps/TileSystem.cs b/Content.Shared/Maps/TileSystem.cs index 87b2720cad5..d6006ac61a6 100644 --- a/Content.Shared/Maps/TileSystem.cs +++ b/Content.Shared/Maps/TileSystem.cs @@ -100,6 +100,9 @@ public bool PryTile(TileRef tileRef, bool pryPlating) var tileDef = (ContentTileDefinition) _tileDefinitionManager[tile.TypeId]; + if (!tileDef.CanCrowbar) + return false; + return DeconstructTile(tileRef); } // Delta V From 612b74cd92f9363cf3c8475e4fb579820a7bd96a Mon Sep 17 00:00:00 2001 From: FN Date: Tue, 30 Apr 2024 20:55:41 +0700 Subject: [PATCH 2/5] Fix formatting --- Content.Shared/Maps/TileSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Shared/Maps/TileSystem.cs b/Content.Shared/Maps/TileSystem.cs index d6006ac61a6..17bdd5acab4 100644 --- a/Content.Shared/Maps/TileSystem.cs +++ b/Content.Shared/Maps/TileSystem.cs @@ -86,7 +86,7 @@ public bool PryTile(Vector2i indices, EntityUid gridId) return PryTile(tileRef); } - public bool PryTile(TileRef tileRef) + public bool PryTile(TileRef tileRef) { return PryTile(tileRef, false); } From cfd8d2d0c603e736c7ff1c0ea62888a1e3f84e1a Mon Sep 17 00:00:00 2001 From: FN Date: Tue, 30 Apr 2024 23:30:33 +0700 Subject: [PATCH 3/5] Added debug command --- .../ArtifactActivatingDebugSystem.cs | 18 +++++++++++ .../SpawnThrowArtifactItemCommand.cs | 31 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 Content.Server/Corvax/ArtifactDebug/ArtifactActivatingDebugSystem.cs create mode 100644 Content.Server/Corvax/ArtifactDebug/SpawnThrowArtifactItemCommand.cs diff --git a/Content.Server/Corvax/ArtifactDebug/ArtifactActivatingDebugSystem.cs b/Content.Server/Corvax/ArtifactDebug/ArtifactActivatingDebugSystem.cs new file mode 100644 index 00000000000..4462cf24806 --- /dev/null +++ b/Content.Server/Corvax/ArtifactDebug/ArtifactActivatingDebugSystem.cs @@ -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(OnUseInHand); + } + + private void OnUseInHand(EntityUid entity, ThrowArtifactComponent component, UseInHandEvent e) + { + RaiseLocalEvent(entity, new()); + } +} diff --git a/Content.Server/Corvax/ArtifactDebug/SpawnThrowArtifactItemCommand.cs b/Content.Server/Corvax/ArtifactDebug/SpawnThrowArtifactItemCommand.cs new file mode 100644 index 00000000000..3b18a475a18 --- /dev/null +++ b/Content.Server/Corvax/ArtifactDebug/SpawnThrowArtifactItemCommand.cs @@ -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(console.Player.GetMind(), out var mind) || mind.CurrentEntity is null) + return; + + var entity = _manager.SpawnEntity("ToyNuke", new EntityCoordinates(mind.CurrentEntity.Value, new())); + + _manager.AddComponent(entity); + } +} From c72fdf8bef683cc43197d2176ccf97b18f5b0783 Mon Sep 17 00:00:00 2001 From: FN Date: Fri, 10 May 2024 22:35:23 +0700 Subject: [PATCH 4/5] Fixed artifact --- .../Corvax/ArtifactDebug/SpawnThrowArtifactItemCommand.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Server/Corvax/ArtifactDebug/SpawnThrowArtifactItemCommand.cs b/Content.Server/Corvax/ArtifactDebug/SpawnThrowArtifactItemCommand.cs index 3b18a475a18..660c2f18ea6 100644 --- a/Content.Server/Corvax/ArtifactDebug/SpawnThrowArtifactItemCommand.cs +++ b/Content.Server/Corvax/ArtifactDebug/SpawnThrowArtifactItemCommand.cs @@ -24,7 +24,7 @@ public void Execute(IConsoleShell console, string arg, string[] args) if (console.Player is null || !_manager.TryGetComponent(console.Player.GetMind(), out var mind) || mind.CurrentEntity is null) return; - var entity = _manager.SpawnEntity("ToyNuke", new EntityCoordinates(mind.CurrentEntity.Value, new())); + var entity = _manager.SpawnEntity("PlushieVulp", new EntityCoordinates(mind.CurrentEntity.Value, new())); _manager.AddComponent(entity); } From d1d9377899fb8b0a8ab201b15d847972128a5efe Mon Sep 17 00:00:00 2001 From: FN Date: Fri, 10 May 2024 22:36:02 +0700 Subject: [PATCH 5/5] Removed debug command --- .../ArtifactActivatingDebugSystem.cs | 18 ----------- .../SpawnThrowArtifactItemCommand.cs | 31 ------------------- 2 files changed, 49 deletions(-) delete mode 100644 Content.Server/Corvax/ArtifactDebug/ArtifactActivatingDebugSystem.cs delete mode 100644 Content.Server/Corvax/ArtifactDebug/SpawnThrowArtifactItemCommand.cs diff --git a/Content.Server/Corvax/ArtifactDebug/ArtifactActivatingDebugSystem.cs b/Content.Server/Corvax/ArtifactDebug/ArtifactActivatingDebugSystem.cs deleted file mode 100644 index 4462cf24806..00000000000 --- a/Content.Server/Corvax/ArtifactDebug/ArtifactActivatingDebugSystem.cs +++ /dev/null @@ -1,18 +0,0 @@ -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(OnUseInHand); - } - - private void OnUseInHand(EntityUid entity, ThrowArtifactComponent component, UseInHandEvent e) - { - RaiseLocalEvent(entity, new()); - } -} diff --git a/Content.Server/Corvax/ArtifactDebug/SpawnThrowArtifactItemCommand.cs b/Content.Server/Corvax/ArtifactDebug/SpawnThrowArtifactItemCommand.cs deleted file mode 100644 index 660c2f18ea6..00000000000 --- a/Content.Server/Corvax/ArtifactDebug/SpawnThrowArtifactItemCommand.cs +++ /dev/null @@ -1,31 +0,0 @@ -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(console.Player.GetMind(), out var mind) || mind.CurrentEntity is null) - return; - - var entity = _manager.SpawnEntity("PlushieVulp", new EntityCoordinates(mind.CurrentEntity.Value, new())); - - _manager.AddComponent(entity); - } -}