Barotrauma Client Doc
Barotrauma.Mission Class Referenceabstract
Inheritance diagram for Barotrauma.Mission:
Barotrauma.AbandonedOutpostMission Barotrauma.AbandonedOutpostMission Barotrauma.AlienRuinMission Barotrauma.AlienRuinMission Barotrauma.BeaconMission Barotrauma.BeaconMission Barotrauma.CargoMission Barotrauma.CargoMission Barotrauma.CombatMission Barotrauma.CombatMission Barotrauma.EndMission Barotrauma.EndMission Barotrauma.EscortMission Barotrauma.EscortMission Barotrauma.GoToMission Barotrauma.GoToMission Barotrauma.MineralMission Barotrauma.MineralMission Barotrauma.MonsterMission Barotrauma.MonsterMission Barotrauma.NestMission Barotrauma.NestMission Barotrauma.PirateMission Barotrauma.PirateMission Barotrauma.SalvageMission Barotrauma.SalvageMission Barotrauma.ScanMission Barotrauma.ScanMission

Public Member Functions

 Mission (MissionPrefab prefab, Location[] locations, Submarine sub)
 
virtual void SetLevel (LevelData level)
 
virtual int GetReward (Submarine sub)
 
void Start (Level level)
 
void Update (float deltaTime)
 
void End ()
 End the mission and give a reward if it was completed successfully More...
 
int GetFinalReward (Submarine sub)
 Get the final reward, taking talent bonuses into account if the mission has concluded and the talents modified the reward accordingly. More...
 
virtual void AdjustLevelData (LevelData levelData)
 
Color GetDifficultyColor ()
 
virtual RichString GetMissionRewardText (Submarine sub)
 Returns the full reward text of the mission (e.g. "Reward: 2,000 mk" or "Reward: 500 mk x 2 (out of max 5) = 1,000 mk") More...
 
RichString GetReputationRewardText ()
 
Identifier GetOverrideMusicType ()
 
virtual void ClientRead (IReadMessage msg)
 
virtual void ClientReadInitial (IReadMessage msg)
 

Static Public Member Functions

static Mission LoadRandom (Location[] locations, string seed, bool requireCorrectLocationType, MissionType missionType, bool isSinglePlayer=false)
 
static Mission LoadRandom (Location[] locations, MTRandom rand, bool requireCorrectLocationType, MissionType missionType, bool isSinglePlayer=false)
 
static int GetRewardDistibutionSum (IEnumerable< Character > crew, int rewardDistribution=0)
 
static Color GetDifficultyColor (int difficulty)
 

Public Attributes

readonly MissionPrefab Prefab
 
readonly ImmutableArray< LocalizedStringHeaders
 
readonly ImmutableArray< LocalizedStringMessages
 
Location OriginLocation
 Where was this mission received from? Affects which faction we give reputation for if the mission is configured to give reputation for the faction that gave the mission. Defaults to Locations[0] More...
 
readonly Location[] Locations
 
Action< MissionOnMissionStateChanged
 

Static Public Attributes

static int Amount
 

Protected Member Functions

virtual void StartMissionSpecific (Level level)
 
virtual void UpdateMissionSpecific (float deltaTime)
 
void ShowMessage (int missionState)
 
virtual LocalizedString ModifyMessage (LocalizedString message, bool color=true)
 
abstract bool DetermineCompleted ()
 
virtual void EndMissionSpecific (bool completed)
 
void ChangeLocationType (LocationTypeChange change)
 
HumanPrefab GetHumanPrefabFromElement (XElement element)
 
ItemPrefab FindItemPrefab (XElement element)
 
Vector2? GetCargoSpawnPosition (ItemPrefab itemPrefab, out Submarine cargoRoomSub)
 
LocalizedString GetRewardAmountText (Submarine sub)
 Returns the amount of marks you get from the reward (e.g. "3,000 mk") More...
 
void CreateMessageBox (LocalizedString header, LocalizedString message)
 

Static Protected Member Functions

static Character CreateHuman (HumanPrefab humanPrefab, List< Character > characters, Dictionary< Character, List< Item >> characterItems, Submarine submarine, CharacterTeamType teamType, ISpatialEntity positionToStayIn=null, Rand.RandSync humanPrefabRandSync=Rand.RandSync.ServerAndClient)
 

Protected Attributes

bool failed
 
Level level
 
int state
 
LocalizedString description
 
LocalizedString descriptionWithoutReward
 

Properties

virtual int? State [get, set]
 
int TimesAttempted [get, set]
 
static bool IsClient [get]
 
virtual LocalizedString Name [get]
 
virtual LocalizedString SuccessMessage [get]
 
virtual LocalizedString FailureMessage [get]
 
virtual LocalizedString Description [get]
 
virtual bool AllowUndocking [get]
 
virtual int Reward [get]
 
