tib tree animations

This commit is contained in:
Paul Chote
2010-06-13 16:04:20 +12:00
parent c4d143b729
commit b0802466b2
3 changed files with 14 additions and 2 deletions

View File

@@ -30,6 +30,7 @@ namespace OpenRA.Mods.RA
public readonly int Interval = 75;
public readonly string ResourceType = "Ore";
public readonly int MaxRange = 100;
public readonly int AnimationInterval = 750;
public object Create(Actor self) { return new SeedsResource(); }
}
@@ -37,6 +38,7 @@ namespace OpenRA.Mods.RA
class SeedsResource : ITick
{
int ticks;
int animationTicks;
public void Tick(Actor self)
{
@@ -64,6 +66,13 @@ namespace OpenRA.Mods.RA
ticks = info.Interval;
}
if (--animationTicks <= 0)
{
var info = self.Info.Traits.Get<SeedsResourceInfo>();
self.traits.Get<RenderBuilding>().PlayCustomAnim(self, "active");
animationTicks = info.AnimationInterval;
}
}
static IEnumerable<int2> RandomWalk(int2 p, Thirdparty.Random r)

View File

@@ -2,11 +2,13 @@
<sequences>
<!-- Blossom Trees -->
<unit name="split2">
<sequence name="make" start="0" length="54" />
<sequence name="make" start="0" length="30" />
<sequence name="active" start="30" length="24" />
<sequence name="idle" start="54" length="1" />
</unit>
<unit name="split3">
<sequence name="make" start="0" length="54" />
<sequence name="make" start="0" length="30" />
<sequence name="active" start="30" length="24" />
<sequence name="idle" start="54" length="1" />
</unit>

View File

@@ -608,6 +608,7 @@
</unit>
<unit name="mine">
<sequence name="idle" start="0" length="1" />
<sequence name="active" start="0" length="1" />
</unit>
<unit name="dragon">
<sequence name="idle" start="0" facings="32" />