Beispiel #1
0
 public DetonateTimer(BombermanBomb bomb, BombermanGame game, Mobile owner) : base(TimeSpan.Zero, TimeSpan.FromSeconds(bomb.BombPlacer.SpreadSpeed))
 {
     m_Bomb           = bomb;
     m_Game           = game;
     m_Owner          = owner;
     DetonateLocation = m_Bomb.Location;
     DetonateMap      = m_Bomb.Map;
     Priority         = TimerPriority.TwoFiftyMS;
     maxcount         = m_Bomb.BombPlacer.Strength;
     detonateLocation(DetonateLocation);
     m_Bomb.Delete();
 }
        public override void OnDoubleClick(Mobile from)
        {
            if (!Active)
            {
                from.SendMessage("This bombplacer is not active. Wait until the game has started!");
                return;
            }

            if (!from.CanBeDamaged())
            {
                from.SendMessage("You cannot place bombs in this area");
                return;
            }
            if (m_BombsInWorld < m_MaxBombs)
            {
                BombermanBomb bomb = new BombermanBomb(this, m_Game);
                bomb.MoveToWorld(from.Location, from.Map);
                ++m_BombsInWorld;
            }
            else
            {
                from.SendMessage("You cannot place anymore bombs.");
            }
        }
        public override void OnDoubleClick(Mobile from)
        {
            if (!from.CanBeDamaged())
            {
                from.SendMessage("You cannot place bombs in this area");
                return;
            }
            if (BombsInWorld < MaxBombs)
            {
                bool cont;
                byte inc = 0;
                Map map = from.Map;
                Direction direction = from.Direction;
                int xinc = 0;
                int yinc = 0;

                while (true)
                {
                    cont = false;
                    if (++inc > range)
                    {
                        from.SendMessage("You cannot kick bombs that far");
                        return;
                    }
                    if (direction == Direction.North || direction == Direction.Running)
                    {
                        yinc -= 1;
                    }
                    else if (direction == Direction.East || direction.ToString() == "130")
                    {
                        xinc += 1;
                    }
                    else if (direction == Direction.South || direction.ToString() == "132")
                    {
                        yinc += 1;
                    }
                    else if (direction == Direction.West || direction.ToString() == "134")
                    {
                        xinc -= 1;
                    }

                    int x = from.X + xinc;
                    int y = from.Y + yinc;

                    int z = map.Tiles.GetLandTile(x, y).Z;

                    Point3D location = new Point3D(x, y, z);

                    IPooledEnumerable objects = map.GetObjectsInRange(location, 0);
                    foreach (object o in objects)
                    {
                        if (o is LOSBlocker)
                        {
                            from.SendMessage("You cannot kick a bomb to a place you cannot see.");
                            return;
                        }
                        if (o is Mobile)
                        {
                            from.SendMessage("You cannot kick a bomb on someone else.");
                            return;
                        }
                        if (o is BombermanStone)
                        {
                            cont = true;
                        }
                    }

                    if (!cont)
                    {
                        BombermanBomb bomb = new BombermanBomb(this, m_Game);
                        bomb.MoveToWorld(location, from.Map);
                        ++BombsInWorld;
                        break;
                    }
                }
            }
            else
            {
                from.SendMessage("You cannot place anymore bombs.");
            }
        }
		    public BombTimer(BombermanBomb bomb) : base( TimeSpan.Zero, TimeSpan.FromSeconds( 1.0 ) )
			{
				m_Bomb = bomb;
			    m_Start = DateTime.Now;
				Priority = TimerPriority.TwoFiftyMS;
			}
			public DetonateTimer(BombermanBomb bomb, BombermanGame game, Mobile owner) : base( TimeSpan.Zero, TimeSpan.FromSeconds( bomb.BombPlacer.SpreadSpeed ) )
			{
				m_Bomb = bomb;
                m_Game = game;
                m_Owner = owner;
                DetonateLocation = m_Bomb.Location;
                DetonateMap = m_Bomb.Map;
			    Priority = TimerPriority.TwoFiftyMS;
                maxcount = m_Bomb.BombPlacer.Strength;
                detonateLocation(DetonateLocation);
                m_Bomb.Delete();
			}
Beispiel #6
0
 public BombTimer(BombermanBomb bomb) : base(TimeSpan.Zero, TimeSpan.FromSeconds(1.0))
 {
     m_Bomb   = bomb;
     m_Start  = DateTime.Now;
     Priority = TimerPriority.TwoFiftyMS;
 }
Beispiel #7
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!from.CanBeDamaged())
            {
                from.SendMessage("You cannot place bombs in this area");
                return;
            }
            if (BombsInWorld < MaxBombs)
            {
                bool      cont;
                byte      inc       = 0;
                Map       map       = from.Map;
                Direction direction = from.Direction;
                int       xinc      = 0;
                int       yinc      = 0;

                while (true)
                {
                    cont = false;
                    if (++inc > range)
                    {
                        from.SendMessage("You cannot kick bombs that far");
                        return;
                    }
                    if (direction == Direction.North || direction == Direction.Running)
                    {
                        yinc -= 1;
                    }
                    else if (direction == Direction.East || direction.ToString() == "130")
                    {
                        xinc += 1;
                    }
                    else if (direction == Direction.South || direction.ToString() == "132")
                    {
                        yinc += 1;
                    }
                    else if (direction == Direction.West || direction.ToString() == "134")
                    {
                        xinc -= 1;
                    }

                    int x = from.X + xinc;
                    int y = from.Y + yinc;

                    int z = map.Tiles.GetLandTile(x, y).Z;

                    Point3D location = new Point3D(x, y, z);

                    IPooledEnumerable objects = map.GetObjectsInRange(location, 0);
                    foreach (object o in objects)
                    {
                        if (o is LOSBlocker)
                        {
                            from.SendMessage("You cannot kick a bomb to a place you cannot see.");
                            return;
                        }
                        if (o is Mobile)
                        {
                            from.SendMessage("You cannot kick a bomb on someone else.");
                            return;
                        }
                        if (o is BombermanStone)
                        {
                            cont = true;
                        }
                    }

                    if (!cont)
                    {
                        BombermanBomb bomb = new BombermanBomb(this, m_Game);
                        bomb.MoveToWorld(location, from.Map);
                        ++BombsInWorld;
                        break;
                    }
                }
            }
            else
            {
                from.SendMessage("You cannot place anymore bombs.");
            }
        }
		public override void OnDoubleClick( Mobile from )
		{
            if (!Active)
            {
                from.SendMessage("This bombplacer is not active. Wait until the game has started!");
                return;
            }

			if(!from.CanBeDamaged())
			{
				from.SendMessage( "You cannot place bombs in this area" );
				return;
			}
			if(m_BombsInWorld < m_MaxBombs)
			{
				BombermanBomb bomb = new BombermanBomb( this, m_Game );
				bomb.MoveToWorld( from.Location, from.Map );
			    ++m_BombsInWorld;
			} else {
				from.SendMessage( "You cannot place anymore bombs." );
			}
		}