Buildable wall light (#2644)

* Added empty light

* Can build light fixture

* Can construct and deconstruct small light

* You can build bulbs only on walls

* Playing with placement conditions

* Refactored code a bit

* Added check for north direction and snapping

* Fixed all small light sprites (wrong directions order)

* Fixed weird problem with bulb lights

* Fixed rotation on all stations

* Fixed map again

* Much better placement mode

* Deleted shared wall component and moved all logic to raycasts

* Missing bracket

* Better texture

* Moved wallmount condition to tags

* Removed station station

* Added suffix and fixed on map init bug
This commit is contained in:
Alex Evgrashin
2021-02-07 02:05:53 +03:00
committed by GitHub
parent 2f01d7899f
commit 59e72697cb
14 changed files with 306 additions and 59 deletions

View File

@@ -4,6 +4,9 @@
components:
- type: Clickable
- type: InteractionOutline
- type: Construction
graph: lightFixture
node: tubeLight
- type: Physics
shapes:
- !type:PhysShapeAabb
@@ -47,10 +50,39 @@
- !type:DoActsBehavior
acts: ["Destruction"]
- type: entity
id: PoweredlightEmpty
suffix: Empty
parent: Poweredlight
components:
- type: Sprite
state: empty
- type: PoweredLight
hasLampOnSpawn: False
- type: entity
name: unpowered small light
id: SmallLight
parent: WallLight
components:
- type: Sprite
sprite: Constructible/Lighting/light_small.rsi
state: on
- type: PointLight
energy: 1.0
enabled: true
offset: "-0.5, 0"
- type: Destructible
deadThreshold: 25
resistances: metallicResistances
- type: Construction
graph: lightFixture
node: bulbLight
- type: entity
name: small light
id: PoweredSmallLight
parent: WallLight
parent: SmallLight
components:
- type: Sprite
sprite: Constructible/Lighting/light_small.rsi
@@ -79,24 +111,11 @@
acts: ["Destruction"]
- type: entity
name: unpowered small light
id: SmallLight
parent: WallLight
id: PoweredSmallLightEmpty
suffix: Empty
parent: PoweredSmallLight
components:
- type: Sprite
sprite: Constructible/Lighting/light_small.rsi
state: on
- type: PointLight
energy: 1.0
enabled: true
offset: "-0.5, 0"
- type: Damageable
resistances: metallicResistances
- type: Destructible
thresholds:
- trigger:
!type:TotalDamageTrigger
damage: 25
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
state: empty
- type: PoweredLight
hasLampOnSpawn: False

View File

@@ -1,4 +1,4 @@
- type: entity
- type: entity
id: base_wall
name: basewall
description: Keeps the air in and the greytide out.
@@ -9,6 +9,9 @@
- Wall
components:
- type: RCDDeconstructWhitelist
- type: Tag
tags:
- Wall
- type: Clickable
- type: InteractionOutline
- type: Sprite