Unstable v0.1100.0.4 (November 11th 2020)

This commit is contained in:
Joonas Rikkonen
2020-11-06 20:12:15 +02:00
parent 6b36bf809d
commit b772654326
297 changed files with 12502 additions and 4277 deletions
@@ -55,6 +55,22 @@ namespace Barotrauma.Items.Components
set;
}
private float extraLoad;
private float extraLoadSetTime;
/// <summary>
/// Additional load coming from somewhere else than the devices connected to the junction box (e.g. ballast flora or piezo crystals).
/// Goes back to zero automatically if you stop setting the value.
/// </summary>
public float ExtraLoad
{
get { return extraLoad; }
set
{
extraLoad = Math.Max(value, 0.0f);
extraLoadSetTime = (float)Timing.TotalTime;
}
}
//can the component transfer power
private bool canTransfer;
public bool CanTransfer
@@ -135,6 +151,11 @@ namespace Barotrauma.Items.Components
{
RefreshConnections();
if (Timing.TotalTime > extraLoadSetTime + 1.0)
{
extraLoad = Math.Max(extraLoad - 1000.0f * deltaTime, 0);
}
if (!CanTransfer) { return; }
if (isBroken)