explosions are more or less correct now
This commit is contained in:
@@ -60,8 +60,14 @@ namespace OpenRa.Game
|
|||||||
|
|
||||||
if (t > TotalTime()) /* remove finished bullets */
|
if (t > TotalTime()) /* remove finished bullets */
|
||||||
{
|
{
|
||||||
Game.world.AddFrameEndTask(w => w.Remove(this));
|
Game.world.AddFrameEndTask(w =>
|
||||||
Game.world.AddFrameEndTask(w => w.Add(new Explosion(Dest)));
|
{
|
||||||
|
w.Remove(this);
|
||||||
|
w.Add(new Explosion(Dest, Warhead.Explosion));
|
||||||
|
|
||||||
|
if (Warhead.ImpactSound != null)
|
||||||
|
Game.PlaySound(Warhead.ImpactSound + ".aud", false);
|
||||||
|
});
|
||||||
|
|
||||||
var maxSpread = GetMaximumSpread();
|
var maxSpread = GetMaximumSpread();
|
||||||
var hitActors = Game.FindUnitsInCircle(Dest, GetMaximumSpread());
|
var hitActors = Game.FindUnitsInCircle(Dest, GetMaximumSpread());
|
||||||
|
|||||||
@@ -13,13 +13,15 @@ namespace OpenRa.Game
|
|||||||
Animation anim;
|
Animation anim;
|
||||||
int2 pos;
|
int2 pos;
|
||||||
|
|
||||||
public Explosion(int2 pixelPos)
|
public Explosion(int2 pixelPos, int style)
|
||||||
{
|
{
|
||||||
this.pos = pixelPos;
|
this.pos = pixelPos;
|
||||||
|
|
||||||
anim = new Animation("veh-hit3");
|
anim = new Animation("explosion");
|
||||||
anim.PlayThen("idle", () => Game.world.AddFrameEndTask(w => w.Remove(this)));
|
if (style != 0)
|
||||||
Game.PlaySound("kaboom25.aud", false);
|
anim.PlayThen(style.ToString(), () => 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(); }
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ namespace OpenRa.Game.GameRules
|
|||||||
public readonly bool Ore = false;
|
public readonly bool Ore = false;
|
||||||
public readonly int Explosion = 0;
|
public readonly int Explosion = 0;
|
||||||
public readonly int InfDeath = 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 ]; }
|
public float EffectivenessAgainst(ArmorType at) { return Verses[ (int)at ]; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace OpenRa.Game.Graphics
|
|||||||
public Animation( string name )
|
public Animation( string name )
|
||||||
{
|
{
|
||||||
this.name = name.ToLowerInvariant();
|
this.name = name.ToLowerInvariant();
|
||||||
Play( "idle" );
|
// Play( "idle" );
|
||||||
}
|
}
|
||||||
|
|
||||||
public Sprite Image
|
public Sprite Image
|
||||||
|
|||||||
@@ -37,7 +37,8 @@ namespace OpenRa.Game.Traits
|
|||||||
public override void Tick(Actor self)
|
public override void Tick(Actor self)
|
||||||
{
|
{
|
||||||
base.Tick(self);
|
base.Tick(self);
|
||||||
roof.Tick();
|
if (doneBuilding)
|
||||||
|
roof.Tick();
|
||||||
|
|
||||||
var b = self.Bounds;
|
var b = self.Bounds;
|
||||||
if (isOpen && !Game.SelectUnitsInBox(
|
if (isOpen && !Game.SelectUnitsInBox(
|
||||||
|
|||||||
@@ -19,15 +19,22 @@ namespace SequenceEditor
|
|||||||
|
|
||||||
public static Bitmap[] LoadAndResolve( string shp )
|
public static Bitmap[] LoadAndResolve( string shp )
|
||||||
{
|
{
|
||||||
var reader = new ShpReader(FileSystem.OpenWithExts(shp, ".shp", ".tem", ".sno", ".int"));
|
try
|
||||||
return reader.Select(ih =>
|
{
|
||||||
{
|
var reader = new ShpReader(FileSystem.OpenWithExts(shp, ".shp", ".tem", ".sno", ".int"));
|
||||||
var bmp = new Bitmap(reader.Width, reader.Height);
|
return reader.Select(ih =>
|
||||||
for (var j = 0; j < bmp.Height; j++)
|
{
|
||||||
for (var i = 0; i < bmp.Width; i++)
|
var bmp = new Bitmap(reader.Width, reader.Height);
|
||||||
bmp.SetPixel(i, j, Pal.GetColor(ih.Image[j * bmp.Width + i]));
|
for (var j = 0; j < bmp.Height; j++)
|
||||||
return bmp;
|
for (var i = 0; i < bmp.Width; i++)
|
||||||
}).ToArray();
|
bmp.SetPixel(i, j, Pal.GetColor(ih.Image[j * bmp.Width + i]));
|
||||||
|
return bmp;
|
||||||
|
}).ToArray();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return new Bitmap[] { };
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Save()
|
public static void Save()
|
||||||
@@ -80,10 +87,6 @@ namespace SequenceEditor
|
|||||||
if (UnitName == null)
|
if (UnitName == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Shps[UnitName] = LoadAndResolve(UnitName);
|
|
||||||
|
|
||||||
/* todo: load supplemental SHPs */
|
|
||||||
|
|
||||||
var xpath = string.Format("//unit[@name=\"{0}\"]/sequence", UnitName);
|
var xpath = string.Format("//unit[@name=\"{0}\"]/sequence", UnitName);
|
||||||
foreach (XmlElement e in Doc.SelectNodes(xpath))
|
foreach (XmlElement e in Doc.SelectNodes(xpath))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -393,9 +393,6 @@
|
|||||||
<unit name="120mm">
|
<unit name="120mm">
|
||||||
<sequence name="idle" start="0" length="1" />
|
<sequence name="idle" start="0" length="1" />
|
||||||
</unit>
|
</unit>
|
||||||
<unit name="veh-hit3">
|
|
||||||
<sequence name="idle" start="0" length="*" />
|
|
||||||
</unit>
|
|
||||||
<unit name="e3">
|
<unit name="e3">
|
||||||
<sequence name="stand" start="0" length="8" />
|
<sequence name="stand" start="0" length="8" />
|
||||||
<sequence name="stand2" start="8" length="8" />
|
<sequence name="stand2" start="8" length="8" />
|
||||||
@@ -460,4 +457,12 @@
|
|||||||
<sequence name="die4" start="217" length="12" />
|
<sequence name="die4" start="217" length="12" />
|
||||||
<sequence name="die5" start="229" length="18" />
|
<sequence name="die5" start="229" length="18" />
|
||||||
</unit>
|
</unit>
|
||||||
|
<unit name="explosion">
|
||||||
|
<sequence name="1" start="0" length="4" src="piff" />
|
||||||
|
<sequence name="2" start="0" length="8" src="piffpiff" />
|
||||||
|
<sequence name="3" start="0" length="14" src="napalm2" />
|
||||||
|
<sequence name="4" start="0" length="14" src="veh-hit3" />
|
||||||
|
<sequence name="5" start="0" length="22" src="veh-hit2" />
|
||||||
|
<sequence name="6" start="0" length="27" src="atomsfx" />
|
||||||
|
</unit>
|
||||||
</sequences>
|
</sequences>
|
||||||
Reference in New Issue
Block a user