diff --git a/Content.Client/Construction/ConstructionMenu.cs b/Content.Client/Construction/ConstructionMenu.cs index de5f0ee049..8b7481326e 100644 --- a/Content.Client/Construction/ConstructionMenu.cs +++ b/Content.Client/Construction/ConstructionMenu.cs @@ -250,6 +250,9 @@ namespace Content.Client.Construction case StackType.Cable: return _resourceCache.GetTexture("/Textures/Objects/Tools/cables.rsi/coil-30.png"); + case StackType.MetalRod: + return _resourceCache.GetTexture("/Textures/Objects/Materials/materials.rsi/rods.png"); + } break; diff --git a/Content.Server/Construction/Completions/SetStackCount.cs b/Content.Server/Construction/Completions/SetStackCount.cs new file mode 100644 index 0000000000..3879e92a5e --- /dev/null +++ b/Content.Server/Construction/Completions/SetStackCount.cs @@ -0,0 +1,36 @@ +#nullable enable +using System.Threading.Tasks; +using Content.Server.GameObjects.Components.Stack; +using Content.Shared.Construction; +using JetBrains.Annotations; +using Robust.Shared.Interfaces.GameObjects; +using System; +using Robust.Shared.Log; +using Robust.Shared.Serialization; + +namespace Content.Server.Construction.Completions +{ + [UsedImplicitly] + public class SetStackCount : IGraphAction + { + public int Amount { get; private set; } + + public void ExposeData(ObjectSerializer serializer) + { + serializer.DataField(this, x => x.Amount, "amount", 1); + } + + public async Task PerformAction(IEntity entity, IEntity? user) + { + if (entity.Deleted) return; + if(!entity.TryGetComponent(out StackComponent? stackComponent)) return; + + stackComponent.Count = Math.Min(stackComponent.MaxCount, Amount); + + if (Amount > stackComponent.MaxCount) + { + Logger.Warning("StackCount is bigger than maximum stack capacity, for entity " + entity.Name); + } + } + } +} diff --git a/Content.Server/Construction/Completions/SpawnPrototype.cs b/Content.Server/Construction/Completions/SpawnPrototype.cs index 0752b83c26..30e891bed6 100644 --- a/Content.Server/Construction/Completions/SpawnPrototype.cs +++ b/Content.Server/Construction/Completions/SpawnPrototype.cs @@ -1,6 +1,9 @@ #nullable enable +using System; using System.Threading.Tasks; +using Content.Server.GameObjects.Components.Stack; using Content.Shared.Construction; +using Content.Shared.Utility; using JetBrains.Annotations; using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.IoC; @@ -20,6 +23,7 @@ namespace Content.Server.Construction.Completions serializer.DataField(this, x => x.Amount, "amount", 1); } + public async Task PerformAction(IEntity entity, IEntity? user) { if (entity.Deleted || string.IsNullOrEmpty(Prototype)) return; @@ -27,10 +31,21 @@ namespace Content.Server.Construction.Completions var entityManager = IoCManager.Resolve(); var coordinates = entity.Transform.Coordinates; - for (var i = 0; i < Amount; i++) + if (EntityPrototypeHelpers.HasComponent(Prototype)) { - entityManager.SpawnEntity(Prototype, coordinates); + var _entity = entityManager.SpawnEntity(Prototype, coordinates); + StackComponent stackComponent = _entity.GetComponent(); + + stackComponent.Count = Math.Min(stackComponent.MaxCount, Amount); } + else + { + for (var i = 0; i < Amount; i++) + { + entityManager.SpawnEntity(Prototype, coordinates); + } + } + } } } diff --git a/Content.Server/Construction/Conditions/DoorWelded.cs b/Content.Server/Construction/Conditions/DoorWelded.cs new file mode 100644 index 0000000000..1eb3267bee --- /dev/null +++ b/Content.Server/Construction/Conditions/DoorWelded.cs @@ -0,0 +1,42 @@ +using System.Threading.Tasks; +using Content.Server.GameObjects.Components.Atmos; +using Content.Server.GameObjects.Components.Doors; +using Content.Shared.Construction; +using JetBrains.Annotations; +using Robust.Shared.GameObjects.Components; +using Robust.Shared.Interfaces.GameObjects; +using Robust.Shared.Localization; +using Robust.Shared.Log; +using Robust.Shared.Serialization; +using Robust.Shared.Utility; + +namespace Content.Server.Construction.Conditions +{ + [UsedImplicitly] + public class DoorWelded : IEdgeCondition + { + public bool Welded { get; private set; } + public void ExposeData(ObjectSerializer serializer) + { + serializer.DataField(this, x => x.Welded, "welded", true); + } + + public async Task Condition(IEntity entity) + { + if (!entity.TryGetComponent(out ServerDoorComponent doorComponent)) return false; + return doorComponent.IsWeldedShut == Welded; + } + + public void DoExamine(IEntity entity, FormattedMessage message, bool inDetailsRange) + { + if (!entity.TryGetComponent(out ServerDoorComponent doorComponent)) return; + + if (doorComponent.State == ServerDoorComponent.DoorState.Closed && Welded) + message.AddMarkup(Loc.GetString("First, weld the door.\n")); + else if (doorComponent.IsWeldedShut && !Welded) + { + message.AddMarkup(Loc.GetString("First, unweld the door.\n")); + } + } + } +} diff --git a/Content.Server/GameObjects/Components/Atmos/FirelockComponent.cs b/Content.Server/GameObjects/Components/Atmos/FirelockComponent.cs index 5724e64a4c..5a8fd241f4 100644 --- a/Content.Server/GameObjects/Components/Atmos/FirelockComponent.cs +++ b/Content.Server/GameObjects/Components/Atmos/FirelockComponent.cs @@ -13,6 +13,7 @@ using Robust.Shared.Interfaces.GameObjects; namespace Content.Server.GameObjects.Components.Atmos { [RegisterComponent] + [ComponentReference(typeof(ServerDoorComponent))] public class FirelockComponent : ServerDoorComponent, IInteractUsing, ICollideBehavior { public override string Name => "Firelock"; @@ -68,30 +69,38 @@ namespace Content.Server.GameObjects.Components.Atmos public override async Task InteractUsing(InteractUsingEventArgs eventArgs) { + if (await base.InteractUsing(eventArgs)) + return false; + if (!eventArgs.Using.TryGetComponent(out var tool)) return false; - if (tool.HasQuality(ToolQuality.Prying)) + if (tool.HasQuality(ToolQuality.Prying) && !IsWeldedShut) { var holdingPressure = IsHoldingPressure(); var holdingFire = IsHoldingFire(); if (State == DoorState.Closed) { - if(holdingPressure) + if (holdingPressure) Owner.PopupMessage(eventArgs.User, "A gush of air blows in your face... Maybe you should reconsider."); } - if (!await tool.UseTool(eventArgs.User, Owner, holdingPressure || holdingFire ? 1.5f : 0.25f, ToolQuality.Prying)) return false; - + if (IsWeldedShut || !await tool.UseTool(eventArgs.User, Owner, holdingPressure || holdingFire ? 1.5f : 0.25f, ToolQuality.Prying)) return false; if (State == DoorState.Closed) + { Open(); + } else if (State == DoorState.Open) + { Close(); + } + return true; } + return false; } } diff --git a/Content.Server/GameObjects/Components/Items/FirelockElectronics.cs b/Content.Server/GameObjects/Components/Items/FirelockElectronics.cs new file mode 100644 index 0000000000..88b5fc2e53 --- /dev/null +++ b/Content.Server/GameObjects/Components/Items/FirelockElectronics.cs @@ -0,0 +1,11 @@ +using Robust.Shared.GameObjects; + + +namespace Content.Server.GameObjects.Components.Items +{ + [RegisterComponent] + class FirelockElectronics : Component + { + public override string Name => "FirelockElectronics"; + } +} diff --git a/Content.Server/GameObjects/Components/Items/FloorTileItemComponent.cs b/Content.Server/GameObjects/Components/Items/FloorTileItemComponent.cs index a9df905b61..cf504d52c6 100644 --- a/Content.Server/GameObjects/Components/Items/FloorTileItemComponent.cs +++ b/Content.Server/GameObjects/Components/Items/FloorTileItemComponent.cs @@ -11,6 +11,7 @@ using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Serialization; +using System.Collections.Generic; namespace Content.Server.GameObjects.Components.Items { @@ -18,15 +19,15 @@ namespace Content.Server.GameObjects.Components.Items public class FloorTileItemComponent : Component, IAfterInteract { [Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!; - [Dependency] private readonly IMapManager _mapManager = default!; public override string Name => "FloorTile"; - private string _outputTile; + private List _outputTiles; + public override void ExposeData(ObjectSerializer serializer) { base.ExposeData(serializer); - serializer.DataField(ref _outputTile, "output", "floor_steel"); + serializer.DataField(ref _outputTiles, "outputs", null); } public override void Initialize() @@ -58,31 +59,38 @@ namespace Content.Server.GameObjects.Components.Items { if (!eventArgs.InRangeUnobstructed(ignoreInsideBlocker: true, popup: true)) return; if (!Owner.TryGetComponent(out StackComponent stack)) return; + var mapManager = IoCManager.Resolve(); var location = eventArgs.ClickLocation.AlignWithClosestGridTile(); var locationMap = location.ToMap(Owner.EntityManager); - - var desiredTile = (ContentTileDefinition)_tileDefinitionManager[_outputTile]; - - if (_mapManager.TryGetGrid(location.GetGridId(Owner.EntityManager), out var mapGrid)) + mapManager.TryGetGrid(location.GetGridId(Owner.EntityManager), out var mapGrid); + foreach (var currentTile in _outputTiles) { - var tile = mapGrid.GetTileRef(location); - var baseTurf = (ContentTileDefinition)_tileDefinitionManager[tile.Tile.TypeId]; + var currentTileDefinition = (ContentTileDefinition) _tileDefinitionManager[currentTile]; - if (HasBaseTurf(desiredTile, baseTurf.Name) && eventArgs.Target == null && stack.Use(1)) + if (mapGrid != null) { - PlaceAt(mapGrid, location, desiredTile.TileId); + var tile = mapGrid.GetTileRef(location); + var baseTurf = (ContentTileDefinition) _tileDefinitionManager[tile.Tile.TypeId]; + + if (HasBaseTurf(currentTileDefinition, baseTurf.Name) && stack.Use(1)) + { + PlaceAt(mapGrid, location, currentTileDefinition.TileId); + break; + } } - } - else if(HasBaseTurf(desiredTile, "space")) - { - mapGrid = _mapManager.CreateGrid(locationMap.MapId); - mapGrid.WorldPosition = locationMap.Position; - location = new EntityCoordinates(mapGrid.GridEntityId, Vector2.Zero); - PlaceAt(mapGrid, location, desiredTile.TileId, mapGrid.TileSize/2f); + else if (HasBaseTurf(currentTileDefinition, "space")) + { + mapGrid = mapManager.CreateGrid(locationMap.MapId); + mapGrid.WorldPosition = locationMap.Position; + location = new EntityCoordinates(mapGrid.GridEntityId, Vector2.Zero); + PlaceAt(mapGrid, location, _tileDefinitionManager[_outputTiles[0]].TileId, mapGrid.TileSize / 2f); + break; + } + + } } - } } diff --git a/Content.Server/GameObjects/Components/PlaceableSurfaceComponent.cs b/Content.Server/GameObjects/Components/PlaceableSurfaceComponent.cs index 056aba614f..34e40e69d5 100644 --- a/Content.Server/GameObjects/Components/PlaceableSurfaceComponent.cs +++ b/Content.Server/GameObjects/Components/PlaceableSurfaceComponent.cs @@ -32,7 +32,7 @@ namespace Content.Server.GameObjects.Components } [ViewVariables] - int IInteractUsing.Priority => 1; + int IInteractUsing.Priority => -10; public override void ExposeData(ObjectSerializer serializer) { diff --git a/Content.Shared/Construction/ConstructionConditions/TileType.cs b/Content.Shared/Construction/ConstructionConditions/TileType.cs new file mode 100644 index 0000000000..e7e16240b5 --- /dev/null +++ b/Content.Shared/Construction/ConstructionConditions/TileType.cs @@ -0,0 +1,40 @@ +using Content.Shared.Maps; +using JetBrains.Annotations; +using Robust.Shared.Interfaces.GameObjects; +using Robust.Shared.Map; +using Robust.Shared.Maths; +using Robust.Shared.Serialization; +using System.Collections.Generic; + +namespace Content.Shared.Construction.ConstructionConditions +{ + [UsedImplicitly] + public class TileType : IConstructionCondition + { + + public List TargetTiles { get; private set; } + public void ExposeData(ObjectSerializer serializer) + { + serializer.DataField(this, x => x.TargetTiles, "targets", null); + } + + public bool Condition(IEntity user, EntityCoordinates location, Direction direction) + { + if (TargetTiles == null) return true; + + var tileFound = location.GetTileRef(); + + if (tileFound == null) + return false; + + var tile = TurfHelpers.GetContentTileDefinition(tileFound.Value.Tile); + foreach (var targetTile in TargetTiles) + { + if (tile.Name == targetTile) { + return true; + } + } + return false; + } + } +} diff --git a/Content.Shared/GameObjects/Components/SharedStackComponent.cs b/Content.Shared/GameObjects/Components/SharedStackComponent.cs index f1867d291e..a70af9a823 100644 --- a/Content.Shared/GameObjects/Components/SharedStackComponent.cs +++ b/Content.Shared/GameObjects/Components/SharedStackComponent.cs @@ -125,6 +125,7 @@ namespace Content.Shared.GameObjects.Components { Metal, Glass, + ReinforcedGlass, Plasteel, Cable, Wood, @@ -139,6 +140,7 @@ namespace Content.Shared.GameObjects.Components FloorTileCarpet, FloorTileWhite, FloorTileDark, - FloorTileWood + FloorTileWood, + MetalRod } } diff --git a/Content.Shared/Maps/TurfHelpers.cs b/Content.Shared/Maps/TurfHelpers.cs index 3da39ad24a..da3f322c57 100644 --- a/Content.Shared/Maps/TurfHelpers.cs +++ b/Content.Shared/Maps/TurfHelpers.cs @@ -54,11 +54,13 @@ namespace Content.Shared.Maps if (!coordinates.IsValid(entityManager)) return null; + mapManager ??= IoCManager.Resolve(); if (!mapManager.TryGetGrid(coordinates.GetGridId(entityManager), out var grid)) return null; + if (!grid.TryGetTileRef(coordinates, out var tile)) return null; diff --git a/Resources/Prototypes/Entities/Constructible/Doors/firelock.yml b/Resources/Prototypes/Entities/Constructible/Doors/firelock.yml index 3da88aa3f5..a9bd8b3f3d 100644 --- a/Resources/Prototypes/Entities/Constructible/Doors/firelock.yml +++ b/Resources/Prototypes/Entities/Constructible/Doors/firelock.yml @@ -58,6 +58,10 @@ enabled: false - type: SnapGrid offset: Center + - type: Construction + graph: Firelock + node: Firelock + placement: mode: SnapgridCenter diff --git a/Resources/Prototypes/Entities/Constructible/Doors/firelock_frame.yml b/Resources/Prototypes/Entities/Constructible/Doors/firelock_frame.yml new file mode 100644 index 0000000000..e4d8931124 --- /dev/null +++ b/Resources/Prototypes/Entities/Constructible/Doors/firelock_frame.yml @@ -0,0 +1,25 @@ +- type: entity + id: FirelockFrame + name: Firelock Frame + description: That is a firelock frame. + components: + - type: Sprite + sprite: Constructible/Structures/Doors/firelock.rsi + state: frame1 + - type: Construction + graph: Firelock + node: frame1 + - type: Clickable + - type: InteractionOutline + - type: Physics + shapes: + - !type:PhysShapeAabb + bounds: "-0.49,-0.49,0.49,0.49" + mask: + - Impassable + layer: + - Opaque + - Impassable + - MobImpassable + - VaultImpassable + - SmallImpassable diff --git a/Resources/Prototypes/Entities/Constructible/Furniture/tables.yml b/Resources/Prototypes/Entities/Constructible/Furniture/tables.yml index 41e388ba4b..16651ae08a 100644 --- a/Resources/Prototypes/Entities/Constructible/Furniture/tables.yml +++ b/Resources/Prototypes/Entities/Constructible/Furniture/tables.yml @@ -1,4 +1,4 @@ -- type: entity +- type: entity id: TableBase name: "table" description: A square piece of metal standing on four metal legs. @@ -62,6 +62,9 @@ SteelSheet1: Min: 1 Max: 1 + - type: Construction + graph: Tables + node: TableFrame - type: entity id: TableBar @@ -100,6 +103,9 @@ SteelSheet1: Min: 1 Max: 1 + - type: Construction + graph: Tables + node: MetalTable - type: entity id: TableR @@ -119,6 +125,9 @@ SteelSheet1: Min: 1 Max: 1 + - type: Construction + graph: Tables + node: ReinforcedTable - type: entity id: TableGlass @@ -138,6 +147,9 @@ ShardGlass: Min: 1 Max: 1 + - type: Construction + graph: Tables + node: GlassTable - type: entity id: TableGlassR @@ -157,6 +169,9 @@ ShardGlass: Min: 1 Max: 1 + - type: Construction + graph: Tables + node: RGlassTable - type: entity id: TableWood @@ -176,6 +191,9 @@ WoodPlank: Min: 1 Max: 1 + - type: Construction + graph: Tables + node: WoodTable - type: entity id: TableCarpet @@ -195,6 +213,9 @@ WoodPlank: Min: 1 Max: 1 + - type: Construction + graph: Tables + node: PokerTable - type: entity id: TableStone diff --git a/Resources/Prototypes/Entities/Constructible/Ground/catwalk.yml b/Resources/Prototypes/Entities/Constructible/Ground/catwalk.yml index 5f7993755c..b37a374bbe 100644 --- a/Resources/Prototypes/Entities/Constructible/Ground/catwalk.yml +++ b/Resources/Prototypes/Entities/Constructible/Ground/catwalk.yml @@ -23,3 +23,6 @@ key: catwalk base: catwalk_ - type: Catwalk + - type: Construction + graph: Catwalk + node: Catwalk diff --git a/Resources/Prototypes/Entities/Constructible/Items/metal_rod.yml b/Resources/Prototypes/Entities/Constructible/Items/metal_rod.yml new file mode 100644 index 0000000000..9ed9af1a4e --- /dev/null +++ b/Resources/Prototypes/Entities/Constructible/Items/metal_rod.yml @@ -0,0 +1,35 @@ +- type: entity + name: Metal Rod + parent: BaseItem + id: MetalRod + suffix: full + components: + - type: Sprite + sprite: Objects/Materials/materials.rsi + state: rods + - type: Item + size: 24 + icon: + sprite: /Textures/Constructible/Structures/Walls/materials.rsi + state: rods + prefix: inhand + - type: Construction + graph: metalRod + node: MetalRod + - type: Stack + stacktype: enum.StackType.MetalRod + count: 50 + max: 50 + - type: FloorTile + outputs: + - lattice + - floor_reinforced + +- type: entity + parent: MetalRod + id: MetalRodStack1 + components: + - type: Stack + stacktype: enum.StackType.MetalRod + count: 1 + max: 50 diff --git a/Resources/Prototypes/Entities/Constructible/Power/power_base.yml b/Resources/Prototypes/Entities/Constructible/Power/power_base.yml index a39c8d9568..3b35c9b988 100644 --- a/Resources/Prototypes/Entities/Constructible/Power/power_base.yml +++ b/Resources/Prototypes/Entities/Constructible/Power/power_base.yml @@ -187,6 +187,9 @@ interfaces: - key: enum.ApcUiKey.Key type: ApcBoundUserInterface + - type: Construction + graph: apc + node: apc - type: entity id: SolarPanel diff --git a/Resources/Prototypes/Entities/Objects/Misc/apc_electronics.yml b/Resources/Prototypes/Entities/Objects/Misc/apc_electronics.yml new file mode 100644 index 0000000000..e0f70e9a87 --- /dev/null +++ b/Resources/Prototypes/Entities/Objects/Misc/apc_electronics.yml @@ -0,0 +1,9 @@ +- type: entity + id: APCElectronics + parent: BaseItem + name: APC Electronics + description: Circuit used in APC construction. + components: + - type: Sprite + sprite: Constructible/Misc/module.rsi + state: charger_APC diff --git a/Resources/Prototypes/Entities/Objects/Misc/firelock_electronics.yml b/Resources/Prototypes/Entities/Objects/Misc/firelock_electronics.yml new file mode 100644 index 0000000000..88df2eb6dd --- /dev/null +++ b/Resources/Prototypes/Entities/Objects/Misc/firelock_electronics.yml @@ -0,0 +1,10 @@ +- type: entity + id: FirelockElectronics + parent: BaseItem + name: Firelock Electronics + description: Advanced circuit board used to detect differences in pressure, temperature and gas concentrations between the two sides of the door. + components: + - type: Sprite + sprite: Constructible/Misc/module.rsi + state: mainboard + - type: FirelockElectronics diff --git a/Resources/Prototypes/Entities/Objects/materials.yml b/Resources/Prototypes/Entities/Objects/materials.yml index ce955eae16..a1d7a55269 100644 --- a/Resources/Prototypes/Entities/Objects/materials.yml +++ b/Resources/Prototypes/Entities/Objects/materials.yml @@ -26,6 +26,9 @@ - type: Item sprite: Objects/Materials/sheets.rsi HeldPrefix: metal + - type: FloorTile + outputs: + - underplating - type: entity id: SteelSheet1 @@ -66,6 +69,36 @@ stacktype: enum.StackType.Glass count: 1 +- type: entity + name: Reinforced Glass + parent: MaterialStack + id: rglass + suffix: Full + components: + - type: Material + materials: + - key: enum.MaterialKeys.Stack + mat: rglass + - type: Stack + stacktype: enum.StackType.ReinforcedGlass + - type: Sprite + sprite: Objects/Materials/sheets.rsi + state: rglass + - type: Item + sprite: Objects/Materials/sheets.rsi + HeldPrefix: rglass + +- type: entity + name: Reinforced Glass sheet + id: RGlassSheet1 + parent: rglass + suffix: 1 + components: + - type: Stack + StackType: enum.StackType.ReinforcedGlass + count: 1 + + - type: entity name: plasteel sheet id: PlasteelStack diff --git a/Resources/Prototypes/Entities/Objects/tiles.yml b/Resources/Prototypes/Entities/Objects/tiles.yml index 5c2fa2e9a5..710426f140 100644 --- a/Resources/Prototypes/Entities/Objects/tiles.yml +++ b/Resources/Prototypes/Entities/Objects/tiles.yml @@ -1,4 +1,4 @@ -- type: entity +- type: entity parent: BaseItem id: FloorTileItemBase description: These could work as a pretty decent throwing weapon. @@ -8,7 +8,9 @@ sprite: Objects/Tiles/tile.rsi state: tile_steel - type: FloorTile - output: floor_steel + outputs: + - plating + - floor_steel - type: Stack stacktype: FloorTileSteel count: 1 @@ -35,7 +37,9 @@ sprite: Objects/Tiles/tile.rsi HeldPrefix: tile_wood - type: FloorTile - output: floor_wood + outputs: + - plating + - floor_wood - type: Stack stacktype: FloorTileWood count: 1 @@ -53,7 +57,9 @@ sprite: Objects/Tiles/tile.rsi HeldPrefix: tile_white - type: FloorTile - output: floor_white + outputs: + - plating + - floor_white - type: Stack stacktype: FloorTileWhite count: 1 @@ -71,7 +77,9 @@ sprite: Objects/Tiles/tile.rsi HeldPrefix: tile_dark - type: FloorTile - output: floor_dark + outputs: + - plating + - floor_dark - type: Stack stacktype: FloorTileDark count: 1 @@ -89,7 +97,9 @@ sprite: Objects/Tiles/tile.rsi HeldPrefix: tile_dark - type: FloorTile - output: floor_techmaint + outputs: + - plating + - floor_techmaint - type: entity name: floor tile freezer @@ -103,7 +113,9 @@ sprite: Objects/Tiles/tile.rsi HeldPrefix: tile_showroom - type: FloorTile - output: floor_freezer + outputs: + - plating + - floor_freezer - type: entity name: floor tile showroom @@ -117,7 +129,9 @@ sprite: Objects/Tiles/tile.rsi HeldPrefix: tile_showroom - type: FloorTile - output: floor_showroom + outputs: + - plating + - floor_showroom - type: entity name: floor tile snow @@ -131,7 +145,9 @@ sprite: Objects/Tiles/tile.rsi HeldPrefix: tile_silver - type: FloorTile - output: floor_snow + outputs: + - plating + - floor_snow - type: entity name: floor tile green circuit @@ -145,7 +161,9 @@ sprite: Objects/Tiles/tile.rsi HeldPrefix: tile_silver - type: FloorTile - output: floor_green_circuit + outputs: + - plating + - floor_green_circuit - type: entity name: floor tile gold @@ -159,7 +177,9 @@ sprite: Objects/Tiles/tile.rsi HeldPrefix: tile_gold - type: FloorTile - output: floor_gold + outputs: + - plating + - floor_gold - type: entity name: floor tile reinforced @@ -173,7 +193,9 @@ sprite: Objects/Tiles/tile.rsi HeldPrefix: tile_reinforced - type: FloorTile - output: floor_reinforced + outputs: + - plating + - floor_reinforced - type: entity name: floor tile rock @@ -187,7 +209,9 @@ sprite: Objects/Tiles/tile.rsi HeldPrefix: tile_steel - type: FloorTile - output: floor_rockvault + outputs: + - plating + - floor_rockvault - type: entity name: floor tile mono @@ -201,7 +225,9 @@ sprite: Objects/Tiles/tile.rsi HeldPrefix: tile_steel - type: FloorTile - output: floor_mono + outputs: + - plating + - floor_mono - type: entity name: floor tile linoleum @@ -215,7 +241,9 @@ sprite: Objects/Tiles/tile.rsi HeldPrefix: tile_steel - type: FloorTile - output: floor_lino + outputs: + - plating + - floor_lino - type: entity name: floor tile asteroid @@ -229,7 +257,9 @@ sprite: Objects/Tiles/tile.rsi HeldPrefix: tile_brown - type: FloorTile - output: floor_asteroid_tile + outputs: + - plating + - floor_asteroid_tile - type: entity name: floor tile hydro @@ -243,7 +273,9 @@ sprite: Objects/Tiles/tile.rsi HeldPrefix: tile_hydro - type: FloorTile - output: floor_hydro + outputs: + - plating + - floor_hydro - type: entity name: floor tile dirty @@ -257,4 +289,6 @@ sprite: Objects/Tiles/tile.rsi HeldPrefix: tile_brown - type: FloorTile - output: floor_steel_dirty + outputs: + - plating + - floor_steel_dirty diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/APC.yml b/Resources/Prototypes/Recipes/Construction/Graphs/APC.yml new file mode 100644 index 0000000000..b36718ef3c --- /dev/null +++ b/Resources/Prototypes/Recipes/Construction/Graphs/APC.yml @@ -0,0 +1,13 @@ +- type: constructionGraph + id: apc + start: start + graph: + - node: start + edges: + - to: apc + steps: + - material: Metal + amount: 3 + + - node: apc + entity: BaseAPC diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/catwalk.yml b/Resources/Prototypes/Recipes/Construction/Graphs/catwalk.yml new file mode 100644 index 0000000000..a218cf8e4c --- /dev/null +++ b/Resources/Prototypes/Recipes/Construction/Graphs/catwalk.yml @@ -0,0 +1,24 @@ +- type: constructionGraph + id: Catwalk + start: start + graph: + - node: start + edges: + - to: Catwalk + completed: + - !type:SnapToGrid { } + steps: + - material: MetalRod + amount: 2 + + - node: Catwalk + entity: Catwalk + edges: + - to: start + completed: + - !type:SpawnPrototype + prototype: MetalRodStack1 + amount: 2 + - !type:DeleteEntity {} + steps: + - tool: Cutting diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/firelock.yml b/Resources/Prototypes/Recipes/Construction/Graphs/firelock.yml new file mode 100644 index 0000000000..017f099970 --- /dev/null +++ b/Resources/Prototypes/Recipes/Construction/Graphs/firelock.yml @@ -0,0 +1,166 @@ +- type: constructionGraph + id: Firelock + start: start + graph: + - node: start + edges: + - to: frame1 + completed: + - !type:SnapToGrid { } + steps: + - material: Metal + amount: 3 + doAfter: 1 + + + - node: frame1 + entity: FirelockFrame + actions: + - !type:SpriteStateChange + state: frame1 + edges: + - to: frame2 + conditions: + - !type:EntityAnchored + anchored: true + steps: + - material: Cable + amount: 2 + doAfter: 1 + - to: start + completed: + - !type:SpawnPrototype + prototype: SteelSheet1 + amount: 3 + - !type:DeleteEntity {} + conditions: + - !type:EntityAnchored + anchored: true + steps: + - tool: Welding + doAfter: 1 + + - node: frame2 + actions: + - !type:SpriteStateChange + state: frame2 + edges: + - to: frame3 + conditions: + - !type:EntityAnchored + anchored: true + steps: + - component: FirelockElectronics + store: Firelock Electornics + name: Firelock Electornics + icon: + sprite: "Constructible/Misc/module.rsi" + state: "mainboard" + + - to: frame1 + completed: + - !type:SpawnPrototype + prototype: ApcExtensionCableStack1 + amount: 2 + conditions: + - !type:EntityAnchored + anchored: true + steps: + - tool: Cutting + doAfter: 1.5 + + - node: frame3 + actions: + - !type:SpriteStateChange + state: frame3 + edges: + - to: frame4 + conditions: + - !type:EntityAnchored + anchored: true + steps: + - tool: Screwing + doAfter: 0.25 + - to: frame2 + completed: + - !type:SpawnPrototype + prototype: FirelockElectronics + amount: 1 + conditions: + - !type:EntityAnchored + anchored: true + steps: + - tool: Prying + doAfter: 0.25 + + - node: frame4 + entity: FirelockFrame + actions: + - !type:SpriteStateChange + state: frame4 + edges: + - to: Firelock + conditions: + - !type:EntityAnchored + anchored: true + steps: + - tool: Anchoring + doAfter: 1 + + - to: FirelockGlassFrame + conditions: + - !type:EntityAnchored + anchored: true + steps: + - material: Glass + amount: 2 + doAfter: 2 + + - to: frame3 + conditions: + - !type:EntityAnchored + anchored: true + steps: + - tool: Screwing + doAfter: 0.75 + + - node: Firelock + entity: Firelock + edges: + - to: frame4 + conditions: + - !type:DoorWelded + welded: true + steps: + - tool: Anchoring + doAfter: 0.25 + + - node: FirelockGlassFrame + edges: + - to: FirelockGlass + conditions: + - !type:EntityAnchored + anchored: true + steps: + - tool: Anchoring + doAfter: 1 + - to: frame4 + completed: + - !type:SpawnPrototype + prototype: GlassSheet1 + amount: 2 + steps: + - tool: Screwing + doAfter: 1 + + + - node: FirelockGlass + entity: FirelockGlass + edges: + - to: FirelockGlassFrame + conditions: + - !type:EntityAnchored + anchored: true + steps: + - tool: Anchoring + doAfter: 1 diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/metal_rod.yml b/Resources/Prototypes/Recipes/Construction/Graphs/metal_rod.yml new file mode 100644 index 0000000000..955fb37b43 --- /dev/null +++ b/Resources/Prototypes/Recipes/Construction/Graphs/metal_rod.yml @@ -0,0 +1,16 @@ +- type: constructionGraph + id: metalRod + start: start + graph: + - node: start + edges: + - to: MetalRod + completed: + - !type:SetStackCount + amount: 2 + steps: + - material: Metal + amount: 1 + + - node: MetalRod + entity: MetalRod diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/plating.yml b/Resources/Prototypes/Recipes/Construction/Graphs/plating.yml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/tables.yml b/Resources/Prototypes/Recipes/Construction/Graphs/tables.yml new file mode 100644 index 0000000000..afe3f1753c --- /dev/null +++ b/Resources/Prototypes/Recipes/Construction/Graphs/tables.yml @@ -0,0 +1,82 @@ +- type: constructionGraph + id: Tables + start: start + graph: + - node: start + edges: + - to: TableFrame + completed: + - !type:SnapToGrid { } + steps: + - material: MetalRod + amount: 2 + doAfter: 1 + + - node: PokerTable + entity: TableCarpet + + - node: TableFrame + entity: TableFrame + edges: + - to: start + completed: + - !type:SpawnPrototype + prototype: MetalRod + amount: 2 + - !type:DeleteEntity {} + steps: + - tool: Anchoring + doAfter: 1 + + - to: MetalTable + steps: + - material: Metal + amount: 1 + doAfter: 1 + + - to: ReinforcedTable + steps: + - material: Plasteel + amount: 1 + doAfter: 1 + + - to: GlassTable + steps: + - material: Glass + amount: 1 + doAfter: 1 + + - to: WoodTable + steps: + - material: Wood + amount: 1 + doAfter: 1 + + - to: RGlassTable + steps: + - material: ReinforcedGlass + amount: 1 + doAfter: 1 + + + + - node: MetalTable + entity: TableMetal + + - node: ReinforcedTable + entity: TableR + + - node: GlassTable + entity: TableGlass + + - node: WoodTable + entity: TableWood + edges: + - to: PokerTable + steps: + - material: Wood + amount: 1 + doAfter: 1 + + - node: RGlassTable + entity: TableGlassR diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/window.yml b/Resources/Prototypes/Recipes/Construction/Graphs/window.yml index 12c4d9a11a..069646137a 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/window.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/window.yml @@ -1,4 +1,4 @@ -- type: constructionGraph +- type: constructionGraph id: window start: start graph: @@ -17,10 +17,7 @@ - to: reinforcedWindow steps: - - material: Metal - amount: 2 - doAfter: 2 - - material: Glass + - material: ReinforcedGlass amount: 2 doAfter: 2 @@ -51,10 +48,7 @@ - to: start completed: - !type:SpawnPrototype - prototype: GlassSheet1 - amount: 2 - - !type:SpawnPrototype - prototype: MetalSheet1 + prototype: RGlassSheet1 amount: 2 - !type:DeleteEntity {} steps: diff --git a/Resources/Prototypes/Recipes/Construction/materials.yml b/Resources/Prototypes/Recipes/Construction/materials.yml new file mode 100644 index 0000000000..408466aadf --- /dev/null +++ b/Resources/Prototypes/Recipes/Construction/materials.yml @@ -0,0 +1,10 @@ +- type: construction + name: Metal Rod + id: metalRod + graph: metalRod + startNode: start + targetNode: MetalRod + category: Materials + description: A sturdy metal rod that can be used for various purposes. + icon: Objects/Materials/materials.rsi/rods.png + objectType: Item diff --git a/Resources/Prototypes/Recipes/Construction/structures.yml b/Resources/Prototypes/Recipes/Construction/structures.yml index 5cb4f76115..c79a587150 100644 --- a/Resources/Prototypes/Recipes/Construction/structures.yml +++ b/Resources/Prototypes/Recipes/Construction/structures.yml @@ -110,3 +110,79 @@ objectType: Structure placementMode: SnapgridCenter canRotate: false + +- type: construction + name: Firelock + id: Firelock + graph: Firelock + startNode: start + targetNode: Firelock + category: Structures + description: This is a firelock - it locks an area when a fire alarm in the area is triggered. Don't get squished! + icon: + sprite: Constructible/Structures/Doors/firelock.rsi + state: closed + objectType: Structure + placementMode: SnapgridCenter + +- type: construction + name: Table Frame + id: TableFrame + graph: Tables + startNode: start + targetNode: TableFrame + category: Structures + description: A sturdy frame used in the construction of tables + icon: + sprite: Constructible/Structures/Tables/frame.rsi + state: full + objectType: Structure + placementMode: SnapgridCenter + +- type: construction + name: Poker Table + id: PokerTable + graph: Tables + startNode: start + targetNode: PokerTable + category: Structures + description: A square piece of wood standing on four legs. (What did you expect?) + icon: + sprite: Constructible/Structures/Tables/carpet.rsi + state: full + objectType: Structure + placementMode: SnapgridCenter + +- type: construction + name: Catwalk + id: Catwalk + graph: Catwalk + startNode: start + targetNode: Catwalk + category: Structures + description: Just like a lattice. Except it looks better. + conditions: + - !type:TileType + targets: + - lattice + - plating + - underplating + icon: + sprite: Constructible/Tiles/catwalk.rsi + state: catwalk_preview + objectType: Structure + placementMode: SnapgridCenter + +- type: construction + name: APC + id: apc + graph: apc + startNode: start + targetNode: apc + category: Structures + description: Area Power Controller (APC). Controls power. In an area. + icon: + sprite: Constructible/Power/apc.rsi + state: apc0 + objectType: Structure + placementMode: AlignWallProper diff --git a/Resources/Prototypes/Recipes/Construction/weapons.yml b/Resources/Prototypes/Recipes/Construction/weapons.yml index 4ccda3b552..35a701155e 100644 --- a/Resources/Prototypes/Recipes/Construction/weapons.yml +++ b/Resources/Prototypes/Recipes/Construction/weapons.yml @@ -4,7 +4,7 @@ graph: spear startNode: start targetNode: spear - category: Items/Weapons + category: Weapons description: A crude spear for when you need to put holes in somebody. icon: Objects/Weapons/Melee/spear.rsi/spear.png objectType: Item diff --git a/Resources/Prototypes/Tiles/floors.yml b/Resources/Prototypes/Tiles/floors.yml index 368e32b604..2678975766 100644 --- a/Resources/Prototypes/Tiles/floors.yml +++ b/Resources/Prototypes/Tiles/floors.yml @@ -1,9 +1,8 @@ -- type: tile +- type: tile name: floor_dark display_name: Dark floor texture: "dark" base_turfs: - - space - plating is_subfloor: false can_crowbar: true @@ -16,7 +15,6 @@ display_name: Elevator shaft texture: "elevator_shaft" base_turfs: - - space - plating is_subfloor: false can_crowbar: true @@ -28,7 +26,6 @@ display_name: Freezer texture: "freezer" base_turfs: - - space - plating is_subfloor: false can_crowbar: true @@ -41,7 +38,6 @@ display_name: Hydro floor texture: "hydro" base_turfs: - - space - plating is_subfloor: false can_crowbar: true @@ -53,7 +49,6 @@ display_name: Green circuit floor texture: "green_circuit" base_turfs: - - space - plating is_subfloor: false can_crowbar: true @@ -66,7 +61,6 @@ display_name: Linoleum floor texture: "lino" base_turfs: - - space - plating is_subfloor: false can_crowbar: true @@ -79,7 +73,6 @@ display_name: Mono floor texture: "mono" base_turfs: - - space - plating is_subfloor: false can_crowbar: true @@ -92,7 +85,6 @@ display_name: Reinforced floor texture: "reinforced" base_turfs: - - space - plating is_subfloor: false can_crowbar: true @@ -105,7 +97,6 @@ display_name: rock floor texture: "rock_vault" base_turfs: - - space - plating is_subfloor: false can_crowbar: true @@ -118,7 +109,6 @@ display_name: Showroom floor texture: "showroom" base_turfs: - - space - plating is_subfloor: false can_crowbar: true @@ -131,7 +121,6 @@ display_name: Steel floor texture: "steel" base_turfs: - - space - plating is_subfloor: false can_crowbar: true @@ -144,7 +133,6 @@ display_name: Dirty steel floor texture: "steel_dirty" base_turfs: - - space - plating is_subfloor: false can_crowbar: true @@ -157,8 +145,7 @@ display_name: Techmaint Floor texture: "tech_maint" base_turfs: - - space - - underplating + - plating is_subfloor: false can_crowbar: true footstep_sounds: footstep_floor @@ -170,8 +157,7 @@ display_name: White Floor texture: "white" base_turfs: - - space - - underplating + - plating is_subfloor: false can_crowbar: true footstep_sounds: footstep_floor @@ -194,8 +180,7 @@ display_name: Asteroid Tile texture: Asteroid/asteroid_tile base_turfs: - - space - - underplating + - plating is_subfloor: false can_crowbar: true footstep_sounds: footstep_asteroid @@ -262,8 +247,7 @@ display_name: Gold Tile texture: gold base_turfs: - - space - - underplating + - plating is_subfloor: false can_crowbar: true footstep_sounds: footstep_floor diff --git a/Resources/Prototypes/Tiles/plating.yml b/Resources/Prototypes/Tiles/plating.yml index 63a8ec4dc2..653b604980 100644 --- a/Resources/Prototypes/Tiles/plating.yml +++ b/Resources/Prototypes/Tiles/plating.yml @@ -3,6 +3,16 @@ display_name: Plating texture: plating base_turfs: + - underplating + is_subfloor: true + footstep_sounds: footstep_plating + friction: 0.5 + +- type: tile + name: lattice + display_name: lattice + texture: lattice + base_turfs: - space is_subfloor: true footstep_sounds: footstep_plating @@ -13,7 +23,7 @@ display_name: Underplating texture: underplating base_turfs: - - space + - lattice is_subfloor: true footstep_sounds: footstep_plating friction: 0.5 diff --git a/Resources/Prototypes/materials.yml b/Resources/Prototypes/materials.yml index 0cd57bf107..b39ba30366 100644 --- a/Resources/Prototypes/materials.yml +++ b/Resources/Prototypes/materials.yml @@ -1,4 +1,4 @@ -- type: material +- type: material id: steel name: steel color: gray @@ -18,6 +18,16 @@ thermalConductivity: 0.9 specificHeat: 840 +- type: material + id: rglass + name: Reinforced glass + color: '#49c9a7' + icon: Objects/Materials/sheets.rsi/rglass.png + density: 5000 + electricResistivity: 1.0e+13 + thermalConductivity: 0.9 + specificHeat: 5000 + - type: material id: gold name: gold diff --git a/Resources/Textures/Constructible/Tiles/lattice.png b/Resources/Textures/Constructible/Tiles/lattice.png new file mode 100644 index 0000000000..9a33ae0f9a Binary files /dev/null and b/Resources/Textures/Constructible/Tiles/lattice.png differ diff --git a/Resources/Textures/Objects/Materials/sheets.rsi/meta.json b/Resources/Textures/Objects/Materials/sheets.rsi/meta.json index 23a0a0978e..3f5c791c9c 100644 --- a/Resources/Textures/Objects/Materials/sheets.rsi/meta.json +++ b/Resources/Textures/Objects/Materials/sheets.rsi/meta.json @@ -165,6 +165,18 @@ "name": "plasteel", "directions": 1 }, + { + "name": "rglass", + "directions": 1 + }, + { + "name": "rglass-inhand-left", + "directions": 4 + }, + { + "name": "rglass-inhand-right", + "directions": 4 + }, { "name": "researchicon", "directions": 1 diff --git a/Resources/Textures/Objects/Materials/sheets.rsi/rglass-inhand-left.png b/Resources/Textures/Objects/Materials/sheets.rsi/rglass-inhand-left.png new file mode 100644 index 0000000000..4c4c76a770 Binary files /dev/null and b/Resources/Textures/Objects/Materials/sheets.rsi/rglass-inhand-left.png differ diff --git a/Resources/Textures/Objects/Materials/sheets.rsi/rglass-inhand-right.png b/Resources/Textures/Objects/Materials/sheets.rsi/rglass-inhand-right.png new file mode 100644 index 0000000000..ea661a816a Binary files /dev/null and b/Resources/Textures/Objects/Materials/sheets.rsi/rglass-inhand-right.png differ diff --git a/Resources/Textures/Objects/Materials/sheets.rsi/rglass.png b/Resources/Textures/Objects/Materials/sheets.rsi/rglass.png new file mode 100644 index 0000000000..6f81392e50 Binary files /dev/null and b/Resources/Textures/Objects/Materials/sheets.rsi/rglass.png differ