From d202e27f799a1f7258c8e7ecc703c66dcf30e358 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sat, 31 Jul 2010 18:12:30 +1200 Subject: [PATCH] more tesla hax? --- OpenRA.Mods.RA/AttackBase.cs | 2 +- OpenRA.Mods.RA/AttackTesla.cs | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/OpenRA.Mods.RA/AttackBase.cs b/OpenRA.Mods.RA/AttackBase.cs index 36a359f7b4..8f4dc595a9 100644 --- a/OpenRA.Mods.RA/AttackBase.cs +++ b/OpenRA.Mods.RA/AttackBase.cs @@ -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 { diff --git a/OpenRA.Mods.RA/AttackTesla.cs b/OpenRA.Mods.RA/AttackTesla.cs index 964e9a5bd6..76715843ba 100644 --- a/OpenRA.Mods.RA/AttackTesla.cs +++ b/OpenRA.Mods.RA/AttackTesla.cs @@ -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,21 +51,25 @@ namespace OpenRA.Mods.RA } 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().PlayCharge( self ); - return base.FireDelay( self, info ); + self.traits.Get().PlayCharge(self); } - else - return 3; } } }