explosions are more or less correct now
This commit is contained in:
@@ -59,9 +59,15 @@ namespace OpenRa.Game
|
||||
t += 40;
|
||||
|
||||
if (t > TotalTime()) /* remove finished bullets */
|
||||
{
|
||||
Game.world.AddFrameEndTask(w => w.Remove(this));
|
||||
Game.world.AddFrameEndTask(w => w.Add(new Explosion(Dest)));
|
||||
{
|
||||
Game.world.AddFrameEndTask(w =>
|
||||
{
|
||||
w.Remove(this);
|
||||
w.Add(new Explosion(Dest, Warhead.Explosion));
|
||||
|
||||
if (Warhead.ImpactSound != null)
|
||||
Game.PlaySound(Warhead.ImpactSound + ".aud", false);
|
||||
});
|
||||
|
||||
var maxSpread = GetMaximumSpread();
|
||||
var hitActors = Game.FindUnitsInCircle(Dest, GetMaximumSpread());
|
||||
|
||||
@@ -13,13 +13,15 @@ namespace OpenRa.Game
|
||||
Animation anim;
|
||||
int2 pos;
|
||||
|
||||
public Explosion(int2 pixelPos)
|
||||
public Explosion(int2 pixelPos, int style)
|
||||
{
|
||||
this.pos = pixelPos;
|
||||
|
||||
anim = new Animation("veh-hit3");
|
||||
anim.PlayThen("idle", () => Game.world.AddFrameEndTask(w => w.Remove(this)));
|
||||
Game.PlaySound("kaboom25.aud", false);
|
||||
anim = new Animation("explosion");
|
||||
if (style != 0)
|
||||
anim.PlayThen(style.ToString(), () => Game.world.AddFrameEndTask(w => w.Remove(this)));
|
||||
else
|
||||
Game.world.AddFrameEndTask(w => w.Remove(this));
|
||||
}
|
||||
|
||||
public void Tick() { anim.Tick(); }
|
||||
|
||||
@@ -16,6 +16,8 @@ namespace OpenRa.Game.GameRules
|
||||
public readonly bool Ore = false;
|
||||
public readonly int Explosion = 0;
|
||||
public readonly int InfDeath = 0;
|
||||
public readonly string ImpactSound = null;
|
||||
public readonly string WaterImpactSound = null;
|
||||
|
||||
public float EffectivenessAgainst(ArmorType at) { return Verses[ (int)at ]; }
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace OpenRa.Game.Graphics
|
||||
public Animation( string name )
|
||||
{
|
||||
this.name = name.ToLowerInvariant();
|
||||
Play( "idle" );
|
||||
// Play( "idle" );
|
||||
}
|
||||
|
||||
public Sprite Image
|
||||
|
||||
@@ -37,7 +37,8 @@ namespace OpenRa.Game.Traits
|
||||
public override void Tick(Actor self)
|
||||
{
|
||||
base.Tick(self);
|
||||
roof.Tick();
|
||||
if (doneBuilding)
|
||||
roof.Tick();
|
||||
|
||||
var b = self.Bounds;
|
||||
if (isOpen && !Game.SelectUnitsInBox(
|
||||
|
||||
Reference in New Issue
Block a user