Barotrauma Client Doc
Barotrauma.CharacterParams Class Reference

Contains character data that should be editable in the character editor. More...

Inheritance diagram for Barotrauma.CharacterParams:
Barotrauma.EditableParams Barotrauma.ISerializableEntity

Classes

class  AIParams
 
class  HealthParams
 
class  InventoryParams
 
class  ParticleParams
 
class  SoundParams
 
class  SubParam
 
class  TargetParams
 

Public Member Functions

 CharacterParams (CharacterFile file)
 
bool Load ()
 
bool Save (string fileNameWithoutExtension=null)
 
override bool Reset (bool forceReload=false)
 
bool Deserialize (XElement element=null, bool alsoChildren=true, bool recursive=true, bool loadDefaultValues=true)
 
bool Serialize (XElement element=null, bool alsoChildren=true, bool recursive=true)
 
void AddToEditor (ParamsEditor editor, bool alsoChildren=true, bool recursive=true, int space=0)
 
bool AddSound ()
 
void AddInventory ()
 
void AddBloodEmitter ()
 
void AddGibEmitter ()
 
void AddDamageEmitter ()
 
bool RemoveSound (SoundParams soundParams)
 
bool RemoveBloodEmitter (ParticleParams emitter)
 
bool RemoveGibEmitter (ParticleParams emitter)
 
bool RemoveDamageEmitter (ParticleParams emitter)
 
bool RemoveInventory (InventoryParams inventory)
 
- Public Member Functions inherited from Barotrauma.EditableParams
virtual bool Save (string fileNameWithoutExtension=null, System.Xml.XmlWriterSettings settings=null)
 
virtual void AddToEditor (ParamsEditor editor, int space=0)
 

Static Public Member Functions

static XElement CreateVariantXml (XElement variantXML, XElement baseXML)
 
static bool CompareGroup (Identifier group1, Identifier group2)
 

Public Attributes

readonly CharacterFile File
 
readonly List< SubParamSubParams = new List<SubParam>()
 
readonly List< SoundParamsSounds = new List<SoundParams>()
 
readonly List< ParticleParamsBloodEmitters = new List<ParticleParams>()
 
readonly List< ParticleParamsGibEmitters = new List<ParticleParams>()
 
readonly List< ParticleParamsDamageEmitters = new List<ParticleParams>()
 
readonly List< InventoryParamsInventories = new List<InventoryParams>()
 

Protected Member Functions

override string GetName ()
 
void CreateSubParams ()
 
bool RemoveSubParam< T > (T subParam, IList< T > collection=null)
 
bool TryAddSubParam< T > (ContentXElement element, Func< ContentXElement, CharacterParams, T > constructor, out T subParam, IList< T > collection=null, Func< IList< T >, bool > filter=null)
 
- Protected Member Functions inherited from Barotrauma.EditableParams
ContentXElement CreateElement (string name, params object[] attrs)
 
virtual bool Deserialize (XElement element=null)
 
virtual bool Serialize (XElement element=null)
 
virtual bool Load (ContentPath file)
 
virtual void UpdatePath (ContentPath fullPath)
 

Properties

Identifier SpeciesName [get]
 
Identifier SpeciesTranslationOverride [get]
 
string DisplayName [get]
 
Identifier Group [get]
 
bool Humanoid [get]
 
bool HasInfo [get]
 
bool CanInteract [get]
 
bool Husk [get]
 
bool UseHuskAppendage [get]
 
bool NeedsAir [get, set]
 
bool NeedsWater [get, set]
 
bool UseHumanAI [get, set]
 
bool IsMachine [get, set]
 
bool CanSpeak [get, set]
 
bool ShowHealthBar [get]
 
bool UseBossHealthBar [get]
 
float Noise [get, set]
 
float Visibility [get, set]
 
string BloodDecal [get]
 
string BleedParticleAir [get]
 
string BleedParticleWater [get]
 
float BleedParticleMultiplier [get]
 
bool CanEat [get, set]
 
float EatingSpeed [get, set]
 
bool UsePathFinding [get, set]
 
float PathFinderPriority [get, set]
 
bool HideInSonar [get, set]
 
bool HideInThermalGoggles [get, set]
 
