Passive sonar: when not active, the sonar shows nearby sources of sound and a faint outline of the structures around them. Now it's much easier to monitor how much noise the sub is making and to hide from enemies.

+ Changed the visuals of the sonar a bit. The current rendering method is very inefficient though, todo: write a shader
This commit is contained in:
Regalis
2017-04-24 21:13:54 +03:00
parent 5eb01d4c50
commit 1dad5d9bf4
2 changed files with 215 additions and 157 deletions
@@ -295,22 +295,14 @@ namespace Barotrauma.Items.Components
FissionRate += (MathHelper.Clamp(load - target, -10.0f, 10.0f) - 1.0f) * deltaTime;
CoolingRate += (MathHelper.Clamp(target - load, -5.0f, 5.0f) - 1.0f) * deltaTime;
}
//fission rate can't be lowered below a certain amount if the core is too hot
//FissionRate = Math.Max(fissionRate, heat / 200.0f);
//the power generated by the reactor is equal to the temperature
currPowerConsumption = -temperature*powerPerTemp;
//foreach (Item i in item.ContainedItems)
//{
// i.Condition = 5.0f;
//}
if (item.CurrentHull != null)
{
//the sound can be heard from 20 000 display units away when everything running at 100%
item.CurrentHull.SoundRange = Math.Max((coolingRate + fissionRate) * 100, item.CurrentHull.AiTarget.SoundRange);
//the sound can be heard from 20 000 display units away when running at full power
item.CurrentHull.SoundRange = Math.Max(temperature * 2, item.CurrentHull.AiTarget.SoundRange);
}
UpdateGraph(deltaTime);