De-hardcoded GravityBomb idle and opening sequence
Avoid checking for sequence if Image is null.
This commit is contained in:
@@ -19,6 +19,10 @@ namespace OpenRA.Mods.Common.Effects
|
|||||||
public class GravityBombInfo : IProjectileInfo
|
public class GravityBombInfo : IProjectileInfo
|
||||||
{
|
{
|
||||||
public readonly string Image = null;
|
public readonly string Image = null;
|
||||||
|
[Desc("Sequence to loop while falling.")]
|
||||||
|
public readonly string Sequence = "idle";
|
||||||
|
[Desc("Sequence to play when launched. Skipped if null.")]
|
||||||
|
public readonly string OpenSequence = null;
|
||||||
public readonly string Palette = "effect";
|
public readonly string Palette = "effect";
|
||||||
public readonly bool Shadow = false;
|
public readonly bool Shadow = false;
|
||||||
public readonly WRange Velocity = WRange.Zero;
|
public readonly WRange Velocity = WRange.Zero;
|
||||||
@@ -46,10 +50,14 @@ namespace OpenRA.Mods.Common.Effects
|
|||||||
acceleration = new WVec(WRange.Zero, WRange.Zero, info.Acceleration);
|
acceleration = new WVec(WRange.Zero, WRange.Zero, info.Acceleration);
|
||||||
|
|
||||||
anim = new Animation(args.SourceActor.World, info.Image);
|
anim = new Animation(args.SourceActor.World, info.Image);
|
||||||
if (anim.HasSequence("open"))
|
|
||||||
anim.PlayThen("open", () => anim.PlayRepeating("idle"));
|
if (info.Image != null)
|
||||||
else
|
{
|
||||||
anim.PlayRepeating("idle");
|
if (info.OpenSequence != null)
|
||||||
|
anim.PlayThen(info.OpenSequence, () => anim.PlayRepeating(info.Sequence));
|
||||||
|
else
|
||||||
|
anim.PlayRepeating(info.Sequence);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Tick(World world)
|
public void Tick(World world)
|
||||||
|
|||||||
@@ -260,9 +260,6 @@ smoke_m:
|
|||||||
BlendMode: Additive
|
BlendMode: Additive
|
||||||
|
|
||||||
bombs:
|
bombs:
|
||||||
open: DATA.R8
|
|
||||||
Start: 3280
|
|
||||||
Length: 4
|
|
||||||
idle: DATA.R8
|
idle: DATA.R8
|
||||||
Start: 3280
|
Start: 3280
|
||||||
Length: 4
|
Length: 4
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ ParaBomb:
|
|||||||
Report: CHUTE1.AUD
|
Report: CHUTE1.AUD
|
||||||
Projectile: GravityBomb
|
Projectile: GravityBomb
|
||||||
Image: PARABOMB
|
Image: PARABOMB
|
||||||
|
OpenSequence: open
|
||||||
Velocity: 43
|
Velocity: 43
|
||||||
Acceleration: 0
|
Acceleration: 0
|
||||||
Warhead@1Dam: SpreadDamage
|
Warhead@1Dam: SpreadDamage
|
||||||
|
|||||||
Reference in New Issue
Block a user