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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {}
|
||||
36
Resources/Prototypes/Recipes/Construction/lighting.yml
Normal file
36
Resources/Prototypes/Recipes/Construction/lighting.yml
Normal 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 {}
|
||||
|
||||
@@ -1,2 +1,5 @@
|
||||
- type: Tag
|
||||
id: ExplosivePassable
|
||||
|
||||
- type: Tag
|
||||
id: Wall
|
||||
|
||||
Reference in New Issue
Block a user