本文整理汇总了C#中Mobile.InRange方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.InRange方法的具体用法?C# Mobile.InRange怎么用?C# Mobile.InRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mobile
的用法示例。
在下文中一共展示了Mobile.InRange方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if (! from.InRange( this.GetWorldLocation(), 1 ))
{
from.LocalOverheadMessage( MessageType.Regular, 906, 1019045 ); // I can't reach that.
}
}
示例2: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( !from.InRange( GetWorldLocation(), 2 ) || !from.InLOS( this ) )
{
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that
}
else if ( Visible && ( ItemID == 4656 || ItemID == 4702 ) && DateTime.Now >= m_NextUse )
{
Point3D p = GetWorldLocation();
if ( 1 > Utility.Random( Math.Max( Math.Abs( from.X - p.X ), Math.Abs( from.Y - p.Y ) ) ) )
{
Effects.PlaySound( from.Location, from.Map, from.GetHurtSound() );
from.PublicOverheadMessage( MessageType.Regular, from.SpeechHue, true, "Ouch!" );
SpellHelper.Damage( TimeSpan.FromSeconds( 0.5 ), from, Utility.Dice( 2, 10, 5 ) );
}
Effects.PlaySound( GetWorldLocation(), Map, 0x387 );
Timer.DelayCall( TimeSpan.FromSeconds( 0.25 ), new TimerCallback( Down1 ) );
Timer.DelayCall( TimeSpan.FromSeconds( 0.50 ), new TimerCallback( Down2 ) );
Timer.DelayCall( TimeSpan.FromSeconds( 5.00 ), new TimerCallback( BackUp ) );
m_NextUse = DateTime.Now + TimeSpan.FromSeconds( 10.0 );
}
}
示例3: Target
public void Target( Mobile m )
{
if ( !Caster.CanSee( m ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
else if ( CheckHSequence( m ) )
{
SpellHelper.Turn( Caster, m );
SpellHelper.CheckReflect( (int) this.Circle, Caster, ref m );
double damage = GetNewAosDamage( 17, 1, 5, m );
if ( !m.InRange( Caster, 2 ) )
damage *= 0.25; // 1/4 damage at > 2 tile range
else if ( !m.InRange( Caster, 1 ) )
damage *= 0.50; // 1/2 damage at 2 tile range
m.FixedParticles( 0x374A, 10, 30, 5013, 1153, 2, EffectLayer.Waist );
m.PlaySound( 0x0FC );
SpellHelper.Damage( this, m, damage, 0, 0, 100, 0, 0 );
}
FinishSequence();
}
示例4: OnTarget
protected override void OnTarget(Mobile from, object targeted)
{
if (targeted is Item)
{
var item = (Item) targeted;
if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
{
from.SendLocalizedMessage(500446); // That is too far away.
}
else if (!item.Deleted &&
(item.Dyable ||
(m_Tub.UsesRemaining >= 0 && m_Tub.Redyable && item is BaseDyeTub &&
((BaseDyeTub) item).Redyable &&
((BaseDyeTub) item).UsesRemaining >= 0)) && m_Tub.IsDyable(item) && item is RecallRune)
{
m_Tub.Dye(from, item);
}
else
{
from.SendMessage("You cannot dye that.");
}
}
else
{
from.SendMessage("You cannot dye that.");
}
}
示例5: Target
public void Target( Mobile m )
{
if ( !Caster.CanSee( m ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
else if ( CheckHSequence( m ) )
{
SpellHelper.Turn( Caster, m );
Mobile source = Caster, target = m;
SpellHelper.CheckReflect( (int)this.Circle, source, ref target );
double damage;
if (Caster.IsT2A)
{
damage = Utility.RandomMinMax(SpellDamageControllerT2A._HarmDamageMin,
SpellDamageControllerT2A._HarmDamageMax);
}
else
{
damage = Utility.RandomMinMax(SpellDamageController._HarmDamageMin,
SpellDamageController._HarmDamageMax);
}
if (CheckResisted(target))
{
if (Caster.IsT2A)
damage *= SpellDamageControllerT2A._HarmResistMultiplier;
else
damage *= SpellDamageController._HarmResistMultiplier;
target.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
}
damage *= GetDamageScalar( m );
if (!Caster.IsT2A)
{
//We get our damage numbers from non-reflect
if (!m.InRange(Caster, 2))
damage *= SpellDamageController._HarmFarDistanceMultiplier; // > 2 tile range
else if (!m.InRange(Caster, 1))
damage *= SpellDamageController._HarmFarDistanceMultiplier; // 2 tile range
}
target.FixedParticles( 0x374A, 10, 15, 5013, EffectLayer.Waist );
target.PlaySound( 0x1F1 );
SpellHelper.Damage(this, target, damage);
}
FinishSequence();
}
示例6: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
if ((from.InRange(this, 12)) && !(from.InRange(this, 1)))
{
this.Say(Strings.Dialog("comeCloser"));
return;
}
BarberCanHandle(from);
}
示例7: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
if (from.InRange(GetWorldLocation(), 1))
{
from.SendMessage("You try to examine the strange wall but the vines get in your way.");
}
else if (!from.InRange(GetWorldLocation(), 1))
{
from.SendMessage("I can't reach that.");
}
base.OnDoubleClick(from);
}
示例8: Target
public void Target(Mobile m)
{
if (!this.Caster.CanSee(m))
{
this.Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (this.CheckHSequence(m))
{
SpellHelper.Turn(this.Caster, m);
SpellHelper.CheckReflect((int)this.Circle, this.Caster, ref m);
double damage;
if (Core.AOS)
{
damage = this.GetNewAosDamage(17, 1, 5, m);
}
else
{
damage = Utility.Random(1, 15);
if (this.CheckResisted(m))
{
damage *= 0.75;
m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
}
damage *= this.GetDamageScalar(m);
}
if (!m.InRange(this.Caster, 2))
damage *= 0.25; // 1/4 damage at > 2 tile range
else if (!m.InRange(this.Caster, 1))
damage *= 0.50; // 1/2 damage at 2 tile range
if (Core.AOS)
{
m.FixedParticles(0x374A, 10, 30, 5013, 1153, 2, EffectLayer.Waist);
m.PlaySound(0x0FC);
}
else
{
m.FixedParticles(0x374A, 10, 15, 5013, EffectLayer.Waist);
m.PlaySound(0x1F1);
}
SpellHelper.Damage(this, m, damage, 0, 0, 100, 0, 0);
}
this.FinishSequence();
}
示例9: OnMovement
public override void OnMovement(Mobile from, Point3D oldLocation)
{
if (from.InRange(this, 3) && from is PlayerMobile)
{
if (!from.HasGump(typeof(PopUpGump)))
from.SendGump(new PopUpGump(Name));
}
if (!from.InRange(this, 3) && from is PlayerMobile)
{
if (from.HasGump(typeof(PopUpGump)))
from.CloseGump(typeof(PopUpGump));
}
}
示例10: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
// check the range between the player and projectiles
if ((this.Parent == null && !from.InRange(this.Location, 2)) ||
(this.RootParent is Mobile && !from.InRange(((Mobile)this.RootParent).Location, 2)) ||
(this.RootParent is Container && !from.InRange(((Container)this.RootParent).Location, 2))
)
{
from.SendLocalizedMessage(500446); // That is too far away.
return;
}
from.SendMessage(61, "Which cannon would you like to use this type of projectile?");
from.Target = new ShipWeaponTarget(this);
}
示例11: OnTargetFinish
protected override void OnTargetFinish( Mobile from )
{
if ( !m_Plant.Deleted && m_Plant.PlantStatus < PlantStatus.DecorativePlant && m_Plant.PlantStatus != PlantStatus.BowlOfDirt && from.InRange( m_Plant.GetWorldLocation(), 3 ) && m_Plant.IsUsableBy( from ) )
{
from.SendGump( new ReproductionGump( m_Plant ) );
}
}
示例12: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if (from.InRange(GetWorldLocation(), 2) && from.InLOS(this))
Roll(from);
else
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
}
示例13: OnDoubleClickSecureTrade
public override void OnDoubleClickSecureTrade( Mobile from )
{
if ( !from.InRange( GetWorldLocation(), 2 ) )
{
from.SendLocalizedMessage( 500446 ); // That is too far away.
}
else if ( m_Entries.Count == 0 )
{
from.SendLocalizedMessage( 1062381 ); // The book is empty.
}
else
{
from.SendGump( new BOBGump( (PlayerMobile)from, this ) );
SecureTradeContainer cont = GetSecureTradeCont();
if ( cont != null )
{
SecureTrade trade = cont.Trade;
if ( trade != null && trade.From.Mobile == from )
trade.To.Mobile.SendGump( new BOBGump( (PlayerMobile)(trade.To.Mobile), this ) );
else if ( trade != null && trade.To.Mobile == from )
trade.From.Mobile.SendGump( new BOBGump( (PlayerMobile)(trade.From.Mobile), this ) );
}
}
}
示例14: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
if ( from == null || !from.Alive ) return;
// lumbervalue = 100; will give 100% sucsess in picking
lumberValue = from.Skills[SkillName.Lumberjacking].Value / 5;
if ( DateTime.Now > lastpicked.AddSeconds(3) ) // 3 seconds between picking
{
lastpicked = DateTime.Now;
if ( from.InRange( this.GetWorldLocation(), 2 ) )
{
if ( lumberValue > Utility.Random( 100 ) )
{
from.Direction = from.GetDirectionTo( this );
from.Animate( 32, 5, 1, true, false, 0 ); // Bow
from.SendMessage(AgriTxt.PullRoot);
this.Delete();
from.AddToBackpack( new NightshadeUprooted() );
}
else from.SendMessage(AgriTxt.HardPull);
}
else
{
from.SendMessage(AgriTxt.HardPull);
}
}
}
示例15: Dye
public virtual bool Dye(Mobile from, DyeTub sender)
{
if (this.Deleted)
return false;
BaseHouse house = BaseHouse.FindHouseAt(this);
if (house != null && house.IsCoOwner(from))
{
if (from.InRange(this.GetWorldLocation(), 1))
{
this.Hue = sender.DyedHue;
return true;
}
else
{
from.SendLocalizedMessage(500295); // You are too far away to do that.
return false;
}
}
else
{
return false;
}
}