Barotrauma Client Doc
Barotrauma.EventPrefab Class Reference
Inheritance diagram for Barotrauma.EventPrefab:
Barotrauma.Prefab Barotrauma.TraitorEventPrefab

Public Member Functions

 EventPrefab (ContentXElement element, RandomEventsFile file, Identifier fallbackIdentifier=default)
 
bool TryCreateInstance< T > (out T instance)
 
Event CreateInstance ()
 
override void Dispose ()
 
override string ToString ()
 
- Public Member Functions inherited from Barotrauma.Prefab
 Prefab (ContentFile file, Identifier identifier)
 
 Prefab (ContentFile file, ContentXElement element)
 

Static Public Member Functions

static EventPrefab Create (ContentXElement element, RandomEventsFile file, Identifier fallbackIdentifier=default)
 
static EventPrefab GetUnlockPathEvent (Identifier biomeIdentifier, Faction faction)
 
- Static Public Member Functions inherited from Barotrauma.Prefab
static void DisallowCallFromConstructor ()
 

Public Attributes

readonly ContentXElement ConfigElement
 
readonly Type EventType
 
readonly float Probability
 The probability for the event to do something if it gets selected. For example, the probability for a MonsterEvent to spawn the monster(s). More...
 
readonly bool TriggerEventCooldown
 When this event occurs, should it trigger the event cooldown during which no new events are triggered? More...
 
readonly float Commonness
 The commonness of the event (i.e. how likely it is for this specific event to be chosen from the event set it's configured in). Only valid if the event set is configured to choose a random event (as opposed to just executing all the events in the set). More...
 
readonly Identifier BiomeIdentifier
 If set, the event set can only be chosen in this biome. More...
 
readonly Identifier Faction
 If set, the event set can only be chosen in locations that belong to this faction. More...
 
readonly LocalizedString Name
 
readonly bool UnlockPathEvent
 If set, this event is used as an event that can unlock a path to the next biome. More...
 
readonly string UnlockPathTooltip
 Only valid if UnlockPathEvent is set to true. The tooltip displayed on the pathway this event is blocking. More...
 
readonly int UnlockPathReputation
 Only valid if UnlockPathEvent is set to true. The reputation requirement displayed on the pathway this event is blocking. More...
 
- Public Attributes inherited from Barotrauma.Prefab
readonly Identifier Identifier
 
readonly ContentFile ContentFile
 

Static Public Attributes

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

Additional Inherited Members

- Protected Member Functions inherited from Barotrauma.Prefab
virtual Identifier DetermineIdentifier (XElement element)
 
- Properties inherited from Barotrauma.Prefab
ContentPackageContentPackage [get]
 
ContentPath FilePath [get]
 

Detailed Description

Definition at line 7 of file EventPrefab.cs.

Constructor & Destructor Documentation

◆ EventPrefab()

Barotrauma.EventPrefab.EventPrefab ( ContentXElement  element,
RandomEventsFile  file,
Identifier  fallbackIdentifier = default 
)

Definition at line 69 of file EventPrefab.cs.

Member Function Documentation

◆ Create()

static EventPrefab Barotrauma.EventPrefab.Create ( ContentXElement  element,
RandomEventsFile  file,
Identifier  fallbackIdentifier = default 
)
static

Definition at line 57 of file EventPrefab.cs.

◆ CreateInstance()

Event Barotrauma.EventPrefab.CreateInstance ( )

Definition at line 108 of file EventPrefab.cs.

◆ Dispose()

override void Barotrauma.EventPrefab.Dispose ( )
virtual

Implements Barotrauma.Prefab.

Reimplemented in Barotrauma.TraitorEventPrefab.

Definition at line 124 of file EventPrefab.cs.

◆ GetUnlockPathEvent()

static EventPrefab Barotrauma.EventPrefab.GetUnlockPathEvent ( Identifier  biomeIdentifier,
Faction  faction 
)
static

Definition at line 131 of file EventPrefab.cs.

◆ ToString()

override string Barotrauma.EventPrefab.ToString ( )

Definition at line 126 of file EventPrefab.cs.

◆ TryCreateInstance< T >()

bool Barotrauma.EventPrefab.TryCreateInstance< T > ( out T  instance)
Type Constraints
T :Event 

Definition at line 102 of file EventPrefab.cs.

Member Data Documentation

◆ BiomeIdentifier

readonly Identifier Barotrauma.EventPrefab.BiomeIdentifier

If set, the event set can only be chosen in this biome.

Definition at line 33 of file EventPrefab.cs.

◆ Commonness

readonly float Barotrauma.EventPrefab.Commonness

The commonness of the event (i.e. how likely it is for this specific event to be chosen from the event set it's configured in). Only valid if the event set is configured to choose a random event (as opposed to just executing all the events in the set).

Definition at line 28 of file EventPrefab.cs.

◆ ConfigElement

readonly ContentXElement Barotrauma.EventPrefab.ConfigElement

Definition at line 11 of file EventPrefab.cs.

◆ EventType

readonly Type Barotrauma.EventPrefab.EventType

Definition at line 12 of file EventPrefab.cs.

◆ Faction

readonly Identifier Barotrauma.EventPrefab.Faction

If set, the event set can only be chosen in locations that belong to this faction.

Definition at line 38 of file EventPrefab.cs.

◆ Name

readonly LocalizedString Barotrauma.EventPrefab.Name

Definition at line 40 of file EventPrefab.cs.

◆ Prefabs

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

Definition at line 9 of file EventPrefab.cs.

◆ Probability

readonly float Barotrauma.EventPrefab.Probability

The probability for the event to do something if it gets selected. For example, the probability for a MonsterEvent to spawn the monster(s).

Definition at line 17 of file EventPrefab.cs.

◆ TriggerEventCooldown

readonly bool Barotrauma.EventPrefab.TriggerEventCooldown

When this event occurs, should it trigger the event cooldown during which no new events are triggered?

Definition at line 22 of file EventPrefab.cs.

◆ UnlockPathEvent

readonly bool Barotrauma.EventPrefab.UnlockPathEvent

If set, this event is used as an event that can unlock a path to the next biome.

Definition at line 45 of file EventPrefab.cs.

◆ UnlockPathReputation

readonly int Barotrauma.EventPrefab.UnlockPathReputation

Only valid if UnlockPathEvent is set to true. The reputation requirement displayed on the pathway this event is blocking.

Definition at line 55 of file EventPrefab.cs.

◆ UnlockPathTooltip

readonly string Barotrauma.EventPrefab.UnlockPathTooltip

Only valid if UnlockPathEvent is set to true. The tooltip displayed on the pathway this event is blocking.

Definition at line 50 of file EventPrefab.cs.