water splashes
This commit is contained in:
@@ -67,10 +67,19 @@ namespace OpenRa.Game
|
|||||||
Game.world.AddFrameEndTask(w =>
|
Game.world.AddFrameEndTask(w =>
|
||||||
{
|
{
|
||||||
w.Remove(this);
|
w.Remove(this);
|
||||||
w.Add(new Explosion(VisualDest, Warhead.Explosion));
|
|
||||||
|
|
||||||
if (Warhead.ImpactSound != null)
|
var isWater = Game.IsCellBuildable(
|
||||||
Game.PlaySound(Warhead.ImpactSound + ".aud", false);
|
((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();
|
var maxSpread = GetMaximumSpread();
|
||||||
|
|||||||
@@ -13,16 +13,13 @@ namespace OpenRa.Game
|
|||||||
Animation anim;
|
Animation anim;
|
||||||
int2 pos;
|
int2 pos;
|
||||||
|
|
||||||
public Explosion(int2 pixelPos, int style)
|
public Explosion(int2 pixelPos, int style, bool isWater)
|
||||||
{
|
{
|
||||||
this.pos = pixelPos;
|
this.pos = pixelPos;
|
||||||
|
var variantSuffix = isWater ? "w" : "";
|
||||||
anim = new Animation("explosion");
|
anim = new Animation("explosion");
|
||||||
if (style != 0)
|
anim.PlayThen(style.ToString() + variantSuffix,
|
||||||
anim.PlayThen(style.ToString(),
|
|
||||||
() => Game.world.AddFrameEndTask(w => w.Remove(this)));
|
() => Game.world.AddFrameEndTask(w => w.Remove(this)));
|
||||||
else
|
|
||||||
Game.world.AddFrameEndTask(w => w.Remove(this));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Tick() { anim.Tick(); }
|
public void Tick() { anim.Tick(); }
|
||||||
|
|||||||
@@ -165,6 +165,13 @@ namespace OpenRa.Game
|
|||||||
worldRenderer.terrainRenderer.tileSet.GetWalkability( map.MapTiles[ a.X, a.Y ] ) ) < double.PositiveInfinity;
|
worldRenderer.terrainRenderer.tileSet.GetWalkability( map.MapTiles[ a.X, a.Y ] ) ) < double.PositiveInfinity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool IsWater(int2 a)
|
||||||
|
{
|
||||||
|
return map.IsInMap(a.X, a.Y) &&
|
||||||
|
TerrainCosts.Cost(UnitMovementType.Float,
|
||||||
|
worldRenderer.terrainRenderer.tileSet.GetWalkability(map.MapTiles[a.X, a.Y])) < double.PositiveInfinity;
|
||||||
|
}
|
||||||
|
|
||||||
static IEnumerable<Actor> FindUnits(float2 a, float2 b)
|
static IEnumerable<Actor> FindUnits(float2 a, float2 b)
|
||||||
{
|
{
|
||||||
var min = float2.Min(a, b);
|
var min = float2.Min(a, b);
|
||||||
|
|||||||
@@ -463,7 +463,13 @@
|
|||||||
<sequence name="3" start="0" length="14" src="napalm2" />
|
<sequence name="3" start="0" length="14" src="napalm2" />
|
||||||
<sequence name="4" start="0" length="14" src="veh-hit3" />
|
<sequence name="4" start="0" length="14" src="veh-hit3" />
|
||||||
<sequence name="5" start="0" length="22" src="veh-hit2" />
|
<sequence name="5" start="0" length="22" src="veh-hit2" />
|
||||||
|
<sequence name="6w" start="0" length="27" src="atomsfx" />
|
||||||
|
<sequence name="1w" start="0" length="10" src="h2o_exp3" />
|
||||||
|
<sequence name="5w" start="0" length="10" src="h2o_exp1" />
|
||||||
|
<sequence name="3w" start="0" length="14" src="napalm2" />
|
||||||
<sequence name="6" start="0" length="27" src="atomsfx" />
|
<sequence name="6" start="0" length="27" src="atomsfx" />
|
||||||
|
<sequence name="4w" start="0" length="10" src="h2o_exp2" />
|
||||||
|
<sequence name="2w" start="0" length="10" src="h2o_exp3" />
|
||||||
</unit>
|
</unit>
|
||||||
<unit name="lst">
|
<unit name="lst">
|
||||||
<sequence name="idle" start="0" length="1" />
|
<sequence name="idle" start="0" length="1" />
|
||||||
|
|||||||
Reference in New Issue
Block a user