ImmutableList< MissionPrefab.ReputationRewardReputationRewards [get]
 
bool Completed [get, set]
 
bool Failed [get]
 
virtual bool AllowRespawn [get]
 
virtual int TeamCount [get]
 
virtual SubmarineInfo EnemySubmarineInfo [get]
 
virtual IEnumerable<(LocalizedString Label, Vector2 Position)> SonarLabels [get]
 
Identifier SonarIconIdentifier [get]
 
int? Difficulty [get]
 
IEnumerable< LocalizedStringShownMessages [get]
 
bool DisplayTargetHudIcons [get]
 
virtual IEnumerable< EntityHudIconTargets [get]
 
abstract bool DisplayAsCompleted [get]
 Is the mission at a state at which the only thing left to do is to reach the end of the level? More...
 
abstract bool DisplayAsFailed [get]
 Is the mission at a state at which the mission cannot be completed anymore? More...
 

Detailed Description

Constructor & Destructor Documentation

◆ Mission()

Barotrauma.Mission.Mission ( MissionPrefab  prefab,
Location[]  locations,
Submarine  sub 
)

Member Function Documentation

◆ AdjustLevelData()

virtual void Barotrauma.Mission.AdjustLevelData ( LevelData  levelData)
virtual

◆ ChangeLocationType()

void Barotrauma.Mission.ChangeLocationType ( LocationTypeChange  change)
protected

◆ ClientRead()

virtual void Barotrauma.Mission.ClientRead ( IReadMessage  msg)
virtual

◆ ClientReadInitial()

◆ CreateHuman()

static Character Barotrauma.Mission.CreateHuman ( HumanPrefab  humanPrefab,
List< Character characters,
Dictionary< Character, List< Item >>  characterItems,
Submarine  submarine,
CharacterTeamType  teamType,
ISpatialEntity  positionToStayIn = null,
Rand.RandSync  humanPrefabRandSync = Rand.RandSync.ServerAndClient 
)
staticprotected

◆ CreateMessageBox()

void Barotrauma.Mission.CreateMessageBox ( LocalizedString  header,
LocalizedString  message 
)
protected

◆ DetermineCompleted()

◆ End()

void Barotrauma.Mission.End ( )

End the mission and give a reward if it was completed successfully

Definition at line 364 of file BarotraumaShared/SharedSource/Events/Missions/Mission.cs.

◆ EndMissionSpecific()

◆ FindItemPrefab()

ItemPrefab Barotrauma.Mission.FindItemPrefab ( XElement  element)
protected

◆ GetCargoSpawnPosition()

Vector2? Barotrauma.Mission.GetCargoSpawnPosition ( ItemPrefab  itemPrefab,
out Submarine  cargoRoomSub 
)
protected

◆ GetDifficultyColor() [1/2]

Color Barotrauma.Mission.GetDifficultyColor ( )

◆ GetDifficultyColor() [2/2]

static Color Barotrauma.Mission.GetDifficultyColor ( int  difficulty)
static

◆ GetFinalReward()

int Barotrauma.Mission.GetFinalReward ( Submarine  sub)

Get the final reward, taking talent bonuses into account if the mission has concluded and the talents modified the reward accordingly.

Definition at line 402 of file BarotraumaShared/SharedSource/Events/Missions/Mission.cs.

◆ GetHumanPrefabFromElement()

HumanPrefab Barotrauma.Mission.GetHumanPrefabFromElement ( XElement  element)
protected

◆ GetMissionRewardText()

virtual RichString Barotrauma.Mission.GetMissionRewardText ( Submarine  sub)
virtual

Returns the full reward text of the mission (e.g. "Reward: 2,000 mk" or "Reward: 500 mk x 2 (out of max 5) = 1,000 mk")

Reimplemented in Barotrauma.CargoMission.

Definition at line 58 of file BarotraumaClient/ClientSource/Events/Missions/Mission.cs.

◆ GetOverrideMusicType()

Identifier Barotrauma.Mission.GetOverrideMusicType ( )

◆ GetReputationRewardText()

RichString Barotrauma.Mission.GetReputationRewardText ( )

◆ GetReward()

virtual int Barotrauma.Mission.GetReward ( Submarine  sub)
virtual

◆ GetRewardAmountText()

LocalizedString Barotrauma.Mission.GetRewardAmountText ( Submarine  sub)
protected

Returns the amount of marks you get from the reward (e.g. "3,000 mk")

Definition at line 43 of file BarotraumaClient/ClientSource/Events/Missions/Mission.cs.

◆ GetRewardDistibutionSum()

static int Barotrauma.Mission.GetRewardDistibutionSum ( IEnumerable< Character crew,
int  rewardDistribution = 0 
)
static

◆ LoadRandom() [1/2]