float SonarDisruption [get, set]
 
float DistantSonarRange [get, set]
 
float DisableDistance [get, set]
 
float SoundInterval [get, set]
 
bool DrawLast [get, set]
 
float AITurretPriority [get, set]
 
float AISlowTurretPriority [get, set]
 
Identifier DespawnContainer [get]
 
XDocument VariantFile [get]
 
HealthParams Health [get]
 
AIParams AI [get]
 Parameters for EnemyAIController. Not used by HumanAIController. More...
 
override ContentXElementMainElement [get]
 
- Properties inherited from Barotrauma.EditableParams
bool IsLoaded [get, protected set]
 
string Name [get]
 
string FileName [get]
 
string Folder [get]
 
ContentPath Path = ContentPath.Empty [get, protected set]
 
Dictionary< Identifier, SerializablePropertySerializableProperties [get, protected set]
 
virtual ContentXElementMainElement [get]
 
ContentXElement OriginalElement [get, protected set]
 
SerializableEntityEditor SerializableEntityEditor [get, protected set]
 
- Properties inherited from Barotrauma.ISerializableEntity
string Name [get]
 
Dictionary< Identifier, SerializablePropertySerializableProperties [get]
 

Additional Inherited Members

- Protected Attributes inherited from Barotrauma.EditableParams
ContentXElement rootElement
 
XDocument doc
 

Detailed Description

Contains character data that should be editable in the character editor.

Definition at line 18 of file CharacterParams.cs.

Constructor & Destructor Documentation

◆ CharacterParams()

Barotrauma.CharacterParams.CharacterParams ( CharacterFile  file)

Definition at line 147 of file CharacterParams.cs.

Member Function Documentation

◆ AddBloodEmitter()

void Barotrauma.CharacterParams.AddBloodEmitter ( )

◆ AddDamageEmitter()

void Barotrauma.CharacterParams.AddDamageEmitter ( )

◆ AddGibEmitter()

void Barotrauma.CharacterParams.AddGibEmitter ( )

◆ AddInventory()

void Barotrauma.CharacterParams.AddInventory ( )

◆ AddSound()

bool Barotrauma.CharacterParams.AddSound ( )

◆ AddToEditor()

void Barotrauma.CharacterParams.AddToEditor ( ParamsEditor  editor,
bool  alsoChildren = true,
bool  recursive = true,
int  space = 0 
)

Definition at line 342 of file CharacterParams.cs.

◆ CompareGroup()

static bool Barotrauma.CharacterParams.CompareGroup ( Identifier  group1,
Identifier  group2 
)
static

◆ CreateSubParams()

void Barotrauma.CharacterParams.CreateSubParams ( )
protected

Definition at line 252 of file CharacterParams.cs.

◆ CreateVariantXml()

static XElement Barotrauma.CharacterParams.CreateVariantXml ( XElement  variantXML,
XElement  baseXML 
)
static

Definition at line 164 of file CharacterParams.cs.

◆ Deserialize()

bool Barotrauma.CharacterParams.Deserialize ( XElement  element = null,
bool  alsoChildren = true,
bool  recursive = true,
bool  loadDefaultValues = true 
)

Definition at line 310 of file CharacterParams.cs.

◆ GetName()

override string Barotrauma.CharacterParams.GetName ( )
protectedvirtual

Reimplemented from Barotrauma.EditableParams.

◆ Load()

bool Barotrauma.CharacterParams.Load ( )

Definition at line 197 of file CharacterParams.cs.

◆ RemoveBloodEmitter()

bool Barotrauma.CharacterParams.RemoveBloodEmitter ( ParticleParams  emitter)

◆ RemoveDamageEmitter()

bool Barotrauma.CharacterParams.RemoveDamageEmitter ( ParticleParams  emitter)

◆ RemoveGibEmitter()

bool Barotrauma.CharacterParams.RemoveGibEmitter ( ParticleParams  emitter)

◆ RemoveInventory()

bool Barotrauma.CharacterParams.RemoveInventory ( InventoryParams  inventory)

◆ RemoveSound()

bool Barotrauma.CharacterParams.RemoveSound ( SoundParams  soundParams)

◆ RemoveSubParam< T >()

