當前位置: 首頁>>代碼示例>>C#>>正文


C# Server.Map類代碼示例

本文整理匯總了C#中Server.Map的典型用法代碼示例。如果您正苦於以下問題:C# Map類的具體用法?C# Map怎麽用?C# Map使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Map類屬於Server命名空間,在下文中一共展示了Map類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CraftShopRegion

 public CraftShopRegion( XmlElement xml, Map map, Region parent )
     : base(xml, map, parent)
 {
     int skill = 0;
     ReadInt32( xml, "skill", ref skill, true );
     m_Skills = (CraftSkillType)skill;
 }
開發者ID:kamronbatman,項目名稱:Defiance-AOS-Pre-2012,代碼行數:7,代碼來源:CraftShopRegion.cs

示例2: TreasureRegion

        private const int Range = 5;// No house may be placed within 5 tiles of the treasure
        public TreasureRegion(int x, int y, Map map)
            : base(null, map, Region.DefaultPriority, new Rectangle2D(x - Range, y - Range, 1 + (Range * 2), 1 + (Range * 2)))
        {
            this.GoLocation = new Point3D(x, y, map.GetAverageZ(x, y));

            this.Register();
        }
開發者ID:Crome696,項目名稱:ServUO,代碼行數:8,代碼來源:TreasureMapProtection.cs

示例3: PlaySound

        public static void PlaySound( IPoint3D p, Map map, int soundID )
        {
            if ( soundID <= -1 )
                return;

            if ( map != null )
            {
                Packet playSound = null;

                IPooledEnumerable eable = map.GetClientsInRange( new Point3D( p ) );

                foreach ( NetState state in eable )
                {
                    state.Mobile.ProcessDelta();

                    if ( playSound == null )
                        playSound = Packet.Acquire( new PlaySound( soundID, p ) );

                    state.Send( playSound );
                }

                Packet.Release( playSound );

                eable.Free();
            }
        }
開發者ID:greeduomacro,項目名稱:liberdade-uo-server,代碼行數:26,代碼來源:Effects.cs

示例4: Explode

		public virtual void Explode( Mobile from, Point3D loc, Map map )
		{
			if ( Deleted || map == null )
				return;

			Consume();
			
			// Check if any other players are using this potion
			for ( int i = 0; i < m_Users.Count; i ++ )
			{
				ThrowTarget targ = m_Users[ i ].Target as ThrowTarget;

				if ( targ != null && targ.Potion == this )
					Target.Cancel( from );
			}

			// Effects
			Effects.PlaySound( loc, map, 0x20C );

			for ( int i = -2; i <= 2; i ++ )
			{
				for ( int j = -2; j <= 2; j ++ )
				{
					Point3D p = new Point3D( loc.X + i, loc.Y + j, loc.Z );

					if ( map.CanFit( p, 12, true, false ) && from.InLOS( p ) )
						new InternalItem( from, p, map, MinDamage, MaxDamage );
				}
			}
		}
開發者ID:romeov007,項目名稱:imagine-uo,代碼行數:30,代碼來源:BaseConflagrationPotion.cs

示例5: OnExplode

        public override void OnExplode( Mobile source, Item itemSource, int intensity, Point3D loc, Map map )
        {
            Server.Effects.PlaySound( loc, map, 0x22F );

            int radius = 2; // for anything that's calling this, and is not a bomb
            if ( itemSource is BombPotion )
            {
                BombPotion bomb = itemSource as BombPotion;
                radius = bomb.ExplosionRange;
            }

            int delay = (int)(intensity * Divisor);
            if ( delay <= 0 )
                delay = 1;
            TimeSpan time = TimeSpan.FromSeconds( delay );

            List<Point3D> circlePoints = CircleHelper.CircleMidpoint( loc.X, loc.Y, loc.Z, radius, true );

            Point3D eye = new Point3D( loc );
            eye.Z += 14;
            foreach( Point3D point in circlePoints )
            {
                Point3D target = new Point3D(point);
                target.Z += 14;
                if ( map.LineOfSight( eye, target ) )
                {
                    FireTile tile = new FireTile( time+TimeSpan.FromSeconds( Utility.RandomDouble()*5 ), source, FireEffectType );
                    tile.MoveToWorld( point, map );
                    tile.AddCurrentOccupants();
                }
            }
        }
