- changed how PowerContainers determine how much power to provide to the grid, batteries can now match the load of the grid
- light-emitting alien structures that hold the artifacts instead of just having the artifacts lay on the floor (can also be used for turning artifacts into power sources if installed in a sub)
This commit is contained in:
@@ -82,23 +82,26 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
IsActive = true;
|
||||
|
||||
var button = new GUIButton(new Rectangle(160, 50, 30,30), "-", GUI.Style, GuiFrame);
|
||||
button.OnClicked = (GUIButton btn, object obj) =>
|
||||
if (canBeSelected)
|
||||
{
|
||||
RechargeSpeed = Math.Max(rechargeSpeed - maxRechargeSpeed * 0.1f, 0.0f);
|
||||
item.NewComponentEvent(this, true, false);
|
||||
var button = new GUIButton(new Rectangle(160, 50, 30,30), "-", GUI.Style, GuiFrame);
|
||||
button.OnClicked = (GUIButton btn, object obj) =>
|
||||
{
|
||||
RechargeSpeed = Math.Max(rechargeSpeed - maxRechargeSpeed * 0.1f, 0.0f);
|
||||
item.NewComponentEvent(this, true, false);
|
||||
|
||||
return true;
|
||||
};
|
||||
return true;
|
||||
};
|
||||
|
||||
button = new GUIButton(new Rectangle(200, 50, 30, 30), "+", GUI.Style, GuiFrame);
|
||||
button.OnClicked = (GUIButton btn, object obj) =>
|
||||
{
|
||||
RechargeSpeed = Math.Max(rechargeSpeed + maxRechargeSpeed * 0.1f, 0.0f);
|
||||
item.NewComponentEvent(this, true, false);
|
||||
button = new GUIButton(new Rectangle(200, 50, 30, 30), "+", GUI.Style, GuiFrame);
|
||||
button.OnClicked = (GUIButton btn, object obj) =>
|
||||
{
|
||||
RechargeSpeed = Math.Max(rechargeSpeed + maxRechargeSpeed * 0.1f, 0.0f);
|
||||
item.NewComponentEvent(this, true, false);
|
||||
|
||||
return true;
|
||||
};
|
||||
return true;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public override bool Pick(Character picker)
|
||||
@@ -167,28 +170,18 @@ namespace Barotrauma.Items.Components
|
||||
return;
|
||||
}
|
||||
|
||||
//currPowerConsumption = MathHelper.Lerp(
|
||||
// currPowerConsumption,
|
||||
// -maxOutput * chargeRate,
|
||||
// 0.1f);
|
||||
|
||||
if (gridPower < gridLoad)
|
||||
{
|
||||
// CurrPowerOutput = MathHelper.Lerp(
|
||||
//CurrPowerOutput, Math.Min(maxOutput * chargeRate, gridLoad), 0.05f);
|
||||
|
||||
CurrPowerOutput = MathHelper.Lerp(
|
||||
CurrPowerOutput,
|
||||
Math.Min(maxOutput * chargeRate, gridLoad - (gridLoad * outputVoltage)),
|
||||
0.05f);
|
||||
Math.Min(maxOutput * chargeRate, gridLoad),
|
||||
deltaTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
CurrPowerOutput = MathHelper.Lerp(CurrPowerOutput, 0.0f, 0.05f);
|
||||
CurrPowerOutput = MathHelper.Lerp(CurrPowerOutput, 0.0f, deltaTime);
|
||||
}
|
||||
|
||||
|
||||
//powerConsumption = Math.Min(powerConsumption, 0.0f);
|
||||
Charge -= CurrPowerOutput / 3600.0f;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user