bool Barotrauma.CharacterParams.RemoveSubParam< T > ( subParam,
IList< T >  collection = null 
)
protected
Type Constraints
T :SubParam 

Definition at line 390 of file CharacterParams.cs.

◆ Reset()

override bool Barotrauma.CharacterParams.Reset ( bool  forceReload = false)
virtual

Reimplemented from Barotrauma.EditableParams.

Definition at line 239 of file CharacterParams.cs.

◆ Save()

bool Barotrauma.CharacterParams.Save ( string  fileNameWithoutExtension = null)

Definition at line 226 of file CharacterParams.cs.

◆ Serialize()

bool Barotrauma.CharacterParams.Serialize ( XElement  element = null,
bool  alsoChildren = true,
bool  recursive = true 
)

Definition at line 328 of file CharacterParams.cs.

◆ TryAddSubParam< T >()

bool Barotrauma.CharacterParams.TryAddSubParam< T > ( ContentXElement  element,
Func< ContentXElement, CharacterParams, T >  constructor,
out T  subParam,
IList< T >  collection = null,
Func< IList< T >, bool >  filter = null 
)
protected
Type Constraints
T :SubParam 

Definition at line 401 of file CharacterParams.cs.

Member Data Documentation

◆ BloodEmitters

readonly List<ParticleParams> Barotrauma.CharacterParams.BloodEmitters = new List<ParticleParams>()

Definition at line 134 of file CharacterParams.cs.

◆ DamageEmitters

readonly List<ParticleParams> Barotrauma.CharacterParams.DamageEmitters = new List<ParticleParams>()

Definition at line 136 of file CharacterParams.cs.

◆ File

readonly CharacterFile Barotrauma.CharacterParams.File

Definition at line 128 of file CharacterParams.cs.

◆ GibEmitters

readonly List<ParticleParams> Barotrauma.CharacterParams.GibEmitters = new List<ParticleParams>()

Definition at line 135 of file CharacterParams.cs.

◆ Inventories

readonly List<InventoryParams> Barotrauma.CharacterParams.Inventories = new List<InventoryParams>()

Definition at line 137 of file CharacterParams.cs.

◆ Sounds

readonly List<SoundParams> Barotrauma.CharacterParams.Sounds = new List<SoundParams>()

Definition at line 133 of file CharacterParams.cs.

◆ SubParams

readonly List<SubParam> Barotrauma.CharacterParams.SubParams = new List<SubParam>()

Definition at line 132 of file CharacterParams.cs.

Property Documentation

◆ AI

AIParams Barotrauma.CharacterParams.AI
get

Parameters for EnemyAIController. Not used by HumanAIController.

Returns
AIParams or null. Use EnemyAIController.AIParams, if you don't expect nulls.

Definition at line 145 of file CharacterParams.cs.

◆ AISlowTurretPriority

float Barotrauma.CharacterParams.AISlowTurretPriority
getset

Definition at line 123 of file CharacterParams.cs.

◆ AITurretPriority

float Barotrauma.CharacterParams.AITurretPriority
getset

Definition at line 120 of file CharacterParams.cs.

◆ BleedParticleAir

string Barotrauma.CharacterParams.BleedParticleAir
get

Definition at line 78 of file CharacterParams.cs.

◆ BleedParticleMultiplier

float Barotrauma.CharacterParams.BleedParticleMultiplier
get

Definition at line 84 of file CharacterParams.cs.

◆ BleedParticleWater

string Barotrauma.CharacterParams.BleedParticleWater
get

Definition at line 81 of file CharacterParams.cs.

◆ BloodDecal

string Barotrauma.CharacterParams.BloodDecal
get

Definition at line 75 of file CharacterParams.cs.

◆ CanEat

bool Barotrauma.CharacterParams.CanEat
getset

Definition at line 87 of file CharacterParams.cs.

◆ CanInteract

bool Barotrauma.CharacterParams.CanInteract
get

Definition at line 39 of file CharacterParams.cs.

◆ CanSpeak

bool Barotrauma.CharacterParams.CanSpeak
getset

Definition at line 60 of file CharacterParams.cs.

◆ DespawnContainer

Identifier Barotrauma.CharacterParams.DespawnContainer
get

