Barotrauma Server
|
Stores information about the Character that is needed between rounds in the menu etc., whereas Character itself is the object actually spawned in-game. More...
Classes | |
class | HeadInfo |
class | HeadPreset |
Public Member Functions | |
IEnumerable< Identifier > | GetUnlockedTalentsInTree () |
Endocrine boosters can unlock talents outside the user's talent tree. This method is used to cull them from the selection. | |
IEnumerable< Identifier > | GetUnlockedTalentsOutsideTree () |
Returns unlocked talents that aren't part of the character's talent tree (which can be unlocked e.g. with an endocrine booster) | |
void | CheckDisguiseStatus (bool handleBuff, IdCard idCard=null) |
int | GetManualOrderPriority (Order order) |
IEnumerable< ContentXElement > | GetValidAttachmentElements (IEnumerable< ContentXElement > elements, HeadPreset headPreset, WearableType? wearableType=null) |
int | CountValidAttachmentsOfType (WearableType wearableType) |
CharacterInfo (Identifier speciesName, string name="", string originalName="", Either< Job, JobPrefab > jobOrJobPrefab=null, int variant=0, Rand.RandSync randSync=Rand.RandSync.Unsynced, Identifier npcIdentifier=default) | |
string | GetRandomName (Rand.RandSync randSync) |
void | CheckColors () |
CharacterInfo (ContentXElement infoElement, Identifier npcIdentifier=default) | |
int | GetIdentifier () |
Returns a presumably (not guaranteed) unique and persistent hash using the (current) Name, appearence, and job. So unless there's another character with the exactly same name, job, and appearance, the hash should be unique. | |
int | GetIdentifierUsingOriginalName () |
Returns a presumably (not guaranteed) unique hash and persistent using the OriginalName, appearence, and job. So unless there's another character with the exactly same name, job, and appearance, the hash should be unique. | |
IEnumerable< ContentXElement > | FilterElements (IEnumerable< ContentXElement > elements, ImmutableHashSet< Identifier > tags, WearableType? targetType=null) |
void | RecreateHead (ImmutableHashSet< Identifier > tags, int hairIndex, int beardIndex, int moustacheIndex, int faceAttachmentIndex) |
string | ReplaceVars (string str) |
void | RecreateHead (HeadInfo headInfo) |
void | RefreshHead () |
Reloads the head sprite and the attachment sprites. | |
void | VerifySpriteTagsLoaded () |
void | LoadHeadAttachments () |
ContentXElement | GetRandomElement (IEnumerable< ContentXElement > elements) |
int | CalculateSalary () |
void | ApplySkillGain (Identifier skillIdentifier, float baseGain, bool gainedFromAbility=false, float maxGain=2f) |
Increases the characters skill at a rate proportional to their current skill. If you want to increase the skill level by a specific amount instead, use IncreaseSkillLevel | |
void | IncreaseSkillLevel (Identifier skillIdentifier, float increase, bool gainedFromAbility=false) |
Increase the skill by a specific amount. Talents may affect the actual, final skill increase. | |
void | SetSkillLevel (Identifier skillIdentifier, float level) |
void | GiveExperience (int amount) |
void | SetExperience (int newExperience) |
int | GetTotalTalentPoints () |
int | GetAvailableTalentPoints () |
float | GetProgressTowardsNextLevel () |
int | GetExperienceRequiredForCurrentLevel () |
int | GetExperienceRequiredToLevelUp () |
int | GetExperienceRequiredForLevel (int level) |
How much more experience does the character need to reach the specified level? | |
int | GetCurrentLevel () |
void | Rename (string newName) |
void | ResetName () |
XElement | Save (XElement parentElement) |
void | SaveOrderData () |
Save current orders to OrderData | |
void | ApplyOrderData () |
void | ReloadHeadAttachments () |
Reloads the attachment xml elements according to the indices. Doesn't reload the sprites. | |
void | ClearCurrentOrders () |
void | Remove () |
void | ClearSavedStatValues () |
void | ClearSavedStatValues (StatTypes statType) |
void | RemoveSavedStatValuesOnDeath () |
void | ResetSavedStatValue (Identifier statIdentifier) |
float | GetSavedStatValue (StatTypes statType) |
float | GetSavedStatValue (StatTypes statType, Identifier statIdentifier) |
float | GetSavedStatValueWithAll (StatTypes statType, Identifier statIdentifier) |
Get the combined stat value of the identifier "all" and the specified identifier. | |
float | GetSavedStatValueWithBotsInMp (StatTypes statType, Identifier statIdentifier) |
float | GetSavedStatValueWithBotsInMp (StatTypes statType, Identifier statIdentifier, IReadOnlyCollection< Character > bots) |
void | ChangeSavedStatValue (StatTypes statType, float value, Identifier statIdentifier, bool removeOnDeath, float maxValue=float.MaxValue, bool setValue=false) |
void | ApplyDeathEffects () |
void | ServerWrite (IWriteMessage msg) |
Static Public Member Functions | |
static Color | SelectRandomColor (in ImmutableArray<(Color Color, float Commonness)> array, Rand.RandSync randSync) |
static List< ContentXElement > | AddEmpty (IEnumerable< ContentXElement > elements, WearableType type, float commonness=1) |
static bool | IsValidIndex (int index, List< ContentXElement > list) |
static void | SaveOrders (XElement parentElement, params Order[] orders) |
static void | SaveOrderData (CharacterInfo characterInfo, XElement parentElement) |
Save current orders to the parameter element. | |
static void | ApplyOrderData (Character character, XElement orderData) |
static List< Order > | LoadOrders (XElement ordersElement) |
static void | ApplyHealthData (Character character, XElement healthData, Func< AfflictionPrefab, bool > afflictionPredicate=null) |
Public Attributes | |
XElement | InventoryData |
XElement | HealthData |
XElement | OrderData |
bool | PermanentlyDead |
bool | RenamingEnabled = false |
string | Name |
LocalizedString | Title |
Identifier | NpcSetIdentifier |
Identifier Identifier NpcIdentifier | HumanPrefabIds |
Character | Character |
Note: Can be null. | |
Job | Job |
int | Salary |
Identifier | factionId |
Identifier float reputation | MinReputationToHire |
bool | OmitJobInMenus |
Can be used to disable displaying the job in any info panels. | |
bool | IsDisguised = false |
bool | IsDisguisedAsAnother = false |
bool | StartItemsGiven |
bool | IsNewHire |
Newly hired bot that hasn't spawned yet. | |
CauseOfDeath | CauseOfDeath |
CharacterTeamType | TeamID |
ushort | ID |
Unique ID given to character infos in MP. Non-persistent. Used by clients to identify which infos are the same to prevent duplicate characters in round summary. | |
readonly bool | HasSpecifierTags |
readonly ImmutableArray<(Color Color, float Commonness)> | HairColors |
readonly ImmutableArray<(Color Color, float Commonness)> | FacialHairColors |
readonly ImmutableArray<(Color Color, float Commonness)> | SkinColors |
int | MissionsCompletedSinceDeath = 0 |
Option< int > | LastRewardDistribution = Option.None |
Keeps track of the last reward distribution that was set on the character's wallet. Is used to keep salary when the character respawns since CharacterInfo is preserved between deaths. | |
readonly Dictionary< StatTypes, List< SavedStatValue > > | SavedStatValues = new Dictionary<StatTypes, List<SavedStatValue>>() |
float | LastResistanceMultiplierSkillLossDeath = 1.0f |
Used to store the last known resistance against skill loss on death when the character dies, so it can be correctly applied before reinstantiating the Character object (if respawning). NOTE: The resistances are handled as multipliers here, so 1.0 == 0% resistance. | |
float | LastResistanceMultiplierSkillLossRespawn = 1.0f |
Used to store the last known resistance against skill loss on respawn when the character dies, so it can be correctly applied before reinstantiating the Character object (if respawning). NOTE: The resistances are handled as multipliers here, so 1.0 == 0% resistance. | |
bool | Discarded |
The client opted to create a new character and discard this one. | |
Static Public Attributes | |
const int | MaxAdditionalTalentPoints = 100 |
const int | MaxCurrentOrders = 3 |
Properties | |
HeadInfo | Head [get, set] |
bool | IsMale [get] |
bool | IsFemale [get] |
CharacterInfoPrefab | Prefab [get] |
bool | HasNickname [get] |
string | OriginalName [get] |
string | DisplayName [get] |
Identifier | SpeciesName [get] |
int | ExperiencePoints [get] |
HashSet< Identifier > | UnlockedTalents = new HashSet<Identifier>() [get] |
int | AdditionalTalentPoints [get, set] |
Sprite | HeadSprite [get] |
Sprite | Portrait [get] |
List< WearableSprite > | AttachmentSprites [get] |
ContentXElement | CharacterConfigElement [get, set] |
NPCPersonalityTrait | PersonalityTrait [get] |
static int | HighestManualOrderPriority [get] |
List< Order > | CurrentOrders = new List<Order>() [get] |
List< Identifier > | SpriteTags [get] |
RagdollParams | Ragdoll [get, set] |
bool | IsAttachmentsLoaded [get] |
IReadOnlyList< ContentXElement > | Hairs [get] |
IReadOnlyList< ContentXElement > | Beards [get] |
IReadOnlyList< ContentXElement > | Moustaches [get] |
IReadOnlyList< ContentXElement > | FaceAttachments [get] |
IEnumerable< ContentXElement > | Wearables [get] |
Stores information about the Character that is needed between rounds in the menu etc., whereas Character itself is the object actually spawned in-game.
Barotrauma.CharacterInfo.CharacterInfo | ( | Identifier | speciesName, |
string | name = "", | ||
string | originalName = "", | ||
Either< Job, JobPrefab > | jobOrJobPrefab = null, | ||
int | variant = 0, | ||
Rand.RandSync | randSync = Rand::RandSync::Unsynced, | ||
Identifier | npcIdentifier = default ) |
Barotrauma.CharacterInfo.CharacterInfo | ( | ContentXElement | infoElement, |
Identifier | npcIdentifier = default ) |
|
static |
void Barotrauma.CharacterInfo.ApplyDeathEffects | ( | ) |
|
static |
void Barotrauma.CharacterInfo.ApplyOrderData | ( | ) |
|
static |
void Barotrauma.CharacterInfo.ApplySkillGain | ( | Identifier | skillIdentifier, |
float | baseGain, | ||
bool | gainedFromAbility = false, | ||
float | maxGain = 2f ) |
Increases the characters skill at a rate proportional to their current skill. If you want to increase the skill level by a specific amount instead, use IncreaseSkillLevel
int Barotrauma.CharacterInfo.CalculateSalary | ( | ) |
void Barotrauma.CharacterInfo.ChangeSavedStatValue | ( | StatTypes | statType, |
float | value, | ||
Identifier | statIdentifier, | ||
bool | removeOnDeath, | ||
float | maxValue = float::MaxValue, | ||
bool | setValue = false ) |
void Barotrauma.CharacterInfo.CheckColors | ( | ) |
void Barotrauma.CharacterInfo.CheckDisguiseStatus | ( | bool | handleBuff, |
IdCard | idCard = null ) |
void Barotrauma.CharacterInfo.ClearCurrentOrders | ( | ) |
void Barotrauma.CharacterInfo.ClearSavedStatValues | ( | ) |
void Barotrauma.CharacterInfo.ClearSavedStatValues | ( | StatTypes | statType | ) |
int Barotrauma.CharacterInfo.CountValidAttachmentsOfType | ( | WearableType | wearableType | ) |
IEnumerable< ContentXElement > Barotrauma.CharacterInfo.FilterElements | ( | IEnumerable< ContentXElement > | elements, |
ImmutableHashSet< Identifier > | tags, | ||
WearableType? | targetType = null ) |
int Barotrauma.CharacterInfo.GetAvailableTalentPoints | ( | ) |
int Barotrauma.CharacterInfo.GetCurrentLevel | ( | ) |
int Barotrauma.CharacterInfo.GetExperienceRequiredForCurrentLevel | ( | ) |
int Barotrauma.CharacterInfo.GetExperienceRequiredForLevel | ( | int | level | ) |
How much more experience does the character need to reach the specified level?
int Barotrauma.CharacterInfo.GetExperienceRequiredToLevelUp | ( | ) |
int Barotrauma.CharacterInfo.GetIdentifier | ( | ) |
Returns a presumably (not guaranteed) unique and persistent hash using the (current) Name, appearence, and job. So unless there's another character with the exactly same name, job, and appearance, the hash should be unique.
int Barotrauma.CharacterInfo.GetIdentifierUsingOriginalName | ( | ) |
Returns a presumably (not guaranteed) unique hash and persistent using the OriginalName, appearence, and job. So unless there's another character with the exactly same name, job, and appearance, the hash should be unique.
int Barotrauma.CharacterInfo.GetManualOrderPriority | ( | Order | order | ) |
float Barotrauma.CharacterInfo.GetProgressTowardsNextLevel | ( | ) |
ContentXElement Barotrauma.CharacterInfo.GetRandomElement | ( | IEnumerable< ContentXElement > | elements | ) |
string Barotrauma.CharacterInfo.GetRandomName | ( | Rand.RandSync | randSync | ) |
float Barotrauma.CharacterInfo.GetSavedStatValue | ( | StatTypes | statType | ) |
float Barotrauma.CharacterInfo.GetSavedStatValue | ( | StatTypes | statType, |
Identifier | statIdentifier ) |
float Barotrauma.CharacterInfo.GetSavedStatValueWithAll | ( | StatTypes | statType, |
Identifier | statIdentifier ) |
Get the combined stat value of the identifier "all" and the specified identifier.
The "all" identifier works like the "any" identifier in outpost modules where it doesn't literally mean everything but is an unique identifier that indicates that it should target everything. For example if we wanted to make a talent that increases the fabrication quality of every single item we could use something like: <CharacterAbilityGivePermanentStat stattype="IncreaseFabricationQuality" statidentifier="all" > (Granted IncreaseFabricationQuality doesn't support the "all" identifier so if we need this in vanilla it needs to be implemented in code)
float Barotrauma.CharacterInfo.GetSavedStatValueWithBotsInMp | ( | StatTypes | statType, |
Identifier | statIdentifier ) |
float Barotrauma.CharacterInfo.GetSavedStatValueWithBotsInMp | ( | StatTypes | statType, |
Identifier | statIdentifier, | ||
IReadOnlyCollection< Character > | bots ) |
int Barotrauma.CharacterInfo.GetTotalTalentPoints | ( | ) |
IEnumerable< Identifier > Barotrauma.CharacterInfo.GetUnlockedTalentsInTree | ( | ) |
Endocrine boosters can unlock talents outside the user's talent tree. This method is used to cull them from the selection.
IEnumerable< Identifier > Barotrauma.CharacterInfo.GetUnlockedTalentsOutsideTree | ( | ) |
Returns unlocked talents that aren't part of the character's talent tree (which can be unlocked e.g. with an endocrine booster)
IEnumerable< ContentXElement > Barotrauma.CharacterInfo.GetValidAttachmentElements | ( | IEnumerable< ContentXElement > | elements, |
HeadPreset | headPreset, | ||
WearableType? | wearableType = null ) |
void Barotrauma.CharacterInfo.GiveExperience | ( | int | amount | ) |
void Barotrauma.CharacterInfo.IncreaseSkillLevel | ( | Identifier | skillIdentifier, |
float | increase, | ||
bool | gainedFromAbility = false ) |
Increase the skill by a specific amount. Talents may affect the actual, final skill increase.
|
static |
void Barotrauma.CharacterInfo.LoadHeadAttachments | ( | ) |
|
static |
void Barotrauma.CharacterInfo.RecreateHead | ( | HeadInfo | headInfo | ) |
void Barotrauma.CharacterInfo.RecreateHead | ( | ImmutableHashSet< Identifier > | tags, |
int | hairIndex, | ||
int | beardIndex, | ||
int | moustacheIndex, | ||
int | faceAttachmentIndex ) |
void Barotrauma.CharacterInfo.RefreshHead | ( | ) |
Reloads the head sprite and the attachment sprites.
void Barotrauma.CharacterInfo.ReloadHeadAttachments | ( | ) |
Reloads the attachment xml elements according to the indices. Doesn't reload the sprites.
void Barotrauma.CharacterInfo.Remove | ( | ) |
void Barotrauma.CharacterInfo.RemoveSavedStatValuesOnDeath | ( | ) |
void Barotrauma.CharacterInfo.Rename | ( | string | newName | ) |
string Barotrauma.CharacterInfo.ReplaceVars | ( | string | str | ) |
void Barotrauma.CharacterInfo.ResetName | ( | ) |
void Barotrauma.CharacterInfo.ResetSavedStatValue | ( | Identifier | statIdentifier | ) |
XElement Barotrauma.CharacterInfo.Save | ( | XElement | parentElement | ) |
void Barotrauma.CharacterInfo.SaveOrderData | ( | ) |
Save current orders to OrderData
|
static |
Save current orders to the parameter element.
|
static |
|
static |
void Barotrauma.CharacterInfo.ServerWrite | ( | IWriteMessage | msg | ) |
void Barotrauma.CharacterInfo.SetExperience | ( | int | newExperience | ) |
void Barotrauma.CharacterInfo.SetSkillLevel | ( | Identifier | skillIdentifier, |
float | level ) |
void Barotrauma.CharacterInfo.VerifySpriteTagsLoaded | ( | ) |
CauseOfDeath Barotrauma.CharacterInfo.CauseOfDeath |
Character Barotrauma.CharacterInfo.Character |
Note: Can be null.
bool Barotrauma.CharacterInfo.Discarded |
The client opted to create a new character and discard this one.
readonly ImmutableArray<(Color Color, float Commonness)> Barotrauma.CharacterInfo.FacialHairColors |
Identifier Barotrauma.CharacterInfo.factionId |
readonly ImmutableArray<(Color Color, float Commonness)> Barotrauma.CharacterInfo.HairColors |
readonly bool Barotrauma.CharacterInfo.HasSpecifierTags |
XElement Barotrauma.CharacterInfo.HealthData |
Identifier Identifier NpcIdentifier Barotrauma.CharacterInfo.HumanPrefabIds |
ushort Barotrauma.CharacterInfo.ID |
Unique ID given to character infos in MP. Non-persistent. Used by clients to identify which infos are the same to prevent duplicate characters in round summary.
XElement Barotrauma.CharacterInfo.InventoryData |
bool Barotrauma.CharacterInfo.IsDisguised = false |
bool Barotrauma.CharacterInfo.IsDisguisedAsAnother = false |
bool Barotrauma.CharacterInfo.IsNewHire |
Newly hired bot that hasn't spawned yet.
Job Barotrauma.CharacterInfo.Job |
float Barotrauma.CharacterInfo.LastResistanceMultiplierSkillLossDeath = 1.0f |
Used to store the last known resistance against skill loss on death when the character dies, so it can be correctly applied before reinstantiating the Character object (if respawning). NOTE: The resistances are handled as multipliers here, so 1.0 == 0% resistance.
float Barotrauma.CharacterInfo.LastResistanceMultiplierSkillLossRespawn = 1.0f |
Used to store the last known resistance against skill loss on respawn when the character dies, so it can be correctly applied before reinstantiating the Character object (if respawning). NOTE: The resistances are handled as multipliers here, so 1.0 == 0% resistance.
Option<int> Barotrauma.CharacterInfo.LastRewardDistribution = Option.None |
Keeps track of the last reward distribution that was set on the character's wallet. Is used to keep salary when the character respawns since CharacterInfo is preserved between deaths.
None means the salary has not been set yet, which is not always 0 if default salary is set.
|
static |
|
static |
Identifier float reputation Barotrauma.CharacterInfo.MinReputationToHire |
int Barotrauma.CharacterInfo.MissionsCompletedSinceDeath = 0 |
string Barotrauma.CharacterInfo.Name |
Identifier Barotrauma.CharacterInfo.NpcSetIdentifier |
bool Barotrauma.CharacterInfo.OmitJobInMenus |
Can be used to disable displaying the job in any info panels.
XElement Barotrauma.CharacterInfo.OrderData |
bool Barotrauma.CharacterInfo.PermanentlyDead |
bool Barotrauma.CharacterInfo.RenamingEnabled = false |
int Barotrauma.CharacterInfo.Salary |
readonly Dictionary<StatTypes, List<SavedStatValue> > Barotrauma.CharacterInfo.SavedStatValues = new Dictionary<StatTypes, List<SavedStatValue>>() |
readonly ImmutableArray<(Color Color, float Commonness)> Barotrauma.CharacterInfo.SkinColors |
bool Barotrauma.CharacterInfo.StartItemsGiven |
CharacterTeamType Barotrauma.CharacterInfo.TeamID |
LocalizedString Barotrauma.CharacterInfo.Title |
|
getset |
|
get |
|
get |
|
getset |
|
get |
|
get |
|
get |
|
get |
|
get |
|
getset |
|
get |
|
staticget |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
getset |
|
get |
|
get |
|
get |
|
get |