Barotrauma Server
|
Public Types | |
enum | InteractionType { None , Talk , Examine , Map , Crew , Store , Upgrade , PurchaseSub , MedicalClinic , Cargo } |
enum | TransitionType { None , LeaveLocation , ProgressToNextLocation , ReturnToPreviousLocation , ReturnToPreviousEmptyLocation , ProgressToNextEmptyLocation , End } |
Public Member Functions | |
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. | |
SubmarineInfo | GetPredefinedStartOutpost () |
override void | Start () |
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) | |
TransitionType | GetAvailableTransition () |
override void | End (CampaignMode.TransitionType transitionType=CampaignMode.TransitionType.None) |
void | HandleSaveAndQuit () |
Handles updating store stock, registering event history and relocating items (i.e. things that need to be done when saving and quitting mid-round) | |
void | UpdateStoreStock () |
Updates store stock before saving the game. | |
void | EndCampaign () |
Faction | GetRandomFaction (Rand.RandSync randSync, bool allowEmpty=true) |
Returns a random faction based on their ControlledOutpostPercentage. | |
Faction | GetRandomSecondaryFaction (Rand.RandSync randSync, bool allowEmpty=true) |
Returns a random faction based on their SecondaryControlledOutpostPercentage. | |
bool | TryHireCharacter (Location location, CharacterInfo characterInfo, bool takeMoney=true, Client client=null, bool buyingNewCharacter=false) |
int | NewCharacterCost (CharacterInfo characterInfo) |
bool | CanAffordNewCharacter (CharacterInfo characterInfo) |
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 | Save (XElement element) |
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 () |
![]() | |
virtual void | UpdateWhilePaused (float deltaTime) |
GameMode (GameModePreset preset) | |
virtual void | AddToGUIUpdateList () |
virtual void | Update (float deltaTime) |
Static Public Member Functions | |
static bool | BlocksInteraction (InteractionType interactionType) |
static List< Submarine > | GetSubsToLeaveBehind (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 (Client client, ClientPermissions permissions) |
There is a client-side implementation of the method in CampaignMode | |
static bool | AllowImmediateItemDelivery (Client client) |
static bool | AllowedToManageWallets (Client client) |
Public Attributes | |
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 | PurchasedHullRepairsInLatestSave |
bool | PurchasedItemRepairsInLatestSave |
bool | DivingSuitWarningShown |
bool | ItemsRelocatedToMainSub |
Static Public Attributes | |
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 float | ItemRepairCostPerRepairDuration = 1.0f |
const int | ShuttleReplaceCost = 1000 |
const int | MaxHullRepairCost = 600 |
const int | MaxItemRepairCost = 2000 |
![]() | |
static List< GameModePreset > | PresetList = new List<GameModePreset>() |
Protected Member Functions | |
CampaignMode (GameModePreset preset, CampaignSettings settings) | |
void | LoadInitialLevel () |
Load the first level and start the round after loading a save file. | |
IEnumerable< CoroutineStatus > | DoLevelTransition (TransitionType transitionType, LevelData newLevel, Submarine leavingSub, bool mirror) |
virtual void | EndCampaignProjSpecific () |
void | KeepCharactersCloseToOutpost (float deltaTime) |
void | LoadStats (XElement element) |
XElement | SaveStats () |
void | TransferItemsBetweenSubs () |
Also serializes the current sub. | |
void | RefreshOwnedSubmarines () |
Static Protected Member Functions | |
static void | LeaveUnconnectedSubs (Submarine leavingSub) |
Protected Attributes | |
XElement | petsElement |
bool | wasDocked |
Map | map |
![]() | |
DateTime | startTime |
GameModePreset | preset |
Static Protected Attributes | |
const float | EndTransitionDuration = 5.0f |
Properties | |
IReadOnlyList< Faction > | Factions [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< Mission > | Missions [get] |
Location | CurrentLocation [get] |
LevelData | NextLevel [get, protected set] |
virtual bool | PurchasedHullRepairs [get, set] |
virtual bool | PurchasedLostShuttles [get, set] |
virtual bool | PurchasedItemRepairs [get, set] |
bool | MirrorLevel [get, protected set] |
![]() | |
CrewManager | CrewManager [get] |
virtual IEnumerable< Mission > | Missions [get] |
bool | IsSinglePlayer [get] |
LocalizedString | Name [get] |
virtual bool | Paused [get] |
GameModePreset | Preset [get] |
Events | |
Action | BeforeLevelLoading |
Automatically cleared after triggering -> no need to unregister. | |
Action | OnSaveAndQuit |
Triggers when saving and quitting mid-round (as in, not just transferring to a new level). Automatically cleared after triggering -> no need to unregister. | |
|
protected |
|
virtual |
Reimplemented from Barotrauma.GameMode.
|
static |
There is a client-side implementation of the method in CampaignMode
|
static |
|
static |
void Barotrauma.CampaignMode.AssignNPCMenuInteraction | ( | Character | character, |
InteractionType | interactionType ) |
|
static |
bool Barotrauma.CampaignMode.CanAfford | ( | int | cost, |
Client | client = null ) |
bool Barotrauma.CampaignMode.CanAffordNewCharacter | ( | CharacterInfo | characterInfo | ) |
|
abstractprotected |
|
virtual |
Reimplemented from Barotrauma.GameMode.
Reimplemented in Barotrauma.MultiPlayerCampaign.
void Barotrauma.CampaignMode.EndCampaign | ( | ) |
|
protectedvirtual |
TransitionType Barotrauma.CampaignMode.GetAvailableTransition | ( | ) |
TransitionType Barotrauma.CampaignMode.GetAvailableTransition | ( | out LevelData | nextLevel, |
out Submarine | leavingSub ) |
Which type of transition between levels is currently possible (if any)
|
virtual |
Reimplemented in Barotrauma.MultiPlayerCampaign.
Location Barotrauma.CampaignMode.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.
Faction Barotrauma.CampaignMode.GetFaction | ( | Identifier | identifier | ) |
FactionAffiliation Barotrauma.CampaignMode.GetFactionAffiliation | ( | Identifier | factionIdentifier | ) |
|
static |
|
static |
SubmarineInfo Barotrauma.CampaignMode.GetPredefinedStartOutpost | ( | ) |
|
static |
|
static |
Faction Barotrauma.CampaignMode.GetRandomFaction | ( | Rand.RandSync | randSync, |
bool | allowEmpty = true ) |
Returns a random faction based on their ControlledOutpostPercentage.
allowEmpty | If true, the method can return null if the sum of the factions ControlledOutpostPercentage is less than 100% |
Faction Barotrauma.CampaignMode.GetRandomSecondaryFaction | ( | Rand.RandSync | randSync, |
bool | allowEmpty = true ) |
Returns a random faction based on their SecondaryControlledOutpostPercentage.
allowEmpty | If true, the method can return null if the sum of the factions SecondaryControlledOutpostPercentage is less than 100% |
float Barotrauma.CampaignMode.GetReputation | ( | Identifier | factionIdentifier | ) |
|
static |
|
virtual |
Reimplemented in Barotrauma.MultiPlayerCampaign.
void Barotrauma.CampaignMode.HandleSaveAndQuit | ( | ) |
Handles updating store stock, registering event history and relocating items (i.e. things that need to be done when saving and quitting mid-round)
void Barotrauma.CampaignMode.InitFactions | ( | ) |
|
protected |
|
staticprotected |
void Barotrauma.CampaignMode.LoadActiveOrders | ( | ) |
|
abstractprotected |
Load the first level and start the round after loading a save file.
void Barotrauma.CampaignMode.LoadNewLevel | ( | ) |
void Barotrauma.CampaignMode.LoadPets | ( | ) |
|
protected |
void Barotrauma.CampaignMode.LogState | ( | ) |
int Barotrauma.CampaignMode.NewCharacterCost | ( | CharacterInfo | characterInfo | ) |
int Barotrauma.CampaignMode.NumberOfMissionsAtLocation | ( | Location | location | ) |
void Barotrauma.CampaignMode.OutpostNPCAttacked | ( | Character | npc, |
Character | attacker, | ||
AttackResult | attackResult ) |
|
protected |
|
virtual |
Reimplemented from Barotrauma.GameMode.
|
abstract |
void Barotrauma.CampaignMode.SaveActiveOrders | ( | XElement | parentElement = null | ) |
void Barotrauma.CampaignMode.SavePets | ( | XElement | parentElement = null | ) |
|
protected |
|
virtual |
Reimplemented from Barotrauma.GameMode.
|
virtual |
Reimplemented from Barotrauma.GameMode.
Reimplemented in Barotrauma.MultiPlayerCampaign.
void Barotrauma.CampaignMode.SwitchSubs | ( | ) |
|
protected |
Also serializes the current sub.
bool Barotrauma.CampaignMode.TryHireCharacter | ( | Location | location, |
CharacterInfo | characterInfo, | ||
bool | takeMoney = true, | ||
Client | client = null, | ||
bool | buyingNewCharacter = false ) |
|
virtual |
Reimplemented in Barotrauma.MultiPlayerCampaign.
void Barotrauma.CampaignMode.UpdateStoreStock | ( | ) |
Updates store stock before saving the game.
Wallet Barotrauma.CampaignMode.Bank |
readonly CampaignMetadata Barotrauma.CampaignMode.CampaignMetadata |
readonly CargoManager Barotrauma.CampaignMode.CargoManager |
bool Barotrauma.CampaignMode.CheatsEnabled |
bool Barotrauma.CampaignMode.DivingSuitWarningShown |
|
staticprotected |
|
static |
|
static |
|
static |
bool Barotrauma.CampaignMode.ItemsRelocatedToMainSub |
|
protected |
|
static |
|
static |
|
static |
MedicalClinic Barotrauma.CampaignMode.MedicalClinic |
readonly NamedEvent<WalletChangedEvent> Barotrauma.CampaignMode.OnMoneyChanged = new NamedEvent<WalletChangedEvent>() |
SubmarineInfo Barotrauma.CampaignMode.PendingSubmarineSwitch |
|
protected |
bool Barotrauma.CampaignMode.PurchasedHullRepairsInLatestSave |
bool Barotrauma.CampaignMode.PurchasedItemRepairsInLatestSave |
bool Barotrauma.CampaignMode.PurchasedLostShuttlesInLatestSave |
CampaignSettings Barotrauma.CampaignMode.Settings |
|
static |
int Barotrauma.CampaignMode.TotalPassedLevels |
double Barotrauma.CampaignMode.TotalPlayTime |
UpgradeManager Barotrauma.CampaignMode.UpgradeManager |
|
protected |
|
getsetprotected |
|
get |
|
get |
|
get |
|
getprotected set |
|
get |
|
getprotected set |
|
get |
|
getprotected set |
|
getset |
|
getset |
|
getset |
|
get |
|
getset |
Action Barotrauma.CampaignMode.BeforeLevelLoading |
Automatically cleared after triggering -> no need to unregister.
Action Barotrauma.CampaignMode.OnSaveAndQuit |
Triggers when saving and quitting mid-round (as in, not just transferring to a new level). Automatically cleared after triggering -> no need to unregister.