Barotrauma Client Doc
Barotrauma.Location Class Reference

Classes

class  AbilityLocation
 
class  StoreInfo
 
class  TakenItem
 

Public Member Functions

void SelectMission (Mission mission)
 
void DeselectMission (Mission mission)
 
List< int > GetSelectedMissionIndices ()
 
void SetSelectedMissionIndices (IEnumerable< int > missionIndices)
 
override string ToString ()
 
 Location (Vector2 mapPosition, int? zone, Random rand, bool requireOutpost=false, LocationType forceLocationType=null, IEnumerable< Location > existingLocations=null)
 
 Location (CampaignMode campaign, XElement element)
 Create a location from save data More...
 
void LoadLocationTypeChange (XElement locationElement)
 
void LoadMissions (XElement locationElement)
 
void ChangeType (CampaignMode campaign, LocationType newType, bool createStores=true)
 
void UnlockInitialMissions (Rand.RandSync randSync=Rand.RandSync.ServerAndClient)
 
void UnlockMission (MissionPrefab missionPrefab, LocationConnection connection)
 
void UnlockMission (MissionPrefab missionPrefab)
 
Mission UnlockMissionByIdentifier (Identifier identifier, ContentPackage invokingContentPackage=null)
 
Mission UnlockMissionByTag (Identifier tag, Random random=null, ContentPackage invokingContentPackage=null)
 
void InstantiateLoadedMissions (Map map)
 
void ClearMissions ()
 Removes all unlocked missions from the location More...
 
bool HasOutpost ()
 
bool IsCriticallyRadiated ()
 
LocationType GetLocationType ()
 
IEnumerable< MissionGetMissionsInConnection (LocationConnection connection)
 
void RemoveHireableCharacter (CharacterInfo character)
 
IEnumerable< CharacterInfoGetHireableCharacters ()
 
void ForceName (Identifier nameId)
 
void LoadStores (XElement locationElement)
 
bool IsRadiated ()
 
void RegisterTakenItems (IEnumerable< Item > items)
 Mark the items that have been taken from the outpost to prevent them from spawning when re-entering the outpost More...
 
void RegisterKilledCharacters (IEnumerable< Character > characters)
 Mark the characters who have been killed to prevent them from spawning when re-entering the outpost More...
 
void RemoveTakenItems ()
 
int GetAdjustedMechanicalCost (int cost)
 
int GetAdjustedHealCost (int cost)
 
StoreInfo GetStore (Identifier identifier)
 
void CreateStores (bool force=false)
 
Parameters
forceIf true, the stores will be recreated if they already exists.
More...
 
void UpdateStores ()
 
void UpdateSpecials ()
 
void AddStock (Dictionary< Identifier, List< SoldItem >> items)
 
void RemoveStock (Dictionary< Identifier, List< PurchasedItem >> items)
 
bool CanHaveSubsForSale ()
 
int HighestSubmarineTierAvailable (SubmarineClass submarineClass=SubmarineClass.Undefined)
 
bool IsSubmarineAvailable (SubmarineInfo info)
 
void Reset (CampaignMode campaign)
 
XElement Save (Map map, XElement parentElement)
 
void Remove ()
 
void RemoveProjSpecific ()
 

Static Public Member Functions

static Location CreateRandom (Vector2 position, int? zone, Random rand, bool requireOutpost, LocationType forceLocationType=null, IEnumerable< Location > existingLocations=null)
 
static int GetExtraSpecialSalesCount ()
 

Public Attributes

readonly List< LocationConnectionConnections = new List<LocationConnection>()
 
readonly Dictionary< LocationTypeChange.Requirement, int > ProximityTimer = new Dictionary<LocationTypeChange.Requirement, int>()
 
LocationTypeChange typeChange
 
int LocationTypeChangeCooldown
 
bool DisallowLocationTypeChanges
 
string LastTypeChangeMessage
 
int TimeSinceLastTypeChange
 
bool IsGateBetweenBiomes
 
HireManager HireManager
 

Properties

LocalizedString DisplayName [get]
 
Identifier NameIdentifier [get]
 
bool Discovered [get]
 
bool Visited [get]
 
bool LocationTypeChangesBlocked [get]
 Is some mission blocking this location from changing its type, or have location type changes been forcibly disabled on the location? More...
 
Biome Biome [get, set]
 
Vector2 MapPosition [get]
 
LocationType Type [get]
 
LocationType OriginalType [get]
 
LevelData LevelData [get, set]
 
int PortraitId [get]
 
Faction Faction [get, set]
 
Faction SecondaryFaction [get, set]
 
Reputation Reputation [get]
 
