Example #1
0
        public void ResolveOrder(Actor self, Order order)
        {
            if (order.OrderString != "PlaceBeacon")
                return;

            var pos = self.World.Map.CenterOfCell(order.TargetLocation);

            self.World.AddFrameEndTask(w =>
            {
                if (playerBeacon != null)
                    self.World.Remove(playerBeacon);

                playerBeacon = new Beacon(self.Owner, pos, info.Duration, info.PalettePrefix);
                self.World.Add(playerBeacon);

                if (self.Owner.IsAlliedWith(self.World.RenderPlayer))
                    Game.Sound.PlayNotification(self.World.Map.Rules, null, info.NotificationType, info.Notification,
                        self.World.RenderPlayer != null ? self.World.RenderPlayer.Faction.InternalName : null);

                if (radarPings != null)
                {
                    if (playerRadarPing != null)
                        radarPings.Remove(playerRadarPing);

                    playerRadarPing = radarPings.Add(
                        () => self.Owner.IsAlliedWith(self.World.RenderPlayer),
                        pos,
                        self.Owner.Color.RGB,
                        info.Duration);
                }
            });
        }
Example #2
0
 public virtual void Activate(Actor self, Order order, SupportPowerManager manager)
 {
     if (Info.DisplayRadarPing && manager.RadarPings != null)
     {
         ping = manager.RadarPings.Value.Add(
             () => order.Player.IsAlliedWith(self.World.RenderPlayer),
             self.World.Map.CenterOfCell(order.TargetLocation),
             order.Player.Color.RGB,
             Info.RadarPingDuration);
     }
 }
Example #3
0
		public RadarPing Add(Func<bool> isVisible, WPos position, Color color, int duration)
		{
			var ping = new RadarPing(isVisible, position, color, duration,
				info.FromRadius, info.ToRadius, info.ShrinkSpeed, info.RotationSpeed);

			if (ping.IsVisible())
				LastPingPosition = ping.Position;

			Pings.Add(ping);

			return ping;
		}
Example #4
0
        public RadarPing Add(Func <bool> isVisible, WPos position, Color color, int duration)
        {
            var ping = new RadarPing(isVisible, position, color, duration,
                                     info.FromRadius, info.ToRadius, info.ShrinkSpeed, info.RotationSpeed);

            if (ping.IsVisible())
            {
                LastPingPosition = ping.Position;
            }

            Pings.Add(ping);

            return(ping);
        }
Example #5
0
        public virtual void Activate(Actor self, Order order, SupportPowerManager manager)
        {
            if (Info.DisplayRadarPing && manager.RadarPings != null)
            {
                ping = manager.RadarPings.Value.Add(
                    () => order.Player.IsAlliedWith(self.World.RenderPlayer),
                    order.Target.CenterPosition,
                    order.Player.Color,
                    Info.RadarPingDuration);
            }

            foreach (var notify in self.TraitsImplementing <INotifySupportPower>())
            {
                notify.Activated(self);
            }
        }
Example #6
0
        public void ResolveOrder(Actor self, Order order)
        {
            if (order.OrderString != "PlaceBeacon")
            {
                return;
            }

            var pos = self.World.Map.CenterOfCell(order.TargetLocation);

            self.World.AddFrameEndTask(w =>
            {
                if (playerBeacon != null)
                {
                    self.World.Remove(playerBeacon);
                }

                playerBeacon = new Beacon(self.Owner, pos, info.Duration, info.Palette, info.IsPlayerPalette, info.BeaconImage, info.ArrowSequence, info.CircleSequence);

                self.World.Add(playerBeacon);

                if (self.Owner.IsAlliedWith(self.World.RenderPlayer))
                {
                    Game.Sound.PlayNotification(self.World.Map.Rules, null, info.NotificationType, info.Notification,
                                                self.World.RenderPlayer != null ? self.World.RenderPlayer.Faction.InternalName : null);
                }

                if (radarPings != null)
                {
                    if (playerRadarPing != null)
                    {
                        radarPings.Remove(playerRadarPing);
                    }

                    playerRadarPing = radarPings.Add(
                        () => self.Owner.IsAlliedWith(self.World.RenderPlayer),
                        pos,
                        self.Owner.Color.RGB,
                        info.Duration);
                }
            });
        }
Example #7
0
 public void Remove(RadarPing ping)
 {
     Pings.Remove(ping);
 }
Example #8
0
 public void Remove(RadarPing ping)
 {
     Pings.Remove(ping);
 }