(c7ebe3cdb) Fixed: Old TextManager.Get call
This commit is contained in:
@@ -475,18 +475,6 @@ namespace Barotrauma
|
||||
}
|
||||
attackSimPos = ConvertUnits.ToSimUnits(attackWorldPos);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Take the sub position into account in the sim pos
|
||||
if (Character.Submarine == null && SelectedAiTarget.Entity.Submarine != null)
|
||||
{
|
||||
attackSimPos += SelectedAiTarget.Entity.Submarine.SimPosition;
|
||||
}
|
||||
else if (Character.Submarine != null && SelectedAiTarget.Entity.Submarine == null)
|
||||
{
|
||||
attackSimPos -= Character.Submarine.SimPosition;
|
||||
}
|
||||
}
|
||||
|
||||
if (raycastTimer > 0.0)
|
||||
{
|
||||
@@ -546,9 +534,7 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool canAttack = true;
|
||||
if (IsCoolDownRunning)
|
||||
else
|
||||
{
|
||||
UpdateWallTarget();
|
||||
raycastTimer = RaycastInterval;
|
||||
@@ -1032,46 +1018,15 @@ namespace Barotrauma
|
||||
{
|
||||
targetingTag = targetCharacter.SpeciesName.ToLowerInvariant();
|
||||
}
|
||||
else if (targetCharacter.Submarine != null && Character.Submarine == null)
|
||||
{
|
||||
//target inside, AI outside -> we'll be attacking a wall between the characters so use the priority for attacking rooms
|
||||
targetingTag = "room";
|
||||
}
|
||||
else if (targetingPriorities.ContainsKey(targetCharacter.SpeciesName.ToLowerInvariant()))
|
||||
{
|
||||
targetingTag = targetCharacter.SpeciesName.ToLowerInvariant();
|
||||
}
|
||||
}
|
||||
else if (target.Entity != null)
|
||||
{
|
||||
//skip the target if it's a room and the character is already inside a sub
|
||||
if (character.CurrentHull != null && target.Entity is Hull) continue;
|
||||
|
||||
Door door = null;
|
||||
if (target.Entity is Item item)
|
||||
{
|
||||
if (targetCharacter.AIController is EnemyAIController enemy)
|
||||
{
|
||||
targetingTag = "room";
|
||||
}
|
||||
|
||||
door = item.GetComponent<Door>();
|
||||
foreach (TargetingPriority prio in targetingPriorities.Values)
|
||||
{
|
||||
if (item.HasTag(prio.TargetTag))
|
||||
if (enemy.combatStrength > combatStrength)
|
||||
{
|
||||
targetingTag = "stronger";
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (target.Entity is Structure s)
|
||||
{
|
||||
targetingTag = "wall";
|
||||
if (aggressiveBoarding)
|
||||
{
|
||||
// Ignore walls when inside.
|
||||
valueModifier = character.CurrentHull == null ? 2 : 0;
|
||||
if (valueModifier > 0)
|
||||
else if (enemy.combatStrength < combatStrength)
|
||||
{
|
||||
targetingTag = "weaker";
|
||||
}
|
||||
@@ -1203,14 +1158,6 @@ namespace Barotrauma
|
||||
|
||||
#endregion
|
||||
|
||||
protected override void OnStateChanged(AIState from, AIState to)
|
||||
{
|
||||
latchOntoAI?.DeattachFromBody();
|
||||
Character.AnimController.ReleaseStuckLimbs();
|
||||
escapePoint = Vector2.Zero;
|
||||
wallTarget = null;
|
||||
}
|
||||
|
||||
if (toBeRemoved != null)
|
||||
{
|
||||
foreach (AITarget target in toBeRemoved)
|
||||
@@ -1232,6 +1179,19 @@ namespace Barotrauma
|
||||
return (int)Math.Ceiling(ConvertUnits.ToDisplayUnits(colliderSize) / Structure.WallSectionSize);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
protected override void OnStateChanged(AIState from, AIState to)
|
||||
{
|
||||
latchOntoAI?.DeattachFromBody();
|
||||
Character.AnimController.ReleaseStuckLimbs();
|
||||
}
|
||||
|
||||
private int GetMinimumPassableHoleCount()
|
||||
{
|
||||
return (int)Math.Ceiling(ConvertUnits.ToDisplayUnits(colliderSize) / Structure.WallSectionSize);
|
||||
}
|
||||
|
||||
private bool CanPassThroughHole(Structure wall, int sectionIndex)
|
||||
{
|
||||
int requiredHoleCount = GetMinimumPassableHoleCount();
|
||||
|
||||
@@ -408,7 +408,7 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (MainLimb.type == LimbType.Head && HeadAngle.HasValue)
|
||||
while (MainLimb.Rotation - (movementAngle + mainLimbAngle) < -MathHelper.Pi)
|
||||
{
|
||||
movementAngle = Dir > 0 ? -MathHelper.PiOver2 : MathHelper.PiOver2;
|
||||
if (MainLimb.type == LimbType.Head && HeadAngle.HasValue)
|
||||
|
||||
@@ -1037,6 +1037,8 @@ namespace Barotrauma
|
||||
|
||||
CheckValidity();
|
||||
|
||||
CheckValidity();
|
||||
|
||||
UpdateNetPlayerPosition(deltaTime);
|
||||
CheckDistFromCollider();
|
||||
UpdateCollisionCategories();
|
||||
@@ -1348,7 +1350,7 @@ namespace Barotrauma
|
||||
SetInitialLimbPositions();
|
||||
return;
|
||||
}
|
||||
return true;
|
||||
UpdateProjSpecific(deltaTime);
|
||||
}
|
||||
|
||||
partial void UpdateProjSpecific(float deltaTime);
|
||||
|
||||
@@ -179,6 +179,9 @@ namespace Barotrauma.Items.Components
|
||||
newConnection.Item.Position - refSub.HiddenSubPosition;
|
||||
|
||||
|
||||
if (nodes.Count > 0 && nodes[0] == nodePos) break;
|
||||
if (nodes.Count > 1 && nodes[nodes.Count - 1] == nodePos) break;
|
||||
|
||||
if (nodes.Count > 0 && nodes[0] == nodePos) break;
|
||||
if (nodes.Count > 1 && nodes[nodes.Count - 1] == nodePos) break;
|
||||
|
||||
|
||||
@@ -186,6 +186,9 @@ namespace Barotrauma
|
||||
Hull hull = Hull.FindHull(ConvertUnits.ToDisplayUnits(explosionPos), null, false);
|
||||
bool underWater = hull == null || explosionPos.Y < hull.Surface;
|
||||
|
||||
Hull hull = Hull.FindHull(ConvertUnits.ToDisplayUnits(explosionPos), null, false);
|
||||
bool underWater = hull == null || explosionPos.Y < hull.Surface;
|
||||
|
||||
explosionPos = ConvertUnits.ToSimUnits(explosionPos);
|
||||
|
||||
Dictionary<Limb, float> distFactors = new Dictionary<Limb, float>();
|
||||
|
||||
@@ -48,6 +48,18 @@ namespace Barotrauma
|
||||
private set;
|
||||
}
|
||||
|
||||
public Vector2 LinearVelocity
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public float AngularVelocity
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public readonly float Timestamp;
|
||||
public readonly UInt16 ID;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user