bool IsFactionHostile [get]
 
int TurnsInRadiation [get, set]
 
Dictionary< Identifier, StoreInfoStores [get, set]
 
int StoreInitialBalance [get]
 
int DailySpecialsCount [get]
 
int RequestedGoodsCount [get]
 
HashSet< IdentifierStoreIdentifiers = new HashSet<Identifier>() [get]
 
IEnumerable< TakenItemTakenItems [get]
 
IEnumerable< int > KilledCharacterIdentifiers [get]
 
IEnumerable< MissionAvailableMissions [get]
 
IEnumerable< MissionSelectedMissions [get]
 
float PriceMultiplier [get, set]
 
float MechanicalPriceMultiplier [get, set]
 

Detailed Description

Definition at line 11 of file Location.cs.

Constructor & Destructor Documentation

◆ Location() [1/2]

Barotrauma.Location.Location ( Vector2  mapPosition,
int?  zone,
Random  rand,
bool  requireOutpost = false,
LocationType  forceLocationType = null,
IEnumerable< Location existingLocations = null 
)

Definition at line 547 of file Location.cs.

◆ Location() [2/2]

Barotrauma.Location.Location ( CampaignMode  campaign,
XElement  element 
)

Create a location from save data

Definition at line 559 of file Location.cs.

Member Function Documentation

◆ AddStock()

void Barotrauma.Location.AddStock ( Dictionary< Identifier, List< SoldItem >>  items)

Definition at line 1432 of file Location.cs.

◆ CanHaveSubsForSale()

bool Barotrauma.Location.CanHaveSubsForSale ( )

Definition at line 1463 of file Location.cs.

◆ ChangeType()

void Barotrauma.Location.ChangeType ( CampaignMode  campaign,
LocationType  newType,
bool  createStores = true 
)

Definition at line 749 of file Location.cs.

◆ ClearMissions()

void Barotrauma.Location.ClearMissions ( )

Removes all unlocked missions from the location

Definition at line 1042 of file Location.cs.

◆ CreateRandom()

static Location Barotrauma.Location.CreateRandom ( Vector2  position,
int?  zone,
Random  rand,
bool  requireOutpost,
LocationType  forceLocationType = null,
IEnumerable< Location existingLocations = null 
)
static

Definition at line 744 of file Location.cs.

◆ CreateStores()

void Barotrauma.Location.CreateStores ( bool  force = false)

Parameters
forceIf true, the stores will be recreated if they already exists.

Definition at line 1280 of file Location.cs.

◆ DeselectMission()

void Barotrauma.Location.DeselectMission ( Mission  mission)

Definition at line 466 of file Location.cs.

◆ ForceName()

void Barotrauma.Location.ForceName ( Identifier  nameId)

Definition at line 1160 of file Location.cs.

◆ GetAdjustedHealCost()

int Barotrauma.Location.GetAdjustedHealCost ( int  cost)

Definition at line 1260 of file Location.cs.

◆ GetAdjustedMechanicalCost()

int Barotrauma.Location.GetAdjustedMechanicalCost ( int  cost)

Definition at line 1250 of file Location.cs.

◆ GetExtraSpecialSalesCount()

static int Barotrauma.Location.GetExtraSpecialSalesCount ( )
static

Definition at line 1456 of file Location.cs.

◆ GetHireableCharacters()

IEnumerable<CharacterInfo> Barotrauma.Location.GetHireableCharacters ( )

Definition at line 1103 of file Location.cs.

◆ GetLocationType()

LocationType Barotrauma.Location.GetLocationType ( )

Definition at line 1065 of file Location.cs.

◆ GetMissionsInConnection()

IEnumerable<Mission> Barotrauma.Location.GetMissionsInConnection ( LocationConnection  connection)

Definition at line 1081 of file Location.cs.

◆ GetSelectedMissionIndices()

List<int> Barotrauma.Location.GetSelectedMissionIndices ( )

Definition at line 472 of file Location.cs.

◆ GetStore()

StoreInfo Barotrauma.Location.GetStore ( Identifier  identifier)

Definition at line 1270 of file Location.cs.

◆ HasOutpost()

bool Barotrauma.Location.HasOutpost ( )

Definition at line 1048 of file Location.cs.

◆ HighestSubmarineTierAvailable()

int Barotrauma.Location.HighestSubmarineTierAvailable ( SubmarineClass  submarineClass = SubmarineClass.Undefined)

Definition at line 1468 of file Location.cs.

◆ InstantiateLoadedMissions()

void Barotrauma.Location.InstantiateLoadedMissions ( Map  map)

Definition at line 997 of file Location.cs.

