De-hardcoded LaserZap animation sequence

This commit is contained in:
reaperrr
2015-04-09 23:11:08 +02:00
parent 87b7cc4527
commit b7bb719173

View File

@@ -26,8 +26,10 @@ namespace OpenRA.Mods.Common.Effects
public readonly bool UsePlayerColor = false;
[Desc("Laser color in (A,)R,G,B.")]
public readonly Color Color = Color.Red;
[Desc("Impact animation. Requires a regular animation with idle: sequence instead of explosion special case.")]
[Desc("Impact animation.")]
public readonly string HitAnim = null;
[Desc("Sequence of impact animation to use.")]
public readonly string HitAnimSequence = "idle";
public readonly string HitAnimPalette = "effect";
public IEffect Create(ProjectileArgs args)
@@ -68,7 +70,7 @@ namespace OpenRA.Mods.Common.Effects
if (!doneDamage)
{
if (hitanim != null)
hitanim.PlayThen("idle", () => animationComplete = true);
hitanim.PlayThen(info.HitAnimSequence, () => animationComplete = true);
args.Weapon.Impact(Target.FromPos(target), args.SourceActor, args.DamageModifiers);
doneDamage = true;