(e7bd8839d) Remove unused parameters.

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:51:12 +03:00
parent 884360216f
commit 049d3ba795
24 changed files with 403 additions and 326 deletions
@@ -37,24 +37,6 @@ namespace Barotrauma
get { return objectiveManager; }
}
private bool shouldCrouch;
private float crouchRaycastTimer;
const float CrouchRaycastInterval = 1.0f;
public const float HULL_SAFETY_THRESHOLD = 50;
public HashSet<Hull> UnsafeHulls { get; private set; } = new HashSet<Hull>();
private SteeringManager outsideSteering, insideSteering;
public IndoorsSteeringManager PathSteering => insideSteering as IndoorsSteeringManager;
public HumanoidAnimController AnimController => Character.AnimController as HumanoidAnimController;
public override AIObjectiveManager ObjectiveManager
{
get { return objectiveManager; }
}
public Order CurrentOrder
{
get;
@@ -127,7 +127,7 @@ namespace Barotrauma
}
if (abandon) { return; }
Arm(deltaTime);
Move(deltaTime);
Move();
}
private void Arm(float deltaTime)
@@ -150,7 +150,7 @@ namespace Barotrauma
}
if (Equip())
{
if (Reload(deltaTime))
if (Reload())
{
Attack(deltaTime);
}
@@ -163,16 +163,16 @@ namespace Barotrauma
}
}
private void Move(float deltaTime)
private void Move()
{
switch (Mode)
{
case CombatMode.Offensive:
Engage(deltaTime);
Engage();
break;
case CombatMode.Defensive:
case CombatMode.Retreat:
Retreat(deltaTime);
Retreat();
break;
default:
throw new NotImplementedException();
@@ -273,7 +273,7 @@ namespace Barotrauma
return true;
}
private void Retreat(float deltaTime)
private void Retreat()
{
if (followTargetObjective != null)
{
@@ -294,7 +294,7 @@ namespace Barotrauma
TryAddSubObjective(ref retreatObjective, () => new AIObjectiveGoTo(retreatTarget, character, objectiveManager, false, true));
}
private void Engage(float deltaTime)
private void Engage()
{
retreatTarget = null;
if (retreatObjective != null)
@@ -323,7 +323,7 @@ namespace Barotrauma
});
}
private bool Reload(float deltaTime)
private bool Reload()
{
if (WeaponComponent != null && WeaponComponent.requiredItems.ContainsKey(RelatedItem.RelationType.Contained))
{
@@ -100,6 +100,31 @@ namespace Barotrauma
{
#if DEBUG
DebugConsole.ThrowError("AIObjectiveFixLeak failed - the item \"" + weldingTool + "\" has no RepairTool component but is tagged as a welding tool");
#endif
abandon = true;
return;
}
Vector2 gapDiff = Leak.WorldPosition - character.WorldPosition;
// TODO: use the collider size/reach?
if (!character.AnimController.InWater && Math.Abs(gapDiff.X) < 100 && gapDiff.Y < 0.0f && gapDiff.Y > -150)
{
HumanAIController.AnimController.Crouching = true;
}
float reach = ConvertUnits.ToSimUnits(repairTool.Range);
bool canOperate = ConvertUnits.ToSimUnits(gapDiff.Length()) < reach;
if (canOperate)
{
TryAddSubObjective(ref operateObjective, () => new AIObjectiveOperateItem(repairTool, character, objectiveManager, option: "", requireEquip: true, operateTarget: Leak));
}
else
{
TryAddSubObjective(ref gotoObjective, () => new AIObjectiveGoTo(ConvertUnits.ToSimUnits(GetStandPosition()), character, objectiveManager) { CloseEnough = reach * 0.75f });
}
var repairTool = weldingTool.GetComponent<RepairTool>();
if (repairTool == null)
{
#if DEBUG
DebugConsole.ThrowError("AIObjectiveFixLeak failed - the item \"" + weldingTool + "\" has no RepairTool component but is tagged as a welding tool");
#endif
abandon = true;
return;
@@ -73,6 +73,21 @@ namespace Barotrauma
}
}
public override void Update(float deltaTime)
{
if (objectiveManager.CurrentObjective == this)
{
if (randomTimer > 0)
{
randomTimer -= deltaTime;
}
else
{
SetRandom();
}
}
}
public override bool IsCompleted() => false;
public override bool CanBeCompleted => true;
@@ -86,6 +86,10 @@ namespace Barotrauma
{
isCompleted = true;
}
if (component.AIOperate(deltaTime, character, this))
{
isCompleted = true;
}
}
else
{