當前位置: 首頁>>代碼示例>>C#>>正文


C# PlayerMobile.Animate方法代碼示例

本文整理匯總了C#中Server.Mobiles.PlayerMobile.Animate方法的典型用法代碼示例。如果您正苦於以下問題:C# PlayerMobile.Animate方法的具體用法?C# PlayerMobile.Animate怎麽用?C# PlayerMobile.Animate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Server.Mobiles.PlayerMobile的用法示例。


在下文中一共展示了PlayerMobile.Animate方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Honor

		private static void Honor( PlayerMobile source, Mobile target )
		{
			IHonorTarget honorTarget = target as IHonorTarget;

			if ( honorTarget == null || !source.CanBeHarmful( target, true ) )
				return;

			if ( honorTarget.ReceivedHonorContext != null )
			{
				if ( honorTarget.ReceivedHonorContext.Source == source )
					return;

				if ( honorTarget.ReceivedHonorContext.CheckDistance() )
				{
					source.SendLocalizedMessage( 1063233 ); // Somebody else is honoring this opponent
					return;
				}
			}

			if ( target.Hits < target.HitsMax )
			{
				source.SendLocalizedMessage( 1063166 ); // You cannot honor this monster because it is too damaged.
				return;
			}

			if ( source.SentHonorContext != null )
				source.SentHonorContext.Cancel();

			new HonorContext( source, target );

			source.Direction = source.GetDirectionTo( target );

			if ( !source.Mounted )
				source.Animate( 32, 5, 1, true, true, 0 );

			// OSI apparently removed this message... it's nice though
			source.Say( 1063231 ); // I honor you
		}
開發者ID:greeduomacro,項目名稱:unknown-shard-1,代碼行數:38,代碼來源:Honor.cs

示例2: Honor

		private static void Honor( PlayerMobile source, Mobile target )
		{
			IHonorTarget honorTarget = target as IHonorTarget;
			GuardedRegion reg = (GuardedRegion) source.Region.GetRegion( typeof( GuardedRegion ) );
			Map map = source.Map;

			if ( honorTarget == null )
				return;

			if ( honorTarget.ReceivedHonorContext != null )
			{
				if ( honorTarget.ReceivedHonorContext.Source == source )
					return;

				if ( honorTarget.ReceivedHonorContext.CheckDistance() )
				{
					source.SendLocalizedMessage( 1063233 ); // Somebody else is honoring this opponent
					return;
				}
			}

			if ( target.Hits < target.HitsMax )
			{
				source.SendLocalizedMessage( 1063166 ); // You cannot honor this monster because it is too damaged.
				return;
			}

			BaseCreature cret = target as BaseCreature;
			if ( target.Body.IsHuman && (cret == null || (!cret.AlwaysAttackable && !cret.AlwaysMurderer)) )
			{

				if( reg == null || reg.IsDisabled() )
				{				
					//Allow honor on blue if Out of guardzone
				}
				else if ( map != null && (map.Rules & MapRules.HarmfulRestrictions) == 0 )
				{
					//Allow honor on blue if in Fel
				}
				else
				{
					source.SendLocalizedMessage( 1001018 ); // You cannot perform negative acts
					return;					//cannot honor in trammel town on blue
				}
			}

			if( Core.ML && target is PlayerMobile )
			{
				source.SendLocalizedMessage( 1075614 ); // You cannot honor other players.
				return;
			}

			if ( source.SentHonorContext != null )
				source.SentHonorContext.Cancel();

			new HonorContext( source, target );

			source.Direction = source.GetDirectionTo( target );

			if ( !source.Mounted )
				source.Animate( 32, 5, 1, true, true, 0 );

		}
開發者ID:nathanvy,項目名稱:runuo,代碼行數:63,代碼來源:Honor.cs

示例3: InternalTimer

            public InternalTimer(PlayerMobile from, int turn)
                : base(TimeSpan.FromSeconds(1.4))
            {
                if (from.Body.Type == BodyType.Human && !from.Mounted)
                    from.Animate(9, (5 - turn), 1, true, false, 0);

                m_From = from;
                m_turn = turn;
            }
開發者ID:justdanofficial,項目名稱:khaeros,代碼行數:9,代碼來源:BlacksmithingGump.cs


注:本文中的Server.Mobiles.PlayerMobile.Animate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。