diff --git a/Content.Server/Construction/Completions/EmptyContainer.cs b/Content.Server/Construction/Completions/EmptyContainer.cs index 6d26bb5da1..4455d1d79a 100644 --- a/Content.Server/Construction/Completions/EmptyContainer.cs +++ b/Content.Server/Construction/Completions/EmptyContainer.cs @@ -34,7 +34,7 @@ namespace Content.Server.Construction.Completions foreach (var ent in containerSys.EmptyContainer(container, true, reparent: !pickup)) { if (pickup) - handSys.PickupOrDrop(userUid, ent, handsComp: hands); + handSys.PickupOrDrop(userUid, ent, dropNear: true, handsComp: hands); } } } diff --git a/Content.Shared/Containers/ContainerFillSystem.cs b/Content.Shared/Containers/ContainerFillSystem.cs index 0ccc6a7192..e3849db824 100644 --- a/Content.Shared/Containers/ContainerFillSystem.cs +++ b/Content.Shared/Containers/ContainerFillSystem.cs @@ -3,8 +3,6 @@ using Content.Shared.EntityTable.Conditions; using Content.Shared.Item; using Robust.Shared.Containers; using Robust.Shared.Map; -using Robust.Shared.Prototypes; -using System; using System.Linq; using System.Numerics; diff --git a/Resources/Audio/Construction/attributions.yml b/Resources/Audio/Construction/attributions.yml new file mode 100644 index 0000000000..89c26dafa1 --- /dev/null +++ b/Resources/Audio/Construction/attributions.yml @@ -0,0 +1,30 @@ +- files: ["place_electronics_1.ogg", "place_electronics_2.ogg"] + license: "CC0-1.0" + copyright: "Foley by izzl on freesound.org. Mixed by iaada (GitHub)." + source: "https://freesound.org/people/izzl/sounds/790525/" + +- files: ["place_glass_1.ogg"] + license: "CC-BY-3.0" + copyright: "By lsprice on freesound.org." + source: "https://freesound.org/people/lsprice/sounds/88851/" + +- files: ["place_glass_2.ogg"] + license: "CC-BY-3.0" + copyright: "By lsprice on freesound.org." + source: "https://freesound.org/people/lsprice/sounds/88852/" + +- files: ["place_glass_3.ogg"] + license: "CC-BY-3.0" + copyright: "By lsprice on freesound.org." + source: "https://freesound.org/people/lsprice/sounds/88853/" + +- files: ["place_metal_1.ogg", "place_metal_2.ogg", "place_metal_3.ogg", "place_metal_4.ogg"] + license: "CC-BY-4.0" + copyright: "Foley by jerry.berumen on freesound.org. Mixed by iaada (GitHub)." + source: "https://freesound.org/people/jerry.berumen/sounds/770810/" + +- files: ["place_wires_1.ogg", "place_wires_2.ogg"] + license: "CC-BY-4.0" + copyright: "Foley by Clearwavsound and SiriusBizdness on freesound.org. Mixed by iaada (GitHub)." + source: ["https://freesound.org/people/Clearwavsound/sounds/541035/", + "https://freesound.org/people/SiriusBizdness/sounds/565193/"] diff --git a/Resources/Audio/Construction/place_electronics_1.ogg b/Resources/Audio/Construction/place_electronics_1.ogg new file mode 100644 index 0000000000..6fa8b7b830 Binary files /dev/null and b/Resources/Audio/Construction/place_electronics_1.ogg differ diff --git a/Resources/Audio/Construction/place_electronics_2.ogg b/Resources/Audio/Construction/place_electronics_2.ogg new file mode 100644 index 0000000000..0e5b2199b4 Binary files /dev/null and b/Resources/Audio/Construction/place_electronics_2.ogg differ diff --git a/Resources/Audio/Construction/place_glass_1.ogg b/Resources/Audio/Construction/place_glass_1.ogg new file mode 100644 index 0000000000..ad575bb318 Binary files /dev/null and b/Resources/Audio/Construction/place_glass_1.ogg differ diff --git a/Resources/Audio/Construction/place_glass_2.ogg b/Resources/Audio/Construction/place_glass_2.ogg new file mode 100644 index 0000000000..37ac6bb339 Binary files /dev/null and b/Resources/Audio/Construction/place_glass_2.ogg differ diff --git a/Resources/Audio/Construction/place_glass_3.ogg b/Resources/Audio/Construction/place_glass_3.ogg new file mode 100644 index 0000000000..422ddec718 Binary files /dev/null and b/Resources/Audio/Construction/place_glass_3.ogg differ diff --git a/Resources/Audio/Construction/place_metal_1.ogg b/Resources/Audio/Construction/place_metal_1.ogg new file mode 100644 index 0000000000..80c0e29c64 Binary files /dev/null and b/Resources/Audio/Construction/place_metal_1.ogg differ diff --git a/Resources/Audio/Construction/place_metal_2.ogg b/Resources/Audio/Construction/place_metal_2.ogg new file mode 100644 index 0000000000..47a0b27a03 Binary files /dev/null and b/Resources/Audio/Construction/place_metal_2.ogg differ diff --git a/Resources/Audio/Construction/place_metal_3.ogg b/Resources/Audio/Construction/place_metal_3.ogg new file mode 100644 index 0000000000..39f887cfec Binary files /dev/null and b/Resources/Audio/Construction/place_metal_3.ogg differ diff --git a/Resources/Audio/Construction/place_metal_4.ogg b/Resources/Audio/Construction/place_metal_4.ogg new file mode 100644 index 0000000000..cd09e321c9 Binary files /dev/null and b/Resources/Audio/Construction/place_metal_4.ogg differ diff --git a/Resources/Audio/Construction/place_wires_1.ogg b/Resources/Audio/Construction/place_wires_1.ogg new file mode 100644 index 0000000000..de650a9b7a Binary files /dev/null and b/Resources/Audio/Construction/place_wires_1.ogg differ diff --git a/Resources/Audio/Construction/place_wires_2.ogg b/Resources/Audio/Construction/place_wires_2.ogg new file mode 100644 index 0000000000..987599fe38 Binary files /dev/null and b/Resources/Audio/Construction/place_wires_2.ogg differ diff --git a/Resources/Prototypes/Entities/Structures/Wallmounts/WallmountMachines/station_map.yml b/Resources/Prototypes/Entities/Structures/Wallmounts/WallmountMachines/station_map.yml index 84f78aaca4..d2c6ece32a 100644 --- a/Resources/Prototypes/Entities/Structures/Wallmounts/WallmountMachines/station_map.yml +++ b/Resources/Prototypes/Entities/Structures/Wallmounts/WallmountMachines/station_map.yml @@ -1,14 +1,31 @@ - type: entity - parent: [ BaseWallmountMetallic, StructureHealthMachineFlimsy ] - id: StationMapBroken - name: station map - description: A virtual map of the surrounding station. - suffix: Wall broken + abstract: true + parent: BaseWallmountMetallic + id: BaseStationMap + suffix: Wall components: - type: Sprite sprite: Structures/Wallmounts/station-map.rsi offset: 0, -0.25 drawdepth: WallMountedItems + - type: WallMount + arc: 360 + - type: Construction + graph: StationMap + containers: + - board + - type: ContainerContainer + containers: + board: !type:Container + +- type: entity + parent: [ BaseStationMap, StructureHealthMachineFlimsy ] + id: StationMapBroken + name: station map + description: A former map of the surrounding station. + suffix: Wall broken + components: + - type: Sprite layers: - state: broken - type: Destructible @@ -20,29 +37,33 @@ - &SoundMetalGlassBreak !type:PlaySoundBehavior sound: collection: MetalGlassBreak + - !type:EmptyAllContainersBehaviour - !type:SpawnEntitiesBehavior spawn: - StationMapCircuitboard: &Min0Max1 + SheetSteel1: &Min0Max1 min: 0 max: 1 - SheetSteel1: *Min0Max1 CableApcStack1: *Min0Max1 - + - type: Construction + node: broken + - type: EntityTableContainerFill + contextContainers: true + containers: + board: + id: StationMapCircuitboard + prob: 0.25 # The board is probably broken + conditions: + - !type:EmptyContainerCondition # If this entity is spawned via construction the circuitboard already exists - type: entity - parent: [ BaseWallmountMachine, StructureHealthMachineWeak ] + parent: [ BaseStationMap, BaseWallmountMachine, StructureHealthMachineWeak ] id: StationMap name: station map description: A virtual map of the surrounding station. - suffix: Wall components: - - type: WallMount - arc: 360 - type: Appearance - type: StationMap - type: Sprite - sprite: Structures/Wallmounts/station-map.rsi - offset: 0, -0.25 layers: - state: base - state: unshaded @@ -57,12 +78,13 @@ enum.PowerDeviceVisualLayers.Powered: True: { visible: true } False: { visible: false } - - type: ContainerFill + - type: EntityTableContainerFill + contextContainers: true containers: - board: [ StationMapCircuitboard ] - - type: ContainerContainer - containers: - board: !type:Container + board: + id: StationMapCircuitboard + conditions: + - !type:EmptyContainerCondition - type: ApcPowerReceiver powerLoad: 50 - type: PowerState @@ -70,13 +92,12 @@ workingPowerDraw: 200 - type: UIPowerState - type: Construction - graph: StationMap node: station_map - type: ActivatableUIRequiresPower - type: ActivatableUI key: enum.StationMapUiKey.Key - type: Damageable - damageModifierSet: GlassReinforcedMod + damageModifierSet: GlassMod - type: Destructible thresholds: - trigger: @@ -84,12 +105,8 @@ damage: 100 behaviors: - *SoundMetalGlassBreak - - !type:SpawnEntitiesBehavior - offset: 0 - spawn: - StationMapBroken: - min: 1 - max: 1 + - !type:ChangeConstructionNodeBehavior + node: broken - type: UserInterface interfaces: enum.StationMapUiKey.Key: @@ -106,16 +123,12 @@ - NoConsoleSound - type: entity - parent: [ BaseWallmountMetallic, StructureHealthMachineFlimsy ] + parent: [ BaseStationMap, StructureHealthMachineFlimsy ] id: StationMapAssembly name: station map assembly description: A station map assembly. components: - - type: WallMount - arc: 360 - type: Sprite - sprite: Structures/Wallmounts/station-map.rsi - offset: 0, -0.25 layers: - state: frame0 map: [ "enum.ConstructionVisuals.Layer" ] @@ -127,14 +140,15 @@ assembly: { state: frame0 } wired: { state: frame1 } electronics: { state: frame2 } + screen: { state: frame3 } - type: Construction - graph: StationMap node: assembly - type: Destructible thresholds: - trigger: *DamageMachineFlimsy behaviors: - *SoundMetalGlassBreak + - !type:EmptyAllContainersBehaviour - !type:SpawnEntitiesBehavior spawn: SheetSteel1: *Min0Max1 diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/utilities/station_maps.yml b/Resources/Prototypes/Recipes/Construction/Graphs/utilities/station_maps.yml index 5329eaf68f..3d1ed73d9d 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/utilities/station_maps.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/utilities/station_maps.yml @@ -3,12 +3,19 @@ start: start graph: - node: start + actions: # This action on the start node ensures we delete regardless of how we get here (sometimes reduces code duplication) + - !type:DeleteEntity {} edges: - to: assembly steps: - material: Steel amount: 2 - doAfter: 2.0 + doAfter: 2 + completed: + # An edge with no completed action feels unresponsive, so in this case a sound is added. + - !type:PlaySound + sound: + collection: PlaceMetal - node: assembly entity: StationMapAssembly @@ -19,16 +26,18 @@ steps: - material: Cable amount: 2 - doAfter: 1 + completed: + - !type:PlaySound + sound: + collection: PlaceWires - to: start + steps: + - tool: Welding + doAfter: 2 completed: - !type:GivePrototype prototype: SheetSteel1 amount: 2 - - !type:DeleteEntity {} - steps: - - tool: Welding - doAfter: 2 - node: wired entity: StationMapAssembly @@ -38,22 +47,50 @@ - to: electronics steps: - tag: StationMapElectronics - store: board + doAfter: 1 + store: &Container board name: construction-graph-tag-station-map-electronics icon: sprite: "Objects/Misc/module.rsi" - state: "door_electronics" # /tg/ uses the same sprite, right? - doAfter: 1 + state: "door_electronics" + completed: + - !type:PlaySound + sound: + collection: PlaceElectronics - to: assembly + steps: + - tool: Cutting + doAfter: 1 completed: - !type:GivePrototype prototype: CableApcStack1 amount: 2 + + - node: electronics + entity: StationMapAssembly + actions: + - !type:AppearanceChange + edges: + - to: screen + steps: + - material: Glass + amount: 2 + completed: + - !type:PlaySound + sound: + collection: PlaceGlass + - to: wired steps: - tool: Cutting doAfter: 1 + completed: + # Empty the container instead of spawning a new electronics to maintain component changes the board might have. + - !type:EmptyContainer + container: *Container + pickup: true - - node: electronics + - node: screen + entity: StationMapAssembly actions: - !type:AppearanceChange edges: @@ -61,18 +98,49 @@ steps: - tool: Screwing doAfter: 2 - - - node: station_map - entity: StationMap - edges: - - to: wired - conditions: - - !type:ContainerNotEmpty - container: board completed: - - !type:EmptyAllContainers - pickup: true - emptyAtUser: true + - !type:PlaySound + sound: /Audio/Machines/light_tube_on.ogg + - to: electronics + conditions: # Safety condition. Should never be false but surfaces something went wrong + - !type:ContainerNotEmpty + container: *Container + examineText: deconstructible-verb-activate-no-target-text steps: - tool: Prying doAfter: 1 + completed: + - !type:GivePrototype + prototype: SheetGlass1 + amount: 2 + + # Final destination + - node: station_map + entity: StationMap + edges: + - to: screen + steps: + - tool: Screwing + doAfter: 2 + + # The entity prototype has a random fill so there's two nodes to cover both possibilities + - node: broken + entity: StationMapBroken + edges: + - to: wired + conditions: + - !type:ContainerEmpty + container: *Container + steps: &StepsBroken + - tool: Screwing + doAfter: 3 + completed: &CompletedBroken + - !type:GivePrototype + prototype: ShardGlass + amount: 2 + - to: electronics + conditions: + - !type:ContainerNotEmpty + container: *Container + steps: *StepsBroken + completed: *CompletedBroken diff --git a/Resources/Prototypes/SoundCollections/construction.yml b/Resources/Prototypes/SoundCollections/construction.yml new file mode 100644 index 0000000000..887ec658b3 --- /dev/null +++ b/Resources/Prototypes/SoundCollections/construction.yml @@ -0,0 +1,26 @@ +- type: soundCollection + id: PlaceElectronics + files: + - /Audio/Construction/place_electronics_1.ogg + - /Audio/Construction/place_electronics_2.ogg + +- type: soundCollection + id: PlaceGlass + files: + - /Audio/Construction/place_glass_1.ogg + - /Audio/Construction/place_glass_2.ogg + - /Audio/Construction/place_glass_3.ogg + +- type: soundCollection + id: PlaceMetal + files: + - /Audio/Construction/place_metal_1.ogg + - /Audio/Construction/place_metal_2.ogg + - /Audio/Construction/place_metal_3.ogg + - /Audio/Construction/place_metal_4.ogg + +- type: soundCollection + id: PlaceWires + files: + - /Audio/Construction/place_wires_1.ogg + - /Audio/Construction/place_wires_2.ogg diff --git a/Resources/Textures/Structures/Wallmounts/station-map.rsi/frame2.png b/Resources/Textures/Structures/Wallmounts/station-map.rsi/frame2.png index 1b4ed09717..358e8edba9 100644 Binary files a/Resources/Textures/Structures/Wallmounts/station-map.rsi/frame2.png and b/Resources/Textures/Structures/Wallmounts/station-map.rsi/frame2.png differ diff --git a/Resources/Textures/Structures/Wallmounts/station-map.rsi/frame3.png b/Resources/Textures/Structures/Wallmounts/station-map.rsi/frame3.png new file mode 100644 index 0000000000..de13939790 Binary files /dev/null and b/Resources/Textures/Structures/Wallmounts/station-map.rsi/frame3.png differ diff --git a/Resources/Textures/Structures/Wallmounts/station-map.rsi/meta.json b/Resources/Textures/Structures/Wallmounts/station-map.rsi/meta.json index 6a5452dc3b..6f57e92e12 100644 --- a/Resources/Textures/Structures/Wallmounts/station-map.rsi/meta.json +++ b/Resources/Textures/Structures/Wallmounts/station-map.rsi/meta.json @@ -1,7 +1,7 @@ { "version": 1, "license": "CC-BY-SA-3.0", - "copyright": "By AftrLite (GitHub)", + "copyright": "By AftrLite (GitHub), circuitboard on 'frame2' and 'frame3' added by iaada (GitHub)", "size": { "x": 32, "y": 32 @@ -27,6 +27,10 @@ "name": "frame2", "directions": 4 }, + { + "name": "frame3", + "directions": 4 + }, { "name": "unshaded", "directions": 4