◆ IsCriticallyRadiated()

bool Barotrauma.Location.IsCriticallyRadiated ( )

Definition at line 1055 of file Location.cs.

◆ IsRadiated()

bool Barotrauma.Location.IsRadiated ( )

◆ IsSubmarineAvailable()

bool Barotrauma.Location.IsSubmarineAvailable ( SubmarineInfo  info)

Definition at line 1477 of file Location.cs.

◆ LoadLocationTypeChange()

void Barotrauma.Location.LoadLocationTypeChange ( XElement  locationElement)

Definition at line 692 of file Location.cs.

◆ LoadMissions()

void Barotrauma.Location.LoadMissions ( XElement  locationElement)

Definition at line 728 of file Location.cs.

◆ LoadStores()

void Barotrauma.Location.LoadStores ( XElement  locationElement)

Definition at line 1167 of file Location.cs.

◆ RegisterKilledCharacters()

void Barotrauma.Location.RegisterKilledCharacters ( IEnumerable< Character characters)

Mark the characters who have been killed to prevent them from spawning when re-entering the outpost

Definition at line 1232 of file Location.cs.

◆ RegisterTakenItems()

void Barotrauma.Location.RegisterTakenItems ( IEnumerable< Item items)

Mark the items that have been taken from the outpost to prevent them from spawning when re-entering the outpost

Definition at line 1214 of file Location.cs.

◆ Remove()

void Barotrauma.Location.Remove ( )

Definition at line 1653 of file Location.cs.

◆ RemoveHireableCharacter()

void Barotrauma.Location.RemoveHireableCharacter ( CharacterInfo  character)

Definition at line 1087 of file Location.cs.

◆ RemoveProjSpecific()

void Barotrauma.Location.RemoveProjSpecific ( )

Definition at line 1658 of file Location.cs.

◆ RemoveStock()

void Barotrauma.Location.RemoveStock ( Dictionary< Identifier, List< PurchasedItem >>  items)

Definition at line 1444 of file Location.cs.

◆ RemoveTakenItems()

void Barotrauma.Location.RemoveTakenItems ( )

Definition at line 1241 of file Location.cs.

◆ Reset()

void Barotrauma.Location.Reset ( CampaignMode  campaign)

Definition at line 1489 of file Location.cs.

◆ Save()

XElement Barotrauma.Location.Save ( Map  map,
XElement  parentElement 
)

Definition at line 1502 of file Location.cs.

◆ SelectMission()

void Barotrauma.Location.SelectMission ( Mission  mission)

Definition at line 457 of file Location.cs.

◆ SetSelectedMissionIndices()

void Barotrauma.Location.SetSelectedMissionIndices ( IEnumerable< int >  missionIndices)

Definition at line 485 of file Location.cs.

◆ ToString()

override string Barotrauma.Location.ToString ( )

Definition at line 542 of file Location.cs.

◆ UnlockInitialMissions()

void Barotrauma.Location.UnlockInitialMissions ( Rand.RandSync  randSync = Rand.RandSync.ServerAndClient)

Definition at line 802 of file Location.cs.

◆ UnlockMission() [1/2]

void Barotrauma.Location.UnlockMission ( MissionPrefab  missionPrefab)

Definition at line 821 of file Location.cs.

◆ UnlockMission() [2/2]

void Barotrauma.Location.UnlockMission ( MissionPrefab  missionPrefab,
LocationConnection  connection 
)

Definition at line 814 of file Location.cs.

◆ UnlockMissionByIdentifier()

Mission Barotrauma.Location.UnlockMissionByIdentifier ( Identifier  identifier,
ContentPackage  invokingContentPackage = null 
)

Definition at line 828 of file Location.cs.

◆ UnlockMissionByTag()

Mission Barotrauma.Location.UnlockMissionByTag ( Identifier  tag,
Random  random = null,
ContentPackage  invokingContentPackage = null 
)

Definition at line 854 of file Location.cs.

◆ UpdateSpecials()

void Barotrauma.Location.UpdateSpecials ( )

Definition at line 1397 of file Location.cs.

◆ UpdateStores()

void Barotrauma.Location.UpdateStores ( )

Definition at line 1332 of file Location.cs.

Member Data Documentation

◆ Connections

readonly List<LocationConnection> Barotrauma.Location.Connections = new List<LocationConnection>()

Definition at line 56 of file Location.cs.

◆ DisallowLocationTypeChanges

bool Barotrauma.Location.DisallowLocationTypeChanges

Definition at line 85 of file Location.cs.

◆ HireManager

HireManager Barotrauma.Location.HireManager

Definition at line 540 of file Location.cs.

