more of attack-ground (order wiring, etc); doesn't work.
This commit is contained in:
@@ -57,9 +57,6 @@ namespace OpenRA.Mods.RA.Activities
|
||||
return this;
|
||||
}
|
||||
|
||||
public void Cancel(Actor self)
|
||||
{
|
||||
Target = new Target();
|
||||
}
|
||||
public void Cancel(Actor self) { Target = Target.None; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,13 +15,13 @@ namespace OpenRA.Mods.RA.Activities
|
||||
public class FlyAttack : IActivity
|
||||
{
|
||||
public IActivity NextActivity { get; set; }
|
||||
Actor Target;
|
||||
Target Target;
|
||||
|
||||
public FlyAttack(Actor target) { Target = target; }
|
||||
public FlyAttack(Target target) { Target = target; }
|
||||
|
||||
public IActivity Tick(Actor self)
|
||||
{
|
||||
if (Target == null || Target.IsDead)
|
||||
if (!Target.IsValid)
|
||||
return NextActivity;
|
||||
|
||||
var limitedAmmo = self.traits.GetOrDefault<LimitedAmmo>();
|
||||
@@ -34,7 +34,7 @@ namespace OpenRA.Mods.RA.Activities
|
||||
this);
|
||||
}
|
||||
|
||||
public void Cancel(Actor self) { Target = null; NextActivity = null; }
|
||||
public void Cancel(Actor self) { Target = Target.None; NextActivity = null; }
|
||||
}
|
||||
|
||||
public class FlyCircle : IActivity
|
||||
|
||||
@@ -15,10 +15,10 @@ namespace OpenRA.Mods.RA.Activities
|
||||
{
|
||||
public class Follow : IActivity
|
||||
{
|
||||
Actor Target;
|
||||
Target Target;
|
||||
int Range;
|
||||
|
||||
public Follow(Actor target, int range)
|
||||
public Follow(Target target, int range)
|
||||
{
|
||||
Target = target;
|
||||
Range = range;
|
||||
@@ -28,10 +28,10 @@ namespace OpenRA.Mods.RA.Activities
|
||||
|
||||
public IActivity Tick( Actor self )
|
||||
{
|
||||
if (Target == null || Target.IsDead)
|
||||
if (!Target.IsValid)
|
||||
return NextActivity;
|
||||
|
||||
var inRange = ( Target.Location - self.Location ).LengthSquared < Range * Range;
|
||||
var inRange = ( Util.CellContaining( Target.CenterLocation ) - self.Location ).LengthSquared < Range * Range;
|
||||
|
||||
if( !inRange )
|
||||
return new Move( Target, Range ) { NextActivity = this };
|
||||
@@ -41,7 +41,7 @@ namespace OpenRA.Mods.RA.Activities
|
||||
|
||||
public void Cancel(Actor self)
|
||||
{
|
||||
Target = null;
|
||||
Target = Target.None;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,14 +16,14 @@ namespace OpenRA.Mods.RA.Activities
|
||||
{
|
||||
public class HeliAttack : IActivity
|
||||
{
|
||||
Actor target;
|
||||
public HeliAttack( Actor target ) { this.target = target; }
|
||||
Target target;
|
||||
public HeliAttack( Target target ) { this.target = target; }
|
||||
|
||||
public IActivity NextActivity { get; set; }
|
||||
|
||||
public IActivity Tick(Actor self)
|
||||
{
|
||||
if (target == null || target.IsDead)
|
||||
if (!target.IsValid)
|
||||
return NextActivity;
|
||||
|
||||
var limitedAmmo = self.traits.GetOrDefault<LimitedAmmo>();
|
||||
@@ -55,6 +55,6 @@ namespace OpenRA.Mods.RA.Activities
|
||||
return this;
|
||||
}
|
||||
|
||||
public void Cancel(Actor self) { target = null; NextActivity = null; }
|
||||
public void Cancel(Actor self) { target = Target.None; NextActivity = null; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user