Added battery recharge docks, moved applying OnActive statuseffects to the Powered itemcomponent, removed smoke particles from stun baton hit effect
This commit is contained in:
@@ -33,6 +33,8 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
|
||||
if (voltage < minVoltage) return;
|
||||
|
||||
ApplyStatusEffects(ActionType.OnActive, deltaTime, null);
|
||||
|
||||
if (powerConsumption == 0.0f) voltage = 1.0f;
|
||||
|
||||
|
||||
@@ -209,7 +209,7 @@ namespace Barotrauma.Items.Components
|
||||
public override void Update(float deltaTime, Camera cam)
|
||||
{
|
||||
#if CLIENT
|
||||
if (progressBar!=null)
|
||||
if (progressBar != null)
|
||||
{
|
||||
progressBar.BarSize = fabricatedItem == null ? 0.0f : (fabricatedItem.RequiredTime - timeUntilReady) / fabricatedItem.RequiredTime;
|
||||
}
|
||||
@@ -217,6 +217,8 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
if (voltage < minVoltage) return;
|
||||
|
||||
ApplyStatusEffects(ActionType.OnActive, deltaTime, null);
|
||||
|
||||
if (powerConsumption == 0) voltage = 1.0f;
|
||||
|
||||
timeUntilReady -= deltaTime*voltage;
|
||||
|
||||
@@ -62,6 +62,11 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
hasPower = voltage > minVoltage;
|
||||
|
||||
if (hasPower)
|
||||
{
|
||||
ApplyStatusEffects(ActionType.OnActive, deltaTime, null);
|
||||
}
|
||||
|
||||
voltage = 0.0f;
|
||||
}
|
||||
|
||||
|
||||
@@ -64,8 +64,6 @@ namespace Barotrauma.Items.Components
|
||||
powerDownTimer = 0.0f;
|
||||
}
|
||||
|
||||
ApplyStatusEffects(ActionType.OnActive, deltaTime, null);
|
||||
|
||||
running = true;
|
||||
|
||||
CurrFlow = Math.Min(voltage, 1.0f) * generatedAmount*100.0f;
|
||||
|
||||
@@ -186,16 +186,16 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
|
||||
ApplyStatusEffects(ActionType.OnActive, deltaTime, null);
|
||||
|
||||
|
||||
fissionRate = Math.Min(fissionRate, AvailableFuel);
|
||||
|
||||
float heat = 80 * fissionRate * (AvailableFuel/2000.0f);
|
||||
|
||||
float heat = 80 * fissionRate * (AvailableFuel / 2000.0f);
|
||||
float heatDissipation = 50 * coolingRate + Math.Max(ExtraCooling, 5.0f);
|
||||
|
||||
float deltaTemp = (((heat - heatDissipation) * 5) - temperature) / 10000.0f;
|
||||
Temperature = temperature + deltaTemp;
|
||||
|
||||
if (temperature>fireTemp && temperature-deltaTemp<fireTemp)
|
||||
if (temperature > fireTemp && temperature - deltaTemp < fireTemp)
|
||||
{
|
||||
#if CLIENT
|
||||
Vector2 baseVel = Rand.Vector(300.0f);
|
||||
|
||||
@@ -129,7 +129,9 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
|
||||
if (voltage < minVoltage && powerConsumption > 0.0f) return;
|
||||
|
||||
|
||||
ApplyStatusEffects(ActionType.OnActive, deltaTime, null);
|
||||
|
||||
if (autoPilot)
|
||||
{
|
||||
UpdateAutoPilot(deltaTime);
|
||||
@@ -138,12 +140,10 @@ namespace Barotrauma.Items.Components
|
||||
item.SendSignal(0, targetVelocity.X.ToString(CultureInfo.InvariantCulture), "velocity_x_out", null);
|
||||
|
||||
float targetLevel = -targetVelocity.Y;
|
||||
|
||||
targetLevel += (neutralBallastLevel - 0.5f) * 100.0f;
|
||||
|
||||
item.SendSignal(0, targetLevel.ToString(CultureInfo.InvariantCulture), "velocity_y_out", null);
|
||||
|
||||
|
||||
voltage -= deltaTime;
|
||||
}
|
||||
|
||||
|
||||
@@ -110,9 +110,7 @@ namespace Barotrauma.Items.Components
|
||||
float chargeRatio = (float)(Math.Sqrt(charge / capacity));
|
||||
float gridPower = 0.0f;
|
||||
float gridLoad = 0.0f;
|
||||
|
||||
//if (item.linkedTo.Count == 0) return;
|
||||
|
||||
|
||||
foreach (Connection c in item.Connections)
|
||||
{
|
||||
if (c.Name == "power_in") continue;
|
||||
@@ -125,18 +123,12 @@ namespace Barotrauma.Items.Components
|
||||
gridPower -= pt.CurrPowerConsumption;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//float gridRate = voltage;
|
||||
|
||||
|
||||
if (chargeRatio > 0.0f)
|
||||
{
|
||||
ApplyStatusEffects(ActionType.OnActive, deltaTime, null);
|
||||
}
|
||||
|
||||
//recharge
|
||||
//if (gridRate >= chargeRate)
|
||||
//{
|
||||
|
||||
if (charge >= capacity)
|
||||
{
|
||||
rechargeVoltage = 0.0f;
|
||||
@@ -149,9 +141,7 @@ namespace Barotrauma.Items.Components
|
||||
currPowerConsumption = MathHelper.Lerp(currPowerConsumption, rechargeSpeed, 0.05f);
|
||||
Charge += currPowerConsumption * rechargeVoltage / 3600.0f;
|
||||
}
|
||||
|
||||
//}
|
||||
|
||||
|
||||
//provide power to the grid
|
||||
if (gridLoad > 0.0f)
|
||||
{
|
||||
|
||||
@@ -91,6 +91,7 @@ namespace Barotrauma.Items.Components
|
||||
#if CLIENT
|
||||
if (voltage > minVoltage)
|
||||
{
|
||||
ApplyStatusEffects(ActionType.OnActive, deltaTime, null);
|
||||
if (!powerOnSoundPlayed)
|
||||
{
|
||||
powerOnSound.Play(1.0f, 600.0f, item.WorldPosition);
|
||||
@@ -101,6 +102,11 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
powerOnSoundPlayed = false;
|
||||
}
|
||||
#else
|
||||
if (voltage > minVoltage)
|
||||
{
|
||||
ApplyStatusEffects(ActionType.OnActive, deltaTime, null);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -135,9 +135,7 @@ namespace Barotrauma.Items.Components
|
||||
#if CLIENT
|
||||
light.ParentSub = item.Submarine;
|
||||
#endif
|
||||
|
||||
ApplyStatusEffects(ActionType.OnActive, deltaTime);
|
||||
|
||||
|
||||
#if CLIENT
|
||||
if (item.Container != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user