use explosion *names*, not *numbers* like RA.
This commit is contained in:
@@ -49,10 +49,11 @@ namespace OpenRA
|
||||
return;
|
||||
|
||||
var isWater = world.GetTerrainInfo(targetTile).IsWater;
|
||||
var explosionType = isWater ? warhead.WaterExplosion : warhead.Explosion;
|
||||
|
||||
if (warhead.Explosion != 0)
|
||||
if (explosionType != null)
|
||||
world.AddFrameEndTask(
|
||||
w => w.Add(new Explosion(w, args.dest, warhead.Explosion, isWater)));
|
||||
w => w.Add(new Explosion(w, args.dest, explosionType, isWater)));
|
||||
|
||||
Sound.Play(GetImpactSound(warhead, isWater), args.dest);
|
||||
|
||||
|
||||
@@ -29,12 +29,11 @@ namespace OpenRA.Effects
|
||||
Animation anim;
|
||||
int2 pos;
|
||||
|
||||
public Explosion(World world, int2 pixelPos, int style, bool isWater)
|
||||
public Explosion(World world, int2 pixelPos, string style, bool isWater)
|
||||
{
|
||||
this.pos = pixelPos;
|
||||
var variantSuffix = isWater ? "w" : "";
|
||||
anim = new Animation("explosion");
|
||||
anim.PlayThen(style.ToString() + variantSuffix,
|
||||
anim.PlayThen(style,
|
||||
() => world.AddFrameEndTask(w => w.Remove(this)));
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,8 @@ namespace OpenRA.GameRules
|
||||
public readonly int Spread = 1; // distance (in pixels) from the explosion center at which damage is 1/2.
|
||||
public readonly float[] Verses = { 1, 1, 1, 1, 1 }; // damage vs each armortype
|
||||
public readonly bool Ore = false; // can this damage ore?
|
||||
public readonly int Explosion = 0; // explosion effect to use
|
||||
public readonly string Explosion = null; // explosion effect to use
|
||||
public readonly string WaterExplosion = null; // explosion effect on hitting water (usually a splash)
|
||||
public readonly string SmudgeType = null; // type of smudge to apply
|
||||
public readonly int[] Size = { 0, 0 }; // size of the explosion. provide 2 values for a ring effect (outer/inner)
|
||||
public readonly int InfDeath = 0; // infantry death animation to use
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace OpenRA.Traits
|
||||
Sound.Play(self.Info.Traits.Get<BuildingInfo>().DamagedSound, self.CenterLocation);
|
||||
break;
|
||||
case DamageState.Dead:
|
||||
self.World.AddFrameEndTask(w => w.Add(new Explosion(w, self.CenterLocation.ToInt2(), 7, false)));
|
||||
self.World.AddFrameEndTask(w => w.Add(new Explosion(w, self.CenterLocation.ToInt2(), "building", false)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user