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

Public Member Functions

 TraitorEventPrefab (ContentXElement element, RandomEventsFile file, Identifier fallbackIdentifier=default)
 
bool ReputationRequirementsMet (CampaignMode? campaign)
 
bool MissionRequirementsMet (GameSession? gameSession)
 
bool LevelRequirementsMet (Level? level)
 
override void Dispose ()
 
override string ToString ()
 
- Public Member Functions inherited from Barotrauma.EventPrefab
 EventPrefab (ContentXElement element, RandomEventsFile file, Identifier fallbackIdentifier=default)
 
bool TryCreateInstance< T > (out T instance)
 
Event CreateInstance ()
 
override string ToString ()
 
- Public Member Functions inherited from Barotrauma.Prefab
 Prefab (ContentFile file, Identifier identifier)
 
 Prefab (ContentFile file, ContentXElement element)
 

Public Attributes

readonly? Sprite Icon
 
readonly Color IconColor
 
ImmutableHashSet< IdentifierTags
 
ImmutableHashSet< IdentifierRequiredCompletedTags
 An event with one of these tags must've been completed previously for this event to trigger. More...
 
readonly int DangerLevel
 
readonly int RequiredPreviousDangerLevel
 An event of this danger level (or higher) must have been selected previously for this event to trigger. It does not matter whether the event was completed successfully or not. Defaults to one less than the DangerLevel of this event. More...
 
readonly bool RequirePreviousDangerLevelCompleted
 An event of a lower danger level must have been completed on the previous round for this event to trigger. Defaults to false (no requirements) More...
 
readonly int MinPlayerCount
 Minimum number of non-spectating human players on the server for the event to get selected. More...
 
readonly int SecondaryTraitorAmount
 Number of players to assign as a "secondary traitor". If both this and SecondaryTraitorPercentage are defined, this is treated as a minimum number of secondary traitors. More...
 
readonly float SecondaryTraitorPercentage
 Percentage of players to assign as a "secondary traitor". More...
 
readonly bool AllowAccusingSecondaryTraitor
 Does accusing a secondary traitor count as correctly identifying the traitor? More...
 
readonly int MoneyPenaltyForUnfoundedTraitorAccusation
 Money penalty if the crew votes a wrong player as the traitor More...
 
readonly bool IsChainable
 Is this event chainable, i.e. does the same traitor get another, higher-lvl one if they complete this one successfully? More...
 
readonly float StealPercentageOfExperience
 
- Public Attributes inherited from Barotrauma.EventPrefab
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

const int MinDangerLevel = 1
 
const int MaxDangerLevel = 3
 
- Static Public Attributes inherited from Barotrauma.EventPrefab
static readonly PrefabCollection< EventPrefabPrefabs = new PrefabCollection<EventPrefab>()
 
- Static Public Attributes inherited from Barotrauma.Prefab
static readonly ImmutableHashSet< Type > Types
 

Properties

bool HasReputationRequirements [get]
 
bool HasMissionRequirements [get]
 
bool HasLevelRequirements [get]
 
- Properties inherited from Barotrauma.Prefab
ContentPackageContentPackage [get]
 
