Unstable 0.1300.0.9
This commit is contained in:
@@ -12,7 +12,7 @@ namespace Barotrauma
|
||||
{
|
||||
class CharacterHUD
|
||||
{
|
||||
const float BossHealthBarDuration = 1200.0f;
|
||||
const float BossHealthBarDuration = 120.0f;
|
||||
|
||||
class BossHealthBar
|
||||
{
|
||||
@@ -615,10 +615,6 @@ namespace Barotrauma
|
||||
{
|
||||
bossHealthBar.FadeTimer = Math.Min(bossHealthBar.FadeTimer, 5.0f);
|
||||
}
|
||||
else if (bossHealthBar.Character.AIController is EnemyAIController enemyAI && !enemyAI.IsTargetingPlayerTeam)
|
||||
{
|
||||
bossHealthBar.FadeTimer = Math.Min(bossHealthBar.FadeTimer, 60.0f);
|
||||
}
|
||||
bossHealthBar.FadeTimer -= deltaTime;
|
||||
}
|
||||
|
||||
|
||||
@@ -3198,10 +3198,10 @@ namespace Barotrauma
|
||||
return characters.Where(c => Character.Controlled == null || ((includeSelf || c != Character.Controlled) && c.TeamID == Character.Controlled.TeamID)).Union(GetOrderableFriendlyNPCs())
|
||||
// 1. Prioritize those who are on the same submarine than the controlled character
|
||||
.OrderByDescending(c => Character.Controlled == null || c.Submarine == Character.Controlled.Submarine)
|
||||
// 2. Prioritize those who are already ordered to operate the item target of the new 'operate' order, or given the same maintenance order as now issued
|
||||
// 2. Prioritize those who have been given the same maintenance or operate order as now issued
|
||||
.ThenByDescending(c => c.CurrentOrders.Any(o =>
|
||||
o.Order != null && o.Order.Identifier == order.Identifier &&
|
||||
(order.Category == OrderCategory.Maintenance || (order.Category == OrderCategory.Operate && o.Order.TargetSpatialEntity == order.TargetSpatialEntity))))
|
||||
(order.Category == OrderCategory.Maintenance || order.Category == OrderCategory.Operate)))
|
||||
// 3. Prioritize those with the appropriate job for the order
|
||||
.ThenByDescending(c => order.HasAppropriateJob(c))
|
||||
// 4. Prioritize bots over player controlled characters
|
||||
|
||||
@@ -113,14 +113,16 @@ namespace Barotrauma
|
||||
public static void OnSetSelectedConstruction(Character character, Item oldConstruction, Item newConstruction)
|
||||
{
|
||||
if (oldConstruction == newConstruction) { return; }
|
||||
|
||||
if (Character.Controlled != null && Character.Controlled == character && oldConstruction != null && oldConstruction.GetComponent<Ladder>() == null)
|
||||
{
|
||||
TimeStoppedInteracting = Timing.TotalTime;
|
||||
}
|
||||
if (newConstruction != null && newConstruction.GetComponent<Ladder>() == null)
|
||||
{
|
||||
OnStartedInteracting(character, newConstruction);
|
||||
}
|
||||
|
||||
if (newConstruction == null) { return; }
|
||||
if (newConstruction.GetComponent<Ladder>() != null) { return; }
|
||||
if (newConstruction.GetComponent<ConnectionPanel>() is ConnectionPanel cp && cp.User == character) { return; }
|
||||
OnStartedInteracting(character, newConstruction);
|
||||
}
|
||||
|
||||
private static void OnStartedInteracting(Character character, Item item)
|
||||
@@ -136,6 +138,9 @@ namespace Barotrauma
|
||||
if (DisplayHint($"{hintIdentifierBase}.brokenitem")) { return; }
|
||||
}
|
||||
|
||||
// Don't display other item-related hints if the repair interface is displayed
|
||||
if (item.Repairables.Any(r => r.ShouldDrawHUD(character))) { return; }
|
||||
|
||||
// onstartedinteracting.lootingisstealing
|
||||
if (item.Submarine?.Info?.Type == SubmarineType.Outpost &&
|
||||
item.ContainedItems.Any(i => !i.AllowStealing))
|
||||
|
||||
@@ -183,7 +183,8 @@ namespace Barotrauma
|
||||
|
||||
//reputation panel -------------------------------------------------------------------------------
|
||||
|
||||
if (gameMode is CampaignMode campaignMode)
|
||||
var campaignMode = gameMode as CampaignMode;
|
||||
if (campaignMode != null)
|
||||
{
|
||||
GUIFrame reputationframe = new GUIFrame(new RectTransform(crewFrame.RectTransform.RelativeSize, background.RectTransform, Anchor.TopCenter, minSize: crewFrame.RectTransform.MinSize));
|
||||
rightPanels.Add(reputationframe);
|
||||
@@ -217,7 +218,14 @@ namespace Barotrauma
|
||||
};
|
||||
|
||||
List<Mission> missionsToDisplay = new List<Mission>(selectedMissions);
|
||||
if (!selectedMissions.Any() && startLocation?.SelectedMission != null) { missionsToDisplay.Add(startLocation.SelectedMission); }
|
||||
if (!selectedMissions.Any() && startLocation?.SelectedMission != null)
|
||||
{
|
||||
if (startLocation.SelectedMission.Locations[0] == startLocation.SelectedMission.Locations[1] ||
|
||||
startLocation.SelectedMission.Locations.Contains(campaignMode?.Map.SelectedLocation))
|
||||
{
|
||||
missionsToDisplay.Add(startLocation.SelectedMission);
|
||||
}
|
||||
}
|
||||
|
||||
if (missionsToDisplay.Any())
|
||||
{
|
||||
@@ -461,6 +469,7 @@ namespace Barotrauma
|
||||
new string[] { Reputation.GetFormattedReputationText(normalizedUnlockReputation, unlockEvent.UnlockPathReputation, addColorTags: true), $"‖color:gui.orange‖{connection.LevelData.Biome.DisplayName}‖end‖" });
|
||||
var unlockInfoPanel = new GUITextBlock(new RectTransform(new Vector2(0.8f, 0.0f), reputationFrame.RectTransform, Anchor.BottomCenter) { MinSize = new Point(0, GUI.IntScale(30)), AbsoluteOffset = new Point(0, GUI.IntScale(3)) },
|
||||
unlockText, style: "GUIButtonRound", textAlignment: Alignment.Center, textColor: GUI.Style.TextColor, parseRichText: true);
|
||||
unlockInfoPanel.Color = Color.Lerp(unlockInfoPanel.Color, Color.Black, 0.8f);
|
||||
if (unlockInfoPanel.TextSize.X > unlockInfoPanel.Rect.Width * 0.7f)
|
||||
{
|
||||
unlockInfoPanel.Font = GUI.SmallFont;
|
||||
|
||||
@@ -1334,6 +1334,11 @@ namespace Barotrauma
|
||||
OnSelected = (tickBox) =>
|
||||
{
|
||||
DisableInGameHints = tickBox.Selected;
|
||||
if (!DisableInGameHints && GameMain.Config?.IgnoredHints != null)
|
||||
{
|
||||
// Reset the ignored hints when the hints are re-enabled (to-be-replaced by a separate button)
|
||||
GameMain.Config.IgnoredHints.Clear();
|
||||
}
|
||||
UnsavedSettings = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -705,11 +705,12 @@ namespace Barotrauma.Items.Components
|
||||
if (c.Params.HideInSonar) { continue; }
|
||||
|
||||
if (!c.IsUnconscious && c.Params.DistantSonarRange > 0.0f &&
|
||||
c.AIController is EnemyAIController enemyAI && enemyAI.IsTargetingPlayerTeam &&
|
||||
((c.WorldPosition - transducerCenter) * displayScale).LengthSquared() > DisplayRadius * DisplayRadius)
|
||||
{
|
||||
float dist = Vector2.Distance(c.WorldPosition, transducerCenter);
|
||||
Vector2 targetDir = (c.WorldPosition - transducerCenter) / dist;
|
||||
Vector2 targetVector = c.WorldPosition - transducerCenter;
|
||||
if (targetVector.LengthSquared() > MathUtils.Pow2(c.Params.DistantSonarRange)) { continue; }
|
||||
float dist = targetVector.Length();
|
||||
Vector2 targetDir = targetVector / dist;
|
||||
int blipCount = (int)MathHelper.Clamp(c.Mass, 50, 200);
|
||||
for (int i = 0; i < blipCount; i++)
|
||||
{
|
||||
|
||||
@@ -70,6 +70,8 @@ namespace Barotrauma
|
||||
private List<RichTextData> tooltipRichTextData;
|
||||
private string prevTooltip;
|
||||
|
||||
private (SubmarineInfo pendingSub, float realWorldCrushDepth) pendingSubInfo;
|
||||
|
||||
/*private (Rectangle targetArea, string tip)? connectionTooltip;
|
||||
private string sanitizedConnectionTooltip;
|
||||
private List<RichTextData> connectionTooltipRichTextData;
|
||||
@@ -855,7 +857,21 @@ namespace Barotrauma
|
||||
if (connection.LevelData.HasHuntingGrounds) { iconCount++; }
|
||||
if (connection.Locked) { iconCount++; }
|
||||
string tooltip = null;
|
||||
var subCrushDepth = Submarine.MainSub?.RealWorldCrushDepth ?? Level.DefaultRealWorldCrushDepth;
|
||||
float subCrushDepth = Level.DefaultRealWorldCrushDepth;
|
||||
var currentOrPendingSub = SubmarineSelection.CurrentOrPendingSubmarine();
|
||||
if (Submarine.MainSub != null && Submarine.MainSub.Info == currentOrPendingSub)
|
||||
{
|
||||
subCrushDepth = Submarine.MainSub.RealWorldCrushDepth;
|
||||
}
|
||||
else if (currentOrPendingSub != null)
|
||||
{
|
||||
if (pendingSubInfo.pendingSub != currentOrPendingSub)
|
||||
{
|
||||
// Store the real world crush depth for the pending sub so that we don't have to calculate it again every time
|
||||
pendingSubInfo = (currentOrPendingSub, currentOrPendingSub.GetRealWorldCrushDepth());
|
||||
}
|
||||
subCrushDepth = pendingSubInfo.realWorldCrushDepth;
|
||||
}
|
||||
if (GameMain.GameSession?.Campaign?.UpgradeManager != null)
|
||||
{
|
||||
var hullUpgradePrefab = UpgradePrefab.Find("increasewallhealth");
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<RootNamespace>Barotrauma</RootNamespace>
|
||||
<Authors>FakeFish, Undertow Games</Authors>
|
||||
<Product>Barotrauma</Product>
|
||||
<Version>0.1300.0.8</Version>
|
||||
<Version>0.1300.0.9</Version>
|
||||
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<AssemblyName>Barotrauma</AssemblyName>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<RootNamespace>Barotrauma</RootNamespace>
|
||||
<Authors>FakeFish, Undertow Games</Authors>
|
||||
<Product>Barotrauma</Product>
|
||||
<Version>0.1300.0.8</Version>
|
||||
<Version>0.1300.0.9</Version>
|
||||
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<AssemblyName>Barotrauma</AssemblyName>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<RootNamespace>Barotrauma</RootNamespace>
|
||||
<Authors>FakeFish, Undertow Games</Authors>
|
||||
<Product>Barotrauma</Product>
|
||||
<Version>0.1300.0.8</Version>
|
||||
<Version>0.1300.0.9</Version>
|
||||
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<AssemblyName>Barotrauma</AssemblyName>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<RootNamespace>Barotrauma</RootNamespace>
|
||||
<Authors>FakeFish, Undertow Games</Authors>
|
||||
<Product>Barotrauma Dedicated Server</Product>
|
||||
<Version>0.1300.0.8</Version>
|
||||
<Version>0.1300.0.9</Version>
|
||||
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<AssemblyName>DedicatedServer</AssemblyName>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<RootNamespace>Barotrauma</RootNamespace>
|
||||
<Authors>FakeFish, Undertow Games</Authors>
|
||||
<Product>Barotrauma Dedicated Server</Product>
|
||||
<Version>0.1300.0.8</Version>
|
||||
<Version>0.1300.0.9</Version>
|
||||
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<AssemblyName>DedicatedServer</AssemblyName>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<RootNamespace>Barotrauma</RootNamespace>
|
||||
<Authors>FakeFish, Undertow Games</Authors>
|
||||
<Product>Barotrauma Dedicated Server</Product>
|
||||
<Version>0.1300.0.8</Version>
|
||||
<Version>0.1300.0.9</Version>
|
||||
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<AssemblyName>DedicatedServer</AssemblyName>
|
||||
|
||||
@@ -141,7 +141,8 @@ namespace Barotrauma
|
||||
{
|
||||
DialogueIdentifier = "dialogcannotreachtarget",
|
||||
TargetName = container.Item.Name,
|
||||
abortCondition = obj => !ItemToContain.IsOwnedBy(character)
|
||||
abortCondition = obj => !ItemToContain.IsOwnedBy(character),
|
||||
SpeakIfFails = !objectiveManager.IsCurrentOrder<AIObjectiveCleanupItems>()
|
||||
},
|
||||
onAbandon: () => Abandon = true,
|
||||
onCompleted: () => RemoveSubObjective(ref goToObjective));
|
||||
|
||||
@@ -87,6 +87,7 @@ namespace Barotrauma
|
||||
},
|
||||
onAbandon: () =>
|
||||
{
|
||||
getOxygen = null;
|
||||
int remainingTanks = ReportOxygenTankCount();
|
||||
// Try to seek any oxygen sources.
|
||||
TryAddSubObjective(ref getOxygen, () =>
|
||||
|
||||
@@ -354,6 +354,7 @@ namespace Barotrauma
|
||||
#if DEBUG
|
||||
DebugConsole.NewMessage($"{character.Name}: Cannot find an item with the following identifier(s) or tag(s): {string.Join(", ", identifiersOrTags)}", Color.Yellow);
|
||||
#endif
|
||||
SpeakCannotFind();
|
||||
Abandon = true;
|
||||
}
|
||||
}
|
||||
@@ -415,6 +416,24 @@ namespace Barotrauma
|
||||
#if DEBUG
|
||||
DebugConsole.NewMessage($"{character.Name}: Get item failed to reach {moveToTarget}", Color.Yellow);
|
||||
#endif
|
||||
}
|
||||
|
||||
private void SpeakCannotFind()
|
||||
{
|
||||
// TODO: Use the item name as the variable here.
|
||||
if (character.IsOnPlayerTeam && objectiveManager.CurrentOrder == objectiveManager.CurrentObjective)
|
||||
{
|
||||
string msg = TextManager.Get("dialogcannotreachtarget", true);
|
||||
if (msg != null)
|
||||
{
|
||||
character.Speak(msg, identifier: "dialogcannotfinditem", minDurationBetweenSimilar: 20.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: remove?
|
||||
private void SpeakCannotReach()
|
||||
{
|
||||
if (character.IsOnPlayerTeam && objectiveManager.CurrentOrder == objectiveManager.CurrentObjective)
|
||||
{
|
||||
string TargetName = (moveToTarget as MapEntity)?.Name ?? (moveToTarget as Character)?.Name ?? moveToTarget.ToString();
|
||||
|
||||
@@ -166,7 +166,11 @@ namespace Barotrauma
|
||||
coroutine = CoroutineManager.InvokeAfter(() =>
|
||||
{
|
||||
//round ended before the coroutine finished
|
||||
#if CLIENT
|
||||
if (GameMain.GameSession == null || Level.Loaded == null && !(GameMain.GameSession.GameMode is TestGameMode)) { return; }
|
||||
#else
|
||||
if (GameMain.GameSession == null || Level.Loaded == null) { return; }
|
||||
#endif
|
||||
DelayedObjectives.Remove(objective);
|
||||
AddObjective(objective);
|
||||
callback?.Invoke();
|
||||
|
||||
@@ -612,10 +612,11 @@ namespace Barotrauma
|
||||
set
|
||||
{
|
||||
#if CLIENT
|
||||
HintManager.OnSetSelectedConstruction(this, _selectedConstruction, value);
|
||||
var prevSelectedConstruction = _selectedConstruction;
|
||||
#endif
|
||||
_selectedConstruction = value;
|
||||
#if CLIENT
|
||||
HintManager.OnSetSelectedConstruction(this, prevSelectedConstruction, _selectedConstruction);
|
||||
if (Controlled == this)
|
||||
{
|
||||
if (_selectedConstruction == null)
|
||||
@@ -3815,6 +3816,10 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
canBePutInOriginalInventory = inventory.CanBePut(newItem, slotIndices[0]);
|
||||
}
|
||||
|
||||
if (canBePutInOriginalInventory)
|
||||
{
|
||||
|
||||
@@ -898,11 +898,11 @@ namespace Barotrauma
|
||||
case HitDetection.Distance:
|
||||
if (dist < attack.DamageRange)
|
||||
{
|
||||
structureBody = Submarine.PickBody(simPos, attackSimPos, collisionCategory: Physics.CollisionWall | Physics.CollisionLevel, allowInsideFixture: true);
|
||||
if (structureBody?.UserData as string == "ruinroom")
|
||||
structureBody = Submarine.PickBody(simPos, attackSimPos, collisionCategory: Physics.CollisionWall | Physics.CollisionLevel, allowInsideFixture: true, customPredicate:
|
||||
(Fixture f) =>
|
||||
{
|
||||
structureBody = null;
|
||||
}
|
||||
return f?.Body?.UserData as string != "ruinroom";
|
||||
});
|
||||
if (damageTarget is Item i && i.GetComponent<Items.Components.Door>() != null)
|
||||
{
|
||||
// If the attack is aimed to an item and hits an item, it's successful.
|
||||
|
||||
@@ -31,10 +31,10 @@ namespace Barotrauma
|
||||
foreach (LocationConnection connection in GameMain.GameSession?.Map?.CurrentLocation?.Connections)
|
||||
{
|
||||
if (!connection.Locked) { continue; }
|
||||
connection.Locked = false;
|
||||
#if SERVER
|
||||
NotifyUnlock(connection);
|
||||
#else
|
||||
connection.Locked = false;
|
||||
new GUIMessageBox(string.Empty, TextManager.Get("pathunlockedgeneric"),
|
||||
new string[0], type: GUIMessageBox.Type.InGame, iconStyle: "UnlockPathIcon", relativeSize: new Vector2(0.3f, 0.15f), minSize: new Point(512, 128));
|
||||
#endif
|
||||
|
||||
@@ -115,7 +115,11 @@ namespace Barotrauma
|
||||
{
|
||||
if (Map.CurrentLocation?.SelectedMission != null)
|
||||
{
|
||||
yield return Map.CurrentLocation.SelectedMission;
|
||||
if (Map.CurrentLocation.SelectedMission.Locations[0] == Map.CurrentLocation.SelectedMission.Locations[1] ||
|
||||
Map.CurrentLocation.SelectedMission.Locations.Contains(Map.SelectedLocation))
|
||||
{
|
||||
yield return Map.CurrentLocation.SelectedMission;
|
||||
}
|
||||
}
|
||||
foreach (Mission mission in extraMissions)
|
||||
{
|
||||
@@ -279,7 +283,7 @@ namespace Barotrauma
|
||||
{
|
||||
Random rand = new MTRandom(ToolBox.StringToInt(levelData.Seed));
|
||||
var huntingGroundsMissionPrefab = huntingGroundsMissionPrefabs.GetRandom(rand);
|
||||
if (!Missions.Any(m => m.Prefab.Type == huntingGroundsMissionPrefab.Type))
|
||||
if (!Missions.Any(m => m.Prefab.Tags.Any(t => t.Equals("huntinggrounds", StringComparison.OrdinalIgnoreCase))))
|
||||
{
|
||||
extraMissions.Add(huntingGroundsMissionPrefab.Instantiate(Map.SelectedConnection.Locations));
|
||||
}
|
||||
|
||||
@@ -590,8 +590,7 @@ namespace Barotrauma.Items.Components
|
||||
var container = item.GetComponent<ItemContainer>();
|
||||
if (objective.SubObjectives.None())
|
||||
{
|
||||
int itemCount = item.ContainedItems.Count(i => i != null && container.ContainableItems.Any(ri => ri.MatchesItem(i))) + 1;
|
||||
var containObjective = AIContainItems<Reactor>(container, character, objective, itemCount, equip: false, removeEmpty: true, spawnItemIfNotFound: character.TeamID == CharacterTeamType.FriendlyNPC, dropItemOnDeselected: true);
|
||||
var containObjective = AIContainItems<Reactor>(container, character, objective, itemCount: 1, equip: true, removeEmpty: true, spawnItemIfNotFound: character.TeamID == CharacterTeamType.FriendlyNPC, dropItemOnDeselected: true);
|
||||
containObjective.Completed += ReportFuelRodCount;
|
||||
containObjective.Abandoned += ReportFuelRodCount;
|
||||
character.Speak(TextManager.Get("DialogReactorFuel"), null, 0.0f, "reactorfuel", 30.0f);
|
||||
@@ -613,19 +612,15 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
return outOfFuel;
|
||||
}
|
||||
else if (TooMuchFuel())
|
||||
else
|
||||
{
|
||||
if (item.OwnInventory?.AllItems != null)
|
||||
if (TooMuchFuel())
|
||||
{
|
||||
var container = item.GetComponent<ItemContainer>();
|
||||
foreach (Item item in item.OwnInventory.AllItemsMod)
|
||||
{
|
||||
if (container.ContainableItems.Any(ri => ri.MatchesItem(item)))
|
||||
{
|
||||
item.Drop(character);
|
||||
break;
|
||||
}
|
||||
}
|
||||
DropFuel(minCondition: 0.1f, maxCondition: 100);
|
||||
}
|
||||
else
|
||||
{
|
||||
DropFuel(minCondition: 0, maxCondition: 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -692,6 +687,23 @@ namespace Barotrauma.Items.Components
|
||||
aiUpdateTimer = AIUpdateInterval;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void DropFuel(float minCondition, float maxCondition)
|
||||
{
|
||||
if (item.OwnInventory?.AllItems != null)
|
||||
{
|
||||
var container = item.GetComponent<ItemContainer>();
|
||||
foreach (Item item in item.OwnInventory.AllItemsMod)
|
||||
{
|
||||
if (item.ConditionPercentage <= maxCondition && item.ConditionPercentage >= minCondition)
|
||||
{
|
||||
item.Drop(character);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnMapLoaded()
|
||||
@@ -735,6 +747,5 @@ namespace Barotrauma.Items.Components
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3598,10 +3598,13 @@ namespace Barotrauma
|
||||
if (!(GameMain.NetworkMember?.IsClient ?? false))
|
||||
{
|
||||
//empty the reactor
|
||||
foreach (Item item in reactorContainer.Inventory.AllItems)
|
||||
if (reactorContainer != null)
|
||||
{
|
||||
if (item.NonInteractable) { continue; }
|
||||
Spawner.AddToRemoveQueue(item);
|
||||
foreach (Item item in reactorContainer.Inventory.AllItems)
|
||||
{
|
||||
if (item.NonInteractable) { continue; }
|
||||
Spawner.AddToRemoveQueue(item);
|
||||
}
|
||||
}
|
||||
|
||||
//remove wires
|
||||
|
||||
@@ -1082,6 +1082,7 @@ namespace Barotrauma
|
||||
int currentLocationConnection = element.GetAttributeInt("currentlocationconnection", -1);
|
||||
if (currentLocationConnection >= 0)
|
||||
{
|
||||
Connections[currentLocationConnection].Locked = false;
|
||||
SelectLocation(Connections[currentLocationConnection].OtherLocation(CurrentLocation));
|
||||
}
|
||||
else
|
||||
|
||||
@@ -165,10 +165,7 @@ namespace Barotrauma
|
||||
if (structure.Submarine != this || !structure.HasBody || structure.Indestructible) { continue; }
|
||||
realWorldCrushDepth = Math.Min(structure.CrushDepth, realWorldCrushDepth.Value);
|
||||
}
|
||||
if (Info.SubmarineClass == SubmarineClass.DeepDiver)
|
||||
{
|
||||
realWorldCrushDepth *= 1.2f;
|
||||
}
|
||||
realWorldCrushDepth *= Info.GetRealWorldCrushDepthMultiplier();
|
||||
}
|
||||
return realWorldCrushDepth.Value;
|
||||
}
|
||||
@@ -1060,6 +1057,7 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
steering.MaintainPos = true;
|
||||
steering.PosToMaintain = WorldPosition;
|
||||
steering.AutoPilot = true;
|
||||
#if SERVER
|
||||
steering.UnsentChanges = true;
|
||||
|
||||
@@ -464,6 +464,49 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculated from <see cref="SubmarineElement"/>. Can be used when the sub hasn't been loaded and we can't access <see cref="Submarine.RealWorldCrushDepth"/>.
|
||||
/// </summary>
|
||||
public float GetRealWorldCrushDepth()
|
||||
{
|
||||
if (SubmarineElement == null) { return Level.DefaultRealWorldCrushDepth; }
|
||||
bool structureCrushDepthsDefined = false;
|
||||
float realWorldCrushDepth = float.PositiveInfinity;
|
||||
foreach (var structureElement in SubmarineElement.GetChildElements("structure"))
|
||||
{
|
||||
string name = structureElement.Attribute("name")?.Value ?? "";
|
||||
string identifier = structureElement.GetAttributeString("identifier", "");
|
||||
var structurePrefab = Structure.FindPrefab(name, identifier);
|
||||
if (structurePrefab == null || !structurePrefab.Body) { continue; }
|
||||
if (!structureCrushDepthsDefined && structureElement.Attribute("crushdepth") != null)
|
||||
{
|
||||
structureCrushDepthsDefined = true;
|
||||
}
|
||||
float structureCrushDepth = structureElement.GetAttributeFloat("crushdepth", float.PositiveInfinity);
|
||||
realWorldCrushDepth = Math.Min(structureCrushDepth, realWorldCrushDepth);
|
||||
}
|
||||
if (!structureCrushDepthsDefined)
|
||||
{
|
||||
realWorldCrushDepth = Level.DefaultRealWorldCrushDepth;
|
||||
}
|
||||
realWorldCrushDepth *= GetRealWorldCrushDepthMultiplier();
|
||||
return realWorldCrushDepth;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Based on <see cref="SubmarineClass"/>
|
||||
/// </summary>
|
||||
public float GetRealWorldCrushDepthMultiplier()
|
||||
{
|
||||
if (SubmarineClass == SubmarineClass.DeepDiver)
|
||||
{
|
||||
return 1.2f;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
//saving/loading ----------------------------------------------------
|
||||
public bool SaveAs(string filePath, System.IO.MemoryStream previewImage = null)
|
||||
|
||||
@@ -224,7 +224,7 @@ namespace Barotrauma
|
||||
if (Character.Controlled != null &&
|
||||
Lights.LightManager.ViewTarget != null)
|
||||
{
|
||||
Vector2 targetPos = Lights.LightManager.ViewTarget.DrawPosition;
|
||||
Vector2 targetPos = Lights.LightManager.ViewTarget.WorldPosition;
|
||||
if (Lights.LightManager.ViewTarget == Character.Controlled &&
|
||||
(CharacterHealth.OpenHealthWindow != null || CrewManager.IsCommandInterfaceOpen || ConversationAction.IsDialogOpen))
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ using Barotrauma.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Barotrauma.Extensions;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
@@ -202,6 +203,8 @@ namespace Barotrauma
|
||||
return false;
|
||||
}
|
||||
|
||||
private static readonly List<string> availableTexts = new List<string>();
|
||||
|
||||
public static string Get(string textTag, bool returnNull = false, string fallBackTag = null, bool useEnglishAsFallBack = true)
|
||||
{
|
||||
lock (mutex)
|
||||
@@ -228,11 +231,19 @@ namespace Barotrauma
|
||||
return textTag;
|
||||
}
|
||||
#endif
|
||||
|
||||
availableTexts.Clear();
|
||||
foreach (TextPack textPack in textPacks[Language])
|
||||
{
|
||||
string text = textPack.Get(textTag);
|
||||
if (text != null) { return text; }
|
||||
var texts = textPack.GetAll(textTag);
|
||||
if (texts != null)
|
||||
{
|
||||
availableTexts.AddRange(texts);
|
||||
}
|
||||
}
|
||||
|
||||
if (availableTexts.Any())
|
||||
{
|
||||
return availableTexts.GetRandom().Replace(@"\n", "\n");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(fallBackTag))
|
||||
|
||||
@@ -84,6 +84,22 @@ namespace Barotrauma
|
||||
return retval;
|
||||
}
|
||||
|
||||
public override int Next(int minValue, int maxValue)
|
||||
{
|
||||
int range = maxValue - minValue;
|
||||
return minValue + Next(range);
|
||||
}
|
||||
|
||||
public override void NextBytes(byte[] buffer)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void NextBytes(Span<byte> buffer)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a random value is greater or equal than 0 and less than maxValue
|
||||
/// </summary>
|
||||
|
||||
@@ -1,3 +1,42 @@
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
v0.1300.0.9 (unstable)
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
|
||||
Changes:
|
||||
- Re-enabling in-game hints now resets hints previously set not be shown again.
|
||||
- Reduced the stun duration of Molochs' and Hammerheads' attacks. Also add some bitewounds damage on the Molochs' attacks so that they trigger all the AI reactions and don't get treated as failed attacks.
|
||||
|
||||
Fixes:
|
||||
- Fixed occasional "mission mismatch" errors when entering a hunting grounds level in the multiplayer campaign.
|
||||
- Fixed camera shaking/vibrating when moving at high speed.
|
||||
- Fixed monsters being able to attack through ruin walls.
|
||||
- Fixed overlapping vending machine & light switch in CrewModule_02.
|
||||
- Fixed respawn shuttle maintaining an incorrect position after getting dispatched.
|
||||
- Fixed selected mission carrying over to whichever level you choose in the campaign.
|
||||
- Fixed diving suit's vision obstructing effect disappearing if you also wear a diving mask.
|
||||
- Removed unnecessary extra light components from large and normal engine.
|
||||
- Fixed "attempted to select a locked connection" error when a player joins mid-round after the path to the next biome has been unlocked.
|
||||
- Fixed campaign map crush depth warnings being always calculated for the currently docked submarine, not taking a possible pending submarine switch into account.
|
||||
- Fixed Hammerhead Spawns not targeting decoys.
|
||||
- Fixed the abyss monsters not targeting "provocative" items, like flares, glowsticks, scooters etc.
|
||||
- Fixed Hammerhead Matriarch constantly fleeing from divers. It's intentional that that the matriarch avoids the divers, but not as much. Now they should flee briefly only when shot by the player, making it possible for the divers to reach it (#5449).
|
||||
- Fixed distant sonar waves not being visible in multiplayer.
|
||||
- Fixed distant sonar waves being visible from too far away.
|
||||
- Fixed the boss health bar vanishing too quickly in the multiplayer game mode.
|
||||
- Fixed bots sometimes getting stuck while trying to find a safer room, if they fail to find any oxygen tanks. They should run to a safety instead.
|
||||
- Fixed monsters moving weirdly in multiplayer game (only unstable).
|
||||
|
||||
Modding:
|
||||
- Fixed custom loading screen tips not showing up if the vanilla content package is enabled.
|
||||
- Fixed crashing when loading a save where a stack contains more items than the maximum stack size for the item/container.
|
||||
|
||||
Bots:
|
||||
- Fixed bots reporting unnecessarily when they abort a cleaning up task (#5400). Also fixes (much more rare) unnecessary reporting with the other orders.
|
||||
- Fixed some inconsistencies in the automatic crew selection logic used for assigning orders without specifying the target.
|
||||
- Fixed bots putting multiple fuel rods in the reactor if there's more than one rod in the reactor (#5213). Fixed bots swapping out full fuel rods from the reactor (#5503). Both issues closely related.
|
||||
- Fixed job specific autonomous objectives being broken in the sub test mode.
|
||||
- Fixed bots taking items from fabricators and deconstructors (#5431).
|
||||
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
v0.1300.0.8 (unstable)
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user