fixes #61
This commit is contained in:
@@ -30,18 +30,7 @@ namespace OpenRa.Game
|
||||
public List<int2> FindUnitPath(int2 src, int2 dest, UnitMovementType umt)
|
||||
{
|
||||
using (new PerfSample("find_unit_path"))
|
||||
{
|
||||
var sw = new Stopwatch();
|
||||
/*if (passableCost[(int)umt][dest.X, dest.Y] == float.PositiveInfinity)
|
||||
return new List<int2>();
|
||||
if (!Game.BuildingInfluence.CanMoveHere(dest))
|
||||
return new List<int2>();*/
|
||||
|
||||
var result = FindUnitPath(src, DefaultEstimator(dest), umt);
|
||||
Game.NormalPathTime += sw.ElapsedTime();
|
||||
Game.NormalPathCount++;
|
||||
return result;
|
||||
}
|
||||
return FindUnitPath(src, DefaultEstimator(dest), umt);
|
||||
}
|
||||
|
||||
public List<int2> FindUnitPathToRange(int2 src, int2 dest, UnitMovementType umt, int range)
|
||||
@@ -105,9 +94,6 @@ namespace OpenRa.Game
|
||||
var otherCellInfo = InitCellInfo();
|
||||
otherCellInfo[from.X, from.Y] = new CellInfo( 0, from, false );
|
||||
var ret = FindBidiPath(cellInfo, otherCellInfo, queue, otherQueue, estimator, h2, umt, true);
|
||||
|
||||
//var ret = FindPath(cellInfo, queue, estimator, umt, true);
|
||||
//ret.Reverse();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,16 +59,16 @@ namespace OpenRa.Game.Traits
|
||||
yield return Pair.New(anim.Image, 24f * (float2)self.Location);
|
||||
}
|
||||
|
||||
public void Damaged(Actor self, DamageState state)
|
||||
void INotifyDamage.Damaged(Actor self, DamageState state)
|
||||
{
|
||||
switch( state )
|
||||
{
|
||||
case DamageState.Normal:
|
||||
anim.PlayRepeating("idle"); /* todo: make interaction?? this should only get called on half->ok */
|
||||
anim.PlayRepeating("idle");
|
||||
break;
|
||||
case DamageState.Half:
|
||||
anim.PlayRepeating("damaged-idle");
|
||||
Game.PlaySound("kaboom1.aud", false); /* todo: maybe sep. sound stuff from visual ?? */
|
||||
Game.PlaySound("kaboom1.aud", false);
|
||||
break;
|
||||
case DamageState.Dead:
|
||||
DoBib(self, true);
|
||||
|
||||
@@ -5,13 +5,32 @@ using System.Text;
|
||||
|
||||
namespace OpenRa.Game.Traits
|
||||
{
|
||||
class RenderBuildingTurreted : RenderBuilding
|
||||
class RenderBuildingTurreted : RenderBuilding, INotifyDamage
|
||||
{
|
||||
public RenderBuildingTurreted(Actor self)
|
||||
: base(self)
|
||||
{
|
||||
Make( () => anim.PlayFetchIndex( "idle",
|
||||
() => self.traits.Get<Turreted>().turretFacing / 8 ) );
|
||||
Make( () => PlayTurretAnim( self, "idle" ));
|
||||
}
|
||||
|
||||
void PlayTurretAnim(Actor self, string a)
|
||||
{
|
||||
anim.PlayFetchIndex(a,
|
||||
() => self.traits.Get<Turreted>().turretFacing / 8);
|
||||
}
|
||||
|
||||
void INotifyDamage.Damaged(Actor self, DamageState ds)
|
||||
{
|
||||
switch (ds)
|
||||
{
|
||||
case DamageState.Normal:
|
||||
PlayTurretAnim(self, "idle");
|
||||
break;
|
||||
case DamageState.Half:
|
||||
PlayTurretAnim(self, "damaged-idle");
|
||||
Game.PlaySound("kaboom1.aud", false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user