Barotrauma Server Doc
Barotrauma.LevelObjectPrefab Class Reference
Inheritance diagram for Barotrauma.LevelObjectPrefab:
Barotrauma.PrefabWithUintIdentifier Barotrauma.ISerializableEntity Barotrauma.Prefab

Classes

class  ChildObject
 

Public Types

enum class  SpawnPosType {
  None = 0 , MainPathWall = 1 , SidePathWall = 2 , CaveWall = 4 ,
  NestWall = 8 , RuinWall = 16 , SeaFloor = 32 , MainPath = 64 ,
  LevelStart = 128 , LevelEnd = 256 , OutpostWall = 512 , Wall = MainPathWall | SidePathWall | CaveWall
}
 

Public Member Functions

override string ToString ()
 
 LevelObjectPrefab (ContentXElement element, LevelObjectPrefabsFile file, Identifier identifierOverride=default)
 
float GetCommonness (CaveGenerationParams generationParams, bool requireCaveSpecificOverride=true)
 
float GetCommonness (LevelData levelData)
 
override void Dispose ()
 
- Public Member Functions inherited from Barotrauma.Prefab
 Prefab (ContentFile file, Identifier identifier)
 
 Prefab (ContentFile file, ContentXElement element)
 

Static Public Member Functions

static Identifier ParseIdentifier (Identifier identifierOverride, XElement element)
 
- Static Public Member Functions inherited from Barotrauma.Prefab
static void DisallowCallFromConstructor ()
 

Public Attributes

readonly List< ContentXElementLevelTriggerElements
 
readonly Dictionary< Identifier, float > OverrideCommonness
 Overrides the commonness of the object in a specific level type. Key = name of the level type, value = commonness in that level type. More...
 
- Public Attributes inherited from Barotrauma.Prefab
readonly Identifier Identifier
 
readonly ContentFile ContentFile
 

Static Public Attributes

static readonly PrefabCollection< LevelObjectPrefabPrefabs = new PrefabCollection<LevelObjectPrefab>()
 
- Static Public Attributes inherited from Barotrauma.Prefab
static readonly ImmutableHashSet< Type > Types
 

Properties

List< SpriteSprites = new List<Sprite>() [get]
 
DeformableSprite DeformableSprite [get]
 
float MinSize [get]
 
float MaxSize [get]
 
Alignment Alignment [get]
 Which sides of a wall the object can appear on. More...
 
SpawnPosType SpawnPos [get]
 
XElement Config [get]
 
XElement PhysicsBodyElement [get]
 
int PhysicsBodyTriggerIndex = -1 [get]
 
Dictionary< Sprite, XElement > SpriteSpecificPhysicsBodyElements = new Dictionary<Sprite, XElement>() [get]
 
int MaxCount [get]
 
Vector2 DepthRange [get]
 
float ClusteringAmount [get]
 The tendency for the prefab to form clusters. Used as an exponent for perlin noise values that are used to determine the probability for an object to spawn at a specific position. More...
 
float ClusteringGroup [get]
 A value between 0-1 that determines the z-coordinate to sample perlin noise from when determining the probability for an object to spawn at a specific position. Using the same (or close) value for different objects means the objects tend to form clusters in the same areas. More...
 
Vector2 RandomOffset [get]
 
bool AlignWithSurface [get]
 
bool AllowAtStart [get]
 
bool AllowAtEnd [get]
 
float MinSurfaceWidth [get]
 Minimum length of a graph edge the object can spawn on. More...
 
Vector2 RandomRotation [get]
 
Vector2 RandomRotationRad [get]
 
float SwingAmount [get]
 
float SwingAmountRad [get]
 
float SwingFrequency [get]
 
Vector2 ScaleOscillation [get]
 
float ScaleOscillationFrequency [get]
 
float Commonness [get]
 
float SonarDisruption [get]
 
bool TakeLevelWallDamage [get]
 
bool HideWhenBroken [get]
 
float Health [get]
 
Color SpriteColor [get]
 
string Name [get]
 
List< ChildObjectChildObjects [get]
 
Dictionary< Identifier, SerializablePropertySerializableProperties [get]
 
List< LevelObjectPrefabOverrideProperties [get]
 A list of prefabs whose properties override this one's properties when a trigger is active. E.g. if a trigger in the index 1 of the trigger list is active, the properties in index 1 in this list are used (unless it's null) More...
 
- Properties inherited from Barotrauma.PrefabWithUintIdentifier
UInt32 UintIdentifier [get, set]
 
- Properties inherited from Barotrauma.Prefab
ContentPackageContentPackage [get]
 
ContentPath FilePath [get]
 
- Properties inherited from Barotrauma.ISerializableEntity
string Name [get]
 
Dictionary< Identifier, SerializablePropertySerializableProperties [get]
 

Additional Inherited Members

