mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
Station Map Construction Graph Improvements (#45584)
* commit * surprisingly easy * graph improvements * new sounds * all the sounds * redo the sounds and also microbal * Revert "surprisingly easy" This reverts commit b0b0f8aa6b07ac7a0bfe915a50c0e3294e05d68a. * Early merge container fill PR * context * refactor: cleanup ContainerFillSystem.OnTableMapInit, more xml-doc for EmptyContainerCondition * remove stray edge and add a few more comments * microbalance and better construction behavior --------- Co-authored-by: iaada <iaada@users.noreply.github.com> Co-authored-by: Fildrance <fildrance@gmail.com>
This commit is contained in:
parent
a9bcdbb357
commit
fada4ff458
20 changed files with 198 additions and 58 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
30
Resources/Audio/Construction/attributions.yml
Normal file
30
Resources/Audio/Construction/attributions.yml
Normal file
|
|
@ -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/"]
|
||||
BIN
Resources/Audio/Construction/place_electronics_1.ogg
Normal file
BIN
Resources/Audio/Construction/place_electronics_1.ogg
Normal file
Binary file not shown.
BIN
Resources/Audio/Construction/place_electronics_2.ogg
Normal file
BIN
Resources/Audio/Construction/place_electronics_2.ogg
Normal file
Binary file not shown.
BIN
Resources/Audio/Construction/place_glass_1.ogg
Normal file
BIN
Resources/Audio/Construction/place_glass_1.ogg
Normal file
Binary file not shown.
BIN
Resources/Audio/Construction/place_glass_2.ogg
Normal file
BIN
Resources/Audio/Construction/place_glass_2.ogg
Normal file
Binary file not shown.
BIN
Resources/Audio/Construction/place_glass_3.ogg
Normal file
BIN
Resources/Audio/Construction/place_glass_3.ogg
Normal file
Binary file not shown.
BIN
Resources/Audio/Construction/place_metal_1.ogg
Normal file
BIN
Resources/Audio/Construction/place_metal_1.ogg
Normal file
Binary file not shown.
BIN
Resources/Audio/Construction/place_metal_2.ogg
Normal file
BIN
Resources/Audio/Construction/place_metal_2.ogg
Normal file
Binary file not shown.
BIN
Resources/Audio/Construction/place_metal_3.ogg
Normal file
BIN
Resources/Audio/Construction/place_metal_3.ogg
Normal file
Binary file not shown.
BIN
Resources/Audio/Construction/place_metal_4.ogg
Normal file
BIN
Resources/Audio/Construction/place_metal_4.ogg
Normal file
Binary file not shown.
BIN
Resources/Audio/Construction/place_wires_1.ogg
Normal file
BIN
Resources/Audio/Construction/place_wires_1.ogg
Normal file
Binary file not shown.
BIN
Resources/Audio/Construction/place_wires_2.ogg
Normal file
BIN
Resources/Audio/Construction/place_wires_2.ogg
Normal file
Binary file not shown.
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
26
Resources/Prototypes/SoundCollections/construction.yml
Normal file
26
Resources/Prototypes/SoundCollections/construction.yml
Normal file
|
|
@ -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
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue