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

@@ -0,0 +1,46 @@
- type: constructionGraph
id: lightFixture
start: start
graph:
- node: start
edges:
- to: bulbLight
steps:
- material: Metal
amount: 1
doAfter: 2.0
- to: tubeLight
steps:
- material: Metal
amount: 2
doAfter: 2.0
- node: tubeLight
entity: PoweredlightEmpty
edges:
- to: start
conditions:
- !type:ContainerEmpty
container: "light_bulb"
steps:
- tool: Screwing
doAfter: 2.0
completed:
- !type:SpawnPrototype
prototype: SteelSheet1
amount: 2
- !type:DeleteEntity {}
- node: bulbLight
entity: PoweredSmallLightEmpty
edges:
- to: start
conditions:
- !type:ContainerEmpty
container: "light_bulb"
steps:
- tool: Screwing
doAfter: 2.0
completed:
- !type:SpawnPrototype
prototype: SteelSheet1
amount: 1
- !type:DeleteEntity {}

View File

@@ -0,0 +1,36 @@
- type: construction
name: wall light
id: LightTubeFixture
graph: lightFixture
startNode: start
targetNode: tubeLight
category: Structures
description: A wall light fixture. Use light tubes.
icon:
sprite: Constructible/Lighting/light_tube.rsi
state: off
objectType: Structure
placementMode: WallmountLight
canRotate: true
canBuildInImpassable: true
conditions:
- !type:WallmountCondition {}
- type: construction
name: small wall light
id: LightSmallFixture
graph: lightFixture
startNode: start
targetNode: bulbLight
category: Structures
description: A wall light fixture. Use light bulbs.
icon:
sprite: Constructible/Lighting/light_small.rsi
state: off
objectType: Structure
placementMode: WallmountLight
canRotate: true
canBuildInImpassable: true
conditions:
- !type:WallmountCondition {}