• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Mobile类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Mobile的典型用法代码示例。如果您正苦于以下问题:C# Mobile类的具体用法?C# Mobile怎么用?C# Mobile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Mobile类属于命名空间,在下文中一共展示了Mobile类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: IsEnemy

		public override bool IsEnemy( Mobile m )
		{
			if ( m.Player && m.FindItemOnLayer( Layer.Helm ) is OrcishKinMask )
				return false;

			return base.IsEnemy( m );
		}
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:7,代码来源:OrcScout.cs


示例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;
        }
开发者ID:jasegiffin,项目名称:JustUO,代码行数:27,代码来源:SpellHelper.cs


示例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!
			}
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:32,代码来源:AddPartyTarget.cs


示例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;
        }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:30,代码来源:DefInscription.cs


示例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 );
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:7,代码来源:LocalMap.cs


示例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; 
                        	} 

			 }
		}	
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:28,代码来源:Prescription+Vicodin.cs


示例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 );
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:26,代码来源:PsychicAttack.cs


示例8: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
			if ( m_IsRewardItem && !Engines.VeteranRewards.RewardSystem.CheckIsUsableBy( from, this, null ) )
				return;

			base.OnDoubleClick( from );
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:7,代码来源:LeatherDyeTub.cs


示例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));
        }
开发者ID:greeduomacro,项目名称:annox,代码行数:7,代码来源:SolaretesOfSacrifice.cs


示例10: OnMoveOver

        public override bool OnMoveOver(Mobile m)
        {
            if (Core.ML)
                return true;

            return base.OnMoveOver(m);
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:7,代码来源:BaseFactionVendor.cs


示例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.
				}
			}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:30,代码来源:EtherealMountDeed.cs


示例12: OnDoubleClick

			public override void OnDoubleClick( Mobile from )
			{
				if(IsPartOf != null)
					IsPartOf.OnDoubleClick(from);
				else
					base.OnDoubleClick(from);
			}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:7,代码来源:YardFountain.cs


示例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 );
 }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:7,代码来源:Peacemaking.cs


示例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.
			}	
		}
开发者ID:nick12344356,项目名称:The-Basement,代码行数:7,代码来源:RewardCake.cs


示例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();
 }
开发者ID:Crome696,项目名称:ServUO,代码行数:7,代码来源:DefGlassblowing.cs


示例16: SewerQuestGump

 public SewerQuestGump( Mobile owner )
     : base(50,50)
 {
     //----------------------------------------------------------------------------------------------------
     AddPage( 0 );AddImageTiled(  54, 33, 369, 400, 2624 );AddAlphaRegion( 54, 33, 369, 400 );AddImageTiled( 416, 39, 44, 389, 203 );
     //--------------------------------------Window size bar--------------------------------------------
     AddImage( 97, 49, 9005 );AddImageTiled( 58, 39, 29, 390, 10460 );AddImageTiled( 412, 37, 31, 389, 10460 );
     AddBackground(85, 30, 329, 408, 3500);
     AddLabel( 140, 60, 0x34, "Infested Sewer" );
     //----------------------/----------------------------------------------/
     AddHtml( 107, 140, 300, 230, " < BODY > " +
     "<BASEFONT COLOR=YELLOW>Hi, I'm Brent. I work for Britain's <BR>" +
     "<BASEFONT COLOR=YELLOW>sewer management department. Recently<BR>" +
     "<BASEFONT COLOR=YELLOW>radioactive slimes have infested the<BR>" +
     "<BASEFONT COLOR=YELLOW>sewers. Needless to say I havent been<BR>" +
     "<BASEFONT COLOR=YELLOW>back to work since.  If you could kill<BR>" +
     "<BASEFONT COLOR=YELLOW>a few of them off and bring me back<BR>" +
     "<BASEFONT COLOR=YELLOW>30 bottles of radioactive acid as proof<BR>" +
     "<BASEFONT COLOR=YELLOW>I will reward you. Just be cautious, you<BR>" +
     "<BASEFONT COLOR=YELLOW>wouldn't believe the weird stuff people<BR>" +
     "<BASEFONT COLOR=YELLOW>flush down the drain.<BR>" +
     "<BASEFONT COLOR=YELLOW><BR>" +
     "<BASEFONT COLOR=YELLOW><BR>" +
     "<BASEFONT COLOR=YELLOW><BR>" +
     "<BASEFONT COLOR=YELLOW><BR>" +
     "<BASEFONT COLOR=YELLOW><BR>" +
     "</BODY>", false, true);
     //----------------------/----------------------------------------------/
     AddImage( 430, 9, 10441);AddImageTiled( 40, 38, 17, 391, 9263 );AddImage( 6, 25, 10421 );AddImage( 34, 12, 10420 );AddImageTiled( 94, 25, 342, 15, 10304 );AddImageTiled( 40, 427, 415, 16, 10304 );AddImage( -10, 314, 10402 );AddImage( 56, 150, 10411 );AddImage( 155, 120, 2103 );AddImage( 136, 84, 96 );AddButton( 225, 390, 0xF7, 0xF8, 0, GumpButtonType.Reply, 0 );
 }
