Picking items from outside the sub, replcaed fabricator.png with separate sprites for each machine, descriptions moved from itemprefab to the mapentityprefab base class, editortutorial progress
This commit is contained in:
@@ -158,7 +158,7 @@ namespace Barotrauma
|
||||
|
||||
foreach (Controller controller in buttons)
|
||||
{
|
||||
if (Vector2.Distance(controller.Item.SimPosition, character.SimPosition) > controller.Item.PickDistance * 2.0f) continue;
|
||||
if (Vector2.Distance(controller.Item.Position, character.Position) > controller.Item.PickDistance * 2.0f) continue;
|
||||
|
||||
controller.Item.Pick(character, false, true);
|
||||
break;
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace Barotrauma
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Vector2.Distance(character.SimPosition, container.Item.SimPosition) > container.Item.PickDistance
|
||||
if (Vector2.Distance(character.Position, container.Item.Position) > container.Item.PickDistance
|
||||
&& !container.Item.IsInsideTrigger(character.Position))
|
||||
{
|
||||
AddSubObjective(new AIObjectiveGoTo(container.Item, character));
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Barotrauma
|
||||
{
|
||||
if (targetItem != null)
|
||||
{
|
||||
if (Vector2.Distance(character.SimPosition, targetItem.SimPosition) < targetItem.PickDistance)
|
||||
if (Vector2.Distance(character.Position, targetItem.Position) < targetItem.PickDistance)
|
||||
{
|
||||
int targetSlot = -1;
|
||||
if (equip)
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace Barotrauma
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
allowedDistance = Math.Max(item.PickDistance, allowedDistance);
|
||||
allowedDistance = Math.Max(ConvertUnits.ToSimUnits(item.PickDistance), allowedDistance);
|
||||
if (item.IsInsideTrigger(character.WorldPosition)) completed = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace Barotrauma
|
||||
{
|
||||
if (component.CanBeSelected)
|
||||
{
|
||||
if (Vector2.Distance(character.SimPosition, component.Item.SimPosition) < component.Item.PickDistance
|
||||
if (Vector2.Distance(character.Position, component.Item.Position) < component.Item.PickDistance
|
||||
|| component.Item.IsInsideTrigger(character.WorldPosition))
|
||||
{
|
||||
if (character.SelectedConstruction != component.Item && component.CanBeSelected)
|
||||
|
||||
@@ -383,7 +383,7 @@ namespace Barotrauma
|
||||
|
||||
avgVelocity = avgVelocity / Limbs.Count();
|
||||
|
||||
float impact = Vector2.Dot((f1.Body.LinearVelocity + avgVelocity) / 2.0f, -normal);
|
||||
float impact = Vector2.Dot(avgVelocity, -normal);
|
||||
|
||||
if (GameMain.Server != null) impact = impact / 2.0f;
|
||||
|
||||
|
||||
@@ -676,8 +676,15 @@ namespace Barotrauma
|
||||
if (torso == null) return null;
|
||||
|
||||
Vector2 pos = (torso.body.TargetPosition != Vector2.Zero) ? torso.body.TargetPosition : torso.SimPosition;
|
||||
Vector2 pickPos = selectedConstruction == null ? mouseSimPos : selectedConstruction.SimPosition;
|
||||
|
||||
return Item.FindPickable(pos, selectedConstruction == null ? mouseSimPos : selectedConstruction.SimPosition, AnimController.CurrentHull, selectedItems);
|
||||
if (Submarine != null)
|
||||
{
|
||||
pos += Submarine.SimPosition;
|
||||
pickPos += Submarine.SimPosition;
|
||||
}
|
||||
|
||||
return Item.FindPickable(pos, pickPos, AnimController.CurrentHull, selectedItems);
|
||||
}
|
||||
|
||||
private Character FindClosestCharacter(Vector2 mouseSimPos, float maxDist = 150.0f)
|
||||
|
||||
@@ -210,7 +210,7 @@ namespace Barotrauma
|
||||
body.CollidesWith = Physics.CollisionAll & ~Physics.CollisionCharacter & ~Physics.CollisionMisc;
|
||||
}
|
||||
|
||||
impactTolerance = ToolBox.GetAttributeFloat(element, "impacttolerance", character.IsHumanoid ? 15.0f : 50.0f);
|
||||
impactTolerance = ToolBox.GetAttributeFloat(element, "impacttolerance", character.IsHumanoid ? 10.0f : 50.0f);
|
||||
|
||||
body.UserData = this;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user