Skip to content

Commit

Permalink
more tesla hax?
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisforbes committed Jul 31, 2010
1 parent 960dddc commit d202e27
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion OpenRA.Mods.RA/AttackBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
18 changes: 11 additions & 7 deletions OpenRA.Mods.RA/AttackTesla.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class AttackTeslaInfo : AttackOmniInfo
public override object Create(ActorInitializer init) { return new AttackTesla(init.self); }
}

class AttackTesla : AttackOmni, ITick
class AttackTesla : AttackOmni, ITick, INotifyAttack
{
int charges;
int timeToRecharge;
Expand Down Expand Up @@ -51,21 +51,25 @@ public override void Tick( Actor self )
}

Actor previousTarget;

public override int FireDelay( Actor self, AttackBaseInfo info )
{
foreach( var w in Weapons )
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;

if( target.Actor != previousTarget )
if (target.Actor != previousTarget)
{
previousTarget = target.Actor;
self.traits.Get<RenderBuildingCharge>().PlayCharge( self );
return base.FireDelay( self, info );
self.traits.Get<RenderBuildingCharge>().PlayCharge(self);
}
else
return 3;
}
}
}

0 comments on commit d202e27

Please sign in to comment.