開發者ID:justdanofficial,項目名稱:khaeros,代碼行數:32,代碼來源:FireEffect.cs

示例6: CustomRegion

        public CustomRegion( RegionControl m, Map map )
            : base("", "Custom Region", map, typeof( WarriorGuard ))
        {
            LoadFromXml = false;

            m_Controller = m;
        }
開發者ID:cynricthehun,項目名稱:UOLegends,代碼行數:7,代碼來源:CustomRegion.cs

示例7: MovementPath

        public MovementPath(Mobile m, Point3D goal)
        {
            Point3D start = m.Location;
            Map map = m.Map;

            this.m_Map = map;
            this.m_Start = start;
            this.m_Goal = goal;

            if (map == null || map == Map.Internal)
                return;

            if (Utility.InRange(start, goal, 1))
                return;

            try
            {
                PathAlgorithm alg = m_OverrideAlgorithm;

                if (alg == null)
                {
                    alg = FastAStarAlgorithm.Instance;
                    //if ( !alg.CheckCondition( m, map, start, goal ) )	// SlowAstar is still broken
                    //	alg = SlowAStarAlgorithm.Instance;		// TODO: Fix SlowAstar
                }

                if (alg != null && alg.CheckCondition(m, map, start, goal))
                    this.m_Directions = alg.Find(m, map, start, goal);
            }
            catch (Exception e)
            {
                Console.WriteLine("Warning: {0}: Pathing error from {1} to {2}", e.GetType().Name, start, goal);
            }
        }
開發者ID:FreeReign,項目名稱:forkuo,代碼行數:34,代碼來源:MovementPath.cs

示例8: DeleteMoonGate

		private static int DeleteMoonGate(Map map, Point3D p)
		{
			Queue<Item> m_Queue = new Queue<Item>();

			IPooledEnumerable eable = map.GetItemsInRange(p, 0);

			foreach (Item item in eable)
			{
				if (item is PublicMoongate)
				{
					int delta = item.Z - p.Z;

					if (delta >= -12 && delta <= 12)
						m_Queue.Enqueue(item);
				}
			}

			eable.Free();

			int m_Count = m_Queue.Count;

			while (m_Queue.Count > 0)
				(m_Queue.Dequeue()).Delete();

			return m_Count;
		}
開發者ID:romeov007,項目名稱:imagine-uo,代碼行數:26,代碼來源:MoonGenDelete.cs

示例9: Sector

		public Sector( int x, int y, Map owner )
		{
			m_X = x;
			m_Y = y;
			m_Owner = owner;
			m_Active = false;
		}
開發者ID:kamronbatman,項目名稱:DefianceUO-Pre1.10,代碼行數:7,代碼來源:Sector.cs

示例10: Explode

		public virtual void Explode( Mobile from, Point3D loc, Map map )
		{
			if ( Deleted || map == null )
				return;

			Consume();

			// Check if any other players are using this potion
			for ( int i = 0; i < m_Users.Count; i ++ )
			{
				ThrowTarget targ = m_Users[ i ].Target as ThrowTarget;

				if ( targ != null && targ.Potion == this )
					Target.Cancel( from );
			}

			// Effects
			Effects.PlaySound( loc, map, 0x207 );

			Geometry.Circle2D( loc, map, Radius, new DoEffect_Callback( BlastEffect ), 270, 90 );

			Timer.DelayCall( TimeSpan.FromSeconds( 0.3 ), new TimerStateCallback( CircleEffect2 ), new object[] { loc, map } );

			foreach ( Mobile mobile in map.GetMobilesInRange( loc, Radius ) )
			{
                if (mobile is BaseCreature)
                {
					BaseCreature mon = (BaseCreature) mobile;

					mon.Pacify( from, DateTime.Now + TimeSpan.FromSeconds( 5.0 ) ); // TODO check
				}
			}
		}
開發者ID:FreeReign,項目名稱:imaginenation,代碼行數:33,代碼來源:BaseConfusionBlastPotion.cs