ContentPath FilePath [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from Barotrauma.EventPrefab
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 ()
 
- Protected Member Functions inherited from Barotrauma.Prefab
virtual Identifier DetermineIdentifier (XElement element)
 

Detailed Description

Definition at line 13 of file TraitorEventPrefab.cs.

Constructor & Destructor Documentation

◆ TraitorEventPrefab()

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

Definition at line 267 of file TraitorEventPrefab.cs.

Member Function Documentation

◆ Dispose()

override void Barotrauma.TraitorEventPrefab.Dispose ( )
virtual

Reimplemented from Barotrauma.EventPrefab.

Definition at line 355 of file TraitorEventPrefab.cs.

◆ LevelRequirementsMet()

bool Barotrauma.TraitorEventPrefab.LevelRequirementsMet ( Level level)

Definition at line 340 of file TraitorEventPrefab.cs.

◆ MissionRequirementsMet()

bool Barotrauma.TraitorEventPrefab.MissionRequirementsMet ( GameSession gameSession)

Definition at line 331 of file TraitorEventPrefab.cs.

◆ ReputationRequirementsMet()

bool Barotrauma.TraitorEventPrefab.ReputationRequirementsMet ( CampaignMode campaign)

Definition at line 318 of file TraitorEventPrefab.cs.

◆ ToString()

override string Barotrauma.TraitorEventPrefab.ToString ( )

Definition at line 360 of file TraitorEventPrefab.cs.

Member Data Documentation

◆ AllowAccusingSecondaryTraitor

readonly bool Barotrauma.TraitorEventPrefab.AllowAccusingSecondaryTraitor

Does accusing a secondary traitor count as correctly identifying the traitor?

Definition at line 253 of file TraitorEventPrefab.cs.

◆ DangerLevel

readonly int Barotrauma.TraitorEventPrefab.DangerLevel

Definition at line 220 of file TraitorEventPrefab.cs.

◆ Icon

readonly? Sprite Barotrauma.TraitorEventPrefab.Icon

Definition at line 200 of file TraitorEventPrefab.cs.

◆ IconColor

readonly Color Barotrauma.TraitorEventPrefab.IconColor

Definition at line 201 of file TraitorEventPrefab.cs.

◆ IsChainable

readonly bool Barotrauma.TraitorEventPrefab.IsChainable

Is this event chainable, i.e. does the same traitor get another, higher-lvl one if they complete this one successfully?

Definition at line 263 of file TraitorEventPrefab.cs.

◆ MaxDangerLevel

const int Barotrauma.TraitorEventPrefab.MaxDangerLevel = 3
static

Definition at line 204 of file TraitorEventPrefab.cs.

◆ MinDangerLevel

const int Barotrauma.TraitorEventPrefab.MinDangerLevel = 1
static

Definition at line 203 of file TraitorEventPrefab.cs.

◆ MinPlayerCount

readonly int Barotrauma.TraitorEventPrefab.MinPlayerCount

Minimum number of non-spectating human players on the server for the event to get selected.

Definition at line 237 of file TraitorEventPrefab.cs.

◆ MoneyPenaltyForUnfoundedTraitorAccusation

readonly int Barotrauma.TraitorEventPrefab.MoneyPenaltyForUnfoundedTraitorAccusation

Money penalty if the crew votes a wrong player as the traitor

Definition at line 258 of file TraitorEventPrefab.cs.

◆ RequiredCompletedTags

ImmutableHashSet<Identifier> Barotrauma.TraitorEventPrefab.RequiredCompletedTags

An event with one of these tags must've been completed previously for this event to trigger.

Definition at line 218 of file TraitorEventPrefab.cs.

◆ RequiredPreviousDangerLevel

readonly int Barotrauma.TraitorEventPrefab.RequiredPreviousDangerLevel

An event of this danger level (or higher) must have been selected previously for this event to trigger. It does not matter whether the event was completed successfully or not. Defaults to one less than the DangerLevel of this event.

Definition at line 226 of file TraitorEventPrefab.cs.

◆ RequirePreviousDangerLevelCompleted

readonly bool Barotrauma.TraitorEventPrefab.RequirePreviousDangerLevelCompleted

An event of a lower danger level must have been completed on the previous round for this event to trigger. Defaults to false (no requirements)

Definition at line 232 of file TraitorEventPrefab.cs.

◆ SecondaryTraitorAmount

readonly int Barotrauma.TraitorEventPrefab.SecondaryTraitorAmount

Number of players to assign as a "secondary traitor". If both this and SecondaryTraitorPercentage are defined, this is treated as a minimum number of secondary traitors.

Definition at line 243 of file TraitorEventPrefab.cs.

◆ SecondaryTraitorPercentage

readonly float Barotrauma.TraitorEventPrefab.SecondaryTraitorPercentage

Percentage of players to assign as a "secondary traitor".

Definition at line 248 of file TraitorEventPrefab.cs.

◆ StealPercentageOfExperience

readonly float Barotrauma.TraitorEventPrefab.StealPercentageOfExperience

Definition at line 265 of file TraitorEventPrefab.cs.

◆ Tags

ImmutableHashSet<Identifier> Barotrauma.TraitorEventPrefab.Tags

Definition at line 206 of file TraitorEventPrefab.cs.

Property Documentation

◆ HasLevelRequirements

bool Barotrauma.TraitorEventPrefab.HasLevelRequirements
get

Definition at line 213 of file TraitorEventPrefab.cs.

◆ HasMissionRequirements

bool Barotrauma.TraitorEventPrefab.HasMissionRequirements
get

Definition at line 212 of file TraitorEventPrefab.cs.

◆ HasReputationRequirements

bool Barotrauma.TraitorEventPrefab.HasReputationRequirements
get

Definition at line 211 of file TraitorEventPrefab.cs.