当前位置: 首页>>代码示例>>C#>>正文


C# PlayerMobile.GetMobilesInRange方法代码示例

本文整理汇总了C#中Server.Mobiles.PlayerMobile.GetMobilesInRange方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerMobile.GetMobilesInRange方法的具体用法?C# PlayerMobile.GetMobilesInRange怎么用?C# PlayerMobile.GetMobilesInRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Server.Mobiles.PlayerMobile的用法示例。


在下文中一共展示了PlayerMobile.GetMobilesInRange方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BonusAction

		public virtual void BonusAction( PlayerMobile player, Mobile attacker )
		{
			IPooledEnumerable eable = player.GetMobilesInRange( 16 );
			ArrayList list = new ArrayList();

			foreach( Mobile m in eable )
			{
				if( m.Player || this == m || !this.CanBeHarmful( m ) )
					continue;

				list.Add( m );
			}
			
			for( int i = 0; i < list.Count; i++ )
			{
				Mobile m = (Mobile)list[i];
				
				int dmg = i * Utility.RandomMinMax( 10, 25 );
				
				m.Damage( dmg, this );
				
				if( i >= list.Count || i == (list.Count - 1) )
					continue;
				else if( i == 0 )
					Effects.SendMovingEffect( this, m, 0x36F4, 5, 10, false, true, 1154, 0 );
				else
					Effects.SendMovingEffect( m, ((Mobile)list[i + 1]), 0x36F4, 5, 10, false, true, 1154, 0 );
			}
			
			eable.Free();
			list.Clear();
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:32,代码来源:SilverDragon.cs

示例2: BroadcastBite

 private static void BroadcastBite( PlayerMobile pm )
 {
     foreach ( Mobile m in pm.GetMobilesInRange( 8 ) )
     {
         if ( m is PlayerMobile && pm != m )
         {
             m.SendMessage( pm.Name + " gets savagely mauled by a zombie." );
         }
     }
 }
开发者ID:jsrn,项目名称:ZUOmbies,代码行数:10,代码来源:ZombieInfection.cs

示例3: CanPlayerLoot

		public static bool CanPlayerLoot(PlayerMobile player)
		{
			if ( player.AccessLevel > AccessLevel.Player )
				return true;
			if ( !player.Alive )
			{
				player.PlaySound( 1069 ); //hey
				player.SendMessage( "You are dead!" );
				return false;
			}
			if ( player.Blessed )
			{
				player.PlaySound( 1069 ); //hey
				player.SendMessage( "You can't loot while you are invulnerable!");
				return false;
			}
			foreach ( Mobile other in player.GetMobilesInRange( 5 ) )
			{
				if ( ! ( other is PlayerMobile ) )
					continue;
				if ( player != other && !other.Hidden && other.AccessLevel == AccessLevel.Player )
				{
					player.PlaySound(1069); //hey
					player.SendMessage("You are too close to another player to do that!");
					return false; //ignore self, staff and hidden
				}
			}
			return true;
		}
开发者ID:Jascen,项目名称:UOSmart,代码行数:29,代码来源:MasterLooterUtils.cs

示例4: PetNoto

        public void PetNoto(PlayerMobile master)
        {
        	if ( master.Mounted )
        	{
        		if ( master.Mount is BaseCreature )
        		{
        			BaseCreature mount = (BaseCreature)master.Mount;
        			mount.Delta(MobileDelta.Noto);
        			mount.InvalidateProperties();
        		}
        	}
        
        	foreach ( Mobile m in master.GetMobilesInRange( 50 ) )
			{
				if ( m is BaseCreature )
				{
					BaseCreature pet = (BaseCreature)m;

					if ( pet.Controlled && pet.ControlMaster == master )
					{
						pet.Delta(MobileDelta.Noto);
        				pet.InvalidateProperties();
					}
				}
			}
        }
开发者ID:nick12344356,项目名称:The-Basement,代码行数:26,代码来源:FieldController.cs

示例5: ResurrectPets

        public void ResurrectPets(PlayerMobile master)
        {
            if ( master.Mounted )
        	{
        		if ( master.Mount is BaseCreature )
        		{
        			BaseCreature mount = (BaseCreature)master.Mount;
        			
        			mount.Hits = mount.HitsMax;
        			mount.Stam = mount.StamMax;
        			mount.Mana = mount.ManaMax;
        			mount.Combatant = null;
            		mount.Aggressed.Clear();
            		mount.Aggressors.Clear();
           	 		mount.Criminal = false;
        		}
        	}
        
        	foreach ( Mobile m in master.GetMobilesInRange( 50 ) )
			{
				if ( m is BaseCreature )
				{
					BaseCreature pet = (BaseCreature)m;

					if ( pet.Controlled && pet.ControlMaster == master )
					{
           			 	if (pet.IsDeadPet)
                			pet.ResurrectPet();

            			pet.Hits = pet.HitsMax;
            			pet.Stam = pet.StamMax;
            			pet.Mana = pet.ManaMax;

            			pet.Combatant = null;
            			pet.Aggressed.Clear();
            			pet.Aggressors.Clear();
            			pet.Criminal = false;
					}
				}
			}
        }
开发者ID:nick12344356,项目名称:The-Basement,代码行数:41,代码来源:FieldController.cs

示例6: FightingBackToBack

        public static void FightingBackToBack( PlayerMobile pm, bool movingaway )
        {
            ArrayList list = new ArrayList();
            ArrayList allies = new ArrayList();
            ArrayList leavelist = new ArrayList();

            if( pm.Feats.GetFeatLevel(FeatList.BackToBack) > 0 )
            {
                if( pm.Warmode && !pm.Mounted )
                {
                    foreach( Mobile m in pm.GetMobilesInRange( 2 ) )
                        list.Add( m );

                    for( int i = 0; i < list.Count; ++i )
                    {
                        PlayerMobile m = (Mobile)list[i] as PlayerMobile;
                        Mobile x = m as Mobile;
                        Mobile y = pm as Mobile;

                        if( m is PlayerMobile && m != pm && m.Warmode && !m.Mounted )
                        {
                            if( m == null || m.Deleted || m.Map != pm.Map || !m.Alive || !pm.CanSee( m ) || m.Feats.GetFeatLevel(FeatList.BackToBack) < 1 || !pm.AllyList.Contains( x ) || !m.AllyList.Contains( y ) )
                                continue;

                            if( pm.InLOS( m ) )
                                allies.Add( m );
                        }
                    }

                    if( allies.Count > 0 )
                    {
                        for( int i = 0; i < allies.Count; ++i )
                        {
                            PlayerMobile m = (Mobile)allies[i] as PlayerMobile;

                            if( !m.BackToBack )
                            {
                                BackToBackBonus( m, true );
                            }

                            if( !pm.BackToBack )
                            {
                                BackToBackBonus( pm, true );
                            }
                        }
                    }

                    else
                    {
                        if( pm.BackToBack )
                        {
                            BackToBackBonus( pm, false );
                        }

                        if( !movingaway )
                        {
                            foreach( Mobile mob in pm.GetMobilesInRange( 3 ) )
                                leavelist.Add( mob );

                            for( int i = 0; i < leavelist.Count; ++i )
                            {
                                PlayerMobile m = (Mobile)leavelist[i] as PlayerMobile;

                                if( m != pm && m is PlayerMobile )
                                {
                                    FightingBackToBack( m, true );
                                }
                            }
                        }
                    }
                }

                else
                {
                    if( pm.BackToBack )
                    {
                        BackToBackBonus( pm, false );
                    }
                }
            }
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:81,代码来源:PlayerMobile.cs


注:本文中的Server.Mobiles.PlayerMobile.GetMobilesInRange方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。