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


C# Mobile.BeginTarget方法代码示例

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


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

示例1: OnTarget

		public void OnTarget( Mobile from, object targeted, object state )
		{
			object[] states = (object[])state;
			BaseCommand command = (BaseCommand)states[0];
			string[] args = (string[])states[1];

			if ( !BaseCommand.IsAccessible( from, targeted ) )
			{
				from.SendMessage( "That is not accessible." );
				from.BeginTarget( -1, command.ObjectTypes == ObjectTypes.All, TargetFlags.None, new TargetStateCallback( OnTarget ), new object[]{ command, args } );
				return;
			}

			switch ( command.ObjectTypes )
			{
				case ObjectTypes.Both:
				{
					if ( !(targeted is Item) && !(targeted is Mobile) )
					{
						from.SendMessage( "This command does not work on that." );
						return;
					}

					break;
				}
				case ObjectTypes.Items:
				{
					if ( !(targeted is Item) )
					{
						from.SendMessage( "This command only works on items." );
						return;
					}

					break;
				}
				case ObjectTypes.Mobiles:
				{
					if ( !(targeted is Mobile) )
					{
						from.SendMessage( "This command only works on mobiles." );
						return;
					}

					break;
				}
			}

			RunCommand( from, targeted, command, args );

			from.BeginTarget( -1, command.ObjectTypes == ObjectTypes.All, TargetFlags.None, new TargetStateCallback( OnTarget ), new object[]{ command, args } );
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:51,代码来源:MultiCommandImplementor.cs

示例2: Link_OnFirstTarget

		private static void Link_OnFirstTarget( Mobile from, object targeted )
		{
			BaseDoor door = targeted as BaseDoor;

			if ( door == null )
			{
				from.BeginTarget( -1, false, TargetFlags.None, new TargetCallback( Link_OnFirstTarget ) );
				from.SendMessage( "That is not a door. Try again." );
			}
			else
			{
				from.BeginTarget( -1, false, TargetFlags.None, new TargetStateCallback( Link_OnSecondTarget ), door );
				from.SendMessage( "Target the second door to link." );
			}
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:15,代码来源:BaseDoor.cs

示例3: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
			if ( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
				return;
			}

			if ( Core.AOS && (from.Paralyzed || from.Frozen || (from.Spell != null && from.Spell.IsCasting)) )
			{
				//to prevent exploiting for pvp
				from.SendLocalizedMessage( 1075857 ); // You can not use that while paralyzed.
				return;
			} 

			if ( m_Timer == null )
			{
				m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 1 ), TimeSpan.FromSeconds( 1 ), new TimerCallback( OnFirebombTimerTick ) );
				m_LitBy = from;
				from.SendLocalizedMessage( 1060581 ); //You light the firebomb! Throw it now!
			}
			else
				from.SendLocalizedMessage( 1060582 ); //You've already lit it! Better throw it now!

			from.BeginTarget( 12, true, TargetFlags.None, new TargetCallback( OnFirebombTarget ) );
		}
开发者ID:PepeBiondi,项目名称:runsa,代码行数:26,代码来源:Firebomb.cs

示例4: OnDoubleClick

 public override void OnDoubleClick(Mobile from)
 {
     if (!IsChildOf(from.Backpack))
     {
         from.SendMessage("You must have the Retouching Tool in your backpack!");
     }
     from.BeginTarget(2, false, TargetFlags.None, new TargetCallback(OnTarget));
 }
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:8,代码来源:[ServUO.com]-Retouching+Tool.cs

示例5: OnDoubleClick

 public override void OnDoubleClick(Mobile from)
 {
     if (IsChildOf(from.Backpack))
     {
         from.SendMessage("What would you like to scour?");
         from.BeginTarget(-1, false, Server.Targeting.TargetFlags.None, new TargetCallback(OnTarget));
     }
 }
开发者ID:Crome696,项目名称:ServUO,代码行数:8,代码来源:ScouringToxin.cs

