bool CanTargetLocation(Actor self, CPos location, List <Actor> actorsAtLocation, TargetModifiers modifiers, ref string cursor) { if (!self.World.Map.Contains(location)) { return(false); } IsQueued = modifiers.HasModifier(TargetModifiers.ForceQueue); cursor = ab.info.Cursor; if (negativeDamage) { return(false); } if (!ab.HasAnyValidWeapons(Target.FromCell(self.World, location))) { return(false); } if (modifiers.HasModifier(TargetModifiers.ForceAttack)) { var maxRange = ab.GetMaximumRange().Range; var targetRange = (self.World.Map.CenterOfCell(location) - self.CenterPosition).HorizontalLengthSquared; if (targetRange > maxRange * maxRange) { cursor = ab.info.OutsideRangeCursor; } return(true); } return(false); }
public void RenderAfterWorld(WorldRenderer wr) { if (self.Owner != self.World.LocalPlayer) { return; } wr.DrawRangeCircleWithContrast( self.CenterPosition, attack.GetMaximumRange(), Color.FromArgb(128, Color.Yellow), Color.FromArgb(96, Color.Black) ); }
public Actor ScanForTarget(Actor self, Actor currentTarget) { var range = Info.ScanRadius > 0 ? WRange.FromCells(Info.ScanRadius) : attack.GetMaximumRange(); if (self.IsIdle || currentTarget == null || !Target.FromActor(currentTarget).IsInRange(self.CenterPosition, range)) { if (nextScanTime <= 0) { return(ChooseTarget(self, range)); } } return(currentTarget); }
public Actor ScanForTarget(Actor self, Actor currentTarget) { var range = Info.ScanRadius > 0 ? Info.ScanRadius : attack.GetMaximumRange(); if (self.IsIdle || currentTarget == null || !Combat.IsInRange(self.CenterLocation, range, currentTarget)) { if (nextScanTime <= 0) { return(ChooseTarget(self, range)); } } return(currentTarget); }
public IEnumerable <IRenderable> RenderAfterWorld(WorldRenderer wr) { if (self.Owner != self.World.LocalPlayer) { yield break; } yield return(new RangeCircleRenderable( self.CenterPosition, attack.GetMaximumRange(), 0, Color.FromArgb(128, Color.Yellow), Color.FromArgb(96, Color.Black) )); }