water splashes

This commit is contained in:
Chris Forbes
2009-11-01 17:56:05 +13:00
parent 4dd54eb1e3
commit 5dbc70da02
5 changed files with 30 additions and 9 deletions

View File

@@ -67,10 +67,19 @@ namespace OpenRa.Game
Game.world.AddFrameEndTask(w =>
{
w.Remove(this);
w.Add(new Explosion(VisualDest, Warhead.Explosion));
if (Warhead.ImpactSound != null)
Game.PlaySound(Warhead.ImpactSound + ".aud", false);
var isWater = Game.IsCellBuildable(
((1f / Game.CellSize) * Dest.ToFloat2()).ToInt2(), UnitMovementType.Float);
if (Warhead.Explosion != 0)
w.Add(new Explosion(VisualDest, Warhead.Explosion, isWater));
var impact = Warhead.ImpactSound;
if (isWater && Warhead.WaterImpactSound != null)
impact = Warhead.WaterImpactSound;
if (impact != null)
Game.PlaySound(impact+ ".aud", false);
});
var maxSpread = GetMaximumSpread();