diff --git a/Content.Shared/Maps/ContentTileDefinition.cs b/Content.Shared/Maps/ContentTileDefinition.cs index 7c3d1e4304..6739fb2335 100644 --- a/Content.Shared/Maps/ContentTileDefinition.cs +++ b/Content.Shared/Maps/ContentTileDefinition.cs @@ -75,6 +75,11 @@ namespace Content.Shared.Maps /// [DataField("weather")] public bool Weather = false; + /// + /// Is this tile immune to RCD deconstruct. + /// + [DataField("indestructible")] public bool Indestructible = false; + public void AssignTileId(ushort id) { TileId = id; diff --git a/Content.Shared/RCD/Systems/RCDSystem.cs b/Content.Shared/RCD/Systems/RCDSystem.cs index 9bab9c6a4d..2e923ec985 100644 --- a/Content.Shared/RCD/Systems/RCDSystem.cs +++ b/Content.Shared/RCD/Systems/RCDSystem.cs @@ -237,14 +237,25 @@ public sealed class RCDSystem : EntitySystem if (tile.Tile.IsEmpty) return false; - //They tried to decon a turf but the turf is blocked - if (target == null && IsTileBlocked(tile)) + //They tried to decon a turf but... + if (target == null) { - _popup.PopupClient(Loc.GetString("rcd-component-tile-obstructed-message"), uid, user); - return false; + // the turf is blocked + if (IsTileBlocked(tile)) + { + _popup.PopupClient(Loc.GetString("rcd-component-tile-obstructed-message"), uid, user); + return false; + } + // the turf can't be destroyed (planet probably) + var tileDef = (ContentTileDefinition) _tileDefMan[tile.Tile.TypeId]; + if (tileDef.Indestructible) + { + _popup.PopupClient(Loc.GetString("rcd-component-tile-indestructible-message"), uid, user); + return false; + } } //They tried to decon a non-turf but it's not in the whitelist - if (target != null && !_tag.HasTag(target.Value, "RCDDeconstructWhitelist")) + else if (!_tag.HasTag(target.Value, "RCDDeconstructWhitelist")) { _popup.PopupClient(Loc.GetString("rcd-component-deconstruct-target-not-on-whitelist-message"), uid, user); return false; diff --git a/Resources/Locale/en-US/rcd/components/rcd-component.ftl b/Resources/Locale/en-US/rcd/components/rcd-component.ftl index 00ca3fa262..b7920c9ede 100644 --- a/Resources/Locale/en-US/rcd/components/rcd-component.ftl +++ b/Resources/Locale/en-US/rcd/components/rcd-component.ftl @@ -11,6 +11,7 @@ rcd-component-change-mode = The RCD is now set to {$mode} mode. rcd-component-no-ammo-message = The RCD is out of ammo! rcd-component-tile-obstructed-message = That tile is obstructed! +rcd-component-tile-indestructible-message = That tile can't be destroyed! rcd-component-deconstruct-target-not-on-whitelist-message = You can't deconstruct that! rcd-component-cannot-build-floor-tile-not-empty-message = You can only build a floor on space! rcd-component-cannot-build-wall-tile-not-empty-message = You cannot build a wall on space! diff --git a/Resources/Prototypes/Tiles/planet.yml b/Resources/Prototypes/Tiles/planet.yml index 2b18eb7649..e82ffa57bd 100644 --- a/Resources/Prototypes/Tiles/planet.yml +++ b/Resources/Prototypes/Tiles/planet.yml @@ -8,6 +8,7 @@ collection: FootstepAsteroid heatCapacity: 10000 weather: true + indestructible: true # Desert - type: tile @@ -22,6 +23,7 @@ collection: FootstepAsteroid heatCapacity: 10000 weather: true + indestructible: true - type: tile id: FloorLowDesert @@ -35,6 +37,7 @@ collection: FootstepAsteroid heatCapacity: 10000 weather: true + indestructible: true # Grass - type: tile @@ -60,6 +63,7 @@ itemDrop: FloorTileItemGrass heatCapacity: 10000 weather: true + indestructible: true # Lava - type: tile @@ -72,6 +76,7 @@ collection: FootstepAsteroid heatCapacity: 10000 weather: true + indestructible: true # Snow - type: tile @@ -91,5 +96,6 @@ friction: 0.20 heatCapacity: 10000 weather: true + indestructible: true # Wasteland