Barotrauma Client Doc
Barotrauma.SinglePlayerCampaign Class Reference
Inheritance diagram for Barotrauma.SinglePlayerCampaign:
Barotrauma.CampaignMode Barotrauma.GameMode Barotrauma.GameMode

Public Member Functions

override void UpdateWhilePaused (float deltaTime)
 
override void HUDScaleChanged ()
 
override void Start ()
 
override void Update (float deltaTime)
 
override void Save (XElement element)
 
- Public Member Functions inherited from Barotrauma.CampaignMode
virtual Wallet GetWallet (Client client=null)
 
virtual bool TryPurchase (Client client, int price)
 
virtual int GetBalance (Client client=null)
 
bool CanAfford (int cost, Client client=null)
 
Location GetCurrentDisplayLocation ()
 The location that's displayed as the "current one" in the map screen. Normally the current outpost or the location at the start of the level, but when selecting the next destination at the end of the level at an uninhabited location we use the location at the end More...
 
void InitFactions ()
 
override void AddExtraMissions (LevelData levelData)
 
void LoadNewLevel ()
 
TransitionType GetAvailableTransition (out LevelData nextLevel, out Submarine leavingSub)
 Which type of transition between levels is currently possible (if any) More...
 
TransitionType GetAvailableTransition ()
 
override void End (CampaignMode.TransitionType transitionType=CampaignMode.TransitionType.None)
 
void UpdateStoreStock ()
 Updates store stock before saving the game More...
 
void EndCampaign ()
 
Faction GetRandomFaction (Rand.RandSync randSync, bool allowEmpty=true)
 Returns a random faction based on their ControlledOutpostPercentage More...
 
Faction GetRandomSecondaryFaction (Rand.RandSync randSync, bool allowEmpty=true)
 Returns a random faction based on their SecondaryControlledOutpostPercentage More...
 
bool TryHireCharacter (Location location, CharacterInfo characterInfo, Character hirer, Client client=null)
 
void AssignNPCMenuInteraction (Character character, InteractionType interactionType)
 
void OutpostNPCAttacked (Character npc, Character attacker, AttackResult attackResult)
 
Faction GetFaction (Identifier identifier)
 
float GetReputation (Identifier factionIdentifier)
 
FactionAffiliation GetFactionAffiliation (Identifier factionIdentifier)
 
void LogState ()
 
override void Remove ()
 
int NumberOfMissionsAtLocation (Location location)
 
void CheckTooManyMissions (Location currentLocation, Client sender)
 
void SwitchSubs ()
 
void SavePets (XElement parentElement=null)
 
void LoadPets ()
 
void SaveActiveOrders (XElement parentElement=null)
 
void LoadActiveOrders ()
 
override void ShowStartMessage ()
 
override void Draw (SpriteBatch spriteBatch)
 
Task SelectSummaryScreen (RoundSummary roundSummary, LevelData newLevel, bool mirror, Action action)
 
void CancelStartRound ()
 
void ThrowIfStartRoundCancellationRequested ()
 
override void AddToGUIUpdateList ()
 
- Public Member Functions inherited from Barotrauma.GameMode
 GameMode (GameModePreset preset)
 
virtual void End (CampaignMode.TransitionType transitionType=CampaignMode.TransitionType.None)
 

Static Public Member Functions

static SinglePlayerCampaign StartNew (string mapSeed, CampaignSettings startingSettings)
 Start a completely new single player campaign More...
 
static SinglePlayerCampaign Load (XElement element)
 Load a previously saved single player campaign from xml More...
 
- Static Public Member Functions inherited from Barotrauma.CampaignMode
static bool BlocksInteraction (InteractionType interactionType)
 
static List< SubmarineGetSubsToLeaveBehind (Submarine leavingSub)
 
static int GetHullRepairCost ()
 
static int GetItemRepairCost ()
 
static Faction GetRandomFaction (IEnumerable< Faction > factions, Rand.RandSync randSync, bool secondary=false, bool allowEmpty=true)
 
static Faction GetRandomFaction (IEnumerable< Faction > factions, Random random, bool secondary=false, bool allowEmpty=true)
 
static bool AllowedToManageCampaign (ClientPermissions permissions)
 There is a server-side implementation of the method in MultiPlayerCampaign More...
 
static bool AllowedToManageWallets ()
 
static bool AllowImmediateItemDelivery ()
 

Static Public Attributes

const int MinimumInitialMoney = 0
 