◆ IsGateBetweenBiomes

bool Barotrauma.Location.IsGateBetweenBiomes

Definition at line 517 of file Location.cs.

◆ LastTypeChangeMessage

string Barotrauma.Location.LastTypeChangeMessage

Definition at line 513 of file Location.cs.

◆ LocationTypeChangeCooldown

int Barotrauma.Location.LocationTypeChangeCooldown

Definition at line 78 of file Location.cs.

◆ ProximityTimer

readonly Dictionary<LocationTypeChange.Requirement, int> Barotrauma.Location.ProximityTimer = new Dictionary<LocationTypeChange.Requirement, int>()

Definition at line 76 of file Location.cs.

◆ TimeSinceLastTypeChange

int Barotrauma.Location.TimeSinceLastTypeChange

Definition at line 515 of file Location.cs.

◆ typeChange

LocationTypeChange Barotrauma.Location.typeChange

Definition at line 77 of file Location.cs.

Property Documentation

◆ AvailableMissions

IEnumerable<Mission> Barotrauma.Location.AvailableMissions
get

Definition at line 436 of file Location.cs.

◆ Biome

Biome Barotrauma.Location.Biome
getset

Definition at line 87 of file Location.cs.

◆ DailySpecialsCount

int Barotrauma.Location.DailySpecialsCount
get

Definition at line 413 of file Location.cs.

◆ Discovered

bool Barotrauma.Location.Discovered
get

Definition at line 72 of file Location.cs.

◆ DisplayName

LocalizedString Barotrauma.Location.DisplayName
get

Definition at line 58 of file Location.cs.

◆ Faction

Faction Barotrauma.Location.Faction
getset

Definition at line 99 of file Location.cs.

◆ IsFactionHostile

bool Barotrauma.Location.IsFactionHostile
get

Definition at line 105 of file Location.cs.

◆ KilledCharacterIdentifiers

IEnumerable<int> Barotrauma.Location.KilledCharacterIdentifiers
get

Definition at line 430 of file Location.cs.

◆ LevelData

LevelData Barotrauma.Location.LevelData
getset

Definition at line 95 of file Location.cs.

◆ LocationTypeChangesBlocked

bool Barotrauma.Location.LocationTypeChangesBlocked
get

Is some mission blocking this location from changing its type, or have location type changes been forcibly disabled on the location?

Definition at line 83 of file Location.cs.

◆ MapPosition

Vector2 Barotrauma.Location.MapPosition
get

Definition at line 89 of file Location.cs.

◆ MechanicalPriceMultiplier

float Barotrauma.Location.MechanicalPriceMultiplier
getset

Definition at line 507 of file Location.cs.

◆ NameIdentifier

Identifier Barotrauma.Location.NameIdentifier
get

Definition at line 60 of file Location.cs.

◆ OriginalType

LocationType Barotrauma.Location.OriginalType
get

Definition at line 93 of file Location.cs.

◆ PortraitId

int Barotrauma.Location.PortraitId
get

Definition at line 97 of file Location.cs.

◆ PriceMultiplier

float Barotrauma.Location.PriceMultiplier
getset

Definition at line 500 of file Location.cs.

◆ Reputation

Reputation Barotrauma.Location.Reputation
get

Definition at line 103 of file Location.cs.

◆ RequestedGoodsCount

int Barotrauma.Location.RequestedGoodsCount
get

Definition at line 414 of file Location.cs.

◆ SecondaryFaction

Faction Barotrauma.Location.SecondaryFaction
getset

Definition at line 101 of file Location.cs.

◆ SelectedMissions

IEnumerable<Mission> Barotrauma.Location.SelectedMissions
get

Definition at line 446 of file Location.cs.

◆ StoreIdentifiers

HashSet<Identifier> Barotrauma.Location.StoreIdentifiers = new HashSet<Identifier>()
get

Definition at line 416 of file Location.cs.

◆ StoreInitialBalance

int Barotrauma.Location.StoreInitialBalance
get

Definition at line 406 of file Location.cs.

◆ Stores

Dictionary<Identifier, StoreInfo> Barotrauma.Location.Stores
getset

Definition at line 400 of file Location.cs.

◆ TakenItems

IEnumerable<TakenItem> Barotrauma.Location.TakenItems
get

Definition at line 424 of file Location.cs.

◆ TurnsInRadiation

int Barotrauma.Location.TurnsInRadiation
getset

Definition at line 107 of file Location.cs.

◆ Type

LocationType Barotrauma.Location.Type
get

Definition at line 91 of file Location.cs.

◆ Visited

bool Barotrauma.Location.Visited
get

Definition at line 74 of file Location.cs.