Barotrauma Server
Loading...
Searching...
No Matches
Barotrauma.EventSet Class Referencesealed

Event sets are sets of random events that occur within a level (most commonly, monster spawns and scripted events). Event sets can also be nested: a "parent set" can choose from several "subsets", either randomly or by some kind of criteria. More...

Inheritance diagram for Barotrauma.EventSet:
Barotrauma.Prefab

Classes

class  EventDebugStats
 
struct  SubEventPrefab
 

Public Member Functions

 EventSet (ContentXElement element, RandomEventsFile file, EventSet parentSet=null)
 
void CheckLocationTypeErrors ()
 
float GetCommonness (Level level)
 
int GetEventCount (Level level)
 
override string ToString ()
 
override void Dispose ()
 
- Public Member Functions inherited from Barotrauma.Prefab
 Prefab (ContentFile file, Identifier identifier)
 
 Prefab (ContentFile file, ContentXElement element)
 
void Dispose ()
 

Static Public Member Functions

static List< EventPrefabGetAllEventPrefabs ()
 
static void AddSetEventPrefabsToList (List< EventPrefab > list, EventSet set)
 
static EventPrefab GetEventPrefab (Identifier identifier)
 
static List< string > GetDebugStatistics (int simulatedRoundCount=100, Func< MonsterEvent, bool > filter=null, bool fullLog=false)
 
- Static Public Member Functions inherited from Barotrauma.Prefab
static void DisallowCallFromConstructor ()
 

Public Attributes

readonly bool IsCampaignSet
 If enabled, this set can only be chosen in the campaign mode.
 
readonly float MinLevelDifficulty
 The difficulty of the current level must be equal to or higher than this for this set to be chosen.
 
readonly float MaxLevelDifficulty
 The difficulty of the current level must be equal to or less than this for this set to be chosen.
 
readonly Identifier BiomeIdentifier
 If set, the event set can only be chosen in this biome.
 
readonly LevelData.LevelType LevelType
 If set, the event set can only be chosen in this type of level (outpost level or a connection between outpost levels).
 
readonly Identifier RequiredLayer
 If set, this layer must be present somewhere in the level.
 
readonly ImmutableArray< IdentifierLocationTypeIdentifiers
 If set, the event set can only be chosen in locations of this type.
 
readonly Identifier Faction
 If set, the event set can only be chosen in locations that belong to this faction.
 
readonly bool ChooseRandom
 If set, one event, or a sub event set, is chosen randomly from this set.
 
readonly int SubSetCount = 1
 
readonly bool Exhaustible
 'Exhaustible' sets won't appear in the same level until after one world step (~10 min, see Map.ProgressWorld) has passed.
 
readonly float MinDistanceTraveled
 The event set won't become active until the submarine has travelled at least this far. A value between 0-1, where 0 is the beginning of the level and 1 the end of the level (e.g. 0.5 would mean the sub needs to be half-way through the level).
 
readonly float MinMissionTime
 The event set won't become active until the round has lasted at least this many seconds.
 
readonly float MinIntensity
 
readonly float MaxIntensity
 
readonly bool AllowAtStart
 If the event is not allowed at start, it won't become active until the submarine has moved at least 50 meters away from the beginning of the level. Only valid in LocationConnections (levels between locations).
 
readonly bool IgnoreCoolDown
 Normally an event (such as a monster spawn) triggers a cooldown during which no new events are created. This can be used to ignore the cooldown.
 
readonly bool TriggerEventCooldown
 Should this event set trigger the event cooldown (during which no new events are created) when it becomes active?
 
