Introduce INotifyAttack.PreparingAttack
And use it to allow triggering attack animations/overlays at a different point than the actual weapon firing.
This commit is contained in:
@@ -82,12 +82,14 @@ namespace OpenRA.Mods.Common.Traits
|
||||
Panic();
|
||||
}
|
||||
|
||||
public void Attacking(Actor self, Target target, Armament a, Barrel barrel)
|
||||
void INotifyAttack.Attacking(Actor self, Target target, Armament a, Barrel barrel)
|
||||
{
|
||||
if (self.World.SharedRandom.Next(100 / info.AttackPanicChance) == 0)
|
||||
Panic();
|
||||
}
|
||||
|
||||
void INotifyAttack.PreparingAttack(Actor self, Target target, Armament a, Barrel barrel) { }
|
||||
|
||||
public int GetSpeedModifier()
|
||||
{
|
||||
return Panicking ? info.PanicSpeedModifier : 100;
|
||||
|
||||
Reference in New Issue
Block a user