(f0d812055) v0.9.9.0

This commit is contained in:
Joonas Rikkonen
2020-04-23 19:19:37 +03:00
parent b647059b93
commit ac37a3b0e4
391 changed files with 15054 additions and 5420 deletions
@@ -13,6 +13,7 @@ namespace Barotrauma
public override bool KeepDivingGearOn => true;
public override bool IgnoreUnsafeHulls => true;
public override bool AllowOutsideSubmarine => true;
private readonly CombatMode initialMode;
@@ -149,12 +150,12 @@ namespace Barotrauma
}
if (!HoldPosition && seekAmmunition == null)
{
Move();
Move(deltaTime);
}
}
}
private void Move()
private void Move(float deltaTime)
{
switch (Mode)
{
@@ -163,7 +164,7 @@ namespace Barotrauma
break;
case CombatMode.Defensive:
case CombatMode.Retreat:
Retreat();
Retreat(deltaTime);
break;
default:
throw new NotImplementedException();
@@ -411,7 +412,10 @@ namespace Barotrauma
return true;
}
private void Retreat()
private float findHullTimer;
private readonly float findHullInterval = 1.0f;
private void Retreat(float deltaTime)
{
RemoveSubObjective(ref followTargetObjective);
RemoveSubObjective(ref seekAmmunition);
@@ -421,7 +425,15 @@ namespace Barotrauma
}
if (retreatTarget == null || (retreatObjective != null && !retreatObjective.CanBeCompleted))
{
retreatTarget = findSafety.FindBestHull(HumanAIController.VisibleHulls);
if (findHullTimer > 0)
{
findHullTimer -= deltaTime;
}
else
{
retreatTarget = findSafety.FindBestHull(HumanAIController.VisibleHulls);
findHullTimer = findHullInterval * Rand.Range(0.9f, 1.1f);
}
}
if (retreatTarget != null && character.CurrentHull != retreatTarget)
{