Barotrauma Client Doc
Barotrauma.HumanPrefab Class Reference
Inheritance diagram for Barotrauma.HumanPrefab:
Barotrauma.PrefabWithUintIdentifier Barotrauma.Prefab Barotrauma.CorpsePrefab

Public Member Functions

 HumanPrefab (ContentXElement element, ContentFile file, Identifier npcSetIdentifier)
 
IEnumerable< IdentifierGetTags ()
 
IEnumerable< IdentifierGetModuleFlags ()
 
IEnumerable< IdentifierGetSpawnPointTags ()
 
JobPrefab GetJobPrefab (Rand.RandSync randSync=Rand.RandSync.Unsynced, Func< JobPrefab, bool > predicate=null)
 
void InitializeCharacter (Character npc, ISpatialEntity positionToStayIn=null)
 
bool GiveItems (Character character, Submarine submarine, WayPoint spawnPoint, Rand.RandSync randSync=Rand.RandSync.Unsynced, bool createNetworkEvents=true)
 
CharacterInfo CreateCharacterInfo (Rand.RandSync randSync=Rand.RandSync.Unsynced)
 Creates a character info from the human prefab. If there are custom character infos defined, those are used, otherwise a randomized info is generated. More...
 
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 void InitializeItem (Character character, ContentXElement itemElement, Submarine submarine, HumanPrefab humanPrefab, WayPoint spawnPoint=null, Item parentItem=null, bool createNetworkEvents=true)
 
- Static Public Member Functions inherited from Barotrauma.Prefab
static void DisallowCallFromConstructor ()
 

Public Attributes

readonly List<(ContentXElement element, float commonness)> ItemSets = new List<(ContentXElement element, float commonness)>()
 
readonly List<(ContentXElement element, float commonness)> CustomCharacterInfos = new List<(ContentXElement element, float commonness)>()
 
readonly Identifier NpcSetIdentifier
 
- Public Attributes inherited from Barotrauma.Prefab
readonly Identifier Identifier
 
readonly ContentFile ContentFile
 

Properties

Identifier Job [get, protected set]
 
float Commonness [get, protected set]
 
float HealthMultiplier [get, protected set]
 
float HealthMultiplierInMultiplayer [get, protected set]
 
float AimSpeed [get, protected set]
 
float AimAccuracy [get, protected set]
 
float SkillMultiplier [get, protected set]
 
int ExperiencePoints [get]
 
string Tags [get, set]
 
string ModuleFlags [get, set]
 
string SpawnPointTags [get, set]
 
CampaignMode.InteractionType CampaignInteractionType [get, protected set]
 
AIObjectiveIdle.BehaviorType Behavior [get, protected set]
 
float ReportRange [get, protected set]
 
Identifier[] PreferredOutpostModuleTypes [get, protected set]
 
Identifier Faction [get, set]
 
Identifier Group [get, set]
 
bool AllowDraggingIndefinitely [get, set]
 
XElement Element [get, protected set]
 
- Properties inherited from Barotrauma.PrefabWithUintIdentifier
UInt32 UintIdentifier [get, set]
 
- Properties inherited from Barotrauma.Prefab
ContentPackageContentPackage [get]
 
ContentPath FilePath [get]
 

Additional Inherited Members

- Static Public Attributes inherited from Barotrauma.Prefab
static readonly ImmutableHashSet< Type > Types
 
- 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 HumanPrefab.cs.

Constructor & Destructor Documentation

◆ HumanPrefab()

Barotrauma.HumanPrefab.HumanPrefab ( ContentXElement  element,
ContentFile  file,
Identifier  npcSetIdentifier 
)

Definition at line 125 of file HumanPrefab.cs.

Member Function Documentation

◆ CreateCharacterInfo()

CharacterInfo Barotrauma.HumanPrefab.CreateCharacterInfo ( Rand.RandSync  randSync = Rand.RandSync.Unsynced)

Creates a character info from the human prefab. If there are custom character infos defined, those are used, otherwise a randomized info is generated.

Parameters
randSync
Returns

Definition at line 216 of file HumanPrefab.cs.

◆ Dispose()

override void Barotrauma.HumanPrefab.Dispose ( )
virtual

Implements Barotrauma.Prefab.

Definition at line 315 of file HumanPrefab.cs.

◆ GetJobPrefab()

JobPrefab Barotrauma.HumanPrefab.GetJobPrefab ( Rand.RandSync  randSync = Rand.RandSync.Unsynced,
Func< JobPrefab, bool >  predicate = null 
)

Definition at line 150 of file HumanPrefab.cs.

◆ GetModuleFlags()

IEnumerable<Identifier> Barotrauma.HumanPrefab.GetModuleFlags ( )

Definition at line 140 of file HumanPrefab.cs.

◆ GetSpawnPointTags()

IEnumerable<Identifier> Barotrauma.HumanPrefab.GetSpawnPointTags ( )