示例11: GetDestination

        public override bool GetDestination( PlayerMobile player, ref Point3D loc, ref Map map )
        {
            QuestSystem qs = player.Quest;

            if ( qs is EminosUndertakingQuest )
            {
                QuestObjective obj = qs.FindObjective( typeof( TakeBlueTeleporterObjective ) );

                if ( obj != null )
                {
                    if ( X == 423 && Y == 805 && Z == -1 )
                    {
                        loc = new Point3D( 411, 1116, 0 );
                    }

                    if ( X == 411 && Y == 1117 && Z == 0 )
                    {
                        loc = new Point3D( 424, 807, 0 );
                    }

                    map = Map.Malas;
                    return true;
                }
            }

            return false;
        }
開發者ID:Ravenwolfe,項目名稱:xrunuo,代碼行數:27,代碼來源:BlueTeleporter.cs

示例12: QuestCompleteObjectiveRegion

		public QuestCompleteObjectiveRegion( XmlElement xml, Map map, Region parent ) : base( xml, map, parent )
		{
			XmlElement questEl = xml["quest"];

			ReadType( questEl, "type", ref m_Quest );
			ReadType( questEl, "complete", ref m_Objective );
		}
開發者ID:Godkong,項目名稱:Origins,代碼行數:7,代碼來源:QuestCompleteObjectiveRegion.cs

示例13: CheckItem

        private static void CheckItem( Item item, Map oldMap )
        {
            if ( item.Map == null || item.Map == Map.Internal )
                return;

            if ( !m_Timers.ContainsKey( item ) )
            {
                MoonbindTimer timer = new MoonbindTimer( item );
                timer.Start();

                m_Timers.Add( item, timer );
            }

            Mobile parent = item.Parent as Mobile;

            if ( parent != null )
            {
                bool sendMessage = oldMap != null && oldMap != Map.Internal && ( oldMap == Map.Felucca || item.Map == Map.Felucca );

                if ( sendMessage )
                {
                    if ( item.IsEphemeral() )
                        parent.SendLocalizedMessage( 1153088 ); // The power of the moon Felucca no longer strengthens your Faction gear.
                    else
                        parent.SendLocalizedMessage( 1153087 ); // The power of the moon Felucca strengthens your Faction gear.
                }
            }

            item.InvalidateProperties();
        }
開發者ID:Ravenwolfe,項目名稱:xrunuo,代碼行數:30,代碼來源:Moonbind.cs

示例14: Deserialize

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 2:
				{
					m_Level = reader.ReadInt();
					goto case 1;
				}
				case 1:
				{
					m_TargetMap = reader.ReadMap();
					break;
				}
				case 0:
				{
					m_TargetMap = Map.Trammel;
					break;
				}
			}

			if ( version < 2 )
				m_Level = GetRandomLevel();
		}
開發者ID:greeduomacro,項目名稱:annox,代碼行數:28,代碼來源:ParchmentMessage.cs

示例15: Explode

		public virtual void Explode( Mobile from, Point3D loc, Map map )
		{
			if ( Deleted || map == null )
				return;

			Consume();
			
			// Check if any other players are using this potion
			for ( int i = 0; i < m_Users.Count; i ++ )
			{
				ThrowTarget targ = m_Users[ i ].Target as ThrowTarget;

				if ( targ != null && targ.Potion == this )
					Target.Cancel( from );
			}
			
			// Add delay
			AddDelay( from );
			
			// Effects		
			Effects.PlaySound( loc, map, 0x207 );
			
			EffectCircle( loc, map, Radius );
			
			foreach ( Mobile mobile in map.GetMobilesInRange( loc, Radius ) )
			{
				if ( mobile is BaseCreature )
				{
					BaseCreature mon = (BaseCreature) mobile;
					
					mon.Pacify( from, DateTime.Now + TimeSpan.FromSeconds( 5.0 ) ); // TODO check
				}
			}
		}
開發者ID:PepeBiondi,項目名稱:runsa,代碼行數:34,代碼來源:BaseConfusionBlastPotion.cs


注:本文中的Server.Map類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。