Fix girder not having correct physics layers, add TileNotBlocked construction condition
This commit is contained in:
@@ -0,0 +1,32 @@
|
|||||||
|
using Content.Shared.Maps;
|
||||||
|
using JetBrains.Annotations;
|
||||||
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
|
using Robust.Shared.Map;
|
||||||
|
using Robust.Shared.Maths;
|
||||||
|
using Robust.Shared.Serialization;
|
||||||
|
|
||||||
|
namespace Content.Shared.Construction.ConstructionConditions
|
||||||
|
{
|
||||||
|
[UsedImplicitly]
|
||||||
|
public class TileNotBlocked : IConstructionCondition
|
||||||
|
{
|
||||||
|
private bool _filterMobs = false;
|
||||||
|
private bool _failIfSpace = true;
|
||||||
|
|
||||||
|
public void ExposeData(ObjectSerializer serializer)
|
||||||
|
{
|
||||||
|
serializer.DataField(ref _filterMobs, "filterMobs", false);
|
||||||
|
serializer.DataField(ref _failIfSpace, "failIfSpace", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Condition(IEntity user, EntityCoordinates location, Direction direction)
|
||||||
|
{
|
||||||
|
var tileRef = location.GetTileRef();
|
||||||
|
|
||||||
|
if (tileRef == null || tileRef.Value.IsSpace())
|
||||||
|
return !_failIfSpace;
|
||||||
|
|
||||||
|
return !tileRef.Value.IsBlockedTurf(_filterMobs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
- type: Clickable
|
- type: Clickable
|
||||||
- type: InteractionOutline
|
- type: InteractionOutline
|
||||||
- type: Anchorable
|
- type: Anchorable
|
||||||
|
snap: true
|
||||||
- type: Construction
|
- type: Construction
|
||||||
graph: girder
|
graph: girder
|
||||||
node: girder
|
node: girder
|
||||||
@@ -17,13 +18,9 @@
|
|||||||
anchored: true
|
anchored: true
|
||||||
shapes:
|
shapes:
|
||||||
- !type:PhysShapeAabb
|
- !type:PhysShapeAabb
|
||||||
mask:
|
|
||||||
- Impassable
|
|
||||||
- MobImpassable
|
|
||||||
- VaultImpassable
|
|
||||||
- SmallImpassable
|
|
||||||
layer:
|
layer:
|
||||||
- Opaque
|
- Opaque
|
||||||
|
- Impassable
|
||||||
- MobImpassable
|
- MobImpassable
|
||||||
- VaultImpassable
|
- VaultImpassable
|
||||||
- SmallImpassable
|
- SmallImpassable
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
icon:
|
icon:
|
||||||
sprite: Constructible/Power/conveyor.rsi
|
sprite: Constructible/Power/conveyor.rsi
|
||||||
state: conveyor_stopped_cw
|
state: conveyor_stopped_cw
|
||||||
|
conditions:
|
||||||
|
- !type:TileNotBlocked {}
|
||||||
|
|
||||||
- type: construction
|
- type: construction
|
||||||
name: two-way lever
|
name: two-way lever
|
||||||
@@ -26,3 +28,5 @@
|
|||||||
icon:
|
icon:
|
||||||
sprite: Constructible/Power/conveyor.rsi
|
sprite: Constructible/Power/conveyor.rsi
|
||||||
state: switch-off
|
state: switch-off
|
||||||
|
conditions:
|
||||||
|
- !type:TileNotBlocked {}
|
||||||
|
|||||||
@@ -13,6 +13,8 @@
|
|||||||
placementMode: SnapgridCenter
|
placementMode: SnapgridCenter
|
||||||
canRotate: false
|
canRotate: false
|
||||||
canBuildInImpassable: false
|
canBuildInImpassable: false
|
||||||
|
conditions:
|
||||||
|
- !type:TileNotBlocked { }
|
||||||
|
|
||||||
- type: construction
|
- type: construction
|
||||||
name: wall
|
name: wall
|
||||||
@@ -29,6 +31,8 @@
|
|||||||
placementMode: SnapgridCenter
|
placementMode: SnapgridCenter
|
||||||
canRotate: false
|
canRotate: false
|
||||||
canBuildInImpassable: false
|
canBuildInImpassable: false
|
||||||
|
conditions:
|
||||||
|
- !type:TileNotBlocked {}
|
||||||
|
|
||||||
- type: construction
|
- type: construction
|
||||||
name: reinforced wall
|
name: reinforced wall
|
||||||
@@ -45,6 +49,8 @@
|
|||||||
placementMode: SnapgridCenter
|
placementMode: SnapgridCenter
|
||||||
canRotate: false
|
canRotate: false
|
||||||
canBuildInImpassable: false
|
canBuildInImpassable: false
|
||||||
|
conditions:
|
||||||
|
- !type:TileNotBlocked {}
|
||||||
|
|
||||||
- type: construction
|
- type: construction
|
||||||
name: low wall
|
name: low wall
|
||||||
@@ -55,7 +61,8 @@
|
|||||||
category: Structures
|
category: Structures
|
||||||
description: A low wall used for mounting windows.
|
description: A low wall used for mounting windows.
|
||||||
conditions:
|
conditions:
|
||||||
- !type:NoWindowsInTile { }
|
- !type:NoWindowsInTile {}
|
||||||
|
- !type:TileNotBlocked {}
|
||||||
icon:
|
icon:
|
||||||
sprite: Constructible/Structures/Walls/low_wall.rsi
|
sprite: Constructible/Structures/Walls/low_wall.rsi
|
||||||
state: metal
|
state: metal
|
||||||
@@ -131,6 +138,8 @@
|
|||||||
objectType: Structure
|
objectType: Structure
|
||||||
placementMode: SnapgridCenter
|
placementMode: SnapgridCenter
|
||||||
canBuildInImpassable: false
|
canBuildInImpassable: false
|
||||||
|
conditions:
|
||||||
|
- !type:TileNotBlocked {}
|
||||||
|
|
||||||
- type: construction
|
- type: construction
|
||||||
name: Table Frame
|
name: Table Frame
|
||||||
@@ -146,6 +155,8 @@
|
|||||||
objectType: Structure
|
objectType: Structure
|
||||||
placementMode: SnapgridCenter
|
placementMode: SnapgridCenter
|
||||||
canBuildInImpassable: false
|
canBuildInImpassable: false
|
||||||
|
conditions:
|
||||||
|
- !type:TileNotBlocked {}
|
||||||
|
|
||||||
- type: construction
|
- type: construction
|
||||||
name: Poker Table
|
name: Poker Table
|
||||||
@@ -161,6 +172,8 @@
|
|||||||
objectType: Structure
|
objectType: Structure
|
||||||
placementMode: SnapgridCenter
|
placementMode: SnapgridCenter
|
||||||
canBuildInImpassable: false
|
canBuildInImpassable: false
|
||||||
|
conditions:
|
||||||
|
- !type:TileNotBlocked {}
|
||||||
|
|
||||||
- type: construction
|
- type: construction
|
||||||
name: Catwalk
|
name: Catwalk
|
||||||
@@ -171,6 +184,7 @@
|
|||||||
category: Structures
|
category: Structures
|
||||||
description: Just like a lattice. Except it looks better.
|
description: Just like a lattice. Except it looks better.
|
||||||
conditions:
|
conditions:
|
||||||
|
- !type:TileNotBlocked {}
|
||||||
- !type:TileType
|
- !type:TileType
|
||||||
targets:
|
targets:
|
||||||
- lattice
|
- lattice
|
||||||
|
|||||||
Reference in New Issue
Block a user