Definition at line 145 of file HumanPrefab.cs.

◆ GetTags()

IEnumerable<Identifier> Barotrauma.HumanPrefab.GetTags ( )

Definition at line 135 of file HumanPrefab.cs.

◆ GiveItems()

bool Barotrauma.HumanPrefab.GiveItems ( Character  character,
Submarine  submarine,
WayPoint  spawnPoint,
Rand.RandSync  randSync = Rand.RandSync.Unsynced,
bool  createNetworkEvents = true 
)

Definition at line 193 of file HumanPrefab.cs.

◆ InitializeCharacter()

void Barotrauma.HumanPrefab.InitializeCharacter ( Character  npc,
ISpatialEntity  positionToStayIn = null 
)

Definition at line 155 of file HumanPrefab.cs.

◆ InitializeItem()

static void Barotrauma.HumanPrefab.InitializeItem ( Character  character,
ContentXElement  itemElement,
Submarine  submarine,
HumanPrefab  humanPrefab,
WayPoint  spawnPoint = null,
Item  parentItem = null,
bool  createNetworkEvents = true 
)
static

Definition at line 242 of file HumanPrefab.cs.

Member Data Documentation

◆ CustomCharacterInfos

readonly List<(ContentXElement element, float commonness)> Barotrauma.HumanPrefab.CustomCharacterInfos = new List<(ContentXElement element, float commonness)>()

Definition at line 121 of file HumanPrefab.cs.

◆ ItemSets

readonly List<(ContentXElement element, float commonness)> Barotrauma.HumanPrefab.ItemSets = new List<(ContentXElement element, float commonness)>()

Definition at line 120 of file HumanPrefab.cs.

◆ NpcSetIdentifier

readonly Identifier Barotrauma.HumanPrefab.NpcSetIdentifier

Definition at line 123 of file HumanPrefab.cs.

Property Documentation

◆ AimAccuracy

float Barotrauma.HumanPrefab.AimAccuracy
getprotected set

Definition at line 28 of file HumanPrefab.cs.

◆ AimSpeed

float Barotrauma.HumanPrefab.AimSpeed
getprotected set

Definition at line 25 of file HumanPrefab.cs.

◆ AllowDraggingIndefinitely

bool Barotrauma.HumanPrefab.AllowDraggingIndefinitely
getset

Definition at line 115 of file HumanPrefab.cs.

◆ Behavior

AIObjectiveIdle.BehaviorType Barotrauma.HumanPrefab.Behavior
getprotected set

Definition at line 101 of file HumanPrefab.cs.

◆ CampaignInteractionType

CampaignMode.InteractionType Barotrauma.HumanPrefab.CampaignInteractionType
getprotected set

Definition at line 98 of file HumanPrefab.cs.

◆ Commonness

float Barotrauma.HumanPrefab.Commonness
getprotected set

Definition at line 16 of file HumanPrefab.cs.

◆ Element

XElement Barotrauma.HumanPrefab.Element
getprotected set

Definition at line 117 of file HumanPrefab.cs.

◆ ExperiencePoints

int Barotrauma.HumanPrefab.ExperiencePoints
get

Definition at line 34 of file HumanPrefab.cs.

◆ Faction

Identifier Barotrauma.HumanPrefab.Faction
getset

Definition at line 109 of file HumanPrefab.cs.

◆ Group

Identifier Barotrauma.HumanPrefab.Group
getset

Definition at line 112 of file HumanPrefab.cs.

◆ HealthMultiplier

float Barotrauma.HumanPrefab.HealthMultiplier
getprotected set

Definition at line 19 of file HumanPrefab.cs.

◆ HealthMultiplierInMultiplayer

float Barotrauma.HumanPrefab.HealthMultiplierInMultiplayer
getprotected set

Definition at line 22 of file HumanPrefab.cs.

◆ Job

Identifier Barotrauma.HumanPrefab.Job
getprotected set

Definition at line 13 of file HumanPrefab.cs.

◆ ModuleFlags

string Barotrauma.HumanPrefab.ModuleFlags
getset

Definition at line 59 of file HumanPrefab.cs.

◆ PreferredOutpostModuleTypes

Identifier [] Barotrauma.HumanPrefab.PreferredOutpostModuleTypes
getprotected set

Definition at line 106 of file HumanPrefab.cs.

◆ ReportRange

float Barotrauma.HumanPrefab.ReportRange
getprotected set

Definition at line 104 of file HumanPrefab.cs.

◆ SkillMultiplier

float Barotrauma.HumanPrefab.SkillMultiplier
getprotected set

Definition at line 31 of file HumanPrefab.cs.

◆ SpawnPointTags

string Barotrauma.HumanPrefab.SpawnPointTags
getset

Definition at line 80 of file HumanPrefab.cs.

◆ Tags

string Barotrauma.HumanPrefab.Tags
getset

Definition at line 39 of file HumanPrefab.cs.