示例6: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
            if (from.Mounted && !TrapHelper.CanWorkMounted)
            {
                from.SendMessage( "You cannot deploy a Lobster Trap while mounted." );
                return;
            }

            from.BeginTarget(-1, true, TargetFlags.None, new TargetCallback(OnTarget));
		}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:10,代码来源:Lobstertraps2.cs

示例7: OnDoubleClick

		public override void OnDoubleClick(Mobile from)
		{
			if (from == null || from.Backpack == null)
				return;

			if (!IsChildOf(from.Backpack))
				from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
			else
				from.BeginTarget(1, false, TargetFlags.None, new TargetCallback(CellKey_OnTarget));
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:10,代码来源:CellKey.cs

示例8: OnDoubleClick

 public override void OnDoubleClick(Mobile from)
 {
     if (from.EquipItem(this) || IsChildOf(from))
     {
         from.PlaySound(0x166);
         from.PublicOverheadMessage(MessageType.Emote, 33, true, "*The Daemon claws demand a soul*");
         from.BeginTarget(-1, true, TargetFlags.None, OnTarget);
     }
     else
         from.SendAsciiMessage("You must equip the claws to use them");
 }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:11,代码来源:DaemonClaws.cs

示例9: OnDoubleClick

        public override void OnDoubleClick(Mobile from)
        {
            if (!from.InRange(GetWorldLocation(), 2) || !from.InLOS(this))
            {
                from.SendLocalizedMessage(501816);
                return;
            }

            from.SendMessage("Dans quoi souhaitez-vous l'enfoncer?");
            from.BeginTarget(1, false, TargetFlags.Harmful, new TargetCallback(OnTarget));
        }
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:11,代码来源:RustyNails.cs

示例10: OnDoubleClick

  public override void OnDoubleClick(Mobile from)
 {
     if (from.Karma > -2500)
     {
         base.OnDoubleClick(from);
         return;
     }
     
     from.SendMessage("Vous seriez assez méchant pour en faire une décoration!");
     from.BeginTarget(2, false, TargetFlags.None, new TargetCallback(OnTarget));
 }
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:11,代码来源:Skull.cs

示例11: OnDoubleClick

        public override void OnDoubleClick(Mobile from)
        {
            if (m_Harvested)
            {
                from.SendMessage("Vous ne décelez rien sous ces écailles");
                return;
            }

            from.SendMessage("Vous dénotez certains gravats sur les écailles");
            from.SendMessage("Peut-être qu'un liquide ennemi pourrait les faire partir?");
            from.BeginTarget(2, false, TargetFlags.None, new TargetCallback(OnTarget));
        }
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:12,代码来源:Scales.cs

示例12: OnDoubleClick

 public override void OnDoubleClick(Mobile from)
 {
     if (IsChildOf(from.Backpack))
     {
         from.BeginTarget(2, false, TargetFlags.Beneficial, new TargetCallback(OnTarget));
         from.SendMessage("Who would you like to resurrect?");
     }
     else
     {
         from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
     }
 }
开发者ID:greeduomacro,项目名称:last-wish,代码行数:12,代码来源:ScrollOfResurrection.cs

示例13: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
			if ( IsChildOf( from.Backpack ) )
			{
				from.BeginTarget( 6, false, TargetFlags.None, new TargetCallback( OnTarget ) );
				from.SendLocalizedMessage( 1053024 ); // Select the swamp dragon you wish to place the barding on.
			}
			else
			{
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
			}
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:12,代码来源:DragonBardingDeed.cs

示例14: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
			if ( IsChildOf( from.Backpack ) )
			{
				from.BeginTarget( 3, false, TargetFlags.None, new TargetCallback( OnTarget ) );
				from.SendMessage( "Select a Dawn's music box to add this gears to." );
			}
			else
			{
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
			}
		}
开发者ID:PepeBiondi,项目名称:runsa,代码行数:12,代码来源:MusicBoxGears.cs

示例15: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
			if ( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
			}
			else
			{
				from.BeginTarget( 2, false, TargetFlags.None, new TargetCallback( OnTarget ) );
				from.SendMessage( "What do you wish to use the gem on?" );
			}
		}
开发者ID:Grimoric,项目名称:RunUO.T2A,代码行数:12,代码来源:ArcaneGem.cs


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