本文整理汇总了C#中Mobile类的典型用法代码示例。如果您正苦于以下问题:C# Mobile类的具体用法?C# Mobile怎么用?C# Mobile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Mobile类属于命名空间,在下文中一共展示了Mobile类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsEnemy
public override bool IsEnemy( Mobile m )
{
if ( m.Player && m.FindItemOnLayer( Layer.Helm ) is OrcishKinMask )
return false;
return base.IsEnemy( m );
}
示例2: HasSpellMastery
public static bool HasSpellMastery(Mobile m)
{
//Publish 71 PVP Spell damage increase cap changes. If you have GM of one school of magic and no others, you are "focused" in that school of magic and have 30% sdi cap instead of 15%.
List<SkillName> schools = new List<SkillName>()
{
SkillName.Magery,
SkillName.AnimalTaming,
SkillName.Musicianship,
SkillName.Mysticism,
SkillName.Spellweaving,
SkillName.Chivalry,
SkillName.Necromancy,
SkillName.Bushido,
SkillName.Ninjitsu
};
bool spellMastery = false;
foreach (SkillName skill in schools)
{
if (m.Skills[skill].Base >= 30.0 && spellMastery)
return false;
if (m.Skills[skill].Base >= 100.0)
spellMastery = true;
}
return spellMastery;
}
示例3: OnTarget
protected override void OnTarget( Mobile from, object o )
{
if ( o is Mobile )
{
Mobile m = (Mobile)o;
Party p = Party.Get( from );
Party mp = Party.Get( m );
if ( from == m )
from.SendLocalizedMessage( 1005439 ); // You cannot add yourself to a party.
else if ( p != null && p.Leader != from )
from.SendLocalizedMessage( 1005453 ); // You may only add members to the party if you are the leader.
else if ( m.Party is Mobile )
return;
else if ( p != null && (p.Members.Count + p.Candidates.Count) >= Party.Capacity )
from.SendLocalizedMessage( 1008095 ); // You may only have 10 in your party (this includes candidates).
else if ( !m.Player && m.Body.IsHuman )
m.SayTo( from, 1005443 ); // Nay, I would rather stay here and watch a nail rust.
else if ( !m.Player )
from.SendLocalizedMessage( 1005444 ); // The creature ignores your offer.
else if ( mp != null && mp == p )
from.SendLocalizedMessage( 1005440 ); // This person is already in your party!
else if ( mp != null )
from.SendLocalizedMessage( 1005441 ); // This person is already in a party!
else
Party.Invite( from, m );
}
else
{
from.SendLocalizedMessage( 1005442 ); // You may only add living things to your party!
}
}
示例4: CanCraft
public override int CanCraft( Mobile from, BaseTool tool, Type typeItem )
{
if ( tool.Deleted || tool.UsesRemaining < 0 )
return 1044038; // You have worn out your tool!
else if ( !BaseTool.CheckAccessible( tool, from ) )
return 1044263; // The tool must be on your person to use.
if ( typeItem != null )
{
object o = Activator.CreateInstance( typeItem );
if ( o is SpellScroll )
{
SpellScroll scroll = (SpellScroll)o;
Spellbook book = Spellbook.Find( from, scroll.SpellID );
bool hasSpell = ( book != null && book.HasSpell( scroll.SpellID ) );
scroll.Delete();
return ( hasSpell ? 0 : 1042404 ); // null : You don't have that spell!
}
else if ( o is Item )
{
((Item)o).Delete();
}
}
return 0;
}
示例5: CraftInit
public override void CraftInit( Mobile from )
{
double skillValue = from.Skills[SkillName.Cartography].Value;
int dist = 64 + (int)(skillValue * 2);
SetDisplay( from.X - dist, from.Y - dist, from.X + dist, from.Y + dist, 200, 200 );
}
示例6: OnDoubleClick
//public override bool DisplayLootType{ get{ return true; } }
public override void OnDoubleClick( Mobile from ) // Override double click of the deed to call our target
{
if ( !IsChildOf( from.Backpack ) ) // Make sure its in their pack
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
else
{
this.Delete();
from.SendMessage( "The item has been placed in your backpack." );
switch ( Utility.Random( 5 ) ) //Random chance of armor
{
case 0: from.AddToBackpack( new Vicodin( ) );
break;
case 1: from.AddToBackpack( new Vicodin( ) );
break;
case 2: from.AddToBackpack( new Vicodin( ) );
break;
case 3: from.AddToBackpack( new Vicodin( ) );
break;
case 4: from.AddToBackpack( new Vicodin( ) );
break;
}
}
}
示例7: OnHit
public override void OnHit( Mobile attacker, Mobile defender, int damage )
{
if ( !Validate( attacker ) || !CheckMana( attacker, true ) )
return;
ClearCurrentAbility( attacker );
defender.PlaySound( 0x213 );
attacker.SendLocalizedMessage( 1074383 ); // Your shot sends forth a wave of psychic energy.
defender.SendLocalizedMessage( 1074384 ); // Your mind is attacked by psychic force!
int extraDamage = 10 * (int) ( attacker.Int / defender.Int );
if ( extraDamage < 10 )
extraDamage = 10;
if ( extraDamage > 20 )
extraDamage = 20;
AOS.Damage( defender, attacker, extraDamage, 100, 0, 0, 0, 0 ); // 100% Physical Damage
if ( m_EffectTable.ContainsKey( defender ) )
m_EffectTable[defender].Stop();
m_EffectTable[defender] = Timer.DelayCall( TimeSpan.FromSeconds( 8.0 ), new TimerStateCallback( Expire_Callback ), defender );
}
示例8: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( m_IsRewardItem && !Engines.VeteranRewards.RewardSystem.CheckIsUsableBy( from, this, null ) )
return;
base.OnDoubleClick( from );
}
示例9: OnSingleClick
public override void OnSingleClick(Mobile from)
{
base.OnSingleClick(from);
if (IsArcane)
LabelTo(from, 1061837, String.Format("{0}\t{1}", m_CurArcaneCharges, m_MaxArcaneCharges));
}
示例10: OnMoveOver
public override bool OnMoveOver(Mobile m)
{
if (Core.ML)
return true;
return base.OnMoveOver(m);
}
示例11: OnTarget
protected override void OnTarget( Mobile from, object targeted )
{
if ( targeted == m_Ticket )
{
from.SendLocalizedMessage( 501928 ); // You can't target the same ticket!
}
else if ( targeted is EtherealMountDeed )
{
EtherealMountDeed theirTicket = targeted as EtherealMountDeed;
Mobile them = theirTicket.m_Owner;
if ( them == null || them.Deleted )
{
from.SendLocalizedMessage( 501930 ); // That is not a valid ticket.
}
else
{
from.SendGump( new InternalGump( from, m_Ticket ) );
them.SendGump( new InternalGump( them, theirTicket ) );
}
}
else if ( targeted is Item && ((Item)targeted).ItemID == 0x14F0 )
{
from.SendLocalizedMessage( 501931 ); // You need to find another ticket marked NEW PLAYER.
}
else
{
from.SendLocalizedMessage( 501929 ); // You will need to select a ticket.
}
}
示例12: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if(IsPartOf != null)
IsPartOf.OnDoubleClick(from);
else
base.OnDoubleClick(from);
}
示例13: OnPickedInstrument
public static void OnPickedInstrument( Mobile from, BaseInstrument instrument )
{
from.RevealingAction();
from.SendLocalizedMessage( 1049525 ); // Whom do you wish to calm?
from.Target = new InternalTarget( from, instrument );
from.NextSkillTime = DateTime.Now + TimeSpan.FromHours( 6.0 );
}
示例14: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if (! from.InRange( this.GetWorldLocation(), 1 ))
{
from.LocalOverheadMessage( MessageType.Regular, 906, 1019045 ); // I can't reach that.
}
}
示例15: PlayCraftEffect
public override void PlayCraftEffect(Mobile from)
{
from.PlaySound(0x2B); // bellows
//if ( from.Body.Type == BodyType.Human && !from.Mounted )
// from.Animate( 9, 5, 1, true, false, 0 );
//new InternalTimer( from ).Start();
}