- CrewCommander key can be changed

- Improved logic for teleporting character in/out the sub
- changed Turret.AIOperate to use the new coordinate system
- neutralballastlevel option in steering
- crewmanager UI works properly with different numbers of crew members
- fixed obstructvision "twitching" when moving in/out the sub
- resetting steering velocity when AI is waiting
- GetItem AIObjective ignores items outside the sub
- crew has the "dismissed" order by default
-
This commit is contained in:
Regalis
2016-01-20 00:26:45 +02:00
parent 4dd48d7bf2
commit 6c57c1270c
24 changed files with 213 additions and 74 deletions
@@ -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 > 1.0f)
if (Math.Abs(Force) > 1.0f)
{
Vector2 currForce = new Vector2((force / 100.0f) * maxForce * (voltage / minVoltage), 0.0f);
@@ -244,7 +244,7 @@ namespace Barotrauma.Items.Components
{
var mission = GameMain.GameSession.Mission;
if (!string.IsNullOrWhiteSpace(mission.RadarLabel))
if (!string.IsNullOrWhiteSpace(mission.RadarLabel) && mission.RadarPosition != Vector2.Zero)
{
DrawMarker(spriteBatch,
mission.RadarLabel,
@@ -27,6 +27,8 @@ namespace Barotrauma.Items.Components
private bool valueChanged;
private float autopilotRayCastTimer;
private float neutralBallastLevel;
bool AutoPilot
{
@@ -47,6 +49,17 @@ namespace Barotrauma.Items.Components
}
}
[Editable, HasDefaultValue(0.5f, true)]
public float NeutralBallastLevel
{
get { return neutralBallastLevel; }
set
{
neutralBallastLevel = MathHelper.Clamp(value, 0.0f, 1.0f);
}
}
private Vector2 TargetVelocity
{
get { return targetVelocity;}
@@ -115,7 +128,11 @@ namespace Barotrauma.Items.Components
item.SendSignal(targetVelocity.X.ToString(CultureInfo.InvariantCulture), "velocity_x_out");
item.SendSignal((-targetVelocity.Y).ToString(CultureInfo.InvariantCulture), "velocity_y_out");
float targetLevel = -targetVelocity.Y;
targetLevel += (neutralBallastLevel - 0.5f) * 100.0f;
item.SendSignal(targetLevel.ToString(CultureInfo.InvariantCulture), "velocity_y_out");
}
public override void DrawHUD(SpriteBatch spriteBatch, Character character)