- Static Public Attributes inherited from Barotrauma.CampaignMode
readonly record struct SaveInfo(string FilePath, Option< SerializableDateTime > SaveTime, string SubmarineName, ImmutableArray< string > EnabledContentPackageNames) const int MaxMoney = int.MaxValue / 2
 
const int InitialMoney = 8500
 
const float HullRepairCostPerDamage = 0.1f
 
const int ShuttleReplaceCost = 1000
 
const int MaxHullRepairCost = 600
 
- Static Public Attributes inherited from Barotrauma.GameMode
static List< GameModePresetPresetList = new List<GameModePreset>()
 

Protected Member Functions

override void LoadInitialLevel ()
 Load the first level and start the round after loading a save file More...
 
override IEnumerable< CoroutineStatusDoLevelTransition (TransitionType transitionType, LevelData newLevel, Submarine leavingSub, bool mirror)
 
override void EndCampaignProjSpecific ()
 
- Protected Member Functions inherited from Barotrauma.CampaignMode
 CampaignMode (GameModePreset preset, CampaignSettings settings)
 
void KeepCharactersCloseToOutpost (float deltaTime)
 
void LoadStats (XElement element)
 
XElement SaveStats ()
 
void TransferItemsBetweenSubs ()
 Also serializes the current sub. More...
 
void RefreshOwnedSubmarines ()
 
GUIButton CreateEndRoundButton ()
 
SubmarineInfo GetPredefinedStartOutpost ()
 
void TryEndRoundWithFuelCheck (Action onConfirm, Action onReturnToMapScreen)
 

Properties

override bool Paused [get]
 
override bool PurchasedHullRepairs [get, set]
 
override bool PurchasedLostShuttles [get, set]
 
override bool PurchasedItemRepairs [get, set]
 
- Properties inherited from Barotrauma.CampaignMode
IReadOnlyList< FactionFactions [get]
 
XElement ActiveOrdersElement [get, set]
 
bool IsFirstRound = true [get, protected set]
 
bool DisableEvents [get]
 
bool TransferItemsOnSubSwitch [get, set]
 
bool SwitchedSubsThisRound [get]
 
Map Map [get]
 
override IEnumerable< MissionMissions [get]
 
Location CurrentLocation [get]
 
LevelData NextLevel [get, protected set]
 
virtual bool PurchasedHullRepairs [get, set]
 
virtual bool PurchasedLostShuttles [get, set]
 
virtual bool PurchasedItemRepairs [get, set]
 
GUIButton EndRoundButton [get]
 
SlideshowPlayer SlideshowPlayer [get, protected set]
 
bool ForceMapUI [get, protected set]
 
bool??????? ShowCampaignUI [get, set]
 
virtual Wallet Wallet [get]
 Gets the current personal wallet In singleplayer this is the campaign bank and in multiplayer this is the personal wallet More...
 
- Properties inherited from Barotrauma.GameMode
CrewManagerCrewManager [get]
 
virtual IEnumerable< MissionMissions [get]
 
bool IsSinglePlayer [get]
 
LocalizedString Name [get]
 
virtual bool Paused [get]
 
GameModePreset Preset [get]
 

Additional Inherited Members

- Public Types inherited from Barotrauma.CampaignMode
enum class  InteractionType {
  None , Talk , Examine , Map ,
  Crew , Store , Upgrade , PurchaseSub ,
  MedicalClinic , Cargo
}
 
enum class  TransitionType {
  None , LeaveLocation , ProgressToNextLocation , ReturnToPreviousLocation ,
  ReturnToPreviousEmptyLocation , ProgressToNextEmptyLocation , End
}
 
- Public Attributes inherited from Barotrauma.CampaignMode
double TotalPlayTime
 
int TotalPassedLevels
 
readonly CargoManager CargoManager
 
UpgradeManager UpgradeManager
 
MedicalClinic MedicalClinic
 
readonly CampaignMetadata CampaignMetadata
 
CampaignSettings Settings
 
readonly NamedEvent< WalletChangedEvent > OnMoneyChanged = new NamedEvent<WalletChangedEvent>()
 
bool CheatsEnabled
 
SubmarineInfo PendingSubmarineSwitch
 
Wallet Bank
 
bool PurchasedLostShuttlesInLatestSave
 
bool DivingSuitWarningShown
 
GUIButton ReadyCheckButton
 
CampaignUI CampaignUI
 