- Protected Member Functions inherited from Barotrauma.PrefabWithUintIdentifier
 PrefabWithUintIdentifier (ContentFile file, Identifier identifier)
 
 PrefabWithUintIdentifier (ContentFile file, ContentXElement element)
 
- Protected Member Functions inherited from Barotrauma.Prefab
virtual Identifier DetermineIdentifier (XElement element)
 

Detailed Description

Definition at line 10 of file LevelObjectPrefab.cs.

Member Enumeration Documentation

◆ SpawnPosType

Enumerator
None 
MainPathWall 
SidePathWall 
CaveWall 
NestWall 
RuinWall 
SeaFloor 
MainPath 
LevelStart 
LevelEnd 
OutpostWall 
Wall 

Definition at line 35 of file LevelObjectPrefab.cs.

Constructor & Destructor Documentation

◆ LevelObjectPrefab()

Barotrauma.LevelObjectPrefab.LevelObjectPrefab ( ContentXElement  element,
LevelObjectPrefabsFile  file,
Identifier  identifierOverride = default 
)

Definition at line 326 of file LevelObjectPrefab.cs.

Member Function Documentation

◆ Dispose()

override void Barotrauma.LevelObjectPrefab.Dispose ( )
virtual

Implements Barotrauma.Prefab.

Definition at line 461 of file LevelObjectPrefab.cs.

◆ GetCommonness() [1/2]

float Barotrauma.LevelObjectPrefab.GetCommonness ( CaveGenerationParams  generationParams,
bool  requireCaveSpecificOverride = true 
)

Definition at line 432 of file LevelObjectPrefab.cs.

◆ GetCommonness() [2/2]

float Barotrauma.LevelObjectPrefab.GetCommonness ( LevelData  levelData)

Definition at line 443 of file LevelObjectPrefab.cs.

◆ ParseIdentifier()

static Identifier Barotrauma.LevelObjectPrefab.ParseIdentifier ( Identifier  identifierOverride,
XElement  element 
)
static

Definition at line 350 of file LevelObjectPrefab.cs.

◆ ToString()

override string Barotrauma.LevelObjectPrefab.ToString ( )

Definition at line 320 of file LevelObjectPrefab.cs.

Member Data Documentation

◆ LevelTriggerElements

readonly List<ContentXElement> Barotrauma.LevelObjectPrefab.LevelTriggerElements

Definition at line 99 of file LevelObjectPrefab.cs.

◆ OverrideCommonness

readonly Dictionary<Identifier, float> Barotrauma.LevelObjectPrefab.OverrideCommonness

Overrides the commonness of the object in a specific level type. Key = name of the level type, value = commonness in that level type.

Definition at line 105 of file LevelObjectPrefab.cs.

◆ Prefabs

readonly PrefabCollection<LevelObjectPrefab> Barotrauma.LevelObjectPrefab.Prefabs = new PrefabCollection<LevelObjectPrefab>()
static

Definition at line 12 of file LevelObjectPrefab.cs.

Property Documentation

◆ Alignment

Alignment Barotrauma.LevelObjectPrefab.Alignment
get

Which sides of a wall the object can appear on.

Definition at line 80 of file LevelObjectPrefab.cs.

◆ AlignWithSurface

bool Barotrauma.LevelObjectPrefab.AlignWithSurface
get

Definition at line 175 of file LevelObjectPrefab.cs.

◆ AllowAtEnd

bool Barotrauma.LevelObjectPrefab.AllowAtEnd
get

Definition at line 189 of file LevelObjectPrefab.cs.

◆ AllowAtStart

bool Barotrauma.LevelObjectPrefab.AllowAtStart
get

Definition at line 182 of file LevelObjectPrefab.cs.

◆ ChildObjects

List<ChildObject> Barotrauma.LevelObjectPrefab.ChildObjects
get

Definition at line 299 of file LevelObjectPrefab.cs.

◆ ClusteringAmount

float Barotrauma.LevelObjectPrefab.ClusteringAmount
get

The tendency for the prefab to form clusters. Used as an exponent for perlin noise values that are used to determine the probability for an object to spawn at a specific position.

Definition at line 145 of file LevelObjectPrefab.cs.

◆ ClusteringGroup

float Barotrauma.LevelObjectPrefab.ClusteringGroup
get

A value between 0-1 that determines the z-coordinate to sample perlin noise from when determining the probability for an object to spawn at a specific position. Using the same (or close) value for different objects means the objects tend to form clusters in the same areas.

Definition at line 161 of file LevelObjectPrefab.cs.

◆ Commonness

float Barotrauma.LevelObjectPrefab.Commonness
get

Definition at line 256 of file LevelObjectPrefab.cs.

◆ Config

XElement Barotrauma.LevelObjectPrefab.Config
get

Definition at line 93 of file LevelObjectPrefab.cs.

◆ DeformableSprite

DeformableSprite Barotrauma.LevelObjectPrefab.DeformableSprite
get

