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


C# Mobiles.BaseAI类代码示例

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


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

示例1: AIControlMobileTarget

		public AIControlMobileTarget( BaseAI ai, OrderType order ) : base( -1, false, TargetFlags.None )
		{
			m_List = new ArrayList();
			m_Order = order;

			AddAI( ai );
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:7,代码来源:AIControlMobileTarget.cs

示例2: AIControlMobileTarget

		public AIControlMobileTarget( BaseAI ai, OrderType order ) : base( -1, false, ( order == OrderType.Attack ? TargetFlags.Harmful : TargetFlags.None ) )
		{
			m_List = new List<BaseAI>();
			m_Order = order;

			AddAI( ai );
		}
开发者ID:Godkong,项目名称:RunUO,代码行数:7,代码来源:AIControlMobileTarget.cs

示例3: AddAI

		public void AddAI( BaseAI ai )
		{
			if ( !m_List.Contains( ai ) )
			{
				m_List.Add( ai );
			}
		}
开发者ID:xrunuo,项目名称:xrunuo,代码行数:7,代码来源:AIControlMobileTarget.cs

示例4: ResponseTimer

            public ResponseTimer(BaseCreature mobile, SpeechEventArgs p, BaseAI ai)
                : base(TimeSpan.FromSeconds(1))
            {
                e = p;
                m_Mobile = mobile;
                m_AI = ai;

                Priority = TimerPriority.OneSecond;
            }
开发者ID:Godkong,项目名称:Origins,代码行数:9,代码来源:BaseAI.cs

示例5: InteractTimer

            public InteractTimer(BaseCreature mobile, BaseAI ai, Mobile from)
                : base(TimeSpan.FromSeconds(30.0))
            {
                m_Mobile = mobile;
                m_AI = ai;
                m_From = from;

                Priority = TimerPriority.OneSecond;
            }
开发者ID:Godkong,项目名称:Origins,代码行数:9,代码来源:BaseAI.cs

示例6: InternalTimer

 public InternalTimer(BaseAI b, TimeSpan delay )
     : base(delay)
 {
     m_b = b;
      m_End = DateTime.Now + delay;
      Priority = TimerPriority.OneSecond;
 }
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:7,代码来源:BaseAI.cs

示例7: InternalEntry

			public InternalEntry(Mobile from, int number, int range, BaseCreature mobile, BaseAI ai, OrderType order)
				: base(number, range)
			{
				m_From = from;
				m_Mobile = mobile;
				m_AI = ai;
				m_Order = order;

				if (mobile.IsDeadPet &&
					(order == OrderType.Guard || order == OrderType.Attack || order == OrderType.Transfer || order == OrderType.Drop))
				{
					Enabled = false;
				}
			}
开发者ID:Crome696,项目名称:ServUO,代码行数:14,代码来源:BaseAI.cs

示例8: CombatTarget

		public CombatTarget( BaseAI ai, BaseCreature bc )
			: base( 10, false, TargetFlags.None )
		{
			m_AI = ai;
			creature = bc;
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:6,代码来源:CreatureController.cs

示例9: AddAI

 public void AddAI(BaseAI ai)
 {
     if (!this.m_List.Contains(ai))
         this.m_List.Add(ai);
 }
开发者ID:m309,项目名称:ForkUO,代码行数:5,代码来源:AIControlMobileTarget.cs

示例10: AITimer

            public AITimer( BaseAI owner )
                : base(TimeSpan.FromSeconds( Utility.RandomDouble() ), TimeSpan.FromSeconds( Math.Max( 0.0, owner.m_Mobile.CurrentSpeed ) ))
            {
                m_Owner = owner;

                if ( Delay > m_Owner.m_Mobile.ReaquireDelay )
                    Delay = m_Owner.m_Mobile.ReaquireDelay;

                if ( m_Owner.m_Mobile.CurrentSpeed > 0.5 )
                    Priority = TimerPriority.FiftyMS;
                else if ( m_Owner.m_Mobile.CurrentSpeed > 0.25 )
                    Priority = TimerPriority.TwentyFiveMS;
                else
                    Priority = TimerPriority.TenMS;
            }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:15,代码来源:BaseAI.cs

示例11: InternalEntry

 public InternalEntry(Mobile from, int number, int range, BaseCreature mobile, BaseAI ai, OrderType order)
     : base(number, range)
 {
     m_From = from;
     m_Mobile = mobile;
     m_AI = ai;
     m_Order = order;
 }
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:8,代码来源:PomiGuard.cs

示例12: OnTarget

        protected override void OnTarget( Mobile from, object target )
        {
            if( target is BaseCreature )
            {
                BaseCreature pet = (BaseCreature)target;
                m_ai = pet.AIObject;

                if( pet.Body.IsHuman )
                    from.SendMessage("The person looks at you in disgust.");
                else if( pet.ControlMaster != from )
                    from.SendMessage("That is not your pet.");
                else if( pet.Combatant != null && pet.InRange(pet.Combatant, 12) )
                    from.SendMessage("You cannot do that while your pet is fighting.");
                else if( pet.Controlled == true && pet.ControlMaster == from )
                {
                    if( Utility.Random(15) == 1 )
                    {
                        m_ai.DoMove(Direction.South);
                        m_ai.DoMove(Direction.South);
                        m_ai.DoMove(Direction.East);
                        m_ai.DoMove(Direction.South);
                        m_ai.NextMove = DateTime.Now;

                        from.SendMessage("Your pet shies away from the rope.");
                        pet.PlaySound(pet.GetAngerSound());
                    }
                    else
                    {
                        if( pet.Blessed == false )
                        {
                            pet.Blessed = true;
                            pet.CantWalk = true;
                            pet.ControlOrder = OrderType.Stay;
                            pet.Combatant = null;
                            pet.Loyalty = 85;

                            from.LocalOverheadMessage(MessageType.Regular, from.EmoteHue, false, "*attaches the rope to the animal*");
                            from.Backpack.ConsumeTotal(typeof(HitchingRope), 1);
                            from.SendMessage("Your pet has been hitched to the post.");
                        }
                    }
                }
            }
        }
开发者ID:greeduomacro,项目名称:hubroot,代码行数:44,代码来源:PostToPetTarget.cs

示例13: ChangeAIType

		public  void ChangeAIType( AIType NewAI )
		{
			if ( m_AI != null )
				m_AI.m_Timer.Stop();

			if( ForcedAI != null )
			{
				m_AI = ForcedAI;
				return;
			}

			m_AI = null;

			switch ( NewAI )
			{
				case AIType.AI_Melee:
					m_AI = new MeleeAI(this);
					break;
				case AIType.AI_Animal:
					m_AI = new AnimalAI(this);
					break;
				case AIType.AI_Berserk:
					m_AI = new BerserkAI(this);
					break;
				case AIType.AI_Archer:
					m_AI = new ArcherAI(this);
					break;
				case AIType.AI_Healer:
					m_AI = new HealerAI(this);
					break;
				case AIType.AI_Vendor:
					m_AI = new VendorAI(this);
					break;
				case AIType.AI_Mage:
					m_AI = new MageAI(this);
					break;
				case AIType.AI_Predator:
					//m_AI = new PredatorAI(this);
					m_AI = new MeleeAI(this);
					break;
				case AIType.AI_Thief:
					m_AI = new ThiefAI(this);
					break;
			}
		}
开发者ID:greeduomacro,项目名称:uotitan,代码行数:45,代码来源:BaseCreature.cs

示例14: ChangeAIType

        public virtual void ChangeAIType(AIType NewAI)
        {
            if ( m_AI != null )
                m_AI.m_Timer.Stop();

            m_AI = null;

            if ( this is BaseFactionGuard )
            {
                m_AI = new FactionGuardAI( (BaseFactionGuard) this );
                return;
            }

            switch (NewAI)
            {
                case AIType.AI_Melee:
                    m_AI = new MeleeAI(this);
                    break;
                case AIType.AI_Animal:
                    m_AI = new AnimalAI(this);
                    break;
                case AIType.AI_Berserk:
                    m_AI = new BerserkAI(this);
                    break;
                case AIType.AI_Archer:
                    m_AI = new ArcherAI(this);
                    break;
                case AIType.AI_Healer:
                    m_AI = new HealerAI(this);
                    break;
                case AIType.AI_Vendor:
                    m_AI = new VendorAI(this);
                    break;
                case AIType.AI_Mage:
                    m_AI = new MageAI(this);
                    break;
                case AIType.AI_Predator:
                    //m_AI = new PredatorAI(this);
                    m_AI = new MeleeAI(this);
                    break;
                case AIType.AI_Thief:
                    m_AI = new ThiefAI(this);
                    break;
            }
        }
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:45,代码来源:BaseCreature.cs

示例15: InitAI

		private void InitAI()
		{
			switch ( AI )
			{
				case AIType.AI_Melee:
					m_ForcedAI = new EvoMeleeAI( this, m_CanAttackPlayers );
					break;
				case AIType.AI_Berserk:
					m_ForcedAI = new EvoBerserkAI( this, m_CanAttackPlayers );
					break;
				case AIType.AI_Archer:
					m_ForcedAI = new EvoArcherAI( this, m_CanAttackPlayers );
					break;
				case AIType.AI_Mage:
					m_ForcedAI = new EvoMageAI( this, m_CanAttackPlayers );
					break;
				default:
					m_ForcedAI = null;
					break;
			}
			ChangeAIType( AI );
		}
开发者ID:greeduomacro,项目名称:dragonknights-uo,代码行数:22,代码来源:BaseEvo.cs


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