Definition at line 126 of file CharacterParams.cs.

◆ DisableDistance

float Barotrauma.CharacterParams.DisableDistance
getset

Definition at line 111 of file CharacterParams.cs.

◆ DisplayName

string Barotrauma.CharacterParams.DisplayName
get

Definition at line 27 of file CharacterParams.cs.

◆ DistantSonarRange

float Barotrauma.CharacterParams.DistantSonarRange
getset

Definition at line 108 of file CharacterParams.cs.

◆ DrawLast

bool Barotrauma.CharacterParams.DrawLast
getset

Definition at line 117 of file CharacterParams.cs.

◆ EatingSpeed

float Barotrauma.CharacterParams.EatingSpeed
getset

Definition at line 90 of file CharacterParams.cs.

◆ Group

Identifier Barotrauma.CharacterParams.Group
get

Definition at line 30 of file CharacterParams.cs.

◆ HasInfo

bool Barotrauma.CharacterParams.HasInfo
get

Definition at line 36 of file CharacterParams.cs.

◆ Health

HealthParams Barotrauma.CharacterParams.Health
get

Definition at line 138 of file CharacterParams.cs.

◆ HideInSonar

bool Barotrauma.CharacterParams.HideInSonar
getset

Definition at line 99 of file CharacterParams.cs.

◆ HideInThermalGoggles

bool Barotrauma.CharacterParams.HideInThermalGoggles
getset

Definition at line 102 of file CharacterParams.cs.

◆ Humanoid

bool Barotrauma.CharacterParams.Humanoid
get

Definition at line 33 of file CharacterParams.cs.

◆ Husk

bool Barotrauma.CharacterParams.Husk
get

Definition at line 42 of file CharacterParams.cs.

◆ IsMachine

bool Barotrauma.CharacterParams.IsMachine
getset

Definition at line 57 of file CharacterParams.cs.

◆ MainElement

override ContentXElement? Barotrauma.CharacterParams.MainElement
get

Definition at line 155 of file CharacterParams.cs.

◆ NeedsAir

bool Barotrauma.CharacterParams.NeedsAir
getset

Definition at line 48 of file CharacterParams.cs.

◆ NeedsWater

bool Barotrauma.CharacterParams.NeedsWater
getset

Definition at line 51 of file CharacterParams.cs.

◆ Noise

float Barotrauma.CharacterParams.Noise
getset

Definition at line 69 of file CharacterParams.cs.

◆ PathFinderPriority

float Barotrauma.CharacterParams.PathFinderPriority
getset

Definition at line 96 of file CharacterParams.cs.

◆ ShowHealthBar

bool Barotrauma.CharacterParams.ShowHealthBar
get

Definition at line 63 of file CharacterParams.cs.

◆ SonarDisruption

float Barotrauma.CharacterParams.SonarDisruption
getset

Definition at line 105 of file CharacterParams.cs.

◆ SoundInterval

float Barotrauma.CharacterParams.SoundInterval
getset

Definition at line 114 of file CharacterParams.cs.

◆ SpeciesName

Identifier Barotrauma.CharacterParams.SpeciesName
get

Definition at line 21 of file CharacterParams.cs.

◆ SpeciesTranslationOverride

Identifier Barotrauma.CharacterParams.SpeciesTranslationOverride
get

Definition at line 24 of file CharacterParams.cs.

◆ UseBossHealthBar

bool Barotrauma.CharacterParams.UseBossHealthBar
get

Definition at line 66 of file CharacterParams.cs.

◆ UseHumanAI

bool Barotrauma.CharacterParams.UseHumanAI
getset

Definition at line 54 of file CharacterParams.cs.

◆ UseHuskAppendage

bool Barotrauma.CharacterParams.UseHuskAppendage
get

Definition at line 45 of file CharacterParams.cs.

◆ UsePathFinding

bool Barotrauma.CharacterParams.UsePathFinding
getset

Definition at line 93 of file CharacterParams.cs.

◆ VariantFile

XDocument Barotrauma.CharacterParams.VariantFile
get

Definition at line 130 of file CharacterParams.cs.

◆ Visibility

float Barotrauma.CharacterParams.Visibility
getset

Definition at line 72 of file CharacterParams.cs.