Progress + prettier ice walls

This commit is contained in:
Regalis
2015-12-12 13:44:05 +02:00
parent 78bccca4af
commit 17e8a2171f
49 changed files with 479 additions and 273 deletions
@@ -192,6 +192,7 @@ namespace Barotrauma
raycastTimer = RaycastInterval;
}
steeringManager.SteeringAvoid(deltaTime, 1.0f);
steeringManager.SteeringSeek(attackSimPosition);
//check if any of the limbs is close enough to attack the target
@@ -322,7 +323,7 @@ namespace Barotrauma
attackTimer += deltaTime;
limb.body.ApplyTorque(limb.Mass * 50.0f * Character.AnimController.Dir * dir);
limb.attack.DoDamage(Character, damageTarget, limb.SimPosition, deltaTime, (limb.soundTimer <= 0.0f));
limb.attack.DoDamage(Character, damageTarget, limb.WorldPosition, deltaTime, (limb.soundTimer <= 0.0f));
limb.soundTimer = Limb.SoundInterval;
}
@@ -218,7 +218,7 @@ namespace Barotrauma
//a node that hasn't been searched yet
if (nextNode.state==0)
{
nextNode.H = Vector2.DistanceSquared(nextNode.Position,end.Position);
nextNode.H = Vector2.Distance(nextNode.Position,end.Position);
if (GetNodePenalty != null)
{
@@ -144,11 +144,14 @@ namespace Barotrauma
avoidSteering = Vector2.Normalize(Submarine.LastPickedPosition - obstaclePosition);
}
else
else if (closestBody.UserData is Item)
{
Item item = closestBody.UserData as Item;
if (item != null) avoidSteering = Vector2.Normalize(Submarine.LastPickedPosition - item.SimPosition);
avoidSteering = Vector2.Normalize(Submarine.LastPickedPosition - item.SimPosition);
}
else
{
avoidSteering = Vector2.Normalize(host.SimPosition - Submarine.LastPickedPosition);
}
}