protected override IEnumerable <IRenderable> RenderAnnotations(WorldRenderer wr, World world) { var info = instance.Info as AttackOrderPowerInfo; foreach (var a in instance.Instances.Where(i => !i.IsTraitPaused)) { yield return(new RangeCircleAnnotationRenderable( a.Self.CenterPosition, attack.GetMinimumRange(), 0, info.CircleColor, info.CircleWidth, info.CircleBorderColor, info.CircleBorderWidth)); yield return(new RangeCircleAnnotationRenderable( a.Self.CenterPosition, attack.GetMaximumRange(), 0, info.CircleColor, info.CircleWidth, info.CircleBorderColor, info.CircleBorderWidth)); } }
IEnumerable <Order> IOrderGenerator.Order(World world, CPos cell, int2 worldPixel, MouseInput mi) { world.CancelInputMode(); if (mi.Button == expectedButton && IsValidTarget(world, cell)) { yield return new Order(order, manager.Self, false) { TargetActor = GetFiringActor(world, cell), TargetLocation = cell, SuppressVisualFeedback = true } } ; } void IOrderGenerator.Tick(World world) { // Cancel the OG if we can't use the power if (!manager.Powers.ContainsKey(order)) { world.CancelInputMode(); } } IEnumerable <IRenderable> IOrderGenerator.Render(WorldRenderer wr, World world) { yield break; } IEnumerable <IRenderable> IOrderGenerator.RenderAboveShroud(WorldRenderer wr, World world) { foreach (var a in instance.Instances.Where(i => !i.Self.IsDisabled())) { yield return(new RangeCircleRenderable( a.Self.CenterPosition, attack.GetMinimumRange(), 0, Color.Red, Color.FromArgb(96, Color.Black))); yield return(new RangeCircleRenderable( a.Self.CenterPosition, attack.GetMaximumRange(), 0, Color.Red, Color.FromArgb(96, Color.Black))); } } string IOrderGenerator.GetCursor(World world, CPos cell, int2 worldPixel, MouseInput mi) { return(IsValidTarget(world, cell) ? cursor : cursorBlocked); } }
protected override IEnumerable <IRenderable> RenderAboveShroud(WorldRenderer wr, World world) { foreach (var a in instance.Instances.Where(i => !i.IsTraitPaused)) { yield return(new RangeCircleRenderable( a.Self.CenterPosition, attack.GetMinimumRange(), 0, Color.Red, Color.FromArgb(96, Color.Black))); yield return(new RangeCircleRenderable( a.Self.CenterPosition, attack.GetMaximumRange(), 0, Color.Red, Color.FromArgb(96, Color.Black))); } }
public IEnumerable <IRenderable> RangeCircleRenderables(WorldRenderer wr) { if (!self.Owner.IsAlliedWith(self.World.RenderPlayer)) { yield break; } var range = Info.RangeCircleMode == RangeCircleMode.Minimum ? attack.GetMinimumRange() : attack.GetMaximumRange(); if (range == WDist.Zero) { yield break; } yield return(new RangeCircleRenderable( self.CenterPosition, range, 0, Info.Color, Info.BorderColor)); }