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

Classes

class  ChildObject
 
class  SoundConfig
 

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 ()
 
void Save (XElement element)
 
- 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...
 
List< int > ParticleEmitterTriggerIndex [get]
 
List< ParticleEmitterPrefabParticleEmitterPrefabs [get]
 
List< Vector2 > EmitterPositions [get]
 
List< SoundConfigSounds = new List<SoundConfig>() [get]
 
List< int > LightSourceTriggerIndex = new List<int>() [get]
 
List< LightSourceParamsLightSourceParams = new List<Lights.LightSourceParams>() [get]
 
List< SpriteDeformationSpriteDeformations = new List<SpriteDeformation>() [get]
 Only used for editing sprite deformation parameters. The actual LevelObjects use separate SpriteDeformation instances. 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

Member Enumeration Documentation

◆ SpawnPosType

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

Definition at line 35 of file BarotraumaShared/SharedSource/Map/Levels/LevelObjects/LevelObjectPrefab.cs.

Constructor & Destructor Documentation

◆ LevelObjectPrefab()

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

Member Function Documentation

◆ Dispose()

override void Barotrauma.LevelObjectPrefab.Dispose ( )
virtual

◆ GetCommonness() [1/2]

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

◆ GetCommonness() [2/2]

float Barotrauma.LevelObjectPrefab.GetCommonness ( LevelData  levelData)

◆ ParseIdentifier()

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

◆ Save()

void Barotrauma.LevelObjectPrefab.Save ( XElement  element)

◆ ToString()

override string Barotrauma.LevelObjectPrefab.ToString ( )

Member Data Documentation

◆ LevelTriggerElements

readonly List<ContentXElement> Barotrauma.LevelObjectPrefab.LevelTriggerElements

◆ 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 BarotraumaShared/SharedSource/Map/Levels/LevelObjects/LevelObjectPrefab.cs.

◆ Prefabs

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

Property Documentation

◆ Alignment

Alignment Barotrauma.LevelObjectPrefab.Alignment
get

Which sides of a wall the object can appear on.

Definition at line 80 of file BarotraumaShared/SharedSource/Map/Levels/LevelObjects/LevelObjectPrefab.cs.

◆ AlignWithSurface

bool Barotrauma.LevelObjectPrefab.AlignWithSurface
get

◆ AllowAtEnd

bool Barotrauma.LevelObjectPrefab.AllowAtEnd
get

◆ AllowAtStart

bool Barotrauma.LevelObjectPrefab.AllowAtStart
get

◆ ChildObjects

List<ChildObject> Barotrauma.LevelObjectPrefab.ChildObjects
get

◆ 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 BarotraumaShared/SharedSource/Map/Levels/LevelObjects/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 BarotraumaShared/SharedSource/Map/Levels/LevelObjects/LevelObjectPrefab.cs.

◆ Commonness

float Barotrauma.LevelObjectPrefab.Commonness
get

◆ Config

XElement Barotrauma.LevelObjectPrefab.Config
get

◆ DeformableSprite

DeformableSprite Barotrauma.LevelObjectPrefab.DeformableSprite
get

◆ DepthRange

Vector2 Barotrauma.LevelObjectPrefab.DepthRange
get

◆ EmitterPositions

List<Vector2> Barotrauma.LevelObjectPrefab.EmitterPositions
get

◆ Health

float Barotrauma.LevelObjectPrefab.Health
get

◆ HideWhenBroken

bool Barotrauma.LevelObjectPrefab.HideWhenBroken
get

◆ LightSourceParams

List<LightSourceParams> Barotrauma.LevelObjectPrefab.LightSourceParams = new List<Lights.LightSourceParams>()
get

◆ LightSourceTriggerIndex

List<int> Barotrauma.LevelObjectPrefab.LightSourceTriggerIndex = new List<int>()
get

◆ MaxCount

int Barotrauma.LevelObjectPrefab.MaxCount
get

◆ MaxSize

float Barotrauma.LevelObjectPrefab.MaxSize
get

◆ MinSize

float Barotrauma.LevelObjectPrefab.MinSize
get

◆ MinSurfaceWidth

float Barotrauma.LevelObjectPrefab.MinSurfaceWidth
get

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

Definition at line 199 of file BarotraumaShared/SharedSource/Map/Levels/LevelObjects/LevelObjectPrefab.cs.

◆ Name

string Barotrauma.LevelObjectPrefab.Name
get

◆ 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 BarotraumaShared/SharedSource/Map/Levels/LevelObjects/LevelObjectPrefab.cs.

◆ ParticleEmitterPrefabs

List<ParticleEmitterPrefab> Barotrauma.LevelObjectPrefab.ParticleEmitterPrefabs
get

◆ ParticleEmitterTriggerIndex

List<int> Barotrauma.LevelObjectPrefab.ParticleEmitterTriggerIndex
get

◆ PhysicsBodyElement

XElement Barotrauma.LevelObjectPrefab.PhysicsBodyElement
get

◆ PhysicsBodyTriggerIndex

int Barotrauma.LevelObjectPrefab.PhysicsBodyTriggerIndex = -1
get

◆ RandomOffset

Vector2 Barotrauma.LevelObjectPrefab.RandomOffset
get

◆ RandomRotation

Vector2 Barotrauma.LevelObjectPrefab.RandomRotation
get

◆ RandomRotationRad

Vector2 Barotrauma.LevelObjectPrefab.RandomRotationRad
get

◆ ScaleOscillation

Vector2 Barotrauma.LevelObjectPrefab.ScaleOscillation
get

◆ ScaleOscillationFrequency

float Barotrauma.LevelObjectPrefab.ScaleOscillationFrequency
get

◆ SerializableProperties

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

◆ SonarDisruption

float Barotrauma.LevelObjectPrefab.SonarDisruption
get

◆ Sounds

List<SoundConfig> Barotrauma.LevelObjectPrefab.Sounds = new List<SoundConfig>()
get

◆ SpawnPos

SpawnPosType Barotrauma.LevelObjectPrefab.SpawnPos
get

◆ SpriteColor

Color Barotrauma.LevelObjectPrefab.SpriteColor
get

◆ SpriteDeformations

List<SpriteDeformation> Barotrauma.LevelObjectPrefab.SpriteDeformations = new List<SpriteDeformation>()
get

Only used for editing sprite deformation parameters. The actual LevelObjects use separate SpriteDeformation instances.

Definition at line 64 of file BarotraumaClient/ClientSource/Map/Levels/LevelObjects/LevelObjectPrefab.cs.

◆ Sprites

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

◆ SpriteSpecificPhysicsBodyElements

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

◆ SwingAmount

float Barotrauma.LevelObjectPrefab.SwingAmount
get

◆ SwingAmountRad

float Barotrauma.LevelObjectPrefab.SwingAmountRad
get

◆ SwingFrequency

float Barotrauma.LevelObjectPrefab.SwingFrequency
get

◆ TakeLevelWallDamage

bool Barotrauma.LevelObjectPrefab.TakeLevelWallDamage
get