Adds support for damage-stage-based sequences to WithSpriteBody and WithTurret
This commit is contained in:
@@ -42,7 +42,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
}
|
||||
|
||||
public class WithSpriteBody : UpgradableTrait<WithSpriteBodyInfo>, ISpriteBody
|
||||
public class WithSpriteBody : UpgradableTrait<WithSpriteBodyInfo>, ISpriteBody, INotifyDamageStateChanged
|
||||
{
|
||||
public readonly Animation DefaultAnimation;
|
||||
|
||||
@@ -94,5 +94,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
after();
|
||||
});
|
||||
}
|
||||
|
||||
public virtual void DamageStateChanged(Actor self, AttackInfo e)
|
||||
{
|
||||
if (DefaultAnimation.CurrentSequence != null)
|
||||
DefaultAnimation.ReplaceAnim(NormalizeSequence(self, DefaultAnimation.CurrentSequence.Name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user