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


C# PlayerMobile.CanBeginAction方法代码示例

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


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

示例1: CanChange

		private static bool CanChange( PlayerMobile from, Race targetRace )
		{
			if ( from.Deleted )
				return false;

			if ( from.Race == targetRace )
				from.SendLocalizedMessage( 1111918 ); // You are already that race.
			else if ( !MondainsLegacy.CheckML( from, false ) )
				from.SendLocalizedMessage( 1073651 ); // You must have Mondain's Legacy before proceeding...
			else if ( !from.Alive )
				from.SendLocalizedMessage( 1073646 ); // Only the living may proceed...
			else if ( from.Mounted )
				from.SendLocalizedMessage( 1073647 ); // You may not continue while mounted...
			else if ( !from.CanBeginAction( typeof( PolymorphSpell ) ) || DisguiseTimers.IsDisguised( from ) || AnimalForm.UnderTransformation( from ) || !from.CanBeginAction( typeof( IncognitoSpell ) ) || from.IsBodyMod ) // TODO: Does this cover everything?
				from.SendLocalizedMessage( 1073648 ); // You may only proceed while in your original state...
			else if ( from.Spell != null && from.Spell.IsCasting )
				from.SendLocalizedMessage( 1073649 ); // One may not proceed while embracing magic...
			else if ( from.Poisoned )
				from.SendLocalizedMessage( 1073652 ); // You must be healthy to proceed...
			else if ( IsWearingEquipment( from ) )
				from.SendLocalizedMessage( 1073650 ); // To proceed you must be unburdened by equipment...
			else
				return true;

			return false;
		}
开发者ID:nathanvy,项目名称:runuo,代码行数:26,代码来源:RaceChangeGump.cs

示例2: OnVirtueAccepted

        public static void OnVirtueAccepted( PlayerMobile protector, PlayerMobile protectee )
        {
            if ( !VirtueHelper.IsSeeker( protector, VirtueName.Justice ) )
            {
                protector.SendLocalizedMessage( 1049610 ); // You must reach the first path in this virtue to invoke it.
            }
            else if ( !protector.CanBeginAction( typeof( JusticeVirtue ) ) )
            {
                protector.SendLocalizedMessage( 1049370 ); // You must wait a while before offering your protection again.
            }
            else if ( protector.JusticeProtectors.Count > 0 )
            {
                protector.SendLocalizedMessage( 1049542 ); // You cannot protect someone while being protected.
            }
            else if ( protector.Map != Map.Felucca )
            {
                protector.SendLocalizedMessage( 1049372 ); // You cannot use this ability here.
            }
            else if ( protectee.Map != Map.Felucca )
            {
                protector.SendLocalizedMessage( 1049372 ); // You cannot use this ability here.
            }
            else if ( protectee == protector || protectee.Criminal || protectee.Kills >= 5 )
            {
                protector.SendLocalizedMessage( 1049436 ); // That player cannot be protected.
            }
            else if ( protectee.JusticeProtectors.Count > 0 )
            {
                protector.SendLocalizedMessage( 1049369 ); // You cannot protect that player right now.
            }
            else
            {
                protectee.JusticeProtectors.Add( protector );

                string args = String.Format( "{0}\t{1}", protector.Name, protectee.Name );

                protectee.SendLocalizedMessage( 1049451, args ); // You are now being protected by ~1_NAME~.
                protector.SendLocalizedMessage( 1049452, args ); // You are now protecting ~2_NAME~.
            }
        }
开发者ID:Godkong,项目名称:RunUO,代码行数:40,代码来源:Justice.cs

示例3: ApplyMagicReflectEffect

		public bool ApplyMagicReflectEffect(PlayerMobile Wearer)
		{
			if (Wearer == null)
				return false;

			Spell spell = new MagicReflectSpell(Wearer,null); 
	
			if ( Wearer.MagicDamageAbsorb > 0 )
			{
				Wearer.SendMessage("The magic of this item is already protecting you.");
				return false;
			}
			else if (Wearer.Region.OnBeginSpellCast( Wearer, spell ) == false)
			{
				Wearer.SendMessage("The magic normally within this object seems absent.");
				return false;
			}	
			else if ( !Wearer.CanBeginAction( typeof( DefensiveSpell ) ) )
			{
				Wearer.SendLocalizedMessage( 1005385 ); // The spell will not adhere to you at this time.
				return false;
			}
			else
			{
				if ( Wearer.BeginAction( typeof( DefensiveSpell ) ) )
				{
					int value = (int)((Utility.Random(51) + 50) + (Utility.Random(51) + 50)); // Random value of up to 100 for magery and up to 100 for scribing - lowest though is 50 magery/50 scribing equivalent strength
					value = (int)(8 + (value/200)*7.0);//absorb from 8 to 15 "circles"

					Wearer.MagicDamageAbsorb = value;

					Wearer.FixedParticles( 0x375A, 10, 15, 5037, EffectLayer.Waist );
					Wearer.PlaySound( 0x1E9 );
					Wearer.SendMessage("You feel the magic of the item envelope you.");
					return true;
				}
				else
				{
					Wearer.SendLocalizedMessage( 1005385 ); // The spell will not adhere to you at this time.
					return false;
				}
			}
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:43,代码来源:BaseJewel.cs


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