readonly bool IgnoreIntensity
 Normally events can only trigger if the intensity of the situation is low enough (e.g. you won't get new monster spawns if the submarine is already facing a disaster). This can be used to ignore the intensity.
 
readonly bool PerRuin
 The set is applied once per each ruin in the level. Can be used to ensure there's a consistent amount of monster spawns in the ruins in the level regardless of how many there are (and that no ruin monsters spawn if there are no ruins).
 
readonly bool PerCave
 The set is applied once per each cave in the level. Can be used to ensure there's a consistent amount of monster spawns in the cave in the level regardless of how many there are (and that no cave monsters spawn if there are no caves).
 
readonly bool PerWreck
 The set is applied once per each wreck in the level. Can be used to ensure there's a consistent amount of monster spawns in the wreck in the level regardless of how many there are (and that no wreck monsters spawn if there are no wreck).
 
readonly bool DisableInHuntingGrounds
 If enabled, this event will not be applied if the level contains hunting grounds.
 
readonly bool OncePerLevel
 If enabled, events from this set can only occur once in the level.
 
readonly bool DelayWhenCrewAway
 Should the event set be delayed if at least half of the crew is away from the submarine? The maximum amount of time the events can get delayed is defined in event manager settings (EventManagerSettings.FreezeDurationWhenCrewAway)
 
readonly bool Additive
 Additive sets are important to be aware of when creating custom event sets! If an additive set gets chosen for a level, the game will also select a non-additive one. This means you can for example configure an additive set that spawns custom monsters (and make it very common if you want the monsters to spawn frequently), which will spawn those custom monsters in addition to the vanilla monsters spawned by vanilla sets, without you having to add your custom monsters to every single vanilla set.
 
readonly float DefaultCommonness
 The commonness of the event set (i.e. how likely it is for this specific set to be chosen).
 
readonly ImmutableDictionary< Identifier, float > OverrideCommonness
 
readonly float ResetTime
 If set, the event set can trigger again after this amount of seconds has passed since it last triggered.
 
readonly int ForceAtDiscoveredNr
 Used to force an event set based on how many other locations have been discovered before this (used for campaign tutorial event sets).
 
readonly int ForceAtVisitedNr
 Used to force an event set based on how many other outposts have been visited before this (used for campaign tutorial event sets).
 
readonly bool CampaignTutorialOnly
 If enabled, this set can only occur when the campaign tutorial is enabled (generally used for the tutorial events).
 
readonly ImmutableArray< SubEventPrefabEventPrefabs
 
readonly ImmutableArray< EventSetChildSets
 
- Public Attributes inherited from Barotrauma.Prefab
readonly Identifier Identifier
 
readonly ContentFile ContentFile
 

Static Public Attributes

static readonly PrefabCollection< EventSetPrefabs = new PrefabCollection<EventSet>()
 
- 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

Event sets are sets of random events that occur within a level (most commonly, monster spawns and scripted events). Event sets can also be nested: a "parent set" can choose from several "subsets", either randomly or by some kind of criteria.

Constructor & Destructor Documentation

◆ EventSet()

Barotrauma.EventSet.EventSet ( ContentXElement element,
RandomEventsFile file,
EventSet parentSet = null )

Member Function Documentation

◆ AddSetEventPrefabsToList()

static void Barotrauma.EventSet.AddSetEventPrefabsToList ( List< EventPrefab > list,
EventSet set )
static

◆ CheckLocationTypeErrors()

void Barotrauma.EventSet.CheckLocationTypeErrors ( )

◆ Dispose()

override void Barotrauma.EventSet.Dispose ( )

◆ GetAllEventPrefabs()

static List< EventPrefab > Barotrauma.EventSet.GetAllEventPrefabs ( )
static

◆ GetCommonness()

float Barotrauma.EventSet.GetCommonness ( Level level)

◆ GetDebugStatistics()

static List< string > Barotrauma.EventSet.GetDebugStatistics ( int simulatedRoundCount = 100,
Func< MonsterEvent, bool > filter = null,
bool fullLog = false )
static

◆ GetEventCount()

int Barotrauma.EventSet.GetEventCount ( Level level)

◆ GetEventPrefab()

static EventPrefab Barotrauma.EventSet.GetEventPrefab ( Identifier identifier)
static

◆ ToString()

override string Barotrauma.EventSet.ToString ( )

Member Data Documentation

◆ Additive

readonly bool Barotrauma.EventSet.Additive

Additive sets are important to be aware of when creating custom event sets! If an additive set gets chosen for a level, the game will also select a non-additive one. This means you can for example configure an additive set that spawns custom monsters (and make it very common if you want the monsters to spawn frequently), which will spawn those custom monsters in addition to the vanilla monsters spawned by vanilla sets, without you having to add your custom monsters to every single vanilla set.

◆ AllowAtStart

readonly bool Barotrauma.EventSet.AllowAtStart

If the event is not allowed at start, it won't become active until the submarine has moved at least 50 meters away from the beginning of the level. Only valid in LocationConnections (levels between locations).

◆ BiomeIdentifier

readonly Identifier Barotrauma.EventSet.BiomeIdentifier

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

◆ CampaignTutorialOnly

readonly bool Barotrauma.EventSet.CampaignTutorialOnly

If enabled, this set can only occur when the campaign tutorial is enabled (generally used for the tutorial events).

◆ ChildSets

readonly ImmutableArray<EventSet> Barotrauma.EventSet.ChildSets

◆ ChooseRandom

readonly bool Barotrauma.EventSet.ChooseRandom

If set, one event, or a sub event set, is chosen randomly from this set.

◆ DefaultCommonness

readonly float Barotrauma.EventSet.DefaultCommonness

The commonness of the event set (i.e. how likely it is for this specific set to be chosen).

◆ DelayWhenCrewAway

readonly bool Barotrauma.EventSet.DelayWhenCrewAway

Should the event set be delayed if at least half of the crew is away from the submarine? The maximum amount of time the events can get delayed is defined in event manager settings (EventManagerSettings.FreezeDurationWhenCrewAway)

◆ DisableInHuntingGrounds

readonly bool Barotrauma.EventSet.DisableInHuntingGrounds

If enabled, this event will not be applied if the level contains hunting grounds.

◆ EventPrefabs

readonly ImmutableArray<SubEventPrefab> Barotrauma.EventSet.EventPrefabs

◆ Exhaustible

readonly bool Barotrauma.EventSet.Exhaustible

'Exhaustible' sets won't appear in the same level until after one world step (~10 min, see Map.ProgressWorld) has passed.

◆ Faction

readonly Identifier Barotrauma.EventSet.Faction

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

◆ ForceAtDiscoveredNr

readonly int Barotrauma.EventSet.ForceAtDiscoveredNr

Used to force an event set based on how many other locations have been discovered before this (used for campaign tutorial event sets).

◆ ForceAtVisitedNr

readonly int Barotrauma.EventSet.ForceAtVisitedNr

Used to force an event set based on how many other outposts have been visited before this (used for campaign tutorial event sets).

◆ IgnoreCoolDown

readonly bool Barotrauma.EventSet.IgnoreCoolDown

Normally an event (such as a monster spawn) triggers a cooldown during which no new events are created. This can be used to ignore the cooldown.

◆ IgnoreIntensity

readonly bool Barotrauma.EventSet.IgnoreIntensity

Normally events can only trigger if the intensity of the situation is low enough (e.g. you won't get new monster spawns if the submarine is already facing a disaster). This can be used to ignore the intensity.

◆ IsCampaignSet

readonly bool Barotrauma.EventSet.IsCampaignSet

If enabled, this set can only be chosen in the campaign mode.

◆ LevelType

readonly LevelData.LevelType Barotrauma.EventSet.LevelType

If set, the event set can only be chosen in this type of level (outpost level or a connection between outpost levels).

◆ LocationTypeIdentifiers

readonly ImmutableArray<Identifier> Barotrauma.EventSet.LocationTypeIdentifiers

If set, the event set can only be chosen in locations of this type.

◆ MaxIntensity

readonly float Barotrauma.EventSet.MaxIntensity

◆ MaxLevelDifficulty

readonly float Barotrauma.EventSet.MaxLevelDifficulty

The difficulty of the current level must be equal to or less than this for this set to be chosen.

◆ MinDistanceTraveled

readonly float Barotrauma.EventSet.MinDistanceTraveled

The event set won't become active until the submarine has travelled at least this far. A value between 0-1, where 0 is the beginning of the level and 1 the end of the level (e.g. 0.5 would mean the sub needs to be half-way through the level).

◆ MinIntensity

readonly float Barotrauma.EventSet.MinIntensity

◆ MinLevelDifficulty

readonly float Barotrauma.EventSet.MinLevelDifficulty

The difficulty of the current level must be equal to or higher than this for this set to be chosen.

◆ MinMissionTime

readonly float Barotrauma.EventSet.MinMissionTime

The event set won't become active until the round has lasted at least this many seconds.

◆ OncePerLevel

readonly bool Barotrauma.EventSet.OncePerLevel

If enabled, events from this set can only occur once in the level.

◆ OverrideCommonness

readonly ImmutableDictionary<Identifier, float> Barotrauma.EventSet.OverrideCommonness

◆ PerCave

readonly bool Barotrauma.EventSet.PerCave

The set is applied once per each cave in the level. Can be used to ensure there's a consistent amount of monster spawns in the cave in the level regardless of how many there are (and that no cave monsters spawn if there are no caves).

◆ PerRuin

readonly bool Barotrauma.EventSet.PerRuin

The set is applied once per each ruin in the level. Can be used to ensure there's a consistent amount of monster spawns in the ruins in the level regardless of how many there are (and that no ruin monsters spawn if there are no ruins).

◆ PerWreck

readonly bool Barotrauma.EventSet.PerWreck

The set is applied once per each wreck in the level. Can be used to ensure there's a consistent amount of monster spawns in the wreck in the level regardless of how many there are (and that no wreck monsters spawn if there are no wreck).

◆ Prefabs

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

◆ RequiredLayer

readonly Identifier Barotrauma.EventSet.RequiredLayer

If set, this layer must be present somewhere in the level.

◆ ResetTime

readonly float Barotrauma.EventSet.ResetTime

If set, the event set can trigger again after this amount of seconds has passed since it last triggered.

◆ SubSetCount

readonly int Barotrauma.EventSet.SubSetCount = 1

◆ TriggerEventCooldown

readonly bool Barotrauma.EventSet.TriggerEventCooldown

Should this event set trigger the event cooldown (during which no new events are created) when it becomes active?


The documentation for this class was generated from the following file: