added infantry taking cover behavior

This commit is contained in:
Chris Forbes
2009-12-17 21:52:39 +13:00
parent 36e788b685
commit ac2b666366
9 changed files with 184 additions and 16 deletions

View File

@@ -168,7 +168,11 @@ namespace OpenRa.Game.Traits.Activities
var oldFraction = moveFraction;
var oldTotal = moveFractionTotal;
moveFraction += ( self.Info as MobileInfo ).Speed;
var actualSpeed = (int)self.traits.WithInterface<ISpeedModifier>().Aggregate(
(float)(self.Info as MobileInfo).Speed,
(a, t) => t.GetSpeedModifier() * a);
moveFraction += actualSpeed;
UpdateCenterLocation( self, mobile );
if( moveFraction >= moveFractionTotal )
{