(d9829ac) v0.9.4.0

This commit is contained in:
Regalis
2019-10-24 18:05:42 +02:00
parent 9aa12bcac2
commit b39922a074
319 changed files with 12516 additions and 6815 deletions
@@ -51,6 +51,8 @@ namespace Barotrauma.Items.Components
const float AIUpdateInterval = 0.2f;
private float aiUpdateTimer;
private Character lastAIUser;
private Character lastUser;
private Character LastUser
{
@@ -63,7 +65,7 @@ namespace Barotrauma.Items.Components
}
}
[Editable(0.0f, float.MaxValue, ToolTip = "How much power (kW) the reactor generates when operating at full capacity."), Serialize(10000.0f, true)]
[Editable(0.0f, float.MaxValue), Serialize(10000.0f, true, description: "How much power (kW) the reactor generates when operating at full capacity.")]
public float MaxPowerOutput
{
get { return maxPowerOutput; }
@@ -73,21 +75,21 @@ namespace Barotrauma.Items.Components
}
}
[Editable(0.0f, float.MaxValue, ToolTip = "How long the temperature has to stay critical until a meltdown occurs."), Serialize(120.0f, true)]
[Editable(0.0f, float.MaxValue), Serialize(120.0f, true, description: "How long the temperature has to stay critical until a meltdown occurs.")]
public float MeltdownDelay
{
get { return meltDownDelay; }
set { meltDownDelay = Math.Max(value, 0.0f); }
}
[Editable(0.0f, float.MaxValue, ToolTip = "How long the temperature has to stay critical until the reactor catches fire."), Serialize(30.0f, true)]
[Editable(0.0f, float.MaxValue), Serialize(30.0f, true, description: "How long the temperature has to stay critical until the reactor catches fire.")]
public float FireDelay
{
get { return fireDelay; }
set { fireDelay = Math.Max(value, 0.0f); }
}
[Serialize(0.0f, true)]
[Serialize(0.0f, true, description: "Current temperature of the reactor (0% - 100%). Indended to be used by StatusEffect conditionals.")]
public float Temperature
{
get { return temperature; }
@@ -98,7 +100,7 @@ namespace Barotrauma.Items.Components
}
}
[Serialize(0.0f, true)]
[Serialize(0.0f, true, description: "Current fission rate of the reactor (0% - 100%). Intended to be used by StatusEffect conditionals (setting the value from XML is not recommended).")]
public float FissionRate
{
get { return fissionRate; }
@@ -109,7 +111,7 @@ namespace Barotrauma.Items.Components
}
}
[Serialize(0.0f, true)]
[Serialize(0.0f, true, description: "Current turbine output of the reactor (0% - 100%). Intended to be used by StatusEffect conditionals (setting the value from XML is not recommended).")]
public float TurbineOutput
{
get { return turbineOutput; }
@@ -120,7 +122,7 @@ namespace Barotrauma.Items.Components
}
}
[Serialize(0.2f, true), Editable(0.0f, 1000.0f, ToolTip = "How fast the condition of the contained fuel rods deteriorates.")]
[Serialize(0.2f, true, description: "How fast the condition of the contained fuel rods deteriorates per second."), Editable(0.0f, 1000.0f)]
public float FuelConsumptionRate
{
get { return fuelConsumptionRate; }
@@ -131,7 +133,7 @@ namespace Barotrauma.Items.Components
}
}
[Serialize(false, true)]
[Serialize(false, true, description: "Is the temperature currently critical. Intended to be used by StatusEffect conditionals (setting the value from XML has no effect).")]
public bool TemperatureCritical
{
get { return temperature > allowedTemperature.Y; }
@@ -143,7 +145,7 @@ namespace Barotrauma.Items.Components
private float targetFissionRate;
private float targetTurbineOutput;
[Serialize(false, true)]
[Serialize(false, true, description: "Is the automatic temperature control currently on. Indended to be used by StatusEffect conditionals (setting the value from XML is not recommended).")]
public bool AutoTemp
{
get { return autoTemp; }
@@ -193,6 +195,18 @@ namespace Barotrauma.Items.Components
}
#endif
//if an AI character was using the item on the previous frame but not anymore, turn autotemp on
// (= bots turn autotemp back on when leaving the reactor)
if (lastAIUser != null)
{
if (lastAIUser.SelectedConstruction != item && lastAIUser.CanInteractWith(item))
{
AutoTemp = true;
unsentChanges = true;
lastAIUser = null;
}
}
prevAvailableFuel = AvailableFuel;
ApplyStatusEffects(ActionType.OnActive, deltaTime, null);
@@ -562,7 +576,7 @@ namespace Barotrauma.Items.Components
character.Speak(TextManager.Get("DialogReactorTaken"), null, 0.0f, "reactortaken", 10.0f);
}
LastUser = character;
LastUser = lastAIUser = character;
switch (objective.Option.ToLowerInvariant())
{