Husk improvements, option for admin to talk to dead players, spectators or one specific player, entitygrid bugfix
This commit is contained in:
@@ -107,6 +107,14 @@ namespace Barotrauma
|
||||
|
||||
Character.AnimController.IgnorePlatforms = (-Character.AnimController.TargetMovement.Y > Math.Abs(Character.AnimController.TargetMovement.X));
|
||||
|
||||
if (Character.AnimController is HumanoidAnimController)
|
||||
{
|
||||
if (Math.Abs(Character.AnimController.TargetMovement.X) > 0.1f && !Character.AnimController.InWater)
|
||||
{
|
||||
Character.AnimController.TargetDir = Character.AnimController.TargetMovement.X > 0.0f ? Direction.Right : Direction.Left;
|
||||
}
|
||||
}
|
||||
|
||||
if (updateTargetsTimer > 0.0)
|
||||
{
|
||||
updateTargetsTimer -= deltaTime;
|
||||
|
||||
@@ -43,6 +43,9 @@ namespace Barotrauma
|
||||
stepSize = ToolBox.GetAttributeVector2(element, "stepsize", Vector2.One);
|
||||
stepSize = ConvertUnits.ToSimUnits(stepSize);
|
||||
|
||||
walkSpeed = ToolBox.GetAttributeFloat(element, "walkspeed", 1.0f);
|
||||
swimSpeed = ToolBox.GetAttributeFloat(element, "swimspeed", 1.0f);
|
||||
|
||||
//stepOffset = ToolBox.GetAttributeVector2(element, "stepoffset", Vector2.One);
|
||||
//stepOffset = ConvertUnits.ToSimUnits(stepOffset);
|
||||
|
||||
|
||||
@@ -31,9 +31,6 @@ namespace Barotrauma
|
||||
|
||||
flip = ToolBox.GetAttributeBool(element, "flip", false);
|
||||
|
||||
walkSpeed = ToolBox.GetAttributeFloat(element, "walkspeed", 1.0f);
|
||||
swimSpeed = ToolBox.GetAttributeFloat(element, "swimspeed", 1.0f);
|
||||
|
||||
float footRot = ToolBox.GetAttributeFloat(element,"footrotation", float.NaN);
|
||||
if (float.IsNaN(footRot))
|
||||
{
|
||||
|
||||
@@ -241,7 +241,7 @@ namespace Barotrauma
|
||||
|
||||
float footMid = waist.SimPosition.X;// (leftFoot.SimPosition.X + rightFoot.SimPosition.X) / 2.0f;
|
||||
|
||||
movement = MathUtils.SmoothStep(movement, TargetMovement, movementLerp);
|
||||
movement = MathUtils.SmoothStep(movement, TargetMovement*walkSpeed, movementLerp);
|
||||
movement.Y = 0.0f;
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
@@ -502,7 +502,7 @@ namespace Barotrauma
|
||||
|
||||
if (TargetMovement == Vector2.Zero) return;
|
||||
|
||||
movement = MathUtils.SmoothStep(movement, TargetMovement, 0.3f);
|
||||
movement = MathUtils.SmoothStep(movement, TargetMovement*swimSpeed, 0.3f);
|
||||
|
||||
//dont try to move upwards if head is already out of water
|
||||
if (surfaceLimiter > 1.0f && TargetMovement.Y > 0.0f)
|
||||
|
||||
@@ -391,7 +391,10 @@ namespace Barotrauma
|
||||
|
||||
Properties = ObjectProperty.GetProperties(this);
|
||||
|
||||
Info = characterInfo==null ? new CharacterInfo(file) : characterInfo;
|
||||
if (file == humanConfigFile)
|
||||
{
|
||||
Info = characterInfo == null ? new CharacterInfo(file) : characterInfo;
|
||||
}
|
||||
|
||||
XDocument doc = ToolBox.TryLoadXml(file);
|
||||
if (doc == null || doc.Root == null) return;
|
||||
@@ -453,22 +456,26 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
if (Info.PickedItemIDs.Any())
|
||||
if (file == humanConfigFile)
|
||||
{
|
||||
for (ushort i = 0; i < Info.PickedItemIDs.Count; i++ )
|
||||
if (Info.PickedItemIDs.Any())
|
||||
{
|
||||
if (Info.PickedItemIDs[i] == 0) continue;
|
||||
for (ushort i = 0; i < Info.PickedItemIDs.Count; i++ )
|
||||
{
|
||||
if (Info.PickedItemIDs[i] == 0) continue;
|
||||
|
||||
Item item = FindEntityByID(Info.PickedItemIDs[i]) as Item;
|
||||
Item item = FindEntityByID(Info.PickedItemIDs[i]) as Item;
|
||||
|
||||
System.Diagnostics.Debug.Assert(item != null);
|
||||
if (item == null) continue;
|
||||
System.Diagnostics.Debug.Assert(item != null);
|
||||
if (item == null) continue;
|
||||
|
||||
item.Pick(this, true, true, true);
|
||||
inventory.TryPutItem(item, i, false);
|
||||
item.Pick(this, true, true, true);
|
||||
inventory.TryPutItem(item, i, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
AnimController.FindHull(null);
|
||||
if (AnimController.CurrentHull != null) Submarine = AnimController.CurrentHull.Submarine;
|
||||
|
||||
|
||||
@@ -132,6 +132,8 @@ namespace Barotrauma
|
||||
return;
|
||||
}
|
||||
|
||||
name = "";
|
||||
|
||||
if (doc.Root.Element("name") != null)
|
||||
{
|
||||
string firstNamePath = ToolBox.GetAttributeString(doc.Root.Element("name"), "firstname", "");
|
||||
|
||||
Reference in New Issue
Block a user