开发者ID:Ziden,项目名称:ServUO-EC-Test-Fork,代码行数:30,代码来源:SewerQuestGump.cs


示例17: PlayEndingEffect

        public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item)
        {
            if (toolBroken)
                from.SendLocalizedMessage(1044038); // You have worn out your tool

            if (failed)
            {
                if (lostMaterial)
                    return 1044043; // You failed to create the item, and some of your materials are lost.
                else
                    return 1044157; // You failed to create the item, but no materials were lost.
            }
            else
            {
                from.PlaySound(0x41); // glass breaking

                if (quality == 0)
                    return 502785; // You were barely able to make this item.  It's quality is below average.
                else if (makersMark && quality == 2)
                    return 1044156; // You create an exceptional quality item and affix your maker's mark.
                else if (quality == 2)
                    return 1044155; // You create an exceptional quality item.
                else
                    return 1044154; // You create the item.
            }
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:26,代码来源:DefGlassblowing.cs


示例18: OnSingleClick

        public override void OnSingleClick(Mobile from)
        {
            base.OnSingleClick(from);

            if (!String.IsNullOrEmpty(this.m_Subtext))
                this.LabelTo(from, m_Subtext);
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:7,代码来源:SubtextSign.cs


示例19: OnSwing

		public override TimeSpan OnSwing( Mobile attacker, Mobile defender ) {
			// Make sure we've been standing still for one second
			if( DateTime.Now > (attacker.LastMoveTime + TimeSpan.FromSeconds( Core.AOS ? 0.5 : 1.0 )) || (Core.AOS && WeaponAbility.GetCurrentAbility( attacker ) is MovingShot) ) {
				bool canSwing = true;

				if( Core.AOS ) {
					canSwing = (!attacker.Paralyzed && !attacker.Frozen);

					if( canSwing ) {
						Spell sp = attacker.Spell as Spell;

						canSwing = (sp == null || !sp.IsCasting || !sp.BlocksMovement);
					}
				}

				if( canSwing && attacker.HarmfulCheck( defender ) ) {
					attacker.DisruptiveAction();
					attacker.Send( new Swing( 0, attacker, defender ) );

					if( OnFired( attacker, defender ) ) {
						if( CheckHit( attacker, defender ) )
							OnHit( attacker, defender );
						else
							OnMiss( attacker, defender );
					}
				}

				return GetDelay( attacker );
			} else {
				return TimeSpan.FromSeconds( 0.25 );
			}
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:32,代码来源:BaseThrowingWeap.cs


示例20: OnDoubleClick

        public override void OnDoubleClick(Mobile from)
        {
            bool wasBurning = this.Burning;

            base.OnDoubleClick(from);

            if (!wasBurning && this.Burning)
            {
                PlayerMobile player = from as PlayerMobile;

                if (player == null)
                    return;

                QuestSystem qs = player.Quest;

                if (qs != null && qs is HaochisTrialsQuest)
                {
                    QuestObjective obj = qs.FindObjective(typeof(SixthTrialIntroObjective));

                    if (obj != null && !obj.Completed)
                        obj.Complete();

                    this.SendLocalizedMessageTo(from, 1063251); // You light a candle in honor.
                }
            }
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:26,代码来源:HonorCandle.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# MobileServiceAuthenticationProvider类代码示例发布时间:2022-05-24
下一篇:
C# MlkBiCgStab类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap