pressure plate (#902)

This commit is contained in:
Ed
2025-02-16 00:39:36 +03:00
committed by GitHub
parent 37fd4d887f
commit a3849c8aa9
15 changed files with 287 additions and 9 deletions

View File

@@ -0,0 +1,11 @@
- type: sourcePort
id: CP14Pressed
name: cp14-signal-port-name-pressed
description: cp14-signal-port-description-pressed
defaultLinks: [ Toggle, Trigger, Timer ]
- type: sourcePort
id: CP14Released
name: cp14-signal-port-name-released
description: cp14-signal-port-description-released
defaultLinks: [ Toggle, Trigger, Timer ]

View File

@@ -54,4 +54,16 @@
soundHit:
collection: MetalThud
cPAnimationLength: 0.25
cPAnimationOffset: -1.3
cPAnimationOffset: -1.3
- type: NetworkConfigurator
- type: ActivatableUI
key: enum.NetworkConfiguratorUiKey.List
inHandsOnly: true
- type: UserInterface
interfaces:
enum.NetworkConfiguratorUiKey.List:
type: NetworkConfiguratorBoundUserInterface
enum.NetworkConfiguratorUiKey.Configure:
type: NetworkConfiguratorBoundUserInterface
enum.NetworkConfiguratorUiKey.Link:
type: NetworkConfiguratorBoundUserInterface

View File

@@ -0,0 +1,71 @@
- type: entity
id: CP14PressurePlateBase
abstract: true
parent: BaseStructure
placement:
mode: SnapgridCenter
categories: [ ForkFiltered ]
name: pressure plate
description: This button can activate something!
components:
- type: Fixtures
fixtures:
slipFixture:
shape:
!type:PhysShapeAabb
bounds: "-0.4,-0.4,0.4,0.4"
mask:
- SmallMobMask
layer:
- SmallMobLayer
hard: false
- type: Physics
bodyType: Static
- type: Sprite
snapCardinals: true
drawdepth: FloorObjects
sprite: _CP14/Structures/Specific/Device/pressure_plate.rsi
- type: ItemPlacer
maxEntities: 5
- type: Appearance
- type: CollisionWake
enabled: false
- type: CP14PressurePlate
pressedSound:
path: /Audio/Machines/button.ogg
params:
pitchscale: 0.75
releasedSound:
path: /Audio/Machines/button.ogg
- type: DeviceNetwork
deviceNetId: Wireless
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 100
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- type: WirelessNetworkConnection
range: 10
- type: DeviceLinkSource
ports:
- CP14Pressed
- Status
- CP14Released
- type: entity
parent: CP14PressurePlateBase
id: CP14PressurePlateWooden
components:
- type: Sprite
layers:
- state: wooden
map: ["enabled"]
- type: GenericVisualizer
visuals:
enum.PressurePlateVisuals.Pressed:
enabled:
True: { state: wooden_pressed }
False: { state: wooden }

View File

@@ -8,7 +8,7 @@
description: This button can activate something!
components:
- type: Sprite
sprite: _CP14/Structures/Wallmount/buttons.rsi
sprite: _CP14/Structures/Specific/Device/wallmount_buttons.rsi
- type: Clickable
- type: InteractionOutline
- type: Physics
@@ -16,22 +16,28 @@
- type: UseDelay
delay: 0.5 # prevent light-toggling auto-clickers.
- type: SignalSwitch
onPort: Pressed
offPort: Pressed
statusPort: Pressed
onPort: CP14Pressed
offPort: CP14Pressed
statusPort: CP14Pressed
- type: Fixtures
- type: DeviceNetwork
deviceNetId: Wireless
- type: WirelessNetworkConnection
range: 100
range: 10
- type: DeviceLinkSource
ports:
- Pressed
- CP14Pressed
- type: entity
id: CP14WallmouontButtonWooden
parent: CP14WallmountButtonBase
name: wooden wall button
components:
- type: Sprite
state: wooden
state: wooden
- type: entity
id: CP14WallmouontButtonStone
parent: CP14WallmountButtonBase
components:
- type: Sprite
state: stone