예제 #1
0
        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.");
            }
        }
예제 #3
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." );
			}
		}