- Static Protected Member Functions inherited from Barotrauma.CampaignMode
static void LeaveUnconnectedSubs (Submarine leavingSub)
 
- Protected Attributes inherited from Barotrauma.CampaignMode
XElement petsElement
 
bool wasDocked
 
Map map
 
bool crewDead
 
Color overlayColor
 
Sprite overlaySprite
 
GUIButton endRoundButton
 
GUIFrame campaignUIContainer
 
- Protected Attributes inherited from Barotrauma.GameMode
DateTime startTime
 
GameModePreset preset
 
- Static Protected Attributes inherited from Barotrauma.CampaignMode
const float EndTransitionDuration = 5.0f
 
- Events inherited from Barotrauma.CampaignMode
Action BeforeLevelLoading
 Automatically cleared after triggering -> no need to unregister More...
 

Detailed Description

Definition at line 9 of file SinglePlayerCampaign.cs.

Member Function Documentation

◆ DoLevelTransition()

override IEnumerable<CoroutineStatus> Barotrauma.SinglePlayerCampaign.DoLevelTransition ( TransitionType  transitionType,
LevelData  newLevel,
Submarine  leavingSub,
bool  mirror 
)
protectedvirtual

Implements Barotrauma.CampaignMode.

Definition at line 371 of file SinglePlayerCampaign.cs.

◆ EndCampaignProjSpecific()

override void Barotrauma.SinglePlayerCampaign.EndCampaignProjSpecific ( )
protectedvirtual

Reimplemented from Barotrauma.CampaignMode.

Definition at line 480 of file SinglePlayerCampaign.cs.

◆ HUDScaleChanged()

override void Barotrauma.SinglePlayerCampaign.HUDScaleChanged ( )
virtual

Reimplemented from Barotrauma.GameMode.

Definition at line 227 of file SinglePlayerCampaign.cs.

◆ Load()

static SinglePlayerCampaign Barotrauma.SinglePlayerCampaign.Load ( XElement  element)
static

Load a previously saved single player campaign from xml

Parameters
element
Returns

◆ LoadInitialLevel()

override void Barotrauma.SinglePlayerCampaign.LoadInitialLevel ( )
protectedvirtual

Load the first level and start the round after loading a save file

Implements Barotrauma.CampaignMode.

Definition at line 259 of file SinglePlayerCampaign.cs.

◆ Save()

override void Barotrauma.SinglePlayerCampaign.Save ( XElement  element)
virtual

Implements Barotrauma.CampaignMode.

Definition at line 673 of file SinglePlayerCampaign.cs.

◆ Start()

override void Barotrauma.SinglePlayerCampaign.Start ( )
virtual

Reimplemented from Barotrauma.CampaignMode.

Definition at line 234 of file SinglePlayerCampaign.cs.

◆ StartNew()

static SinglePlayerCampaign Barotrauma.SinglePlayerCampaign.StartNew ( string  mapSeed,
CampaignSettings  startingSettings 
)
static

Start a completely new single player campaign

◆ Update()

override void Barotrauma.SinglePlayerCampaign.Update ( float  deltaTime)
virtual

Reimplemented from Barotrauma.CampaignMode.

Definition at line 494 of file SinglePlayerCampaign.cs.

◆ UpdateWhilePaused()

override void Barotrauma.SinglePlayerCampaign.UpdateWhilePaused ( float  deltaTime)
virtual

Reimplemented from Barotrauma.GameMode.

Definition at line 24 of file SinglePlayerCampaign.cs.

Member Data Documentation

◆ MinimumInitialMoney

const int Barotrauma.SinglePlayerCampaign.MinimumInitialMoney = 0
static

Definition at line 11 of file SinglePlayerCampaign.cs.

Property Documentation

◆ Paused

override bool Barotrauma.SinglePlayerCampaign.Paused
get

Definition at line 13 of file SinglePlayerCampaign.cs.

◆ PurchasedHullRepairs

override bool Barotrauma.SinglePlayerCampaign.PurchasedHullRepairs
getset

Definition at line 56 of file SinglePlayerCampaign.cs.

◆ PurchasedItemRepairs

override bool Barotrauma.SinglePlayerCampaign.PurchasedItemRepairs
getset

Definition at line 72 of file SinglePlayerCampaign.cs.

◆ PurchasedLostShuttles

override bool Barotrauma.SinglePlayerCampaign.PurchasedLostShuttles
getset

Definition at line 64 of file SinglePlayerCampaign.cs.