示例#1
0
        //this determines the opposite direction to the specified blast direction
        protected BlastDirection ReverseDirection(BlastDirection direction)
        {
            switch (direction)
            {
            case BlastDirection.West:
            {
                return(BlastDirection.East);
            }

            case BlastDirection.East:
            {
                return(BlastDirection.West);
            }

            case BlastDirection.North:
            {
                return(BlastDirection.South);
            }

            case BlastDirection.South:
            {
                return(BlastDirection.North);
            }
            }

            return(BlastDirection.None);
        }
示例#2
0
        public BombBlast(Point3D location, Map map, BlastDirection direction, BombBag bombbag, Mobile planter,
                         int strength, bool baddaboom)
        {
            _Direction = direction;
            _DeltaX    = (_Direction == BlastDirection.West ? -1 : 0) + (_Direction == BlastDirection.East ? 1 : 0);
            _DeltaY    = (_Direction == BlastDirection.North ? -1 : 0) + (_Direction == BlastDirection.South ? 1 : 0);

            _Location = new Point3D(location.X + _DeltaX, location.Y + _DeltaY, location.Z);
            _Map      = map;

            _BombBag = bombbag;
            _Planter = planter;

            _Strength  = strength;
            _BaddaBoom = baddaboom;

            _BlastTimer = new BlastTimer(this);
            _BlastTimer.Start();

            //check for any victims of the blast
            if (_BombBag != null && !_BombBag.Deleted)
            {
                _BombBag.ControlItem.CheckForMobileVictims(_Location, _Map, _BombBag);
            }
        }
示例#3
0
        public BombBlast(Point3D location, Map map, BlastDirection direction, BombBag bombbag, Mobile planter,
            int strength, bool baddaboom)
        {
            _Direction = direction;
            _DeltaX = (_Direction == BlastDirection.West ? -1 : 0) + (_Direction == BlastDirection.East ? 1 : 0);
            _DeltaY = (_Direction == BlastDirection.North ? -1 : 0) + (_Direction == BlastDirection.South ? 1 : 0);

            _Location = new Point3D(location.X + _DeltaX, location.Y + _DeltaY, location.Z);
            _Map = map;

            _BombBag = bombbag;
            _Planter = planter;

            _Strength = strength;
            _BaddaBoom = baddaboom;

            _BlastTimer = new BlastTimer(this);
            _BlastTimer.Start();

            //check for any victims of the blast
            if (_BombBag != null && !_BombBag.Deleted)
            {
                _BombBag.ControlItem.CheckForMobileVictims(_Location, _Map, _BombBag);
            }
        }
示例#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(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();
        }
示例#6
0
		//this determines the opposite direction to the specified blast direction
		protected BlastDirection ReverseDirection( BlastDirection direction )
		{
			switch( direction )
			{
				case BlastDirection.West:
				{
					return( BlastDirection.East );
				}
				case BlastDirection.East:
				{
					return( BlastDirection.West );
				}
				case BlastDirection.North:
				{
					return( BlastDirection.South );
				}
				case BlastDirection.South:
				{
					return( BlastDirection.North );
				}
			}
			
			return BlastDirection.None;
		}