(a00338777) v0.9.2.1
This commit is contained in:
@@ -14,7 +14,9 @@ namespace Barotrauma
|
||||
private float waitUntilPathUnreachable;
|
||||
private bool getDivingGearIfNeeded;
|
||||
|
||||
public Func<bool> customCondition;
|
||||
public Func<bool> requiredCondition;
|
||||
public Func<PathNode, bool> startNodeFilter;
|
||||
public Func<PathNode, bool> endNodeFilter;
|
||||
|
||||
public bool followControlledCharacter;
|
||||
public bool mimic;
|
||||
@@ -137,7 +139,12 @@ namespace Barotrauma
|
||||
currTargetSimPos -= diff;
|
||||
}
|
||||
}
|
||||
character.AIController.SteeringManager.SteeringSeek(currTargetSimPos);
|
||||
if (PathSteering != null)
|
||||
{
|
||||
PathSteering.startNodeFilter = startNodeFilter;
|
||||
PathSteering.endNodeFilter = endNodeFilter;
|
||||
}
|
||||
SteeringManager.SteeringSeek(currTargetSimPos);
|
||||
if (SteeringManager != PathSteering)
|
||||
{
|
||||
SteeringManager.SteeringAvoid(deltaTime, lookAheadDistance: 5, weight: 1, heading: VectorExtensions.Forward(character.AnimController.Collider.Rotation));
|
||||
@@ -191,7 +198,7 @@ namespace Barotrauma
|
||||
}
|
||||
else if (closeEnough)
|
||||
{
|
||||
if (customCondition == null || customCondition())
|
||||
if (requiredCondition == null || requiredCondition())
|
||||
{
|
||||
if (Target is Item item)
|
||||
{
|
||||
@@ -218,7 +225,7 @@ namespace Barotrauma
|
||||
|
||||
private void CalculateCloseEnough()
|
||||
{
|
||||
float interactionDistance = Target is Item i ? i.InteractDistance * 0.9f : 0;
|
||||
float interactionDistance = Target is Item i ? i.InteractDistance + Math.Max(i.Rect.Width, i.Rect.Height) / 2 : 0;
|
||||
CloseEnough = Math.Max(interactionDistance, CloseEnough);
|
||||
}
|
||||
|
||||
|
||||
+13
-2
@@ -149,7 +149,14 @@ namespace Barotrauma
|
||||
character?.Speak(TextManager.GetWithVariable("DialogCannotRepair", "[itemname]", Item.Name, true), null, 0.0f, "cannotrepair", 10.0f);
|
||||
}
|
||||
}
|
||||
repairable.CurrentFixer = abandon && repairable.CurrentFixer == character ? null : character;
|
||||
if (abandon)
|
||||
{
|
||||
repairable.StopRepairing(character);
|
||||
}
|
||||
else
|
||||
{
|
||||
repairable.StartRepairing(character, Repairable.FixActions.Repair);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -161,7 +168,11 @@ namespace Barotrauma
|
||||
constructor: () =>
|
||||
{
|
||||
previousCondition = -1;
|
||||
var objective = new AIObjectiveGoTo(Item, character, objectiveManager);
|
||||
var objective = new AIObjectiveGoTo(Item, character, objectiveManager)
|
||||
{
|
||||
// Don't stop in ladders, because we can't interact with other items while holding the ladders.
|
||||
endNodeFilter = node => node.Waypoint.Ladders == null
|
||||
};
|
||||
if (repairTool != null)
|
||||
{
|
||||
objective.CloseEnough = repairTool.Range * 0.75f;
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ namespace Barotrauma
|
||||
if (Character.CharacterList.Any(c => c.CurrentHull == item.CurrentHull && !HumanAIController.IsFriendly(c))) { return false; }
|
||||
if (!Objectives.ContainsKey(item))
|
||||
{
|
||||
if (item.Repairables.All(r => item.Condition > r.ShowRepairUIThreshold)) { return false; }
|
||||
if (item.Repairables.All(r => item.ConditionPercentage > r.ShowRepairUIThreshold)) { return false; }
|
||||
}
|
||||
if (RequireAdequateSkills)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user