本文整理汇总了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();
}
示例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." );
}
}
}
示例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;
}
示例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();
}
}
}
}
示例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;
}
}
}
}
示例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 );
}
}
}
}