Barotrauma Client
|
Public Member Functions | |
override string | ToString () |
int | CalculateBasePrice () |
void | AttemptBallastFloraInfection (Identifier identifier, float deltaTime, float probability) |
void | MakeWreck () |
bool | CreateWreckAI () |
bool | CreateTurretAI () |
Creates an AI that operates all the turrets on a sub, same as Thalamus but only operates the turrets. | |
void | DisableWreckAI () |
Rectangle | GetDockedBorders (bool allowDifferentTeam=true) |
Returns a rect that contains the borders of this sub and all subs docked to it, excluding outposts. | |
IEnumerable< Submarine > | GetConnectedSubs () |
Returns a list of all submarines that are connected to this one via docking ports, including this sub. | |
void | RefreshConnectedSubs () |
Vector2 | FindSpawnPos (Vector2 spawnPos, Point? submarineSize=null, float subDockingPortOffset=0.0f, int verticalMoveDir=0) |
Attempt to find a spawn position close to the specified position where the sub doesn't collide with walls/ruins. | |
void | UpdateTransform (bool interpolate=true) |
Rectangle | CalculateDimensions (bool onlyHulls=true) |
void | FlipX (List< Submarine > parents=null) |
void | EnableFactionSpecificEntities (Identifier factionIdentifier) |
bool | LayerExists (Identifier layer) |
void | SetLayerEnabled (Identifier layer, bool enabled, bool sendNetworkEvent=false) |
void | Update (float deltaTime) |
void | ApplyForce (Vector2 force) |
void | EnableMaintainPosition () |
void | NeutralizeBallast () |
void | SetPrevTransform (Vector2 position) |
void | SetPosition (Vector2 position, List< Submarine > checkd=null, bool forceUndockFromStaticSubmarines=true) |
void | Translate (Vector2 amount) |
bool | IsConnectedTo (Submarine otherSub) |
Returns true if the sub is same as the other, or connected to it via docking ports. | |
List< Hull > | GetHulls (bool alsoFromConnectedSubs) |
List< Gap > | GetGaps (bool alsoFromConnectedSubs) |
List< Item > | GetItems (bool alsoFromConnectedSubs) |
List< WayPoint > | GetWaypoints (bool alsoFromConnectedSubs) |
List< Structure > | GetWalls (bool alsoFromConnectedSubs) |
List< T > | GetEntities< T > (bool includingConnectedSubs, List< T > list) |
List<(ItemContainer container, int freeSlots)> | GetCargoContainers () |
IEnumerable< T > | GetEntities< T > (bool includingConnectedSubs, IEnumerable< T > list) |
bool | IsEntityFoundOnThisSub (MapEntity entity, bool includingConnectedSubs, bool allowDifferentTeam=false, bool allowDifferentType=false) |
Submarine (SubmarineInfo info, bool showErrorMessages=true, Func< Submarine, List< MapEntity > > loadEntities=null, IdRemap linkedRemap=null) | |
void | SetCrushDepth (float realWorldCrushDepth) |
Normally crush depth is determined by the crush depths of the walls and upgrades applied on them. This method forces the crush depths of all the walls to the specified value. | |
bool | CheckFuel () |
void | SaveToXElement (XElement element) |
bool | TrySaveAs (string filePath, System.IO.MemoryStream previewImage=null) |
override void | Remove () |
void | Dispose () |
void | DisableObstructedWayPoints () |
Permanently disables obstructed waypoints obstructed by the level. | |
void | DisableObstructedWayPoints (Submarine otherSub) |
Temporarily disables waypoints obstructed by the other sub. | |
void | EnableObstructedWaypoints (Submarine otherSub) |
Only affects temporarily disabled waypoints. | |
void | RefreshOutdoorNodes () |
Item | FindContainerFor (Item item, bool onlyPrimary, bool checkTransferConditions=false, bool allowConnectedSubs=false) |
![]() | |
Entity (Submarine submarine, ushort id) | |
void | FreeID () |
Removes the entity from the entity dictionary and frees up the ID it was using. | |
Static Public Member Functions | |||
static Vector2 | VectorToWorldGrid (Vector2 position, Submarine sub=null, bool round=false) | ||
static Rectangle | AbsRect (Vector2 pos, Vector2 size) | ||
static RectangleF | AbsRectF (Vector2 pos, Vector2 size) | ||
static bool | RectContains (Rectangle rect, Vector2 pos, bool inclusive=false) | ||
static bool | RectsOverlap (Rectangle rect1, Rectangle rect2, bool inclusive=true) | ||
static bool | RectsOverlap (RectangleF rect1, RectangleF rect2, bool inclusive=true) | ||
static Body | PickBody (Vector2 rayStart, Vector2 rayEnd, IEnumerable< Body > ignoredBodies=null, Category? collisionCategory=null, bool ignoreSensors=true, Predicate< Fixture > customPredicate=null, bool allowInsideFixture=false) | ||
static float | LastPickedBodyDist (Body body) | ||
static IEnumerable< Body > | PickBodies (Vector2 rayStart, Vector2 rayEnd, IEnumerable< Body > ignoredBodies=null, Category? collisionCategory=null, bool ignoreSensors=true, Predicate< Fixture > customPredicate=null, bool allowInsideFixture=false) | ||
Returns a list of physics bodies the ray intersects with, sorted according to distance (the closest body is at the beginning of the list). | |||
static Body | CheckVisibility (Vector2 rayStart, Vector2 rayEnd, bool ignoreLevel=false, bool ignoreSubs=false, bool ignoreSensors=true, bool ignoreDisabledWalls=true, bool ignoreBranches=true, Predicate< Fixture > blocksVisibilityPredicate=null) | ||
Check visibility between two points (in sim units). | |||
static bool | LayerExistsInAnySub (Identifier layer) | ||
static ? Vector2 | CalculateDockOffset (Submarine sub, Submarine dockedSub) | ||
static Submarine | FindClosest (Vector2 worldPosition, bool ignoreOutposts=false, bool ignoreOutsideLevel=true, bool ignoreRespawnShuttle=false, CharacterTeamType? teamType=null) | ||
| |||
static Submarine | FindContainingInLocalCoordinates (Vector2 position, float inflate=500.0f) | ||
Finds the sub whose borders contain the position. Note that this method uses the "actual" position of the sub outside the level: only use this if the position is in a submarine's local coordinate space! | |||
static Submarine | FindContaining (Vector2 worldPosition, float inflate=500.0f) | ||
Finds the sub whose world borders contain the position. | |||
static Rectangle | GetBorders (XElement submarineElement) | ||
static Submarine | Load (SubmarineInfo info, bool unloadPrevious, IdRemap linkedRemap=null) | ||
static void | RepositionEntities (Vector2 moveAmount, IEnumerable< MapEntity > entities) | ||
static void | Unload () | ||
static Vector2 | GetRelativeSimPosition (ISpatialEntity from, ISpatialEntity to, Vector2? targetWorldPos=null) | ||
static Vector2 | GetRelativeSimPositionFromWorldPosition (Vector2 targetWorldPos, Submarine fromSub, Submarine toSub) | ||
static Vector2 | GetRelativeSimPosition (Vector2 targetSimPos, Submarine fromSub, Submarine toSub) | ||
![]() | |||
static IReadOnlyCollection< Entity > | GetEntities () | ||
static int | FindFreeIdBlock (int minBlockSize) | ||
Finds a contiguous block of free IDs of at least the given size. | |||
static Entity | FindEntityByID (ushort ID) | ||
Find an entity based on the ID. | |||
static void | RemoveAll () | ||
static void | DumpIds (int count, string filename) | ||
Public Attributes | |
CharacterTeamType | TeamID = CharacterTeamType.None |
readonly Dictionary< Submarine, DockingPort > | ConnectedDockingPorts |
bool | ShowSonarMarker = true |
![]() | |
readonly ushort | ID |
Unique, but non-persistent identifier. Stays the same if the entities are created in the exactly same order, but doesn't persist e.g. between the rounds. | |
readonly string | CreationStackTrace |
readonly UInt64 | CreationIndex |
Static Public Attributes | |
static readonly Vector2 | HiddenSubStartPosition = new Vector2(-50000.0f, 10000.0f) |
static bool | LockX |
static bool | LockY |
static readonly Vector2 | GridSize = new Vector2(16.0f, 16.0f) |
static readonly Submarine[] | MainSubs = new Submarine[2] |
![]() | |
const ushort | NullEntityID = 0 |
const ushort | EntitySpawnerID = ushort.MaxValue |
const ushort | RespawnManagerID = ushort.MaxValue - 1 |
const ushort | DummyID = ushort.MaxValue - 2 |
const ushort | ReservedIDStart = ushort.MaxValue - 3 |
const ushort | MaxEntityCount = ushort.MaxValue - 4 |
static EntitySpawner | Spawner |
Protected Member Functions | |
override ushort | DetermineID (ushort id, Submarine submarine) |
![]() |
Properties | |
SubmarineInfo | Info [get] |
Vector2 | HiddenSubPosition [get] |
ushort | IdOffset [get] |
static Submarine | MainSub [get, set] |
static IEnumerable< MapEntity > | VisibleEntities [get] |
IEnumerable< Submarine > | DockedTo [get] |
static Vector2 | LastPickedPosition [get] |
static float | LastPickedFraction [get] |
static Fixture | LastPickedFixture [get] |
static Vector2 | LastPickedNormal [get] |
bool | Loading [get] |
bool | GodMode [get, set] |
static List< Submarine > | Loaded [get] |
SubmarineBody | SubBody [get] |
PhysicsBody | PhysicsBody [get] |
Rectangle | Borders [get] |
Extents of the solid items/structures (ones with a physics body) and hulls. | |
Rectangle | VisibleBorders [get] |
Extents of all the visible items/structures/hulls (including ones without a physics body) | |
override Vector2 | Position [get] |
override Vector2 | WorldPosition [get] |
float | RealWorldCrushDepth [get] |
float | RealWorldDepth [get] |
How deep down the sub is from the surface of Europa in meters (affected by level type, does not correspond to "actual" coordinate systems) | |
bool | AtEndExit [get] |
bool | AtStartExit [get] |
bool | AtEitherExit [get] |
new Vector2 | DrawPosition [get] |
override Vector2 | SimPosition [get] |
Vector2 | Velocity [get, set] |
List< Vector2 > | HullVertices [get] |
int | SubmarineSpecificIDTag [get] |
bool | AtDamageDepth [get] |
IReadOnlyList< WayPoint > | ExitPoints [get] |
bool | ImmuneToBallastFlora [get, set] |
WreckAI | WreckAI [get] |
SubmarineTurretAI | TurretAI [get] |
bool | FlippedX [get] |
static bool | Unloading [get] |
![]() | |
static int | EntityCount [get] |
bool | Removed [get] |
bool | IdFreed [get] |
virtual Vector2 | SimPosition [get] |
virtual Vector2 | Position [get] |
virtual Vector2 | WorldPosition [get] |
virtual Vector2 | DrawPosition [get] |
Submarine | Submarine [get, set] |
AITarget | AiTarget [get] |
bool | InDetectable [get, set] |
Indetectable characters can't be spotted by AIs and aren't visible on the sonar or health scanner. | |
double | SpawnTime [get] |
string | ErrorLine [get] |
![]() |
Additional Inherited Members | |
![]() | |
AITarget | aiTarget |
Barotrauma.Submarine.Submarine | ( | SubmarineInfo | info, |
bool | showErrorMessages = true, | ||
Func< Submarine, List< MapEntity > > | loadEntities = null, | ||
IdRemap | linkedRemap = null ) |
void Barotrauma.Submarine.ApplyForce | ( | Vector2 | force | ) |
void Barotrauma.Submarine.AttemptBallastFloraInfection | ( | Identifier | identifier, |
float | deltaTime, | ||
float | probability ) |
int Barotrauma.Submarine.CalculateBasePrice | ( | ) |
Rectangle Barotrauma.Submarine.CalculateDimensions | ( | bool | onlyHulls = true | ) |
|
static |
bool Barotrauma.Submarine.CheckFuel | ( | ) |
|
static |
Check visibility between two points (in sim units).
ignoreBranches | Should plants' branches be ignored? |
blocksVisibilityPredicate | If the predicate returns false, the fixture is ignored even if it would normally block visibility. |
bool Barotrauma.Submarine.CreateTurretAI | ( | ) |
Creates an AI that operates all the turrets on a sub, same as Thalamus but only operates the turrets.
bool Barotrauma.Submarine.CreateWreckAI | ( | ) |
|
protectedvirtual |
Reimplemented from Barotrauma.Entity.
void Barotrauma.Submarine.DisableObstructedWayPoints | ( | ) |
Permanently disables obstructed waypoints obstructed by the level.
void Barotrauma.Submarine.DisableObstructedWayPoints | ( | Submarine | otherSub | ) |
Temporarily disables waypoints obstructed by the other sub.
void Barotrauma.Submarine.DisableWreckAI | ( | ) |
void Barotrauma.Submarine.Dispose | ( | ) |
void Barotrauma.Submarine.EnableFactionSpecificEntities | ( | Identifier | factionIdentifier | ) |
void Barotrauma.Submarine.EnableMaintainPosition | ( | ) |
void Barotrauma.Submarine.EnableObstructedWaypoints | ( | Submarine | otherSub | ) |
Only affects temporarily disabled waypoints.
|
static |
teamType | If has value, the sub must match the team type. |
Item Barotrauma.Submarine.FindContainerFor | ( | Item | item, |
bool | onlyPrimary, | ||
bool | checkTransferConditions = false, | ||
bool | allowConnectedSubs = false ) |
|
static |
Finds the sub whose world borders contain the position.
|
static |
Finds the sub whose borders contain the position. Note that this method uses the "actual" position of the sub outside the level: only use this if the position is in a submarine's local coordinate space!
Vector2 Barotrauma.Submarine.FindSpawnPos | ( | Vector2 | spawnPos, |
Point? | submarineSize = null, | ||
float | subDockingPortOffset = 0::0f, | ||
int | verticalMoveDir = 0 ) |
Attempt to find a spawn position close to the specified position where the sub doesn't collide with walls/ruins.
void Barotrauma.Submarine.FlipX | ( | List< Submarine > | parents = null | ) |
|
static |
List<(ItemContainer container, int freeSlots)> Barotrauma.Submarine.GetCargoContainers | ( | ) |
IEnumerable< Submarine > Barotrauma.Submarine.GetConnectedSubs | ( | ) |
Returns a list of all submarines that are connected to this one via docking ports, including this sub.
Rectangle Barotrauma.Submarine.GetDockedBorders | ( | bool | allowDifferentTeam = true | ) |
Returns a rect that contains the borders of this sub and all subs docked to it, excluding outposts.
IEnumerable< T > Barotrauma.Submarine.GetEntities< T > | ( | bool | includingConnectedSubs, |
IEnumerable< T > | list ) |
T | : | MapEntity |
List< T > Barotrauma.Submarine.GetEntities< T > | ( | bool | includingConnectedSubs, |
List< T > | list ) |
T | : | MapEntity |
List< Gap > Barotrauma.Submarine.GetGaps | ( | bool | alsoFromConnectedSubs | ) |
List< Hull > Barotrauma.Submarine.GetHulls | ( | bool | alsoFromConnectedSubs | ) |
List< Item > Barotrauma.Submarine.GetItems | ( | bool | alsoFromConnectedSubs | ) |
|
static |
|
static |
|
static |
List< Structure > Barotrauma.Submarine.GetWalls | ( | bool | alsoFromConnectedSubs | ) |
List< WayPoint > Barotrauma.Submarine.GetWaypoints | ( | bool | alsoFromConnectedSubs | ) |
bool Barotrauma.Submarine.IsConnectedTo | ( | Submarine | otherSub | ) |
Returns true if the sub is same as the other, or connected to it via docking ports.
bool Barotrauma.Submarine.IsEntityFoundOnThisSub | ( | MapEntity | entity, |
bool | includingConnectedSubs, | ||
bool | allowDifferentTeam = false, | ||
bool | allowDifferentType = false ) |
|
static |
bool Barotrauma.Submarine.LayerExists | ( | Identifier | layer | ) |
|
static |
|
static |
void Barotrauma.Submarine.MakeWreck | ( | ) |
void Barotrauma.Submarine.NeutralizeBallast | ( | ) |
|
static |
Returns a list of physics bodies the ray intersects with, sorted according to distance (the closest body is at the beginning of the list).
customPredicate | Can be used to filter the bodies based on some condition. If the predicate returns false, the body isignored. |
allowInsideFixture | Should fixtures that the start of the ray is inside be returned |
|
static |
|
static |
|
static |
|
static |
void Barotrauma.Submarine.RefreshConnectedSubs | ( | ) |
void Barotrauma.Submarine.RefreshOutdoorNodes | ( | ) |
|
virtual |
Reimplemented from Barotrauma.Entity.
|
static |
void Barotrauma.Submarine.SaveToXElement | ( | XElement | element | ) |
void Barotrauma.Submarine.SetCrushDepth | ( | float | realWorldCrushDepth | ) |
Normally crush depth is determined by the crush depths of the walls and upgrades applied on them. This method forces the crush depths of all the walls to the specified value.
realWorldCrushDepth | Depth in "real world" units (meters from the surface of Europa, the value you see on the nav terminal). |
void Barotrauma.Submarine.SetLayerEnabled | ( | Identifier | layer, |
bool | enabled, | ||
bool | sendNetworkEvent = false ) |
void Barotrauma.Submarine.SetPosition | ( | Vector2 | position, |
List< Submarine > | checkd = null, | ||
bool | forceUndockFromStaticSubmarines = true ) |
void Barotrauma.Submarine.SetPrevTransform | ( | Vector2 | position | ) |
override string Barotrauma.Submarine.ToString | ( | ) |
void Barotrauma.Submarine.Translate | ( | Vector2 | amount | ) |
bool Barotrauma.Submarine.TrySaveAs | ( | string | filePath, |
System.IO.MemoryStream | previewImage = null ) |
|
static |
void Barotrauma.Submarine.Update | ( | float | deltaTime | ) |
void Barotrauma.Submarine.UpdateTransform | ( | bool | interpolate = true | ) |
|
static |
readonly Dictionary<Submarine, DockingPort> Barotrauma.Submarine.ConnectedDockingPorts |
|
static |
|
static |
|
static |
bool Barotrauma.Submarine.ShowSonarMarker = true |
CharacterTeamType Barotrauma.Submarine.TeamID = CharacterTeamType.None |
|
get |
|
get |
|
get |
|
get |
|
get |
Extents of the solid items/structures (ones with a physics body) and hulls.
|
get |
|
get |
|
get |
|
get |
|
getset |
|
get |
|
get |
|
get |
|
getset |
|
get |
|
staticget |
|
staticget |
|
staticget |
|
staticget |
|
staticget |
|
get |
|
staticgetset |
|
get |
|
get |
Implements Barotrauma.ISpatialEntity.
|
get |
|
get |
How deep down the sub is from the surface of Europa in meters (affected by level type, does not correspond to "actual" coordinate systems)
|
get |
Implements Barotrauma.ISpatialEntity.
|
get |
|
get |
|
get |
|
staticget |
|
getset |
|
get |
Extents of all the visible items/structures/hulls (including ones without a physics body)
|
staticget |
|
get |
Implements Barotrauma.ISpatialEntity.
|
get |