Build 0.20.0.0

This commit is contained in:
Markus Isberg
2022-10-27 17:54:57 +03:00
parent 05c7b1f869
commit edaf4b09fe
197 changed files with 4344 additions and 1773 deletions
@@ -265,6 +265,8 @@ namespace Barotrauma.Items.Components
foreach (DeconstructItem deconstructItem in it.Prefab.DeconstructItems)
{
if (!deconstructItem.IsValidDeconstructor(item)) { continue; }
float percentageHealth = it.Condition / it.MaxCondition;
if (percentageHealth < deconstructItem.MinCondition || percentageHealth > deconstructItem.MaxCondition) { continue; }
RegisterItem(deconstructItem.ItemIdentifier, deconstructItem.Amount);
}
@@ -1119,7 +1119,7 @@ namespace Barotrauma.Items.Components
if (it.GetComponent<PowerContainer>() is { } battery)
{
int batteryCapacity = (int)(battery.Charge / battery.Capacity * 100f);
int batteryCapacity = (int)(battery.Charge / battery.GetCapacity() * 100f);
line2 = TextManager.GetWithVariable("statusmonitor.battery.tooltip", "[amount]", batteryCapacity.ToString());
}
else if (it.GetComponent<PowerTransfer>() is { } powerTransfer)
@@ -1028,7 +1028,7 @@ namespace Barotrauma.Items.Components
{
foreach (var c in MineralClusters)
{
var unobtainedMinerals = c.resources.Where(i => i != null && i.GetRootInventoryOwner() == i);
var unobtainedMinerals = c.resources.Where(i => i != null && i.GetComponent<Holdable>() is { Attached: true });
if (unobtainedMinerals.None()) { continue; }
if (!CheckResourceMarkerVisibility(c.center, transducerCenter)) { continue; }
var i = unobtainedMinerals.FirstOrDefault();
@@ -390,7 +390,7 @@ namespace Barotrauma.Items.Components
!ActiveDockingSource.Docked && DockingTarget?.Item?.Submarine == Level.Loaded.StartOutpost && (DockingTarget?.Item?.Submarine?.Info.IsOutpost ?? false))
{
// Docking to an outpost
var subsToLeaveBehind = campaign.GetSubsToLeaveBehind(Item.Submarine);
var subsToLeaveBehind = CampaignMode.GetSubsToLeaveBehind(Item.Submarine);
if (subsToLeaveBehind.Any())
{
enterOutpostPrompt = new GUIMessageBox(