more accurate submarine body generation, multiplayer fixes, saving takes HiddenSubPosition into account, fire coordinate fixes, editscreen fixes, checking item triggers in AIObjectiveGoto, netlobbyscreen sync fixes, re-enabled level start/end positions, water edit fixed
This commit is contained in:
@@ -92,10 +92,7 @@ namespace Barotrauma
|
||||
|
||||
if (Vector2.Distance(character.SimPosition, enemy.SimPosition) < 3.0f)
|
||||
{
|
||||
character.AIController.SteeringManager.SteeringManual(deltaTime, character.SimPosition - enemy.SimPosition);
|
||||
}
|
||||
else
|
||||
{
|
||||
character.AIController.SteeringManager.SteeringManual(deltaTime, (character.SimPosition - enemy.SimPosition)*0.1f);
|
||||
coolDownTimer = CoolDown;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,17 +57,34 @@ namespace Barotrauma
|
||||
|
||||
character.AIController.SteeringManager.SteeringSeek(
|
||||
target != null ? target.SimPosition : targetPos);
|
||||
|
||||
Vector2 currTargetPos = target != null ? target.SimPosition : targetPos;
|
||||
if (Vector2.Distance(currTargetPos, character.SimPosition) < 1.0f)
|
||||
{
|
||||
character.AnimController.TargetDir = currTargetPos.X > character.SimPosition.X ? Direction.Right : Direction.Left;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsCompleted()
|
||||
{
|
||||
if (repeat) return false;
|
||||
|
||||
bool completed = false;
|
||||
|
||||
float allowedDistance = 0.5f;
|
||||
var item = target as Item;
|
||||
if (item != null) allowedDistance = Math.Max(item.PickDistance,allowedDistance);
|
||||
|
||||
return Vector2.Distance(target != null ? target.SimPosition : targetPos, character.SimPosition) < allowedDistance;
|
||||
if (item != null)
|
||||
{
|
||||
allowedDistance = Math.Max(item.PickDistance, allowedDistance);
|
||||
if (item.IsInsideTrigger(character.WorldPosition)) completed = true;
|
||||
}
|
||||
|
||||
completed = completed || Vector2.Distance(target != null ? target.SimPosition : targetPos, character.SimPosition) < allowedDistance;
|
||||
|
||||
if (completed) character.AIController.SteeringManager.SteeringManual(0.0f, -character.AIController.Steering);
|
||||
|
||||
return completed;
|
||||
}
|
||||
|
||||
public override bool IsDuplicate(AIObjective otherObjective)
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace Barotrauma
|
||||
{
|
||||
if (character.Position.X < character.AnimController.CurrentHull.Rect.X + WallAvoidDistance)
|
||||
{
|
||||
pathSteering.SteeringManual(deltaTime, Vector2.UnitX);
|
||||
pathSteering.SteeringManual(deltaTime, Vector2.UnitX*5.0f);
|
||||
}
|
||||
else if (character.Position.X > character.AnimController.CurrentHull.Rect.Right - WallAvoidDistance)
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Barotrauma
|
||||
ItemComponent target = itemController == null ? targetItem: itemController;
|
||||
|
||||
if (Vector2.Distance(character.SimPosition, target.Item.SimPosition) < target.Item.PickDistance
|
||||
|| target.Item.IsInsideTrigger(character.Position))
|
||||
|| target.Item.IsInsideTrigger(character.WorldPosition))
|
||||
{
|
||||
if (character.SelectedConstruction != target.Item && target.CanBeSelected)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user