Apc device network and apc based light switch (#4908)

* Remove WireNet node group from cables
Implement extension cable components and system
Remove connection over distance logic from ApcPower... components

* Add extension cable components to prototypes

* Implement ApcNetwork
Implement ApcNetSwitch

* Fix ignoredComponents.cs

* Add friend attribute to new components

* Add construction graph for a light switch

* Address reviews

* Fix broken test

* Move ConnectionType enum to DeviceNetworkComponent
Change netId data definition to use the ConnectionType enum values

Co-authored-by: Julian Giebel <j.giebel@netrocks.info>
This commit is contained in:
Julian Giebel
2021-10-24 01:23:19 +02:00
committed by GitHub
parent e7f352d6c2
commit 45caf25ea9
43 changed files with 678 additions and 237 deletions

View File

@@ -24,6 +24,7 @@
- MobImpassable
- SmallImpassable
- type: ApcPowerReceiver
- type: ExtensionCableReceiver
- type: UserInterface
interfaces:
- key: enum.ReagentDispenserUiKey.Key

View File

@@ -10,3 +10,4 @@
- type: ReagentDispenser
pack: ChemDispenserStandardInventory
- type: ApcPowerReceiver
- type: ExtensionCableReceiver

View File

@@ -53,6 +53,7 @@
- type: AirlockVisualizer
- type: WiresVisualizer
- type: ApcPowerReceiver
- type: ExtensionCableReceiver
- type: Wires
BoardName: "Airlock Control"
LayoutId: Airlock

View File

@@ -37,6 +37,7 @@
- state: panel_open
map: ["enum.WiresVisualLayers.MaintenancePanel"]
- type: ApcPowerReceiver
- type: ExtensionCableReceiver
- type: Damageable
damageContainer: Inorganic
damageModifierSet: Glass

View File

@@ -6,6 +6,7 @@
parent: ComputerBase
components:
- type: ApcPowerReceiver
- type: ExtensionCableReceiver
- type: PointLight
radius: 1.5
energy: 1.6

View File

@@ -11,6 +11,7 @@
node: computer
- type: Computer
- type: ApcPowerReceiver
- type: ExtensionCableReceiver
- type: Sprite
sprite: Structures/Machines/computers.rsi
layers:

View File

@@ -20,6 +20,7 @@
- type: ShuttleConsole
- type: ApcPowerReceiver
powerLoad: 200
- type: ExtensionCableReceiver
- type: PointLight
radius: 1.5
energy: 1.6
@@ -108,6 +109,7 @@
- type: ApcPowerReceiver
powerLoad: 200
priority: Low
- type: ExtensionCableReceiver
- type: Computer
board: ResearchComputerCircuitboard
- type: PointLight

View File

@@ -38,3 +38,4 @@
id: BaseMachinePowered
components:
- type: ApcPowerReceiver
- type: ExtensionCableReceiver

View File

@@ -17,6 +17,7 @@
state: mixer_loaded
- type: ChemMaster
- type: ApcPowerReceiver
- type: ExtensionCableReceiver
- type: InteractionOutline
- type: Anchorable
- type: Physics

View File

@@ -24,6 +24,7 @@
anchored: true
- type: ApcPowerReceiver
powerLoad: 500
- type: ExtensionCableReceiver
- type: Physics
bodyType: Static
fixtures:

View File

@@ -12,6 +12,7 @@
- type: ApcPowerReceiver
powerLoad: 200
priority: Low
- type: ExtensionCableReceiver
- type: Destructible
thresholds:
- trigger:

View File

@@ -18,6 +18,7 @@
- type: ParticleAcceleratorPartVisualizer
baseState: unlit
- type: ApcPowerReceiver
- type: ExtensionCableReceiver
- type: ParticleAcceleratorControlBox
- type: Construction
graph: particleAcceleratorControlBox

View File

@@ -62,6 +62,7 @@
!type:CableDeviceNode
nodeGroupID: HVPower
- type: ApcPowerReceiver
- type: ExtensionCableReceiver
- type: PowerSupplier
supplyRate: 0

View File

@@ -56,6 +56,7 @@
voltage: Apc
- type: Apc
voltage: Apc
- type: ExtensionCableProvider
- type: UserInterface
interfaces:
- key: enum.ApcUiKey.Key

View File

@@ -50,9 +50,6 @@
power:
!type:CableNode
nodeGroupID: HVPower
wire:
!type:AdjacentNode
nodeGroupID: WireNet
- type: Cable
cableDroppedOnCutPrototype: CableHVStack1
cableType: HighVoltage
@@ -93,9 +90,6 @@
power:
!type:CableNode
nodeGroupID: MVPower
wire:
!type:AdjacentNode
nodeGroupID: WireNet
- type: Cable
cableDroppedOnCutPrototype: CableMVStack1
cableType: MediumVoltage
@@ -136,11 +130,9 @@
power:
!type:CableNode
nodeGroupID: Apc
wire:
!type:AdjacentNode
nodeGroupID: WireNet
- type: PowerProvider
voltage: Apc
- type: ExtensionCableProvider
- type: Cable
cableDroppedOnCutPrototype: CableApcStack1
cableType: Apc

View File

@@ -12,6 +12,7 @@
- type: PowerCellCharger
transfer_efficiency: 0.85
- type: ApcPowerReceiver
- type: ExtensionCableReceiver
- type: Appearance
visuals:
- type: PowerChargerVisualizer
@@ -33,6 +34,7 @@
- type: WeaponCapacitorCharger
transfer_efficiency: 0.85
- type: ApcPowerReceiver
- type: ExtensionCableReceiver
- type: Appearance
visuals:
- type: PowerChargerVisualizer
@@ -54,6 +56,7 @@
- type: WeaponCapacitorCharger
transfer_efficiency: 0.95
- type: ApcPowerReceiver
- type: ExtensionCableReceiver
- type: Appearance
visuals:
- type: PowerChargerVisualizer

View File

@@ -164,4 +164,5 @@
sprite: Structures/Power/power.rsi
state: wirelessmachine
- type: ApcPowerReceiver
- type: ExtensionCableReceiver
- type: Anchorable

View File

@@ -15,6 +15,7 @@
sprite: Structures/Wallmounts/barsign.rsi
state: empty
- type: ApcPowerReceiver
- type: ExtensionCableReceiver
- type: BarSign
- type: Destructible
thresholds:
@@ -38,6 +39,7 @@
sprite: Structures/Wallmounts/sylphs.rsi
state: sylph
- type: ApcPowerReceiver
- type: ExtensionCableReceiver
- type: BarSign
- type: entity

View File

@@ -12,6 +12,7 @@
color: "#FF4020"
mask: /Textures/Effects/LightMasks/cone.png
- type: ApcPowerReceiver
- type: ExtensionCableReceiver
- type: Battery
maxCharge: 30000
startingCharge: 0

View File

@@ -74,6 +74,10 @@
types:
Heat: 20
- type: ApcPowerReceiver
- type: ExtensionCableReceiver
- type: DeviceNetworkComponent
deviceNetId: Apc
- type: ApcNetworkConnection
- type: Appearance
visuals:
- type: PoweredLightVisualizer
@@ -159,6 +163,10 @@
types:
Heat: 20
- type: ApcPowerReceiver
- type: ExtensionCableReceiver
- type: DeviceNetworkComponent
deviceNetId: Apc
- type: ApcNetworkConnection
- type: Appearance
visuals:
- type: PoweredLightVisualizer

View File

@@ -43,3 +43,27 @@
placement:
snap:
- Wallmount
- type: entity
id: ApcNetSwitch
name: apc net switch
description: Its a switch for toggling lights that are connected to the same apc.
components:
- type: Clickable
- type: InteractionOutline
- type: Physics
- type: Sprite
sprite: Structures/Wallmounts/switch.rsi
state: on
- type: Rotatable
- type: Construction
graph: lightSwitch
node: lightSwitch
- type: ExtensionCableReceiver
- type: DeviceNetworkComponent
deviceNetId: Apc
- type: ApcNetworkConnection
- type: ApcNetSwitch
placement:
snap:
- Wallmount

View File

@@ -35,4 +35,5 @@
- !type:DoActsBehavior
acts: ["Destruction"]
- type: ApcPowerReceiver
- type: ExtensionCableReceiver
- type: CargoTelepad

View File

@@ -31,6 +31,7 @@
type: Content.Shared.MachineLinking.TwoWayLeverSignal
maxConnections: 1
- type: ApcPowerReceiver
- type: ExtensionCableReceiver
- type: Conveyor
- type: Appearance
visuals:

View File

@@ -44,3 +44,27 @@
prototype: SheetSteel1
amount: 1
- !type:DeleteEntity {}
- type: constructionGraph
id: lightSwitch
start: start
graph:
- node: start
edges:
- to: lightSwitch
steps:
- material: Steel
amount: 1
doAfter: 2.0
- node: lightSwitch
entity: ApcNetSwitch
edges:
- to: start
steps:
- tool: Screwing
doAfter: 2.0
completed:
- !type:SpawnPrototype
prototype: SheetSteel1
amount: 1
- !type:DeleteEntity {}

View File

@@ -34,3 +34,22 @@
conditions:
- !type:WallmountCondition {}
- type: construction
name: light switch
id: LightSwitchRecipe
graph: lightSwitch
startNode: start
targetNode: lightSwitch
category: Structures
description: A switch for toggling lights that are connected to the same apc.
icon:
sprite: Structures/Wallmounts/switch.rsi
state: on
objectType: Structure
placementMode: SnapgridCenter
canRotate: true
canBuildInImpassable: true
conditions:
- !type:WallmountCondition {}