Definition at line 57 of file LevelObjectPrefab.cs.

◆ DepthRange

Vector2 Barotrauma.LevelObjectPrefab.DepthRange
get

Definition at line 133 of file LevelObjectPrefab.cs.

◆ Health

float Barotrauma.LevelObjectPrefab.Health
get

Definition at line 284 of file LevelObjectPrefab.cs.

◆ HideWhenBroken

bool Barotrauma.LevelObjectPrefab.HideWhenBroken
get

Definition at line 277 of file LevelObjectPrefab.cs.

◆ MaxCount

int Barotrauma.LevelObjectPrefab.MaxCount
get

Definition at line 126 of file LevelObjectPrefab.cs.

◆ MaxSize

float Barotrauma.LevelObjectPrefab.MaxSize
get

Definition at line 70 of file LevelObjectPrefab.cs.

◆ MinSize

float Barotrauma.LevelObjectPrefab.MinSize
get

Definition at line 64 of file LevelObjectPrefab.cs.

◆ MinSurfaceWidth

float Barotrauma.LevelObjectPrefab.MinSurfaceWidth
get

Minimum length of a graph edge the object can spawn on.

Definition at line 199 of file LevelObjectPrefab.cs.

◆ Name

string Barotrauma.LevelObjectPrefab.Name
get

Definition at line 297 of file LevelObjectPrefab.cs.

◆ OverrideProperties

List<LevelObjectPrefab> Barotrauma.LevelObjectPrefab.OverrideProperties
get

A list of prefabs whose properties override this one's properties when a trigger is active. E.g. if a trigger in the index 1 of the trigger list is active, the properties in index 1 in this list are used (unless it's null)

Definition at line 314 of file LevelObjectPrefab.cs.

◆ PhysicsBodyElement

XElement Barotrauma.LevelObjectPrefab.PhysicsBodyElement
get

Definition at line 107 of file LevelObjectPrefab.cs.

◆ PhysicsBodyTriggerIndex

int Barotrauma.LevelObjectPrefab.PhysicsBodyTriggerIndex = -1
get

Definition at line 112 of file LevelObjectPrefab.cs.

◆ RandomOffset

Vector2 Barotrauma.LevelObjectPrefab.RandomOffset
get

Definition at line 168 of file LevelObjectPrefab.cs.

◆ RandomRotation

Vector2 Barotrauma.LevelObjectPrefab.RandomRotation
get

Definition at line 207 of file LevelObjectPrefab.cs.

◆ RandomRotationRad

Vector2 Barotrauma.LevelObjectPrefab.RandomRotationRad
get

Definition at line 216 of file LevelObjectPrefab.cs.

◆ ScaleOscillation

Vector2 Barotrauma.LevelObjectPrefab.ScaleOscillation
get

Definition at line 239 of file LevelObjectPrefab.cs.

◆ ScaleOscillationFrequency

float Barotrauma.LevelObjectPrefab.ScaleOscillationFrequency
get

Definition at line 246 of file LevelObjectPrefab.cs.

◆ SerializableProperties

Dictionary<Identifier, SerializableProperty> Barotrauma.LevelObjectPrefab.SerializableProperties
get

Definition at line 305 of file LevelObjectPrefab.cs.

◆ SonarDisruption

float Barotrauma.LevelObjectPrefab.SonarDisruption
get

Definition at line 263 of file LevelObjectPrefab.cs.

◆ SpawnPos

SpawnPosType Barotrauma.LevelObjectPrefab.SpawnPos
get

Definition at line 87 of file LevelObjectPrefab.cs.

◆ SpriteColor

Color Barotrauma.LevelObjectPrefab.SpriteColor
get

Definition at line 291 of file LevelObjectPrefab.cs.

◆ Sprites

List<Sprite> Barotrauma.LevelObjectPrefab.Sprites = new List<Sprite>()
get

Definition at line 51 of file LevelObjectPrefab.cs.

◆ SpriteSpecificPhysicsBodyElements

Dictionary<Sprite, XElement> Barotrauma.LevelObjectPrefab.SpriteSpecificPhysicsBodyElements = new Dictionary<Sprite, XElement>()
get

Definition at line 118 of file LevelObjectPrefab.cs.

◆ SwingAmount

float Barotrauma.LevelObjectPrefab.SwingAmount
get

Definition at line 220 of file LevelObjectPrefab.cs.

◆ SwingAmountRad

float Barotrauma.LevelObjectPrefab.SwingAmountRad
get

Definition at line 229 of file LevelObjectPrefab.cs.

◆ SwingFrequency

float Barotrauma.LevelObjectPrefab.SwingFrequency
get

Definition at line 232 of file LevelObjectPrefab.cs.

◆ TakeLevelWallDamage

bool Barotrauma.LevelObjectPrefab.TakeLevelWallDamage
get

Definition at line 270 of file LevelObjectPrefab.cs.