diff --git a/OpenRa.Game/Traits/Render/RenderInfantry.cs b/OpenRa.Game/Traits/Render/RenderInfantry.cs index 6336c7ed2e..2685233743 100644 --- a/OpenRa.Game/Traits/Render/RenderInfantry.cs +++ b/OpenRa.Game/Traits/Render/RenderInfantry.cs @@ -1,4 +1,5 @@ using OpenRa.Effects; +using OpenRa.Graphics; namespace OpenRa.Traits { @@ -12,6 +13,7 @@ namespace OpenRa.Traits public RenderInfantry(Actor self) : base(self) { + anim = new Animation( GetImage( self ), () => self.traits.Get().Facing ); anim.PlayFacing("stand", () => self.traits.Get().Facing); } @@ -23,14 +25,11 @@ namespace OpenRa.Traits var mobile = self.traits.Get(); if (float2.WithinEpsilon(self.CenterLocation, Util.CenterOfCell(mobile.toCell), 2)) return false; - var dir = Util.QuantizeFacing(self.traits.Get().Facing, 8); - var prefix = IsProne(self) ? "crawl-" : "run-"; + var seq = IsProne(self) ? "crawl" : "run"; - if (anim.CurrentSequence.Name.StartsWith(prefix)) - anim.ReplaceAnim(prefix + dir); - else - anim.PlayRepeating(prefix + dir); + if (anim.CurrentSequence.Name != seq) + anim.PlayRepeating(seq); return true; } @@ -44,13 +43,12 @@ namespace OpenRa.Traits public void Attacking(Actor self) { - var dir = Util.QuantizeFacing(self.traits.Get().Facing, 8); inAttack = true; - var prefix = IsProne(self) ? "prone-shoot-" : "shoot-"; + var seq = IsProne(self) ? "prone-shoot" : "shoot"; - if (anim.HasSequence(prefix + dir)) - anim.PlayThen(prefix + dir, () => inAttack = false); + if (anim.HasSequence(seq)) + anim.PlayThen(seq, () => inAttack = false); else if (anim.HasSequence("heal")) anim.PlayThen("heal", () => inAttack = false); } @@ -63,10 +61,8 @@ namespace OpenRa.Traits /* todo: idle anims, etc */ - var dir = Util.QuantizeFacing(self.traits.Get().Facing, 8); - if (IsProne(self)) - anim.PlayFetchIndex("crawl-" + dir, () => 0); /* what a hack. */ + anim.PlayFetchIndex("crawl", () => 0); /* what a hack. */ else anim.PlayFacing("stand", () => self.traits.Get().Facing); diff --git a/mods/ra/sequences.xml b/mods/ra/sequences.xml index 55a4ae00e5..facce4693b 100644 --- a/mods/ra/sequences.xml +++ b/mods/ra/sequences.xml @@ -305,47 +305,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + @@ -412,70 +377,28 @@ - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - + + - - - - - - - + - - - - - - - - - + @@ -491,37 +414,16 @@ - - - - - - - - + - - - - - - - - + - - - - - - - - + @@ -712,58 +614,23 @@ - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - + + - - - - - - - - + @@ -777,44 +644,16 @@ - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - + + @@ -822,114 +661,44 @@ - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - + + - - - - - - - - + - - - - - - - - +