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 int Interval = 75;
public readonly string ResourceType = "Ore"; public readonly string ResourceType = "Ore";
public readonly int MaxRange = 100; public readonly int MaxRange = 100;
public readonly int AnimationInterval = 750;
public object Create(Actor self) { return new SeedsResource(); } public object Create(Actor self) { return new SeedsResource(); }
} }
@@ -37,6 +38,7 @@ namespace OpenRA.Mods.RA
class SeedsResource : ITick class SeedsResource : ITick
{ {
int ticks; int ticks;
int animationTicks;
public void Tick(Actor self) public void Tick(Actor self)
{ {
@@ -64,6 +66,13 @@ namespace OpenRA.Mods.RA
ticks = info.Interval; 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) static IEnumerable<int2> RandomWalk(int2 p, Thirdparty.Random r)

View File

@@ -2,11 +2,13 @@
<sequences> <sequences>
<!-- Blossom Trees --> <!-- Blossom Trees -->
<unit name="split2"> <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" /> <sequence name="idle" start="54" length="1" />
</unit> </unit>
<unit name="split3"> <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" /> <sequence name="idle" start="54" length="1" />
</unit> </unit>

View File

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