more tesla hax?
This commit is contained in:
@@ -10,12 +10,12 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using OpenRA.Effects;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.GameRules;
|
||||
using OpenRA.Traits;
|
||||
using System.Drawing;
|
||||
|
||||
namespace OpenRA.Mods.RA
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace OpenRA.Mods.RA
|
||||
public override object Create(ActorInitializer init) { return new AttackTesla(init.self); }
|
||||
}
|
||||
|
||||
class AttackTesla : AttackOmni, ITick
|
||||
class AttackTesla : AttackOmni, ITick, INotifyAttack
|
||||
{
|
||||
int charges;
|
||||
int timeToRecharge;
|
||||
@@ -51,10 +51,17 @@ namespace OpenRA.Mods.RA
|
||||
}
|
||||
|
||||
Actor previousTarget;
|
||||
|
||||
public override int FireDelay( Actor self, AttackBaseInfo info )
|
||||
{
|
||||
return target.Actor == previousTarget ? 3 : base.FireDelay(self, info);
|
||||
}
|
||||
|
||||
public void Attacking(Actor self)
|
||||
{
|
||||
foreach (var w in Weapons)
|
||||
w.FireDelay = 8;
|
||||
|
||||
timeToRecharge = Weapons[0].Info.ROF;
|
||||
--charges;
|
||||
|
||||
@@ -62,10 +69,7 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
previousTarget = target.Actor;
|
||||
self.traits.Get<RenderBuildingCharge>().PlayCharge(self);
|
||||
return base.FireDelay( self, info );
|
||||
}
|
||||
else
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user