diff --git a/Barotrauma/Content/Characters/Charybdis/charybdis.png b/Barotrauma/Content/Characters/Charybdis/charybdis.png index ef2796ae1..6d1ba2da8 100644 Binary files a/Barotrauma/Content/Characters/Charybdis/charybdis.png and b/Barotrauma/Content/Characters/Charybdis/charybdis.png differ diff --git a/Barotrauma/Content/Characters/Charybdis/charybdis.xml b/Barotrauma/Content/Characters/Charybdis/charybdis.xml index 7d2c5047e..44eeab013 100644 --- a/Barotrauma/Content/Characters/Charybdis/charybdis.xml +++ b/Barotrauma/Content/Characters/Charybdis/charybdis.xml @@ -9,15 +9,22 @@ attackpriorityrooms="50.0" attackpriorityweaker="50" attackprioritystronger="-30" + eatpriority="40" sight="0.5" hearing="1.0"/> - + - + @@ -33,17 +40,25 @@ - - + + + + + + + + + - - + + + \ No newline at end of file diff --git a/Barotrauma/Content/Characters/Coelanth/coelanth.xml b/Barotrauma/Content/Characters/Coelanth/coelanth.xml index 7ab073ad5..194c95cd9 100644 --- a/Barotrauma/Content/Characters/Coelanth/coelanth.xml +++ b/Barotrauma/Content/Characters/Coelanth/coelanth.xml @@ -6,20 +6,27 @@ - + - + diff --git a/Barotrauma/Content/Characters/Tigerthresher/tigerthresher.xml b/Barotrauma/Content/Characters/Tigerthresher/tigerthresher.xml index fe6767a6a..6c3d35f6e 100644 --- a/Barotrauma/Content/Characters/Tigerthresher/tigerthresher.xml +++ b/Barotrauma/Content/Characters/Tigerthresher/tigerthresher.xml @@ -15,8 +15,11 @@ sight="0.5" hearing="1.0"/> - diff --git a/Barotrauma/Source/Characters/AI/EnemyAIController.cs b/Barotrauma/Source/Characters/AI/EnemyAIController.cs index fb1a53a11..7dcc71e6b 100644 --- a/Barotrauma/Source/Characters/AI/EnemyAIController.cs +++ b/Barotrauma/Source/Characters/AI/EnemyAIController.cs @@ -485,6 +485,7 @@ namespace Barotrauma { //only one limb left, the character is now full eaten Entity.Spawner.AddToRemoveQueue(targetCharacter); + selectedAiTarget = null; state = AIState.None; } else //sever a random joint diff --git a/Barotrauma/Source/Characters/Animation/FishAnimController.cs b/Barotrauma/Source/Characters/Animation/FishAnimController.cs index 35024c7ba..1d352de69 100644 --- a/Barotrauma/Source/Characters/Animation/FishAnimController.cs +++ b/Barotrauma/Source/Characters/Animation/FishAnimController.cs @@ -15,6 +15,8 @@ namespace Barotrauma private float waveAmplitude; private float waveLength; + private float steerTorque; + private bool rotateTowardsMovement; private bool mirror, flip; @@ -28,13 +30,15 @@ namespace Barotrauma public FishAnimController(Character character, XElement element) : base(character, element) { - waveAmplitude = ConvertUnits.ToSimUnits(ToolBox.GetAttributeFloat(element, "waveamplitude", 0.0f)); - waveLength = ConvertUnits.ToSimUnits(ToolBox.GetAttributeFloat(element, "wavelength", 0.0f)); + waveAmplitude = ConvertUnits.ToSimUnits(ToolBox.GetAttributeFloat(element, "waveamplitude", 0.0f)); + waveLength = ConvertUnits.ToSimUnits(ToolBox.GetAttributeFloat(element, "wavelength", 0.0f)); + + steerTorque = ToolBox.GetAttributeFloat(element, "steertorque", 25.0f); - flip = ToolBox.GetAttributeBool(element, "flip", true); - mirror = ToolBox.GetAttributeBool(element, "mirror", false); + flip = ToolBox.GetAttributeBool(element, "flip", true); + mirror = ToolBox.GetAttributeBool(element, "mirror", false); - float footRot = ToolBox.GetAttributeFloat(element,"footrotation", float.NaN); + float footRot = ToolBox.GetAttributeFloat(element, "footrotation", float.NaN); if (float.IsNaN(footRot)) { footRotation = null; @@ -184,12 +188,12 @@ namespace Barotrauma if (rotateTowardsMovement) { Collider.SmoothRotate(movementAngle, 25.0f); - MainLimb.body.SmoothRotate(movementAngle, 25.0f); + MainLimb.body.SmoothRotate(movementAngle, steerTorque); } else { Collider.SmoothRotate(HeadAngle * Dir, 25.0f); - MainLimb.body.SmoothRotate(HeadAngle * Dir, 25.0f); + MainLimb.body.SmoothRotate(HeadAngle * Dir, steerTorque); } Limb tail = GetLimb(LimbType.Tail); diff --git a/Barotrauma/Source/Characters/Limb.cs b/Barotrauma/Source/Characters/Limb.cs index 5e573b550..fb61f3c50 100644 --- a/Barotrauma/Source/Characters/Limb.cs +++ b/Barotrauma/Source/Characters/Limb.cs @@ -136,6 +136,11 @@ namespace Barotrauma get { return body.Rotation; } } + public float Scale + { + get { return scale; } + } + //where an animcontroller is trying to pull the limb, only used for debug visualization public Vector2 AnimTargetPos { diff --git a/Barotrauma/Source/Screens/EditCharacterScreen.cs b/Barotrauma/Source/Screens/EditCharacterScreen.cs index 4417ad71b..6cae14af2 100644 --- a/Barotrauma/Source/Screens/EditCharacterScreen.cs +++ b/Barotrauma/Source/Screens/EditCharacterScreen.cs @@ -253,24 +253,27 @@ namespace Barotrauma { continue; } - - jointPos.Y = -jointPos.Y; - jointPos += limbBodyPos; + + Vector2 tformedJointPos = jointPos /= limb.Scale; + tformedJointPos.Y = -tformedJointPos.Y; + tformedJointPos += limbBodyPos; + if (joint.BodyA == limb.body.FarseerBody) { float a1 = joint.UpperLimit - MathHelper.PiOver2; float a2 = joint.LowerLimit - MathHelper.PiOver2; - float a3 =( a1+a2)/2.0f; - GUI.DrawLine(spriteBatch, jointPos, jointPos + new Vector2((float)Math.Cos(a1), -(float)Math.Sin(a1)) * 30.0f, Color.Green); - GUI.DrawLine(spriteBatch, jointPos, jointPos + new Vector2((float)Math.Cos(a2), -(float)Math.Sin(a2)) * 30.0f, Color.DarkGreen); + float a3 = (a1 + a2) / 2.0f; + GUI.DrawLine(spriteBatch, tformedJointPos, tformedJointPos + new Vector2((float)Math.Cos(a1), -(float)Math.Sin(a1)) * 30.0f, Color.Green); + GUI.DrawLine(spriteBatch, tformedJointPos, tformedJointPos + new Vector2((float)Math.Cos(a2), -(float)Math.Sin(a2)) * 30.0f, Color.DarkGreen); - GUI.DrawLine(spriteBatch, jointPos, jointPos + new Vector2((float)Math.Cos(a3), -(float)Math.Sin(a3)) * 30.0f, Color.LightGray); + GUI.DrawLine(spriteBatch, tformedJointPos, tformedJointPos + new Vector2((float)Math.Cos(a3), -(float)Math.Sin(a3)) * 30.0f, Color.LightGray); } - GUI.DrawRectangle(spriteBatch, jointPos, new Vector2(5.0f, 5.0f), Color.Red, true); - if (Vector2.Distance(PlayerInput.MousePosition, jointPos) < 6.0f) + GUI.DrawRectangle(spriteBatch, tformedJointPos, new Vector2(5.0f, 5.0f), Color.Red, true); + if (Vector2.Distance(PlayerInput.MousePosition, tformedJointPos) < 10.0f) { - GUI.DrawRectangle(spriteBatch, jointPos - new Vector2(3.0f, 3.0f), new Vector2(11.0f, 11.0f), Color.Red, false); + GUI.DrawString(spriteBatch, tformedJointPos + Vector2.One*10.0f, jointPos.ToString(), Color.White, Color.Black * 0.5f); + GUI.DrawRectangle(spriteBatch, tformedJointPos - new Vector2(3.0f, 3.0f), new Vector2(11.0f, 11.0f), Color.Red, false); if (PlayerInput.LeftButtonHeld()) { Vector2 speed = ConvertUnits.ToSimUnits(PlayerInput.MouseSpeed);