Пример #1
0
 public BaddaBoom(Bomb bomb) : base(0x1858, "If you can read this, you are probably going to die...")
 {
     Hue   = 1161;
     _Bomb = bomb;
 }
Пример #2
0
 public DetonatorReceiver(Bomb bomb) : base(0xF13, bomb.Name)
 {
     _Bomb = bomb;
 }
Пример #3
0
 public FuseTimer(Bomb bomb) : base(TimeSpan.FromSeconds(BombermanSettings.EXPLODE_DELAY), TimeSpan.FromSeconds(1.0))
 {
     Priority = TimerPriority.TwoFiftyMS;
     _Bomb    = bomb;
 }
Пример #4
0
        public BombCandle(Bomb bomb) : base(0x1430, bomb.Name)
        {
            Hue = 1;

            _Bomb = bomb;
        }
Пример #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);
            }
        }