Endworm attacks working, itemlabel text saving bugfix, deconstructors & fabricators need power, engine sprite, disable wire node dragging in character mode, only hit with one meleeweapon at a time, fixrequirement text overflow fix, mapentities can hace multiple categories, Gap.FindHull fix, Waypoint ladder & gap saving, stuff
This commit is contained in:
@@ -8,7 +8,7 @@ using System.Xml.Linq;
|
||||
|
||||
namespace Barotrauma.Items.Components
|
||||
{
|
||||
class Deconstructor : ItemComponent
|
||||
class Deconstructor : Powered
|
||||
{
|
||||
GUIProgressBar progressBar;
|
||||
GUIButton activateButton;
|
||||
@@ -39,7 +39,12 @@ namespace Barotrauma.Items.Components
|
||||
return;
|
||||
}
|
||||
|
||||
progressTimer += deltaTime;
|
||||
if (voltage < minVoltage) return;
|
||||
|
||||
if (powerConsumption == 0.0f) voltage = 1.0f;
|
||||
|
||||
progressTimer += deltaTime*voltage;
|
||||
Voltage -= deltaTime * 10.0f;
|
||||
|
||||
var targetItem = container.Inventory.Items.FirstOrDefault(i => i != null);
|
||||
progressBar.BarSize = Math.Min(progressTimer / targetItem.Prefab.DeconstructTime, 1.0f);
|
||||
@@ -83,6 +88,8 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
SetActive(!IsActive);
|
||||
|
||||
currPowerConsumption = IsActive ? powerConsumption : 0.0f;
|
||||
|
||||
item.NewComponentEvent(this, true, true);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace Barotrauma.Items.Components
|
||||
if (powerConsumption == 0.0f) voltage = 1.0f;
|
||||
|
||||
Force = MathHelper.Lerp(force, (voltage < minVoltage) ? 0.0f : targetForce, 0.1f);
|
||||
if (Force != 0.0f)
|
||||
if (Force > 1.0f)
|
||||
{
|
||||
Vector2 currForce = new Vector2((force / 100.0f) * maxForce * (voltage / minVoltage), 0.0f);
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
GameMain.ParticleManager.CreateParticle("bubbles", item.WorldPosition,
|
||||
var bubbles = GameMain.ParticleManager.CreateParticle("bubbles", item.WorldPosition - (Vector2.UnitX * item.Rect.Width/2),
|
||||
-currForce / 5.0f + new Vector2(Rand.Range(-100.0f, 100.0f), Rand.Range(-50f, 50f)),
|
||||
0.0f, item.CurrentHull);
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
}
|
||||
|
||||
class Fabricator : ItemComponent
|
||||
class Fabricator : Powered
|
||||
{
|
||||
private List<FabricableItem> fabricableItems;
|
||||
|
||||
@@ -64,8 +64,8 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
private GUIFrame selectedItemFrame;
|
||||
|
||||
GUIProgressBar progressBar;
|
||||
GUIButton activateButton;
|
||||
private GUIProgressBar progressBar;
|
||||
private GUIButton activateButton;
|
||||
|
||||
private FabricableItem fabricatedItem;
|
||||
private float timeUntilReady;
|
||||
@@ -208,6 +208,8 @@ namespace Barotrauma.Items.Components
|
||||
var containers = item.GetComponents<ItemContainer>();
|
||||
containers[0].Inventory.Locked = true;
|
||||
containers[1].Inventory.Locked = true;
|
||||
|
||||
currPowerConsumption = powerConsumption;
|
||||
}
|
||||
|
||||
private void CancelFabricating()
|
||||
@@ -216,6 +218,8 @@ namespace Barotrauma.Items.Components
|
||||
IsActive = false;
|
||||
fabricatedItem = null;
|
||||
|
||||
currPowerConsumption = 0.0f;
|
||||
|
||||
if (activateButton != null)
|
||||
{
|
||||
activateButton.Text = "Create";
|
||||
@@ -231,13 +235,19 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
public override void Update(float deltaTime, Camera cam)
|
||||
{
|
||||
timeUntilReady -= deltaTime;
|
||||
|
||||
if (progressBar!=null)
|
||||
{
|
||||
progressBar.BarSize = fabricatedItem == null ? 0.0f : (fabricatedItem.RequiredTime - timeUntilReady) / fabricatedItem.RequiredTime;
|
||||
}
|
||||
|
||||
if (voltage < minVoltage) return;
|
||||
|
||||
if (powerConsumption == 0) voltage = 1.0f;
|
||||
|
||||
timeUntilReady -= deltaTime*voltage;
|
||||
|
||||
voltage -= deltaTime * 10.0f;
|
||||
|
||||
if (timeUntilReady > 0.0f) return;
|
||||
|
||||
var containers = item.GetComponents<ItemContainer>();
|
||||
|
||||
@@ -406,14 +406,14 @@ namespace Barotrauma.Items.Components
|
||||
//temperature too high/low
|
||||
if (Math.Abs(tempDiff)>500.0f)
|
||||
{
|
||||
autoTemp = false;
|
||||
AutoTemp = false;
|
||||
FissionRate += deltaTime * 100.0f * Math.Sign(tempDiff);
|
||||
CoolingRate -= deltaTime * 100.0f * Math.Sign(tempDiff);
|
||||
}
|
||||
//temperature OK
|
||||
else
|
||||
{
|
||||
autoTemp = true;
|
||||
AutoTemp = true;
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -566,7 +566,7 @@ namespace Barotrauma.Items.Components
|
||||
return;
|
||||
}
|
||||
|
||||
autoTemp = newAutoTemp;
|
||||
AutoTemp = newAutoTemp;
|
||||
Temperature = newTemperature;
|
||||
ShutDownTemp = newShutDownTemp;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user