Пример #1
0
        public void Explode(BlastDirection inhibitdirection)
        {
            if (_FuseTimer != null)
            {
                _FuseTimer.Stop();
                _FuseTimer = null;
            }

            if (BombBag != null)
            {
                BombBag.Bombs.Remove(this);
            }

            //sound effect of explosion
            Effects.PlaySound(Location, Map,
                              Utility.RandomList(0x11B, 0x305, 0x306, 0x307, 0x11C, 0x308, 0x11D, 0x309, 0x4CF, 0x11E, 0x207));

            //bomb explosion graphics effect: 0x36CB
            Effects.SendLocationEffect(new Point3D(X + 1, Y + 1, Z), Map, 0x36CB, 10);

            //set off fire blowout
            foreach (int blastdirection in Enum.GetValues(typeof(BlastDirection)))
            {
                var curdirection = (BlastDirection)blastdirection;

                if (curdirection != BlastDirection.None && curdirection != inhibitdirection)
                {
                    var blast = new BombBlast(Location, Map, curdirection, BombBag, Planter, _Strength - 1,
                                              _BaddaBoom != null);
                }
            }
            //check for damagable at spot
            if (BombBag != null && !BombBag.Deleted)
            {
                BombBag.ControlItem.CheckForMobileVictims(Location, Map, BombBag);
            }

            Delete();
        }
Пример #2
0
		public void Explode()
		{
			if( _BlastTimer != null )
			{
				_BlastTimer.Stop();
				_BlastTimer = null;
			}
			
			if( _Map == null )
			{
				return;
			}
			
			IPooledEnumerable ie = _Map.GetItemsInRange( _Location, 0 );
			
			bool hitwall = false;
			
			foreach( Item item in ie )
			{
				if( item is BombermanObstacle && !( item is BombermanFloorTile ) )
				{
					
					BombermanObstacle obstacle = (BombermanObstacle)item;
					
					if( obstacle.Destructable )
					{
						obstacle.Destroy();
					}
					else
					{
						hitwall = true;
						_Strength = 0;
					}
					
					//stop the fires here if you don't have a baddaboom bomb
					if( !_BaddaBoom )
					{
						_Strength = 0;
					}
					break;
				}
				
				if( item is Bomb )
				{
					Bomb bomb = (Bomb)item;
					
					//reassign who planted it so that the bomb who originally exploded will get credit for any kills
					bomb.Planter = _BombBag.Owner;
					
					bomb.Explode( ReverseDirection( _Direction ) );
					
					//stop the fires here
					_Strength = 0;
					break;
				}
				
			}
			
			ie.Free();
			
			if( !hitwall )
			{
				RenderBlast();
			}
			
			//check for any victims of the blast
			if( _BombBag != null && !_BombBag.Deleted )
			{
				_BombBag.ControlItem.CheckForMobileVictims( _Location, _Map, _BombBag );
			}
			
			
			if( !hitwall )
			{
				
			}
			
			if( _Strength > 0 )
			{
				
				BombBlast newblast = new BombBlast( _Location, _Map, _Direction, _BombBag, _Planter, _Strength - 1, _BaddaBoom );
			}
		}
Пример #3
0
			public BlastTimer( BombBlast bombblast ) : base( TimeSpan.FromMilliseconds( BombermanSettings.BLAST_DELAY ), TimeSpan.FromSeconds( 1.0 ) )
			{
				_BombBlast = bombblast;
			}
Пример #4
0
		public void Explode( BlastDirection inhibitdirection )
		{

			if( _FuseTimer != null )
			{
				_FuseTimer.Stop();
				_FuseTimer = null;
			}
			
			if( BombBag != null )
			{
				BombBag.Bombs.Remove( this );
			}

			//sound effect of explosion
			Effects.PlaySound( Location, Map, Utility.RandomList( 0x11B, 0x305, 0x306, 0x307, 0x11C, 0x308, 0x11D, 0x309, 0x4CF, 0x11E, 0x207  ) );
			
			//bomb explosion graphics effect: 0x36CB
			Effects.SendLocationEffect( new Point3D( X + 1, Y + 1, Z ), Map, 0x36CB, 10 );
			
			//set off fire blowout
			foreach( int blastdirection in Enum.GetValues( typeof( BlastDirection ) ) )
			{
				BlastDirection curdirection = (BlastDirection)blastdirection;
				
				if( curdirection != BlastDirection.None && curdirection != inhibitdirection )
				{
					BombBlast blast = new BombBlast( Location, Map, curdirection, BombBag, Planter, _Strength - 1, _BaddaBoom != null );
				}
				
			}
			//check for damagable at spot
			if( BombBag != null && !BombBag.Deleted )
			{
				BombBag.ControlItem.CheckForMobileVictims( Location, Map, BombBag );
			}
			
			Delete();
		}
Пример #5
0
        public void Explode()
        {
            if (_BlastTimer != null)
            {
                _BlastTimer.Stop();
                _BlastTimer = null;
            }

            if (_Map == null)
            {
                return;
            }

            IPooledEnumerable ie = _Map.GetItemsInRange(_Location, 0);

            bool hitwall = false;

            foreach (Item item in ie)
            {
                if (item is BombermanObstacle && !(item is BombermanFloorTile))
                {
                    BombermanObstacle obstacle = (BombermanObstacle)item;

                    if (obstacle.Destructable)
                    {
                        obstacle.Destroy();
                    }
                    else
                    {
                        hitwall   = true;
                        _Strength = 0;
                    }

                    //stop the fires here if you don't have a baddaboom bomb
                    if (!_BaddaBoom)
                    {
                        _Strength = 0;
                    }
                    break;
                }

                if (item is Bomb)
                {
                    Bomb bomb = (Bomb)item;

                    //reassign who planted it so that the bomb who originally exploded will get credit for any kills
                    bomb.Planter = _BombBag.Owner;

                    bomb.Explode(ReverseDirection(_Direction));

                    //stop the fires here
                    _Strength = 0;
                    break;
                }
            }

            ie.Free();

            if (!hitwall)
            {
                RenderBlast();
            }

            //check for any victims of the blast
            if (_BombBag != null && !_BombBag.Deleted)
            {
                _BombBag.ControlItem.CheckForMobileVictims(_Location, _Map, _BombBag);
            }


            if (!hitwall)
            {
            }

            if (_Strength > 0)
            {
                BombBlast newblast = new BombBlast(_Location, _Map, _Direction, _BombBag, _Planter, _Strength - 1, _BaddaBoom);
            }
        }
Пример #6
0
 public BlastTimer(BombBlast bombblast) : base(TimeSpan.FromMilliseconds(BombermanSettings.BLAST_DELAY), TimeSpan.FromSeconds(1.0))
 {
     _BombBlast = bombblast;
 }