Improved map rendering, shops, light bugfix, junction boxes wont break as easily

This commit is contained in:
Regalis
2015-07-27 23:45:20 +03:00
parent 4238301ad3
commit 7155f1cef0
37 changed files with 472 additions and 300 deletions

View File

@@ -123,7 +123,7 @@ namespace Subsurface.Items.Components
MeltDown();
return;
}
else if (temperature==0.0f)
else if (temperature == 0.0f)
{
if (powerUpTask == null || powerUpTask.IsFinished)
{

View File

@@ -50,7 +50,7 @@ namespace Subsurface.Items.Components
pt.powerLoad += (fullLoad - pt.powerLoad) / inertia;
pt.currPowerConsumption += (-fullPower - pt.currPowerConsumption) / inertia;
pt.Item.SendSignal("", "power", fullPower / Math.Max(fullLoad, 1.0f));
if (-pt.currPowerConsumption > pt.powerLoad * 2.0f) pt.item.Condition = 0.0f;
if (-pt.currPowerConsumption > Math.Max(pt.powerLoad * 2.0f, 200.0f)) pt.item.Condition -= deltaTime*10.0f;
}
}
@@ -139,7 +139,6 @@ namespace Subsurface.Items.Components
{
connection.SendSignal(signal, sender, 0.0f);
}
}
}
}
}

View File

@@ -83,6 +83,12 @@ namespace Subsurface.Items.Components
light.Position = ConvertUnits.ToDisplayUnits(item.body.Position);
}
if (item.container!= null)
{
light.Color = Color.Transparent;
return;
}
if (powerConsumption == 0.0f)
{
voltage = 1.0f;
@@ -92,9 +98,9 @@ namespace Subsurface.Items.Components
currPowerConsumption = powerConsumption;
}
if (Rand.Range(0.0f, 1.0f)<0.05f && voltage < Rand.Range(0.0f, minVoltage))
if (Rand.Range(0.0f, 1.0f) < 0.05f && voltage < Rand.Range(0.0f, minVoltage))
{
if (voltage>0.1f) sparkSounds[Rand.Int(sparkSounds.Length)].Play(1.0f, 400.0f, item.Position);
if (voltage > 0.1f) sparkSounds[Rand.Int(sparkSounds.Length)].Play(1.0f, 400.0f, item.Position);
lightBrightness = 0.0f;
}
else
@@ -117,6 +123,13 @@ namespace Subsurface.Items.Components
}
}
public override void Remove()
{
base.Remove();
light.Remove();
}
public override void ReceiveSignal(string signal, Connection connection, Item sender, float power=0.0f)
{
base.ReceiveSignal(signal, connection, sender, power);