static Mission Barotrauma.Mission.LoadRandom ( Location[]  locations,
MTRandom  rand,
bool  requireCorrectLocationType,
MissionType  missionType,
bool  isSinglePlayer = false 
)
static

◆ LoadRandom() [2/2]

static Mission Barotrauma.Mission.LoadRandom ( Location[]  locations,
string  seed,
bool  requireCorrectLocationType,
MissionType  missionType,
bool  isSinglePlayer = false 
)
static

◆ ModifyMessage()

virtual LocalizedString Barotrauma.Mission.ModifyMessage ( LocalizedString  message,
bool  color = true 
)
protectedvirtual

◆ SetLevel()

virtual void Barotrauma.Mission.SetLevel ( LevelData  level)
virtual

◆ ShowMessage()

void Barotrauma.Mission.ShowMessage ( int  missionState)
protected

◆ Start()

void Barotrauma.Mission.Start ( Level  level)

◆ StartMissionSpecific()

◆ Update()

void Barotrauma.Mission.Update ( float  deltaTime)

◆ UpdateMissionSpecific()

Member Data Documentation

◆ Amount

int Barotrauma.Mission.Amount
static

◆ description

LocalizedString Barotrauma.Mission.description
protected

◆ descriptionWithoutReward

LocalizedString Barotrauma.Mission.descriptionWithoutReward
protected

◆ failed

bool Barotrauma.Mission.failed
protected

◆ Headers

readonly ImmutableArray<LocalizedString> Barotrauma.Mission.Headers

◆ level

Level Barotrauma.Mission.level
protected

◆ Locations

readonly Location [] Barotrauma.Mission.Locations

◆ Messages

readonly ImmutableArray<LocalizedString> Barotrauma.Mission.Messages

◆ OnMissionStateChanged

Action<Mission> Barotrauma.Mission.OnMissionStateChanged

◆ OriginLocation

Location Barotrauma.Mission.OriginLocation

Where was this mission received from? Affects which faction we give reputation for if the mission is configured to give reputation for the faction that gave the mission. Defaults to Locations[0]

Definition at line 140 of file BarotraumaShared/SharedSource/Events/Missions/Mission.cs.

◆ Prefab

readonly MissionPrefab Barotrauma.Mission.Prefab

◆ state

int Barotrauma.Mission.state
protected

Property Documentation

◆ AllowRespawn

virtual bool Barotrauma.Mission.AllowRespawn
get

◆ AllowUndocking

virtual bool Barotrauma.Mission.AllowUndocking
get

◆ Completed

bool Barotrauma.Mission.Completed
getset

◆ Description

virtual LocalizedString Barotrauma.Mission.Description
get

◆ Difficulty

int? Barotrauma.Mission.Difficulty
get

◆ DisplayAsCompleted

abstract bool Barotrauma.Mission.DisplayAsCompleted
get

Is the mission at a state at which the only thing left to do is to reach the end of the level?

Definition at line 23 of file BarotraumaClient/ClientSource/Events/Missions/Mission.cs.

◆ DisplayAsFailed

abstract bool Barotrauma.Mission.DisplayAsFailed
get

Is the mission at a state at which the mission cannot be completed anymore?

Definition at line 27 of file BarotraumaClient/ClientSource/Events/Missions/Mission.cs.

◆ DisplayTargetHudIcons

bool Barotrauma.Mission.DisplayTargetHudIcons
get

◆ EnemySubmarineInfo

virtual SubmarineInfo Barotrauma.Mission.EnemySubmarineInfo
get

◆ Failed

bool Barotrauma.Mission.Failed
get

◆ FailureMessage

virtual LocalizedString Barotrauma.Mission.FailureMessage
get

◆ HudIconTargets

virtual IEnumerable<Entity> Barotrauma.Mission.HudIconTargets
get

◆ IsClient

bool Barotrauma.Mission.IsClient
staticgetprotected

◆ Name

virtual LocalizedString Barotrauma.Mission.Name
get

◆ ReputationRewards

ImmutableList<MissionPrefab.ReputationReward> Barotrauma.Mission.ReputationRewards
get

◆ Reward

virtual int Barotrauma.Mission.Reward
get

◆ ShownMessages

IEnumerable<LocalizedString> Barotrauma.Mission.ShownMessages
get

◆ SonarIconIdentifier

Identifier Barotrauma.Mission.SonarIconIdentifier
get

◆ SonarLabels

virtual IEnumerable<(LocalizedString Label, Vector2 Position)> Barotrauma.Mission.SonarLabels
get

◆ State

virtual int? Barotrauma.Mission.State
getset

◆ SuccessMessage

virtual LocalizedString Barotrauma.Mission.SuccessMessage
get

◆ TeamCount

virtual int Barotrauma.Mission.TeamCount
get

◆ TimesAttempted

int Barotrauma.Mission.TimesAttempted
getset