Fix AttackLeap.
This commit is contained in:
@@ -115,7 +115,7 @@ namespace OpenRA.Mods.RA
|
|||||||
a();
|
a();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DoAttack(Actor self, Target target)
|
public virtual void DoAttack(Actor self, Target target)
|
||||||
{
|
{
|
||||||
if( !CanAttack( self, target ) ) return;
|
if( !CanAttack( self, target ) ) return;
|
||||||
|
|
||||||
|
|||||||
@@ -14,25 +14,22 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
class AttackLeapInfo : AttackBaseInfo
|
class AttackLeapInfo : AttackFrontalInfo
|
||||||
{
|
{
|
||||||
public override object Create(ActorInitializer init) { return new AttackLeap(init.self); }
|
public override object Create(ActorInitializer init) { return new AttackLeap(init.self, this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
class AttackLeap : AttackBase
|
class AttackLeap : AttackFrontal
|
||||||
{
|
{
|
||||||
internal bool IsLeaping;
|
internal bool IsLeaping;
|
||||||
protected Target target;
|
protected Target target;
|
||||||
|
|
||||||
public AttackLeap(Actor self)
|
public AttackLeap(Actor self, AttackLeapInfo info)
|
||||||
: base(self) {}
|
: base(self, info) {}
|
||||||
|
|
||||||
public override void Tick(Actor self)
|
public override void DoAttack(Actor self, Target target)
|
||||||
{
|
{
|
||||||
base.Tick(self);
|
if( !CanAttack( self, target ) ) return;
|
||||||
|
|
||||||
if (!target.IsValid) return;
|
|
||||||
if (IsLeaping) return;
|
|
||||||
|
|
||||||
var weapon = Weapons[0].Info;
|
var weapon = Weapons[0].Info;
|
||||||
if( !Combat.IsInRange( self.CenterLocation, weapon.Range, target ) ) return;
|
if( !Combat.IsInRange( self.CenterLocation, weapon.Range, target ) ) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user