fix 776 -- support custom SHPs & bright/dim zap count in TeslaZap projectile type
This commit is contained in:
@@ -20,6 +20,9 @@ namespace OpenRA.Mods.RA.Effects
|
|||||||
{
|
{
|
||||||
class TeslaZapInfo : IProjectileInfo
|
class TeslaZapInfo : IProjectileInfo
|
||||||
{
|
{
|
||||||
|
public readonly string Image = "litning";
|
||||||
|
public readonly int BrightZaps = 1;
|
||||||
|
public readonly int DimZaps = 2;
|
||||||
public IEffect Create(ProjectileArgs args) { return new TeslaZap( this, args ); }
|
public IEffect Create(ProjectileArgs args) { return new TeslaZap( this, args ); }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,18 +32,18 @@ namespace OpenRA.Mods.RA.Effects
|
|||||||
int timeUntilRemove = 2; // # of frames
|
int timeUntilRemove = 2; // # of frames
|
||||||
bool doneDamage = false;
|
bool doneDamage = false;
|
||||||
|
|
||||||
const int numZaps = 3;
|
|
||||||
|
|
||||||
readonly List<Renderable> renderables = new List<Renderable>();
|
readonly List<Renderable> renderables = new List<Renderable>();
|
||||||
|
|
||||||
public TeslaZap(TeslaZapInfo info, ProjectileArgs args)
|
public TeslaZap(TeslaZapInfo info, ProjectileArgs args)
|
||||||
{
|
{
|
||||||
Args = args;
|
Args = args;
|
||||||
var bright = SequenceProvider.GetSequence("litning", "bright");
|
var bright = SequenceProvider.GetSequence(info.Image, "bright");
|
||||||
var dim = SequenceProvider.GetSequence("litning", "dim");
|
var dim = SequenceProvider.GetSequence(info.Image, "dim");
|
||||||
|
|
||||||
for (var n = 0; n < numZaps; n++)
|
for( var n = 0; n < info.DimZaps; n++ )
|
||||||
renderables.AddRange(DrawZapWandering(args.src, args.dest, n == numZaps - 1 ? bright : dim));
|
renderables.AddRange(DrawZapWandering(args.src, args.dest, dim));
|
||||||
|
for( var n = 0; n < info.BrightZaps; n++ )
|
||||||
|
renderables.AddRange(DrawZapWandering(args.src, args.dest, bright));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Tick( World world )
|
public void Tick( World world )
|
||||||
|
|||||||
Reference in New Issue
Block a user