Oil Derricks spurt fire when dead.

This commit is contained in:
Paul Chote
2010-11-27 15:50:46 +13:00
parent f9f9fbf3e4
commit 52e265557c
5 changed files with 66 additions and 5 deletions

View File

@@ -0,0 +1,33 @@
#region Copyright & License Information
/*
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see LICENSE.
*/
#endregion
using System.Collections.Generic;
using System.Linq;
using OpenRA.Traits;
using OpenRA.Graphics;
namespace OpenRA.Mods.Cnc
{
class WithFireInfo : ITraitInfo
{
public object Create(ActorInitializer init) { return new WithFire(init.self); }
}
class WithFire
{
public WithFire(Actor self)
{
var rs = self.Trait<RenderSimple>();
var roof = new Animation(rs.GetImage(self));
roof.PlayThen("fire-start", () => roof.PlayRepeating("fire-loop"));
rs.anims.Add( "fire", new RenderSimple.AnimationWithOffset( roof, () => new float2(7,-15), null ) { ZOffset = 24 } );
}
}
}